@@ -2,6 +2,7 @@ import { OperationalTypographyDemo } from "./OperationalTypographyDemo";
import { useCallback , useEffect , useMemo , useRef , useState , type CSSProperties , type ReactNode } from "react" ;
import { applyGlassMaterial , applyNodedcTheme , defaultGlassMaterial , type GlassMaterialSettings , type NodedcTheme , type RgbTuple } from "@nodedc/ui-core" ;
import { createTemplateFeatures , getPageTemplate , pageTemplates , type PageTemplateDefinition } from "@nodedc/page-patterns" ;
import { MissionThemeExample } from './MissionThemeExample' ;
import { EditorDockExample } from './EditorDockExample' ;
import {
ActivityIndicator ,
@@ -37,7 +38,6 @@ import {
ResizableViewport ,
SceneAnnotation ,
HeaderNavigation ,
HeaderProfile ,
HeaderWorkspace ,
Icon ,
IconButton ,
@@ -124,7 +124,8 @@ const designProfileDocumentPath = (reference: { id: string; version: string; sta
) ;
const accents : Array < { label : string ; value : RgbTuple ; hex : string } > = [
{ label : "NODE.DC " , value : [ 255 , 47 , 146 ] , hex : "#ff2f92 " } ,
{ label : "Mission Core " , value : [ 247 , 248 , 244 ] , hex : "#f7f8f4 " } ,
{ label : "Rose" , value : [ 255 , 47 , 146 ] , hex : "#ff2f92" } ,
{ label : "Rose" , value : [ 255 , 62 , 108 ] , hex : "#ff3e6c" } ,
{ label : "Blush" , value : [ 255 , 108 , 175 ] , hex : "#ff6caf" } ,
{ label : "Magenta" , value : [ 215 , 70 , 255 ] , hex : "#d746ff" } ,
@@ -150,7 +151,7 @@ const materialDefaults: Record<NodedcTheme, MaterialDraft> = {
panelOpacity : 100 ,
fieldHex : "#2a2a2c" ,
fieldOpacity : 100 ,
nestedHex : "#0b0b0d " ,
nestedHex : "#0d0d0f " ,
} ,
light : {
panelHex : "#ffffff" ,
@@ -338,7 +339,7 @@ function Preview({ title, note, children, className }: {
export function CatalogApp() {
const [ theme , setTheme ] = useState < NodedcTheme > ( "dark" ) ;
const [ accentHex , setAccentHex ] = useState ( "#ff2f92 " ) ;
const [ accentHex , setAccentHex ] = useState ( "#f7f8f4 " ) ;
const [ materialByTheme , setMaterialByTheme ] = useState < Record < NodedcTheme , MaterialDraft > > ( ( ) = > ( {
dark : { . . . materialDefaults . dark } ,
light : { . . . materialDefaults . light } ,
@@ -391,7 +392,7 @@ export function CatalogApp() {
const [ glowDistance , setGlowDistance ] = useState ( 105 ) ;
const [ usePortColors , setUsePortColors ] = useState ( false ) ;
const [ connectionType , setConnectionType ] = useState ( "spline" ) ;
const [ lightColor , setLightColor ] = useState ( "#ff2f92 " ) ;
const [ lightColor , setLightColor ] = useState ( "#f7f8f4 " ) ;
const [ connectionColor , setConnectionColor ] = useState ( "#404040" ) ;
const [ fillColor , setFillColor ] = useState ( "#ff6caf" ) ;
const [ fillOpacity , setFillOpacity ] = useState ( 100 ) ;
@@ -412,7 +413,8 @@ export function CatalogApp() {
const [ splitPaneDemoSize , setSplitPaneDemoSize ] = useState ( 50 ) ;
const [ sidePanelDemoOpen , setSidePanelDemoOpen ] = useState ( true ) ;
const [ createModalOpen , setCreateModalOpen ] = useState ( false ) ;
const [ missionAppearance , setMissionAppearance ] = useState ( false ) ;
const [ missionAppearance , setMissionAppearance ] = useState ( true ) ;
const [ flatEdges , setFlatEdges ] = useState ( true ) ;
const [ featureSettingsDemoOpen , setFeatureSettingsDemoOpen ] = useState ( false ) ;
const [ featureSettingsDemoSection , setFeatureSettingsDemoSection ] = useState ( 'general' ) ;
const [ confirmOpen , setConfirmOpen ] = useState ( false ) ;
@@ -552,6 +554,7 @@ export function CatalogApp() {
applyNodedcTheme ( document . documentElement , {
theme ,
appearance : missionAppearance ? "mission" : "default" ,
edges : flatEdges ? "flat" : "default" ,
accent ,
material : {
panel : panelMaterial ,
@@ -561,7 +564,7 @@ export function CatalogApp() {
} ,
} ) ;
document . documentElement . style . setProperty ( "--nodedc-canvas-soft" , material . nestedHex ) ;
} , [ accent , fieldMaterial , material . fieldOpacity , material . nestedHex , material . panelOpacity , panelMaterial , theme , missionAppearance ] ) ;
} , [ accent , fieldMaterial , material . fieldOpacity , material . nestedHex , material . panelOpacity , panelMaterial , theme , missionAppearance , flatEdges ] ) ;
useEffect ( ( ) = > {
applyGlassMaterial ( document . documentElement , glassMaterial ) ;
@@ -1395,6 +1398,7 @@ export function CatalogApp() {
case "controls" :
return (
< div className = "catalog-grid" >
< Preview title = "Mission Core" note = "canonical foundation / nested fields / portal" className = "catalog-preview--wide" > < MissionThemeExample / > < / Preview >
< Preview title = "Navigation cube" note = "faces / edges / corners" > < NavigationCube edgeOpacity = { cubeEdgeOpacity } size = { cubeSize } quaternion = { [ . 28 , - . 36 , . 12 , . 88 ] } onSelect = { setCubeDirection } / > < RangeControl label = "Размер 3D-куба" value = { cubeSize } min = { 48 } max = { 160 } step = { 1 } onChange = { setCubeSize } formatValue = { v = > ` ${ v } px ` } / > < RangeControl label = "Прозрачность линий куба" value = { 1 - cubeEdgeOpacity } min = { 0 } max = { 1 } step = { . 05 } onChange = { v = > setCubeEdgeOpacity ( 1 - v ) } formatValue = { v = > ` ${ Math . round ( v * 100 ) } % ` } / > < p > { cubeDirection . join ( " · " ) } < / p > < / Preview >
< Preview title = "Selection" note = "integrated / split / inline" >
< div className = "catalog-form" >
@@ -1411,7 +1415,7 @@ export function CatalogApp() {
< / FieldFrame >
< FieldFrame label = "Engine / split select" >
< Select
variant = "split"
variant = "split" shape = "pill"
label = "Тип связи"
value = { connectionType }
options = { [
@@ -1798,7 +1802,7 @@ export function CatalogApp() {
< p className = "catalog-preview__explanation" > Destructive - ц в е т п о я в л я е т с я т о л ь к о у п о д т в е р ж д е н и я . < / p >
< Button variant = "danger" shape = "pill" icon = { < Icon name = "trash" / > } onClick = { ( ) = > setConfirmOpen ( true ) } > П р о в е р и т ь у д а л е н и е < / Button >
< / Preview >
< Preview title = "Настройки модуля" note = "адаптивное меню и форма" className = "catalog-modal-preview" > < Switch label = "Визуальный профиль Mission Core" checked = { missionAppearance } onChange = { setMissionAppearance } / >
< Preview title = "Настройки модуля" note = "адаптивное меню и форма" className = "catalog-modal-preview" > < Switch label = "Без декоративных обводок" checked = { flatEdges } onChange = { setFlatEdges } / > < Switch label = " Визуальный профиль Mission Core" checked = { missionAppearance } onChange = { setMissionAppearance } / >
< Button icon = { < Icon name = "settings" / > } onClick = { ( ) = > setFeatureSettingsDemoOpen ( true ) } > О т к р ы т ь н а с т р о й к и м о д у л я < / Button >
< / Preview >
< Preview title = "Workflow sharing" note = "ENGINE / access" className = "catalog-modal-preview" >
@@ -2170,10 +2174,11 @@ export function CatalogApp() {
/ >
< / >
}
// The shared profile owns its responsive label; consumers do not size it.
right = {
< HeaderProfile >
< IconButton label = "Уведомления" > < Icon name = "inbox" size = { 20 } strokeWidth = { 1.7 } / > < / IconButton >
< UserProfileMenu
triggerLabel = "Профиль"
triggerIcon = "inbox"
displayName = { sessionProfile ? . user ? . displayName || "Профиль" }
subtitle = { sessionProfile ? . user ? . email || "NODE.DC Foundry" }
avatarUrl = { sessionProfile ? . user ? . avatarUrl || undefined }
@@ -2183,7 +2188,6 @@ export function CatalogApp() {
{ id : "logout" , label : "Выйти" , icon : "external" , href : "/auth/logout" } ,
] }
/ >
< / HeaderProfile >
}
/ >
}