@visualli/core 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -105
- package/dist/chunk-25AJTPMS.js +68 -0
- package/dist/chunk-25AJTPMS.js.map +1 -0
- package/dist/{chunk-6NXADJK2.js → chunk-7NJWM7ZE.js} +84 -117
- package/dist/chunk-7NJWM7ZE.js.map +1 -0
- package/dist/chunk-KVSM3APM.js +96 -0
- package/dist/chunk-KVSM3APM.js.map +1 -0
- package/dist/{chunk-PDP5CVUL.js → chunk-LOQLNYB3.js} +2 -2
- package/dist/chunk-LV3EXUQY.js +753 -0
- package/dist/chunk-LV3EXUQY.js.map +1 -0
- package/dist/chunk-N7HCYULH.js +12 -0
- package/dist/chunk-N7HCYULH.js.map +1 -0
- package/dist/{chunk-I75TMOE4.js → chunk-P6PKWVYF.js} +2 -2
- package/dist/chunk-TPLJJKAU.js +151 -0
- package/dist/chunk-TPLJJKAU.js.map +1 -0
- package/dist/chunk-UAMEJG2C.js +267 -0
- package/dist/chunk-UAMEJG2C.js.map +1 -0
- package/dist/{chunk-LJYSKSCE.js → chunk-W2CAOOJJ.js} +6 -6
- package/dist/chunk-W2CAOOJJ.js.map +1 -0
- package/dist/config/index.cjs +250 -349
- package/dist/config/index.cjs.map +1 -1
- package/dist/config/index.d.cts +107 -66
- package/dist/config/index.d.ts +107 -66
- package/dist/config/index.js +52 -34
- package/dist/constants/index.cjs +14 -333
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +5 -243
- package/dist/constants/index.d.ts +5 -243
- package/dist/constants/index.js +5 -75
- package/dist/designSystem-BOrZHfEq.d.cts +150 -0
- package/dist/designSystem-BOrZHfEq.d.ts +150 -0
- package/dist/document-BFBwn93X.d.ts +26 -0
- package/dist/document-MEJEfxl3.d.cts +26 -0
- package/dist/ideaSize-CLDKeyqD.d.cts +11 -0
- package/dist/ideaSize-DxxGy2E8.d.ts +11 -0
- package/dist/index-BmILeKj6.d.cts +99 -0
- package/dist/index-CcPRwVUL.d.ts +99 -0
- package/dist/index.cjs +1636 -961
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +350 -27
- package/dist/index.d.ts +350 -27
- package/dist/index.js +445 -190
- package/dist/index.js.map +1 -1
- package/dist/{document-B3hnNr-F.d.cts → layer-B2A3Ki48.d.cts} +2 -16
- package/dist/{document-B3hnNr-F.d.ts → layer-B2A3Ki48.d.ts} +2 -16
- package/dist/layout/index.d.cts +2 -1
- package/dist/layout/index.d.ts +2 -1
- package/dist/mindmap-C3Qr0qKW.d.cts +182 -0
- package/dist/mindmap-DHeVa86G.d.ts +182 -0
- package/dist/parser/index.cjs +745 -179
- package/dist/parser/index.cjs.map +1 -1
- package/dist/parser/index.d.cts +23 -8
- package/dist/parser/index.d.ts +23 -8
- package/dist/parser/index.js +7 -2
- package/dist/performance/index.cjs +13 -0
- package/dist/performance/index.cjs.map +1 -1
- package/dist/performance/index.js +2 -2
- package/dist/theme/index.cjs +884 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +2 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.js +53 -0
- package/dist/types/index.d.cts +4 -2
- package/dist/types/index.d.ts +4 -2
- package/dist/viewport/index.cjs +17 -6
- package/dist/viewport/index.cjs.map +1 -1
- package/dist/viewport/index.d.cts +6 -4
- package/dist/viewport/index.d.ts +6 -4
- package/dist/viewport/index.js +2 -2
- package/licenses/visualli-design-system/LICENSE +9 -0
- package/licenses/visualli-design-system/NOTICE.md +6 -0
- package/package.json +13 -5
- package/src/config/README.md +2 -4
- package/src/config/USAGE_EXAMPLES.md +0 -4
- package/src/config/index.ts +3 -4
- package/src/constants/index.ts +1 -1
- package/src/constants/layout.ts +11 -0
- package/src/constants/performanceConstants.ts +8 -27
- package/src/generated/README.md +12 -0
- package/src/generated/designSystem.ts +758 -0
- package/src/generated/geometry/blob.ts +99 -0
- package/src/generated/geometry/blobShapes.ts +4 -0
- package/src/generated/geometry/color.ts +37 -0
- package/src/generated/geometry/container.ts +84 -0
- package/src/generated/geometry/detail.ts +22 -0
- package/src/generated/geometry/idea.ts +56 -0
- package/src/generated/geometry/interaction.ts +122 -0
- package/src/generated/geometry/motion.ts +140 -0
- package/src/index.ts +18 -1
- package/src/parser/configUtils.ts +12 -19
- package/src/parser/visualliConverter.ts +71 -112
- package/src/parser/visualliParser.ts +16 -1
- package/src/rendering/culling.ts +16 -12
- package/src/rendering/ideaSize.ts +21 -0
- package/src/rendering/nodeGeometry.ts +97 -0
- package/src/theme/index.ts +136 -0
- package/src/types/document.ts +9 -0
- package/src/types/layer.ts +1 -1
- package/src/types/mindmap.ts +13 -0
- package/src/utils/navigation.ts +33 -63
- package/src/viewport/viewportUtils.ts +6 -4
- package/dist/animations/index.cjs +0 -146
- package/dist/animations/index.cjs.map +0 -1
- package/dist/animations/index.d.cts +0 -81
- package/dist/animations/index.d.ts +0 -81
- package/dist/animations/index.js +0 -35
- package/dist/chunk-6NXADJK2.js.map +0 -1
- package/dist/chunk-F36SMC3K.js +0 -106
- package/dist/chunk-F36SMC3K.js.map +0 -1
- package/dist/chunk-G5H3P4YZ.js +0 -273
- package/dist/chunk-G5H3P4YZ.js.map +0 -1
- package/dist/chunk-LDJRGT2Q.js +0 -163
- package/dist/chunk-LDJRGT2Q.js.map +0 -1
- package/dist/chunk-LJYSKSCE.js.map +0 -1
- package/dist/chunk-LNTJTDB2.js +0 -349
- package/dist/chunk-LNTJTDB2.js.map +0 -1
- package/dist/mindmap-DWS0WZT_.d.cts +0 -118
- package/dist/mindmap-DWS0WZT_.d.ts +0 -118
- package/src/animations/constants.ts +0 -72
- package/src/animations/easing.ts +0 -70
- package/src/animations/index.ts +0 -2
- package/src/config/blobShapes.ts +0 -146
- package/src/config/textScaling.ts +0 -54
- package/src/constants/design.ts +0 -281
- /package/dist/{chunk-PDP5CVUL.js.map → chunk-LOQLNYB3.js.map} +0 -0
- /package/dist/{chunk-I75TMOE4.js.map → chunk-P6PKWVYF.js.map} +0 -0
- /package/dist/{animations → theme}/index.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/index.ts","../../src/constants/performanceConstants.ts","../../src/constants/design.ts","../../src/constants/renderConfig.ts"],"sourcesContent":["export * from './performanceConstants.js';\nexport * from './design.js';\nexport * from './renderConfig.js';\n","// ─── Performance & Rendering Constants ───────────────────────────────────────\n\n// ── FPS ───────────────────────────────────────────────────────────────────────\n\nexport const FPS_TARGET = 60;\nexport const FPS_WARNING_THRESHOLD = 45;\nexport const FPS_CRITICAL_THRESHOLD = 30;\nexport const TARGET_FRAME_TIME = 1000 / FPS_TARGET; // ~16.67 ms\nexport const MAX_FRAME_TIME = 18; // p95 threshold\n\n/** Legacy frame-rate targets kept for backward compatibility. */\nexport const FPS_TARGETS = {\n PAN_MIN: 30,\n ZOOM_TARGET: 60,\n WARNING_THRESHOLD: 20,\n} as const;\n\n// ── Timing Thresholds (ms) ────────────────────────────────────────────────────\n\nexport const TIMING_THRESHOLDS = {\n VIEWPORT_QUERY_MAX: 5,\n SPATIAL_UPDATE_MAX: 10,\n DRAG_RESPONSE_MAX: 16,\n LOAD_5K_TARGET: 2000,\n LOAD_10K_TARGET: 3000,\n VIEWPORT_DEBOUNCE: 100,\n SPATIAL_INDEX_BUILD: 50,\n} as const;\n\n// ── Memory Limits (MB) ────────────────────────────────────────────────────────\n\nexport const MEMORY_TARGET_MB = 500;\nexport const MEMORY_WARNING_MB = 600;\nexport const MEMORY_CRITICAL_MB = 800;\n\nexport const MEMORY_LIMITS = {\n MAX_10K_NODES: 500,\n MAX_GROWTH_PERCENT: 20,\n WARNING_THRESHOLD: 400,\n} as const;\n\n// ── Viewport Culling ──────────────────────────────────────────────────────────\n\nexport const VIEWPORT_MARGIN = 0.1;\nexport const MAX_VISIBLE_NODES = 800;\nexport const CULLING_QUERY_TIME_BUDGET = 5;\n\n// ── Spatial Index ─────────────────────────────────────────────────────────────\n\nexport const RBUSH_MAX_ENTRIES = 16;\nexport const SPATIAL_INDEX_BUILD_BUDGET = 50;\n\n// ── Node Dimensions ───────────────────────────────────────────────────────────\n\nexport const NODE_MIN_WIDTH = 200;\nexport const NODE_HEIGHT = 80;\nexport const NODE_PADDING = 40;\nexport const CHAR_WIDTH = 8;\nexport const TITLE_MAX_LENGTH = 150;\n\n// ── Visual Styling ────────────────────────────────────────────────────────────\n\nexport const CORNER_RADIUS = 8;\nexport const BORDER_WIDTH_NORMAL = 2;\nexport const BORDER_WIDTH_SELECTED = 3;\n\nexport const COLOR_SELECTED = '#1B2D4F';\nexport const COLOR_BORDER_LIGHT = '#4A3728';\nexport const COLOR_BORDER_DARK = '#FAF6F1';\nexport const COLOR_DEFAULT_NODE = '#FAF6F1';\n\n// ── Zoom Constraints ──────────────────────────────────────────────────────────\n\nexport const ZOOM_MIN = 0.05;\nexport const ZOOM_MAX = 5.0;\nexport const ZOOM_DEFAULT = 1.0;\nexport const ZOOM_STEP = 0.1;\nexport const ZOOM_WHEEL_SENSITIVITY = 0.001;\n\nexport const ZOOM_NAV_IN_THRESHOLD = 2.7;\nexport const ZOOM_NAV_OUT_THRESHOLD = 0.4;\nexport const TEXT_LABEL_HIDE_BELOW_ZOOM = 0.3;\n\n// ── Quality Level Presets ─────────────────────────────────────────────────────\n\nexport const QUALITY_HIGH = {\n shadows: true,\n bezierCurves: true,\n animations: true,\n textQuality: 'high' as const,\n antialiasing: true,\n};\n\nexport const QUALITY_MEDIUM = {\n shadows: false,\n bezierCurves: true,\n animations: true,\n textQuality: 'medium' as const,\n antialiasing: true,\n};\n\nexport const QUALITY_LOW = {\n shadows: false,\n bezierCurves: false,\n animations: false,\n textQuality: 'low' as const,\n antialiasing: false,\n};\n\n// ── Performance Monitoring ────────────────────────────────────────────────────\n\nexport const FPS_SAMPLE_WINDOW = 60;\nexport const FPS_UPDATE_INTERVAL = 1000;\nexport const MEMORY_CHECK_INTERVAL = 5000;\nexport const PERFORMANCE_TOAST_COOLDOWN = 10000;\n\n// ── Auto-Adjustment ───────────────────────────────────────────────────────────\n\nexport const FPS_DOWNGRADE_THRESHOLD = 45;\nexport const FPS_UPGRADE_THRESHOLD = 58;\nexport const FPS_STABILIZATION_FRAMES = 180;\n\n// ── Canvas Dimensions ─────────────────────────────────────────────────────────\n\nexport const DEFAULT_CANVAS_WIDTH = 1920;\nexport const DEFAULT_CANVAS_HEIGHT = 1080;\n\n// ── Interaction ───────────────────────────────────────────────────────────────\n\nexport const CLICK_THRESHOLD = 5;\nexport const DOUBLE_CLICK_DELAY = 300;\nexport const DRAG_START_DISTANCE = 10;\n\n// ── Data Validation ───────────────────────────────────────────────────────────\n\nexport const MAX_NODES = 20000;\nexport const CIRCULAR_REFERENCE_MAX_DEPTH = 1000;\n\n// ── Debounce / Throttle ───────────────────────────────────────────────────────\n\nexport const RESIZE_DEBOUNCE = 300;\nexport const SCROLL_THROTTLE = 16;\nexport const SEARCH_DEBOUNCE = 500;\n\n/** Node count thresholds that gate optimisation strategies. */\nexport const NODE_COUNT_THRESHOLDS = {\n SPATIAL_INDEX_MIN: 100,\n VIEWPORT_CULLING_MIN: 500,\n CANVAS_RENDERING_MIN: 2000,\n DOM_RENDERING_MAX: 5000,\n} as const;\n\n/** Viewport buffer configuration. */\nexport const VIEWPORT_CONFIG = {\n BUFFER_PERCENT: 0.2,\n MIN_VISIBLE_NODES: 10,\n} as const;\n","// ─── Design System Constants ──────────────────────────────────────────────────\n//\n// Single source of truth for all color tokens, typography, spacing, and\n// visual design constants used across the SDK and consuming apps.\n//\n// ## Color Priority\n// 1. Data file values (node.color, layer.backgroundColor)\n// 2. Fall back to these constants\n\n// ── Visualli Design System v2 ─────────────────────────────────────────────────\n\nexport const DS_COLORS = {\n light: {\n bgApp: '#F0EDE6',\n bgSurface: '#FAF8F4',\n bgInput: '#FFFFFF',\n border: '#DDD9D0',\n borderDivider: '#E8E4DC',\n primary: '#1B2D4F',\n primaryHover: '#243B68',\n textPrimary: '#1A1A18',\n textSecondary: '#6B6860',\n textMuted: '#747270',\n textOnPrimary: '#FAF8F4',\n hoverItem: 'rgba(27,45,79,0.07)',\n focusRing: 'rgba(27,45,79,0.40)',\n btnMuted: '#8E8C88',\n },\n dark: {\n bgApp: '#141412',\n bgSurface: '#1C1C1A',\n bgInput: '#262622',\n border: '#333330',\n borderDivider: '#2A2A28',\n primary: '#BB532D',\n primaryHover: '#CC6440',\n textPrimary: '#F0EDE6',\n textSecondary: '#B0ABA3',\n textMuted: '#8E8C88',\n textOnPrimary: '#FAF8F4',\n hoverItem: 'rgba(198,94,56,0.12)',\n focusRing: 'rgba(198,94,56,0.50)',\n btnMuted: '#4A4845',\n },\n} as const;\n\nexport const DS_TYPOGRAPHY = {\n fontDisplay: \"'Nunito', sans-serif\",\n fontBody: \"'Nunito Sans', sans-serif\",\n logo: { size: '20px', weight: 800, letterSpacing: '0.04em' },\n heading: { size: '16px', weight: 700, letterSpacing: '-0.2px' },\n cta: { size: '11px', weight: 800, letterSpacing: '0.12em', transform: 'uppercase' as const },\n body: { size: '13px', weight: 400 },\n input: { size: '13px', weight: 300, style: 'italic' as const },\n search: { size: '12px', weight: 400 },\n username: { size: '13px', weight: 600 },\n avatar: { size: '11px', weight: 700 },\n footer: { size: '12px', weight: 400 },\n empty: { size: '11px', weight: 300, style: 'italic' as const },\n} as const;\n\nexport const DS_RADII = {\n sidebar: 16,\n input: 8,\n cta: 7,\n item: 6,\n swatch: 10,\n} as const;\n\n// ── Brand Colors ──────────────────────────────────────────────────────────────\n\nexport const BRAND_COLORS = {\n primary: {\n 50: '#EFF6FF',\n 100: '#DBEAFE',\n 200: '#BFDBFE',\n 300: '#93C5FD',\n 400: '#60A5FA',\n 500: '#3B82F6',\n 600: '#2563EB',\n 700: '#1D4ED8',\n 800: '#1E40AF',\n 900: '#1E3A8A',\n },\n secondary: {\n 50: '#F0FDF4',\n 100: '#DCFCE7',\n 200: '#BBF7D0',\n 300: '#86EFAC',\n 400: '#4ADE80',\n 500: '#10B981',\n 600: '#059669',\n 700: '#047857',\n 800: '#065F46',\n 900: '#064E3B',\n },\n accent: {\n purple: '#8B5CF6',\n cyan: '#06B6D4',\n sky: '#0EA5E9',\n lime: '#84CC16',\n amber: '#F59E0B',\n red: '#EF4444',\n },\n} as const;\n\n// ── Level Colors ──────────────────────────────────────────────────────────────\n\nexport const LEVEL_COLORS = {\n level0: BRAND_COLORS.primary[500],\n level1: BRAND_COLORS.primary[400],\n level2: BRAND_COLORS.primary[300],\n level3: BRAND_COLORS.primary[200],\n level4: BRAND_COLORS.primary[300],\n level5: BRAND_COLORS.primary[400],\n level6: BRAND_COLORS.primary[500],\n level7: BRAND_COLORS.primary[600],\n level8: BRAND_COLORS.primary[700],\n} as const;\n\nexport const LEVEL_COLOR_ARRAY = [\n LEVEL_COLORS.level0,\n LEVEL_COLORS.level1,\n LEVEL_COLORS.level2,\n LEVEL_COLORS.level3,\n LEVEL_COLORS.level4,\n LEVEL_COLORS.level5,\n LEVEL_COLORS.level6,\n LEVEL_COLORS.level7,\n LEVEL_COLORS.level8,\n] as const;\n\nexport const PARENT_FALLBACK_COLORS = [\n '#12C7D3', '#325E8C', '#8A70A6', '#F54A57', '#FF6C4D',\n '#F28C16', '#FFD347', '#7F7F7F', '#8D8D8D',\n] as const;\n\nexport const SEMANTIC_COLORS = {\n success: BRAND_COLORS.secondary[500],\n error: BRAND_COLORS.accent.red,\n warning: BRAND_COLORS.accent.amber,\n info: BRAND_COLORS.primary[500],\n} as const;\n\n// ── Theme Colors ──────────────────────────────────────────────────────────────\n\nexport const THEME_COLORS = {\n light: {\n background: { primary: '#FAF8F4', secondary: '#F0EDE6', tertiary: '#FFFFFF' },\n text: { primary: '#1A1A18', secondary: '#6B6860', tertiary: '#747270' },\n border: { primary: '#DDD9D0', secondary: '#E8E4DC' },\n },\n dark: {\n background: { primary: '#1C1C1A', secondary: '#141412', tertiary: '#262622' },\n text: { primary: '#F0EDE6', secondary: '#B0ABA3', tertiary: '#8E8C88' },\n border: { primary: '#333330', secondary: '#2A2A28' },\n },\n} as const;\n\n// ── Canvas Node Colors ────────────────────────────────────────────────────────\n\nexport const CANVAS_COLORS = {\n node: {\n border: '#FFFFFF',\n titleColor: '#1e1b4b',\n badgeBackground: '#FFC107',\n badgeStroke: '#fcd34d',\n },\n} as const;\n\n// ── Spacing ───────────────────────────────────────────────────────────────────\n\nexport const SPACING = {\n xs: 4,\n sm: 8,\n md: 16,\n lg: 24,\n xl: 32,\n '2xl': 48,\n '3xl': 64,\n '4xl': 96,\n} as const;\n\nexport const LAYOUT_SPACING = {\n nodeSpacing: 200,\n levelSpacing: 150,\n containerPadding: 20,\n gridSize: 50,\n} as const;\n\n// ── Typography ────────────────────────────────────────────────────────────────\n\nexport const FONTS = {\n primary: \"'Inter', sans-serif\",\n secondary: \"'Poppins', sans-serif\",\n mono: \"'Roboto Mono', monospace\",\n} as const;\n\nexport const FONT_SIZES = {\n xs: '0.75rem',\n sm: '0.875rem',\n base: '1rem',\n lg: '1.125rem',\n xl: '1.25rem',\n '2xl': '1.5rem',\n '3xl': '1.875rem',\n '4xl': '2.25rem',\n} as const;\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\n/** Get a level color, cycling back to level 0 for levels > 8. */\nexport function getColorForLevel(level: number): string {\n return LEVEL_COLOR_ARRAY[level % LEVEL_COLOR_ARRAY.length];\n}\n\n/**\n * Darken a hex color by reducing HSL lightness.\n * Returns a monochromatic darker version — used for border/stroke colors.\n * Falls back to the original string if parsing fails.\n */\nexport function darkenHexColor(hex: string, amount: number = 0.22): string {\n if (!hex || !hex.startsWith('#')) return hex;\n let r: number, g: number, b: number;\n if (hex.length === 4) {\n r = parseInt(hex[1] + hex[1], 16);\n g = parseInt(hex[2] + hex[2], 16);\n b = parseInt(hex[3] + hex[3], 16);\n } else if (hex.length === 7) {\n r = parseInt(hex.slice(1, 3), 16);\n g = parseInt(hex.slice(3, 5), 16);\n b = parseInt(hex.slice(5, 7), 16);\n } else {\n return hex;\n }\n if (isNaN(r) || isNaN(g) || isNaN(b)) return hex;\n const rn = r / 255, gn = g / 255, bn = b / 255;\n const cmax = Math.max(rn, gn, bn), cmin = Math.min(rn, gn, bn);\n const d = cmax - cmin;\n const l = (cmax + cmin) / 2;\n const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));\n let h = 0;\n if (d !== 0) {\n const seg = cmax === rn ? (gn - bn) / d : cmax === gn ? (bn - rn) / d + 2 : (rn - gn) / d + 4;\n h = ((seg * 60) + 360) % 360;\n }\n const newL = Math.max(0, l - amount);\n const c2 = (1 - Math.abs(2 * newL - 1)) * s;\n const x2 = c2 * (1 - Math.abs(((h / 60) % 2) - 1));\n const m2 = newL - c2 / 2;\n let r1 = 0, g1 = 0, b1 = 0;\n if (h < 60) { r1 = c2; g1 = x2; b1 = 0; }\n else if (h < 120) { r1 = x2; g1 = c2; b1 = 0; }\n else if (h < 180) { r1 = 0; g1 = c2; b1 = x2; }\n else if (h < 240) { r1 = 0; g1 = x2; b1 = c2; }\n else if (h < 300) { r1 = x2; g1 = 0; b1 = c2; }\n else { r1 = c2; g1 = 0; b1 = x2; }\n const toHex = (v: number) => Math.round((v + m2) * 255).toString(16).padStart(2, '0');\n return `#${toHex(r1)}${toHex(g1)}${toHex(b1)}`;\n}\n\nexport function getThemeBackground(\n isDark: boolean,\n variant: 'primary' | 'secondary' | 'tertiary' = 'primary',\n): string {\n return isDark ? THEME_COLORS.dark.background[variant] : THEME_COLORS.light.background[variant];\n}\n\nexport function getThemeText(\n isDark: boolean,\n variant: 'primary' | 'secondary' | 'tertiary' = 'primary',\n): string {\n return isDark ? THEME_COLORS.dark.text[variant] : THEME_COLORS.light.text[variant];\n}\n\nexport function getThemeBorder(\n isDark: boolean,\n variant: 'primary' | 'secondary' = 'primary',\n): string {\n return isDark ? THEME_COLORS.dark.border[variant] : THEME_COLORS.light.border[variant];\n}\n","// ─── Render Configuration ─────────────────────────────────────────────────────\n\nimport type { RenderConfig } from '../types/mindmap.js';\nimport {\n FPS_TARGET,\n MEMORY_TARGET_MB,\n QUALITY_HIGH,\n QUALITY_MEDIUM,\n QUALITY_LOW,\n NODE_COUNT_THRESHOLDS,\n} from './performanceConstants.js';\n\n// ── Defaults ──────────────────────────────────────────────────────────────────\n\nexport const DEFAULT_RENDER_CONFIG: RenderConfig = {\n renderMode: 'canvas',\n qualityLevel: 'high',\n cullingEnabled: false,\n fpsTarget: FPS_TARGET,\n memoryLimit: MEMORY_TARGET_MB,\n};\n\nexport const SIMPLIFIED_RENDER_CONFIG: RenderConfig = {\n renderMode: 'simplified',\n qualityLevel: 'low',\n cullingEnabled: true,\n fpsTarget: 30,\n memoryLimit: 400,\n};\n\n// ── Quality Map ───────────────────────────────────────────────────────────────\n\nexport const QUALITY_SETTINGS = {\n high: QUALITY_HIGH,\n medium: QUALITY_MEDIUM,\n low: QUALITY_LOW,\n} as const;\n\n// ── Feature Flags ─────────────────────────────────────────────────────────────\n\nexport const FEATURE_FLAGS = {\n viewportCulling: true,\n spatialIndexing: true,\n shadows: true,\n bezierCurves: true,\n animations: true,\n branchBadges: true,\n autoQualityAdjustment: true,\n performanceMonitoring: true,\n performanceToasts: true,\n debugOverlay: false,\n showFPS: false,\n showMemory: false,\n showVisibleCount: false,\n} as const;\n\n// ── Render Modes ──────────────────────────────────────────────────────────────\n\nexport type RenderMode = RenderConfig['renderMode'];\nexport type QualityLevel = RenderConfig['qualityLevel'];\n\nexport const RENDER_MODES = {\n canvas: {\n name: 'Canvas',\n description: 'Full Konva canvas rendering with all features',\n features: { culling: true, shadows: true, bezierCurves: true, animations: true },\n },\n simplified: {\n name: 'Simplified',\n description: 'Reduced feature set for low-end devices',\n features: { culling: true, shadows: false, bezierCurves: false, animations: false },\n },\n} as const;\n\nexport const QUALITY_LEVELS = {\n high: { name: 'High', description: 'All visual features enabled', targetFPS: 60, features: QUALITY_HIGH },\n medium: { name: 'Medium', description: 'Shadows disabled, other features enabled', targetFPS: 60, features: QUALITY_MEDIUM },\n low: { name: 'Low', description: 'Minimal visual features, max performance', targetFPS: 30, features: QUALITY_LOW },\n} as const;\n\n// ── Auto-Adjustment Helpers ───────────────────────────────────────────────────\n\nexport function getOptimalQualityLevel(\n currentFPS: number,\n currentQuality: QualityLevel,\n): QualityLevel {\n if (currentFPS < 45 && currentQuality === 'high') return 'medium';\n if (currentFPS < 30 && currentQuality === 'medium') return 'low';\n if (currentFPS > 58 && currentQuality === 'low') return 'medium';\n if (currentFPS > 58 && currentQuality === 'medium') return 'high';\n return currentQuality;\n}\n\nexport function getRenderConfigForQuality(quality: QualityLevel): Partial<RenderConfig> {\n return { qualityLevel: quality, fpsTarget: QUALITY_LEVELS[quality].targetFPS };\n}\n\nexport function isFeatureEnabled(\n featureName: keyof typeof FEATURE_FLAGS,\n config: RenderConfig,\n): boolean {\n if (!FEATURE_FLAGS[featureName]) return false;\n\n const qs = QUALITY_SETTINGS[config.qualityLevel];\n switch (featureName) {\n case 'shadows': return qs.shadows;\n case 'bezierCurves': return qs.bezierCurves;\n case 'animations': return qs.animations;\n default: return FEATURE_FLAGS[featureName] as boolean;\n }\n}\n\n// ── Device Detection ──────────────────────────────────────────────────────────\n\n/**\n * Recommend a render config based on detected device memory (browser only).\n * Falls back to SIMPLIFIED_RENDER_CONFIG when the Performance Memory API is\n * unavailable or memory is constrained.\n */\nexport function getRecommendedRenderConfig(): RenderConfig {\n if (typeof performance === 'undefined' || !(performance as unknown as Record<string, unknown>)['memory']) {\n return SIMPLIFIED_RENDER_CONFIG;\n }\n\n const memory = (performance as unknown as Record<string, unknown>)['memory'] as Record<string, number>;\n if (memory?.['jsHeapSizeLimit'] && memory['jsHeapSizeLimit'] < 512 * 1024 * 1024) {\n return SIMPLIFIED_RENDER_CONFIG;\n }\n\n return DEFAULT_RENDER_CONFIG;\n}\n\n/** Re-export so consumers need only one import. */\nexport { NODE_COUNT_THRESHOLDS };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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C3D,MAAI,aAAa,MAAM,mBAAmB,SAAU,QAAO;AAC3D,MAAI,aAAa,MAAM,mBAAmB,MAAU,QAAO;AAC3D,MAAI,aAAa,MAAM,mBAAmB,SAAU,QAAO;AAC3D,SAAO;AACT;AAEO,SAAS,0BAA0B,SAA8C;AACtF,SAAO,EAAE,cAAc,SAAS,WAAW,eAAe,OAAO,EAAE,UAAU;AAC/E;AAEO,SAAS,iBACd,aACA,QACS;AACT,MAAI,CAAC,cAAc,WAAW,EAAG,QAAO;AAExC,QAAM,KAAK,iBAAiB,OAAO,YAAY;AAC/C,UAAQ,aAAa;AAAA,IACnB,KAAK;AAAgB,aAAO,GAAG;AAAA,IAC/B,KAAK;AAAgB,aAAO,GAAG;AAAA,IAC/B,KAAK;AAAgB,aAAO,GAAG;AAAA,IAC/B;AAAqB,aAAO,cAAc,WAAW;AAAA,EACvD;AACF;AASO,SAAS,6BAA2C;AACzD,MAAI,OAAO,gBAAgB,eAAe,CAAE,YAAmD,QAAQ,GAAG;AACxG,WAAO;AAAA,EACT;AAEA,QAAM,SAAU,YAAmD,QAAQ;AAC3E,MAAI,SAAS,iBAAiB,KAAK,OAAO,iBAAiB,IAAI,MAAM,OAAO,MAAM;AAChF,WAAO;AAAA,EACT;AAEA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/constants/index.ts","../../src/generated/geometry/interaction.ts","../../src/constants/performanceConstants.ts","../../src/constants/layout.ts","../../src/constants/renderConfig.ts"],"sourcesContent":["export * from './performanceConstants.js';\nexport * from './layout.js';\nexport * from './renderConfig.js';\n","// Generated from visualli.ai design-system/components/src/interaction.ts — do not edit here.\n/* How the canvas answers the pointer and the keyboard — the timing and rules behind the peek (an idea's summary)\n and terms (semantic anchors: an underlined word and its definition card). The look and the pop-in animation live\n in the CSS (.vi-fact, .vi-anchor, .vi-anchor-card); these are the behaviours, as data, so every renderer (VisualMap,\n the spec SDK on a canvas) opens and closes them alike. Times in ms. No dependencies, so it can travel alone. */\n\n/** Terms (semantic anchors) in a peek's text. */\nexport const TERM = {\n /** Hovering the term this long opens its definition card… */ hoverOpen: 250,\n /** …which closes this long after the pointer leaves both the term and the card (moving between them keeps it open). */ hoverClose: 300,\n /** Only a mouse opens on hover; touch and pen open on tap. */ hoverPointers: ['mouse'] as readonly string[],\n /** A click, tap, Enter or Space pins the card open (hovering away doesn't close it); pressing again unpins and closes. */ clickPins: true,\n /** Escape closes the card and returns focus to the term; a press anywhere outside the term and its card closes it. */ escapeCloses: true, pressOutsideCloses: true,\n /** Opening by click or keyboard moves focus to the card's first link or button. */ focusCardOnOpen: true,\n /** The card is kept this far inside the viewport's left and right edges. */ viewportMargin: 8,\n /** The card's link to a source about the term. */ learnMoreLabel: 'Learn more',\n} as const;\n\n/** The peek: an idea's summary card on hover (pointer) or tap (touch). */\nexport const PEEK = {\n /** Hovering an idea opens its peek at once; it stays this long after the pointer leaves the idea (and while the\n * pointer is over the peek itself), so the pointer can travel from the idea onto the card. */ hoverClose: 180,\n} as const;\n\n/** The touch peek: a bottom sheet with a grip. */\nexport const SHEET = {\n /** Dragging the grip down this far closes the sheet (or collapses it when expanded); up this far expands it. */ dismissDrag: 80, expandDrag: 40,\n /** Its height: this share of the map, at most `maxHeight` px; the map pans the chosen idea into the space above it. */ heightRatio: 0.42, maxHeight: 300,\n} as const;\n\n/** Zoom, pan and fit. */\nexport const VIEW = {\n /** Each zoom step multiplies or divides the zoom by this. */ zoomStep: 1.2,\n /** Zoom limits (the zoom-min / zoom-max tokens; the build checks they agree). */ zoomMin: 0.3, zoomMax: 5,\n /** Fit to view never enlarges a layer beyond this. */ fitMax: 1.1,\n} as const;\n\n/** Touch gestures on the map (any touch input — phones, tablets and touchscreen laptops alike; it follows the pointer\n * in use, not the device, so a mouse or trackpad on the same laptop isn't affected). */\nexport const GESTURE = {\n /** Two fingers pinch to zoom the map's contents — ideas, connectors, containers and their labels — around the\n * point between the fingers, within VIEW's limits. Controls, the depth trail, the peek, chat and the page never scale. */ pinchZoom: true,\n /** Moving both fingers pans the contents. */ twoFingerPan: true,\n /** The pointers that pinch (PointerEvent.pointerType). */ pointers: ['touch'] as readonly string[],\n /** Where the map is the page (an app: AppShell, the mobile app), it takes every touch gesture (touch-action: none),\n * so the browser never zooms the page. Embedded on a scrolling page (website, docs), one finger still scrolls the\n * page (touch-action: pan-x pan-y); two fingers that land together pinch the map. */ appTouchAction: 'none', embeddedTouchAction: 'pan-x pan-y',\n /** Zoom never navigates: stepping inside and backing out stay explicit (tap an idea / Step inside, the depth trail,\n * Escape or Backspace). */ zoomNavigates: false,\n} as const;\n\n/** The zoom after a pinch: the zoom at the start, scaled by how far the fingers spread, within VIEW's limits. */\nexport function pinchZoom(startZoom: number, startDistance: number, distance: number): number {\n const z = startZoom * (distance / Math.max(startDistance, 1));\n return Math.min(VIEW.zoomMax, Math.max(VIEW.zoomMin, z));\n}\n\n/** Keeps the map point that was under `from` under `to` when the scale changes from `s0` to `s1`: the new\n * translation, given the old one (screen = world × s + t). Used to zoom around the fingers. */\nexport function zoomAround(t0: { x: number; y: number }, s0: number, s1: number, from: { x: number; y: number }, to: { x: number; y: number }): { x: number; y: number } {\n const wx = (from.x - t0.x) / s0, wy = (from.y - t0.y) / s0;\n return { x: to.x - wx * s1, y: to.y - wy * s1 };\n}\n\n/** Framing a layer (fit to view): its ideas with room around them, and its container hulls with room for the name pill. */\nexport const FRAME = {\n /** Room beyond each idea's outline (at least `minPadX` / `minPadY` from its centre). */ clearX: 50, clearY: 46, minPadX: 150, minPadY: 120,\n /** Room beyond each container hull for its dashed line and the name pill straddling it. */ hullX: 24, hullY: 40,\n} as const;\nexport type FrameBox = { x0: number; y0: number; x1: number; y1: number };\n\n/** The box a layer is framed by: every idea (`rx` / `ry` its half size) and every container hull. */\nexport function layerBounds(ideas: ReadonlyArray<{ x: number; y: number; rx: number; ry: number }>, hulls: ReadonlyArray<FrameBox> = []): FrameBox {\n let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;\n for (const n of ideas) {\n const px = Math.max(FRAME.minPadX, n.rx + FRAME.clearX), py = Math.max(FRAME.minPadY, n.ry + FRAME.clearY);\n x0 = Math.min(x0, n.x - px); x1 = Math.max(x1, n.x + px); y0 = Math.min(y0, n.y - py); y1 = Math.max(y1, n.y + py);\n }\n for (const h of hulls) { x0 = Math.min(x0, h.x0 - FRAME.hullX); x1 = Math.max(x1, h.x1 + FRAME.hullX); y0 = Math.min(y0, h.y0 - FRAME.hullY); y1 = Math.max(y1, h.y1 + FRAME.hullY); }\n if (!Number.isFinite(x0)) return { x0: -FRAME.minPadX, y0: -FRAME.minPadY, x1: FRAME.minPadX, y1: FRAME.minPadY };\n return { x0, y0, x1, y1 };\n}\n\n/** Fit to view: the scale that shows `bounds` in an area of `width` × `height` (never beyond VIEW.fitMax), and the\n * world point to centre. */\nexport function fitView(bounds: FrameBox, width: number, height: number): { scale: number; center: { x: number; y: number } } {\n const scale = Math.min(width / Math.max(1, bounds.x1 - bounds.x0), height / Math.max(1, bounds.y1 - bounds.y0), VIEW.fitMax);\n return { scale, center: { x: (bounds.x0 + bounds.x1) / 2, y: (bounds.y0 + bounds.y1) / 2 } };\n}\n\n/** Where the peek card sits (pointer): beside the idea — right of it if it fits, else left — and level with it. */\nexport const PEEK_PLACEMENT = {\n /** Gap between the idea's outermost ring and the card. */ gap: 16,\n /** The card's width and the height kept clear below it. */ cardWidth: 300, cardHeight: 220,\n /** The card is raised this much above the idea's centre. */ raise: 70,\n /** Kept this far inside the map's edges. */ margin: 12,\n} as const;\n\n/** The peek card's top-left, in map (screen) pixels. `idea`: the idea's centre on screen and its on-screen half\n * width with its outermost ring (`half`); `box`: the map's size. */\nexport function peekPosition(idea: { x: number; y: number; half: number }, box: { w: number; h: number }, card: { w: number; h: number } = { w: PEEK_PLACEMENT.cardWidth, h: PEEK_PLACEMENT.cardHeight }) {\n const P = PEEK_PLACEMENT, half = idea.half + P.gap;\n const right = idea.x + half + card.w < box.w - P.margin;\n return { left: right ? idea.x + half : Math.max(P.margin, idea.x - half - card.w), top: Math.min(Math.max(P.margin, idea.y - P.raise), box.h - card.h), side: right ? 'right' as const : 'left' as const };\n}\n\n/** The depth trail: each entry shows the idea that was stepped into — its title and a dot in its color (the same\n * topic or custom color the idea is drawn in, including the sibling-order topic of an uncolored idea). The first\n * entry is the map itself: a `stone` dot and the home glyph only (`rootLabel: 'icon'`) — no text, since a map's title\n * usually repeats its centre idea's, which the next entry shows; its accessible name and tooltip are the map's title.\n * The dot is the idea shape (shapeForLevel). */\nexport const TRAIL = { rootTopic: 'stone', rootLabel: 'icon', homeIconSize: 12, dotBox: 16, dotRadius: 6.4, stroke: 1.25, currentStroke: 1.75 } as const;\n\n/** How an input answers: a mouse hovers (peeks and terms open on hover); touch and pen tap. Null for unknown pointers. */\nexport function pointerModeFor(pointerType: string): 'hover' | 'touch' | null {\n return pointerType === 'mouse' ? 'hover' : pointerType === 'touch' || pointerType === 'pen' ? 'touch' : null;\n}\n\n/** Whether a pointer of this type opens a term on hover (PointerEvent.pointerType). */\nexport function hoverOpensTerm(pointerType: string): boolean {\n return TERM.hoverPointers.includes(pointerType);\n}\n","// ─── Performance & Rendering Constants ───────────────────────────────────────\n//\n// Performance budgets and interaction thresholds. Visual values (colours,\n// stroke widths, node size, zoom range) come from the design system tokens.\n\nimport { VIEW } from '../generated/geometry/interaction.js';\n\n// ── FPS ───────────────────────────────────────────────────────────────────────\n\nexport const FPS_TARGET = 60;\nexport const FPS_WARNING_THRESHOLD = 45;\nexport const FPS_CRITICAL_THRESHOLD = 30;\nexport const TARGET_FRAME_TIME = 1000 / FPS_TARGET; // ~16.67 ms\nexport const MAX_FRAME_TIME = 18; // p95 threshold\n\n/** Legacy frame-rate targets kept for backward compatibility. */\nexport const FPS_TARGETS = {\n PAN_MIN: 30,\n ZOOM_TARGET: 60,\n WARNING_THRESHOLD: 20,\n} as const;\n\n// ── Timing Thresholds (ms) ────────────────────────────────────────────────────\n\nexport const TIMING_THRESHOLDS = {\n VIEWPORT_QUERY_MAX: 5,\n SPATIAL_UPDATE_MAX: 10,\n DRAG_RESPONSE_MAX: 16,\n LOAD_5K_TARGET: 2000,\n LOAD_10K_TARGET: 3000,\n VIEWPORT_DEBOUNCE: 100,\n SPATIAL_INDEX_BUILD: 50,\n} as const;\n\n// ── Memory Limits (MB) ────────────────────────────────────────────────────────\n\nexport const MEMORY_TARGET_MB = 500;\nexport const MEMORY_WARNING_MB = 600;\nexport const MEMORY_CRITICAL_MB = 800;\n\nexport const MEMORY_LIMITS = {\n MAX_10K_NODES: 500,\n MAX_GROWTH_PERCENT: 20,\n WARNING_THRESHOLD: 400,\n} as const;\n\n// ── Viewport Culling ──────────────────────────────────────────────────────────\n\nexport const VIEWPORT_MARGIN = 0.1;\nexport const MAX_VISIBLE_NODES = 800;\nexport const CULLING_QUERY_TIME_BUDGET = 5;\n\n// ── Spatial Index ─────────────────────────────────────────────────────────────\n\nexport const RBUSH_MAX_ENTRIES = 16;\nexport const SPATIAL_INDEX_BUILD_BUDGET = 50;\n\n// ── Zoom Constraints ──────────────────────────────────────────────────────────\n\n// Zoom limits: the design system's VIEW (geometry/interaction.ts; equal to the zoom-min / zoom-max tokens).\nexport const ZOOM_MIN = VIEW.zoomMin;\nexport const ZOOM_MAX = VIEW.zoomMax;\nexport const ZOOM_DEFAULT = 1.0;\n\n// ── Quality Level Presets ─────────────────────────────────────────────────────\n\nexport const QUALITY_HIGH = {\n shadows: true,\n bezierCurves: true,\n animations: true,\n textQuality: 'high' as const,\n antialiasing: true,\n};\n\nexport const QUALITY_MEDIUM = {\n shadows: false,\n bezierCurves: true,\n animations: true,\n textQuality: 'medium' as const,\n antialiasing: true,\n};\n\nexport const QUALITY_LOW = {\n shadows: false,\n bezierCurves: false,\n animations: false,\n textQuality: 'low' as const,\n antialiasing: false,\n};\n\n// ── Performance Monitoring ────────────────────────────────────────────────────\n\nexport const FPS_SAMPLE_WINDOW = 60;\nexport const FPS_UPDATE_INTERVAL = 1000;\nexport const MEMORY_CHECK_INTERVAL = 5000;\nexport const PERFORMANCE_TOAST_COOLDOWN = 10000;\n\n// ── Auto-Adjustment ───────────────────────────────────────────────────────────\n\nexport const FPS_DOWNGRADE_THRESHOLD = 45;\nexport const FPS_UPGRADE_THRESHOLD = 58;\nexport const FPS_STABILIZATION_FRAMES = 180;\n\n// ── Canvas Dimensions ─────────────────────────────────────────────────────────\n\nexport const DEFAULT_CANVAS_WIDTH = 1920;\nexport const DEFAULT_CANVAS_HEIGHT = 1080;\n\n// ── Interaction ───────────────────────────────────────────────────────────────\n\nexport const CLICK_THRESHOLD = 5;\nexport const DOUBLE_CLICK_DELAY = 300;\nexport const DRAG_START_DISTANCE = 10;\n\n// ── Data Validation ───────────────────────────────────────────────────────────\n\nexport const MAX_NODES = 20000;\nexport const CIRCULAR_REFERENCE_MAX_DEPTH = 1000;\n\n// ── Debounce / Throttle ───────────────────────────────────────────────────────\n\nexport const RESIZE_DEBOUNCE = 300;\nexport const SCROLL_THROTTLE = 16;\nexport const SEARCH_DEBOUNCE = 500;\n\n/** Node count thresholds that gate optimisation strategies. */\nexport const NODE_COUNT_THRESHOLDS = {\n SPATIAL_INDEX_MIN: 100,\n VIEWPORT_CULLING_MIN: 500,\n CANVAS_RENDERING_MIN: 2000,\n DOM_RENDERING_MAX: 5000,\n} as const;\n\n/** Viewport buffer configuration. */\nexport const VIEWPORT_CONFIG = {\n BUFFER_PERCENT: 0.2,\n MIN_VISIBLE_NODES: 10,\n} as const;\n","// ─── Layout constants ────────────────────────────────────────────────────────\n//\n// Non-visual layout metrics (world units). Everything visual (colours, fonts,\n// radii, spacing, motion) comes from the design system: see ../theme.\n\nexport const LAYOUT_SPACING = {\n nodeSpacing: 200,\n levelSpacing: 150,\n containerPadding: 20,\n gridSize: 50,\n} as const;\n","// ─── Render Configuration ─────────────────────────────────────────────────────\n\nimport type { RenderConfig } from '../types/mindmap.js';\nimport {\n FPS_TARGET,\n MEMORY_TARGET_MB,\n QUALITY_HIGH,\n QUALITY_MEDIUM,\n QUALITY_LOW,\n NODE_COUNT_THRESHOLDS,\n} from './performanceConstants.js';\n\n// ── Defaults ──────────────────────────────────────────────────────────────────\n\nexport const DEFAULT_RENDER_CONFIG: RenderConfig = {\n renderMode: 'canvas',\n qualityLevel: 'high',\n cullingEnabled: false,\n fpsTarget: FPS_TARGET,\n memoryLimit: MEMORY_TARGET_MB,\n};\n\nexport const SIMPLIFIED_RENDER_CONFIG: RenderConfig = {\n renderMode: 'simplified',\n qualityLevel: 'low',\n cullingEnabled: true,\n fpsTarget: 30,\n memoryLimit: 400,\n};\n\n// ── Quality Map ───────────────────────────────────────────────────────────────\n\nexport const QUALITY_SETTINGS = {\n high: QUALITY_HIGH,\n medium: QUALITY_MEDIUM,\n low: QUALITY_LOW,\n} as const;\n\n// ── Feature Flags ─────────────────────────────────────────────────────────────\n\nexport const FEATURE_FLAGS = {\n viewportCulling: true,\n spatialIndexing: true,\n shadows: true,\n bezierCurves: true,\n animations: true,\n branchBadges: true,\n autoQualityAdjustment: true,\n performanceMonitoring: true,\n performanceToasts: true,\n debugOverlay: false,\n showFPS: false,\n showMemory: false,\n showVisibleCount: false,\n} as const;\n\n// ── Render Modes ──────────────────────────────────────────────────────────────\n\nexport type RenderMode = RenderConfig['renderMode'];\nexport type QualityLevel = RenderConfig['qualityLevel'];\n\nexport const RENDER_MODES = {\n canvas: {\n name: 'Canvas',\n description: 'Full Konva canvas rendering with all features',\n features: { culling: true, shadows: true, bezierCurves: true, animations: true },\n },\n simplified: {\n name: 'Simplified',\n description: 'Reduced feature set for low-end devices',\n features: { culling: true, shadows: false, bezierCurves: false, animations: false },\n },\n} as const;\n\nexport const QUALITY_LEVELS = {\n high: { name: 'High', description: 'All visual features enabled', targetFPS: 60, features: QUALITY_HIGH },\n medium: { name: 'Medium', description: 'Shadows disabled, other features enabled', targetFPS: 60, features: QUALITY_MEDIUM },\n low: { name: 'Low', description: 'Minimal visual features, max performance', targetFPS: 30, features: QUALITY_LOW },\n} as const;\n\n// ── Auto-Adjustment Helpers ───────────────────────────────────────────────────\n\nexport function getOptimalQualityLevel(\n currentFPS: number,\n currentQuality: QualityLevel,\n): QualityLevel {\n if (currentFPS < 45 && currentQuality === 'high') return 'medium';\n if (currentFPS < 30 && currentQuality === 'medium') return 'low';\n if (currentFPS > 58 && currentQuality === 'low') return 'medium';\n if (currentFPS > 58 && currentQuality === 'medium') return 'high';\n return currentQuality;\n}\n\nexport function getRenderConfigForQuality(quality: QualityLevel): Partial<RenderConfig> {\n return { qualityLevel: quality, fpsTarget: QUALITY_LEVELS[quality].targetFPS };\n}\n\nexport function isFeatureEnabled(\n featureName: keyof typeof FEATURE_FLAGS,\n config: RenderConfig,\n): boolean {\n if (!FEATURE_FLAGS[featureName]) return false;\n\n const qs = QUALITY_SETTINGS[config.qualityLevel];\n switch (featureName) {\n case 'shadows': return qs.shadows;\n case 'bezierCurves': return qs.bezierCurves;\n case 'animations': return qs.animations;\n default: return FEATURE_FLAGS[featureName] as boolean;\n }\n}\n\n// ── Device Detection ──────────────────────────────────────────────────────────\n\n/**\n * Recommend a render config based on detected device memory (browser only).\n * Falls back to SIMPLIFIED_RENDER_CONFIG when the Performance Memory API is\n * unavailable or memory is constrained.\n */\nexport function getRecommendedRenderConfig(): RenderConfig {\n if (typeof performance === 'undefined' || !(performance as unknown as Record<string, unknown>)['memory']) {\n return SIMPLIFIED_RENDER_CONFIG;\n }\n\n const memory = (performance as unknown as Record<string, unknown>)['memory'] as Record<string, number>;\n if (memory?.['jsHeapSizeLimit'] && memory['jsHeapSizeLimit'] < 512 * 1024 * 1024) {\n return SIMPLIFIED_RENDER_CONFIG;\n }\n\n return DEFAULT_RENDER_CONFIG;\n}\n\n/** Re-export so consumers need only one import. */\nexport { NODE_COUNT_THRESHOLDS };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAAA,IAC/B,KAAK;AAAgB,aAAO,GAAG;AAAA,IAC/B;AAAqB,aAAO,cAAc,WAAW;AAAA,EACvD;AACF;AASO,SAAS,6BAA2C;AACzD,MAAI,OAAO,gBAAgB,eAAe,CAAE,YAAmD,QAAQ,GAAG;AACxG,WAAO;AAAA,EACT;AAEA,QAAM,SAAU,YAAmD,QAAQ;AAC3E,MAAI,SAAS,iBAAiB,KAAK,OAAO,iBAAiB,IAAI,MAAM,OAAO,MAAM;AAChF,WAAO;AAAA,EACT;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { R as RenderConfig } from '../mindmap-
|
|
1
|
+
import { R as RenderConfig } from '../mindmap-C3Qr0qKW.cjs';
|
|
2
|
+
import '../designSystem-BOrZHfEq.cjs';
|
|
2
3
|
|
|
3
4
|
declare const FPS_TARGET = 60;
|
|
4
5
|
declare const FPS_WARNING_THRESHOLD = 45;
|
|
@@ -33,26 +34,9 @@ declare const MAX_VISIBLE_NODES = 800;
|
|
|
33
34
|
declare const CULLING_QUERY_TIME_BUDGET = 5;
|
|
34
35
|
declare const RBUSH_MAX_ENTRIES = 16;
|
|
35
36
|
declare const SPATIAL_INDEX_BUILD_BUDGET = 50;
|
|
36
|
-
declare const
|
|
37
|
-
declare const
|
|
38
|
-
declare const NODE_PADDING = 40;
|
|
39
|
-
declare const CHAR_WIDTH = 8;
|
|
40
|
-
declare const TITLE_MAX_LENGTH = 150;
|
|
41
|
-
declare const CORNER_RADIUS = 8;
|
|
42
|
-
declare const BORDER_WIDTH_NORMAL = 2;
|
|
43
|
-
declare const BORDER_WIDTH_SELECTED = 3;
|
|
44
|
-
declare const COLOR_SELECTED = "#1B2D4F";
|
|
45
|
-
declare const COLOR_BORDER_LIGHT = "#4A3728";
|
|
46
|
-
declare const COLOR_BORDER_DARK = "#FAF6F1";
|
|
47
|
-
declare const COLOR_DEFAULT_NODE = "#FAF6F1";
|
|
48
|
-
declare const ZOOM_MIN = 0.05;
|
|
49
|
-
declare const ZOOM_MAX = 5;
|
|
37
|
+
declare const ZOOM_MIN: 0.3;
|
|
38
|
+
declare const ZOOM_MAX: 5;
|
|
50
39
|
declare const ZOOM_DEFAULT = 1;
|
|
51
|
-
declare const ZOOM_STEP = 0.1;
|
|
52
|
-
declare const ZOOM_WHEEL_SENSITIVITY = 0.001;
|
|
53
|
-
declare const ZOOM_NAV_IN_THRESHOLD = 2.7;
|
|
54
|
-
declare const ZOOM_NAV_OUT_THRESHOLD = 0.4;
|
|
55
|
-
declare const TEXT_LABEL_HIDE_BELOW_ZOOM = 0.3;
|
|
56
40
|
declare const QUALITY_HIGH: {
|
|
57
41
|
shadows: boolean;
|
|
58
42
|
bezierCurves: boolean;
|
|
@@ -104,234 +88,12 @@ declare const VIEWPORT_CONFIG: {
|
|
|
104
88
|
readonly MIN_VISIBLE_NODES: 10;
|
|
105
89
|
};
|
|
106
90
|
|
|
107
|
-
declare const DS_COLORS: {
|
|
108
|
-
readonly light: {
|
|
109
|
-
readonly bgApp: "#F0EDE6";
|
|
110
|
-
readonly bgSurface: "#FAF8F4";
|
|
111
|
-
readonly bgInput: "#FFFFFF";
|
|
112
|
-
readonly border: "#DDD9D0";
|
|
113
|
-
readonly borderDivider: "#E8E4DC";
|
|
114
|
-
readonly primary: "#1B2D4F";
|
|
115
|
-
readonly primaryHover: "#243B68";
|
|
116
|
-
readonly textPrimary: "#1A1A18";
|
|
117
|
-
readonly textSecondary: "#6B6860";
|
|
118
|
-
readonly textMuted: "#747270";
|
|
119
|
-
readonly textOnPrimary: "#FAF8F4";
|
|
120
|
-
readonly hoverItem: "rgba(27,45,79,0.07)";
|
|
121
|
-
readonly focusRing: "rgba(27,45,79,0.40)";
|
|
122
|
-
readonly btnMuted: "#8E8C88";
|
|
123
|
-
};
|
|
124
|
-
readonly dark: {
|
|
125
|
-
readonly bgApp: "#141412";
|
|
126
|
-
readonly bgSurface: "#1C1C1A";
|
|
127
|
-
readonly bgInput: "#262622";
|
|
128
|
-
readonly border: "#333330";
|
|
129
|
-
readonly borderDivider: "#2A2A28";
|
|
130
|
-
readonly primary: "#BB532D";
|
|
131
|
-
readonly primaryHover: "#CC6440";
|
|
132
|
-
readonly textPrimary: "#F0EDE6";
|
|
133
|
-
readonly textSecondary: "#B0ABA3";
|
|
134
|
-
readonly textMuted: "#8E8C88";
|
|
135
|
-
readonly textOnPrimary: "#FAF8F4";
|
|
136
|
-
readonly hoverItem: "rgba(198,94,56,0.12)";
|
|
137
|
-
readonly focusRing: "rgba(198,94,56,0.50)";
|
|
138
|
-
readonly btnMuted: "#4A4845";
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
declare const DS_TYPOGRAPHY: {
|
|
142
|
-
readonly fontDisplay: "'Nunito', sans-serif";
|
|
143
|
-
readonly fontBody: "'Nunito Sans', sans-serif";
|
|
144
|
-
readonly logo: {
|
|
145
|
-
readonly size: "20px";
|
|
146
|
-
readonly weight: 800;
|
|
147
|
-
readonly letterSpacing: "0.04em";
|
|
148
|
-
};
|
|
149
|
-
readonly heading: {
|
|
150
|
-
readonly size: "16px";
|
|
151
|
-
readonly weight: 700;
|
|
152
|
-
readonly letterSpacing: "-0.2px";
|
|
153
|
-
};
|
|
154
|
-
readonly cta: {
|
|
155
|
-
readonly size: "11px";
|
|
156
|
-
readonly weight: 800;
|
|
157
|
-
readonly letterSpacing: "0.12em";
|
|
158
|
-
readonly transform: "uppercase";
|
|
159
|
-
};
|
|
160
|
-
readonly body: {
|
|
161
|
-
readonly size: "13px";
|
|
162
|
-
readonly weight: 400;
|
|
163
|
-
};
|
|
164
|
-
readonly input: {
|
|
165
|
-
readonly size: "13px";
|
|
166
|
-
readonly weight: 300;
|
|
167
|
-
readonly style: "italic";
|
|
168
|
-
};
|
|
169
|
-
readonly search: {
|
|
170
|
-
readonly size: "12px";
|
|
171
|
-
readonly weight: 400;
|
|
172
|
-
};
|
|
173
|
-
readonly username: {
|
|
174
|
-
readonly size: "13px";
|
|
175
|
-
readonly weight: 600;
|
|
176
|
-
};
|
|
177
|
-
readonly avatar: {
|
|
178
|
-
readonly size: "11px";
|
|
179
|
-
readonly weight: 700;
|
|
180
|
-
};
|
|
181
|
-
readonly footer: {
|
|
182
|
-
readonly size: "12px";
|
|
183
|
-
readonly weight: 400;
|
|
184
|
-
};
|
|
185
|
-
readonly empty: {
|
|
186
|
-
readonly size: "11px";
|
|
187
|
-
readonly weight: 300;
|
|
188
|
-
readonly style: "italic";
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
declare const DS_RADII: {
|
|
192
|
-
readonly sidebar: 16;
|
|
193
|
-
readonly input: 8;
|
|
194
|
-
readonly cta: 7;
|
|
195
|
-
readonly item: 6;
|
|
196
|
-
readonly swatch: 10;
|
|
197
|
-
};
|
|
198
|
-
declare const BRAND_COLORS: {
|
|
199
|
-
readonly primary: {
|
|
200
|
-
readonly 50: "#EFF6FF";
|
|
201
|
-
readonly 100: "#DBEAFE";
|
|
202
|
-
readonly 200: "#BFDBFE";
|
|
203
|
-
readonly 300: "#93C5FD";
|
|
204
|
-
readonly 400: "#60A5FA";
|
|
205
|
-
readonly 500: "#3B82F6";
|
|
206
|
-
readonly 600: "#2563EB";
|
|
207
|
-
readonly 700: "#1D4ED8";
|
|
208
|
-
readonly 800: "#1E40AF";
|
|
209
|
-
readonly 900: "#1E3A8A";
|
|
210
|
-
};
|
|
211
|
-
readonly secondary: {
|
|
212
|
-
readonly 50: "#F0FDF4";
|
|
213
|
-
readonly 100: "#DCFCE7";
|
|
214
|
-
readonly 200: "#BBF7D0";
|
|
215
|
-
readonly 300: "#86EFAC";
|
|
216
|
-
readonly 400: "#4ADE80";
|
|
217
|
-
readonly 500: "#10B981";
|
|
218
|
-
readonly 600: "#059669";
|
|
219
|
-
readonly 700: "#047857";
|
|
220
|
-
readonly 800: "#065F46";
|
|
221
|
-
readonly 900: "#064E3B";
|
|
222
|
-
};
|
|
223
|
-
readonly accent: {
|
|
224
|
-
readonly purple: "#8B5CF6";
|
|
225
|
-
readonly cyan: "#06B6D4";
|
|
226
|
-
readonly sky: "#0EA5E9";
|
|
227
|
-
readonly lime: "#84CC16";
|
|
228
|
-
readonly amber: "#F59E0B";
|
|
229
|
-
readonly red: "#EF4444";
|
|
230
|
-
};
|
|
231
|
-
};
|
|
232
|
-
declare const LEVEL_COLORS: {
|
|
233
|
-
readonly level0: "#3B82F6";
|
|
234
|
-
readonly level1: "#60A5FA";
|
|
235
|
-
readonly level2: "#93C5FD";
|
|
236
|
-
readonly level3: "#BFDBFE";
|
|
237
|
-
readonly level4: "#93C5FD";
|
|
238
|
-
readonly level5: "#60A5FA";
|
|
239
|
-
readonly level6: "#3B82F6";
|
|
240
|
-
readonly level7: "#2563EB";
|
|
241
|
-
readonly level8: "#1D4ED8";
|
|
242
|
-
};
|
|
243
|
-
declare const LEVEL_COLOR_ARRAY: readonly ["#3B82F6", "#60A5FA", "#93C5FD", "#BFDBFE", "#93C5FD", "#60A5FA", "#3B82F6", "#2563EB", "#1D4ED8"];
|
|
244
|
-
declare const PARENT_FALLBACK_COLORS: readonly ["#12C7D3", "#325E8C", "#8A70A6", "#F54A57", "#FF6C4D", "#F28C16", "#FFD347", "#7F7F7F", "#8D8D8D"];
|
|
245
|
-
declare const SEMANTIC_COLORS: {
|
|
246
|
-
readonly success: "#10B981";
|
|
247
|
-
readonly error: "#EF4444";
|
|
248
|
-
readonly warning: "#F59E0B";
|
|
249
|
-
readonly info: "#3B82F6";
|
|
250
|
-
};
|
|
251
|
-
declare const THEME_COLORS: {
|
|
252
|
-
readonly light: {
|
|
253
|
-
readonly background: {
|
|
254
|
-
readonly primary: "#FAF8F4";
|
|
255
|
-
readonly secondary: "#F0EDE6";
|
|
256
|
-
readonly tertiary: "#FFFFFF";
|
|
257
|
-
};
|
|
258
|
-
readonly text: {
|
|
259
|
-
readonly primary: "#1A1A18";
|
|
260
|
-
readonly secondary: "#6B6860";
|
|
261
|
-
readonly tertiary: "#747270";
|
|
262
|
-
};
|
|
263
|
-
readonly border: {
|
|
264
|
-
readonly primary: "#DDD9D0";
|
|
265
|
-
readonly secondary: "#E8E4DC";
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
readonly dark: {
|
|
269
|
-
readonly background: {
|
|
270
|
-
readonly primary: "#1C1C1A";
|
|
271
|
-
readonly secondary: "#141412";
|
|
272
|
-
readonly tertiary: "#262622";
|
|
273
|
-
};
|
|
274
|
-
readonly text: {
|
|
275
|
-
readonly primary: "#F0EDE6";
|
|
276
|
-
readonly secondary: "#B0ABA3";
|
|
277
|
-
readonly tertiary: "#8E8C88";
|
|
278
|
-
};
|
|
279
|
-
readonly border: {
|
|
280
|
-
readonly primary: "#333330";
|
|
281
|
-
readonly secondary: "#2A2A28";
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
};
|
|
285
|
-
declare const CANVAS_COLORS: {
|
|
286
|
-
readonly node: {
|
|
287
|
-
readonly border: "#FFFFFF";
|
|
288
|
-
readonly titleColor: "#1e1b4b";
|
|
289
|
-
readonly badgeBackground: "#FFC107";
|
|
290
|
-
readonly badgeStroke: "#fcd34d";
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
declare const SPACING: {
|
|
294
|
-
readonly xs: 4;
|
|
295
|
-
readonly sm: 8;
|
|
296
|
-
readonly md: 16;
|
|
297
|
-
readonly lg: 24;
|
|
298
|
-
readonly xl: 32;
|
|
299
|
-
readonly '2xl': 48;
|
|
300
|
-
readonly '3xl': 64;
|
|
301
|
-
readonly '4xl': 96;
|
|
302
|
-
};
|
|
303
91
|
declare const LAYOUT_SPACING: {
|
|
304
92
|
readonly nodeSpacing: 200;
|
|
305
93
|
readonly levelSpacing: 150;
|
|
306
94
|
readonly containerPadding: 20;
|
|
307
95
|
readonly gridSize: 50;
|
|
308
96
|
};
|
|
309
|
-
declare const FONTS: {
|
|
310
|
-
readonly primary: "'Inter', sans-serif";
|
|
311
|
-
readonly secondary: "'Poppins', sans-serif";
|
|
312
|
-
readonly mono: "'Roboto Mono', monospace";
|
|
313
|
-
};
|
|
314
|
-
declare const FONT_SIZES: {
|
|
315
|
-
readonly xs: "0.75rem";
|
|
316
|
-
readonly sm: "0.875rem";
|
|
317
|
-
readonly base: "1rem";
|
|
318
|
-
readonly lg: "1.125rem";
|
|
319
|
-
readonly xl: "1.25rem";
|
|
320
|
-
readonly '2xl': "1.5rem";
|
|
321
|
-
readonly '3xl': "1.875rem";
|
|
322
|
-
readonly '4xl': "2.25rem";
|
|
323
|
-
};
|
|
324
|
-
/** Get a level color, cycling back to level 0 for levels > 8. */
|
|
325
|
-
declare function getColorForLevel(level: number): string;
|
|
326
|
-
/**
|
|
327
|
-
* Darken a hex color by reducing HSL lightness.
|
|
328
|
-
* Returns a monochromatic darker version — used for border/stroke colors.
|
|
329
|
-
* Falls back to the original string if parsing fails.
|
|
330
|
-
*/
|
|
331
|
-
declare function darkenHexColor(hex: string, amount?: number): string;
|
|
332
|
-
declare function getThemeBackground(isDark: boolean, variant?: 'primary' | 'secondary' | 'tertiary'): string;
|
|
333
|
-
declare function getThemeText(isDark: boolean, variant?: 'primary' | 'secondary' | 'tertiary'): string;
|
|
334
|
-
declare function getThemeBorder(isDark: boolean, variant?: 'primary' | 'secondary'): string;
|
|
335
97
|
|
|
336
98
|
declare const DEFAULT_RENDER_CONFIG: RenderConfig;
|
|
337
99
|
declare const SIMPLIFIED_RENDER_CONFIG: RenderConfig;
|
|
@@ -445,4 +207,4 @@ declare function isFeatureEnabled(featureName: keyof typeof FEATURE_FLAGS, confi
|
|
|
445
207
|
*/
|
|
446
208
|
declare function getRecommendedRenderConfig(): RenderConfig;
|
|
447
209
|
|
|
448
|
-
export {
|
|
210
|
+
export { CIRCULAR_REFERENCE_MAX_DEPTH, CLICK_THRESHOLD, CULLING_QUERY_TIME_BUDGET, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, DEFAULT_RENDER_CONFIG, DOUBLE_CLICK_DELAY, DRAG_START_DISTANCE, FEATURE_FLAGS, FPS_CRITICAL_THRESHOLD, FPS_DOWNGRADE_THRESHOLD, FPS_SAMPLE_WINDOW, FPS_STABILIZATION_FRAMES, FPS_TARGET, FPS_TARGETS, FPS_UPDATE_INTERVAL, FPS_UPGRADE_THRESHOLD, FPS_WARNING_THRESHOLD, LAYOUT_SPACING, MAX_FRAME_TIME, MAX_NODES, MAX_VISIBLE_NODES, MEMORY_CHECK_INTERVAL, MEMORY_CRITICAL_MB, MEMORY_LIMITS, MEMORY_TARGET_MB, MEMORY_WARNING_MB, NODE_COUNT_THRESHOLDS, PERFORMANCE_TOAST_COOLDOWN, QUALITY_HIGH, QUALITY_LEVELS, QUALITY_LOW, QUALITY_MEDIUM, QUALITY_SETTINGS, type QualityLevel, RBUSH_MAX_ENTRIES, RENDER_MODES, RESIZE_DEBOUNCE, type RenderMode, SCROLL_THROTTLE, SEARCH_DEBOUNCE, SIMPLIFIED_RENDER_CONFIG, SPATIAL_INDEX_BUILD_BUDGET, TARGET_FRAME_TIME, TIMING_THRESHOLDS, VIEWPORT_CONFIG, VIEWPORT_MARGIN, ZOOM_DEFAULT, ZOOM_MAX, ZOOM_MIN, getOptimalQualityLevel, getRecommendedRenderConfig, getRenderConfigForQuality, isFeatureEnabled };
|