Implement ProgCode identity and real shared reading UI kit
Build and deploy / deploy (push) Successful in 2m39s
Build and deploy / deploy (push) Successful in 2m39s
This commit is contained in:
1 parent
99c848189e
commit
12562baeb5
2040 files changed
+184656
-181
No files matched your search
@@ -0,0 +1,7 @@
|
||||
export {getArticles,getArticleBySlug,getArticleSummaries} from './model/articles';
|
||||
export {formatDate} from '../../shared/lib';
|
||||
export {ArticleMeta} from './ui/ArticleMeta';
|
||||
export {ArticleListItem} from './ui/ArticleListItem';
|
||||
export {articleHref,articleGenre,readingConnections} from './model/editorial';
|
||||
|
||||
export {EditorialNote} from './ui/EditorialNote';
|
||||
@@ -0,0 +1,4 @@
|
||||
import articles from '../../../../data/articles.json';
|
||||
export function getArticles(){return articles;}
|
||||
export function getArticleBySlug(slug){return articles.find(article=>article.slug===slug);}
|
||||
export function getArticleSummaries(){return articles.map(({slug,title,date,excerpt,categories,readingMinutes})=>({slug,title,date,excerpt,categories,readingMinutes}));}
|
||||
@@ -0,0 +1,19 @@
|
||||
export const articleHref=article=>'/articles/'+encodeURIComponent(article.slug)+'/';
|
||||
export function articleGenre(article){const s=article.slug;if(s.startsWith('о-tilix'))return 'Разговор';if(s==='привет-мир')return 'Знакомство';if(['dconf-','новый-движок','особенности-vibe'].some(p=>s.startsWith(p)))return 'Разбор';if(['firefox-','ошибка-php','вирус-','компиляция-'].some(p=>s.startsWith(p)))return 'Диагностика';return 'Пример API';}
|
||||
const routes={
|
||||
'dconf-':[['новый-движок','Другой этап исполнения: как CTFE представляет программу во время компиляции.'],['особенности-vibe','Пока задача ждёт: как vibe.d связывает волокна и ввод-вывод.'],['о-tilix','Опыт автора GUI: выбор D, память и сопровождение Tilix.']],
|
||||
'новый-движок':[['dconf-','После компиляции: как сборщик D работает с памятью.'],['особенности-vibe','Как средства языка используются в событийной программе.']],
|
||||
'особенности-vibe':[['dconf-','Устройство памяти, на которой выполняется приложение.'],['пишем-аналог','Другой пример обёртки: интерфейс D для знакомой задачи.']],
|
||||
'о-tilix':[['dconf-','Механизм GC, который обсуждает собеседник.'],['компиляция-','Историческая настройка другого окружения для D.']],
|
||||
'пишем-аналог':[['особенности-vibe','Практические интерфейсы и метапрограммирование D.'],['новый-движок','Как язык выполняет функции ещё до запуска.']],
|
||||
'компиляция-':[['о-tilix','Как разработчик приложения выбирает инструменты D.'],['пишем-аналог','Проверить настроенную цепочку на полном примере D.']],
|
||||
'bitrix-api-add':[['bitrix-api-создание','От поля редактора — к отдельным шагам записи каталога.'],['bitrix-api-функция','Как подготовить символьный код элемента.']],
|
||||
'bitrix-api-создание':[['bitrix-api-функция','Подготовка символьного кода и проверка уникальности.'],['bitrix-api-add','Как устроено поле изображения в редакторе.']],
|
||||
'bitrix-api-функция':[['bitrix-api-создание','Как новый элемент связывается с товаром и ценой.'],['bitrix-api-add','Другой небольшой API-пример с явными границами.']],
|
||||
'использование-jquery':[['bitrix-api-add','Другой пример границы между интерфейсом и интеграцией.']],
|
||||
'ошибка-php':[['firefox-','Другой сетевой симптом: где на самом деле ограничено ожидание.']],
|
||||
'firefox-':[['ошибка-php','Сетевой сбой другого уровня: проверка цепочки доверия.']],
|
||||
'вирус-':[['firefox-','Не смешивать поведение браузера с настройкой сетевого ожидания.']],
|
||||
'привет-мир':[['о-tilix','Большой разговор о разработке — один из голосов этого журнала.'],['новый-движок','Начать знакомство с центральной темой: устройство D.']]
|
||||
};
|
||||
export function readingConnections(article,articles){const key=Object.keys(routes).find(p=>article.slug.startsWith(p));return (routes[key]||[]).map(([prefix,reason])=>({article:articles.find(a=>a.slug.startsWith(prefix)),reason})).filter(item=>item.article&&item.article.slug!==article.slug);}
|
||||
@@ -0,0 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
import {articleGenre} from '../model/editorial';
|
||||
import {Tag} from '../../../shared/ui';
|
||||
import {formatDate} from '../../../shared/lib';
|
||||
export function ArticleListItem({article,onSelect,shortDate=true}){
|
||||
return <article className="index-entry"><div className="index-date"><time dateTime={article.date}>{formatDate(article.date,shortDate?{month:'short',day:'numeric'}:undefined)}</time><Tag>{articleGenre(article)} · {article.categories.join(' · ')}</Tag></div><Link onClick={onSelect} href={'/articles/'+encodeURIComponent(article.slug)+'/'}><h3>{article.title}</h3><p>{article.excerpt}</p></Link>{Number.isFinite(article.readingMinutes)&&article.readingMinutes>0&&<span className="index-duration">{article.readingMinutes} мин <b aria-hidden="true">↗</b></span>}</article>;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import {formatDate} from '../../../shared/lib';
|
||||
export function ArticleMeta({article,short=false,showAuthor=true,className=''}){
|
||||
return <div className={['article-meta',className].filter(Boolean).join(' ')}><time dateTime={article.date}>{formatDate(article.date,short?{month:'short',day:'numeric'}:undefined)}</time>{Number.isFinite(article.readingMinutes)&&article.readingMinutes>0&&<span>{article.readingMinutes} мин чтения</span>}{showAuthor&&article.author&&<span>Публикация: {article.author}</span>}</div>;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
import {TextLink} from '../../../shared/ui';
|
||||
export function EditorialNote({article}){const greeting=article.slug==='привет-мир';return <p className="editorial-note">{greeting?'Редакционный пересказ исторической записи: речь от первого лица здесь не является дословной цитатой автора.':'Редакционная версия: формулировки, структура и примеры могут отличаться от архивной страницы.'}{' '}<TextLink href={article.source}>Сверить с архивным снимком →</TextLink></p>}
|
||||
@@ -0,0 +1,2 @@
|
||||
export {Metrika} from './ui/Metrika';
|
||||
export {COUNTER_ID,allowedHost,trackGoal,observePage} from './model/metrika.mjs';
|
||||
@@ -0,0 +1,93 @@
|
||||
// Existing counter; custom events never include queries, URLs or personal metadata.
|
||||
export const COUNTER_ID = 109268613;
|
||||
const goals = new Set(['engaged_read', 'search_used', 'download_click', 'related_content_click', 'search_zero_results', 'content_problem']);
|
||||
export function allowedHost() {
|
||||
return typeof window !== 'undefined' && window.location.protocol === 'https:' &&
|
||||
(window.location.hostname === 'progcode.ru' || window.location.hostname.endsWith('.progcode.ru'));
|
||||
}
|
||||
export function trackGoal(name, reason) {
|
||||
if (!allowedHost() || !goals.has(name) || typeof window.ym !== 'function') return;
|
||||
const reasons = ['not_found', 'image_failed', 'fragment_missing'];
|
||||
if (name === 'content_problem' && reasons.includes(reason)) window.ym(COUNTER_ID, 'reachGoal', name, {reason});
|
||||
else if (name !== 'content_problem') window.ym(COUNTER_ID, 'reachGoal', name);
|
||||
}
|
||||
let started = false;
|
||||
let previousURL;
|
||||
let previousPath;
|
||||
export function observePage() {
|
||||
if (!allowedHost()) return () => {};
|
||||
if (!started) {
|
||||
started = true;
|
||||
window.ym = window.ym || function () {(window.ym.a = window.ym.a || []).push(arguments);};
|
||||
window.ym.l = Date.now();
|
||||
const script = document.createElement('script');
|
||||
script.async = true;
|
||||
script.src = 'https://mc.yandex.ru/metrika/tag.js';
|
||||
document.head.append(script);
|
||||
window.ym(COUNTER_ID, 'init', {defer: true, clickmap: true, trackLinks: true, accurateTrackBounce: true, webvisor: false, trackHash: false});
|
||||
}
|
||||
const missing = !!document.querySelector('main.missing');
|
||||
const url = missing ? window.location.origin + '/404/' : window.location.href.split('#')[0];
|
||||
if (window.location.pathname !== previousPath) {
|
||||
window.ym(COUNTER_ID, 'hit', url, {title: document.title, referer: previousURL || document.referrer});
|
||||
previousURL = url;
|
||||
previousPath = window.location.pathname;
|
||||
}
|
||||
const problems = new Set();
|
||||
function problem(reason) {
|
||||
if (!problems.has(reason)) {problems.add(reason); trackGoal('content_problem', reason);}
|
||||
}
|
||||
if (missing) problem('not_found');
|
||||
const body = document.querySelector('main.article-shell .article-content');
|
||||
function imageError(event) {
|
||||
if (event.target instanceof HTMLImageElement && event.target.closest('main.article-shell .article-content') && event.target.getAttribute('src')) problem('image_failed');
|
||||
}
|
||||
document.addEventListener('error', imageError, true);
|
||||
for (const img of body?.querySelectorAll('img') || []) {
|
||||
if (img.complete && img.naturalWidth === 0 && img.getAttribute('src')) problem('image_failed');
|
||||
}
|
||||
function fragment() {
|
||||
if (!window.location.hash || window.location.hash === '#') return;
|
||||
let id;
|
||||
try {id = decodeURIComponent(window.location.hash.slice(1));} catch {problem('fragment_missing'); return;}
|
||||
if (!document.getElementById(id) && ![...document.getElementsByName(id)].length) problem('fragment_missing');
|
||||
}
|
||||
fragment();
|
||||
window.addEventListener('hashchange', fragment);
|
||||
function click(event) {
|
||||
if (!event.isTrusted || event.defaultPrevented || event.button !== 0) return;
|
||||
const link = event.target.closest?.('a[href]');
|
||||
if (!link || link.getAttribute('aria-disabled') === 'true') return;
|
||||
if (link.closest('.related')) trackGoal('related_content_click');
|
||||
if (link.hasAttribute('download')) trackGoal('download_click');
|
||||
}
|
||||
document.addEventListener('click', click, true);
|
||||
let elapsed = 0, last = performance.now(), active = document.visibilityState === 'visible' && document.hasFocus(), sent = false;
|
||||
function tick() {
|
||||
const now = performance.now();
|
||||
if (active) elapsed += now - last;
|
||||
last = now;
|
||||
active = document.visibilityState === 'visible' && document.hasFocus();
|
||||
if (!body || sent || !active || elapsed < 60000) return;
|
||||
const rect = body.getBoundingClientRect();
|
||||
if (rect.height > 0 && (window.innerHeight - rect.top) / rect.height >= 0.75) {
|
||||
sent = true;
|
||||
trackGoal('engaged_read');
|
||||
}
|
||||
}
|
||||
const interval = body ? window.setInterval(tick, 1000) : null;
|
||||
window.addEventListener('scroll', tick, {passive: true});
|
||||
window.addEventListener('focus', tick);
|
||||
window.addEventListener('blur', tick);
|
||||
document.addEventListener('visibilitychange', tick);
|
||||
return () => {
|
||||
if (interval !== null) window.clearInterval(interval);
|
||||
window.removeEventListener('scroll', tick);
|
||||
window.removeEventListener('focus', tick);
|
||||
window.removeEventListener('blur', tick);
|
||||
document.removeEventListener('visibilitychange', tick);
|
||||
window.removeEventListener('hashchange', fragment);
|
||||
document.removeEventListener('error', imageError, true);
|
||||
document.removeEventListener('click', click, true);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
"use client";
|
||||
import {useEffect} from 'react';
|
||||
import {usePathname} from 'next/navigation';
|
||||
import {observePage} from '../model/metrika.mjs';
|
||||
export function Metrika(){const pathname=usePathname();useEffect(observePage,[pathname]);return null;}
|
||||
@@ -0,0 +1 @@
|
||||
export {ContentAccess} from './ui/ContentAccess';
|
||||
@@ -0,0 +1,33 @@
|
||||
"use client";
|
||||
import {useEffect} from 'react';
|
||||
import {usePathname} from 'next/navigation';
|
||||
export function ContentAccess({selector='main.article-shell .article-content, .kit-reading'}){
|
||||
const pathname=usePathname();
|
||||
useEffect(()=>{
|
||||
let alive=true;const regions=new Set();
|
||||
for(const root of document.querySelectorAll(selector)){
|
||||
for(const pre of root.querySelectorAll('pre')){
|
||||
pre.tabIndex=0;pre.setAttribute('role','region');
|
||||
if(!pre.getAttribute('aria-label'))pre.setAttribute('aria-label','Пример кода, прокрутка клавишами со стрелками');
|
||||
regions.add(pre);
|
||||
}
|
||||
for(const table of root.querySelectorAll('table')){
|
||||
let region=table.parentElement;
|
||||
if(!region?.matches('.table-scroll,.scroll-region')){
|
||||
region=document.createElement('div');region.className='table-scroll scroll-region';table.before(region);region.append(table);
|
||||
}
|
||||
region.tabIndex=0;region.setAttribute('role','region');
|
||||
if(!region.getAttribute('aria-label'))region.setAttribute('aria-label','Таблица, прокрутка клавишами со стрелками');
|
||||
regions.add(region);
|
||||
}
|
||||
}
|
||||
const measure=()=>{if(alive)for(const region of regions)region.dataset.overflow=String(region.scrollWidth>region.clientWidth+1);};
|
||||
const observer=typeof ResizeObserver==='function'?new ResizeObserver(measure):null;
|
||||
for(const region of regions)observer?.observe(region);
|
||||
measure();window.addEventListener('resize',measure);
|
||||
document.addEventListener('load',measure,true);
|
||||
document.fonts?.ready.then(measure);
|
||||
return()=>{alive=false;observer?.disconnect();window.removeEventListener('resize',measure);document.removeEventListener('load',measure,true);};
|
||||
},[pathname,selector]);
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export {JournalSearch} from './ui/JournalSearch';
|
||||
@@ -0,0 +1,16 @@
|
||||
"use client";
|
||||
import {useEffect,useState} from 'react';
|
||||
import {Button,Field,StatusMessage} from '../../../shared/ui';
|
||||
import {ArticleListItem} from '../../../entities/article';
|
||||
export function JournalSearch({articles,onResultSelect,onZeroResults}){
|
||||
const [q,setQ]=useState(''),[topic,setTopic]=useState('Все');
|
||||
const topics=['Все',...new Set(articles.flatMap(article=>article.categories))];
|
||||
const shown=articles.filter(article=>(topic==='Все'||article.categories.includes(topic))&&(article.title+' '+article.excerpt+' '+article.categories.join(' ')).toLocaleLowerCase('ru').includes(q.toLocaleLowerCase('ru')));
|
||||
useEffect(()=>{
|
||||
if(!q.trim()||shown.length)return;
|
||||
const timer=setTimeout(()=>onZeroResults?.(),500);
|
||||
return()=>clearTimeout(timer);
|
||||
},[q,shown.length,onZeroResults]);
|
||||
function reset(){setQ('');setTopic('Все');}
|
||||
return <section id="journal" className="journal"><div className="journal-heading"><div><p className="kicker">ПОЛНЫЙ ИНДЕКС</p><h2>Статьи и заметки</h2></div><span>{articles.length} материалов</span></div><div className="catalog-controls"><Field id="search" label="Найти в журнале" type="search" value={q} onChange={event=>setQ(event.target.value)} placeholder="Тема, язык или задача"/><div className="topic-tabs" aria-label="Темы">{topics.map(value=><Button variant="secondary" aria-pressed={topic===value} key={value} onClick={()=>setTopic(value)}>{value}</Button>)}</div></div><StatusMessage className="search-status">{shown.length?`Найдено материалов: ${shown.length}`:'По этому запросу ничего нет. Попробуйте другое слово или сбросьте тему.'}</StatusMessage><div className="journal-list">{shown.map(article=><ArticleListItem key={article.slug} article={article} onSelect={event=>{if(event.isTrusted&&q.trim())onResultSelect?.();}}/>)}</div>{!shown.length&&<Button variant="secondary" onClick={reset}>Сбросить поиск</Button>}</section>;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export {JsonEditor} from './ui/JsonEditor';
|
||||
@@ -0,0 +1,25 @@
|
||||
"use client";
|
||||
import {useRef,useState} from 'react';
|
||||
import {Button,TextArea,StatusMessage,ScrollRegion} from '../../../shared/ui';
|
||||
const MAX_INPUT_LENGTH=1000000;
|
||||
export function JsonEditor({id='json',initialValue='{"project":"ProgCode","ready":true}'}){
|
||||
const [text,setText]=useState(initialValue),[result,setResult]=useState(''),[state,setState]=useState('empty'),[message,setMessage]=useState(''),[copy,setCopy]=useState('');
|
||||
const revision=useRef(0);
|
||||
const statusId=`${id}-status`;
|
||||
function resetResult(){revision.current+=1;setResult('');setState('empty');setMessage('');setCopy('');}
|
||||
function change(event){setText(event.target.value);resetResult();}
|
||||
function run(compact){
|
||||
revision.current+=1;setCopy('');
|
||||
if(!text.trim()){setResult('');setState('empty');setMessage('Введите JSON для проверки.');return;}
|
||||
if(text.length>MAX_INPUT_LENGTH){setResult('');setState('error');setMessage('Слишком длинный фрагмент. Сократите текст перед проверкой.');return;}
|
||||
try{setResult(JSON.stringify(JSON.parse(text),null,compact?0:2));setState('success');setMessage('JSON корректен');}
|
||||
catch(error){setResult('');setState('error');setMessage(`Ошибка синтаксиса: ${error.message}`);}
|
||||
}
|
||||
async function copyResult(){
|
||||
if(state!=='success')return;
|
||||
const version=revision.current;
|
||||
try{await navigator.clipboard.writeText(result);if(revision.current===version)setCopy('Скопировано');}
|
||||
catch{if(revision.current===version)setCopy('Не удалось скопировать. Выделите текст результата вручную.');}
|
||||
}
|
||||
return <div className="workbench"><section><TextArea id={id} label="01 / Исходный JSON" hint="Проверяйте небольшие JSON-фрагменты. Текст обрабатывается в браузере." value={text} maxLength={MAX_INPUT_LENGTH} spellCheck={false} onChange={change} aria-invalid={state==='error'} aria-describedby={statusId}/><div className="tool-actions"><Button onClick={()=>run(false)}>Форматировать</Button><Button variant="secondary" onClick={()=>run(true)}>Сжать</Button><Button variant="secondary" onClick={()=>{setText('');resetResult();}}>Очистить</Button></div></section><section className={'result-panel '+state}><div className="result-heading"><span>02 / Результат</span><Button variant="secondary" disabled={state!=='success'} onClick={copyResult}>Копировать</Button></div><StatusMessage id={statusId} tone={state==='error'?'error':state==='success'?'success':'neutral'} className="result-label">{message||'Ожидает проверки'}</StatusMessage><ScrollRegion label="Результат JSON, прокрутка клавишами со стрелками"><pre>{result||(state==='error'?'Исправьте JSON и повторите проверку.':'Результат появится после проверки.')}</pre></ScrollRegion><StatusMessage style={copy?undefined:{height:0,minHeight:0,padding:0,margin:0,border:0,background:'transparent'}} className="copy-feedback" tone={copy==='Скопировано'?'success':'neutral'}>{copy}</StatusMessage></section></div>;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export {Shortlinks} from './ui/Shortlinks';
|
||||
@@ -0,0 +1,12 @@
|
||||
"use client";
|
||||
import {useEffect} from 'react';
|
||||
import links from '../../../../data/shortlinks.json';
|
||||
export function Shortlinks(){
|
||||
useEffect(()=>{
|
||||
const id=new URLSearchParams(location.search).get('p');
|
||||
if(!id||!Object.hasOwn(links,id))return;
|
||||
const target=links[id];
|
||||
if(typeof target==='string'&&target.startsWith('/articles/'))location.replace(target);
|
||||
},[]);
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export {ThemeControl} from './ui/ThemeControl';
|
||||
export {ThemeInit} from './ui/ThemeInit';
|
||||
@@ -0,0 +1,23 @@
|
||||
"use client";
|
||||
import {useEffect,useState} from 'react';
|
||||
import {THEME_STORAGE_KEY,THEME_CHANGE_EVENT,THEME_OPTIONS,validTheme} from '../../../shared/config';
|
||||
function readPreference(){try{const value=localStorage.getItem(THEME_STORAGE_KEY);return validTheme(value)?value:'system';}catch{return 'system';}}
|
||||
export function ThemeControl(){
|
||||
const [theme,setTheme]=useState('system');const [ready,setReady]=useState(false);
|
||||
useEffect(()=>{
|
||||
const sync=event=>{const value=validTheme(event?.detail)?event.detail:readPreference();setTheme(value);setReady(true);document.documentElement.dataset.theme=value;};
|
||||
const onStorage=event=>{if(event.key===THEME_STORAGE_KEY||event.key===null)sync();};
|
||||
sync();window.addEventListener(THEME_CHANGE_EVENT,sync);window.addEventListener('storage',onStorage);
|
||||
return()=>{window.removeEventListener(THEME_CHANGE_EVENT,sync);window.removeEventListener('storage',onStorage);};
|
||||
},[]);
|
||||
function change(value){
|
||||
if(!validTheme(value))return;
|
||||
setTheme(value);setReady(true);document.documentElement.dataset.theme=value;
|
||||
try{localStorage.setItem(THEME_STORAGE_KEY,value);}catch{/* Preference remains usable for this page without storage. */}
|
||||
window.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT,{detail:value}));
|
||||
}
|
||||
const index=THEME_OPTIONS.findIndex(option=>option.value===theme);
|
||||
const next=THEME_OPTIONS[(index+1)%THEME_OPTIONS.length];
|
||||
const name=`Тема: ${THEME_OPTIONS[index].label}. Переключить на: ${next.label}`;
|
||||
return <button type="button" className="theme-control" data-ready={ready?'true':'false'} data-theme-mode={theme} aria-label={name} title={name} onClick={()=>change(next.value)}>{THEME_OPTIONS.map(option=><svg key={option.value} className="theme-icon" data-theme-icon={option.value} viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="square" strokeLinejoin="miter" aria-hidden="true" focusable="false">{option.value==='system'?<><rect x="3" y="4" width="18" height="13"/><path d="M8 21h8M12 17v4"/></>:option.value==='light'?<><circle cx="12" cy="12" r="4"/><path d="M12 1v3M12 20v3M1 12h3M20 12h3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1"/></>:<path d="M20.6 15.1A9 9 0 0 1 8.9 3.4 9 9 0 1 0 20.6 15.1Z"/>}</svg>)}</button>;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import {THEME_STORAGE_KEY} from '../../../shared/config';
|
||||
// Constant script contains only the storage key and allowlisted preference values.
|
||||
export function ThemeInit(){const code=`try{var t=localStorage.getItem(${JSON.stringify(THEME_STORAGE_KEY)});document.documentElement.dataset.theme=(t==='light'||t==='dark'||t==='system')?t:'system';}catch(e){document.documentElement.dataset.theme='system';}`;return <script id="progcode-theme-init" dangerouslySetInnerHTML={{__html:code}}/>;}
|
||||
@@ -0,0 +1,2 @@
|
||||
import {Prose} from '../../shared/ui';
|
||||
export default function About(){return <main id="main" className="simple-page"><p className="kicker">PROGCODE.RU</p><h1>Блог одного<br/>программиста.</h1><p className="large-text">Здесь разбирают устройство инструментов, пишут небольшие функции и задают вопросы разработчикам.</p><Prose><h2>Что читать</h2><p>Основная коллекция — заметки DarkRiDDeR 2017–2019 годов о D, PHP, Bitrix, JavaScript и рабочем окружении. Среди них есть короткие рецепты, большой разбор сборщика мусора и интервью с создателем Tilix.</p><p>Технические примеры привязаны к контексту своих версий. Там, где старый совет мог привести к ошибке, текст уточнён. Интервью и переводы сохраняют авторство и ссылки на первичные публикации.</p><h2>Как ориентироваться</h2><p>Начните с <a href="/#journal">индекса статей</a>, выберите тему или задайте поиск. Для длинных разборов предусмотрено оглавление. В <a href="/resources/">справочниках</a> собраны первичные источники по темам блога, а <a href="/tools/">JSON-инструмент</a> помогает проверить ответ API.</p><h2>Автор и связь</h2><p>Автор исторических заметок подписывался DarkRiDDeR. Подтверждённый актуальный канал связи не указан; старые формы отправки сообщений больше не используются.</p></Prose></main>}
|
||||
@@ -0,0 +1,2 @@
|
||||
import {Prose,TextLink} from '../../shared/ui';
|
||||
export default function AccessibilityPage(){return <main id="main" className="simple-page service-page"><p className="kicker">ДОСТУП К СОДЕРЖАНИЮ</p><h1>Настроить чтение<br/>под себя.</h1><Prose><h2>Клавиатура и оглавление</h2><p>Первое нажатие Tab открывает ссылку «К содержанию». Ссылки и кнопки имеют видимую рамку фокуса. В длинных статьях оглавление ведёт к настоящим разделам; на узком экране его можно свернуть.</p><h2>Код и широкие таблицы</h2><p>Примеры кода сохраняют отступы, а таблицы — связь строк и столбцов. Если содержимое шире экрана, прокручивается только этот блок. Перейдите к нему клавишей Tab и используйте стрелки влево и вправо либо прокрутите касанием.</p><h2>Размер текста и тема</h2><p>Используйте масштаб браузера, чтобы увеличить текст. В шапке можно выбрать светлую, тёмную или системную тему; выбор сохраняется только в этом браузере. Системная настройка уменьшенного движения отключает плавную прокрутку.</p><h2>Изображения и состояния</h2><p>Схемы сопровождаются описаниями и подписями. Цвет не заменяет текст ошибки или состояние поиска. Если изображение не загрузилось, остальная статья остаётся доступной. Пустой поиск можно сбросить, а неизвестный адрес ведёт к странице 404 с переходом в журнал.</p><p>Это описание предусмотренных способов работы, а не гарантия одинакового поведения каждого браузера или вспомогательной технологии.</p><ul><li><TextLink href="/#journal">Найти материал в журнале</TextLink></li><li><TextLink href="/ui-kit/">Проверить компоненты на реальном содержимом</TextLink></li><li><TextLink href="/privacy/">О теме, локальных инструментах и аналитике</TextLink></li></ul></Prose></main>}
|
||||
@@ -0,0 +1,5 @@
|
||||
import Link from 'next/link';
|
||||
import {getArticles,articleGenre,ArticleMeta,EditorialNote} from '../../entities/article';
|
||||
import ArticleReader from '../../widgets/article-reader';
|
||||
import RelatedReading from '../../widgets/related-reading';
|
||||
export default function ArticlePage({article,related}){return <main id="main" className="article-shell"><nav className="breadcrumbs" aria-label="Путь"><Link href="/#journal">Журнал</Link><span>/</span><span>{article.categories.join(' · ')}</span></nav><header className="article-header"><p className="kicker">{articleGenre(article)} · {article.categories.join(' / ')}</p><h1>{article.title}</h1><p className="article-deck">{article.excerpt}</p><ArticleMeta article={article}/><EditorialNote article={article}/></header><ArticleReader article={article} related={<RelatedReading article={article} articles={getArticles()}/>}/></main>}
|
||||
@@ -0,0 +1,3 @@
|
||||
import Link from 'next/link';
|
||||
import {ArticleListItem} from '../../entities/article';
|
||||
export default function CatalogPage({title,articles}){return <main id="main" className="archive-page"><p className="kicker">ТЕМАТИЧЕСКИЙ ИНДЕКС</p><h1>{title}</h1><p className="large-text">Материалов по этой теме: {articles.length}. <Link href="/#journal">Перейти к поиску по всему журналу</Link>.</p><div className="journal-list">{articles.map(article=><ArticleListItem key={article.slug} article={article} shortDate={false}/>)}</div></main>}
|
||||
@@ -0,0 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
import Catalog from '../../widgets/journal-index';
|
||||
import MechanismMap from '../../widgets/mechanism-map';
|
||||
import {Shortlinks} from '../../features/shortlinks';
|
||||
import {getArticles,getArticleSummaries,ArticleMeta,articleHref,articleGenre,readingConnections} from '../../entities/article';
|
||||
import {ActionLink} from '../../shared/ui';
|
||||
export default function Home(){const all=getArticles(),lead=all.find(a=>a.slug.startsWith('dconf-')),connections=readingConnections(lead,all),practical=all.filter(a=>a.slug.startsWith('использование-jquery')||a.slug.startsWith('bitrix-api-функция'));return <main id="main" className="home"><Shortlinks/><section className="home-opening" aria-label="С чего начать"><div className="hero-copy"><p className="kicker">ИНЖЕНЕРНЫЙ ЖУРНАЛ · 2017–2019</p><h1>От вызова<br/>к механизму.</h1><p className="intro-deck">Механизмы D, прикладной Bitrix и диагностика окружения. Полные разборы, код и границы решений.</p></div><MechanismMap href={articleHref(lead)}/><article className="lead"><div><p className="kicker">В ФОКУСЕ · РАЗБОР / ПАМЯТЬ</p><h2><Link href={articleHref(lead)}>{lead.title}</Link></h2><ArticleMeta article={lead} showAuthor={false}/><p>От пулов памяти до маркировки и очистки: доклад Дмитрия Ольшанского о сборщике мусора D.</p></div><aside><p className="kicker">ВНУТРИ РАЗБОРА</p><p>Подробный разбор с поясняющими схемами. Планы и ограничения относятся к реализации 2017 года.</p><Link href={articleHref(lead)}>Открыть материал →</Link></aside></article></section><section className="reading-questions"><div className="section-head"><h2>Продолжить вопрос.</h2><p className="kicker">РАЗНЫЕ ПУТИ, НЕ СТУПЕНИ КУРСА</p></div>{connections.map(({article,reason})=><article className="entry" key={article.slug}><div className="entry-content"><p className="tiny-topic">{articleGenre(article)} · {article.categories.join(' / ')}</p><h3><Link href={articleHref(article)}>{article.title}</Link></h3><p className="entry-reason">{reason}</p></div><Link href={articleHref(article)} className="entry-arrow" aria-label={'Читать: '+article.title}>↗</Link></article>)}</section><section><div className="section-head"><h2>Найти конкретный ответ.</h2><Link href="/#journal">Все 14 материалов →</Link></div>{practical.map(article=><article className="entry" key={article.slug}><div className="entry-content"><p className="tiny-topic">{articleGenre(article)} · {article.categories.join(' / ')}</p><h3><Link href={articleHref(article)}>{article.title}</Link></h3><p>{article.excerpt}</p></div><Link href={articleHref(article)} className="entry-arrow" aria-label={'Читать: '+article.title}>↗</Link></article>)}</section><Catalog articles={getArticleSummaries()}/><section className="utility-promo"><div><p className="kicker">МАСТЕРСКАЯ</p><h2>Проверить JSON.</h2><p>Синтаксис, отступы и компактная запись — локально в браузере.</p></div><ActionLink href="/tools/">Открыть инструмент →</ActionLink><Link href="/ui-kit/">Устройство страниц и состояния компонентов</Link></section></main>}
|
||||
@@ -0,0 +1,2 @@
|
||||
import JsonWorkbench from '../../widgets/json-workbench';
|
||||
export default function JsonToolPage(){return <main id="main" className="tool-page"><header className="tool-heading"><p className="kicker">ИНСТРУМЕНТ РАЗРАБОТЧИКА</p><h1>Привести JSON<br/>в порядок.</h1><p>Проверьте синтаксис, расставьте отступы или уберите пробелы.<br/>Текст обрабатывается локально в вашем браузере.</p></header><JsonWorkbench/><section className="tool-notes"><h2>Синтаксис — только первый шаг.</h2><p>Ключи и строки требуют двойных кавычек. Комментарии и завершающие запятые не поддерживаются. Проверка не подтверждает соответствие схеме API. Большие целые числа могут терять точность в JavaScript: такие идентификаторы лучше хранить строками.</p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse">Правила JSON.parse в MDN ↗</a></section></main>}
|
||||
@@ -0,0 +1,2 @@
|
||||
import {ActionLink,TextLink} from '../../shared/ui';
|
||||
export default function NotFoundPage(){return <main id="main" className="missing"><p className="kicker">ОШИБКА 404</p><div className="missing-code" aria-hidden="true">{ ? }</div><h1>Такой страницы нет.</h1><p>Возможно, в адресе опечатка или ссылка больше не существует.<br/>Попробуйте найти нужную тему в журнале.</p><ActionLink href="/#journal">Перейти к поиску →</ActionLink><TextLink href="/ui-kit/">Открыть мастерскую компонентов</TextLink></main>}
|
||||
@@ -0,0 +1,2 @@
|
||||
import {Prose,TextLink} from '../../shared/ui';
|
||||
export default function PrivacyPage(){return <main id="main" className="simple-page service-page"><p className="kicker">О РАБОТЕ САЙТА</p><h1>Приватность<br/>и аналитика.</h1><Prose><h2>Чтение и локальные инструменты</h2><p>Для чтения не нужна регистрация. Поиск по журналу и обработка JSON выполняются в браузере: отдельный поисковый запрос или исходный JSON не отправляются в событиях сайта. Выбранная цветовая тема сохраняется в локальном хранилище браузера; её можно поменять в шапке.</p><h2>Что помогает улучшать журнал</h2><p>На ProgCode подключена Яндекс Метрика — счётчик 109268613. Она помогает понять, откуда приходят читатели, какие материалы читают и где возникают трудности. Сервис получает сведения о просмотрах, адресах и заголовках страниц, источниках перехода, браузере и устройстве; может использовать cookie. Это внешняя аналитика, даже когда сам JSON-инструмент работает локально.</p><p>Включены карта кликов и учёт переходов по внешним ссылкам. Вебвизор — запись сеансов — выключен. Стандартный показатель отказов не подменяется искусственными просмотрами или событиями.</p><h2>Какие действия учитывает сайт</h2><p>Отдельные события отмечают чтение статьи не менее минуты в видимом окне с фокусом и достижение 75% текста, выбор результата поиска, отсутствие результатов, переход к связанному материалу и подтверждённую проблему контента. В этих событиях нет текста поискового запроса, введённого JSON, содержимого отсутствующего якоря или полного сообщения ошибки. Скачивания учитывались бы только при клике на настоящую ссылку скачивания; в текущей коллекции таких файлов нет.</p><h2>Ваш браузер и выбор</h2><p>Настройки cookie и локального хранилища управляются в браузере. Яндекс также описывает способы отключить сбор Метрики. Отключение счётчика не мешает чтению статей, поиску и работе JSON-инструмента.</p><ul><li><TextLink href="https://yandex.ru/support/metrica/ru/code/data-collected">Какие сведения собирает Метрика</TextLink></li><li><TextLink href="https://yandex.ru/support/metrica/ru/general/user-opt-out">Как отключить сбор Метрики</TextLink></li><li><TextLink href="https://yandex.ru/legal/confidential/">Политика конфиденциальности Яндекса</TextLink></li></ul><p>Описание относится к функциям этого сайта. Условия обработки данных внешним сервисом изложены в его документах.</p></Prose></main>}
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
const sources=[['D','Язык, стандартная библиотека и инструменты',[['Спецификация D','https://dlang.org/spec/spec.html','Синтаксис, семантика и правила языка.'],['Стандартная библиотека Phobos','https://dlang.org/phobos/index.html','Контракты функций, модули и примеры.'],['DUB','https://dub.pm/','Сборка проектов и управление зависимостями.']]],['PHP','Функции и интеграции',[['Справочник PHP','https://www.php.net/manual/ru/','Функции, расширения и примеры использования.'],['API Bitrix','https://dev.1c-bitrix.ru/api_help/','Описание API и ограничений конкретных методов.']]],['Web','Сборка и безопасность',[['webpack: ProvidePlugin','https://webpack.js.org/plugins/provide-plugin/','Как автоматически подключать модуль для свободного идентификатора.'],['MDN: JSON.parse','https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse','Синтаксис JSON, ошибки разбора и точность чисел.'],['curl: проверка TLS','https://curl.se/docs/sslcerts.html','Цепочка доверия и безопасная диагностика сертификатов.']]]];
|
||||
export default function Resources(){return <main id="main" className="simple-page"><p className="kicker">ДЕРЖАТЬ ПОД РУКОЙ</p><h1>Сначала —<br/>первоисточник.</h1><p className="large-text">Справочники по темам журнала: для проверки версии API, поведения функции и границ примера.</p><div className="resource-groups">{sources.map(([topic,title,links])=><section key={topic}><p className="kicker">{topic}</p><h2>{title}</h2>{links.map(([name,href,text])=><a key={href} href={href}><h3>{name}<span>↗</span></h3><p>{text}</p></a>)}</section>)}</div></main>}
|
||||
@@ -0,0 +1,2 @@
|
||||
import {Prose,TextLink} from '../../shared/ui';
|
||||
export default function SourcesPage(){return <main id="main" className="simple-page service-page"><p className="kicker">ИСТОЧНИКИ И РЕДАКТУРА</p><h1>Сохранить смысл.<br/>Уточнить контекст.</h1><Prose><h2>Что входит в журнал</h2><p>Здесь собрана известная коллекция из четырнадцати публикаций ProgCode 2017–2019 годов: заметки о D, PHP, Bitrix, JavaScript и рабочем окружении. Это исторические материалы, а не обещание актуальности всех описанных версий или полноты прежнего сайта.</p><h2>Как восстанавливаются материалы</h2><p>Основой нынешней редакции служат общедоступные архивные снимки старых страниц. Тексты переработаны: формулировки, структура и технические примеры могут отличаться от исторических. Это не дословная копия архива; по сравнению с ним сохранность каждого абзаца не подтверждается. Исторические даты и атрибуция указывают исходную публикацию, а не авторство редакционных изменений. Старые известные адреса ведут к нынешним версиям.</p><p>Архивная оболочка, рекламные вставки и комментарии не переносятся автоматически. Ссылки остаются там, где они помогают проверить техническое утверждение или источник перевода. Неподтверждённые пропуски не заменяются выдуманными публикациями.</p><h2>Что добавляет редактура</h2><p>Переработанные фразы, в том числе от первого лица, не следует цитировать как дословную речь исторического автора. Для цитирования нужно сверяться с архивным снимком, ссылка на который дана у статьи. Оглавления и поясняющие схемы помогают читать большие разборы. Новые схемы объясняют устройство механизмов и не выдаются за исторические снимки интерфейса. В заметке о FileInput сохранён подлинный небольшой пример контрола Bitrix.</p><p>Уточнения раскрывают ограничения версий и последствия старых советов: например, замена шаблона Diet в описанном статически компилируемом варианте требует пересборки использующего его кода. Уточнения не превращают старую статью в руководство по всем современным версиям инструмента.</p><h2>Как проверить и продолжить чтение</h2><ul><li><TextLink href="https://web.archive.org/web/*/http://progcode.ru/">Архивные снимки ProgCode в Wayback Machine</TextLink></li><li><TextLink href="/resources/">Первичные справочники по темам журнала</TextLink></li><li><TextLink href="/#journal">Индекс известных статей</TextLink></li><li><TextLink href="/about/">О блоге и историческом авторстве</TextLink></li></ul><p>Актуальный подтверждённый канал связи автора не указан. На сайте нет формы, которая обещает отправить сообщение без работающего получателя.</p></Prose></main>}
|
||||
@@ -0,0 +1,21 @@
|
||||
import Link from 'next/link';
|
||||
import {Brand,Button,ActionLink,Prose,StatusMessage,ScrollRegion} from '../../shared/ui';
|
||||
import {getArticles,ArticleMeta,ArticleListItem,EditorialNote,articleHref} from '../../entities/article';
|
||||
import {ThemeControl} from '../../features/theme-selection';
|
||||
import {ContentAccess} from '../../features/content-access';
|
||||
import JournalIndex from '../../widgets/journal-index';
|
||||
import JsonWorkbench from '../../widgets/json-workbench';
|
||||
import MechanismMap from '../../widgets/mechanism-map';
|
||||
import PagePreview,{BuildIdentity} from '../../widgets/page-preview';
|
||||
import {designSystemRegistry as registry} from '../../shared/config';
|
||||
function Label({article}){return <header className="specimen-label"><p>Материал: <Link href={articleHref(article)}>{article.title}</Link></p><ArticleMeta article={article}/></header>}
|
||||
const demos=id=>['journal-search','journal-index'].includes(id)?'#search-states':['json-editor','json-workbench'].includes(id)?'#json-states':['article-figure','article-meta','article-list-item','prose','historical-figures','historical-code','historical-table'].includes(id)?'#domain-content':['mechanism-map'].includes(id)?'#mechanism-specimen':['site-header','site-footer','article-reader','related-reading','page-preview'].includes(id)?'#page-compositions':'#primitive-states';
|
||||
export default function UIKitPage(){const all=getArticles();const find=prefix=>all.find(item=>item.slug.startsWith(prefix));const ctfe=find('новый-движок'),code=find('пишем-аналог'),bitrix=find('bitrix-api-add'),gc=find('dconf'),tls=find('ошибка-php'),windows=find('вирус-'),hello=find('привет-');const block=(value,pattern)=>value.contentHtml.match(pattern)?.[0]||'';const moduleCode=[...code.contentHtml.matchAll(/<pre[\s\S]*?<\/pre>/g)].map(match=>match[0]).sort((a,b)=>b.length-a.length)[0];const table=block(ctfe,/<table[\s\S]*?<\/table>/);const figures=[...gc.contentHtml.matchAll(/<figure[\s\S]*?<\/figure>/g)].map(match=>match[0]);const summaries=all.map(({slug,title,date,excerpt,categories,readingMinutes})=>({slug,title,date,excerpt,categories,readingMinutes}));const pages=[{title:'Главная: выбор и полный указатель',href:'/',reason:'SiteHeader, HomePage, MechanismMap, ArticleMeta, JournalIndex и SiteFooter.'},...all.map(a=>({title:a.title,href:articleHref(a),reason:'Полное тело, Prose, ArticleReader, оглавление, локальный доступ к коду и осмысленное продолжение.'})),{title:'JSON-инструмент',href:'/tools/',reason:'Та же рабочая область JsonWorkbench и те же поля, кнопки и статусы.'},{title:'Справочники',href:'/resources/',reason:'Реальные ссылки, длинные заголовки и общая текстовая композиция.'},{title:'О блоге',href:'/about/',reason:'Сведения о журнале и исторический контекст.'},{title:'Источники и редактура',href:'/sources/',reason:'Честная граница восстановления и поясняющих иллюстраций.'},{title:'Приватность',href:'/privacy/',reason:'Реальные параметры аналитики и локальной обработки JSON.'},{title:'Доступность',href:'/accessibility/',reason:'Клавиатура, оглавление, прокрутка и темы.'},{title:'Страница 404',href:'/ui-kit-missing-page/',reason:'Настоящий ответ404 и работающие пути возврата.'}];return <main id="main" className="uikit-page"><header><p className="kicker">МАСТЕРСКАЯ / УСТРОЙСТВО СТРАНИЦ</p><h1>Компоненты и страницы ProgCode.</h1><p className="large-text">Правила, состояния и полные материалы. Здесь работают те же элементы, из которых собраны журнал, статьи и JSON-инструмент.</p><BuildIdentity/><nav aria-label="Разделы мастерской" className="uikit-actions"><Link href="#foundations">Основы</Link><Link href="#primitive-states">Состояния</Link><Link href="#domain-content">Контент</Link><Link href="#api-ledger">API и потребители</Link><Link href="#page-compositions">Полные страницы</Link></nav></header>
|
||||
<section id="foundations" className="uikit-section"><h2>Основы: цвет, набор и композиция</h2><div className="uikit-grid"><div className="uikit-panel"><Brand/><p>Знак B: буква P и ортогональный выход. Он остаётся одной формой в разных размерах.</p><div className="uikit-native">{[16,32,48].map(size=><figure key={size}><img src={'/brand/v3/favicon-'+size+'.png'} width={size} height={size} alt={'Знак B, '+size+' пикселей'}/><figcaption>{size} × {size}</figcaption></figure>)}</div></div><div className="uikit-panel"><h3>Текст и сетка</h3><p>Основной набор — Arial/Helvetica, код — локальный моноширинный шрифт. Колонка чтения ограничена 720px; мобильный текст 18px, широкий 19px с межстрочным интервалом 1,7.</p><p>Внешняя сетка 1328px, поля 32/20px. Шаги отступов: 8, 16, 24, 32, 48, 64px. Оглавление переходит из боковой колонки над текстом; код и таблицы прокручиваются отдельно.</p><p>Главная выбирает вопрос. Указатель помогает найти материал. Статья сохраняет полное рассуждение. Сервисные страницы используют ту же текстовую основу.</p></div></div><div className="uikit-swatches"><div className="uikit-swatch">Фон и текст<strong>Основное чтение</strong><code>canvas / text</code></div><div className="uikit-swatch" style={{background:'var(--color-subtle)',color:'var(--color-secondary)'}}>Мета и подписи<strong>Вторичная информация</strong><code>subtle / secondary</code></div><div className="uikit-swatch" style={{color:'var(--color-accent)'}}>Ссылка и фокус<strong>Кобальтовый маршрут</strong><code>accent / focus</code></div></div><p>Тема меняется одной кнопкой со значком текущего режима: система → светлая → тёмная. Изображения сохраняют исходные цвета на светлой подложке. Сигнал не заменяет текст ошибки или выбранного состояния.</p><div className="uikit-type-scale"><h1 aria-hidden="true">Заголовок</h1><h2>Раздел статьи</h2><h3>Подраздел и длинное название</h3><p>Русский текст и English terms, <code>preg_match_all</code>, D и PHP — в одном спокойном ритме.</p><p className="tiny-topic">МЕТАДАННЫЕ · ДАТА · ЖАНР</p></div></section>
|
||||
<section id="primitive-states" className="uikit-section"><h2>Анатомия и работающие состояния</h2><p>Компоненты показаны в своей задаче: поиск, проверка JSON, чтение и навигация. Здесь нет отдельной формы публикации или кнопок без назначения.</p><ThemeControl/><p>Одна иконка показывает текущий режим. Нажатие, Enter или пробел выбирают следующий: система → светлая → тёмная. Название кнопки и подсказка объясняют текущий и следующий режим. Та же кнопка находится в шапке.</p><p><Link href="#search-states">Поля и пустая выдача — в настоящем поиске</Link> · <Link href="#json-states">Ошибка, результат и недоступное копирование — в настоящем JSON-инструменте</Link></p></section>
|
||||
<section id="domain-content" className="uikit-section"><h2>Контентные блоки на реальных текстах</h2><div className="uikit-grid">{[tls,windows].map(item=><div className="uikit-panel" key={item.slug}><Label article={item}/><h3>{item.title}</h3><p>{item.excerpt}</p></div>)}</div><div className="uikit-prose"><Label article={hello}/><EditorialNote article={hello}/><Prose html={hello.contentHtml} className="kit-reading"/></div><h3>Строка указателя и метаданные</h3><ArticleListItem article={ctfe}/><p>Жанр в строке указателя описывает работу читателя; исходная категория и дата сохраняются.</p><h3>Полный модуль с проверками</h3><Label article={code}/><p>Самый длинный блок не сокращён до декоративного сниппета. В нём остаются модуль, функции и тесты.</p><Prose html={moduleCode} className="kit-reading uikit-prose"/><h3>Таблица: строки и столбцы</h3><Label article={ctfe}/><div className="article-content kit-reading"><ScrollRegion label="Таблица сравнения CTFE; горизонтальная прокрутка" className="table-scroll" dangerouslySetInnerHTML={{__html:table}}/></div><h3>Изображение, размер и подпись</h3><div className="uikit-grid"><div><Label article={bitrix}/><Prose className="kit-reading" html={block(bitrix,/<figure[\s\S]*?<\/figure>/)}/></div><div><Label article={gc}/><Prose className="kit-reading" html={figures[1]||figures[0]}/></div></div></section>
|
||||
<section id="mechanism-specimen" className="uikit-section"><h2>Предметная схема и переход</h2><Label article={gc}/><MechanismMap href={articleHref(gc)}/></section>
|
||||
<section id="search-states" className="uikit-section"><h2>Поиск: результат, пустая выдача и восстановление</h2><p>Попробуйте Bitrix, выберите тему, затем введите Rust и сбросьте запрос. Это тот же JournalIndex, что на главной; запрос не отправляется в пользовательских целях аналитики.</p><JournalIndex articles={summaries}/></section>
|
||||
<section id="json-states" className="uikit-section"><h2>JSON: пусто, корректно, ошибка и копирование</h2><p>Общая рабочая область используется на странице инструмента. Проверка локальная; синтаксическая корректность не означает соответствие схеме API. Отказ буфера обмена обрабатывается реальным состоянием, а не подменённым успешным сообщением.</p><JsonWorkbench/></section>
|
||||
<section id="api-ledger" className="uikit-section"><h2>Компонент → исходник → потребитель</h2><p>{registry.components.length} записей фактической реализации. Путь указывает владельца в проекте; пример состояния и реальная страница доступны рядом. Невизуальные API не маскируются под отсутствующий экран.</p><div className="kit-inventory">{registry.components.map(c=><details key={c.id}><summary>{c.name} <small>{c.layer}</small></summary><p><code>{Array.isArray(c.source)?c.source.join(', '):c.source}</code></p><dl><dt>Анатомия</dt><dd>{c.anatomy?.join(' · ')}</dd><dt>API</dt><dd><pre>{JSON.stringify(c.props||{},null,2)}</pre></dd><dt>Варианты</dt><dd>{c.variants?.join(' · ')}</dd><dt>Состояния</dt><dd>{c.states?.join(' · ')}</dd><dt>Адаптив и клавиатура</dt><dd>{c.responsive} {c.keyboard}</dd><dt>Потребители</dt><dd>{c.consumers?.map((consumer,i)=><p key={i}><code>{consumer.source}</code><br/>{(Array.isArray(consumer.route)?consumer.route:[consumer.route]).filter(Boolean).map(route=>route.startsWith('/')?<Link key={route} href={route}>{route} </Link>:<span key={route}>{route}</span>)}</p>)}</dd></dl><Link href={demos(c.id)}>Открыть пример / композицию →</Link></details>)}</div></section>
|
||||
<section id="page-compositions" className="uikit-section"><h2>Полные страницы из этой же сборки</h2><p>Все 14 публикаций доступны целиком, вместе с главной, инструментом и сервисными страницами. Это настоящие маршруты: их содержимое, компоненты и тема совпадают с открытой сборкой. Страница 404 возвращает 404.</p><PagePreview pages={pages}/><p><ActionLink href="/sources/">Источники и редактура</ActionLink> <ActionLink variant="secondary" href="/privacy/">Приватность</ActionLink></p></section><ContentAccess/></main>}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,6 @@
|
||||
export const THEME_STORAGE_KEY='progcode-theme';
|
||||
export const THEME_CHANGE_EVENT='progcode-theme-change';
|
||||
export const THEME_OPTIONS=[{value:'system',label:'Системная'},{value:'light',label:'Светлая'},{value:'dark',label:'Тёмная'}];
|
||||
export function validTheme(value){return value==='light'||value==='dark'||value==='system';}
|
||||
|
||||
export {default as designSystemRegistry} from './design-system.json';
|
||||
@@ -0,0 +1,5 @@
|
||||
// Archived publication timestamps are UTC; their UTC calendar days match the
|
||||
// visible source dates and dated permalinks. Never use the build/browser timezone.
|
||||
export function formatDate(date, {day = '2-digit', month = 'long'} = {}) {
|
||||
return new Intl.DateTimeFormat('ru-RU', {day, month, year: 'numeric', timeZone: 'UTC'}).format(new Date(date));
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export {formatDate} from './dates.mjs';
|
||||
@@ -0,0 +1,49 @@
|
||||
/* Public component contracts; semantic tokens are shared by real pages and the kit. */
|
||||
body{font-family:var(--font-ui)}
|
||||
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible,[tabindex="0"]:focus-visible{outline:3px solid var(--color-accent);outline-offset:3px}
|
||||
.brand{display:inline-flex;flex-shrink:0;align-items:center;line-height:1;text-decoration:none}.brand img{width:202px;height:auto}.brand .brand-dark{display:none}:root[data-theme=dark] .brand .brand-light{display:none}:root[data-theme=dark] .brand .brand-dark{display:block}
|
||||
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .brand .brand-light{display:none}:root:not([data-theme=light]) .brand .brand-dark{display:block}}
|
||||
.theme-control{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--color-secondary)}.theme-control select{min-height:44px;max-width:128px;padding:8px;border:1px solid var(--color-control);border-radius:3px;background:var(--color-surface);color:var(--color-text);font:inherit}
|
||||
.masthead nav{gap:22px}.masthead nav a{display:inline-flex;align-items:center;min-height:44px}.footer nav{display:flex;flex-direction:column;gap:10px}.footer nav a{width:fit-content}.footer .brand img{width:176px}.footer>span{line-height:1.6}
|
||||
.field{display:block;min-width:0}.field>span,.field-label{display:block;font:12px/1.5 var(--font-ui);margin-bottom:8px}.field input,.field textarea{background:var(--color-surface);border:1px solid var(--color-control);color:var(--color-text)}.field-hint,.field-note{font:12px/1.6 var(--font-ui);color:var(--color-secondary)}
|
||||
.ui-button,.button{min-height:44px;line-height:1.4;padding:11px 16px;border-radius:3px;font:600 14px/1.4 var(--font-ui)}.ui-button{background:var(--color-surface);color:var(--color-text);border:1px solid var(--color-control)}.ui-button.primary,.ui-button[data-variant=primary]{background:var(--color-text);border-color:var(--color-text);color:var(--color-canvas)}.ui-button:hover:not(:disabled){text-decoration:underline;text-underline-offset:4px}.ui-button:disabled,button:disabled{cursor:not-allowed;color:var(--color-secondary);border-style:dashed;background:var(--color-subtle)}
|
||||
.status-message{font:14px/1.6 var(--font-ui);color:var(--color-secondary)}.status-message.success,.status-message[data-tone=success]{color:var(--color-success-text)}.status-message.error,.status-message[data-tone=error]{color:var(--color-error-text)}.status-message[data-tone=success]{background:var(--color-success-bg);padding:12px}.status-message[data-tone=error]{background:var(--color-error-bg);padding:12px}
|
||||
.scroll-region{max-width:100%;min-width:0;overflow:auto}.scroll-region pre{margin:0}.scroll-region[data-overflow=true]::before,.table-scroll[data-overflow=true]::before{content:'Прокрутка по горизонтали: касанием или стрелками после фокусировки';display:block;padding:8px 12px;font:12px/1.5 var(--font-ui);color:var(--color-secondary);background:var(--color-subtle)}
|
||||
.article-header{max-width:740px}.reading-column{font-family:var(--font-reading);font-size:var(--reading-size);max-width:min(var(--reading-measure),740px)}.article-content{font-family:var(--font-reading);font-size:var(--reading-size);line-height:var(--reading-leading);overflow-wrap:anywhere}.article-content p{margin-bottom:1.1em}.article-content h2{margin-top:48px}.article-content a:visited{color:var(--color-visited)}.article-content pre{font:14px/1.65 var(--font-mono);color:var(--color-code-text);background:var(--color-code)}.article-content pre[data-overflow=true]{border-left:3px solid var(--color-control)}.article-content code{background:var(--color-subtle);font-family:var(--font-mono)}.article-content pre code{background:none}
|
||||
.article-content figure{background:#fff;color:#142035;border-color:var(--color-control)}.article-content figcaption{font-size:12px;color:#526179;border-color:#c1cad8}.article-content table{font-size:14px}.article-content th,.article-content td{border-color:var(--color-control)}.article-content .table-scroll{border-color:var(--color-control)}
|
||||
.related,.article-end{font-family:var(--font-ui)}.article-meta,.article-end,.index-date,.index-date span,.index-duration,.story-meta,.tiny-topic,.recipe-number,.kicker,.search-status,.field-note,.copy-feedback,.result-heading,.result-label{font-size:12px;line-height:1.5}.topic-tabs button{min-height:44px}.topic-tabs button[aria-pressed=true]{font-weight:700}.search-status{min-height:20px}.journal-heading>span{font-size:12px}
|
||||
.utility-promo{background:var(--color-subtle);color:var(--color-text);border:1px solid var(--color-border)}.utility-promo p{color:var(--color-secondary)}.utility-promo .kicker{color:var(--color-accent)}.result-panel.success{background:var(--color-success-bg)}.result-panel.error{background:var(--color-error-bg)}.result-panel.success .result-label,.result-panel.success .result-panel pre{color:var(--color-success-text)}.result-panel.error .result-label,.result-panel.error pre{color:var(--color-error-text)}.result-panel pre{color:var(--color-text)}.result-panel .status-message{margin:16px 0}.workbench textarea{font-size:14px}.tool-actions button{font-size:14px}.workbench .field>span{display:block}.copy-feedback{color:var(--color-accent)}
|
||||
.service-page .article-content{max-width:min(var(--reading-measure),740px)}.service-page h2{margin-top:40px}.service-page a{overflow-wrap:anywhere}.service-nav{display:flex;gap:16px;flex-wrap:wrap;margin-top:32px}
|
||||
.uikit-page{padding:48px 0 64px}.uikit-page>header{max-width:820px}.uikit-page>header h1{font-size:clamp(32px,5vw,58px);letter-spacing:-1.5px}.uikit-section{margin:48px 0;padding-top:32px;border-top:1px solid var(--color-control)}.uikit-section>h2{font-size:30px}.uikit-section>p{max-width:70ch;color:var(--color-secondary)}.specimen-label{font:13px/1.6 var(--font-ui);margin-bottom:20px}.specimen-label a{font-weight:700}.uikit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.uikit-panel{min-width:0;padding:24px;background:var(--color-surface);border:1px solid var(--color-control);border-radius:4px}.uikit-panel .brand img{max-width:100%}.uikit-prose{max-width:min(68ch,740px)}.uikit-native{display:flex;flex-wrap:wrap;align-items:center;gap:32px;padding:24px;background:var(--color-surface);border:1px solid var(--color-control)}.uikit-native figure{margin:0}.uikit-native figcaption{font-size:12px;margin-top:10px}.uikit-native img{max-width:none}.uikit-swatches{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.uikit-swatch{padding:20px;border:1px solid var(--color-control);border-radius:3px}.uikit-swatch strong,.uikit-swatch code{display:block}.uikit-swatch code{margin-top:8px;font-size:12px}.uikit-actions{display:flex;gap:12px;flex-wrap:wrap}.uikit-panel h3{font-size:22px;line-height:1.3}
|
||||
@media(max-width:950px){.masthead{gap:12px}.brand img{width:178px}.masthead nav{gap:14px}.reading-column{max-width:min(var(--reading-measure),740px)}.article-header{max-width:740px}}
|
||||
@media(max-width:650px){main{margin-inline:16px}.masthead{margin-inline:16px;padding-block:16px;display:grid;grid-template-columns:1fr auto;gap:8px 12px}.masthead .brand img{width:168px}.masthead nav{grid-column:1/-1;grid-row:2;gap:4px 14px;flex-wrap:wrap;justify-content:space-between;width:100%;font-size:13px}.masthead nav a{white-space:normal;min-height:44px}.theme-control{gap:4px;justify-content:flex-end}.theme-control>label{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}.theme-control select{max-width:100px;padding:8px 4px;font-size:12px}.footer{margin-inline:16px;grid-template-columns:1fr;gap:20px}.footer .brand img{width:178px}.footer>p,.footer>nav{grid-column:auto;grid-row:auto}.footer>span{display:block;text-align:left}.footer nav{gap:12px}.footer nav a{min-height:32px}.article-header h1{font-size:34px}.reading-column{max-width:100%}.article-content pre{font-size:13px;margin-inline:0;max-width:100%}.article-content figure{margin-inline:0}.contents-rail{font-size:13px}.article-content figcaption{font-size:12px}.index-date,.index-date span,.index-duration{font-size:12px}.index-entry{grid-template-columns:minmax(0,1fr) 58px}.index-entry h3{overflow-wrap:anywhere}.story-meta{font-size:12px;letter-spacing:0}.intro h1{font-size:38px}.simple-page{padding-inline:16px}.workbench textarea,.result-panel pre{font-size:13px}.result-heading button{font-size:12px;min-height:40px}.uikit-page{padding-top:32px}.uikit-grid,.uikit-swatches{grid-template-columns:1fr}.uikit-panel{padding:16px}.uikit-section{margin-block:32px;padding-top:24px}.uikit-native{padding:16px;gap:24px}.uikit-section>h2{font-size:26px}.article-content h2{margin-top:36px}}
|
||||
@media(forced-colors:active){button,input,textarea,select,.ui-button,.button,.table-scroll{border:1px solid ButtonText}a:focus-visible,button:focus-visible,[tabindex="0"]:focus-visible{outline:3px solid Highlight}.uikit-swatch{border-color:CanvasText}}
|
||||
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}
|
||||
|
||||
.ui-action-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}.ui-text-link{display:inline;text-decoration:underline;text-underline-offset:4px}.ui-tag{font:12px/1.5 var(--font-ui);color:var(--color-accent)}.brand-symbol img{width:32px;height:32px}.field-label{color:var(--color-text)}.result-panel .status-message.success{color:var(--color-success-text)}.result-panel .status-message.error{color:var(--color-error-text)}
|
||||
|
||||
@media(max-width:650px){.simple-page h1,.tool-page h1{font-size:34px;line-height:1.13;letter-spacing:-1px;overflow-wrap:anywhere}}
|
||||
|
||||
.catalog-controls>.field{flex:1;max-width:390px}@media(max-width:950px){.catalog-controls>.field{max-width:none;width:100%}}
|
||||
|
||||
/* V3 primitives remain shared by the live pages and inventory specimens. */
|
||||
.ui-button,.button,.field input,.field textarea,.theme-control select,.uikit-panel,.uikit-native,.uikit-swatch{border-radius:0}.ui-button.primary,.ui-button[data-variant=primary],.button{background:var(--accent);border-color:var(--accent);color:var(--bg)}.ui-button.secondary,.ui-button[data-variant=secondary]{background:var(--surface);color:var(--ink);border-color:var(--muted)}.field-label{font-size:14px;font-weight:700}.field input,.field textarea{padding:14px;min-height:48px}.field textarea{font:14px/1.6 var(--font-mono)}.theme-control select{border-color:var(--muted);padding:12px;min-height:46px}.status-message{border-left:4px solid var(--accent);background:var(--soft);padding:16px}.status-message.success{border-color:var(--color-success-text)}.status-message.error{border-color:var(--color-error-text)}.uikit-panel{border:0;border-top:3px solid var(--accent);padding:18px 0;background:none}.uikit-section{border-color:var(--line)}.uikit-grid{gap:32px}.uikit-native{background:var(--soft)}.ui-tag{font-family:var(--font-mono)}.brand img{width:224px}.brand-symbol img{width:32px;height:32px}.brand-dark{display:none}@media(max-width:800px){.masthead .brand img{width:178px}.masthead .brand-symbol img{width:32px}.theme-control{margin-left:auto}.theme-control select{max-width:112px;font-size:13px;padding:10px 6px}.uikit-grid{grid-template-columns:1fr}}
|
||||
/* Final semantic aliases keep the shared contract consistent across import order. */
|
||||
.reading-column,.article-header{max-width:720px}.article-content pre{border-left:4px solid var(--signal)}.article-content figure{background:#fff;color:#142035}.article-content figcaption{color:#526179;border-color:#c1cad8}.uikit-page>header{max-width:1000px}.uikit-page>header h1{font-size:clamp(38px,5.9vw,76px);letter-spacing:-.055em}.scroll-region{overscroll-behavior-inline:contain}.field-control[aria-invalid=true]{border-color:var(--color-error-text);border-left-width:4px}.ui-button:hover:not(:disabled),.ui-action-link:hover{filter:brightness(.95)}.ui-button:disabled{filter:none}.masthead nav a[aria-current=page]{box-shadow:0 3px var(--accent)}
|
||||
@media(max-width:800px){main{margin-inline:0;padding-inline:20px}.masthead{margin-inline:0;padding-inline:20px}.footer{margin-inline:20px}.article-header{max-width:100%}.reading-column{max-width:100%}.theme-control>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.masthead .brand img{width:178px}.masthead .brand-symbol img{width:32px}.article-content pre{font-size:13px}.uikit-page{padding-block:0}.uikit-panel{padding-inline:0}.simple-page{padding-inline:0}.article-header h1{font-size:37px;line-height:1.08}.article-content h2{font-size:28px}}
|
||||
.home-opening{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:32px 56px;padding:14px 0 0}.hero-copy{grid-column:1;grid-row:1}.home-opening>.mechanism{grid-column:2;grid-row:1;min-width:0}.home-opening>.lead{grid-column:1/-1;grid-row:2}.hero-copy h1{font-size:clamp(38px,5.9vw,86px);line-height:1.01;letter-spacing:-.055em;font-weight:800}.hero-copy .deck{font-size:21px;line-height:1.55;max-width:650px}.memory-map{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr);gap:8px;align-items:center;margin:24px 0;color:#fff}.memory-root,.memory-reachable,.memory-unreachable{border:2px solid #fff;padding:12px 8px;text-align:center;color:#fff;min-width:0}.memory-unreachable{grid-column:5;border-style:dashed}.memory-arrow{color:#fff;font-size:24px}.mechanism .mechanism-note{max-width:none;color:#fff;font:13px/1.6 var(--font-mono)}.mechanism .memory-map *{color:#fff}.entry-reason{color:var(--accent);font-size:15px;line-height:1.6}.brand img{height:auto}
|
||||
@media(max-width:800px){.home-opening{grid-template-columns:minmax(0,1fr);gap:24px}.hero-copy{grid-column:1;grid-row:1}.home-opening>.lead{grid-column:1;grid-row:2;margin-bottom:0}.home-opening>.mechanism{grid-column:1;grid-row:3;min-height:0;margin-bottom:32px}.mechanism p,.mechanism .mechanism-note{display:block!important}.memory-map{margin:16px 0;gap:6px}.memory-root,.memory-reachable,.memory-unreachable{padding:10px 4px;font-size:13px}.hero-copy .deck{font-size:19px}.theme-control{flex-shrink:0}.masthead .brand{max-width:100%}}
|
||||
@media(max-width:360px){.masthead .brand img{width:168px}.theme-control{margin-left:0}.masthead nav{order:3}.theme-control select{max-width:132px}}
|
||||
.component-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:32px}.gallery-panel{min-width:0;border-top:3px solid var(--accent);padding-top:18px}.gallery-panel h3{font-size:25px;line-height:1.2;letter-spacing:-.025em}.gallery-panel>p{color:var(--muted);font-size:15px;line-height:1.6}.gallery-panel .field{margin-block:20px}.gallery-panel .field-note{margin-top:8px}.gallery-panel textarea{width:100%;resize:vertical}.gallery-panel input:disabled{background:var(--soft);color:var(--muted);border-style:dashed;cursor:not-allowed}.gallery-panel input:read-only,.gallery-panel textarea:read-only{background:var(--soft)}.gallery-panel .status-message{margin-block:16px}.gallery-panel .scroll-region pre{padding:24px;background:var(--code);color:var(--oncode);font:14px/1.7 var(--font-mono);border-left:4px solid var(--signal);white-space:pre;min-width:max-content}.gallery-brands{display:flex;align-items:center;flex-wrap:wrap;gap:24px;margin-block:24px}.gallery-anatomy{font:13px/1.6 var(--font-mono)}.gallery-panel .theme-control{justify-content:flex-start}.gallery-panel .theme-control>label{position:static;width:auto;height:auto;clip-path:none}.gallery-panel .ui-action-link{margin-bottom:16px}@media(max-width:800px){.component-gallery{grid-template-columns:1fr;gap:28px}.gallery-panel h3{font-size:23px}}
|
||||
/* Actual V3 integration: real page roots and two-child editorial rows. */
|
||||
.home .entry{display:grid;grid-template-columns:minmax(0,1fr) 32px;gap:24px;align-items:start}.home .entry-content{grid-column:1;min-width:0}.home .entry-arrow{grid-column:2;font-size:26px}.home .entry h3{overflow-wrap:anywhere}.build-identity,.build-identity code{max-width:100%;overflow-wrap:anywhere;word-break:break-word}.build-identity code{display:block}.uikit-page .kit-inventory details,.uikit-page .kit-inventory dd{min-width:0;overflow-wrap:anywhere}.uikit-page .kit-inventory pre{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}.uikit-page .kit-inventory details{padding:18px 0;border-top:1px solid var(--color-border)}.uikit-page .kit-inventory summary{cursor:pointer;font-weight:700}.uikit-page .kit-inventory dl{display:grid;grid-template-columns:150px minmax(0,1fr);gap:10px 20px}.uikit-page .kit-inventory dt{font-weight:700}.uikit-page .kit-inventory dd{margin:0}.uikit-page .kit-inventory dd p a{display:inline-block;margin:4px 10px 4px 0}.page-preview,.preview-controls{min-width:0}.preview-controls{display:flex;gap:16px;align-items:end;flex-wrap:wrap;margin-bottom:20px}.preview-controls label{display:flex;flex-direction:column;gap:6px;min-width:0;max-width:100%}.preview-controls select{max-width:100%;min-height:44px;padding:10px;background:var(--color-surface);color:var(--color-text);border:1px solid var(--color-control)}.preview-controls label:first-child{flex:1;min-width:180px}.page-preview-region{max-width:100%;overflow:auto;border:1px solid var(--color-control);padding:8px;background:var(--color-surface)}.page-preview-region iframe{display:block;border:0;max-width:none}.mechanism>p{width:auto;max-width:none}.mechanism>p:not(.mono){font:14px/1.6 var(--font-ui)}.mechanism>.mechanism-note{font:13px/1.6 var(--font-ui)}
|
||||
@media(max-width:800px){main.simple-page,main.service-page,main.uikit-page,main.missing{padding:30px 20px 48px;margin:0;max-width:100%;width:100%;min-width:0}.home .entry{grid-template-columns:minmax(0,1fr);gap:8px}.home .entry-arrow{grid-column:1;font-size:22px}.uikit-page .kit-inventory dl{grid-template-columns:minmax(0,1fr);gap:4px}.uikit-page .kit-inventory dd{margin-bottom:16px}.preview-controls label{width:100%}.preview-controls label:first-child{min-width:0}.uikit-type-scale h1{font-size:38px;overflow-wrap:anywhere}}
|
||||
|
||||
/* Native radio theme switch: shared header and kit, no operating-system popup. */
|
||||
.theme-control{margin:0;padding:0;min-width:36px;width:36px;height:40px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border:1px solid transparent;border-radius:0;background:transparent;color:var(--color-text);cursor:pointer}.theme-control:hover{border-color:var(--color-control);background:var(--color-surface)}.theme-control:focus-visible{outline:3px solid var(--color-accent);outline-offset:3px}.theme-icon{display:none;max-width:none}.theme-control[data-ready=true][data-theme-mode=system] [data-theme-icon=system],.theme-control[data-ready=true][data-theme-mode=light] [data-theme-icon=light],.theme-control[data-ready=true][data-theme-mode=dark] [data-theme-icon=dark],:root[data-theme=system] .theme-control[data-ready=false] [data-theme-icon=system],:root[data-theme=light] .theme-control[data-ready=false] [data-theme-icon=light],:root[data-theme=dark] .theme-control[data-ready=false] [data-theme-icon=dark],:root:not([data-theme]) .theme-control[data-ready=false] [data-theme-icon=system]{display:block}
|
||||
@media(max-width:800px){.masthead .theme-control{margin-left:auto}.masthead .brand img{width:160px}.masthead .brand-symbol img{width:32px}.masthead{gap:10px}.masthead nav{gap:16px}}
|
||||
@media(forced-colors:active){.theme-control:hover{border-color:ButtonText}.theme-control:focus-visible{outline-color:Highlight}}
|
||||
.editorial-note{font:14px/1.6 var(--font-ui);color:var(--color-secondary);max-width:720px;margin:20px 0 0;overflow-wrap:anywhere}.editorial-note a{color:var(--color-accent)}
|
||||
/* Persisted integration rules: tool/archive gutters and real-page review links. */
|
||||
@media(max-width:800px){main#main.tool-page,main#main.archive-page{padding:30px 20px 48px;margin:0;max-width:100%;width:100%;min-width:0}}
|
||||
.real-page-links{columns:2;column-gap:32px;padding-left:20px}.real-page-links li{break-inside:avoid;margin-bottom:12px}.preview-utility>summary,.preview-page-picker>summary{cursor:pointer;padding:16px 0;font-weight:700}.preview-page-picker ul{list-style:none;padding:0;display:grid;gap:8px}.preview-page-picker button{text-align:left;max-width:100%;white-space:normal}.preview-controls button[aria-pressed=true]{background:var(--color-accent);color:var(--color-canvas)}@media(max-width:800px){.real-page-links{columns:1}}
|
||||
@@ -0,0 +1,19 @@
|
||||
*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:92px}body{margin:0;color:var(--ink);background:var(--paper);font-family:Arial,Helvetica,sans-serif;line-height:1.6}a{color:inherit;text-underline-offset:4px}button,input,textarea{font:inherit}button,a,input,textarea,summary{touch-action:manipulation}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible,pre:focus-visible{outline:3px solid var(--accent);outline-offset:4px}img{max-width:100%;height:auto;display:block}h1,h2,h3,p{margin-top:0}h1,h2,h3{line-height:1.12}button{border:1px solid var(--line);padding:9px 14px;background:transparent;color:var(--ink);border-radius:3px}.button{display:inline-flex;align-items:center;justify-content:center;background:var(--ink);color:var(--white);padding:12px 20px;border:1px solid var(--ink);text-decoration:none;font-weight:700;border-radius:3px}.button:hover{background:var(--accent);border-color:var(--accent)}.skip-link{position:absolute;left:16px;top:-80px;z-index:30;background:var(--ink);color:var(--color-canvas);padding:12px}.skip-link:focus{top:10px}.masthead{max-width:1264px;margin:auto;min-height:88px;padding:16px 32px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ink);gap:24px}.wordmark{text-decoration:none;font-size:32px;font-weight:900;letter-spacing:-1.8px;line-height:1}.wordmark span{font-weight:400}.wordmark i{font-style:normal;color:var(--accent)}.masthead nav{display:flex;gap:28px;align-items:center;font-size:14px}.masthead nav a{text-decoration:none}.masthead nav a:hover{color:var(--accent)}.edition{font:11px monospace;letter-spacing:1px;color:var(--muted)}main{max-width:1200px;margin:auto}.kicker{font:700 11px/1.5 Arial,sans-serif;letter-spacing:1.5px;color:var(--accent);margin-bottom:16px}.intro{padding:58px 0 42px;display:flex;align-items:flex-end;justify-content:space-between;gap:40px}.intro h1{font-size:clamp(36px,4.2vw,62px);letter-spacing:-2.5px;margin-bottom:0}.intro h1 em{font-style:normal;color:var(--accent)}.intro-deck{font-size:16px;line-height:1.7;color:var(--muted);max-width:350px;margin-bottom:5px}.front-grid{display:grid;grid-template-columns:1.4fr 1fr;gap:40px;border-top:1px solid var(--line);padding-top:28px}.lead-story{text-decoration:none;background:var(--color-subtle);border:1px solid var(--color-border);border-radius:4px;padding:30px 32px;display:flex;flex-direction:column}.story-meta{display:flex;justify-content:space-between;gap:10px;font:10px monospace;letter-spacing:1px;color:var(--color-secondary);margin-bottom:26px}.lead-story h2{font-size:clamp(28px,3vw,42px);letter-spacing:-1.4px;margin-bottom:17px}.lead-story>p{font-size:16px;color:var(--color-secondary);max-width:480px;line-height:1.6}.lead-visual{margin:20px -8px 26px}.lead-visual img{width:100%;max-height:280px;object-fit:contain}.text-link{display:flex;justify-content:space-between;font-size:14px;font-weight:700;margin-top:auto;border-top:1px solid var(--color-border);padding-top:16px}.text-link b{color:var(--accent);font-size:22px}.section-title{border-bottom:2px solid var(--ink);padding-bottom:16px}.section-title .kicker{margin-bottom:8px}.section-title h2{font-size:25px;letter-spacing:-.6px;margin:0}.recipe{display:flex;gap:15px;border-bottom:1px solid var(--line);padding:22px 0;text-decoration:none;align-items:flex-start}.recipe-number{font:12px monospace;color:var(--muted);padding-top:3px}.tiny-topic{font:10px monospace;letter-spacing:.8px;color:var(--accent)}.recipe h3{font-size:19px;line-height:1.3;margin:6px 0 0;font-weight:600}.recipe>b{margin-left:auto;font-size:22px;color:var(--accent)}.recipe:hover h3,.index-entry a:hover h3{color:var(--accent)}.reading-routes{margin-top:58px;border-top:1px solid var(--ink);padding:24px 0 36px}.reading-routes>div{display:grid;grid-template-columns:repeat(3,1fr);gap:30px}.reading-routes a{text-decoration:none;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:9px;padding-right:24px}.reading-routes a:last-child{border:0}.reading-routes a>span{font:11px monospace;color:var(--muted)}.reading-routes strong{font-size:20px;line-height:1.25}.reading-routes small{font-size:13px;color:var(--muted)}.journal{padding:40px 0 56px;border-top:1px solid var(--ink)}.journal-heading{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:25px}.journal-heading h2{font-size:38px;letter-spacing:-1px;margin:0}.journal-heading>span{font:12px monospace;color:var(--muted)}.catalog-controls{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;background:var(--soft);padding:24px}.catalog-controls label{flex:1;max-width:390px}.catalog-controls label>span{display:block;font-size:12px;margin-bottom:8px}input{width:100%;background:var(--white);border:1px solid var(--color-control);padding:12px;color:var(--ink);border-radius:2px}.topic-tabs{display:flex;flex-wrap:wrap;gap:7px}.topic-tabs button{padding:8px 12px;Line truncated
|
||||
@media(min-width:1600px){main{max-width:1200px}}@media(max-width:1280px){main{margin:0 32px}.article-header{margin-left:220px}.reading-layout{grid-template-columns:185px minmax(0,1fr);gap:35px}.reading-layout:has(>.reading-column:first-child){margin-left:220px}.simple-page{margin-left:auto;margin-right:auto;padding-left:25px;padding-right:25px}}@media(max-width:950px){.edition{display:none}.front-grid{grid-template-columns:1.2fr 1fr;gap:25px}.lead-story{padding:25px}.recipe h3{font-size:17px}.intro-deck{max-width:280px;font-size:14px}.catalog-controls{flex-direction:column;align-items:stretch;gap:18px}.catalog-controls label{max-width:none}.article-header{margin-left:0;max-width:820px}.reading-layout{display:block}.reading-layout:has(>.reading-column:first-child){margin-left:0}.contents-rail{position:static;max-height:none;max-width:810px;padding:15px 20px;background:var(--soft);margin-bottom:30px}.contents-rail nav{display:grid;grid-template-columns:1fr 1fr;gap:0 25px}.contents-rail details summary{padding-bottom:10px}.footer{grid-template-columns:1fr 1.5fr 1fr}.footer>span{display:none}.workbench{gap:20px}.index-entry{grid-template-columns:140px 1fr 70px;gap:20px}.article-content{font-size:17px}}
|
||||
@media(max-width:650px){html{scroll-padding-top:20px}.masthead{margin:0 20px;padding:20px 0;gap:20px;flex-wrap:wrap;min-height:108px}.wordmark{font-size:30px}.masthead nav{gap:22px;width:100%;font-size:12px;justify-content:space-between}.masthead nav a{white-space:nowrap}main{margin:0 20px}.intro{padding:35px 0 28px;display:block}.intro h1{font-size:41px;letter-spacing:-1.8px}.intro-deck{max-width:none;font-size:14px;margin:23px 0 0}.intro-deck br{display:none}.kicker{font-size:10px;letter-spacing:1.2px}.front-grid{display:block;padding-top:20px}.lead-story{padding:22px}.story-meta{font-size:8px;margin-bottom:22px;letter-spacing:.8px}.lead-story h2{font-size:29px;letter-spacing:-1px}.lead-story>p{font-size:14px}.lead-visual{margin:15px -12px 20px}.lead-visual img{max-height:none}.text-link{font-size:12px}.recipe-column{margin-top:30px}.section-title h2{font-size:25px}.recipe{padding:18px 0}.recipe h3{font-size:19px}.reading-routes{margin-top:35px;padding-top:20px}.reading-routes>div{display:block}.reading-routes a{border-right:0;border-bottom:1px solid var(--line);padding:17px 0;gap:7px}.reading-routes strong{font-size:20px}.journal{padding-top:28px;padding-bottom:35px}.journal-heading{display:block}.journal-heading h2{font-size:30px;margin-bottom:14px}.journal-heading>span{font-size:11px}.catalog-controls{padding:18px;margin:0 -4px}.topic-tabs{gap:6px}.topic-tabs button{font-size:12px;padding:8px 11px}.index-entry{grid-template-columns:1fr 55px;gap:10px;padding:22px 0}.index-date{grid-column:1/-1;display:flex;justify-content:space-between;gap:15px;font-size:10px;padding:0}.index-date span{display:inline;margin:0;font-size:10px}.index-entry h3{font-size:20px;line-height:1.3;margin:0 0 10px}.index-entry p{font-size:13px;line-height:1.6}.index-duration{font-size:10px;display:block;text-align:right;padding-top:6px}.index-duration b{display:block;font-size:23px;padding-top:15px}.utility-promo{display:block;padding:25px;margin-bottom:35px}.utility-promo h2{font-size:29px}.utility-promo p{font-size:14px}.utility-promo .button{font-size:12px;margin-top:25px}.footer{margin:0 20px;padding:28px 0;grid-template-columns:1fr 1fr;gap:22px}.footer>p{grid-column:1}.footer>div{grid-column:2;grid-row:1/3;font-size:12px}.footer .wordmark{font-size:24px}.breadcrumbs{font-size:10px;padding:22px 0;gap:10px}.article-header{margin:12px 0 26px}.article-header h1{font-size:34px;letter-spacing:-1px;line-height:1.13;margin-bottom:20px}.article-deck{font-size:18px;line-height:1.5;margin-bottom:20px}.article-meta{font-size:10px;gap:8px 15px;padding-top:13px}.contents-rail{padding:13px 16px;margin:0 0 25px}.contents-rail nav{display:flex;gap:0}.contents-rail nav a{padding:7px 0;font-size:12px}.article-content{font-size:17px;line-height:1.75}.article-content h2{font-size:25px;margin:36px 0 18px;line-height:1.25;letter-spacing:-.4px}.article-content h3{font-size:20px;margin-top:28px}.article-content pre{font-size:12px;padding:20px 18px;margin:24px -4px;max-width:calc(100% + 8px)}.article-content figure{margin:25px -4px;padding:10px}.article-content figcaption{font-size:11px;line-height:1.6;padding-top:10px;margin-top:10px}.article-content blockquote{padding-left:18px;margin:20px 0}.article-end{font-size:10px}.related{padding:20px}.related a{font-size:17px}.reading-layout{padding-bottom:35px}.simple-page{margin:0;padding:35px 20px 50px;max-width:none}.simple-page h1,.tool-page h1{font-size:43px;letter-spacing:-1.6px}.large-text{font-size:20px;line-height:1.6;margin-bottom:35px}.tool-page{padding:35px 0 50px}.tool-heading p:not(.kicker){font-size:15px}.workbench{grid-template-columns:1fr;gap:28px}.workbench textarea{min-height:260px;font-size:13px;padding:16px}.result-panel{min-height:280px;padding:0 18px 18px}.result-panel pre{font-size:13px;min-height:150px}.tool-actions{gap:7px}.tool-actions button{font-size:12px;padding:10px 13px}.field-note{font-size:10px;line-height:1.5}.tool-notes{margin-top:30px;font-size:14px}.missing{padding:45px 0 65px}.missing h1{font-size:34px}.missing>p:not(.kicker){font-size:14px}.missing-code{font-size:70px}.archive-page{padding:35px 0}.archive-page h1{font-size:37px}.archive-page>.large-text{font-size:18px}.resource-groups section>h2{font-size:25px}.resource-groups h3{font-size:18px}}
|
||||
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
|
||||
|
||||
.article-content .table-scroll{max-width:100%;overflow:auto;margin:25px 0;border:1px solid var(--line);border-radius:3px}.article-content .table-scroll:focus-visible{outline:3px solid var(--accent);outline-offset:4px}.article-content .table-scroll table{display:table;min-width:620px;max-width:none;width:100%;margin:0;overflow-wrap:normal}.article-content figure img[src$=".jpg"]{width:auto;max-width:100%;margin-inline:auto}
|
||||
|
||||
|
||||
/* V3 blue-black trace journal: exact concept geometry plus production aliases. */
|
||||
|
||||
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Arial,Helvetica,sans-serif}button,input,textarea{font:inherit}a{color:inherit;text-decoration-thickness:1px;text-underline-offset:4px}button,a,input,textarea,summary{outline-offset:5px}*:focus-visible{outline:3px solid var(--accent)}button{cursor:pointer}.masthead{max-width:1328px;margin:auto;padding:28px 32px 18px;display:flex;align-items:center;gap:32px;border-bottom:2px solid var(--ink)}.brand{display:flex;align-items:center;gap:11px;text-decoration:none;font-size:29px;font-weight:800;letter-spacing:-1.6px}.brand svg{width:42px;height:42px;color:var(--accent)}.masthead nav{display:flex;gap:24px;margin-left:auto}.masthead nav a{padding:12px 0;text-decoration:none;font-size:15px;font-weight:700}.masthead nav a[aria-current=page]{box-shadow:0 3px var(--accent)}.theme{border:1px solid var(--line);background:var(--surface);color:var(--ink);padding:12px}.notice{max-width:1264px;margin:12px auto 0;font:11px/1.6 monospace;color:var(--muted);letter-spacing:.05em}main{max-width:1328px;margin:auto;padding:40px 32px 80px}section[hidden],.entry[hidden]{display:none}.eyebrow,small,.mono{font:12px/1.6 monospace}.eyebrow{text-transform:uppercase;letter-spacing:.12em;color:var(--accent)}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(38px,5.9vw,86px);line-height:1.01;letter-spacing:-.055em;margin-bottom:26px;max-width:1020px;font-weight:800}h2{font-size:32px;line-height:1.12;letter-spacing:-.03em}h3{font-size:25px;line-height:1.2;letter-spacing:-.025em;margin:7px 0 12px}.deck{font-size:21px;line-height:1.55;max-width:650px}.hero{display:grid;grid-template-columns:1.7fr 1fr;gap:56px;padding:14px 0 48px}.mechanism{background:#1648c6;color:white;padding:28px;align-self:start;position:relative;min-height:336px}.mechanism svg{width:100%;height:210px;display:block}.mechanism p{font:13px/1.6 monospace;margin:0;max-width:26ch}.section-head{border-top:2px solid var(--ink);display:flex;align-items:baseline;justify-content:space-between;padding:18px 0}.lead{display:grid;grid-template-columns:120px 1fr 260px;gap:32px;background:var(--soft);padding:32px 28px;border-left:6px solid var(--accent);margin-bottom:42px}.lead .num{font-size:70px;line-height:1;color:var(--accent);font-weight:bold;letter-spacing:-.06em}.lead h2{font-size:38px}.lead p{line-height:1.6}.lead aside{border-left:1px solid var(--line);padding-left:24px}.entry{display:grid;grid-template-columns:64px minmax(0,1fr) 30px;gap:20px;padding:25px 0;border-top:1px solid var(--line);text-decoration:none}.entry:hover h3{text-decoration:underline;color:var(--accent)}.entry h3,.entry p{overflow-wrap:anywhere}.entry-number{font:16px/2 monospace;color:var(--accent)}.entry small{color:var(--muted)}.entry p{color:var(--muted);line-height:1.6;margin-bottom:0;max-width:76ch}.arrow{font-size:20px;color:var(--accent)}.index-layout{display:grid;grid-template-columns:240px 1fr;gap:48px}.index-rail{border-top:2px solid var(--ink);padding-top:18px}.index-rail p{font-size:14px;line-height:1.6;color:var(--muted)}.topics{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.topics button{background:var(--surface);color:var(--ink);border:1px solid var(--line);padding:10px 12px}.topics button[aria-pressed=true]{background:var(--accent);color:var(--bg);border-color:var(--accent)}label{display:block;font-size:14px;font-weight:bold;margin-bottom:10px}.searchrow{display:flex;gap:8px;max-width:600px}.searchrow input{width:100%;min-width:0;padding:14px;border:1px solid var(--muted);background:var(--surface);color:var(--ink)}.action{background:var(--accent);color:var(--bg);padding:13px 18px;border:1px solid var(--accent);font-weight:700}.secondary{background:var(--surface);color:var(--ink);border-color:var(--muted)}.result-count{padding:14px 0;color:var(--muted);font:13px/1.6 monospace}.reading-top{max-width:1000px;margin:0 0 42px 228px}.reading-top h1{font-size:clamp(35px,4.4vw,63px);line-height:1.08}.reading-layout{display:grid;grid-template-columns:180px minmax(0,720px);gap:48px}.toc{align-self:start;position:sticky;top:24px;font:13px/1.6 monospace;border-top:3px solid var(--accent);padding-top:16px}.toc a{display:block;padding:10px 0;color:var(--muted)}.prose{font-size:19px;line-height:1.7;min-width:0}.prose p{margin-bottom:1.15em}.prose h2{margin-top:48px;font-size:31px;line-height:1.2;scroll-margin-top:30px}.prose h3{margin-top:32px;font-size:24px}.prose a{color:var(--accent)}.prose pre,.spec pre{max-width:100%;overflow:auto;background:var(--code);color:var(--oncode);padding:24px;font:14px/1.7 monospace;border-left:4px solid #e6ff57}.prose code{font-family:monospace;font-size:.88em}.prose img{max-width:100%;height:auto;background:#fff;display:block}.prose figure{margin:32px 0;background:#fff;color:#142035;padding:20px}.prose figcaption{font:13px/1.6 Arial;margin-top:16px}.prose table{border-collapse:collapse;width:100%;font-size:16px}.prose td,.prose th{border:1px solid var(--line);padding:14px;text-align:left}.scrollLine truncated
|
||||
.lead{grid-template-columns:minmax(0,1fr) 260px}.related{margin-top:64px}.continuation{display:block;padding:24px 0;border-bottom:1px solid var(--line);text-decoration:none}.continuation span{display:block;font:14px/1.6 monospace;color:var(--muted);margin-bottom:8px}.continuation strong{font-size:24px}.reason{color:var(--accent)!important;font-size:15px}.native-pair{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:16px 0}.native{padding:24px;display:flex;gap:24px;align-items:center}.native span{font:13px/1.5 monospace}.service{max-width:948px}.service h1{font-size:clamp(38px,5vw,70px)}.service>.prose{max-width:720px;margin-left:228px}.missing-code{font:64px monospace;color:var(--accent)}button:disabled{opacity:.6;cursor:not-allowed}@media(max-width:800px){.lead{grid-template-columns:minmax(0,1fr)}.lead aside{grid-column:auto;border-top:1px solid var(--line);padding-top:16px}.lead h2{font-size:28px}#home .entry{display:block}#home .entry-number{display:none}#catalog .entry{display:block}#catalog .entry-number{font-size:11px;display:inline;margin-right:10px}#catalog .arrow,#home .arrow{display:none}#catalog .entry h3{margin-top:8px}.searchrow{display:block}.searchrow input{display:block;width:100%}.searchrow button{margin-top:8px;padding:10px 14px}.mechanism{padding:16px}.mechanism svg,.mechanism p{display:none!important}.mechanism:after{content:none}.mechanism a{margin-top:0!important}.service>.prose{margin-left:0}.native-pair{grid-template-columns:1fr}.native{gap:20px;padding:16px}}
|
||||
.kit-inventory{margin:32px 0 48px;border-top:3px solid var(--accent);padding-top:18px}.kit-inventory summary{font-size:23px;font-weight:700;cursor:pointer}.kit-inventory p{line-height:1.6}.kit-inventory table{border-collapse:collapse;min-width:740px;font-size:14px;line-height:1.6}.kit-inventory th,.kit-inventory td{border:1px solid var(--line);padding:14px;vertical-align:top;text-align:left}.theme,.topics button{border-color:var(--muted)}#missing>p:not(.eyebrow){font-size:19px;line-height:1.6;max-width:60ch}#missing>a{display:inline-block;margin:12px 24px 12px 0;padding:8px 0}
|
||||
|
||||
.masthead{min-height:0;justify-content:flex-start}.masthead nav{margin-left:auto}.masthead .brand{flex-shrink:0}.edition{display:none}main{max-width:1328px;margin:auto;padding:40px 32px 80px}.article-header,.reading-top{max-width:1000px;margin:0 0 42px 228px}.article-header h1{font-size:clamp(35px,4.4vw,63px);line-height:1.08;letter-spacing:-.055em}.article-deck,.large-text{font-family:var(--font-ui);font-size:21px;line-height:1.55}.reading-layout{grid-template-columns:180px minmax(0,720px);gap:48px}.reading-column{max-width:720px}.reading-layout:has(>.reading-column:first-child){margin-left:228px}.contents-rail{border-top:3px solid var(--accent);padding-top:16px;background:none}.contents-rail nav{display:flex;flex-direction:column}.contents-rail nav a{font:13px/1.6 var(--font-mono)}.article-content{font:var(--reading-size)/var(--reading-leading) var(--font-reading)}.article-content h2{font-size:31px}.article-content h3{font-size:24px}.article-content pre{border-radius:0;border:0;border-left:4px solid var(--signal);font:14px/1.7 var(--font-mono);padding:24px;margin:28px 0;max-width:100%}.article-content figure{border-radius:0;background:#fff;color:#142035;padding:20px}.article-content figure img{background:#fff}.article-content figcaption{color:#526179;border-color:#c1cad8;font-size:13px}.article-content table{font-size:16px}.article-content .table-scroll{border-radius:0}.article-content .table-scroll table{background:#fff;color:#142035}.article-content th{background:#e7edf9}.article-content th,.article-content td{border-color:#8d9db5}.related{margin-top:64px;background:none;padding:0}.related a{display:block;padding:24px 0;border-top:0;border-bottom:1px solid var(--line)}.related a>span{display:block;font:14px/1.6 var(--font-mono);color:var(--muted);margin-bottom:8px}.utility-promo{border-radius:0;background:var(--soft);color:var(--ink);border-left:6px solid var(--accent)}.catalog-controls{background:none;padding:0;align-items:flex-end}.topic-tabs button[aria-pressed=true]{background:var(--accent);color:var(--bg);border-color:var(--accent)}.index-entry{grid-template-columns:150px minmax(0,1fr) 80px}.index-entry h3{font-size:25px;letter-spacing:-.025em}.index-entry p{font-size:16px}.footer{display:flex;padding:32px 0;gap:24px;max-width:1264px;border-top:2px solid var(--ink);color:var(--ink);font-size:13px}.footer>p{width:100%}.footer>span{text-align:left}.simple-page,.service-page,.archive-page,.tool-page{padding-top:0;padding-bottom:0}.service-page .article-content{max-width:720px}.missing{text-align:left}.missing-code{color:var(--accent)}
|
||||
@media(max-width:950px){.masthead{gap:16px}.masthead nav{gap:16px}.reading-layout{display:grid}.article-header{margin-left:0}.reading-layout:has(>.reading-column:first-child){margin-left:0}}
|
||||
@media(max-width:800px){main{margin:0;padding:30px 20px 48px}.masthead{margin:0;padding:18px 20px;display:flex;flex-wrap:wrap;gap:12px}.masthead nav{order:3;grid-column:auto;grid-row:auto;width:100%;margin:0;justify-content:flex-start;gap:16px}.masthead nav a{font-size:13px}.reading-layout{grid-template-columns:minmax(0,1fr);gap:28px}.article-header{margin:0 0 32px}.article-header h1{font-size:37px}.article-deck{font-size:19px}.reading-column{max-width:100%}.contents-rail{margin:0;padding:16px 0 0}.contents-rail nav{display:flex}.article-content{font-size:18px;line-height:1.7}.article-content h2{font-size:28px}.article-content pre{margin:24px 0;font-size:13px;padding:20px 16px;max-width:100%}.article-content figure{margin:25px 0;padding:16px}.article-content figcaption{font-size:13px}.article-content table{font-size:15px}.index-entry{grid-template-columns:minmax(0,1fr) 58px}.index-entry h3{font-size:23px}.index-entry p{font-size:15px}.index-date{grid-column:1/-1}.catalog-controls{gap:18px}.footer{margin:0 20px;display:flex}.footer nav{width:100%}.simple-page{padding-inline:0}.large-text{font-size:19px}.utility-promo{padding:24px}.related{margin-top:40px}.workbench{grid-template-columns:1fr}.uikit-page{padding:0}}
|
||||
|
||||
.mechanism,.mechanism a,.mechanism p,.mechanism strong,.mechanism small{color:#fff}.mechanism a:visited{color:#fff}.mechanism svg{color:#fff}.mechanism .signal{color:var(--signal)}
|
||||
@@ -0,0 +1,4 @@
|
||||
:root{color-scheme:light;--color-canvas:#f5f7fa;--color-surface:#fff;--color-subtle:#e7edf9;--color-text:#142035;--color-secondary:#526179;--color-accent:#1648c6;--color-visited:#6544a2;--color-border:#c1cad8;--color-control:#526179;--color-code:#101e36;--color-code-text:#e8eefb;--color-code-border:#536784;--color-success-bg:#e7f3ec;--color-success-text:#1e643d;--color-error-bg:#fff0ef;--color-error-text:#a52e28;--color-signal:#e6ff57;--font-ui:Arial,Helvetica,sans-serif;--font-reading:Arial,Helvetica,sans-serif;--font-mono:SFMono-Regular,Consolas,monospace;--reading-size:19px;--reading-leading:1.7;--reading-measure:68ch;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-6:24px;--space-8:32px;--space-12:48px;--space-16:64px;--paper:var(--color-canvas);--bg:var(--color-canvas);--white:var(--color-surface);--surface:var(--color-surface);--ink:var(--color-text);--muted:var(--color-secondary);--line:var(--color-border);--accent:var(--color-accent);--soft:var(--color-subtle);--code:var(--color-code);--oncode:var(--color-code-text);--signal:var(--color-signal)}
|
||||
:root[data-theme=dark]{color-scheme:dark;--color-canvas:#111b2c;--color-surface:#18253a;--color-subtle:#22334e;--color-text:#edf2fd;--color-secondary:#b3c0d7;--color-accent:#9dbaff;--color-visited:#d2b7ff;--color-border:#596b87;--color-control:#a0b0c8;--color-code:#101e36;--color-code-text:#e8eefb;--color-code-border:#536784;--color-success-bg:#17372b;--color-success-text:#a8e0bd;--color-error-bg:#432a32;--color-error-text:#ffb6b0;}
|
||||
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--color-canvas:#111b2c;--color-surface:#18253a;--color-subtle:#22334e;--color-text:#edf2fd;--color-secondary:#b3c0d7;--color-accent:#9dbaff;--color-visited:#d2b7ff;--color-border:#596b87;--color-control:#a0b0c8;--color-code:#101e36;--color-code-text:#e8eefb;--color-code-border:#536784;--color-success-bg:#17372b;--color-success-text:#a8e0bd;--color-error-bg:#432a32;--color-error-text:#ffb6b0;}}
|
||||
@media(max-width:800px){:root{--reading-size:18px}}
|
||||
@@ -0,0 +1 @@
|
||||
export {Brand,Button,ActionLink,TextLink,Field,TextArea,StatusMessage,ScrollRegion,Prose,Tag} from './primitives';
|
||||
@@ -0,0 +1,34 @@
|
||||
import Link from 'next/link';
|
||||
const classes=(...names)=>names.filter(Boolean).join(' ');
|
||||
export function Brand({className='',...props}){
|
||||
return <Link {...props} href="/" aria-label="ProgCode — главная" className={classes('brand',className)}><img className="brand-light" src="/brand/v3/logo-light.svg" width="224" height="48" alt="" aria-hidden="true"/><img className="brand-dark" src="/brand/v3/logo-dark.svg" width="224" height="48" alt="" aria-hidden="true"/></Link>;
|
||||
}
|
||||
export function Button({variant='primary',type='button',className='',children,...props}){
|
||||
const kind=variant==='secondary'?'secondary':'primary';
|
||||
return <button {...props} type={type} className={classes('ui-button',kind,className)} data-variant={kind}>{children}</button>;
|
||||
}
|
||||
export function ActionLink({href,children,variant='primary',className='',...props}){
|
||||
const kind=variant==='secondary'?'secondary':'primary';
|
||||
return <Link {...props} href={href} className={classes('ui-button','ui-action-link',kind,className)} data-variant={kind}>{children}</Link>;
|
||||
}
|
||||
export function TextLink({href,children,className='',...props}){return <Link {...props} href={href} className={classes('ui-text-link',className)}>{children}</Link>;}
|
||||
function descriptions(existing,hintId){return [existing,hintId].filter(Boolean).join(' ')||undefined;}
|
||||
export function Field({id,label,hint,className='',...inputProps}){
|
||||
const hintId=hint?`${id}-hint`:undefined;
|
||||
return <div className="field"><label className="field-label" htmlFor={id}>{label}</label><input {...inputProps} id={id} className={classes('field-control',className)} aria-describedby={descriptions(inputProps['aria-describedby'],hintId)}/>{hint&&<p id={hintId} className="field-note">{hint}</p>}</div>;
|
||||
}
|
||||
export function TextArea({id,label,hint,className='',...textareaProps}){
|
||||
const hintId=hint?`${id}-hint`:undefined;
|
||||
return <div className="field field-textarea"><label className="field-label" htmlFor={id}>{label}</label><textarea {...textareaProps} id={id} className={classes('field-control',className)} aria-describedby={descriptions(textareaProps['aria-describedby'],hintId)}/>{hint&&<p id={hintId} className="field-note">{hint}</p>}</div>;
|
||||
}
|
||||
export function StatusMessage({tone='neutral',children,id,className='',...props}){
|
||||
const kind=['neutral','success','error'].includes(tone)?tone:'neutral';
|
||||
return <p {...props} id={id} role="status" aria-live="polite" aria-atomic="true" className={classes('status-message',kind,className)} data-tone={kind}>{children}</p>;
|
||||
}
|
||||
export function ScrollRegion({label,children,className='',tabIndex=0,...props}){return <div {...props} className={classes('scroll-region',className)} tabIndex={tabIndex} role="region" aria-label={label}>{children}</div>;}
|
||||
// html must be the reviewed build-generated publication HTML, never an untrusted input.
|
||||
export function Prose({children,html,className='',...props}){
|
||||
const attrs={...props,className:classes('prose','article-content',className)};
|
||||
return typeof html==='string'?<div {...attrs} dangerouslySetInnerHTML={{__html:html}}/>:<div {...attrs}>{children}</div>;
|
||||
}
|
||||
export function Tag({children,className='',...props}){return <span {...props} className={classes('ui-tag',className)}>{children}</span>;}
|
||||
@@ -0,0 +1,3 @@
|
||||
import {Prose} from '../../shared/ui';
|
||||
import {ContentAccess} from '../../features/content-access';
|
||||
export default function ArticleReader({article,related}){return <div className="reading-layout">{article.toc?.length>1&&<aside className="contents-rail"><details open><summary>В этой статье</summary><nav aria-label="Оглавление статьи">{article.toc.map((section,index)=><a key={section.id} href={'#'+section.id}><span>{String(index+1).padStart(2,'0')}</span>{section.title}</a>)}</nav></details></aside>}<div className="reading-column"><Prose html={article.contentHtml}/><ContentAccess/><div className="article-end"><span>КОНЕЦ ЗАМЕТКИ</span><a href="#main">↑ В начало</a></div>{related}</div></div>}
|
||||
@@ -0,0 +1,4 @@
|
||||
"use client";
|
||||
import {JournalSearch} from '../../features/journal-search';
|
||||
import {trackGoal} from '../../features/analytics';
|
||||
export default function JournalIndex({articles}){return <JournalSearch articles={articles} onResultSelect={()=>trackGoal('search_used')} onZeroResults={()=>trackGoal('search_zero_results')}/>}
|
||||
@@ -0,0 +1,2 @@
|
||||
import {JsonEditor} from '../../features/json-editor';
|
||||
export default function JsonWorkbench(){return <JsonEditor/>}
|
||||
@@ -0,0 +1,2 @@
|
||||
import {TextLink} from '../../shared/ui';
|
||||
export default function MechanismMap({href}){return <aside className="mechanism" aria-labelledby="mechanism-title"><p className="mono" id="mechanism-title">ПАМЯТЬ / УПРОЩЁННАЯ МОДЕЛЬ MARK–SWEEP</p><div className="memory-map" role="img" aria-label="От корней есть путь к A, затем к B. К C пути нет."><span className="memory-root">Корни</span><span className="memory-arrow" aria-hidden="true">→</span><span className="memory-reachable">A</span><span className="memory-arrow" aria-hidden="true">→</span><span className="memory-reachable">B</span><span className="memory-unreachable">C <small>нет пути</small></span></div><p><strong>MARK</strong> отмечает A и B.<br/><strong>SWEEP</strong> освобождает блок C.</p><p className="mechanism-note">Корни — стек, регистры и данные. Финализаторы и ложные указатели усложняют реализацию; это схема из разбора 2017 года.</p><TextLink href={href}>Как устроен сбор →</TextLink></aside>}
|
||||
@@ -0,0 +1,5 @@
|
||||
'use client';
|
||||
import {useEffect,useState} from 'react';
|
||||
import {Button,TextLink,StatusMessage} from '../../shared/ui';
|
||||
export function BuildIdentity(){const [identity,setIdentity]=useState(null);useEffect(()=>{let active=true;fetch('/build-identity.json').then(r=>r.ok?r.json():Promise.reject()).then(v=>{if(active)setIdentity(v.sourceHash)}).catch(()=>{});return()=>{active=false}},[]);return <p className="build-identity">Исходники этой сборки: <code>{identity||'загрузка идентификатора…'}</code></p>}
|
||||
export default function PagePreview({pages}){const [selected,setSelected]=useState(0),[width,setWidth]=useState(390),[opened,setOpened]=useState(false);const item=pages[selected]||pages[0];return <section className="page-preview"><p>Откройте настоящие страницы. Встроенное сравнение ниже — необязательный инструмент проверки системы, а не отдельный макет.</p><nav aria-label="Полные реальные страницы"><ul className="real-page-links">{pages.map(p=><li key={p.href}><TextLink href={p.href}>{p.title}</TextLink></li>)}</ul></nav><details className="preview-utility"><summary>Сравнить полную страницу в контейнере</summary><details className="preview-page-picker"><summary>Страница: {item.title}</summary><ul>{pages.map((p,i)=><li key={p.href}><Button variant="secondary" aria-pressed={selected===i} onClick={()=>{setSelected(i);setOpened(false)}}>{p.title}</Button></li>)}</ul></details><div className="preview-controls"><div role="group" aria-label="Ширина превью" className="uikit-actions">{[320,390,1440].map(v=><Button key={v} variant="secondary" aria-pressed={width===v} onClick={()=>setWidth(v)}>{v} px</Button>)}</div><Button onClick={()=>setOpened(true)}>Показать страницу</Button><TextLink href={item.href}>Открыть отдельно →</TextLink></div><p>{item.reason}</p>{opened?<div className="page-preview-region" tabIndex={0} role="region" aria-label="Полная страница; при необходимости прокручивается по горизонтали"><iframe title={item.title} src={item.href} style={{width,height:850}}/></div>:<StatusMessage>Выбранная страница использует ту же сборку и тему. Нажмите «Показать страницу» для встроенного просмотра.</StatusMessage>}</details></section>}
|
||||
@@ -0,0 +1,3 @@
|
||||
import Link from 'next/link';
|
||||
import {articleHref,articleGenre,readingConnections} from '../../entities/article';
|
||||
export default function RelatedReading({article,articles}){const connections=article?readingConnections(article,articles):[];if(!connections.length)return <section className="related"><p className="kicker">К СЛЕДУЮЩЕМУ ВОПРОСУ</p><Link href="/#journal">Найти материал в указателе →</Link></section>;return <section className="related" aria-label="Продолжить по смыслу"><p className="kicker">К СЛЕДУЮЩЕМУ ВОПРОСУ</p>{connections.map(({article:item,reason})=><Link className="continuation" key={item.slug} href={articleHref(item)}><span className="tiny-topic">{articleGenre(item)} · {item.categories.join(' / ')}</span><strong>{item.title}</strong><span className="reason">{reason}</span><span aria-hidden="true">→</span></Link>)}</section>}
|
||||
@@ -0,0 +1,5 @@
|
||||
import Link from 'next/link';
|
||||
import {Brand} from '../../shared/ui';
|
||||
import {ThemeControl} from '../../features/theme-selection';
|
||||
export function SiteHeader(){return <header className="masthead"><Brand/><nav aria-label="Главная навигация"><Link href="/#journal">Статьи</Link><Link href="/resources/">Справочники</Link><Link href="/tools/">JSON</Link><Link href="/about/">О блоге</Link></nav><ThemeControl/></header>}
|
||||
export function SiteFooter(){return <footer className="footer"><Brand/><p>Заметки о том, как устроен код.<br/>D, PHP, Bitrix и веб-разработка.</p><nav aria-label="Информация о проекте"><Link href="/#journal">Все статьи</Link><Link href="/sources/">Источники и редактура</Link><Link href="/privacy/">Приватность</Link><Link href="/accessibility/">Доступность и чтение</Link><Link href="/ui-kit/">Компоненты ProgCode</Link></nav><span>Материалы 2017–2019</span></footer>}
|
||||
Reference in new issue
Block a user