import{n as e}from"./rolldown-runtime-C0FnF6B9.js";import{n as t}from"./iframe-GrlyTB2d.js";import{i as n,r}from"./react-qN2cStNd.js";import{l as i,m as a}from"./blocks-DkLPipTQ.js";function o(e){let t={code:`code`,h1:`h1`,h2:`h2`,p:`p`,pre:`pre`,strong:`strong`,table:`table`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,...n(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i,{title:`Foundation Lib/Обзор`}),`
`,(0,c.jsx)(t.h1,{id:`ryuzaki13react-foundation-lib`,children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib`})}),`
`,(0,c.jsx)(t.p,{children:`Технический фундамент для host-приложений: чистые преобразования данных, browser/React hooks, сериализуемые runtime-контракты, OData metadata helpers и инфраструктура состояния. Пакет не знает домен приложения, UI-компоненты и transport конкретного backend.`}),`
`,(0,c.jsx)(t.h2,{id:`подключение`,children:`Подключение`}),`
`,(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{className:`language-bash`,children:`npm install @ryuzaki13/react-foundation-lib
`})}),`
`,(0,c.jsxs)(t.p,{children:[`Пакет ESM и намеренно `,(0,c.jsx)(t.strong,{children:`не имеет корневого импорта`}),`. Подключайте ровно тот опубликованный subpath, который нужен сценарию:`]}),`
`,(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{className:`language-ts`,children:`import { formatDateAsDate } from "@ryuzaki13/react-foundation-lib/formatters";
import { createQueryClient } from "@ryuzaki13/react-foundation-lib/query-client";
import type { RowRecord } from "@ryuzaki13/react-foundation-lib/types";
`})}),`
`,(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{className:`language-ts`,children:`// Неверно: корневой entrypoint не опубликован.
import { formatDateAsDate } from "@ryuzaki13/react-foundation-lib";
`})}),`
`,(0,c.jsx)(t.h2,{id:`граница-ответственности`,children:`Граница ответственности`}),`
`,(0,c.jsxs)(t.table,{children:[(0,c.jsx)(t.thead,{children:(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.th,{children:`Задача`}),(0,c.jsx)(t.th,{children:`Использовать`}),(0,c.jsx)(t.th,{children:`Не использовать вместо этого`})]})}),(0,c.jsxs)(t.tbody,{children:[(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Чистые OData V2 metadata, path, filter и value helpers`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`odata-service`})}),(0,c.jsx)(t.td,{children:`HTTP/OData transport`})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Вызовы SAP Gateway, SSO, X-CSRF и TanStack Query operation`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-api/odata`})}),(0,c.jsxs)(t.td,{children:[`ручной `,(0,c.jsx)(t.code,{children:`fetch`}),` или этот пакет`]})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`UI primitives и дизайн-система`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-ui/<module>`})}),(0,c.jsx)(t.td,{children:`hooks/utilities из lib как компонент`})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Доменный mapping и пользовательский сценарий`}),(0,c.jsx)(t.td,{children:`host entity/feature`}),(0,c.jsx)(t.td,{children:`foundation-lib`})]})]})]}),`
`,(0,c.jsxs)(t.p,{children:[(0,c.jsx)(t.code,{children:`react-foundation-lib`}),` не создаёт бизнес-правила, не хранит backend snapshot и не заменяет API- или UI-пакеты.`]}),`
`,(0,c.jsx)(t.h2,{id:`среда-выполнения-и-peer-dependencies`,children:`Среда выполнения и peer dependencies`}),`
`,(0,c.jsx)(t.p,{children:`Большинство pure helpers не требуют React. Entry point с React hook, DOM, browser storage или Service Worker должен вызываться только в браузерном runtime и по правилам React hooks. Совместимые peer dependencies должны быть разрешены host-проектом для используемого entrypoint.`}),`
`,(0,c.jsxs)(t.table,{children:[(0,c.jsx)(t.thead,{children:(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.th,{children:`Возможность`}),(0,c.jsx)(t.th,{children:`Когда нужна в host`})]})}),(0,c.jsxs)(t.tbody,{children:[(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`react`})}),(0,c.jsxs)(t.td,{children:[(0,c.jsx)(t.code,{children:`hooks`}),`, `,(0,c.jsx)(t.code,{children:`dom`}),`, `,(0,c.jsx)(t.code,{children:`copy`}),`, `,(0,c.jsx)(t.code,{children:`media`}),`, `,(0,c.jsx)(t.code,{children:`pwa`}),`, `,(0,c.jsx)(t.code,{children:`three-scene`}),`, selection/table hooks`]})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsxs)(t.td,{children:[(0,c.jsx)(t.code,{children:`@tanstack/react-query`}),`, persistence, broadcast`]}),(0,c.jsxs)(t.td,{children:[(0,c.jsx)(t.code,{children:`query-client`}),`, часть `,(0,c.jsx)(t.code,{children:`error-report`})]})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@tanstack/react-table`})}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`table`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@tanstack/react-virtual`})}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`virtualizer`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@tanstack/react-router`})}),(0,c.jsxs)(t.td,{children:[`search helpers из `,(0,c.jsx)(t.code,{children:`hooks`})]})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@floating-ui/react`})}),(0,c.jsxs)(t.td,{children:[(0,c.jsx)(t.code,{children:`useFloatingListbox`}),`, DOM reference guards`]})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsxs)(t.td,{children:[(0,c.jsx)(t.code,{children:`@dnd-kit/core`}),`, `,(0,c.jsx)(t.code,{children:`@dnd-kit/sortable`})]}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`useDndSortableSensors`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsxs)(t.td,{children:[(0,c.jsx)(t.code,{children:`zustand`}),`, `,(0,c.jsx)(t.code,{children:`immer`})]}),(0,c.jsxs)(t.td,{children:[(0,c.jsx)(t.code,{children:`notifications`}),`, OData store`]})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`zod`})}),(0,c.jsxs)(t.td,{children:[(0,c.jsx)(t.code,{children:`odata-service`}),` schemas`]})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`write-excel-file`})}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`excel`})})]})]})]}),`
`,(0,c.jsx)(t.h2,{id:`выбор-entrypoint`,children:`Выбор entrypoint`}),`
`,(0,c.jsxs)(t.table,{children:[(0,c.jsx)(t.thead,{children:(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.th,{children:`Сценарий`}),(0,c.jsx)(t.th,{children:`Точный import`})]})}),(0,c.jsxs)(t.tbody,{children:[(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Массивы, дедупликация, grouping, reorder`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/array`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsxs)(t.td,{children:[`Base64 и `,(0,c.jsx)(t.code,{children:`Blob`})]}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/binary`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Ограниченный стек копий`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/bounded-copy-stack`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Anchor и state контекстного меню`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/context-menu`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Clipboard и feedback hooks`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/copy`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Hash и UUID`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/crypto`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Валютные labels по OData-параметрам`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/currency`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Сегменты маски даты`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/date-segments`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Portal, focus, observers, browser download`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/dom`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Ошибка отсутствующего React context`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/error`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Подготовка и диагностика error report`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/error-report`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Excel и экспорт таблиц`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/excel`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsxs)(t.td,{children:[(0,c.jsx)(t.code,{children:`FileReader`}),`, MIME, Content-Disposition, изображения`]}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/file`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Client fingerprint`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/fingerprint`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Form errors и presets`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/form`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Даты, числа, строки, pipeline и value state`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/formatters`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Реестр и выполнение клиентских формул таблицы`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/formulas`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Общие React hooks`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/hooks`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsxs)(t.td,{children:[`HTTP headers и text `,(0,c.jsx)(t.code,{children:`Response`})]}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/http`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Breakpoints и media-query hooks`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/media`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Imperative notifications и store`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/notifications`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Математика slider/scale`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/number-scale`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`OData code/text collections и store`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/odata`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`OData V2 metadata, builder, filters, formats`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/odata-service`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Нормализация сохранённых preset ids`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/presets`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Service Worker update и cache policy`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/pwa`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Только cache policy`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/pwa/sw-cache-policy`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`QueryClient, persistence, broadcast`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/query-client`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Вывод открытых границ диапазона`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/range-output`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`SEO/head metadata contracts`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/seo`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsxs)(t.td,{children:[`ID в `,(0,c.jsx)(t.code,{children:`sessionStorage`})]}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/session-storage`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Предсказуемое строковое сравнение`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/string-comparison`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`TanStack Table layout, selection и OData adapter`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/table`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Проверка доступности Three.js`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/three-scene`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Построение tree-table rows`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/tree-table`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Общие TypeScript contracts`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/types`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Clone, className, keyboard, stable stringify, tree`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/utils`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Runtime guards и URL/image validation`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/validators`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`Infinite-query подгрузка virtualizer`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/virtualizer`})})]}),(0,c.jsxs)(t.tr,{children:[(0,c.jsx)(t.td,{children:`XML parse/build`}),(0,c.jsx)(t.td,{children:(0,c.jsx)(t.code,{children:`@ryuzaki13/react-foundation-lib/xml`})})]})]})]}),`
`,(0,c.jsx)(t.h2,{id:`как-читать-справочник`,children:`Как читать справочник`}),`
`,(0,c.jsxs)(t.p,{children:[`Каждая последующая страница построена вокруг `,(0,c.jsx)(t.strong,{children:`published subpath`}),`, а не каталога исходников. В ней указаны точный import, публичные contracts, обязательная инициализация, результат, lifecycle/cleanup и ограничения. Для pure helpers достаточно вызвать функцию; registry, browser и global-store API требуют отдельного раздела «Инициализация и side effects».`]}),`
`,(0,c.jsxs)(t.p,{children:[`Если API не описан как публичный на соответствующей странице, не импортируйте его глубоким путём из `,(0,c.jsx)(t.code,{children:`src`}),` или `,(0,c.jsx)(t.code,{children:`dist`}),`: это не часть стабильного consumer contract.`]})]})}function s(e={}){let{wrapper:t}={...n(),...e.components};return t?(0,c.jsx)(t,{...e,children:(0,c.jsx)(o,{...e})}):o(e)}var c;function l(){return(l=e((()=>{c=t(),r(),a()})))()}l();export{s as default};