3 Commits
Author SHA1 Message Date
huncode 97f34a0b54 Record verified limited production delivery 2026-10-27 16:05:45 +03:00
huncode c0dcb64b1d Freeze verified implemented export for limited publication
Production container deploy / production (push) Successful in 1m32s
2026-10-27 16:01:22 +03:00
huncode a12eefa1de Deploy implemented Videoreg interface and persistent theme cycle 2026-10-27 15:49:46 +03:00
119 changed files with 68659 additions and 2961 deletions

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ server {
if ($videoreg_legacy != "") { return 308 $videoreg_legacy; }
add_header X-Content-Type-Options nosniff always;
add_header Referrer-Policy strict-origin-when-cross-origin always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' https://mc.yandex.ru https://yastatic.net; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://mc.yandex.ru; font-src 'self'; connect-src 'self' https://mc.yandex.ru; frame-src 'self' blob: https://mc.yandex.ru; object-src 'none'; base-uri 'self'; frame-ancestors 'self'" always;
location /api/ { return 404; }
location ~ /showcase/?$ { return 404; }
location /_next/static/ { expires 1y; add_header Cache-Control "public, immutable"; }
+11
View File
@@ -9,6 +9,11 @@ import re
ROOT = Path(__file__).resolve().parents[1]
OUT = ROOT / 'web-front/out'
CSP_MATCH = re.search(r'add_header Content-Security-Policy "([^"]+)"', (ROOT / 'deploy/nginx.conf').read_text())
if not CSP_MATCH:
raise RuntimeError('Preview requires the actual deployment CSP')
CONTENT_SECURITY_POLICY = CSP_MATCH.group(1)
def resolve_public(root: Path, request_path: str):
@@ -37,6 +42,12 @@ def legacy_destination(request_path: str):
class Handler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Content-Security-Policy', CONTENT_SECURITY_POLICY)
self.send_header('X-Content-Type-Options', 'nosniff')
self.send_header('Referrer-Policy', 'strict-origin-when-cross-origin')
super().end_headers()
def __init__(self, *args, **kwargs):
super().__init__(*args, directory=str(OUT), **kwargs)
Whitespace-only changes.
File diff suppressed because it is too large. Load diff
+425
View File
@@ -0,0 +1,425 @@
{
"scope": "Active technical-library FSD graph; inactive legacy catalog shared->entities debt preserved, no runtime cycle inferred",
"activeSourceFiles": 58,
"FSDModules": 52,
"edges": [
{
"from": "fsd/entities/article/index.ts",
"to": "fsd/entities/article/model.ts",
"import": "./model"
},
{
"from": "fsd/entities/article/index.ts",
"to": "fsd/entities/article/model.ts",
"import": "./model"
},
{
"from": "fsd/entities/article/model.ts",
"to": "content/v2-articles.json",
"import": "@/content/v2-articles.json"
},
{
"from": "fsd/entities/article/model.ts",
"to": "content/v2-community.json",
"import": "@/content/v2-community.json"
},
{
"from": "fsd/entities/article/model.ts",
"to": "content/v2-link-approvals.json",
"import": "@/content/v2-link-approvals.json"
},
{
"from": "fsd/features/analytics/index.tsx",
"to": "fsd/shared/config/index.ts",
"import": "@/fsd/shared/config"
},
{
"from": "fsd/features/frame-gallery/index.ts",
"to": "fsd/features/frame-gallery/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/features/frame-gallery/ui.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/features/library-search/index.ts",
"to": "fsd/features/library-search/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/features/library-search/ui.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/features/library-search/ui.tsx",
"to": "fsd/shared/config/index.ts",
"import": "@/fsd/shared/config"
},
{
"from": "fsd/features/page-preview/index.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/features/recording-estimate/index.ts",
"to": "fsd/features/recording-estimate/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/features/recording-estimate/ui.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/features/theme-choice/index.tsx",
"to": "fsd/shared/lib/index.ts",
"import": "@/fsd/shared/lib"
},
{
"from": "fsd/pages/about/index.ts",
"to": "fsd/pages/about/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/pages/article/index.ts",
"to": "fsd/pages/article/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/pages/article/ui.tsx",
"to": "fsd/widgets/article-reader/index.ts",
"import": "@/fsd/widgets/article-reader"
},
{
"from": "fsd/pages/article/ui.tsx",
"to": "fsd/entities/article/index.ts",
"import": "@/fsd/entities/article"
},
{
"from": "fsd/pages/community/index.ts",
"to": "fsd/pages/community/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/pages/community/ui.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/pages/community/ui.tsx",
"to": "fsd/entities/article/index.ts",
"import": "@/fsd/entities/article"
},
{
"from": "fsd/pages/home/index.ts",
"to": "fsd/pages/home/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/pages/home/ui.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/pages/home/ui.tsx",
"to": "fsd/entities/article/index.ts",
"import": "@/fsd/entities/article"
},
{
"from": "fsd/pages/library/index.ts",
"to": "fsd/pages/library/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/pages/library/ui.tsx",
"to": "fsd/entities/article/index.ts",
"import": "@/fsd/entities/article"
},
{
"from": "fsd/pages/library/ui.tsx",
"to": "fsd/features/library-search/index.ts",
"import": "@/fsd/features/library-search"
},
{
"from": "fsd/pages/not-found/index.ts",
"to": "fsd/pages/not-found/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/pages/not-found/ui.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/pages/recording-tool/index.ts",
"to": "fsd/pages/recording-tool/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/pages/recording-tool/ui.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/pages/recording-tool/ui.tsx",
"to": "fsd/features/recording-estimate/index.ts",
"import": "@/fsd/features/recording-estimate"
},
{
"from": "fsd/pages/services/index.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/pages/ui-kit/index.tsx",
"to": "fsd/entities/article/index.ts",
"import": "@/fsd/entities/article"
},
{
"from": "fsd/pages/ui-kit/index.tsx",
"to": "fsd/features/library-search/index.ts",
"import": "@/fsd/features/library-search"
},
{
"from": "fsd/pages/ui-kit/index.tsx",
"to": "fsd/features/recording-estimate/index.ts",
"import": "@/fsd/features/recording-estimate"
},
{
"from": "fsd/pages/ui-kit/index.tsx",
"to": "fsd/features/theme-choice/index.tsx",
"import": "@/fsd/features/theme-choice"
},
{
"from": "fsd/pages/ui-kit/index.tsx",
"to": "fsd/features/page-preview/index.tsx",
"import": "@/fsd/features/page-preview"
},
{
"from": "fsd/pages/ui-kit/index.tsx",
"to": "fsd/widgets/article-reader/index.ts",
"import": "@/fsd/widgets/article-reader"
},
{
"from": "fsd/pages/ui-kit/index.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/pages/ui-kit/index.tsx",
"to": "fsd/shared/config/index.ts",
"import": "@/fsd/shared/config"
},
{
"from": "fsd/pages/ui-kit/index.tsx",
"to": "fsd/pages/ui-kit/reference.ts",
"import": "./reference"
},
{
"from": "fsd/shared/config/index.ts",
"to": "fsd/shared/config/analytics.ts",
"import": "./analytics"
},
{
"from": "fsd/shared/config/index.ts",
"to": "fsd/shared/config/design-tokens.json",
"import": "./design-tokens.json"
},
{
"from": "fsd/shared/lib/index.ts",
"to": "fsd/shared/lib/theme.ts",
"import": "./theme"
},
{
"from": "fsd/widgets/article-reader/index.ts",
"to": "fsd/widgets/article-reader/ui.tsx",
"import": "./ui"
},
{
"from": "fsd/widgets/article-reader/index.ts",
"to": "fsd/widgets/article-reader/parts.tsx",
"import": "./parts"
},
{
"from": "fsd/widgets/article-reader/parts.tsx",
"to": "fsd/features/frame-gallery/index.ts",
"import": "@/fsd/features/frame-gallery"
},
{
"from": "fsd/widgets/article-reader/parts.tsx",
"to": "fsd/entities/article/index.ts",
"import": "@/fsd/entities/article"
},
{
"from": "fsd/widgets/article-reader/parts.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/widgets/article-reader/ui.tsx",
"to": "fsd/entities/article/index.ts",
"import": "@/fsd/entities/article"
},
{
"from": "fsd/widgets/article-reader/ui.tsx",
"to": "fsd/widgets/article-reader/parts.tsx",
"import": "./parts"
},
{
"from": "fsd/widgets/site-shell/index.tsx",
"to": "fsd/shared/ui/index.tsx",
"import": "@/fsd/shared/ui"
},
{
"from": "fsd/widgets/site-shell/index.tsx",
"to": "fsd/features/analytics/index.tsx",
"import": "@/fsd/features/analytics"
},
{
"from": "fsd/widgets/site-shell/index.tsx",
"to": "fsd/features/theme-choice/index.tsx",
"import": "@/fsd/features/theme-choice"
},
{
"from": "app/[...slug]/page.tsx",
"to": "fsd/entities/article/index.ts",
"import": "@/fsd/entities/article"
},
{
"from": "app/[...slug]/page.tsx",
"to": "fsd/pages/article/index.ts",
"import": "@/fsd/pages/article"
},
{
"from": "app/about/page.tsx",
"to": "fsd/pages/about/index.ts",
"import": "@/fsd/pages/about"
},
{
"from": "app/community/page.tsx",
"to": "fsd/pages/community/index.ts",
"import": "@/fsd/pages/community"
},
{
"from": "app/health/ready/route.ts",
"to": "fsd/entities/article/index.ts",
"import": "@/fsd/entities/article"
},
{
"from": "app/layout.tsx",
"to": "fsd/widgets/site-shell/index.tsx",
"import": "@/fsd/widgets/site-shell"
},
{
"from": "app/layout.tsx",
"to": "fsd/shared/styles/tokens.css",
"import": "@/fsd/shared/styles/tokens.css"
},
{
"from": "app/layout.tsx",
"to": "fsd/shared/styles/library.css",
"import": "@/fsd/shared/styles/library.css"
},
{
"from": "app/library/Search.tsx",
"to": "fsd/features/library-search/index.ts",
"import": "@/fsd/features/library-search"
},
{
"from": "app/library/page.tsx",
"to": "fsd/pages/library/index.ts",
"import": "@/fsd/pages/library"
},
{
"from": "app/not-found.tsx",
"to": "fsd/pages/not-found/index.ts",
"import": "@/fsd/pages/not-found"
},
{
"from": "app/page.tsx",
"to": "fsd/pages/home/index.ts",
"import": "@/fsd/pages/home"
},
{
"from": "app/privacy/page.tsx",
"to": "fsd/pages/services/index.tsx",
"import": "@/fsd/pages/services"
},
{
"from": "app/sources/page.tsx",
"to": "fsd/pages/services/index.tsx",
"import": "@/fsd/pages/services"
},
{
"from": "app/tools/recording-time/Calculator.tsx",
"to": "fsd/features/recording-estimate/index.ts",
"import": "@/fsd/features/recording-estimate"
},
{
"from": "app/tools/recording-time/page.tsx",
"to": "fsd/pages/recording-tool/index.ts",
"import": "@/fsd/pages/recording-tool"
},
{
"from": "app/ui-kit/page.tsx",
"to": "fsd/pages/ui-kit/index.tsx",
"import": "@/fsd/pages/ui-kit"
}
],
"sharedComponentRealConsumers": {
"Button": [
"fsd/features/frame-gallery/ui.tsx",
"fsd/features/library-search/ui.tsx"
],
"Input": [
"fsd/features/library-search/ui.tsx",
"fsd/features/recording-estimate/ui.tsx"
],
"Select": [
"fsd/features/library-search/ui.tsx",
"fsd/features/page-preview/index.tsx"
],
"ContentCard": [
"fsd/features/library-search/ui.tsx",
"fsd/pages/community/ui.tsx",
"fsd/pages/home/ui.tsx"
],
"StateMessage": [
"fsd/features/library-search/ui.tsx",
"fsd/pages/not-found/ui.tsx"
],
"Field": [
"fsd/features/recording-estimate/ui.tsx"
],
"ActionLink": [
"fsd/pages/home/ui.tsx",
"fsd/pages/not-found/ui.tsx"
],
"ImageFigure": [
"fsd/pages/home/ui.tsx",
"fsd/widgets/article-reader/parts.tsx"
],
"Notice": [
"fsd/pages/home/ui.tsx",
"fsd/widgets/article-reader/parts.tsx"
],
"CodeBlock": [
"fsd/pages/recording-tool/ui.tsx",
"fsd/widgets/article-reader/parts.tsx"
],
"ResourceLink": [
"fsd/pages/services/index.tsx",
"fsd/widgets/article-reader/parts.tsx"
],
"DataTable": [
"fsd/widgets/article-reader/parts.tsx"
],
"Brand": [
"fsd/widgets/site-shell/index.tsx"
]
},
"errors": []
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,49 @@
### Result
{"base":"http://127.0.0.1:59940","viewport":{"width":360,"height":800},"checks":[{"name":"theme Enter light","passed":true},{"name":"theme Space dark","passed":true},{"name":"theme reload persists dark","passed":true},{"name":"theme cycles to system","passed":true},{"name":"system follows dark","passed":true},{"name":"system follows light","passed":true},{"name":"full body search GPS","passed":true,"actual":15},{"name":"code block indexed","passed":true},{"name":"link anchor indexed","passed":true},{"name":"unknown search empty","passed":true,"actual":"Найдено материалов: 0"},{"name":"reset all articles","passed":true,"actual":28},{"name":"category filter","passed":true,"actual":{"category":"Устройство","kinds":["Устройство · 2014"]}},{"name":"keyboard search reset","passed":true,"actual":"<button type=\"button\" class=\"ui-button\">Сбросить</button>"},{"name":"JPEG known result","passed":true,"actual":"0 ч 16 мин 40 с"},{"name":"fractional cameras rejected","passed":true,"actual":"Проверьте значения"},{"name":"empty capacity rejected","passed":true},{"name":"stream known result","passed":true,"actual":"6 ч 24 мин 0 с"},{"name":"full reserve rejected","passed":true},{"name":"gallery expands actual recovered frames","passed":true,"actual":{"before":6,"after":30}},{"name":"real404","passed":true,"actual":404},{"name":"no browser runtime errors","passed":true,"actual":[]}],"errors":[]}
### Ran Playwright code
```js
await (async page => {
const base='http://127.0.0.1:59940';
const errors=[];page.on('pageerror', e=>errors.push(e.message));
const checks=[];
function check(name,ok,actual){checks.push({name,passed:!!ok,actual});if(!ok) throw new Error(name+': '+JSON.stringify(actual));}
await page.goto(base+'/library');
await page.evaluate(()=>localStorage.clear());await page.reload();
const theme=page.locator('header .theme-cycle');
await theme.press('Enter');check('theme Enter light',(await theme.getAttribute('aria-label')).includes('светлая'));
await theme.press('Space');check('theme Space dark',(await theme.getAttribute('aria-label')).includes('тёмная'));
await page.reload();check('theme reload persists dark',(await theme.getAttribute('aria-label')).includes('тёмная'));
await theme.click();check('theme cycles to system',(await theme.getAttribute('aria-label')).includes('системная'));
await page.emulateMedia({colorScheme:'dark'});await page.waitForFunction(()=>document.documentElement.dataset.theme==='dark');check('system follows dark',await page.locator('html').getAttribute('data-theme')==='dark');
await page.emulateMedia({colorScheme:'light'});await page.waitForFunction(()=>document.documentElement.dataset.theme==='light');check('system follows light',await page.locator('html').getAttribute('data-theme')==='light');
await page.setViewportSize({width:360,height:800});
await page.goto(base+'/library');
await page.locator('#library-query').fill('GPS');
let count=await page.locator('.search-results>a').count();check('full body search GPS',count>0,count);
await page.locator('#library-query').fill('5 кадров/с × (10 с до + 10 с после) = 100 кадров');check('code block indexed',await page.locator('.search-results a[href="/system"]').count()===1);
await page.locator('#library-query').fill('Подключение СВК-007 — ролик СВК-Лаб (YouTube)');check('link anchor indexed',await page.locator('.search-results a[href="/demo.shtml"]').count()===1);
await page.locator('#library-query').fill('невозможныйзапрос98765');check('unknown search empty',await page.locator('.empty').isVisible(),await page.locator('.result-count').innerText());
await page.getByRole('button',{name:'Показать все материалы'}).click();count=await page.locator('.search-results>a').count();check('reset all articles',count>=27,count);
const category=await page.locator('#library-category option').nth(1).textContent();await page.locator('#library-category').selectOption({label:category});const kinds=await page.locator('.search-kind').allTextContents();check('category filter',kinds.length>0&&kinds.every(k=>k.includes(category)),{category,kinds});
await page.getByRole('button',{name:'Сбросить',exact:true}).click();
await page.locator('#library-query').focus();await page.keyboard.press('Tab');check('keyboard search reset',await page.evaluate(()=>document.activeElement?.textContent?.trim()==='Сбросить'),await page.evaluate(()=>document.activeElement?.outerHTML));
await page.goto(base+'/tools/recording-time');
await page.getByLabel('Ёмкость носителя, ГБ').fill('1');await page.getByLabel('Средний размер одного JPEG, КБ').fill('100');await page.getByLabel('Кадров/с на камеру').fill('5');await page.getByLabel('Число камер').fill('2');await page.getByLabel('Резерв места, %').fill('0');
let result=await page.locator('.time-result strong').innerText();check('JPEG known result',result==='0 ч 16 мин 40 с',result);
await page.getByLabel('Число камер').fill('1.5');result=await page.locator('.time-result strong').innerText();check('fractional cameras rejected',result==='Проверьте значения',result);
await page.getByLabel('Число камер').fill('2');await page.getByLabel('Ёмкость носителя, ГБ').fill('');check('empty capacity rejected',(await page.locator('.time-result strong').innerText())==='Проверьте значения');
await page.getByLabel('Видеопоток',{exact:true}).check();await page.getByLabel('Ёмкость носителя, ГБ').fill('128');await page.getByLabel('Суммарный битрейт, Мбит/с').fill('40');await page.getByLabel('Резерв места, %').fill('10');result=await page.locator('.time-result strong').innerText();check('stream known result',result==='6 ч 24 мин 0 с',result);
await page.getByLabel('Резерв места, %').fill('100');check('full reserve rejected',(await page.locator('.time-result strong').innerText())==='Проверьте значения');
await page.goto(base+'/samples/rain');const before=await page.locator('.frame-gallery img').count();const show=page.getByRole('button',{name:/Показать/});await show.click();const after=await page.locator('.frame-gallery img').count();check('gallery expands actual recovered frames',before===6&&after>before,{before,after});
const missing=await page.goto(base+'/this-original-page-does-not-exist');check('real404',missing.status()===404,missing.status());
check('no browser runtime errors',errors.length===0,errors);
return {base,viewport:{width:360,height:800},checks,errors};
}
)(page);
```
### Page
- Page URL: http://127.0.0.1:59940/this-original-page-does-not-exist
- Page Title: Videoreg — техническая библиотека СВК
- Console: 1 errors, 0 warnings
### Events
- New console entries: .playwright-cli/console-2026-10-27T12-56-37-395Z.log#L1
@@ -0,0 +1,2 @@
### Error
Error: system follows dark: undefined
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,39 @@
{
"verifiedAt": "2026-10-27T13:05:29.726034+00:00",
"domain": "videoreg.ru",
"status": "DEPLOYED_VERIFIED_LIMITED_PUBLICATION",
"sourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"deliveryCommit": "c0dcb64b1d6f85cbd652aa38748d844957f1d2ad",
"exportManifestSha256": "68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc",
"image": "git.pryanik.synology.me/huncode/videoreg.ru@sha256:a88549a9e427f60f4c958b1e443f7f628305f9ee1345a10554b6eb4cfb07ba95",
"architecture": "amd64",
"ci": {
"url": "https://git.pryanik.synology.me/huncode/videoreg.ru/actions/runs/1404",
"status": "success"
},
"runtime": {
"swarmUpdate": "completed",
"replicas": "1/1",
"containerHealth": "healthy",
"imagePublicTreeFiles": 523,
"imagePublicTreeIdentical": true
},
"https": {
"apexReady": 200,
"wwwReady": 200,
"tlsVerified": true,
"commitMatches": true,
"crawlRequests": 143,
"crawlTechnicalErrors": 0,
"browserSmokeChecks": 21,
"browserSmokePassed": true
},
"localPreview": "http://127.0.0.1:59940",
"roleApprovals": 5,
"analyticsEnabled": false,
"fullUiKitAcceptance": false,
"historicalRestorationComplete": false,
"unresolvedHistoricalTargets": 119,
"ownBrowsersOpen": 0,
"workStoppedAfterDelivery": true
}
Binary file not shown.
@@ -0,0 +1 @@
{"checks": 800, "failures": [], "originalArticles": 28, "originalPublicFiles": 182}
@@ -0,0 +1,23 @@
{
"scope": "User-authorized release of implemented technically verified interface",
"fullUiKitAcceptance": false,
"fullHistoricalRestorationAccepted": false,
"historicalRestorationComplete": false,
"unresolvedHistoricalTargets": 119,
"analyticsEnabled": false,
"sourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"exportManifestSha256": "68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc",
"checks": {
"testsPassed": 44,
"crawlTechnicalErrors": 0,
"preservationChecks": 800,
"preservationFailures": 0,
"browserSmokeChecks": 21
},
"limitations": [
"Complete personal inspection of all UI-kit variants and states is unfinished",
"119 historical targets remain unresolved",
"Production delivery requires CI and independent runtime verification"
],
"browserSmokeCorrection": "Initial smoke asserted before asynchronous OS change event; corrected check waits for actual event. Final run passed."
}
File diff suppressed because it is too large. Load diff
+94
View File
@@ -0,0 +1,94 @@
npm warn Unknown user config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "public-hoist-pattern". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
> videoreg@0.1.0 ci:quality
> npm run typecheck && npm test && npm run check:design-system && npm run build
npm warn Unknown env config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown env config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "public-hoist-pattern". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
> videoreg@0.1.0 typecheck
> tsc --noEmit
npm warn Unknown env config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown env config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "public-hoist-pattern". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
> videoreg@0.1.0 test
> vitest run
RUN v4.1.5 /private/tmp/videoreg-delivery-20261027
Test Files 13 passed (13)
Tests 44 passed (44)
Start at 15:53:58
Duration 426ms (transform 651ms, setup 0ms, import 1.10s, tests 141ms, environment 1ms)
npm warn Unknown env config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown env config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "public-hoist-pattern". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
> videoreg@0.1.0 check:design-system
> node scripts/design-system/check-fsd.mjs
{"activeFiles":58,"modules":52,"sharedComponents":13,"errors":[]}
npm warn Unknown env config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown env config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "store-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "cache-dir". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm warn Unknown user config "public-hoist-pattern". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
> videoreg@0.1.0 build
> next build web-front
▲ Next.js 16.2.4 (Turbopack)
- Experiments (use with caution):
· cpus: 2
Creating an optimized production build ...
(node:88463) [DEP0205] DeprecationWarning: `module.register()` is deprecated. Use `module.registerHooks()` instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
✓ Compiled successfully in 1789ms
Running TypeScript ...
Finished TypeScript in 1436ms ...
Collecting page data using 2 workers ...
Generating static pages using 2 workers (0/42) ...
Generating static pages using 2 workers (10/42)
Generating static pages using 2 workers (20/42)
Generating static pages using 2 workers (31/42)
✓ Generating static pages using 2 workers (42/42) in 171ms
Finalizing page optimization ...
Route (app)
┌ ○ /
├ ○ /_not-found
├ ● /[...slug]
│ ├ /system
│ ├ /auto.shtml
│ ├ /support.shtml
│ └ [+25 more paths]
├ ○ /about
├ ○ /community
├ ○ /health/live
├ ○ /health/ready
├ ○ /icon.svg
├ ○ /library
├ ○ /privacy
├ ○ /sources
├ ○ /tools/recording-time
└ ○ /ui-kit
○ (Static) prerendered as static content
● (SSG) prerendered as static HTML (uses generateStaticParams)
@@ -0,0 +1,14 @@
{
"role": "content_manager",
"agent": "/root/content_terra",
"decision": "ALLOW_LIMITED_PUBLICATION",
"sourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"exportManifestSha256": "68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc",
"fullUiKitAcceptance": false,
"historicalRestorationComplete": false,
"reportPath": "docs/releases/implemented/reviews/content-terra.md",
"reportSha256": "b2031cb69e1540b182dc54758cb45900c83b3dd393998fae8d982e3cce19c3ca",
"candidateSourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"fullHistoricalRestorationAccepted": false,
"appSourceManifestSha256": "49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537"
}
@@ -0,0 +1,9 @@
# Content review — limited publication, pending export
Delivery source a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7. Source-equivalence.json records 91 identical application inputs versus 6065b113dd3538496b7263884212b1f50ec22faf, no mismatches, fingerprint 49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537. Export manifest SHA-256 68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc. Decision: ALLOW_LIMITED_PUBLICATION for the reviewed corpus; fullUiKitAcceptance=false.
For 6065 I personally opened both palette screenshots of the 200×282 certificate and the complete GPS-invalid-field warning. Root's browser readback measured native/rendered certificate 200×282 in kit, and 200px width on its article page; it confirmed the warning visible in kit in both palettes. All 28 content routes returned HTTP 200 and included the source title. Both source JSONs matched HEAD: 28 articles, 93 sections, 155 paragraphs and 162 gallery frames. No known demonstrated content defect blocks limited publication.
Scope limits: 119 historical targets remain unresolved; restoration is incomplete, analytics disabled, and full UI-kit and theme acceptance is not established. Small-photo /auto.shtml and narrow-screen readback remain unverified; videoreg-957.13.6 remains open. These limits are not a full historical or visual acceptance.
Fresh delivery preservation reports 800 checks, zero failures, 28 original articles and 182 original public files. Crawl is bound to the source and export manifest above; no browser inspection of this rebuilt export is claimed here. Publication remains subject to the other roles and deployment verification.
@@ -0,0 +1,18 @@
{
"role": "creative_director",
"agent": "/root/creative_terra",
"model": "gpt-6.1-terra",
"reasoningEffort": "medium",
"decision": "ALLOW_LIMITED_PUBLICATION",
"sourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"exportManifestSha256": "68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc",
"appSourceManifestSha256": "49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537",
"reviewedSourceCommit": "6065b113dd3538496b7263884212b1f50ec22faf",
"fullUiKitAcceptance": false,
"historicalRestorationComplete": false,
"condition": "Final publication smoke must succeed and no new blocking defect be found",
"reportPath": "docs/releases/implemented/reviews/creative-terra.md",
"reportSha256": "4ec8d551223c6c7c07d091608c77012bede10921a45bcd669528d2c7d8d97817",
"candidateSourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"fullHistoricalRestorationAccepted": false
}
@@ -0,0 +1,9 @@
# Creative director — ограниченное решение о публикации
**ALLOW_LIMITED_PUBLICATION** проверенного корпуса для source `a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7` и export manifest SHA-256 `68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc`, при успешном финальном smoke опубликованной версии и отсутствии новых блокирующих дефектов. Владелец прямо разрешил публикацию при неполном визуальном покрытии и оставшихся исторических пробелах. Это решение не означает полной приёмки UI kit или восстановления истории.
На предшествующем actual D3 `6065b113dd3538496b7263884212b1f50ec22faf` я лично открыл 60 изображений и проверил компактную кнопку темы, клавиатурные переключения и сохранение light после перезагрузки. Список и хэши сохранены в прежнем `docs/design-implementation-v1/reviews/creative-d3.json`; полный разбор и пределы — в `creative-d3.md` того рабочего дерева. Визуально проверены начала разделов kit, но не все раскрытые варианты и состояния. Изображение с 200% использовало CSS zoom, не browser zoom. Новый export я лично в браузере не открывал.
Самостоятельно сравнил байты всех 91 входного файла приложения нового checkout с git-объектами reviewed `6065`: расхождений нет, каждый соответствует хэшу нового manifest. Fingerprint `49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537`; это эквивалентность исходников, а не побайтовая идентичность двух export. В новой сборке `current.json` и `crawl.json` связывают указанные source, fingerprint и export; crawl сообщает 143 HTTP-проверки, 1904 локальные ссылки, 0 errors. `preservation.log` сообщает 800 проверок без ошибок, 28 исходных статей и 182 исходных файла. По сообщению координатора, финальный browser smoke нового export прошёл 21 проверку без runtime errors; лично этот повтор не выполнял.
Известные пределы: полная визуальная приёмка всех вариантов UI kit отсутствует; 119 исторических целей остаются открыты, восстановление неполное, аналитика отключена. Наблюдавшаяся на одном старом dark-320 скриншоте повторная шапка не была установлена как реальный дефект или артефакт захвата. Никакого нового продакшн-развёртывания или подтверждения его результата этим решением не утверждаю.
@@ -0,0 +1,18 @@
{
"role": "designer",
"agent": "/root/designer_terra",
"model": "gpt-6.1-terra",
"reasoningEffort": "medium",
"decision": "ALLOW_LIMITED_PUBLICATION",
"sourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"exportManifestSha256": "68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc",
"appSourceManifestSha256": "49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537",
"reviewedSourceCommit": "6065b113dd3538496b7263884212b1f50ec22faf",
"fullUiKitAcceptance": false,
"historicalRestorationComplete": false,
"condition": "Final publication smoke must succeed and no new blocking defect be found",
"reportPath": "docs/releases/implemented/reviews/designer-terra.md",
"reportSha256": "e546dc2bc7c2edde5d5748f0af72678fffab38a0725044c42fd772ef74090edf",
"candidateSourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"fullHistoricalRestorationAccepted": false
}
@@ -0,0 +1,9 @@
# Решение дизайнера о публикации
**ALLOW_LIMITED_PUBLICATION** для ограниченного корпуса при условии успешного финального smoke на опубликованном кандидате и отсутствия новых блокирующих дефектов. Это решение не является полной приёмкой UI kit или исторического восстановления.
Релизный source `a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7`, export manifest `68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc`. `source-equivalence.json` фиксирует 91 побайтово совпадающий app input с лично осмотренной D3 `6065b113dd3538496b7263884212b1f50ec22faf`, fingerprint `49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537`, без расхождений. Это эквивалентность входов, а не личный визуальный осмотр нового экспорта. Релизный quality log содержит завершённую сборку; preservation log сообщает 800 проверок без ошибок. О независимом подтверждении работы production это не свидетельствует.
Личный D3-осмотр включал 30 кадров, 12 разделов kit в двух темах, 44×44 кнопку темы, Enter/Space, ширины 320/390/1440 и малое изображение 200→200 px. Конкретного блокирующего дефекта в просмотренной области не обнаружено. Не проведены личная проверка каждого варианта и динамического состояния, 200% zoom, hover, screen reader, persistence и реакции системной темы; API-обзор был уменьшен. Восстановление неполное: 119 исторических целей остаются открытыми. Пользователь отдельно разрешил публикацию работающей реализации с раскрытием этих ограничений.
Решение касается только моей роли дизайнера; не утверждаю решение других ролей, новую личную проверку релизного экспорта или успешный deployment. Финальный smoke и фактическую доставку подтверждает исполнитель публикации.
@@ -0,0 +1,13 @@
{
"role": "illustrator",
"agent": "/root/publication_illustrator_terra",
"decision": "ALLOW_LIMITED_PUBLICATION",
"candidateSourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"appSourceManifestSha256": "49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537",
"exportManifestSha256": "68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc",
"fullHistoricalRestorationAccepted": false,
"fullUiKitAcceptance": false,
"condition": "Successful final published-version smoke and no new blocking defect",
"reportPath": "docs/releases/implemented/reviews/illustrator-terra.md",
"reportSha256": "c20049f30521c162b96ef867ed230d8586da739e373d78546ddf933200bfa13b"
}
@@ -0,0 +1,9 @@
# Заключение иллюстратора
**ALLOW_LIMITED_PUBLICATION** в пределах проверенного корпуса, при успешном финальном smoke опубликованной версии и отсутствии новых блокирующих дефектов. Полная приёмка UI kit и полного исторического восстановления не дана; 119 исторических целей остаются нерешёнными.
Кандидат `a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7`, fingerprint входов `49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537`, export manifest `68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc`. `source-equivalence.json` сообщает о 91 побайтово совпадающем входе с ранее проверенным runtime `6065b113dd3538496b7263884212b1f50ec22faf`, без расхождений. Это свидетельство эквивалентности входов, а не мой новый полный визуальный осмотр экспорта.
Проверены исходники знака и иконок: янтарный кадр 4:3 на тёмно-синем фоне, отдельные размеры 16/32/48, у touch-знака отступ 4,625 единицы viewBox. Лично открыл PNG 512 и фотографию СВК-006: знак читается, фотография показывает реальное устройство с SD-слотом; блокирующих дефектов в этих двух файлах не увидел. Предыдущее заключение иллюстратора описывает ограниченный осмотр исторических изображений и пояснений галерей; не выдаю его за свой самостоятельный осмотр всех изображений.
`preservation.log` сообщает 800 проверок без ошибок и 182 сохранённых исходных public-файла. По предоставленным результатам 180 растров декодированы без ошибок; это техническая проверка, не визуальная приёмка каждого изображения. Quality log показывает завершение сборки. Финальный browser smoke — свидетельство исполнителя, не мой собственный браузерный осмотр. Состояние production и фактическую доставку должен подтвердить исполнитель публикации.
@@ -0,0 +1,13 @@
{
"role": "programmer_expert",
"agent": "/root/publication_programmer_terra",
"decision": "ALLOW_LIMITED_PUBLICATION",
"fullHistoricalRestorationAccepted": false,
"fullUiKitAcceptance": false,
"candidateSourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"sourceCommit": "a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7",
"appSourceManifestSha256": "49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537",
"exportManifestSha256": "68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc",
"reportPath": "docs/releases/implemented/reviews/programmer-terra.md",
"reportSha256": "ee12ed49d92473d0cfe05526a5fba9269505b8e92a46b02265ad22a345c20c72"
}
@@ -0,0 +1,11 @@
# Programmer expert: limited publication review
Decision: **ALLOW_LIMITED_PUBLICATION** for the reviewed candidate only. This is a scoped technical decision, not full historical restoration or full UI-kit acceptance.
Candidate commit `a12eefa1deee1a4c6e288f96a7dcd3d8238a83f7`; application manifest `49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537`; export manifest `68fa34a6014a233fed65ec84c619b7b0c26f1db584196f2663d2d0545d4c0ebc`.
I independently recomputed both manifest hashes, verified all 91 listed application source files against their hashes, and compared all 523 regular files in the frozen archive against the export manifest: no missing, extra or differing files. The archive SHA-256 matches the release manifest. HEAD matches the candidate commit. Source equivalence evidence records identical bytes for the application source against the prior local candidate; this does not establish complete restoration.
Existing candidate evidence records typecheck, 44 tests in 13 files, design-system structural checks and build passing; preservation reports 800 checks with no failures. The local crawl reports technical status passed, 38 HTML files, 143 HTTP requests, 180 decoded raster assets and zero errors. The final local browser smoke reports 21 passing checks including search, calculators, theme, gallery and a real 404, with no page runtime errors. The first smoke failure is preserved separately; the corrected final check waits for the asynchronous theme update. These are reviewed logs, not a browser session independently performed by this reviewer.
Limits: 119 historical targets remain unresolved; full historical restoration is not accepted. Personal coverage of the full UI kit is incomplete; full UI-kit acceptance is false. Local evidence does not establish production deployment, ingress, TLS or live behavior. The crawl itself records restoration acceptance blocked. No technical breakage was found within this review's scope; production verification and other scoped decisions remain separate.
@@ -0,0 +1,11 @@
{
"priorLocalSourceCommit": "6065b113dd3538496b7263884212b1f50ec22faf",
"appSourceManifestSha256": "49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537",
"sameAppSourceFiles": 91,
"mismatches": [],
"sourceBytesIdentical": true,
"scope": "Application, verification input and native asset source equivalence only; not a full creative acceptance",
"analyticsEnabled": false,
"historicalRestorationComplete": false,
"unresolvedHistoricalTargets": 119
}
+2 -1
View File
@@ -16,7 +16,8 @@
"ingestion:export-catalog": "node --experimental-strip-types ingestion/src/exportCatalog.ts",
"ingestion:smoke-yandex": "node --experimental-strip-types ingestion/src/smokeFetchYandexMarket.ts",
"ingestion:smoke-mvideo": "node --experimental-strip-types ingestion/src/smokeFetchMvideo.ts",
"ci:quality": "npm run typecheck && npm test && npm run build"
"ci:quality": "npm run typecheck && npm test && npm run check:design-system && npm run build",
"check:design-system": "node scripts/design-system/check-fsd.mjs"
},
"dependencies": {
"next": "16.2.4",
+25
View File
@@ -0,0 +1,25 @@
/** Audit the actually imported UI graph, public APIs, layers and real consumers. */
import ts from 'typescript';
import { readdir,readFile,stat,writeFile } from 'node:fs/promises';
import { resolve,relative,dirname,sep } from 'node:path';
const root=resolve('web-front/src'), fsd=resolve(root,'fsd'), app=resolve(root,'app');
async function files(dir){let all=[];for(const d of await readdir(dir,{withFileTypes:true})){const p=resolve(dir,d.name);if(d.isDirectory())all.push(...await files(p));else if(/\.(ts|tsx)$/.test(p)&&!p.endsWith('.test.ts'))all.push(p);}return all;}
async function exists(p){try{return (await stat(p)).isFile();}catch{return false;}}
async function target(owner,name){let stem;if(name.startsWith('@/'))stem=resolve(root,name.slice(2));else if(name.startsWith('.'))stem=resolve(dirname(owner),name);else return null;for(const p of [stem,...['.ts','.tsx','.json','.css'].map(x=>stem+x),...['index.ts','index.tsx'].map(x=>resolve(stem,x))])if(await exists(p))return p;return null;}
const paths=[...await files(fsd),...await files(app)],info=new Map(),errors=[],edges=[];
const levels={app:6,pages:5,widgets:4,features:3,entities:2,shared:1};
function owner(p){if(p.startsWith(app+sep))return {layer:'app',slice:'app'};const [layer,slice]=relative(fsd,p).split(sep);return {layer,slice};}
for(const path of paths){const code=await readFile(path,'utf8'),ast=ts.createSourceFile(path,code,ts.ScriptTarget.Latest,true),imports=[];
for(const node of ast.statements){if((ts.isImportDeclaration(node)||ts.isExportDeclaration(node))&&node.moduleSpecifier&&ts.isStringLiteral(node.moduleSpecifier)){const name=node.moduleSpecifier.text,to=await target(path,name);imports.push({name,to,names:ts.isImportDeclaration(node)&&node.importClause?.namedBindings&&ts.isNamedImports(node.importClause.namedBindings)?node.importClause.namedBindings.elements.map(x=>x.name.text):[]});}}
const from=owner(path);if((from.layer==='shared'||from.layer==='entities')&&ast.statements.some(n=>ts.isExpressionStatement(n)&&ts.isStringLiteral(n.expression)&&n.expression.text==='use client'))errors.push({kind:'client-boundary-in-shared/entity',file:relative(root,path)});
for(const imp of imports){if(imp.name==='@/content/library')errors.push({kind:'compatibility-cycle-risk',file:relative(root,path)});if(!imp.to)continue;if(imp.to.startsWith(fsd+sep)){const dest=owner(imp.to);if(levels[dest.layer]>levels[from.layer]||(dest.layer===from.layer&&dest.slice!==from.slice&&from.layer!=='app'))errors.push({kind:'upward/lateral-import',from:relative(root,path),to:relative(root,imp.to)});if(imp.name.startsWith('@/fsd/')&&!(dest.layer==='shared'&&imp.to.endsWith('.css'))&&!/^index\.tsx?$/.test(imp.to.split(sep).at(-1)))errors.push({kind:'slice-public-api-bypass',from:relative(root,path),import:imp.name});}edges.push({from:relative(root,path),to:relative(root,imp.to),import:imp.name});}
info.set(path,{imports,ast});
}
const active=new Set();async function visit(p){if(active.has(p))return;active.add(p);for(const imp of info.get(p)?.imports??[])if(imp.to)await visit(imp.to);}
for(const p of await files(app))await visit(p);
const consumers={};for(const [path,data] of info){if(!active.has(path)||path.includes('/pages/ui-kit/'))continue;for(const imp of data.imports)if(imp.name==='@/fsd/shared/ui')for(const name of imp.names)(consumers[name]??=[]).push(relative(root,path));}
const ui=info.get(resolve(fsd,'shared/ui/index.tsx'));const exports=ui.ast.statements.filter(n=>ts.isFunctionDeclaration(n)&&n.modifiers?.some(m=>m.kind===ts.SyntaxKind.ExportKeyword)).map(n=>n.name.text);
for(const name of exports)if(!consumers[name]?.length)errors.push({kind:'shared-ui-without-real-page-consumer',component:name});
if(await exists(resolve(root,'pages/index.tsx')))errors.push({kind:'accidental-next-pages-router'});
const report={scope:'Active technical-library FSD graph; inactive legacy catalog shared->entities debt preserved, no runtime cycle inferred',activeSourceFiles:active.size,FSDModules:info.size,edges,sharedComponentRealConsumers:consumers,errors};
await writeFile('docs/design-system/fsd-graph.json',JSON.stringify(report,null,2)+'\n');console.log(JSON.stringify({activeFiles:active.size,modules:info.size,sharedComponents:exports.length,errors}));if(errors.length)process.exitCode=1;
@@ -0,0 +1,34 @@
#!/usr/bin/env python3
"""Compare original corpus, anchors and binary payload against published R3."""
from pathlib import Path
import hashlib,json,subprocess,sys
sys.path.insert(0,str(Path('scripts/rebuild-v2/vendor').resolve()))
from bs4 import BeautifulSoup
root=Path('.');out=root/'web-front/out';checks=[]
def check(kind,path,ok):
checks.append(dict(kind=kind,path=path,same=bool(ok)))
def digest(data):return hashlib.sha256(data).hexdigest()
for name in ['web-front/src/content/v2-articles.json','web-front/src/content/v2-community.json','deploy/legacy-map.conf','deploy/legacy-routes.json','deploy/legacy-matchers.json']:
check('immutable-source/legacy',name,(root/name).read_bytes()==subprocess.check_output(['git','show','6405a8d:'+name]))
public=subprocess.check_output(['git','ls-tree','-r','--name-only','6405a8d','--','web-front/public'],text=True).splitlines()
for name in public:
relative=name.removeprefix('web-front/public/');before=subprocess.check_output(['git','show','6405a8d:'+name]);check('original-public-source-bytes',relative,digest((root/name).read_bytes())==digest(before));check('original-public-export-bytes',relative,(out/relative).is_file()and digest((out/relative).read_bytes())==digest(before))
articles=json.loads((root/'web-front/src/content/v2-articles.json').read_text())+json.loads((root/'web-front/src/content/v2-community.json').read_text())
for article in articles:
path=article['path'];soup=BeautifulSoup((out/(path.lstrip('/')+'.html')).read_bytes(),'html.parser');body=soup.select_one('article.article-body');check('real-reader',path,body is not None)
if body is None:continue
for i,s in enumerate(article['sections']):
section=body.find('section',id='section-'+str(i));key=path+'#section-'+str(i);check('anchor-and-toc',key,section is not None and soup.find('a',href='#section-'+str(i))is not None)
if section is None:continue
check('exact-heading',key,section.h2.get_text()==s['heading']);check('exact-paragraphs',key,[p.get_text()for p in section.find_all('p',recursive=False)]==s['paragraphs'])
if s.get('list'):check('exact-list',key,[n.get_text()for n in section.find('ol').find_all('li')]==s['list'])
if s.get('note'):check('exact-note',key,section.select_one('.reading-note').get_text()==s['note'])
if s.get('code'):check('exact-code',key,section.find('code').get_text()==s['code'])
if s.get('table'):
t=s['table'];table=section.find('table');check('exact-table-caption',key,table.caption.get_text()==t['caption']);check('exact-table-headers',key,[c.get_text()for c in table.thead.find_all('th')]==t['head']);check('exact-table-cells',key,[[c.get_text()for c in row.find_all(['th','td'])]for row in table.tbody.find_all('tr')]==t['rows'])
if s.get('figure'):f=s['figure'];check('exact-figure/caption',key,section.find('img',src=f['src'])is not None and section.find('figcaption').get_text()==f['caption'])
for link in s.get('links',[]):a=section.find('a',href=link['href']);check('exact-resource-link',key+' '+link['href'],a is not None and a.get_text()==link['label']+' ↗')
for frame in s.get('gallery',[])[:6]:check('original-frame/name',key+' '+frame['filename'],section.find('img',src=frame['src'])is not None and frame['filename']in section.get_text())
check('exact-related-targets',path,[a['href']for a in body.select('.related-reading a')]==article['related'])
x=dict(scope='Actual rendered historical body/anchors/related and all original public bytes; brand/UI utility additions excluded from historical count',baselineCommit='6405a8d',sourceCommit=json.loads((out/'health/ready').read_text())['metadata']['commitSha'],originalArticles=len(articles),originalPublicFiles=len(public),checks=checks,failures=[x for x in checks if not x['same']],newUtilityRoutes=['/sources','/privacy','/ui-kit'],fullHistoricalRestorationAccepted=False)
(root/'docs/design-system/evidence/preservation.json').write_text(json.dumps(x,ensure_ascii=False,indent=2)+'\n');print(json.dumps(dict(checks=len(checks),failures=x['failures'],originalArticles=len(articles),originalPublicFiles=len(public)),ensure_ascii=False));raise SystemExit(1 if x['failures']else 0)
+11
View File
@@ -236,12 +236,23 @@ def active_source_files():
continue
candidates = [stem, *[Path(str(stem) + suffix) for suffix in (".ts", ".tsx", ".js", ".jsx", ".json", ".css")], stem / "index.ts", stem / "index.tsx"]
pending.extend(p for p in candidates if p.is_file())
# Framework icon conventions and first-party public code/branding have no
# import edge, but still belong to the exact source identity.
seen.update((ROOT / "web-front/public").glob("*.js"))
seen.update(p for p in (ROOT / "web-front/public/brand").rglob("*") if p.is_file())
seen.update(p for pattern in ("icon.*", "favicon.ico", "apple-icon.*") for p in (src / "app").glob(pattern) if p.is_file())
# Hash the actual build/check inputs too; they are not browser destinations.
seen.update(ROOT / name for name in ("package.json", "package-lock.json", "tsconfig.json", "web-front/next.config.ts", "scripts/design-system/check-fsd.mjs", "scripts/rebuild-v2/check-built.py", "scripts/rebuild-v2/decode-raster-sharp.mjs", "scripts/rebuild-v2/check-raster-sharp.mjs"))
return sorted(seen)
def source_occurrences(files):
occurrences = []
for path in files:
if not (path.is_relative_to(ROOT / "web-front/src") or path.is_relative_to(ROOT / "web-front/public")):
continue # Build/check tooling is hash-bound, not an active web reference.
if path.suffix.lower() not in (".ts", ".tsx", ".js", ".jsx", ".css", ".json", ".svg"):
continue # Binary sources are hash-bound; never decode them as text.
text = path.read_text()
relative = path.relative_to(ROOT).as_posix()
if path.suffix == ".json":
+14
View File
@@ -16,6 +16,20 @@ try {
assert.equal(report.results[0].width, 64);
assert.equal(report.results[0].height, 32);
assert.equal(report.results[1].valid, false, 'Truncated PNG must fail, not be skipped or treated as metadata-only pass');
const frames = await Promise.all([16, 32, 48].map(size => sharp({ create: { width: size, height: size, channels: 4, background: '#17382f' } }).png().toBuffer()));
const directory = Buffer.alloc(6 + frames.length * 16); directory.writeUInt16LE(1, 2); directory.writeUInt16LE(frames.length, 4);
let offset = directory.length;
frames.forEach((frame, i) => { const at = 6 + i * 16; directory[at] = [16,32,48][i]; directory[at+1] = [16,32,48][i]; directory.writeUInt16LE(1,at+4);directory.writeUInt16LE(32,at+6);directory.writeUInt32LE(frame.length,at+8);directory.writeUInt32LE(offset,at+12);offset += frame.length; });
const ico = Buffer.concat([directory,...frames]);
await writeFile(join(root,'all-frames.ico'),ico);
await writeFile(join(root,'truncated-directory.ico'),ico.subarray(0,24));
const bounds=Buffer.from(ico);bounds.writeUInt32LE(0xffffffff,18);await writeFile(join(root,'bad-bounds.ico'),bounds);
const overlap=Buffer.from(ico);overlap.writeUInt32LE(directory.length,34);await writeFile(join(root,'overlap.ico'),overlap);
const corrupt=Buffer.from(ico);corrupt[directory.length+frames[0].length]=0;await writeFile(join(root,'bad-middle-frame.ico'),corrupt);
const icons=await decodeBatch({root,files:['all-frames.ico','truncated-directory.ico','bad-bounds.ico','overlap.ico','bad-middle-frame.ico']});
assert.equal(icons.results[0].valid,true);assert.deepEqual(icons.results[0].frames.map(f=>[f.width,f.height]),[[16,16],[32,32],[48,48]]);
assert.ok(icons.results.slice(1).every(f=>f.valid===false),'Every corrupt directory/member must fail the full ICO');
process.stdout.write(JSON.stringify({test:'all-ICO-frames-and-corruption',status:'passed',results:icons.results})+'\n');
process.stdout.write(JSON.stringify({ test: 'full-raster-decode-positive-and-corruption', status: 'passed', results: report.results }) + '\n');
} finally {
await rm(root, { recursive: true, force: true });
+26 -1
View File
@@ -1,12 +1,32 @@
/** Fully decode all raster pixels with npm-lockfile-pinned sharp; no network. */
import sharp from 'sharp';
import { realpath } from 'node:fs/promises';
import { realpath, readFile } from 'node:fs/promises';
import { resolve, sep } from 'node:path';
import { fileURLToPath } from 'node:url';
sharp.cache(false);
sharp.concurrency(1);
/** Decode every PNG-backed ICO directory member, not just its largest frame. */
export async function decodeIco(bytes) {
if (bytes.length < 6 || bytes.length > 25 * 1024 * 1024 || bytes.readUInt16LE(0) !== 0 || bytes.readUInt16LE(2) !== 1) throw new Error('Invalid ICO header');
const count = bytes.readUInt16LE(4), ranges = [], frames = [];
if (count < 1 || count > 64 || bytes.length < 6 + count * 16) throw new Error('Invalid ICO directory');
for (let i = 0; i < count; i++) {
const at = 6 + i * 16, width = bytes[at] || 256, height = bytes[at + 1] || 256;
const size = bytes.readUInt32LE(at + 8), offset = bytes.readUInt32LE(at + 12), end = offset + size;
if (size < 8 || offset < 6 + count * 16 || end > bytes.length || ranges.some(([a, b]) => offset < b && end > a)) throw new Error('Invalid ICO member bounds/overlap');
ranges.push([offset, end]);
const png = bytes.subarray(offset, end);
if (!png.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))) throw new Error('ICO member must be PNG-backed; unsupported DIB is not skipped');
const image = sharp(png, { failOn: 'error', limitInputPixels: 65536 });
const { info } = await image.raw().toBuffer({ resolveWithObject: true });
if (info.width !== width || info.height !== height) throw new Error('ICO directory/pixels dimension mismatch');
frames.push({ width, height, decodedBytes: info.size });
}
return { width: Math.max(...frames.map(f => f.width)), height: Math.max(...frames.map(f => f.height)), format: 'ico', pages: count, decodedBytes: frames.reduce((n, f) => n + f.decodedBytes, 0), frames };
}
export async function decodeBatch({ root, files }) {
if (sharp.versions.sharp !== '0.34.5') {
throw new Error(`Expected lockfile sharp0.34.5, found ${sharp.versions.sharp}`);
@@ -20,6 +40,11 @@ export async function decodeBatch({ root, files }) {
try {
const candidate = await realpath(resolve(boundary, file));
if (!candidate.startsWith(boundary + sep)) throw new Error('Raster path outside public root');
if (candidate.toLowerCase().endsWith('.ico')) {
const decoded = await decodeIco(await readFile(candidate));
results.push({ file, type: 'raster', valid: true, ...decoded, decoder: `sharp${sharp.versions.sharp}/all-ICO-PNG-frames` });
continue;
}
const image = sharp(candidate, { failOn: 'error', animated: true, limitInputPixels: 64000000 });
const metadata = await image.metadata();
// metadata() alone is insufficient: force actual decode of every pixel.
Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><rect width="16" height="16" fill="#112c43"/><path d="M0 5h1v5H0zM15 5h1v5h-1z" fill="#f9fbfc"/><path d="M2 3h12v9H2z" fill="#f3933d"/><path d="M4 5h8v5H4z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" fill="#112c43"/><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><rect width="48" height="48" fill="#112c43"/><path d="M0 16h3v15H0zM45 16h3v15h-3z" fill="#f9fbfc"/><path d="M6 10h36v27H6z" fill="#f3933d"/><path d="M12 16h24v15H12z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><rect width="16" height="16" fill="#112c43"/><path d="M0 5h1v5H0zM15 5h1v5h-1z" fill="#f9fbfc"/><path d="M2 3h12v9H2z" fill="#f3933d"/><path d="M4 5h8v5H4z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" fill="#112c43"/><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><rect width="48" height="48" fill="#112c43"/><path d="M0 16h3v15H0zM45 16h3v15h-3z" fill="#f9fbfc"/><path d="M6 10h36v27H6z" fill="#f3933d"/><path d="M12 16h24v15H12z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="275" height="64" viewBox="0 0 275 64" role="img" aria-labelledby="title"><title id="title">Videoreg</title><g transform="translate(0 8) scale(1.5)"><rect width="32" height="32" rx="6" fill="#e9eee5"/><path d="M7 7h18v18H7z" fill="none" stroke="#17382f" stroke-width="2"/><path d="M4 12v16h16" fill="none" stroke="#17382f" stroke-width="2"/><circle cx="21" cy="11" r="2" fill="#9d4820"/></g><text x="64" y="44" fill="#f5f2e9" font-family="Georgia,Times New Roman,serif" font-size="43" font-weight="700" letter-spacing="-1.5">videoreg</text></svg>

After

Width:  |  Height:  |  Size: 592 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="275" height="64" viewBox="0 0 275 64" role="img" aria-labelledby="title"><title id="title">Videoreg</title><g transform="translate(0 8) scale(1.5)"><rect width="32" height="32" rx="6" fill="#17382f"/><path d="M7 7h18v18H7z" fill="none" stroke="#fffef9" stroke-width="2"/><path d="M4 12v16h16" fill="none" stroke="#fffef9" stroke-width="2"/><circle cx="21" cy="11" r="2" fill="#efbf78"/></g><text x="64" y="44" fill="#17382f" font-family="Georgia,Times New Roman,serif" font-size="43" font-weight="700" letter-spacing="-1.5">videoreg</text></svg>

After

Width:  |  Height:  |  Size: 592 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" fill="#112c43"/><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></svg>

After

Width:  |  Height:  |  Size: 270 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 32 32"><title>Videoreg — кадр СВК</title><rect width="32" height="32" fill="#112c43"/><g transform="translate(4.625 4.625) scale(0.7109375)"><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></g></svg>

After

Width:  |  Height:  |  Size: 374 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 32 32"><title>Videoreg — кадр СВК</title><rect width="32" height="32" fill="#112c43"/><g transform="translate(4.625 4.625) scale(0.7109375)"><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></g></svg>

After

Width:  |  Height:  |  Size: 374 B

+79
View File
@@ -0,0 +1,79 @@
/* Videoreg analytics: one existing counter, public hosts only, no query payloads. */
(function () {
"use strict";
if (!/^(www\.)?videoreg\.ru$/.test(window.location.hostname) || window.__videoregMetrika) return;
window.__videoregMetrika = true;
var counter = 109268682;
window.ym = window.ym || function () { (window.ym.a = window.ym.a || []).push(arguments); };
window.ym.l = Number(new Date());
var tag = document.createElement("script");
tag.async = true;
tag.src = "https://mc.yandex.ru/metrika/tag.js";
document.head.appendChild(tag);
window.ym(counter, "init", {
webvisor: false, clickmap: true, trackLinks: true,
accurateTrackBounce: true, trackHash: false
});
function goal(name, params) { window.ym(counter, "reachGoal", name, params); }
var problems = new Set();
function problem(kind) {
if (problems.has(kind)) return;
problems.add(kind);
goal("content_problem", { problem: kind });
}
// Only actual, enabled document/ZIP downloads; a click does not imply success.
document.addEventListener("click", function (event) {
var link = event.target instanceof Element ? event.target.closest("a[href]") : null;
if (!link || event.defaultPrevented || link.getAttribute("aria-disabled") === "true") return;
var url = new URL(link.href, window.location.href);
if (url.origin !== window.location.origin) return;
if (/^\/(manuals|download)\//.test(url.pathname) && /\.(pdf|zip)$/i.test(url.pathname)) goal("download_click");
if (link.closest(".related-reading")) goal("related_content_click");
var queryInput = document.querySelector("#library-query");
if (link.closest(".search-results") && queryInput && queryInput.value.trim()) goal("search_used");
});
document.addEventListener("keydown", function (event) {
if (event.key === "Enter" && !event.isComposing && !event.repeat && event.target.id === "library-query" && event.target.value.trim()) goal("search_used");
});
document.addEventListener("videoreg:search-zero-results", function () { goal("search_zero_results"); });
function fragment() {
var id;
try { id = decodeURIComponent(window.location.hash.slice(1).split(":~:")[0]); } catch (_) { return; }
if (id && !document.getElementById(id) && !document.getElementsByName(id).length) problem("missing_fragment");
}
function imageFailed(image) {
if (image instanceof HTMLImageElement && image.closest("main") && image.getAttribute("src")) problem("image_failed");
}
document.addEventListener("error", function (event) { imageFailed(event.target); }, true);
if (document.querySelector("main.not-found")) problem("not_found");
document.querySelectorAll("main img").forEach(function (image) {
if (image.complete && image.naturalWidth === 0) imageFailed(image);
});
if (document.readyState === "complete") fragment();
else window.addEventListener("load", fragment, { once: true });
window.addEventListener("hashchange", fragment);
var article = document.querySelector("article.article-body");
if (!article) return;
var visibleMs = 0, depth = 0, sent = false, last = performance.now();
var active = document.visibilityState === "visible" && document.hasFocus();
function sample() {
var now = performance.now();
var nextActive = document.visibilityState === "visible" && document.hasFocus();
// Conservative cap avoids counting background/throttled gaps as reading.
if (active && nextActive) visibleMs += Math.min(now - last, 1500);
last = now; active = nextActive;
if (nextActive) {
var rect = article.getBoundingClientRect();
if (rect.height > 0) depth = Math.max(depth, Math.min(1, (window.innerHeight - rect.top) / rect.height));
}
if (!sent && visibleMs >= 60000 && depth >= 0.75) {
sent = true; goal("engaged_read"); clearInterval(timer);
}
}
var timer = setInterval(sample, 1000);
window.addEventListener("scroll", sample, { passive: true });
window.addEventListener("focus", sample);
window.addEventListener("blur", sample);
document.addEventListener("visibilitychange", sample);
})();
+39
View File
@@ -0,0 +1,39 @@
/* Blocking, same-origin bootstrap: keep this before body paint. */
(function () {
'use strict';
var key = 'videoreg-theme';
var root = document.documentElement;
var media = typeof window.matchMedia === 'function' ? window.matchMedia('(prefers-color-scheme: dark)') : null;
function valid(value) { return value === 'light' || value === 'dark' || value === 'system'; }
function read() { try { var value = localStorage.getItem(key); return valid(value) ? value : 'system'; } catch (_) { return 'system'; } }
var choice = read();
function apply() {
var resolved = choice === 'system' ? (media && media.matches ? 'dark' : 'light') : choice;
root.dataset.theme = resolved;
root.dataset.themeChoice = choice;
root.style.colorScheme = resolved;
window.dispatchEvent(new CustomEvent('videoreg:theme-change'));
}
window.videoregTheme = {
get: function () { return choice; },
set: function (value) {
if (!valid(value)) return;
choice = value;
try { localStorage.setItem(key, choice); } catch (_) { /* Session choice still works. */ }
apply();
}
};
function osChanged() { if (choice === 'system') apply(); }
if (media) {
if (media.addEventListener) media.addEventListener('change', osChanged);
else if (media.addListener) media.addListener(osChanged);
}
window.addEventListener('storage', function (event) {
if (event.key !== key && event.key !== null) return;
// Ignore sessionStorage events; inaccessible storage must not break rendering.
try { if (event.storageArea && event.storageArea !== localStorage) return; } catch (_) { return; }
choice = read();
apply();
});
apply();
}());
+8 -164
View File
@@ -1,172 +1,16 @@
import { notFound } from "next/navigation";
import FrameGallery from "@/components/FrameGallery";
import { articles, findArticle } from "@/content/library";
import { articles, findArticle } from "@/fsd/entities/article";
import { ArticlePage } from "@/fsd/pages/article";
export const dynamicParams = false;
export function generateStaticParams() {
return articles.map((a) => ({ slug: a.path.slice(1).split("/") }));
}
export async function generateMetadata({
params,
}: {
params: Promise<{ slug: string[] }>;
}) {
export function generateStaticParams() { return articles.map(a => ({ slug: a.path.slice(1).split("/") })); }
export async function generateMetadata({ params }: { params: Promise<{ slug: string[] }> }) {
const { slug } = await params;
const a = findArticle("/" + slug.join("/"));
return { title: a?.title, description: a?.summary };
}
const dimensions: Record<string, [number, number]> = {
"/archive-media/svk006-front.jpg": [800, 528],
"/archive-media/early-kit.jpg": [640, 551],
"/archive-media/viewer-map.jpg": [1259, 850],
"/archive-media/certificate.jpg": [200, 282],
"/archive-media/installation-interior.jpg": [200, 150],
"/archive-media/installation-block.jpg": [200, 150],
"/diagrams/svk-signal-chain.svg": [440, 870],
"/diagrams/svk-road-guard.svg": [440, 815],
"/diagrams/svk-fleet-channels.svg": [440, 1015],
};
export default async function Page({
params,
}: {
params: Promise<{ slug: string[] }>;
}) {
export default async function Page({ params }: { params: Promise<{ slug: string[] }> }) {
const { slug } = await params;
const a = findArticle("/" + slug.join("/"));
if (!a) notFound();
return (
<main className="reading-page" id="main-content">
<div className="article-heading">
<a className="back-link" href="/library">
← К библиотеке
</a>
<p className="kicker">
{a.category} / {a.date}
</p>
<h1>{a.title}</h1>
<p className="lede">{a.summary}</p>
</div>
<div className="reading-layout">
<aside className="contents">
<details open>
<summary>В этом материале</summary>
<nav aria-label="Содержание статьи">
{a.sections.map((s, i) => (
<a href={"#section-" + i} key={s.heading}>
{s.heading}
</a>
))}
</nav>
</details>
<a className="contents-tool" href="/tools/recording-time">
Расчёт времени записи ↗
</a>
</aside>
<article className="article-body">
{a.sections.map((s, i) => (
<section id={"section-" + i} key={s.heading}>
<h2>{s.heading}</h2>
{s.paragraphs.map((p) => (
<p key={p}>{p}</p>
))}
{s.list && (
<ol>
{s.list.map((v) => (
<li key={v}>{v}</li>
))}
</ol>
)}
{s.note && <aside className="reading-note">{s.note}</aside>}
{s.code && (
<pre tabIndex={0}>
<code>{s.code}</code>
</pre>
)}
{s.table && (
<div
className="table-region"
tabIndex={0}
role="region"
aria-label={s.table.caption}
>
<table>
<caption>{s.table.caption}</caption>
<thead>
<tr>
{s.table.head.map((h) => (
<th scope="col" key={h}>
{h}
</th>
))}
</tr>
</thead>
<tbody>
{s.table.rows.map((row, j) => (
<tr key={j}>
{row.map((value, k) =>
k === 0 ? (
<th scope="row" key={k}>
{value}
</th>
) : (
<td key={k}>{value}</td>
),
)}
</tr>
))}
</tbody>
</table>
</div>
)}
{s.figure && (
<figure
className={
s.figure.diagram
? "content-figure diagram"
: s.figure.small
? "content-figure small-figure"
: "content-figure"
}
>
<a
href={s.figure.src}
aria-label={"Открыть изображение: " + s.figure.alt}
>
<img
src={s.figure.src}
alt={s.figure.alt}
width={dimensions[s.figure.src]?.[0]}
height={dimensions[s.figure.src]?.[1]}
loading="lazy"
/>
</a>
<figcaption>{s.figure.caption}</figcaption>
</figure>
)}
{s.gallery && <FrameGallery frames={s.gallery} />}{" "}
{s.links && (
<ul className="document-links">
{s.links.map((l) => (
<li key={l.href}>
<a href={l.href} rel={l.href.startsWith("https://") ? "noreferrer" : undefined}>{l.label} ↗</a>
</li>
))}
</ul>
)}
</section>
))}
<nav className="related-reading" aria-label="Связанные материалы">
<h2>Продолжить разбор</h2>
{a.related.map((path) => {
const other = findArticle(path);
return (
<a key={path} href={path}>
{other?.title ?? "Калькулятор времени записи"} <span>→</span>
</a>
);
})}
</nav>
</article>
</div>
</main>
);
const article = findArticle("/" + slug.join("/"));
if (!article) notFound();
return <ArticlePage article={article} />;
}
+2 -43
View File
@@ -1,44 +1,3 @@
import { AboutPage } from "@/fsd/pages/about";
export const metadata = { title: "О технической библиотеке" };
export default function About() {
return (
<main id="main-content" className="about-page">
<p className="kicker">VIDEOREG</p>
<h1>Библиотека систем СВК</h1>
<p className="lede">
Устройство, эксплуатация и чтение записи — без витрины продаж.
</p>
<p>
Здесь доступны отобранные технические материалы, пять полных PDF-документов
и подборки кадров. Это не полный архив всех прежних страниц и файлов
videoreg.ru. Ограничения неполных подборок и недоступных файлов указаны
непосредственно в соответствующем материале.
</p>
<h2>Для кого эти материалы</h2>
<p>
Для владельца старого блока СВК, которому нужна инструкция своего
поколения, таблица камер или объяснение покадровой записи. Отдельные
материалы помогают понять устройство ранних автомобильных систем
регистрации.
</p>
<h2>Сначала модель и редакция</h2>
<p>
Страницы разных лет относятся к разным аппаратным версиям. Даты у
материалов помогают различать поколения. Указанные там камеры, носители
и параметры не являются универсальной рекомендацией для современного
оборудования.
</p>
<h2>Как пользоваться</h2>
<p>
Начните с устройства системы, затем откройте инструкцию подходящего
блока. Для поиска конкретной ошибки или камеры используйте поиск по
полным текстам. Исходные PDF открываются внутри сайта; программы и
прошивки автоматически не запускаются.
</p>
<div className="about-links">
<a href="/system">Устройство СВК →</a>
<a href="/library">Материалы и поиск →</a>
<a href="/down.shtml">Документы →</a>
</div>
</main>
);
}
export default AboutPage;
+2 -31
View File
@@ -1,32 +1,3 @@
import { articles } from "@/content/library";
import { CommunityPage } from "@/fsd/pages/community";
export const metadata = { title: "Технические разборы СВК" };
export default function Page() {
return (
<main id="main-content" className="library-page">
<p className="kicker">ЭКСПЛУАТАЦИЯ / РАЗБОРЫ</p>
<h1>
Проблема и условия,
<br />в которых она возникла.
</h1>
<p className="lede">
Два разбора из обсуждений владельцев СВК. Частный опыт не превращён в
обещание совместимости любого оборудования.
</p>
<div className="search-results">
{articles
.filter((a) => a.path.startsWith("/community/"))
.map((a) => (
<a href={a.path} key={a.path}>
<span className="search-kind">Обсуждение · {a.date}</span>
<h2>{a.title}</h2>
<p>{a.summary}</p>
<span>↗</span>
</a>
))}
</div>
<p style={{ marginTop: 32 }}>
<a href="/faq.shtml">Также: ответы по конструкции и настройке →</a>
</p>
</main>
);
}
export default CommunityPage;
Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

+1 -1
View File
@@ -1,4 +1,4 @@
import { NextResponse } from 'next/server';
import { articles } from '@/content/library';
import { articles } from '@/fsd/entities/article';
export const dynamic='force-static';
export async function GET(){return NextResponse.json({status:'ok',service:'videoreg-web',edition:'rebuild-v2-limited',restorationComplete:false,articles:articles.length,metadata:{commitSha:process.env.COMMIT_SHA??'local-v2'}})}
+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="8" fill="#17382f"/><rect x="9" y="18" width="46" height="30" rx="3" fill="#f5f2e9"/><rect x="16" y="26" width="13" height="6" rx="1" fill="#17382f"/><rect x="16" y="36" width="13" height="6" rx="1" fill="#17382f"/><path d="M37 24v19h13V24z" fill="#d8894b"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><title>Videoreg — покадровая запись СВК</title><rect width="32" height="32" fill="#112c43"/><path d="M0 11h2v10H0zM30 11h2v10h-2z" fill="#f9fbfc"/><path d="M4 7h24v18H4z" fill="#f3933d"/><path d="M8 11h16v10H8z" fill="#112c43"/></svg>

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 338 B

+7 -47
View File
@@ -1,53 +1,13 @@
import type { Metadata } from "next";
import "./library.css";
import { SiteShell } from "@/fsd/widgets/site-shell";
import "@/fsd/shared/styles/tokens.css";
import "@/fsd/shared/styles/library.css";
export const metadata: Metadata = {
metadataBase: new URL("https://videoreg.ru"),
title: {
default: "Videoreg — техническая библиотека СВК",
template: "%s · Videoreg",
},
description:
"Устройство видеорегистраторов СВК, оригинальные инструкции, таблицы камер и работа с покадровой записью JPEG.",
title: { default: "Videoreg — техническая библиотека СВК", template: "%s · Videoreg" },
description: "Устройство видеорегистраторов СВК, оригинальные инструкции, таблицы камер и работа с покадровой записью JPEG.",
icons: { icon: [{ url: "/brand/icon-light-32.png", sizes: "32x32", type: "image/png" }, { url: "/brand/icon-light-512.png", sizes: "512x512", type: "image/png" }], apple: [{ url: "/brand/icon-light-180.png", sizes: "180x180", type: "image/png" }] }
};
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="ru">
<body>
<a className="skip" href="#main-content">
Перейти к содержимому
</a>
<header className="masthead">
<a className="wordmark" href="/">
videoreg<span>ТЕХНИЧЕСКАЯ БИБЛИОТЕКА</span>
</a>
<nav aria-label="Основная навигация">
<a href="/library">Материалы и поиск</a>
<a href="/catalog">Оборудование</a>
<a href="/down.shtml">Инструкции</a>
<a href="/tools/recording-time">Расчёт записи</a>
</nav>
<span className="masthead-index">СВК / JPEG / FLASH</span>
</header>
{children}
<footer className="footer">
<div>
<a className="wordmark" href="/">
videoreg
</a>
<p>Камера → кадр → носитель.</p>
</div>
<nav aria-label="Навигация внизу страницы">
<a href="/library">Вся библиотека</a>
<a href="/about">О библиотеке</a>
<a href="/faq.shtml">Вопросы по СВК</a>
</nav>
<p>
Документация и практика
<br />
работы с записью.
</p>
</footer>
</body>
</html>
);
return <html lang="ru" suppressHydrationWarning><head><script src="/theme.js" /></head><body><SiteShell>{children}</SiteShell></body></html>;
}
File diff suppressed because it is too large. Load diff
+1 -96
View File
@@ -1,96 +1 @@
"use client";
import { useState } from "react";
type Entry = {
path: string;
title: string;
summary: string;
category: string;
date: string;
text: string;
};
const normalized = (value: string) =>
value
.toLocaleLowerCase("ru")
.replaceAll("ё", "е")
.replace(/\s+/g, " ")
.trim();
export default function Search({ entries }: { entries: Entry[] }) {
const [query, setQuery] = useState("");
const [category, setCategory] = useState("Все темы");
const categories = ["Все темы", ...new Set(entries.map((a) => a.category))];
const words = normalized(query).split(" ").filter(Boolean);
const found = entries.filter(
(a) =>
(category === "Все темы" || a.category === category) &&
words.every((word) =>
normalized(a.title + " " + a.summary + " " + a.text).includes(word),
),
);
return (
<>
<div className="search-panel">
<label htmlFor="library-query">Найти в материалах</label>
<div className="query-row">
<input
id="library-query"
type="search"
placeholder="Например: GPS, USB или резервная копия"
value={query}
onChange={(e) => setQuery(e.target.value)}
/>
<button
type="button"
onClick={() => {
setQuery("");
setCategory("Все темы");
}}
>
Сбросить
</button>
</div>
<label htmlFor="library-category">Раздел</label>
<select
id="library-category"
value={category}
onChange={(e) => setCategory(e.target.value)}
>
{categories.map((c) => (
<option key={c}>{c}</option>
))}
</select>
</div>
<p className="result-count" role="status">
Найдено материалов: {found.length}
</p>
<div className="search-results">
{found.map((a) => (
<a href={a.path} key={a.path}>
<span className="search-kind">
{a.category} · {a.date}
</span>
<h2>{a.title}</h2>
<p>{a.summary}</p>
<span aria-hidden="true">↗</span>
</a>
))}
</div>
{found.length === 0 && (
<div className="empty">
<h2>Такого сочетания пока нет</h2>
<p>
Попробуйте название модели, «карта», «кадры» или уберите фильтр
раздела.
</p>
<button
onClick={() => {
setQuery("");
setCategory("Все темы");
}}
>
Показать все материалы
</button>
</div>
)}
</>
);
}
export { Search as default } from "@/fsd/features/library-search";
+2 -17
View File
@@ -1,18 +1,3 @@
import { searchIndex } from "@/content/library";
import Search from "./Search";
import { LibraryPage } from "@/fsd/pages/library";
export const metadata = { title: "Все материалы и поиск" };
export default function Page() {
return (
<main className="library-page" id="main-content">
<div className="page-heading">
<p className="kicker">КАТАЛОГ ЗНАНИЙ</p>
<h1>Техническая библиотека</h1>
<p className="lede">
Ищите по полным текстам, названиям камер и моделям блоков. Всё
работает здесь, без запроса к стороннему поиску.
</p>
</div>
<Search entries={searchIndex} />
</main>
);
}
export default LibraryPage;
+2 -21
View File
@@ -1,21 +1,2 @@
export default function NotFound() {
return (
<main id="main-content" className="not-found">
<p className="kicker">404 / СТРАНИЦА НЕ НАЙДЕНА</p>
<h1>
По этому адресу
<br />
материала нет.
</h1>
<p>
Проверьте адрес или найдите модель, камеру и нужную тему в библиотеке.
</p>
<div>
<a className="button" href="/library">
Искать в материалах ↗
</a>
<a href="/">На главную →</a>
</div>
</main>
);
}
import { NotFoundPage } from "@/fsd/pages/not-found";
export default NotFoundPage;
+2 -143
View File
@@ -1,143 +1,2 @@
import { articles } from "@/content/library";
export default function Home() {
const paths = [
"/system",
"/auto.shtml",
"/faq.shtml",
"/support.shtml",
"/down.shtml",
"/samples.shtml",
];
return (
<main id="main-content">
<section className="home-intro">
<div className="intro-copy">
<p className="kicker">БИБЛИОТЕКА СИСТЕМ ВИДЕОРЕГИСТРАЦИИ</p>
<h1>
Разобраться
<br />в устройстве.
<br />
<em>Сохранить запись.</em>
</h1>
<p className="lede">
СВК — камеры отдельно, кадры на съёмном носителе. Здесь собраны
устройство системы, инструкции, совместимость и разборы работы с
файлами.
</p>
<a className="button" href="/system">
Как устроена система <span>↗</span>
</a>
</div>
<figure className="intro-figure">
<span className="figure-label">ОБОРУДОВАНИЕ / СВК-006</span>
<img
src="/archive-media/svk006-front.jpg"
alt="Передняя панель системного блока СВК-006: USB A и B, слот SD CARD и индикаторы."
width="800"
height="528"
fetchPriority="high"
/>
<figcaption>
<span>01 / Системный блок</span>
<p>
Камеры подключаются по USB.
<br />
Изображения сохраняются на карту.
</p>
</figcaption>
</figure>
</section>
<section className="home-path">
<span className="kicker">С ЧЕГО НАЧАТЬ</span>
<a href="/system">
<b>01</b> Устройство и поколения
</a>
<a href="/auto.shtml">
<b>02</b> Работа в автомобиле
</a>
<a href="/down.shtml">
<b>03</b> Инструкция своего блока
</a>
<a href="/samples.shtml">
<b>04</b> Кадры и просмотр
</a>
</section>
<section className="home-library">
<div className="section-title">
<div>
<p className="kicker">НА ПОЛКЕ</p>
<h2>Документация, которую можно открыть</h2>
</div>
<a href="/library">Все {articles.length} материалов и поиск →</a>
</div>
<div className="book-grid">
{paths.map((path, i) => {
const a = articles.find((a) => a.path === path)!;
return (
<a className="book" href={path} key={path}>
<span className="book-top">
{a.category}
<span>{String(i + 1).padStart(2, "0")}</span>
</span>
<h3>{a.title}</h3>
<p>{a.summary}</p>
<span className="book-bottom">
{a.date}
<span aria-hidden="true">↗</span>
</span>
</a>
);
})}
</div>
</section>
<section className="home-workbench">
<div>
<p className="kicker">РАБОЧИЙ ИНСТРУМЕНТ</p>
<h2>
Вместо обещания
<br />
«карты хватит надолго»
</h2>
<p>
Посчитайте время по реальному размеру JPEG и частоте кадров. Для
видеопотока есть отдельный режим по битрейту.
</p>
<a className="button" href="/tools/recording-time">
Оценить длительность записи ↗
</a>
</div>
<div className="formula-note">
<span>ПОКАДРОВАЯ ЗАПИСЬ</span>
<code>
объём × (1 − резерв/100)
<br />÷<br />
(размер кадра × кадров/с × камер)
</code>
<p>
Число камер и резерв места
<br />
тоже участвуют в расчёте.
</p>
</div>
</section>
<section className="home-case">
<div>
<p className="kicker">ИЗ ПРАКТИКИ</p>
<h2>Не только характеристики</h2>
<p>
Почему прибор долго запускается с FLASH и что известно о
нестабильной камере с удлинителем.
</p>
</div>
<div>
<a href="/community/flash-start">
FLASH не выходит в рабочий режим <span>↗</span>
</a>
<a href="/community/usb-extension">
Камера и USB-удлинитель <span>↗</span>
</a>
</div>
</section>
</main>
);
}
import { HomePage } from "@/fsd/pages/home";
export default HomePage;
+3
View File
@@ -0,0 +1,3 @@
import { PrivacyPage } from "@/fsd/pages/services";
export const metadata = { title: "Приватность и аналитика" };
export default PrivacyPage;
+3
View File
@@ -0,0 +1,3 @@
import { SourcesPage } from "@/fsd/pages/services";
export const metadata = { title: "Источники и редакционный подход" };
export default SourcesPage;
@@ -1,168 +1 @@
"use client";
import { useState } from "react";
export default function Calculator() {
const [mode, setMode] = useState("frames");
const [capacity, setCapacity] = useState("1");
const [reserve, setReserve] = useState("10");
const [frameSize, setFrameSize] = useState("64");
const [fps, setFps] = useState("5");
const [cameras, setCameras] = useState("1");
const [bitrate, setBitrate] = useState("40");
const values = [
capacity,
reserve,
...(mode === "frames" ? [frameSize, fps, cameras] : [bitrate]),
];
const [c, s, k, f, n, r] = [
Number(capacity),
Number(reserve),
Number(frameSize),
Number(fps),
Number(cameras),
Number(bitrate),
];
const valid =
values.every((v) => v.trim() !== "" && Number.isFinite(Number(v))) &&
c > 0 &&
c <= 100000 &&
s >= 0 &&
s < 100 &&
(mode === "frames"
? k > 0 &&
k <= 100000 &&
f > 0 &&
f <= 1000 &&
Number.isInteger(n) &&
n >= 1 &&
n <= 16
: r > 0 && r <= 10000);
const seconds = valid
? Math.floor(
mode === "frames"
? (c * 1e6 * (1 - s / 100)) / (k * f * n)
: (c * 8000 * (1 - s / 100)) / r,
)
: 0;
return (
<>
<fieldset className="mode-choice">
<legend>Способ записи</legend>
<label>
<input
type="radio"
name="recording-mode"
value="frames"
checked={mode === "frames"}
onChange={() => setMode("frames")}
/>{" "}
JPEG-кадры
</label>
<label>
<input
type="radio"
name="recording-mode"
value="stream"
checked={mode === "stream"}
onChange={() => setMode("stream")}
/>{" "}
Видеопоток
</label>
</fieldset>
<div className="calculation-layout">
<div className="input-fields">
<label>
Ёмкость носителя, ГБ
<input
type="number"
min="0.001"
max="100000"
step="any"
value={capacity}
onChange={(e) => setCapacity(e.target.value)}
/>
</label>
{mode === "frames" ? (
<>
<label>
Средний размер одного JPEG, КБ
<input
type="number"
min="0.001"
max="100000"
step="any"
value={frameSize}
onChange={(e) => setFrameSize(e.target.value)}
/>
</label>
<div className="input-pair">
<label>
Кадров/с на камеру
<input
type="number"
min="0.01"
max="1000"
step="any"
value={fps}
onChange={(e) => setFps(e.target.value)}
/>
</label>
<label>
Число камер
<input
type="number"
min="1"
max="16"
step="1"
value={cameras}
onChange={(e) => setCameras(e.target.value)}
/>
</label>
</div>
</>
) : (
<label>
Суммарный битрейт, Мбит/с
<input
type="number"
min="0.01"
max="10000"
step="any"
value={bitrate}
onChange={(e) => setBitrate(e.target.value)}
/>
</label>
)}
<label>
Резерв места, %
<input
type="number"
min="0"
max="99"
step="any"
value={reserve}
onChange={(e) => setReserve(e.target.value)}
/>
</label>
</div>
<div className="time-result" role="status" aria-live="polite">
<span>ОЦЕНКА ВРЕМЕНИ</span>
<strong>
{valid
? `${Math.floor(seconds / 3600)} ч ${Math.floor((seconds % 3600) / 60)} мин ${seconds % 60} с`
: "Проверьте значения"}
</strong>
<p>
{valid
? "До перезаписи старейших файлов при заданных условиях."
: "Нужны положительные размеры и скорость; камеры — целое число от 1 до 16, резерв — от 0 до 99%."}
</p>
<small>
{mode === "frames"
? "Размер кадра × частота × число камер"
: "Сумма битрейтов всех камер"}
</small>
</div>
</div>
</>
);
}
export { Calculator as default } from "@/fsd/features/recording-estimate";
@@ -1,69 +1,5 @@
import Calculator from "./Calculator";
import { RecordingToolPage } from "@/fsd/pages/recording-tool";
export const metadata = {
title: "Расчёт длительности записи — JPEG и видеопоток",
};
export default function Page() {
return (
<main id="main-content" className="calculator-page">
<a className="back-link" href="/library">
← К библиотеке
</a>
<p className="kicker">ПРАКТИЧЕСКИЙ РАСЧЁТ</p>
<h1>
Сколько записи
<br />
поместится на носителе?
</h1>
<p className="lede">
Для покадровой СВК используйте размер JPEG и частоту. Для современного
видеопотока — суммарный битрейт. Расчёт не подтверждает совместимость
карты.
</p>
<Calculator />
<div className="calculation-notes">
<section>
<h2>Как измерить размер JPEG</h2>
<p>
Возьмите несколько исходных кадров из обычной поездки. Разделите их
общий размер в байтах на число кадров и на 1000. Получится средний
размер в десятичных КБ. Разные сцены сжимаются неодинаково, поэтому
один случайный кадр даёт грубую оценку.
</p>
<p>
Частоту задавайте для одной камеры, затем укажите число камер. Если
камеры работают с разной частотой или размером кадра, посчитайте их
скорости отдельно и сложите: КБ/кадр × кадров/с.
</p>
<pre tabIndex={0}>
<code>
Время, с = ГБ × 1 000 000 × (1 − резерв/100) ÷ (КБ/кадр × кадров/с
× камер)
</code>
</pre>
</section>
<section>
<h2>Проверочный пример</h2>
<p>
1 ГБ, средний JPEG 100 КБ, 5 кадров/с с каждой из двух камер и
нулевой резерв дают 1000 секунд: 16 минут 40 секунд. Это
арифметический пример, а не измеренная характеристика определённого
СВК.
</p>
<h2>Для видеопотока</h2>
<p>
Сложите битрейты всех камер, включая звук, если он не входит в
указанное значение. Для 128 ГБ, 40 Мбит/с и резерва 10% получится 6
часов 24 минуты. Переменный битрейт, служебные данные и защищённые
файлы изменяют фактический результат.
</p>
<p>
Десятичные ГБ и КБ соответствуют расчёту по размерам файлов в
байтах. Резерв 10% — настраиваемый пример, а не измеренное свойство
носителя.
</p>
<a href="/faq.shtml">Почему старые таблицы времени различаются →</a>
</section>
</div>
</main>
);
}
export default RecordingToolPage;
+3
View File
@@ -0,0 +1,3 @@
import { UiKitPage } from "@/fsd/pages/ui-kit";
export const metadata = { title: "Элементы интерфейса библиотеки" };
export default UiKitPage;
+1 -37
View File
@@ -1,37 +1 @@
"use client";
import { useState } from "react";
type Frame = { src: string; filename: string; width: number; height: number };
export default function FrameGallery({ frames }: { frames: Frame[] }) {
const [all, setAll] = useState(false);
const visible = all ? frames : frames.slice(0, 6);
return (
<div className="frame-gallery">
<p className="frame-count" role="status">
Показано доступных кадров: {visible.length} из {frames.length}
</p>
<div className="frame-grid">
{visible.map((f, i) => (
<figure key={f.src}>
<a href={f.src} aria-label={"Открыть исходный кадр " + f.filename}>
<img
src={f.src}
width={f.width}
height={f.height}
alt={"Кадр дорожной последовательности " + f.filename}
loading={i < 2 ? "eager" : "lazy"}
/>
</a>
<figcaption>
{f.filename} · {f.width}×{f.height}
</figcaption>
</figure>
))}
</div>
{frames.length > 6 && (
<button type="button" onClick={() => setAll((v) => !v)}>
{all ? "Свернуть серию" : "Показать доступные " + frames.length + " кадров"}
</button>
)}
</div>
);
}
export { FrameGallery as default } from "@/fsd/features/frame-gallery";
+3 -100
View File
@@ -1,100 +1,3 @@
import { z } from "zod";
import recovered from "./v2-articles.json";
import community from "./v2-community.json";
import externalApprovals from "./v2-link-approvals.json";
const localPath = z.string().regex(/^\/(?!\/)[a-zA-Z0-9/_.-]*$/);
const approvedHref = z.string().refine(value => localPath.safeParse(value).success || externalApprovals.some(item => item.destination === value), "Unreviewed outbound URL");
const sectionSchema = z.object({
gallery: z
.array(
z.object({
src: localPath,
filename: z.string(),
width: z.number().positive(),
height: z.number().positive(),
}),
)
.optional(),
heading: z.string().min(1),
paragraphs: z.array(z.string().min(1)),
list: z.array(z.string()).optional(),
note: z.string().optional(),
code: z.string().optional(),
links: z.array(z.object({ href: approvedHref, label: z.string() })).optional(),
figure: z
.object({
src: localPath,
alt: z.string().min(12),
caption: z.string(),
diagram: z.boolean().optional(),
small: z.boolean().optional(),
})
.optional(),
table: z
.object({
caption: z.string(),
head: z.array(z.string()).min(2),
rows: z.array(z.array(z.string())),
})
.optional(),
});
const articleSchema = z.object({
path: localPath,
title: z.string().min(3),
category: z.string(),
summary: z.string(),
date: z.string(),
kind: z.enum(["recovered", "linked-source", "recovered-media"]),
sourcePaths: z.array(z.string()),
rawFiles: z.array(z.string()),
sections: z.array(sectionSchema).min(1),
related: z.array(localPath),
});
export const articles = z
.array(articleSchema)
.parse([...recovered, ...community]);
export type LibraryArticle = z.infer<typeof articleSchema>;
export function findArticle(path: string) {
return articles.find((article) => article.path === path);
}
export function articleText(article: LibraryArticle) {
return article.sections
.map((s) =>
[
s.heading,
...s.paragraphs,
...(s.list ?? []),
s.note ?? "",
s.code ?? "",
...(s.links ?? []).map((link) => link.label),
s.table?.head.join(" ") ?? "",
s.table?.rows.flat().join(" ") ?? "",
].join(" "),
)
.join(" ");
}
export const searchIndex = articles.map((article) => ({
path: article.path,
title: article.title,
summary: article.summary,
category: article.category,
date: article.date,
text: articleText(article),
}));
if (new Set(articles.map((x) => x.path)).size !== articles.length)
throw new Error("Duplicate article path");
for (const article of articles) {
for (const section of article.sections) {
for (const link of section.links ?? []) {
if (link.href.startsWith("http") && !externalApprovals.some(item => item.sourcePage === article.path && item.destination === link.href && item.anchor === link.label && item.reviewed)) throw new Error("Unreviewed page/link context: " + article.path);
}
}
for (const section of article.sections) {
if (
section.table?.rows.some(
(row) => row.length !== section.table!.head.length,
)
)
throw new Error("Invalid table: " + article.path);
}
}
// Compatibility API; active domain ownership is fsd/entities/article.
export { articles, findArticle, articleText, searchIndex } from "@/fsd/entities/article";
export type { LibraryArticle } from "@/fsd/entities/article";
@@ -83,5 +83,22 @@
"playbackWatched": false
},
"reason": "Specific original technical demonstration, not a paid insertion; direct link only, no remote player/script/pixel loaded by this site."
},
{
"sourcePage": "/metrika.js",
"destination": "https://mc.yandex.ru/metrika/tag.js",
"anchor": "nction () { (window.ym.a = window.ym.a || []).push(arguments); };\n window.ym.l = Number(new Date());\n var tag = document.createElement(\"script\");\n tag.async = true;\n tag.src = \"https://mc.yandex.ru/metrika/tag.js\";\n document.head.appendChild(tag);\n window.ym(counter, \"init\", {\n webvisor: false, clickmap: true, trackLinks: true,\n accurateTrackBounce: true, trackHash: false\n });\n fu",
"purpose": "Authorized first-party integration of existing counter109268682; one async official vendor tag on exactpublichosts only",
"decision": "keep",
"reviewed": true,
"verification": {
"method": "ActualofficialYandexinitialization+CSPdocs andsourcehostguard review",
"officialDocs": [
"https://yandex.com/support/metrica/en/code/counter-initialize",
"https://yandex.ru/support/metrica/ru/code/install-counter-csp"
],
"projectContract": "docs/metrika/counters-and-contract.json"
},
"reason": "Authorized analytics infrastructure, not recovered editorial content; webvisorfalse/default15s accuratebounce/noextra hit, no customquery or PII; localhost disabled. Runtime request interception tested separately."
}
]
+43
View File
@@ -0,0 +1,43 @@
import { createElement } from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { readFileSync } from 'node:fs';
import { describe, expect, it } from 'vitest';
import { analytics, designTokens } from '@/fsd/shared/config';
import { SiteShell } from '@/fsd/widgets/site-shell';
import { UiKitPage } from '@/fsd/pages/ui-kit';
import { PrivacyPage } from '@/fsd/pages/services';
const luminance = (hex: string) => hex.slice(1).match(/../g)!.map(v => parseInt(v,16)/255).map(v => v <= .04045 ? v/12.92 : ((v+.055)/1.055)**2.4).reduce((n,v,i) => n + v * [.2126,.7152,.0722][i],0);
const contrast = (a: string,b: string) => { const [lo,hi]=[luminance(a),luminance(b)].sort((x,y)=>x-y);return (hi+.05)/(lo+.05); };
describe('used reading system and explicit analytics boundary', () => {
it('keeps design-only shell free of rejected analytics and privacy consistent', () => {
expect(analytics.enabled).toBe(false);
const shell=renderToStaticMarkup(createElement(SiteShell,{children:createElement('main',null,'текст')}));
expect(shell).not.toContain('/metrika.js');expect(shell).not.toContain('mc.yandex');
expect(renderToStaticMarkup(createElement(PrivacyPage))).toContain('счётчик Яндекс Метрики не подключён');
});
it('uses one prefixed working search/calculator demo and no reading-eligible article', () => {
const html=renderToStaticMarkup(createElement(UiKitPage));
expect(html).toContain('id="demo-search-query"');expect(html).not.toContain('id="library-query"');
expect(html).toContain('name="demo-recording-mode"');expect(html).not.toContain('<article');
const ids=[...html.matchAll(/\bid="([^"]+)"/g)].map(m=>m[1]);expect(new Set(ids).size).toBe(ids.length);
expect(html).toContain('Logitech QuickCam for notebooks Pro Carl Zeiss optics');
expect(html).toContain('USB.BIN');expect(html).not.toContain('href="#"');
});
it('binds documented semantic palette to used CSS and real readable contrast', () => {
const css=readFileSync('web-front/src/fsd/shared/styles/tokens.css','utf8');
for(const [name,value] of Object.entries(designTokens.palette))expect(css).toContain(`--color-${name}: ${value};`);
const p=designTokens.palette;
for(const name of ['text-primary','text-secondary','link'] as const)for(const bg of ['surface-paper','surface-sheet'] as const)expect(contrast(p[name],p[bg])).toBeGreaterThanOrEqual(4.5);
expect(contrast(p['text-inverse-muted'],p['surface-inverse'])).toBeGreaterThanOrEqual(4.5);
expect(contrast(p['accent-inverse'],p['surface-inverse'])).toBeGreaterThanOrEqual(4.5);
expect(contrast(p['focus'],p['surface-paper'])).toBeGreaterThanOrEqual(3);
expect(contrast(p['border-control'],p['surface-sheet'])).toBeGreaterThanOrEqual(3);
for(const theme of Object.values(designTokens.themes)) {
for(const name of ['text-primary','text-secondary','link'] as const)for(const bg of ['surface-paper','surface-sheet'] as const)expect(contrast(theme[name],theme[bg])).toBeGreaterThanOrEqual(4.5);
expect(contrast(theme['text-note'],theme['surface-note'])).toBeGreaterThanOrEqual(4.5);
expect(contrast(theme['text-action'],theme['accent-inverse'])).toBeGreaterThanOrEqual(4.5);
expect(contrast(theme['focus'],theme['surface-sheet'])).toBeGreaterThanOrEqual(3);
}
});
});
@@ -0,0 +1,2 @@
export { articles, findArticle, articleText, searchIndex } from "./model";
export type { LibraryArticle } from "./model";
+100
View File
@@ -0,0 +1,100 @@
import { z } from "zod";
import recovered from "@/content/v2-articles.json";
import community from "@/content/v2-community.json";
import externalApprovals from "@/content/v2-link-approvals.json";
const localPath = z.string().regex(/^\/(?!\/)[a-zA-Z0-9/_.-]*$/);
const approvedHref = z.string().refine(value => localPath.safeParse(value).success || externalApprovals.some(item => item.destination === value), "Unreviewed outbound URL");
const sectionSchema = z.object({
gallery: z
.array(
z.object({
src: localPath,
filename: z.string(),
width: z.number().positive(),
height: z.number().positive(),
}),
)
.optional(),
heading: z.string().min(1),
paragraphs: z.array(z.string().min(1)),
list: z.array(z.string()).optional(),
note: z.string().optional(),
code: z.string().optional(),
links: z.array(z.object({ href: approvedHref, label: z.string() })).optional(),
figure: z
.object({
src: localPath,
alt: z.string().min(12),
caption: z.string(),
diagram: z.boolean().optional(),
small: z.boolean().optional(),
})
.optional(),
table: z
.object({
caption: z.string(),
head: z.array(z.string()).min(2),
rows: z.array(z.array(z.string())),
})
.optional(),
});
const articleSchema = z.object({
path: localPath,
title: z.string().min(3),
category: z.string(),
summary: z.string(),
date: z.string(),
kind: z.enum(["recovered", "linked-source", "recovered-media"]),
sourcePaths: z.array(z.string()),
rawFiles: z.array(z.string()),
sections: z.array(sectionSchema).min(1),
related: z.array(localPath),
});
export const articles = z
.array(articleSchema)
.parse([...recovered, ...community]);
export type LibraryArticle = z.infer<typeof articleSchema>;
export function findArticle(path: string) {
return articles.find((article) => article.path === path);
}
export function articleText(article: LibraryArticle) {
return article.sections
.map((s) =>
[
s.heading,
...s.paragraphs,
...(s.list ?? []),
s.note ?? "",
s.code ?? "",
...(s.links ?? []).map((link) => link.label),
s.table?.head.join(" ") ?? "",
s.table?.rows.flat().join(" ") ?? "",
].join(" "),
)
.join(" ");
}
export const searchIndex = articles.map((article) => ({
path: article.path,
title: article.title,
summary: article.summary,
category: article.category,
date: article.date,
text: articleText(article),
}));
if (new Set(articles.map((x) => x.path)).size !== articles.length)
throw new Error("Duplicate article path");
for (const article of articles) {
for (const section of article.sections) {
for (const link of section.links ?? []) {
if (link.href.startsWith("http") && !externalApprovals.some(item => item.sourcePage === article.path && item.destination === link.href && item.anchor === link.label && item.reviewed)) throw new Error("Unreviewed page/link context: " + article.path);
}
}
for (const section of article.sections) {
if (
section.table?.rows.some(
(row) => row.length !== section.table!.head.length,
)
)
throw new Error("Invalid table: " + article.path);
}
}
@@ -0,0 +1,2 @@
import { analytics } from "@/fsd/shared/config";
export function AnalyticsTag() { return analytics.enabled ? <script src="/metrika.js" defer /> : null; }
@@ -0,0 +1 @@
export { default as FrameGallery } from "./ui";
@@ -0,0 +1,38 @@
"use client";
import { useState } from "react";
import { Button } from "@/fsd/shared/ui";
type Frame = { src: string; filename: string; width: number; height: number };
export default function FrameGallery({ frames }: { frames: Frame[] }) {
const [all, setAll] = useState(false);
const visible = all ? frames : frames.slice(0, 6);
return (
<div className="frame-gallery">
<p className="frame-count" role="status">
Показано доступных кадров: {visible.length} из {frames.length}
</p>
<div className="frame-grid">
{visible.map((f, i) => (
<figure key={f.src}>
<a href={f.src} aria-label={"Открыть исходный кадр " + f.filename}>
<img
src={f.src}
width={f.width}
height={f.height}
alt={"Кадр дорожной последовательности " + f.filename}
loading={i < 2 ? "eager" : "lazy"}
/>
</a>
<figcaption>
{f.filename} · {f.width}×{f.height}
</figcaption>
</figure>
))}
</div>
{frames.length > 6 && (
<Button type="button" onClick={() => setAll((v) => !v)}>
{all ? "Свернуть серию" : "Показать доступные " + frames.length + " кадров"}
</Button>
)}
</div>
);
}
@@ -0,0 +1 @@
export { default as Search } from "./ui";
@@ -0,0 +1,96 @@
"use client";
import { useEffect, useState } from "react";
import { Button, Input, Select, ContentCard, StateMessage } from "@/fsd/shared/ui";
import { analytics } from "@/fsd/shared/config";
type Entry = {
path: string;
title: string;
summary: string;
category: string;
date: string;
text: string;
};
const normalized = (value: string) =>
value
.toLocaleLowerCase("ru")
.replaceAll("ё", "е")
.replace(/\s+/g, " ")
.trim();
export default function Search({ entries, idPrefix = "library", emitAnalytics = true }: { entries: Entry[]; idPrefix?: string; emitAnalytics?: boolean }) {
const [query, setQuery] = useState("");
const [category, setCategory] = useState("Все темы");
const categories = ["Все темы", ...new Set(entries.map((a) => a.category))];
const words = normalized(query).split(" ").filter(Boolean);
const found = entries.filter(
(a) =>
(category === "Все темы" || a.category === category) &&
words.every((word) =>
normalized(a.title + " " + a.summary + " " + a.text).includes(word),
),
);
useEffect(() => {
if (!analytics.enabled || !emitAnalytics || !query.trim() || found.length !== 0) return;
// Wait until the live filtered zero state is displayed, not an initial page state.
const timer = setTimeout(() => document.dispatchEvent(new Event("videoreg:search-zero-results")), 500);
return () => clearTimeout(timer);
}, [query, category, found.length, emitAnalytics]);
return (
<>
<div className="search-panel">
<label htmlFor={idPrefix + "-query"}>Найти в материалах</label>
<div className="query-row">
<Input
id={idPrefix + "-query"}
type="search"
placeholder="Например: GPS, USB или резервная копия"
value={query}
onChange={(e) => setQuery(e.target.value)}
/>
<Button
type="button"
onClick={() => {
setQuery("");
setCategory("Все темы");
}}
>
Сбросить
</Button>
</div>
<label htmlFor={idPrefix + "-category"}>Раздел</label>
<Select
id={idPrefix + "-category"}
value={category}
onChange={(e) => setCategory(e.target.value)}
>
{categories.map((c) => (
<option key={c}>{c}</option>
))}
</Select>
</div>
<p className="result-count" role="status">
Найдено материалов: {found.length}
</p>
<div className="search-results">
{found.map((a) => (
<ContentCard key={a.path} href={a.path} title={a.title} summary={a.summary} eyebrow={a.category + " · " + a.date} />
))}
</div>
{found.length === 0 && (
<StateMessage className="empty" title="Такого сочетания пока нет">
<p>
Попробуйте название модели, «карта», «кадры» или уберите фильтр
раздела.
</p>
<Button
onClick={() => {
setQuery("");
setCategory("Все темы");
}}
>
Показать все материалы
</Button>
</StateMessage>
)}
</>
);
}
@@ -0,0 +1,9 @@
"use client";
import { useState } from "react";
import { Select } from "@/fsd/shared/ui";
export type PreviewEntry={path:string;title:string;source:string;components:string};
export function PagePreview({ entries }: { entries: PreviewEntry[] }) {
const [selected,setSelected]=useState(entries[0].path),[width,setWidth]=useState("100%");
const entry=entries.find(e=>e.path===selected)!;
return <div><div className="page-preview-controls"><label htmlFor="kit-real-page">Полная страница<Select id="kit-real-page" value={selected} onChange={e=>setSelected(e.target.value)}>{entries.map(e=><option key={e.path} value={e.path}>{e.title}</option>)}</Select></label><label htmlFor="kit-page-width">Ширина просмотра<Select id="kit-page-width" value={width} onChange={e=>setWidth(e.target.value)}><option value="100%">По контейнеру</option><option value="390px">390 px</option><option value="320px">320 px</option></Select></label><a href={entry.path} target="_blank" rel="noreferrer">Открыть отдельно ↗</a></div><p className="kit-usage"><code>{entry.source}</code><br />{entry.components}</p><p className="review-note">Здесь загружена настоящая страница этой сборки, составленная из тех же компонентов. Тема синхронизируется с выбором в шапке. Это не статический макет.</p><div className="page-preview-shell"><iframe title={"Полная страница: "+entry.title} src={entry.path} style={{width}} loading="lazy" /></div></div>;
}
@@ -0,0 +1 @@
export { default as Calculator } from "./ui";
@@ -0,0 +1,161 @@
"use client";
import { useState } from "react";
import { Input, Field } from "@/fsd/shared/ui";
export default function Calculator({ idPrefix = "recording" }: { idPrefix?: string }) {
const [mode, setMode] = useState("frames");
const [capacity, setCapacity] = useState("1");
const [reserve, setReserve] = useState("10");
const [frameSize, setFrameSize] = useState("64");
const [fps, setFps] = useState("5");
const [cameras, setCameras] = useState("1");
const [bitrate, setBitrate] = useState("40");
const values = [
capacity,
reserve,
...(mode === "frames" ? [frameSize, fps, cameras] : [bitrate]),
];
const [c, s, k, f, n, r] = [
Number(capacity),
Number(reserve),
Number(frameSize),
Number(fps),
Number(cameras),
Number(bitrate),
];
const valid =
values.every((v) => v.trim() !== "" && Number.isFinite(Number(v))) &&
c > 0 &&
c <= 100000 &&
s >= 0 &&
s < 100 &&
(mode === "frames"
? k > 0 &&
k <= 100000 &&
f > 0 &&
f <= 1000 &&
Number.isInteger(n) &&
n >= 1 &&
n <= 16
: r > 0 && r <= 10000);
const seconds = valid
? Math.floor(
mode === "frames"
? (c * 1e6 * (1 - s / 100)) / (k * f * n)
: (c * 8000 * (1 - s / 100)) / r,
)
: 0;
return (
<>
<fieldset className="mode-choice">
<legend>Способ записи</legend>
<label>
<Input
type="radio"
name={idPrefix + "-mode"}
value="frames"
checked={mode === "frames"}
onChange={() => setMode("frames")}
/>{" "}
JPEG-кадры
</label>
<label>
<Input
type="radio"
name={idPrefix + "-mode"}
value="stream"
checked={mode === "stream"}
onChange={() => setMode("stream")}
/>{" "}
Видеопоток
</label>
</fieldset>
<div className="calculation-layout">
<div className="input-fields">
<Field id={idPrefix+"-capacity"} label="Ёмкость носителя, ГБ" hint="Десятичные ГБ; больше нуля, не более 100 000." error={capacity.trim()==="" || !Number.isFinite(c) || c<=0 || c>100000 ? "Введите ёмкость больше нуля и не более 100 000 ГБ." : undefined}>
<Input id={idPrefix+"-capacity"} type="number" min="0.001" max="100000" step="any" value={capacity} aria-invalid={capacity.trim()==="" || !Number.isFinite(c) || c<=0 || c>100000} aria-describedby={idPrefix+"-capacity-hint"+(capacity.trim()==="" || !Number.isFinite(c) || c<=0 || c>100000 ? " "+idPrefix+"-capacity-error":"")} onChange={e=>setCapacity(e.target.value)} />
</Field>
{mode === "frames" ? (
<>
<label>
Средний размер одного JPEG, КБ
<Input
type="number"
min="0.001"
max="100000"
step="any"
value={frameSize}
onChange={(e) => setFrameSize(e.target.value)}
/>
</label>
<div className="input-pair">
<label>
Кадров/с на камеру
<Input
type="number"
min="0.01"
max="1000"
step="any"
value={fps}
onChange={(e) => setFps(e.target.value)}
/>
</label>
<label>
Число камер
<Input
type="number"
min="1"
max="16"
step="1"
value={cameras}
onChange={(e) => setCameras(e.target.value)}
/>
</label>
</div>
</>
) : (
<label>
Суммарный битрейт, Мбит/с
<Input
type="number"
min="0.01"
max="10000"
step="any"
value={bitrate}
onChange={(e) => setBitrate(e.target.value)}
/>
</label>
)}
<label>
Резерв места, %
<Input
type="number"
min="0"
max="99"
step="any"
value={reserve}
onChange={(e) => setReserve(e.target.value)}
/>
</label>
</div>
<div className="time-result" role="status" aria-live="polite">
<span>ОЦЕНКА ВРЕМЕНИ</span>
<strong>
{valid
? `${Math.floor(seconds / 3600)} ч ${Math.floor((seconds % 3600) / 60)} мин ${seconds % 60} с`
: "Проверьте значения"}
</strong>
<p>
{valid
? "До перезаписи старейших файлов при заданных условиях."
: mode === "frames" ? "Нужны положительные размеры и скорость; камеры — целое число от 1 до 16, резерв — от 0 до 99%." : "Нужны положительные ёмкость и суммарный битрейт; резерв — от 0 до 99%."}
</p>
<small>
{mode === "frames"
? "Размер кадра × частота × число камер"
: "Сумма битрейтов всех камер"}
</small>
</div>
</div>
</>
);
}
@@ -0,0 +1,31 @@
'use client';
import { useSyncExternalStore } from 'react';
import { getThemeChoice, setThemeChoice, subscribeThemeChoice, type ThemeChoice } from '@/fsd/shared/lib';
const choices = [
{ value: 'system', label: 'Системная тема' },
{ value: 'light', label: 'Светлая тема' },
{ value: 'dark', label: 'Тёмная тема' },
] as const;
const serverChoice = (): ThemeChoice => 'system';
function ThemeIcon({ choice }: { choice: ThemeChoice }) {
return <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false">
{choice === 'system' ? <><rect x="2" y="3" width="17" height="12" rx="1"/><path d="M8 19h6M11 15v4M16 22l3-7 3 7M17 20h4"/></>
: choice === 'light' ? <><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5 19 19M5 19l1.5-1.5M17.5 6.5 19 5"/></>
: <path d="M20.5 14.3A9 9 0 0 1 9.7 3.5a9 9 0 1 0 10.8 10.8Z"/>}
</svg>;
}
export function ThemeSwitch({ idPrefix }: { idPrefix: string }) {
const choice = useSyncExternalStore(subscribeThemeChoice, getThemeChoice, serverChoice);
const index = choices.findIndex(item => item.value === choice);
const next = choices[(index + 1) % choices.length].value;
const currentNames = { system: 'системная', light: 'светлая', dark: 'тёмная' };
const nextNames = { system: 'системную', light: 'светлую', dark: 'тёмную' };
const label = `Тема: ${currentNames[choice]}. Переключить на ${nextNames[next]}`;
return <button className="theme-cycle" id={`${idPrefix}-theme`} type="button" aria-label={label} title={label} onClick={() => setThemeChoice(next)}>
{choices.map(item => <span key={item.value} className={`theme-cycle-icon theme-cycle-icon-${item.value}`} aria-hidden="true"><ThemeIcon choice={item.value}/></span>)}
</button>;
}
+62
View File
@@ -0,0 +1,62 @@
import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import { articles, searchIndex } from "@/fsd/entities/article";
import { ArticleReader } from "@/fsd/widgets/article-reader";
import { Search } from "@/fsd/features/library-search";
import { Calculator } from "@/fsd/features/recording-estimate";
const text = (value: string) => renderToStaticMarkup(createElement("span", null, value)).slice(6, -7);
describe("active FSD migration contracts", () => {
it("renders every real section, preserved anchor, paragraph, list, code and table cell", () => {
for (const article of articles) {
const html = renderToStaticMarkup(createElement(ArticleReader, { article }));
expect(html).toContain('class="article-body"');
for (const [i, section] of article.sections.entries()) {
expect(html).toContain(`id="section-${i}"`);
expect(html).toContain(`href="#section-${i}"`);
expect(html).toContain(`<h2>${text(section.heading)}</h2>`);
for (const paragraph of section.paragraphs) expect(html).toContain(`<p>${text(paragraph)}</p>`);
for (const value of section.list ?? []) expect(html).toContain(`<li>${text(value)}</li>`);
if (section.note) expect(html).toContain(text(section.note));
if (section.code) expect(html).toContain(`<code>${text(section.code)}</code>`);
if (section.table) {
expect(html).toContain(`<caption>${text(section.table.caption)}</caption>`);
for (const value of [...section.table.head, ...section.table.rows.flat()]) expect(html).toContain(text(value));
}
if (section.figure) {
expect(html).toContain(`src="${section.figure.src}"`);
expect(html).toContain(`<figcaption>${text(section.figure.caption)}</figcaption>`);
}
for (const link of section.links ?? []) {
expect(html).toContain(`href="${text(link.href)}"`);
expect(html).toContain(text(link.label));
}
for (const frame of (section.gallery ?? []).slice(0, 6)) {
expect(html).toContain(`src="${frame.src}"`);
expect(html).toContain(text(frame.filename));
}
}
for (const path of article.related) expect(html).toContain(`href="${path}"`);
}
});
it("keeps production search IDs and namespaces functional demo IDs", () => {
const live = renderToStaticMarkup(createElement(Search, { entries: searchIndex }));
const demo = renderToStaticMarkup(createElement(Search, { entries: searchIndex, idPrefix: "demo-search", emitAnalytics: false }));
expect(live).toContain('id="library-query"');
expect(live).toContain('for="library-category"');
expect(demo).toContain('id="demo-search-query"');
expect(demo).toContain('for="demo-search-category"');
expect(demo).not.toContain('id="library-query"');
for (const entry of searchIndex) expect(live).toContain(`href="${entry.path}"`);
});
it("isolates calculator radio groups and preserves the numeric default estimate", () => {
const live = renderToStaticMarkup(createElement(Calculator));
const demo = renderToStaticMarkup(createElement(Calculator, { idPrefix: "demo-recording" }));
expect(live).toContain('name="recording-mode"');
expect(demo).toContain('name="demo-recording-mode"');
expect(demo).not.toContain('name="recording-mode"');
expect(live).toContain("0 ч 46 мин 52 с");
expect(demo).toContain("0 ч 46 мин 52 с");
});
});
+1
View File
@@ -0,0 +1 @@
export { AboutPage } from "./ui";
+44
View File
@@ -0,0 +1,44 @@
export function AboutPage() {
return (
<main id="main-content" className="about-page">
<p className="kicker">VIDEOREG</p>
<h1>Библиотека систем СВК</h1>
<p className="lede">
Устройство, эксплуатация и чтение записи — без витрины продаж.
</p>
<p>
Здесь доступны отобранные технические материалы, пять полных PDF-документов
и подборки кадров. Это не полный архив всех прежних страниц и файлов
videoreg.ru. Ограничения неполных подборок и недоступных файлов указаны
непосредственно в соответствующем материале.
</p>
<h2>Для кого эти материалы</h2>
<p>
Для владельца старого блока СВК, которому нужна инструкция своего
поколения, таблица камер или объяснение покадровой записи. Отдельные
материалы помогают понять устройство ранних автомобильных систем
регистрации.
</p>
<h2>Сначала модель и редакция</h2>
<p>
Страницы разных лет относятся к разным аппаратным версиям. Даты у
материалов помогают различать поколения. Указанные там камеры, носители
и параметры не являются универсальной рекомендацией для современного
оборудования.
</p>
<h2>Как пользоваться</h2>
<p>
Начните с устройства системы, затем откройте инструкцию подходящего
блока. Для поиска конкретной ошибки или камеры используйте поиск по
полным текстам. Исходные PDF открываются внутри сайта; программы и
прошивки автоматически не запускаются.
</p>
<div className="about-links">
<a href="/system">Устройство СВК →</a>
<a href="/library">Материалы и поиск →</a>
<a href="/down.shtml">Документы →</a>
</div>
</main>
);
}
+1
View File
@@ -0,0 +1 @@
export { ArticlePage } from "./ui";
+3
View File
@@ -0,0 +1,3 @@
import { ArticleReader } from "@/fsd/widgets/article-reader";
import type { LibraryArticle } from "@/fsd/entities/article";
export function ArticlePage({ article }: { article: LibraryArticle }) { return <ArticleReader article={article} />; }
@@ -0,0 +1 @@
export { CommunityPage } from "./ui";
+28
View File
@@ -0,0 +1,28 @@
import { ContentCard } from "@/fsd/shared/ui";
import { articles } from "@/fsd/entities/article";
export function CommunityPage() {
return (
<main id="main-content" className="library-page">
<p className="kicker">ЭКСПЛУАТАЦИЯ / РАЗБОРЫ</p>
<h1>
Проблема и условия,
<br />в которых она возникла.
</h1>
<p className="lede">
Два разбора из обсуждений владельцев СВК. Частный опыт не превращён в
обещание совместимости любого оборудования.
</p>
<div className="search-results">
{articles
.filter((a) => a.path.startsWith("/community/"))
.map((a) => (
<ContentCard key={a.path} href={a.path} title={a.title} summary={a.summary} eyebrow={"Обсуждение · " + a.date} />
))}
</div>
<p style={{ marginTop: 32 }}>
<a href="/faq.shtml">Также: ответы по конструкции и настройке →</a>
</p>
</main>
);
}
+1
View File
@@ -0,0 +1 @@
export { HomePage } from "./ui";
+11
View File
@@ -0,0 +1,11 @@
import { ActionLink, ContentCard, ImageFigure, Notice } from "@/fsd/shared/ui";
import { articles, findArticle } from "@/fsd/entities/article";
export function HomePage() {
const rain=findArticle("/samples/rain")!; const frames=rain.sections.find(s=>s.gallery)!.gallery!;
const paths=["/system","/manuals/svk007","/support.shtml","/samples.shtml"];
return <main id="main-content"><section className="home-intro"><div className="intro-copy"><p className="kicker">ИСТОРИЧЕСКИЕ СИСТЕМЫ СВК · 2005–2014</p><h1>Сначала — система.<br />Затем — кадр.</h1><p className="lede">Найдите своё поколение СВК, откройте инструкцию и проверьте исходную запись. Камеры отдельно, JPEG — на съёмном носителе.</p><ActionLink href="/system">Как устроена СВК ↗</ActionLink><a className="hero-secondary" href="/down.shtml">Найти инструкцию →</a></div><div className="hero-recording"><ImageFigure src={frames[0].src} alt="Исходный дорожный кадр в сильный дождь с камеры Genius Videocam WEB." caption={frames[0].filename+" · "+frames[0].width+" × "+frames[0].height+" · исходный JPEG"} width={frames[0].width} height={frames[0].height} loading="eager" /><div className="recording-strip">{frames.slice(1,3).map(f=><a href={f.src} key={f.src}><img src={f.src} alt={"Исходный кадр "+f.filename} width={f.width} height={f.height} /></a>)}<p>30 из 36 кадров<br />Серия неполная</p></div></div></section>
<section className="home-path"><div><p className="kicker">ВАША ЗАДАЧА</p><h2>Разобраться<br />по порядку</h2></div><div className="task-index">{paths.map((p,i)=>{const a=findArticle(p)!;return <ContentCard key={p} href={p} title={a.title} summary={a.summary} eyebrow={String(i+1).padStart(2,"0")+" / "+a.category+" · "+a.date} variant="index" headingLevel="h3" />})}</div></section>
<section className="home-library"><div className="section-title"><div><p className="kicker">ПОКОЛЕНИЕ И ДОКУМЕНТ</p><h2>Сверьте свой блок</h2></div><a href="/catalog">Модели и комплекты →</a></div><div className="device-dossier"><ImageFigure src="/archive-media/svk006-front.jpg" alt="Передняя панель СВК-006: USB A и B, слот SD CARD и индикаторы." caption="СВК-006. Фотография конкретного блока; составы разных поколений отличаются." width={800} height={528} /><div><h3>Не переносите параметры между версиями</h3><p>В библиотеке рядом остаются дата документа, название модели и оговорки источника. Частота кадров, число каналов и носитель зависят от исполнения.</p><ActionLink href="/manuals/svk007">Паспорт СВК-007 · 2008 ↗</ActionLink><p><a href="/manuals/quickstart">СВК-006/007: начинаем работу →</a></p></div></div></section>
<section className="home-workbench"><div><p className="kicker">ПРОВЕРИТЬ ЗАПИСЬ</p><h2>Оригинал важнее пересказа</h2><p>Дождь, вечер и GPS: сравнивайте исходные файлы с их реальными ограничениями.</p><Notice>По разрывам неполной серии нельзя подтверждать остановку камеры. Наличие GPSInfo не гарантирует корректность координат.</Notice><p><a href={rain.path}>{rain.title} →</a></p><p><a href="/samples/gps">Четыре исходных JPEG с GPSInfo →</a></p></div><div className="formula-note"><span className="kicker">ОЦЕНКА ВРЕМЕНИ</span><h3>Сколько поместится?</h3><p>Размер JPEG × частота × камеры. Учитывайте резерв и реальные условия.</p><ActionLink href="/tools/recording-time">Рассчитать длительность ↗</ActionLink></div></section>
<section className="home-case"><div><p className="kicker">ИЗ ПРАКТИКИ</p><h2>Конкретный случай.<br />Понятные границы.</h2><p>Обсуждение владельца — наблюдение, а не обещание совместимости любого оборудования.</p></div><div>{articles.filter(a=>a.path.startsWith("/community/")).map(a=><ContentCard key={a.path} href={a.path} title={a.title} summary={a.summary} eyebrow={a.date} variant="index" headingLevel="h3" />)}</div></section></main>;
}
+1
View File
@@ -0,0 +1 @@
export { LibraryPage } from "./ui";
+18
View File
@@ -0,0 +1,18 @@
import { searchIndex } from "@/fsd/entities/article";
import { Search } from "@/fsd/features/library-search";
export function LibraryPage() {
return (
<main className="library-page" id="main-content">
<div className="page-heading">
<p className="kicker">КАТАЛОГ ЗНАНИЙ</p>
<h1>Техническая библиотека</h1>
<p className="lede">
Ищите по полным текстам, названиям камер и моделям блоков. Всё
работает здесь, без запроса к стороннему поиску.
</p>
</div>
<Search entries={searchIndex} />
</main>
);
}
@@ -0,0 +1 @@
export { NotFoundPage } from "./ui";
+9
View File
@@ -0,0 +1,9 @@
import { StateMessage, ActionLink } from "@/fsd/shared/ui";
export function NotFoundPage() {
return <main id="main-content" className="not-found">
<p className="kicker">404 / СТРАНИЦА НЕ НАЙДЕНА</p>
<StateMessage headingLevel="h1" title={<>По этому адресу<br />материала нет.</>} actions={<><ActionLink href="/library">Искать в материалах ↗</ActionLink><a href="/">На главную →</a></>}>
<p>Проверьте адрес или найдите модель, камеру и нужную тему в библиотеке.</p>
</StateMessage>
</main>;
}
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff. Show more