@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.
Files changed (127) hide show
  1. package/README.md +37 -105
  2. package/dist/chunk-25AJTPMS.js +68 -0
  3. package/dist/chunk-25AJTPMS.js.map +1 -0
  4. package/dist/{chunk-6NXADJK2.js → chunk-7NJWM7ZE.js} +84 -117
  5. package/dist/chunk-7NJWM7ZE.js.map +1 -0
  6. package/dist/chunk-KVSM3APM.js +96 -0
  7. package/dist/chunk-KVSM3APM.js.map +1 -0
  8. package/dist/{chunk-PDP5CVUL.js → chunk-LOQLNYB3.js} +2 -2
  9. package/dist/chunk-LV3EXUQY.js +753 -0
  10. package/dist/chunk-LV3EXUQY.js.map +1 -0
  11. package/dist/chunk-N7HCYULH.js +12 -0
  12. package/dist/chunk-N7HCYULH.js.map +1 -0
  13. package/dist/{chunk-I75TMOE4.js → chunk-P6PKWVYF.js} +2 -2
  14. package/dist/chunk-TPLJJKAU.js +151 -0
  15. package/dist/chunk-TPLJJKAU.js.map +1 -0
  16. package/dist/chunk-UAMEJG2C.js +267 -0
  17. package/dist/chunk-UAMEJG2C.js.map +1 -0
  18. package/dist/{chunk-LJYSKSCE.js → chunk-W2CAOOJJ.js} +6 -6
  19. package/dist/chunk-W2CAOOJJ.js.map +1 -0
  20. package/dist/config/index.cjs +250 -349
  21. package/dist/config/index.cjs.map +1 -1
  22. package/dist/config/index.d.cts +107 -66
  23. package/dist/config/index.d.ts +107 -66
  24. package/dist/config/index.js +52 -34
  25. package/dist/constants/index.cjs +14 -333
  26. package/dist/constants/index.cjs.map +1 -1
  27. package/dist/constants/index.d.cts +5 -243
  28. package/dist/constants/index.d.ts +5 -243
  29. package/dist/constants/index.js +5 -75
  30. package/dist/designSystem-BOrZHfEq.d.cts +150 -0
  31. package/dist/designSystem-BOrZHfEq.d.ts +150 -0
  32. package/dist/document-BFBwn93X.d.ts +26 -0
  33. package/dist/document-MEJEfxl3.d.cts +26 -0
  34. package/dist/ideaSize-CLDKeyqD.d.cts +11 -0
  35. package/dist/ideaSize-DxxGy2E8.d.ts +11 -0
  36. package/dist/index-BmILeKj6.d.cts +99 -0
  37. package/dist/index-CcPRwVUL.d.ts +99 -0
  38. package/dist/index.cjs +1636 -961
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +350 -27
  41. package/dist/index.d.ts +350 -27
  42. package/dist/index.js +445 -190
  43. package/dist/index.js.map +1 -1
  44. package/dist/{document-B3hnNr-F.d.cts → layer-B2A3Ki48.d.cts} +2 -16
  45. package/dist/{document-B3hnNr-F.d.ts → layer-B2A3Ki48.d.ts} +2 -16
  46. package/dist/layout/index.d.cts +2 -1
  47. package/dist/layout/index.d.ts +2 -1
  48. package/dist/mindmap-C3Qr0qKW.d.cts +182 -0
  49. package/dist/mindmap-DHeVa86G.d.ts +182 -0
  50. package/dist/parser/index.cjs +745 -179
  51. package/dist/parser/index.cjs.map +1 -1
  52. package/dist/parser/index.d.cts +23 -8
  53. package/dist/parser/index.d.ts +23 -8
  54. package/dist/parser/index.js +7 -2
  55. package/dist/performance/index.cjs +13 -0
  56. package/dist/performance/index.cjs.map +1 -1
  57. package/dist/performance/index.js +2 -2
  58. package/dist/theme/index.cjs +884 -0
  59. package/dist/theme/index.cjs.map +1 -0
  60. package/dist/theme/index.d.cts +2 -0
  61. package/dist/theme/index.d.ts +2 -0
  62. package/dist/theme/index.js +53 -0
  63. package/dist/types/index.d.cts +4 -2
  64. package/dist/types/index.d.ts +4 -2
  65. package/dist/viewport/index.cjs +17 -6
  66. package/dist/viewport/index.cjs.map +1 -1
  67. package/dist/viewport/index.d.cts +6 -4
  68. package/dist/viewport/index.d.ts +6 -4
  69. package/dist/viewport/index.js +2 -2
  70. package/licenses/visualli-design-system/LICENSE +9 -0
  71. package/licenses/visualli-design-system/NOTICE.md +6 -0
  72. package/package.json +13 -5
  73. package/src/config/README.md +2 -4
  74. package/src/config/USAGE_EXAMPLES.md +0 -4
  75. package/src/config/index.ts +3 -4
  76. package/src/constants/index.ts +1 -1
  77. package/src/constants/layout.ts +11 -0
  78. package/src/constants/performanceConstants.ts +8 -27
  79. package/src/generated/README.md +12 -0
  80. package/src/generated/designSystem.ts +758 -0
  81. package/src/generated/geometry/blob.ts +99 -0
  82. package/src/generated/geometry/blobShapes.ts +4 -0
  83. package/src/generated/geometry/color.ts +37 -0
  84. package/src/generated/geometry/container.ts +84 -0
  85. package/src/generated/geometry/detail.ts +22 -0
  86. package/src/generated/geometry/idea.ts +56 -0
  87. package/src/generated/geometry/interaction.ts +122 -0
  88. package/src/generated/geometry/motion.ts +140 -0
  89. package/src/index.ts +18 -1
  90. package/src/parser/configUtils.ts +12 -19
  91. package/src/parser/visualliConverter.ts +71 -112
  92. package/src/parser/visualliParser.ts +16 -1
  93. package/src/rendering/culling.ts +16 -12
  94. package/src/rendering/ideaSize.ts +21 -0
  95. package/src/rendering/nodeGeometry.ts +97 -0
  96. package/src/theme/index.ts +136 -0
  97. package/src/types/document.ts +9 -0
  98. package/src/types/layer.ts +1 -1
  99. package/src/types/mindmap.ts +13 -0
  100. package/src/utils/navigation.ts +33 -63
  101. package/src/viewport/viewportUtils.ts +6 -4
  102. package/dist/animations/index.cjs +0 -146
  103. package/dist/animations/index.cjs.map +0 -1
  104. package/dist/animations/index.d.cts +0 -81
  105. package/dist/animations/index.d.ts +0 -81
  106. package/dist/animations/index.js +0 -35
  107. package/dist/chunk-6NXADJK2.js.map +0 -1
  108. package/dist/chunk-F36SMC3K.js +0 -106
  109. package/dist/chunk-F36SMC3K.js.map +0 -1
  110. package/dist/chunk-G5H3P4YZ.js +0 -273
  111. package/dist/chunk-G5H3P4YZ.js.map +0 -1
  112. package/dist/chunk-LDJRGT2Q.js +0 -163
  113. package/dist/chunk-LDJRGT2Q.js.map +0 -1
  114. package/dist/chunk-LJYSKSCE.js.map +0 -1
  115. package/dist/chunk-LNTJTDB2.js +0 -349
  116. package/dist/chunk-LNTJTDB2.js.map +0 -1
  117. package/dist/mindmap-DWS0WZT_.d.cts +0 -118
  118. package/dist/mindmap-DWS0WZT_.d.ts +0 -118
  119. package/src/animations/constants.ts +0 -72
  120. package/src/animations/easing.ts +0 -70
  121. package/src/animations/index.ts +0 -2
  122. package/src/config/blobShapes.ts +0 -146
  123. package/src/config/textScaling.ts +0 -54
  124. package/src/constants/design.ts +0 -281
  125. /package/dist/{chunk-PDP5CVUL.js.map → chunk-LOQLNYB3.js.map} +0 -0
  126. /package/dist/{chunk-I75TMOE4.js.map → chunk-P6PKWVYF.js.map} +0 -0
  127. /package/dist/{animations → theme}/index.js.map +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/theme/index.ts","../../src/generated/designSystem.ts","../../src/generated/geometry/color.ts"],"sourcesContent":["// ─── Theme resolution ────────────────────────────────────────────────────────\n//\n// Everything visual comes from the generated design-system modules. This file\n// only decides WHICH of the 8 themes applies and resolves document colours with\n// the design system's colour rule. No colour literals live here.\n//\n// Dependencies: ../generated/designSystem.ts (generated from design-system/).\n\nimport {\n CANVAS_STYLE,\n DESIGN_SYSTEM_VERSION,\n METRICS,\n METRICS_REDUCED_MOTION,\n THEME_NAMES,\n TOKENS,\n TOPICS,\n TYPE_STYLES,\n type ThemeName,\n type TopicName,\n} from '../generated/designSystem.js';\nimport { TOPIC_ORDER, customColor, topicFor, topicFromName } from '../generated/geometry/color.js';\n\nexport { topicFromName, customColor };\n\nexport { CANVAS_STYLE, DESIGN_SYSTEM_VERSION, METRICS, METRICS_REDUCED_MOTION, THEME_NAMES, TOKENS, TOPICS, TYPE_STYLES };\nexport type { ThemeName, TopicName };\n\n// ── Theme selection ───────────────────────────────────────────────────────────\n\n/** Theme families: each resolves to its light or dark member. */\nexport type ThemeFamily = 'standard' | 'focus' | 'colorsafe' | 'contrast';\n\n/**\n * Anything a consumer may pass as `theme`:\n * - one of the 8 design-system themes ('light', 'dark', 'focus-light', ...)\n * - a family name ('focus' | 'colorsafe' | 'contrast') -> light/dark per the reader's scheme\n * - 'auto' -> light/dark per prefers-color-scheme (contrast under forced-colors)\n *\n * 'light' | 'dark' | 'auto' are the pre-0.2 values, kept as aliases for one release.\n */\nexport type ThemeInput = ThemeName | 'auto' | 'focus' | 'colorsafe' | 'contrast';\n\nexport interface ThemeEnv {\n /** prefers-color-scheme: dark */\n prefersDark?: boolean;\n /** forced-colors: active (Windows high contrast etc.) */\n forcedColors?: boolean;\n}\n\nconst FAMILIES: ReadonlySet<string> = new Set(['focus', 'colorsafe', 'contrast']);\n\nexport function isThemeName(v: unknown): v is ThemeName {\n return typeof v === 'string' && (THEME_NAMES as readonly string[]).includes(v);\n}\n\n/** Resolve any accepted `theme` value to one concrete design-system theme. */\nexport function resolveTheme(input: ThemeInput | undefined, env: ThemeEnv = {}): ThemeName {\n const scheme = env.prefersDark ? 'dark' : 'light';\n if (input === undefined || input === 'auto') return env.forcedColors ? (`contrast-${scheme}` as ThemeName) : scheme;\n if (FAMILIES.has(input)) return `${input}-${scheme}` as ThemeName;\n return isThemeName(input) ? input : 'light';\n}\n\nexport const isDarkTheme = (name: ThemeName): boolean => name.endsWith('dark');\nexport const isContrastTheme = (name: ThemeName): boolean => name.startsWith('contrast');\nexport const isFocusTheme = (name: ThemeName): boolean => name.startsWith('focus');\n\n/** All tokens of a theme (already merged over the light defaults). */\nexport const getTokens = (name: ThemeName): Readonly<Record<string, string>> => TOKENS[name];\n\n/** One token of a theme. Throws on an unknown key so typos fail loudly in tests. */\nexport function token(name: ThemeName, key: string): string {\n const v = TOKENS[name][key];\n if (v === undefined) throw new Error(`Unknown design-system token \"${key}\"`);\n return v;\n}\n\n// ── Comfort settings ──────────────────────────────────────────────────────────\n\nexport interface Comfort {\n /** Atkinson Hyperlegible for map labels instead of the handwritten faces (`data-type=\"readable\"`). */\n readableType?: boolean;\n /** Larger UI and label text (`data-scale=\"lg\"`). */\n largerText?: boolean;\n /** Skip transitions and reveal animations (`data-motion=\"reduced\"`). 'system' follows prefers-reduced-motion. */\n reducedMotion?: boolean | 'system';\n}\n\nexport interface ResolvedComfort { readableType: boolean; largerText: boolean; reducedMotion: boolean }\n\nexport function resolveComfort(c: Comfort | undefined, env: { prefersReducedMotion?: boolean } = {}): ResolvedComfort {\n const rm = c?.reducedMotion;\n return {\n readableType: !!c?.readableType,\n largerText: !!c?.largerText,\n reducedMotion: rm === undefined || rm === 'system' ? !!env.prefersReducedMotion : rm,\n };\n}\n\n/** Numeric design-system tokens (px / ms stripped). */\nexport type Metrics = { readonly [K in keyof typeof METRICS]: number };\n\n/** Numeric tokens with the reduced-motion overrides applied when requested. */\nexport function metricsFor(comfort: ResolvedComfort): Metrics {\n return comfort.reducedMotion ? { ...METRICS, ...METRICS_REDUCED_MOTION } : METRICS;\n}\n\n/** Multiplier the spec applies to label sizes under `data-scale=\"lg\"` (`--vi-label-scale`). */\nexport const labelScale = (c: ResolvedComfort): number => (c.largerText ? 1.15 : 1);\n\n// ── Topic palette ─────────────────────────────────────────────────────────────\n\nexport interface TopicStyle { topic: TopicName; fill: string; ring: string }\n\n/** Fill + ring colour of a topic in a theme. */\nexport function topicStyle(theme: ThemeName, topic: TopicName): TopicStyle {\n const t = TOKENS[theme];\n return { topic, fill: t[`topic-${topic}`]!, ring: t[`topic-${topic}-ring`]! };\n}\n\n/** An idea's colour by the design system's colour rule (geometry/color.ts, verbatim): a topic name → that topic; no\n * colour → the topics in sibling order; any other colour → custom, drawn as given (customColor: the colour as the fill,\n * the fill darkened by CUSTOM.ringShade as the ring). A custom colour doesn't follow themes. */\nexport interface IdeaColor { topic: TopicName | null; custom: { fill: string; ring: string | null } | null }\n\nexport function ideaColor(color: string | null | undefined, siblingIndex: number): IdeaColor {\n const topic = topicFor(color, siblingIndex);\n return topic ? { topic, custom: null } : { topic: null, custom: customColor(color!) };\n}\n\n/** Fill + ring an idea is drawn with in a theme: its topic's, or its custom colour (ring: the `edge` token when the\n * colour has no darker shade, i.e. isn't a 6-digit hex). */\nexport function ideaStyle(theme: ThemeName, c: { topic?: TopicName | null; custom?: IdeaColor['custom'] }): { fill: string; ring: string } {\n if (c.custom) return { fill: c.custom.fill, ring: c.custom.ring ?? TOKENS[theme]['edge']! };\n return topicStyle(theme, c.topic ?? TOPIC_ORDER[0]);\n}\n","// GENERATED by scripts/gen-design-system.mjs from design-system/ (tokens/tokens.json, tokens/tokens.css). Do not edit.\n// Change the design system instead; the next `npm run build` regenerates this file.\n\n/** Version of the design system these modules were generated from. */\nexport const DESIGN_SYSTEM_VERSION = \"0.2.0\" as const;\n\nexport const THEME_NAMES = [\n \"light\",\n \"dark\",\n \"focus-light\",\n \"focus-dark\",\n \"colorsafe-light\",\n \"colorsafe-dark\",\n \"contrast-light\",\n \"contrast-dark\"\n] as const;\nexport type ThemeName = (typeof THEME_NAMES)[number];\n\n/** Every token for every theme (each theme already merged over \"light\"). Keys match the CSS custom properties. */\nexport const TOKENS: Readonly<Record<ThemeName, Readonly<Record<string, string>>>> = {\n \"light\": {\n \"font-display\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, sans-serif\",\n \"font-ui\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, -apple-system, \\\"Segoe UI\\\", sans-serif\",\n \"font-hand\": \"Kalam, \\\"Atkinson Hyperlegible Next\\\", cursive\",\n \"font-note\": \"Caveat, Kalam, cursive\",\n \"font-mono\": \"\\\"Atkinson Hyperlegible Mono\\\", ui-monospace, \\\"SF Mono\\\", Menlo, monospace\",\n \"canvas\": \"#f6f3ee\",\n \"surface\": \"#ffffff\",\n \"surface-sunken\": \"#f0ece5\",\n \"surface-overlay\": \"#ffffff\",\n \"line\": \"#e4dfd6\",\n \"line-strong\": \"#7a7f94\",\n \"ink\": \"#182140\",\n \"ink-muted\": \"#4f5671\",\n \"ink-subtle\": \"#5f647c\",\n \"action\": \"#182140\",\n \"on-action\": \"#ffffff\",\n \"focus\": \"#325e8c\",\n \"link\": \"#2f5a87\",\n \"selection\": \"rgba(18, 199, 211, 0.28)\",\n \"node-ink\": \"#182140\",\n \"edge\": \"#2a3048\",\n \"edge-label\": \"#4f5671\",\n \"topic-teal\": \"#87f2f8\",\n \"topic-teal-ring\": \"#00cdd5\",\n \"topic-harbor\": \"#bcdbff\",\n \"topic-harbor-ring\": \"#76b2f5\",\n \"topic-iris\": \"#e0c8fe\",\n \"topic-iris-ring\": \"#bd96ea\",\n \"topic-berry\": \"#ffbdc4\",\n \"topic-berry-ring\": \"#f47e8f\",\n \"topic-coral\": \"#ffc7b2\",\n \"topic-coral-ring\": \"#f38e65\",\n \"topic-amber\": \"#ffcf9d\",\n \"topic-amber-ring\": \"#eb9c38\",\n \"topic-sun\": \"#ffea94\",\n \"topic-sun-ring\": \"#dfbd04\",\n \"topic-stone\": \"#e0dacf\",\n \"topic-stone-ring\": \"#bab09f\",\n \"space-1\": \"4px\",\n \"space-2\": \"8px\",\n \"space-3\": \"12px\",\n \"space-4\": \"16px\",\n \"space-7\": \"48px\",\n \"radius-sm\": \"10px\",\n \"radius-md\": \"16px\",\n \"radius-lg\": \"24px\",\n \"radius-pill\": \"999px\",\n \"shadow-float\": \"0 1px 2px rgba(24, 33, 64, 0.06), 0 8px 24px rgba(24, 33, 64, 0.08)\",\n \"shadow-pop\": \"0 2px 4px rgba(24, 33, 64, 0.08), 0 16px 40px rgba(24, 33, 64, 0.14)\",\n \"node-width\": \"200px\",\n \"node-height\": \"148px\",\n \"node-stroke\": \"3px\",\n \"edge-width\": \"2.5px\",\n \"edge-gap\": \"15px\",\n \"edge-arc-max\": \"45px\",\n \"immersion-alpha\": \"0.15\",\n \"zoom-min\": \"0.3\",\n \"zoom-max\": \"5\",\n \"duration-instant\": \"100ms\",\n \"duration-quick\": \"160ms\",\n \"duration-base\": \"240ms\",\n \"duration-zoom\": \"500ms\",\n \"duration-reveal\": \"420ms\",\n \"stagger-reveal\": \"70ms\",\n \"ease-zoom\": \"cubic-bezier(0.2, 0.8, 0.2, 1)\",\n \"ease-standard\": \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"ease-bloom\": \"cubic-bezier(0.34, 1.4, 0.64, 1)\",\n \"z-chrome\": \"10\",\n \"z-card\": \"20\",\n \"z-menu\": \"40\"\n },\n \"dark\": {\n \"font-display\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, sans-serif\",\n \"font-ui\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, -apple-system, \\\"Segoe UI\\\", sans-serif\",\n \"font-hand\": \"Kalam, \\\"Atkinson Hyperlegible Next\\\", cursive\",\n \"font-note\": \"Caveat, Kalam, cursive\",\n \"font-mono\": \"\\\"Atkinson Hyperlegible Mono\\\", ui-monospace, \\\"SF Mono\\\", Menlo, monospace\",\n \"canvas\": \"#0f1220\",\n \"surface\": \"#171b2b\",\n \"surface-sunken\": \"#0f1220\",\n \"surface-overlay\": \"#212639\",\n \"line\": \"#2b3148\",\n \"line-strong\": \"#6c7392\",\n \"ink\": \"#eef0f7\",\n \"ink-muted\": \"#b3b8cc\",\n \"ink-subtle\": \"#8f95ae\",\n \"action\": \"#f6f3ee\",\n \"on-action\": \"#182140\",\n \"focus\": \"#12c7d3\",\n \"link\": \"#5fd8e1\",\n \"selection\": \"rgba(18, 199, 211, 0.32)\",\n \"node-ink\": \"#182140\",\n \"edge\": \"#c9cddc\",\n \"edge-label\": \"#b3b8cc\",\n \"topic-teal\": \"#87f2f8\",\n \"topic-teal-ring\": \"#0fc5cd\",\n \"topic-harbor\": \"#bcdbff\",\n \"topic-harbor-ring\": \"#73aceb\",\n \"topic-iris\": \"#e0c8fe\",\n \"topic-iris-ring\": \"#b691e1\",\n \"topic-berry\": \"#ffbdc4\",\n \"topic-berry-ring\": \"#eb798a\",\n \"topic-coral\": \"#ffc7b2\",\n \"topic-coral-ring\": \"#ea8962\",\n \"topic-amber\": \"#ffcf9d\",\n \"topic-amber-ring\": \"#e29737\",\n \"topic-sun\": \"#ffea94\",\n \"topic-sun-ring\": \"#d8b70a\",\n \"topic-stone\": \"#e0dacf\",\n \"topic-stone-ring\": \"#b4a999\",\n \"space-1\": \"4px\",\n \"space-2\": \"8px\",\n \"space-3\": \"12px\",\n \"space-4\": \"16px\",\n \"space-7\": \"48px\",\n \"radius-sm\": \"10px\",\n \"radius-md\": \"16px\",\n \"radius-lg\": \"24px\",\n \"radius-pill\": \"999px\",\n \"shadow-float\": \"0 1px 2px rgba(0, 0, 0, 0.40), 0 8px 24px rgba(0, 0, 0, 0.35)\",\n \"shadow-pop\": \"0 2px 4px rgba(0, 0, 0, 0.50), 0 16px 40px rgba(0, 0, 0, 0.50)\",\n \"node-width\": \"200px\",\n \"node-height\": \"148px\",\n \"node-stroke\": \"3px\",\n \"edge-width\": \"2.5px\",\n \"edge-gap\": \"15px\",\n \"edge-arc-max\": \"45px\",\n \"immersion-alpha\": \"0.15\",\n \"zoom-min\": \"0.3\",\n \"zoom-max\": \"5\",\n \"duration-instant\": \"100ms\",\n \"duration-quick\": \"160ms\",\n \"duration-base\": \"240ms\",\n \"duration-zoom\": \"500ms\",\n \"duration-reveal\": \"420ms\",\n \"stagger-reveal\": \"70ms\",\n \"ease-zoom\": \"cubic-bezier(0.2, 0.8, 0.2, 1)\",\n \"ease-standard\": \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"ease-bloom\": \"cubic-bezier(0.34, 1.4, 0.64, 1)\",\n \"z-chrome\": \"10\",\n \"z-card\": \"20\",\n \"z-menu\": \"40\"\n },\n \"focus-light\": {\n \"font-display\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, sans-serif\",\n \"font-ui\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, -apple-system, \\\"Segoe UI\\\", sans-serif\",\n \"font-hand\": \"Kalam, \\\"Atkinson Hyperlegible Next\\\", cursive\",\n \"font-note\": \"Caveat, Kalam, cursive\",\n \"font-mono\": \"\\\"Atkinson Hyperlegible Mono\\\", ui-monospace, \\\"SF Mono\\\", Menlo, monospace\",\n \"canvas\": \"#f4f2ee\",\n \"surface\": \"#ffffff\",\n \"surface-sunken\": \"#f0ece5\",\n \"surface-overlay\": \"#ffffff\",\n \"line\": \"#e4dfd6\",\n \"line-strong\": \"#7a7f94\",\n \"ink\": \"#182140\",\n \"ink-muted\": \"#4f5671\",\n \"ink-subtle\": \"#5f647c\",\n \"action\": \"#182140\",\n \"on-action\": \"#ffffff\",\n \"focus\": \"#325e8c\",\n \"link\": \"#2f5a87\",\n \"selection\": \"rgba(18, 199, 211, 0.28)\",\n \"node-ink\": \"#182140\",\n \"edge\": \"#5a6079\",\n \"edge-label\": \"#5a6079\",\n \"topic-teal\": \"#bce8ea\",\n \"topic-teal-ring\": \"#67c6cb\",\n \"topic-harbor\": \"#c9d9ec\",\n \"topic-harbor-ring\": \"#8bb2de\",\n \"topic-iris\": \"#d9cfe8\",\n \"topic-iris-ring\": \"#b79ed4\",\n \"topic-berry\": \"#edc6c9\",\n \"topic-berry-ring\": \"#da9099\",\n \"topic-coral\": \"#eecec1\",\n \"topic-coral-ring\": \"#db9b82\",\n \"topic-amber\": \"#eed4ba\",\n \"topic-amber-ring\": \"#d6a570\",\n \"topic-sun\": \"#f4eac1\",\n \"topic-sun-ring\": \"#d2bf73\",\n \"topic-stone\": \"#dddad5\",\n \"topic-stone-ring\": \"#bab09f\",\n \"space-1\": \"4px\",\n \"space-2\": \"8px\",\n \"space-3\": \"12px\",\n \"space-4\": \"16px\",\n \"space-7\": \"48px\",\n \"radius-sm\": \"10px\",\n \"radius-md\": \"16px\",\n \"radius-lg\": \"24px\",\n \"radius-pill\": \"999px\",\n \"shadow-float\": \"0 1px 2px rgba(24, 33, 64, 0.06), 0 8px 24px rgba(24, 33, 64, 0.08)\",\n \"shadow-pop\": \"0 2px 4px rgba(24, 33, 64, 0.08), 0 16px 40px rgba(24, 33, 64, 0.14)\",\n \"node-width\": \"200px\",\n \"node-height\": \"148px\",\n \"node-stroke\": \"3px\",\n \"edge-width\": \"2.5px\",\n \"edge-gap\": \"15px\",\n \"edge-arc-max\": \"45px\",\n \"immersion-alpha\": \"0.15\",\n \"zoom-min\": \"0.3\",\n \"zoom-max\": \"5\",\n \"duration-instant\": \"100ms\",\n \"duration-quick\": \"160ms\",\n \"duration-base\": \"240ms\",\n \"duration-zoom\": \"500ms\",\n \"duration-reveal\": \"420ms\",\n \"stagger-reveal\": \"70ms\",\n \"ease-zoom\": \"cubic-bezier(0.2, 0.8, 0.2, 1)\",\n \"ease-standard\": \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"ease-bloom\": \"cubic-bezier(0.34, 1.4, 0.64, 1)\",\n \"z-chrome\": \"10\",\n \"z-card\": \"20\",\n \"z-menu\": \"40\"\n },\n \"focus-dark\": {\n \"font-display\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, sans-serif\",\n \"font-ui\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, -apple-system, \\\"Segoe UI\\\", sans-serif\",\n \"font-hand\": \"Kalam, \\\"Atkinson Hyperlegible Next\\\", cursive\",\n \"font-note\": \"Caveat, Kalam, cursive\",\n \"font-mono\": \"\\\"Atkinson Hyperlegible Mono\\\", ui-monospace, \\\"SF Mono\\\", Menlo, monospace\",\n \"canvas\": \"#12141c\",\n \"surface\": \"#171b2b\",\n \"surface-sunken\": \"#0f1220\",\n \"surface-overlay\": \"#212639\",\n \"line\": \"#2b3148\",\n \"line-strong\": \"#6c7392\",\n \"ink\": \"#eef0f7\",\n \"ink-muted\": \"#b3b8cc\",\n \"ink-subtle\": \"#8f95ae\",\n \"action\": \"#f6f3ee\",\n \"on-action\": \"#182140\",\n \"focus\": \"#12c7d3\",\n \"link\": \"#5fd8e1\",\n \"selection\": \"rgba(18, 199, 211, 0.32)\",\n \"node-ink\": \"#182140\",\n \"edge\": \"#a9aec0\",\n \"edge-label\": \"#b3b8cc\",\n \"topic-teal\": \"#bce8ea\",\n \"topic-teal-ring\": \"#71bdc1\",\n \"topic-harbor\": \"#c9d9ec\",\n \"topic-harbor-ring\": \"#8cabce\",\n \"topic-iris\": \"#d9cfe8\",\n \"topic-iris-ring\": \"#ae9bc6\",\n \"topic-berry\": \"#edc6c9\",\n \"topic-berry-ring\": \"#cc8e95\",\n \"topic-coral\": \"#eecec1\",\n \"topic-coral-ring\": \"#cd9884\",\n \"topic-amber\": \"#eed4ba\",\n \"topic-amber-ring\": \"#c9a176\",\n \"topic-sun\": \"#f4eac1\",\n \"topic-sun-ring\": \"#c9b97a\",\n \"topic-stone\": \"#dddad5\",\n \"topic-stone-ring\": \"#b4a999\",\n \"space-1\": \"4px\",\n \"space-2\": \"8px\",\n \"space-3\": \"12px\",\n \"space-4\": \"16px\",\n \"space-7\": \"48px\",\n \"radius-sm\": \"10px\",\n \"radius-md\": \"16px\",\n \"radius-lg\": \"24px\",\n \"radius-pill\": \"999px\",\n \"shadow-float\": \"0 1px 2px rgba(24, 33, 64, 0.06), 0 8px 24px rgba(24, 33, 64, 0.08)\",\n \"shadow-pop\": \"0 2px 4px rgba(24, 33, 64, 0.08), 0 16px 40px rgba(24, 33, 64, 0.14)\",\n \"node-width\": \"200px\",\n \"node-height\": \"148px\",\n \"node-stroke\": \"3px\",\n \"edge-width\": \"2.5px\",\n \"edge-gap\": \"15px\",\n \"edge-arc-max\": \"45px\",\n \"immersion-alpha\": \"0.15\",\n \"zoom-min\": \"0.3\",\n \"zoom-max\": \"5\",\n \"duration-instant\": \"100ms\",\n \"duration-quick\": \"160ms\",\n \"duration-base\": \"240ms\",\n \"duration-zoom\": \"500ms\",\n \"duration-reveal\": \"420ms\",\n \"stagger-reveal\": \"70ms\",\n \"ease-zoom\": \"cubic-bezier(0.2, 0.8, 0.2, 1)\",\n \"ease-standard\": \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"ease-bloom\": \"cubic-bezier(0.34, 1.4, 0.64, 1)\",\n \"z-chrome\": \"10\",\n \"z-card\": \"20\",\n \"z-menu\": \"40\"\n },\n \"colorsafe-light\": {\n \"font-display\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, sans-serif\",\n \"font-ui\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, -apple-system, \\\"Segoe UI\\\", sans-serif\",\n \"font-hand\": \"Kalam, \\\"Atkinson Hyperlegible Next\\\", cursive\",\n \"font-note\": \"Caveat, Kalam, cursive\",\n \"font-mono\": \"\\\"Atkinson Hyperlegible Mono\\\", ui-monospace, \\\"SF Mono\\\", Menlo, monospace\",\n \"canvas\": \"#f6f3ee\",\n \"surface\": \"#ffffff\",\n \"surface-sunken\": \"#f0ece5\",\n \"surface-overlay\": \"#ffffff\",\n \"line\": \"#e4dfd6\",\n \"line-strong\": \"#7a7f94\",\n \"ink\": \"#182140\",\n \"ink-muted\": \"#4f5671\",\n \"ink-subtle\": \"#5f647c\",\n \"action\": \"#182140\",\n \"on-action\": \"#ffffff\",\n \"focus\": \"#325e8c\",\n \"link\": \"#2f5a87\",\n \"selection\": \"rgba(18, 199, 211, 0.28)\",\n \"node-ink\": \"#182140\",\n \"edge\": \"#2a3048\",\n \"edge-label\": \"#4f5671\",\n \"topic-teal\": \"#b0ecbc\",\n \"topic-teal-ring\": \"#6cc982\",\n \"topic-harbor\": \"#abdbfe\",\n \"topic-harbor-ring\": \"#60b4ec\",\n \"topic-iris\": \"#f6bde2\",\n \"topic-iris-ring\": \"#dc87c0\",\n \"topic-berry\": \"#feb79e\",\n \"topic-berry-ring\": \"#ec7f58\",\n \"topic-coral\": \"#fece96\",\n \"topic-coral-ring\": \"#e49d41\",\n \"topic-amber\": \"#b2e8fa\",\n \"topic-amber-ring\": \"#5cc4e2\",\n \"topic-sun\": \"#f6f097\",\n \"topic-sun-ring\": \"#d0c637\",\n \"topic-stone\": \"#dbdbdb\",\n \"topic-stone-ring\": \"#b7afb1\",\n \"space-1\": \"4px\",\n \"space-2\": \"8px\",\n \"space-3\": \"12px\",\n \"space-4\": \"16px\",\n \"space-7\": \"48px\",\n \"radius-sm\": \"10px\",\n \"radius-md\": \"16px\",\n \"radius-lg\": \"24px\",\n \"radius-pill\": \"999px\",\n \"shadow-float\": \"0 1px 2px rgba(24, 33, 64, 0.06), 0 8px 24px rgba(24, 33, 64, 0.08)\",\n \"shadow-pop\": \"0 2px 4px rgba(24, 33, 64, 0.08), 0 16px 40px rgba(24, 33, 64, 0.14)\",\n \"node-width\": \"200px\",\n \"node-height\": \"148px\",\n \"node-stroke\": \"3px\",\n \"edge-width\": \"2.5px\",\n \"edge-gap\": \"15px\",\n \"edge-arc-max\": \"45px\",\n \"immersion-alpha\": \"0.15\",\n \"zoom-min\": \"0.3\",\n \"zoom-max\": \"5\",\n \"duration-instant\": \"100ms\",\n \"duration-quick\": \"160ms\",\n \"duration-base\": \"240ms\",\n \"duration-zoom\": \"500ms\",\n \"duration-reveal\": \"420ms\",\n \"stagger-reveal\": \"70ms\",\n \"ease-zoom\": \"cubic-bezier(0.2, 0.8, 0.2, 1)\",\n \"ease-standard\": \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"ease-bloom\": \"cubic-bezier(0.34, 1.4, 0.64, 1)\",\n \"z-chrome\": \"10\",\n \"z-card\": \"20\",\n \"z-menu\": \"40\"\n },\n \"colorsafe-dark\": {\n \"font-display\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, sans-serif\",\n \"font-ui\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, -apple-system, \\\"Segoe UI\\\", sans-serif\",\n \"font-hand\": \"Kalam, \\\"Atkinson Hyperlegible Next\\\", cursive\",\n \"font-note\": \"Caveat, Kalam, cursive\",\n \"font-mono\": \"\\\"Atkinson Hyperlegible Mono\\\", ui-monospace, \\\"SF Mono\\\", Menlo, monospace\",\n \"canvas\": \"#0f1220\",\n \"surface\": \"#171b2b\",\n \"surface-sunken\": \"#0f1220\",\n \"surface-overlay\": \"#212639\",\n \"line\": \"#2b3148\",\n \"line-strong\": \"#6c7392\",\n \"ink\": \"#eef0f7\",\n \"ink-muted\": \"#b3b8cc\",\n \"ink-subtle\": \"#8f95ae\",\n \"action\": \"#f6f3ee\",\n \"on-action\": \"#182140\",\n \"focus\": \"#12c7d3\",\n \"link\": \"#5fd8e1\",\n \"selection\": \"rgba(18, 199, 211, 0.32)\",\n \"node-ink\": \"#182140\",\n \"edge\": \"#c9cddc\",\n \"edge-label\": \"#b3b8cc\",\n \"topic-teal\": \"#b0ecbc\",\n \"topic-teal-ring\": \"#69c27e\",\n \"topic-harbor\": \"#abdbfe\",\n \"topic-harbor-ring\": \"#5eade2\",\n \"topic-iris\": \"#f6bde2\",\n \"topic-iris-ring\": \"#d383b9\",\n \"topic-berry\": \"#feb79e\",\n \"topic-berry-ring\": \"#e37a55\",\n \"topic-coral\": \"#fece96\",\n \"topic-coral-ring\": \"#db9840\",\n \"topic-amber\": \"#b2e8fa\",\n \"topic-amber-ring\": \"#5bbdda\",\n \"topic-sun\": \"#f6f097\",\n \"topic-sun-ring\": \"#c9bf37\",\n \"topic-stone\": \"#dbdbdb\",\n \"topic-stone-ring\": \"#b1a8aa\",\n \"space-1\": \"4px\",\n \"space-2\": \"8px\",\n \"space-3\": \"12px\",\n \"space-4\": \"16px\",\n \"space-7\": \"48px\",\n \"radius-sm\": \"10px\",\n \"radius-md\": \"16px\",\n \"radius-lg\": \"24px\",\n \"radius-pill\": \"999px\",\n \"shadow-float\": \"0 1px 2px rgba(24, 33, 64, 0.06), 0 8px 24px rgba(24, 33, 64, 0.08)\",\n \"shadow-pop\": \"0 2px 4px rgba(24, 33, 64, 0.08), 0 16px 40px rgba(24, 33, 64, 0.14)\",\n \"node-width\": \"200px\",\n \"node-height\": \"148px\",\n \"node-stroke\": \"3px\",\n \"edge-width\": \"2.5px\",\n \"edge-gap\": \"15px\",\n \"edge-arc-max\": \"45px\",\n \"immersion-alpha\": \"0.15\",\n \"zoom-min\": \"0.3\",\n \"zoom-max\": \"5\",\n \"duration-instant\": \"100ms\",\n \"duration-quick\": \"160ms\",\n \"duration-base\": \"240ms\",\n \"duration-zoom\": \"500ms\",\n \"duration-reveal\": \"420ms\",\n \"stagger-reveal\": \"70ms\",\n \"ease-zoom\": \"cubic-bezier(0.2, 0.8, 0.2, 1)\",\n \"ease-standard\": \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"ease-bloom\": \"cubic-bezier(0.34, 1.4, 0.64, 1)\",\n \"z-chrome\": \"10\",\n \"z-card\": \"20\",\n \"z-menu\": \"40\"\n },\n \"contrast-light\": {\n \"font-display\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, sans-serif\",\n \"font-ui\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, -apple-system, \\\"Segoe UI\\\", sans-serif\",\n \"font-hand\": \"Kalam, \\\"Atkinson Hyperlegible Next\\\", cursive\",\n \"font-note\": \"Caveat, Kalam, cursive\",\n \"font-mono\": \"\\\"Atkinson Hyperlegible Mono\\\", ui-monospace, \\\"SF Mono\\\", Menlo, monospace\",\n \"canvas\": \"#ffffff\",\n \"surface\": \"#ffffff\",\n \"surface-sunken\": \"#f2f2f2\",\n \"surface-overlay\": \"#ffffff\",\n \"line\": \"#5c6178\",\n \"line-strong\": \"#000000\",\n \"ink\": \"#000000\",\n \"ink-muted\": \"#1f2433\",\n \"ink-subtle\": \"#3a3f52\",\n \"action\": \"#000000\",\n \"on-action\": \"#ffffff\",\n \"focus\": \"#0b4a8f\",\n \"link\": \"#0b4a8f\",\n \"selection\": \"rgba(18, 199, 211, 0.28)\",\n \"node-ink\": \"#000000\",\n \"edge\": \"#000000\",\n \"edge-label\": \"#1f2433\",\n \"topic-teal\": \"#87f2f8\",\n \"topic-teal-ring\": \"#006b70\",\n \"topic-harbor\": \"#bcdbff\",\n \"topic-harbor-ring\": \"#0e599d\",\n \"topic-iris\": \"#e0c8fe\",\n \"topic-iris-ring\": \"#683b92\",\n \"topic-berry\": \"#ffbdc4\",\n \"topic-berry-ring\": \"#96173a\",\n \"topic-coral\": \"#ffc7b2\",\n \"topic-coral-ring\": \"#923400\",\n \"topic-amber\": \"#ffcf9d\",\n \"topic-amber-ring\": \"#7e4d00\",\n \"topic-sun\": \"#ffea94\",\n \"topic-sun-ring\": \"#7a6600\",\n \"topic-stone\": \"#e0dacf\",\n \"topic-stone-ring\": \"#63594b\",\n \"space-1\": \"4px\",\n \"space-2\": \"8px\",\n \"space-3\": \"12px\",\n \"space-4\": \"16px\",\n \"space-7\": \"48px\",\n \"radius-sm\": \"10px\",\n \"radius-md\": \"16px\",\n \"radius-lg\": \"24px\",\n \"radius-pill\": \"999px\",\n \"shadow-float\": \"none\",\n \"shadow-pop\": \"none\",\n \"node-width\": \"200px\",\n \"node-height\": \"148px\",\n \"node-stroke\": \"3px\",\n \"edge-width\": \"2.5px\",\n \"edge-gap\": \"15px\",\n \"edge-arc-max\": \"45px\",\n \"immersion-alpha\": \"0.15\",\n \"zoom-min\": \"0.3\",\n \"zoom-max\": \"5\",\n \"duration-instant\": \"100ms\",\n \"duration-quick\": \"160ms\",\n \"duration-base\": \"240ms\",\n \"duration-zoom\": \"500ms\",\n \"duration-reveal\": \"420ms\",\n \"stagger-reveal\": \"70ms\",\n \"ease-zoom\": \"cubic-bezier(0.2, 0.8, 0.2, 1)\",\n \"ease-standard\": \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"ease-bloom\": \"cubic-bezier(0.34, 1.4, 0.64, 1)\",\n \"z-chrome\": \"10\",\n \"z-card\": \"20\",\n \"z-menu\": \"40\"\n },\n \"contrast-dark\": {\n \"font-display\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, sans-serif\",\n \"font-ui\": \"\\\"Atkinson Hyperlegible Next\\\", system-ui, -apple-system, \\\"Segoe UI\\\", sans-serif\",\n \"font-hand\": \"Kalam, \\\"Atkinson Hyperlegible Next\\\", cursive\",\n \"font-note\": \"Caveat, Kalam, cursive\",\n \"font-mono\": \"\\\"Atkinson Hyperlegible Mono\\\", ui-monospace, \\\"SF Mono\\\", Menlo, monospace\",\n \"canvas\": \"#000000\",\n \"surface\": \"#000000\",\n \"surface-sunken\": \"#0d0d0d\",\n \"surface-overlay\": \"#0d0d0d\",\n \"line\": \"#9aa0b8\",\n \"line-strong\": \"#ffffff\",\n \"ink\": \"#ffffff\",\n \"ink-muted\": \"#e6e8f0\",\n \"ink-subtle\": \"#c8ccda\",\n \"action\": \"#ffffff\",\n \"on-action\": \"#000000\",\n \"focus\": \"#5fe8f0\",\n \"link\": \"#7ff0f5\",\n \"selection\": \"rgba(18, 199, 211, 0.32)\",\n \"node-ink\": \"#000000\",\n \"edge\": \"#ffffff\",\n \"edge-label\": \"#e6e8f0\",\n \"topic-teal\": \"#87f2f8\",\n \"topic-teal-ring\": \"#64eff7\",\n \"topic-harbor\": \"#bcdbff\",\n \"topic-harbor-ring\": \"#b0d5fe\",\n \"topic-iris\": \"#e0c8fe\",\n \"topic-iris-ring\": \"#dcbfff\",\n \"topic-berry\": \"#ffbdc4\",\n \"topic-berry-ring\": \"#feb3bb\",\n \"topic-coral\": \"#ffc7b2\",\n \"topic-coral-ring\": \"#ffbea5\",\n \"topic-amber\": \"#ffcf9d\",\n \"topic-amber-ring\": \"#ffc78a\",\n \"topic-sun\": \"#ffea94\",\n \"topic-sun-ring\": \"#ffe26d\",\n \"topic-stone\": \"#e0dacf\",\n \"topic-stone-ring\": \"#ddd3c2\",\n \"space-1\": \"4px\",\n \"space-2\": \"8px\",\n \"space-3\": \"12px\",\n \"space-4\": \"16px\",\n \"space-7\": \"48px\",\n \"radius-sm\": \"10px\",\n \"radius-md\": \"16px\",\n \"radius-lg\": \"24px\",\n \"radius-pill\": \"999px\",\n \"shadow-float\": \"none\",\n \"shadow-pop\": \"none\",\n \"node-width\": \"200px\",\n \"node-height\": \"148px\",\n \"node-stroke\": \"3px\",\n \"edge-width\": \"2.5px\",\n \"edge-gap\": \"15px\",\n \"edge-arc-max\": \"45px\",\n \"immersion-alpha\": \"0.15\",\n \"zoom-min\": \"0.3\",\n \"zoom-max\": \"5\",\n \"duration-instant\": \"100ms\",\n \"duration-quick\": \"160ms\",\n \"duration-base\": \"240ms\",\n \"duration-zoom\": \"500ms\",\n \"duration-reveal\": \"420ms\",\n \"stagger-reveal\": \"70ms\",\n \"ease-zoom\": \"cubic-bezier(0.2, 0.8, 0.2, 1)\",\n \"ease-standard\": \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"ease-bloom\": \"cubic-bezier(0.34, 1.4, 0.64, 1)\",\n \"z-chrome\": \"10\",\n \"z-card\": \"20\",\n \"z-menu\": \"40\"\n }\n};\n\n/** Topic palette names (token pairs `topic-<name>` / `topic-<name>-ring`). */\nexport const TOPICS = [\n \"teal\",\n \"harbor\",\n \"iris\",\n \"berry\",\n \"coral\",\n \"amber\",\n \"sun\",\n \"stone\"\n] as const;\nexport type TopicName = (typeof TOPICS)[number];\n\n/** Numeric tokens (px / ms stripped), camel-cased: nodeWidth, nodeStroke, edgeWidth, edgeGap, durationBase, zoomMin ... */\nexport const METRICS = {\n \"space1\": 4,\n \"space2\": 8,\n \"space3\": 12,\n \"space4\": 16,\n \"space7\": 48,\n \"radiusSm\": 10,\n \"radiusMd\": 16,\n \"radiusLg\": 24,\n \"radiusPill\": 999,\n \"nodeWidth\": 200,\n \"nodeHeight\": 148,\n \"nodeStroke\": 3,\n \"edgeWidth\": 2.5,\n \"edgeGap\": 15,\n \"edgeArcMax\": 45,\n \"immersionAlpha\": 0.15,\n \"zoomMin\": 0.3,\n \"zoomMax\": 5,\n \"durationInstant\": 100,\n \"durationQuick\": 160,\n \"durationBase\": 240,\n \"durationZoom\": 500,\n \"durationReveal\": 420,\n \"staggerReveal\": 70,\n \"zChrome\": 10,\n \"zCard\": 20,\n \"zMenu\": 40\n} as const;\n/** Overrides applied when motion is reduced. */\nexport const METRICS_REDUCED_MOTION = {\n \"durationInstant\": 120,\n \"durationQuick\": 0,\n \"durationBase\": 0,\n \"durationZoom\": 0,\n \"durationReveal\": 0,\n \"staggerReveal\": 0\n} as const;\n\n/** Canvas type styles (family is a token name: font-hand, font-note, font-ui ...). */\nexport const TYPE_STYLES = {\n \"heading\": {\n \"family\": \"font-ui\",\n \"size\": 17,\n \"lineHeight\": 24,\n \"weight\": 700\n },\n \"body\": {\n \"family\": \"font-ui\",\n \"size\": 15,\n \"lineHeight\": 22,\n \"weight\": 400\n },\n \"body-sm\": {\n \"family\": \"font-ui\",\n \"size\": 13,\n \"lineHeight\": 18,\n \"weight\": 400\n },\n \"label\": {\n \"family\": \"font-ui\",\n \"size\": 13,\n \"lineHeight\": 16,\n \"weight\": 600,\n \"letterSpacing\": 0.01\n },\n \"caption\": {\n \"family\": \"font-ui\",\n \"size\": 12,\n \"lineHeight\": 16,\n \"weight\": 400\n },\n \"node-root\": {\n \"family\": \"font-hand\",\n \"size\": 30,\n \"lineHeight\": 34,\n \"weight\": 700\n },\n \"node-label\": {\n \"family\": \"font-hand\",\n \"size\": 22,\n \"lineHeight\": 26,\n \"weight\": 700\n },\n \"edge-label\": {\n \"family\": \"font-note\",\n \"size\": 18,\n \"lineHeight\": 20,\n \"weight\": 500\n },\n \"annotation\": {\n \"family\": \"font-note\",\n \"size\": 24,\n \"lineHeight\": 26,\n \"weight\": 600\n }\n} as const;\n\n/** Canvas styling extracted from css/spec.css (node labels, hover, shadows, connector dashes, group frames). */\nexport const CANVAS_STYLE = {\n \"node\": {\n \"selectedStrokeWidth\": 4,\n \"hoverRingsRotate\": -2,\n \"hoverRingsScale\": 1.015,\n \"hoverLift\": -2,\n \"dimmedOpacity\": 1,\n \"dimmedOpacityFocus\": 0.4,\n \"dimmedOpacityTouch\": 0.6,\n \"dimmedOpacityFocusTouch\": 0.4,\n \"shadowLight\": \"0 6px 14px rgba(24, 33, 64, .10)\",\n \"shadowDark\": \"0 0 22px rgba(255, 255, 255, .10)\"\n },\n \"edge\": {\n \"dash\": [\n 7,\n 7\n ],\n \"labelWeight\": 500,\n \"labelSize\": 18,\n \"readableLabelSize\": 14,\n \"readableLabelWeight\": 600,\n \"labelHaloWidth\": 5\n },\n \"group\": {\n \"strokeWidth\": 1.5,\n \"dash\": [\n 10,\n 6\n ],\n \"labelWeight\": 700,\n \"labelLineHeight\": 1.1,\n \"labelSize\": 26,\n \"labelPadding\": {\n \"top\": 6,\n \"x\": 22,\n \"bottom\": 8\n },\n \"labelMaxWidth\": 420,\n \"labelBorderWidth\": 1.5,\n \"labelFill\": \"topic-stone\",\n \"labelBorder\": \"topic-stone-ring\",\n \"labelInk\": \"node-ink\",\n \"contrastLabelBorderWidth\": 2,\n \"contrastLabelBorder\": \"line-strong\"\n }\n} as const;\n","// Generated from visualli.ai design-system/components/src/color.ts — do not edit here.\n/* Which topic an idea is drawn in. A `.visualli` file's `data.color` may name one of the eight topics or be any\n other color, or be missing. Every renderer resolves it with this rule, so a file looks the same everywhere:\n a topic name ('teal', 'Harbor ') → that topic (case and surrounding spaces don't matter);\n no color → the topics in order, by the idea's position among its siblings (so siblings differ);\n anything else (e.g. '#b7e7f3') → null: not a topic — drawn as given (customColor): the color as the fill, and\n the fill darkened (CUSTOM.ringShade) as the ring; a custom color doesn't follow themes.\n No dependencies, so it can travel alone. */\n\n/** The eight topics, in the order missing colors cycle through. */\nexport const TOPIC_ORDER = ['teal', 'harbor', 'iris', 'berry', 'coral', 'amber', 'sun', 'stone'] as const;\nexport type TopicName = (typeof TOPIC_ORDER)[number];\n\n/** The topic a color names, or null. */\nexport function topicFromName(color: string | null | undefined): TopicName | null {\n if (!color) return null;\n const c = color.trim().toLowerCase();\n return (TOPIC_ORDER as readonly string[]).includes(c) ? (c as TopicName) : null;\n}\n\n/** The topic for an idea: its named topic; with no color, the next topic in sibling order; null for any other color. */\nexport function topicFor(color: string | null | undefined, siblingIndex: number): TopicName | null {\n if (!color || !color.trim()) return TOPIC_ORDER[((siblingIndex % TOPIC_ORDER.length) + TOPIC_ORDER.length) % TOPIC_ORDER.length];\n return topicFromName(color);\n}\n\n/** A custom (non-topic) color: drawn as given, with a darker ring. */\nexport const CUSTOM = { /** The ring is the fill with each RGB channel multiplied by this. */ ringShade: 0.78 } as const;\n\n/** Fill and ring for a custom color. `ring` is null when the color isn't a 6-digit hex (use the `edge` token then). */\nexport function customColor(color: string): { fill: string; ring: string | null } {\n const m = /^#?([0-9a-f]{6})$/i.exec((color || '').trim());\n if (!m) return { fill: color, ring: null };\n const n = parseInt(m[1], 16), f = CUSTOM.ringShade;\n const r = Math.round(((n >> 16) & 255) * f), g = Math.round(((n >> 8) & 255) * f), b = Math.round((n & 255) * f);\n return { fill: color.trim(), ring: '#' + ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).slice(1) };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,wBAAwB;AAE9B,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,IAAM,SAAwE;AAAA,EACnF,SAAS;AAAA,IACP,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,IACV,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,mBAAmB;AAAA,IACnB,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,OAAO;AAAA,IACP,aAAa;AAAA,IACb,cAAc;AAAA,IACd,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAChB,qBAAqB;AAAA,IACrB,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,aAAa;AAAA,IACb,kBAAkB;AAAA,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MAAM,EAAG;AAC1F,SAAO,WAAW,OAAO,EAAE,SAAS,YAAY,CAAC,CAAC;AACpD;","names":[]}
@@ -0,0 +1,2 @@
1
+ export { C as CANVAS_STYLE, D as DESIGN_SYSTEM_VERSION, M as METRICS, b as METRICS_REDUCED_MOTION, c as THEME_NAMES, d as TOKENS, e as TOPICS, f as TYPE_STYLES, a as ThemeName, T as TopicName } from '../designSystem-BOrZHfEq.cjs';
2
+ export { a as Comfort, I as IdeaColor, M as Metrics, R as ResolvedComfort, b as ThemeEnv, c as ThemeFamily, d as ThemeInput, e as TopicStyle, f as customColor, g as getTokens, i as ideaColor, h as ideaStyle, j as isContrastTheme, k as isDarkTheme, l as isFocusTheme, m as isThemeName, n as labelScale, o as metricsFor, r as resolveComfort, p as resolveTheme, t as token, s as topicFromName, u as topicStyle } from '../index-BmILeKj6.cjs';
@@ -0,0 +1,2 @@
1
+ export { C as CANVAS_STYLE, D as DESIGN_SYSTEM_VERSION, M as METRICS, b as METRICS_REDUCED_MOTION, c as THEME_NAMES, d as TOKENS, e as TOPICS, f as TYPE_STYLES, a as ThemeName, T as TopicName } from '../designSystem-BOrZHfEq.js';
2
+ export { a as Comfort, I as IdeaColor, M as Metrics, R as ResolvedComfort, b as ThemeEnv, c as ThemeFamily, d as ThemeInput, e as TopicStyle, f as customColor, g as getTokens, i as ideaColor, h as ideaStyle, j as isContrastTheme, k as isDarkTheme, l as isFocusTheme, m as isThemeName, n as labelScale, o as metricsFor, r as resolveComfort, p as resolveTheme, t as token, s as topicFromName, u as topicStyle } from '../index-CcPRwVUL.js';
@@ -0,0 +1,53 @@
1
+ import {
2
+ customColor,
3
+ getTokens,
4
+ ideaColor,
5
+ ideaStyle,
6
+ isContrastTheme,
7
+ isDarkTheme,
8
+ isFocusTheme,
9
+ isThemeName,
10
+ labelScale,
11
+ metricsFor,
12
+ resolveComfort,
13
+ resolveTheme,
14
+ token,
15
+ topicFromName,
16
+ topicStyle
17
+ } from "../chunk-KVSM3APM.js";
18
+ import {
19
+ CANVAS_STYLE,
20
+ DESIGN_SYSTEM_VERSION,
21
+ METRICS,
22
+ METRICS_REDUCED_MOTION,
23
+ THEME_NAMES,
24
+ TOKENS,
25
+ TOPICS,
26
+ TYPE_STYLES
27
+ } from "../chunk-LV3EXUQY.js";
28
+ export {
29
+ CANVAS_STYLE,
30
+ DESIGN_SYSTEM_VERSION,
31
+ METRICS,
32
+ METRICS_REDUCED_MOTION,
33
+ THEME_NAMES,
34
+ TOKENS,
35
+ TOPICS,
36
+ TYPE_STYLES,
37
+ customColor,
38
+ getTokens,
39
+ ideaColor,
40
+ ideaStyle,
41
+ isContrastTheme,
42
+ isDarkTheme,
43
+ isFocusTheme,
44
+ isThemeName,
45
+ labelScale,
46
+ metricsFor,
47
+ resolveComfort,
48
+ resolveTheme,
49
+ token,
50
+ topicFromName,
51
+ topicStyle
52
+ };
53
+ //# sourceMappingURL=index.js.map
@@ -1,7 +1,9 @@
1
- export { F as FlatNode, a as MindMapConfig, M as MindMapConnection, b as MindMapData, c as MindMapNode, d as NodeMap, N as NodeSelection, R as RenderConfig, S as SpatialBounds, T as TopLevelConnection, V as ViewportState } from '../mindmap-DWS0WZT_.cjs';
2
- export { L as LayerConnection, b as LayerContainer, c as LayerNode, V as VisualliDocument, a as VisualliLayer, d as VisualliMeta, e as VisualliRenderConnection, f as VisualliRenderNode } from '../document-B3hnNr-F.cjs';
1
+ export { F as FlatNode, b as MindMapConfig, M as MindMapConnection, c as MindMapData, d as MindMapNode, e as NodeMap, N as NodeSelection, R as RenderConfig, S as SpatialBounds, T as TopLevelConnection, V as ViewportState } from '../mindmap-C3Qr0qKW.cjs';
2
+ export { S as SemanticAnchor, V as VisualliDocument, a as VisualliMeta } from '../document-MEJEfxl3.cjs';
3
+ export { L as LayerConnection, a as LayerContainer, b as LayerNode, V as VisualliLayer, c as VisualliRenderConnection, d as VisualliRenderNode } from '../layer-B2A3Ki48.cjs';
3
4
  import { Meta, Layer } from '@visualli/bindings';
4
5
  export { Connection, Container, Extension, Layer, Meta, Node } from '@visualli/bindings';
6
+ import '../designSystem-BOrZHfEq.cjs';
5
7
 
6
8
  type VisualliFragment = Meta | Layer;
7
9
 
@@ -1,7 +1,9 @@
1
- export { F as FlatNode, a as MindMapConfig, M as MindMapConnection, b as MindMapData, c as MindMapNode, d as NodeMap, N as NodeSelection, R as RenderConfig, S as SpatialBounds, T as TopLevelConnection, V as ViewportState } from '../mindmap-DWS0WZT_.js';
2
- export { L as LayerConnection, b as LayerContainer, c as LayerNode, V as VisualliDocument, a as VisualliLayer, d as VisualliMeta, e as VisualliRenderConnection, f as VisualliRenderNode } from '../document-B3hnNr-F.js';
1
+ export { F as FlatNode, b as MindMapConfig, M as MindMapConnection, c as MindMapData, d as MindMapNode, e as NodeMap, N as NodeSelection, R as RenderConfig, S as SpatialBounds, T as TopLevelConnection, V as ViewportState } from '../mindmap-DHeVa86G.js';
2
+ export { S as SemanticAnchor, V as VisualliDocument, a as VisualliMeta } from '../document-BFBwn93X.js';
3
+ export { L as LayerConnection, a as LayerContainer, b as LayerNode, V as VisualliLayer, c as VisualliRenderConnection, d as VisualliRenderNode } from '../layer-B2A3Ki48.js';
3
4
  import { Meta, Layer } from '@visualli/bindings';
4
5
  export { Connection, Container, Extension, Layer, Meta, Node } from '@visualli/bindings';
6
+ import '../designSystem-BOrZHfEq.js';
5
7
 
6
8
  type VisualliFragment = Meta | Layer;
7
9
 
@@ -33,12 +33,23 @@ __export(viewport_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(viewport_exports);
35
35
 
36
+ // src/generated/geometry/interaction.ts
37
+ var VIEW = {
38
+ /** Each zoom step multiplies or divides the zoom by this. */
39
+ zoomStep: 1.2,
40
+ /** Zoom limits (the zoom-min / zoom-max tokens; the build checks they agree). */
41
+ zoomMin: 0.3,
42
+ zoomMax: 5,
43
+ /** Fit to view never enlarges a layer beyond this. */
44
+ fitMax: 1.1
45
+ };
46
+
36
47
  // src/constants/performanceConstants.ts
37
48
  var FPS_TARGET = 60;
38
49
  var TARGET_FRAME_TIME = 1e3 / FPS_TARGET;
39
50
  var VIEWPORT_MARGIN = 0.1;
40
- var ZOOM_MIN = 0.05;
41
- var ZOOM_MAX = 5;
51
+ var ZOOM_MIN = VIEW.zoomMin;
52
+ var ZOOM_MAX = VIEW.zoomMax;
42
53
  var DEFAULT_CANVAS_WIDTH = 1920;
43
54
  var DEFAULT_CANVAS_HEIGHT = 1080;
44
55
 
@@ -73,8 +84,8 @@ function screenToWorld(screenX, screenY, viewport, canvasWidth = DEFAULT_CANVAS_
73
84
  y: (screenY - canvasHeight / 2) / viewport.zoomLevel + viewport.centerY
74
85
  };
75
86
  }
76
- function clampZoom(zoom) {
77
- return Math.min(ZOOM_MAX, Math.max(ZOOM_MIN, zoom));
87
+ function clampZoom(zoom, fit = 1) {
88
+ return Math.min(ZOOM_MAX * fit, Math.max(ZOOM_MIN * fit, zoom));
78
89
  }
79
90
  function panViewport(deltaX, deltaY, viewport) {
80
91
  return {
@@ -86,8 +97,8 @@ function panViewport(deltaX, deltaY, viewport) {
86
97
  function setViewportCenter(x, y, viewport) {
87
98
  return { ...viewport, centerX: x, centerY: y };
88
99
  }
89
- function zoomViewport(delta, viewport, pivotX, pivotY, canvasWidth = DEFAULT_CANVAS_WIDTH, canvasHeight = DEFAULT_CANVAS_HEIGHT) {
90
- const newZoom = clampZoom(viewport.zoomLevel * (1 + delta));
100
+ function zoomViewport(delta, viewport, pivotX, pivotY, canvasWidth = DEFAULT_CANVAS_WIDTH, canvasHeight = DEFAULT_CANVAS_HEIGHT, fit = 1) {
101
+ const newZoom = clampZoom(viewport.zoomLevel * (1 + delta), fit);
91
102
  let cx = viewport.centerX;
92
103
  let cy = viewport.centerY;
93
104
  if (pivotX !== void 0 && pivotY !== void 0) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/viewport/index.ts","../../src/constants/performanceConstants.ts","../../src/viewport/viewportUtils.ts"],"sourcesContent":["export * from './viewportUtils.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","// ─── Viewport Utilities ───────────────────────────────────────────────────────\n//\n// Pure functions for viewport bounds calculation, coordinate transforms,\n// pan/zoom operations, and node visibility queries.\n\nimport type { ViewportState } from '../types/mindmap.js';\nimport {\n VIEWPORT_MARGIN,\n DEFAULT_CANVAS_WIDTH,\n DEFAULT_CANVAS_HEIGHT,\n ZOOM_MIN,\n ZOOM_MAX,\n} from '../constants/performanceConstants.js';\n\n// ── Viewport Bounds ───────────────────────────────────────────────────────────\n\nexport interface WorldBounds {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n}\n\n/**\n * Calculate the visible world-space bounding box including a margin buffer.\n */\nexport function calculateViewportBounds(\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): WorldBounds {\n const worldW = canvasWidth / viewport.zoomLevel;\n const worldH = canvasHeight / viewport.zoomLevel;\n const mx = worldW * VIEWPORT_MARGIN;\n const my = worldH * VIEWPORT_MARGIN;\n return {\n minX: viewport.centerX - worldW / 2 - mx,\n minY: viewport.centerY - worldH / 2 - my,\n maxX: viewport.centerX + worldW / 2 + mx,\n maxY: viewport.centerY + worldH / 2 + my,\n };\n}\n\n/**\n * Return a new ViewportState with `visibleBounds` recalculated.\n */\nexport function recalculateViewportBounds(\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): ViewportState {\n return {\n ...viewport,\n visibleBounds: calculateViewportBounds(viewport, canvasWidth, canvasHeight),\n };\n}\n\n// ── Coordinate Transforms ─────────────────────────────────────────────────────\n\n/**\n * Convert world-space coordinates to screen-space pixel coordinates.\n */\nexport function worldToScreen(\n worldX: number,\n worldY: number,\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): { x: number; y: number } {\n return {\n x: (worldX - viewport.centerX) * viewport.zoomLevel + canvasWidth / 2,\n y: (worldY - viewport.centerY) * viewport.zoomLevel + canvasHeight / 2,\n };\n}\n\n/**\n * Convert screen-space pixel coordinates to world-space coordinates.\n */\nexport function screenToWorld(\n screenX: number,\n screenY: number,\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): { x: number; y: number } {\n return {\n x: (screenX - canvasWidth / 2) / viewport.zoomLevel + viewport.centerX,\n y: (screenY - canvasHeight / 2) / viewport.zoomLevel + viewport.centerY,\n };\n}\n\n// ── Pan / Zoom ────────────────────────────────────────────────────────────────\n\n/** Clamp zoom to [ZOOM_MIN, ZOOM_MAX]. */\nexport function clampZoom(zoom: number): number {\n return Math.min(ZOOM_MAX, Math.max(ZOOM_MIN, zoom));\n}\n\n/**\n * Pan the viewport by a screen-space delta (positive = right/down).\n */\nexport function panViewport(\n deltaX: number,\n deltaY: number,\n viewport: ViewportState,\n): ViewportState {\n return {\n ...viewport,\n centerX: viewport.centerX - deltaX / viewport.zoomLevel,\n centerY: viewport.centerY - deltaY / viewport.zoomLevel,\n };\n}\n\n/** Teleport the viewport centre to the given world coordinates. */\nexport function setViewportCenter(\n x: number,\n y: number,\n viewport: ViewportState,\n): ViewportState {\n return { ...viewport, centerX: x, centerY: y };\n}\n\n/**\n * Zoom the viewport by a multiplicative delta, optionally around a pivot point.\n *\n * @param delta - Multiplier delta, e.g. 0.1 for +10% zoom\n * @param pivotX - Optional screen-space X pivot\n * @param pivotY - Optional screen-space Y pivot\n */\nexport function zoomViewport(\n delta: number,\n viewport: ViewportState,\n pivotX?: number,\n pivotY?: number,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): ViewportState {\n const newZoom = clampZoom(viewport.zoomLevel * (1 + delta));\n\n let cx = viewport.centerX;\n let cy = viewport.centerY;\n\n if (pivotX !== undefined && pivotY !== undefined) {\n const worldPivot = screenToWorld(pivotX, pivotY, viewport, canvasWidth, canvasHeight);\n cx = worldPivot.x - (pivotX - canvasWidth / 2) / newZoom;\n cy = worldPivot.y - (pivotY - canvasHeight / 2) / newZoom;\n }\n\n return { ...viewport, centerX: cx, centerY: cy, zoomLevel: newZoom };\n}\n\n/**\n * Create a viewport centred on a node (world coordinates) at the given zoom level.\n */\nexport function focusOnNode(\n nodeX: number,\n nodeY: number,\n zoom: number,\n): ViewportState {\n const clamped = clampZoom(zoom);\n return {\n centerX: nodeX,\n centerY: nodeY,\n zoomLevel: clamped,\n rotation: 0,\n visibleBounds: calculateViewportBounds(\n { centerX: nodeX, centerY: nodeY, zoomLevel: clamped, rotation: 0, visibleBounds: { minX: 0, minY: 0, maxX: 0, maxY: 0 } },\n ),\n };\n}\n\n// ── Visibility ────────────────────────────────────────────────────────────────\n\n/**\n * Test whether a world-space AABB intersects the viewport's visible bounds.\n */\nexport function isNodeInViewport(\n nodeX: number,\n nodeY: number,\n nodeWidth: number,\n nodeHeight: number,\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): boolean {\n const bounds = calculateViewportBounds(viewport, canvasWidth, canvasHeight);\n const hw = nodeWidth / 2;\n const hh = nodeHeight / 2;\n return !(\n nodeX + hw < bounds.minX ||\n nodeX - hw > bounds.maxX ||\n nodeY + hh < bounds.minY ||\n nodeY - hh > bounds.maxY\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,aAA6B;AAGnC,IAAM,oBAA6B,MAAO;AAoC1C,IAAM,kBAA2B;AA8BjC,IAAM,WAAwB;AAC9B,IAAM,WAAwB;AAkD9B,IAAM,uBAAwB;AAC9B,IAAM,wBAAwB;;;ACnG9B,SAAS,wBACd,UACA,cAAe,sBACf,eAAe,uBACF;AACb,QAAM,SAAS,cAAe,SAAS;AACvC,QAAM,SAAS,eAAe,SAAS;AACvC,QAAM,KAAK,SAAS;AACpB,QAAM,KAAK,SAAS;AACpB,SAAO;AAAA,IACL,MAAM,SAAS,UAAU,SAAS,IAAI;AAAA,IACtC,MAAM,SAAS,UAAU,SAAS,IAAI;AAAA,IACtC,MAAM,SAAS,UAAU,SAAS,IAAI;AAAA,IACtC,MAAM,SAAS,UAAU,SAAS,IAAI;AAAA,EACxC;AACF;AAKO,SAAS,0BACd,UACA,cAAe,sBACf,eAAe,uBACA;AACf,SAAO;AAAA,IACL,GAAG;AAAA,IACH,eAAe,wBAAwB,UAAU,aAAa,YAAY;AAAA,EAC5E;AACF;AAOO,SAAS,cACd,QACA,QACA,UACA,cAAe,sBACf,eAAe,uBACW;AAC1B,SAAO;AAAA,IACL,IAAI,SAAS,SAAS,WAAW,SAAS,YAAY,cAAe;AAAA,IACrE,IAAI,SAAS,SAAS,WAAW,SAAS,YAAY,eAAe;AAAA,EACvE;AACF;AAKO,SAAS,cACd,SAC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AC3H;AAAA,EACF;AACF;AAOO,SAAS,iBACd,OACA,OACA,WACA,YACA,UACA,cAAe,sBACf,eAAe,uBACN;AACT,QAAM,SAAS,wBAAwB,UAAU,aAAa,YAAY;AAC1E,QAAM,KAAK,YAAa;AACxB,QAAM,KAAK,aAAa;AACxB,SAAO,EACL,QAAQ,KAAK,OAAO,QACpB,QAAQ,KAAK,OAAO,QACpB,QAAQ,KAAK,OAAO,QACpB,QAAQ,KAAK,OAAO;AAExB;","names":[]}
1
+ {"version":3,"sources":["../../src/viewport/index.ts","../../src/generated/geometry/interaction.ts","../../src/constants/performanceConstants.ts","../../src/viewport/viewportUtils.ts"],"sourcesContent":["export * from './viewportUtils.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","// ─── Viewport Utilities ───────────────────────────────────────────────────────\n//\n// Pure functions for viewport bounds calculation, coordinate transforms,\n// pan/zoom operations, and node visibility queries.\n\nimport type { ViewportState } from '../types/mindmap.js';\nimport {\n VIEWPORT_MARGIN,\n DEFAULT_CANVAS_WIDTH,\n DEFAULT_CANVAS_HEIGHT,\n ZOOM_MIN,\n ZOOM_MAX,\n} from '../constants/performanceConstants.js';\n\n// ── Viewport Bounds ───────────────────────────────────────────────────────────\n\nexport interface WorldBounds {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n}\n\n/**\n * Calculate the visible world-space bounding box including a margin buffer.\n */\nexport function calculateViewportBounds(\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): WorldBounds {\n const worldW = canvasWidth / viewport.zoomLevel;\n const worldH = canvasHeight / viewport.zoomLevel;\n const mx = worldW * VIEWPORT_MARGIN;\n const my = worldH * VIEWPORT_MARGIN;\n return {\n minX: viewport.centerX - worldW / 2 - mx,\n minY: viewport.centerY - worldH / 2 - my,\n maxX: viewport.centerX + worldW / 2 + mx,\n maxY: viewport.centerY + worldH / 2 + my,\n };\n}\n\n/**\n * Return a new ViewportState with `visibleBounds` recalculated.\n */\nexport function recalculateViewportBounds(\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): ViewportState {\n return {\n ...viewport,\n visibleBounds: calculateViewportBounds(viewport, canvasWidth, canvasHeight),\n };\n}\n\n// ── Coordinate Transforms ─────────────────────────────────────────────────────\n\n/**\n * Convert world-space coordinates to screen-space pixel coordinates.\n */\nexport function worldToScreen(\n worldX: number,\n worldY: number,\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): { x: number; y: number } {\n return {\n x: (worldX - viewport.centerX) * viewport.zoomLevel + canvasWidth / 2,\n y: (worldY - viewport.centerY) * viewport.zoomLevel + canvasHeight / 2,\n };\n}\n\n/**\n * Convert screen-space pixel coordinates to world-space coordinates.\n */\nexport function screenToWorld(\n screenX: number,\n screenY: number,\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): { x: number; y: number } {\n return {\n x: (screenX - canvasWidth / 2) / viewport.zoomLevel + viewport.centerX,\n y: (screenY - canvasHeight / 2) / viewport.zoomLevel + viewport.centerY,\n };\n}\n\n// ── Pan / Zoom ────────────────────────────────────────────────────────────────\n\n/** Clamp zoom to the design system's limits (VIEW: ZOOM_MIN–ZOOM_MAX), which apply to the zoom relative to the\n * layer's fit (`fit`: the fit-to-view scale), as in the design system's map (scale = fit × zoom). */\nexport function clampZoom(zoom: number, fit = 1): number {\n return Math.min(ZOOM_MAX * fit, Math.max(ZOOM_MIN * fit, zoom));\n}\n\n/**\n * Pan the viewport by a screen-space delta (positive = right/down).\n */\nexport function panViewport(\n deltaX: number,\n deltaY: number,\n viewport: ViewportState,\n): ViewportState {\n return {\n ...viewport,\n centerX: viewport.centerX - deltaX / viewport.zoomLevel,\n centerY: viewport.centerY - deltaY / viewport.zoomLevel,\n };\n}\n\n/** Teleport the viewport centre to the given world coordinates. */\nexport function setViewportCenter(\n x: number,\n y: number,\n viewport: ViewportState,\n): ViewportState {\n return { ...viewport, centerX: x, centerY: y };\n}\n\n/**\n * Zoom the viewport by a multiplicative delta, optionally around a pivot point.\n *\n * @param delta - Multiplier delta, e.g. 0.1 for +10% zoom\n * @param pivotX - Optional screen-space X pivot\n * @param pivotY - Optional screen-space Y pivot\n */\nexport function zoomViewport(\n delta: number,\n viewport: ViewportState,\n pivotX?: number,\n pivotY?: number,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n fit = 1,\n): ViewportState {\n const newZoom = clampZoom(viewport.zoomLevel * (1 + delta), fit);\n\n let cx = viewport.centerX;\n let cy = viewport.centerY;\n\n if (pivotX !== undefined && pivotY !== undefined) {\n const worldPivot = screenToWorld(pivotX, pivotY, viewport, canvasWidth, canvasHeight);\n cx = worldPivot.x - (pivotX - canvasWidth / 2) / newZoom;\n cy = worldPivot.y - (pivotY - canvasHeight / 2) / newZoom;\n }\n\n return { ...viewport, centerX: cx, centerY: cy, zoomLevel: newZoom };\n}\n\n/**\n * Create a viewport centred on a node (world coordinates) at the given zoom level.\n */\nexport function focusOnNode(\n nodeX: number,\n nodeY: number,\n zoom: number,\n): ViewportState {\n const clamped = clampZoom(zoom);\n return {\n centerX: nodeX,\n centerY: nodeY,\n zoomLevel: clamped,\n rotation: 0,\n visibleBounds: calculateViewportBounds(\n { centerX: nodeX, centerY: nodeY, zoomLevel: clamped, rotation: 0, visibleBounds: { minX: 0, minY: 0, maxX: 0, maxY: 0 } },\n ),\n };\n}\n\n// ── Visibility ────────────────────────────────────────────────────────────────\n\n/**\n * Test whether a world-space AABB intersects the viewport's visible bounds.\n */\nexport function isNodeInViewport(\n nodeX: number,\n nodeY: number,\n nodeWidth: number,\n nodeHeight: number,\n viewport: ViewportState,\n canvasWidth = DEFAULT_CANVAS_WIDTH,\n canvasHeight = DEFAULT_CANVAS_HEIGHT,\n): boolean {\n const bounds = calculateViewportBounds(viewport, canvasWidth, canvasHeight);\n const hw = nodeWidth / 2;\n const hh = nodeHeight / 2;\n return !(\n nodeX + hw < bounds.minX ||\n nodeX - hw > bounds.maxX ||\n nodeY + hh < bounds.minY ||\n nodeY - hh > bounds.maxY\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC+BO,IAAM,OAAO;AAAA;AAAA,EAC4C,UAAU;AAAA;AAAA,EACU,SAAS;AAAA,EAAK,SAAS;AAAA;AAAA,EAClD,QAAQ;AACjE;;;AC1BO,IAAM,aAA6B;AAGnC,IAAM,oBAA6B,MAAO;AAoC1C,IAAM,kBAA2B;AAYjC,IAAM,WAAwB,KAAK;AACnC,IAAM,WAAwB,KAAK;AA4CnC,IAAM,uBAAwB;AAC9B,IAAM,wBAAwB;;;AChF9B,SAAS,wBACd,UACA,cAAe,sBACf,eAAe,uBACF;AACb,QAAM,SAAS,cAAe,SAAS;AACvC,QAAM,SAAS,eAAe,SAAS;AACvC,QAAM,KAAK,SAAS;AACpB,QAAM,KAAK,SAAS;AACpB,SAAO;AAAA,IACL,MAAM,SAAS,UAAU,SAAS,IAAI;AAAA,IACtC,MAAM,SAAS,UAAU,SAAS,IAAI;AAAA,IACtC,MAAM,SAAS,UAAU,SAAS,IAAI;AAAA,IACtC,MAAM,SAAS,UAAU,SAAS,IAAI;AAAA,EACxC;AACF;AAKO,SAAS,0BACd,UACA,cAAe,sBACf,eAAe,uBACA;AACf,SAAO;AAAA,IACL,GAAG;AAAA,IACH,eAAe,wBAAwB,UAAU,aAAa,YAAY;AAAA,EAC5E;AACF;AAOO,SAAS,cACd,QACA,QACA,UACA,cAAe,sBACf,eAAe,uBACW;AAC1B,SAAO;AAAA,IACL,IAAI,SAAS,SAAS,WAAW,SAAS,YAAY,cAAe;AAAA,IACrE,IAAI,SAAS,SAAS,WAAW,SAAS,YAAY,eAAe;AAAA,EACvE;AACF;AAKO,SAAS,cACd,SACA,SACA,UACA,cAAe,s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,EAAE,EAAE;AAAA,IAC3H;AAAA,EACF;AACF;AAOO,SAAS,iBACd,OACA,OACA,WACA,YACA,UACA,cAAe,sBACf,eAAe,uBACN;AACT,QAAM,SAAS,wBAAwB,UAAU,aAAa,YAAY;AAC1E,QAAM,KAAK,YAAa;AACxB,QAAM,KAAK,aAAa;AACxB,SAAO,EACL,QAAQ,KAAK,OAAO,QACpB,QAAQ,KAAK,OAAO,QACpB,QAAQ,KAAK,OAAO,QACpB,QAAQ,KAAK,OAAO;AAExB;","names":[]}
@@ -1,4 +1,5 @@
1
- import { V as ViewportState } from '../mindmap-DWS0WZT_.cjs';
1
+ import { V as ViewportState } from '../mindmap-C3Qr0qKW.cjs';
2
+ import '../designSystem-BOrZHfEq.cjs';
2
3
 
3
4
  interface WorldBounds {
4
5
  minX: number;
@@ -28,8 +29,9 @@ declare function screenToWorld(screenX: number, screenY: number, viewport: Viewp
28
29
  x: number;
29
30
  y: number;
30
31
  };
31
- /** Clamp zoom to [ZOOM_MIN, ZOOM_MAX]. */
32
- declare function clampZoom(zoom: number): number;
32
+ /** Clamp zoom to the design system's limits (VIEW: ZOOM_MIN–ZOOM_MAX), which apply to the zoom relative to the
33
+ * layer's fit (`fit`: the fit-to-view scale), as in the design system's map (scale = fit × zoom). */
34
+ declare function clampZoom(zoom: number, fit?: number): number;
33
35
  /**
34
36
  * Pan the viewport by a screen-space delta (positive = right/down).
35
37
  */
@@ -43,7 +45,7 @@ declare function setViewportCenter(x: number, y: number, viewport: ViewportState
43
45
  * @param pivotX - Optional screen-space X pivot
44
46
  * @param pivotY - Optional screen-space Y pivot
45
47
  */
46
- declare function zoomViewport(delta: number, viewport: ViewportState, pivotX?: number, pivotY?: number, canvasWidth?: number, canvasHeight?: number): ViewportState;
48
+ declare function zoomViewport(delta: number, viewport: ViewportState, pivotX?: number, pivotY?: number, canvasWidth?: number, canvasHeight?: number, fit?: number): ViewportState;
47
49
  /**
48
50
  * Create a viewport centred on a node (world coordinates) at the given zoom level.
49
51
  */
@@ -1,4 +1,5 @@
1
- import { V as ViewportState } from '../mindmap-DWS0WZT_.js';
1
+ import { V as ViewportState } from '../mindmap-DHeVa86G.js';
2
+ import '../designSystem-BOrZHfEq.js';
2
3
 
3
4
  interface WorldBounds {
4
5
  minX: number;
@@ -28,8 +29,9 @@ declare function screenToWorld(screenX: number, screenY: number, viewport: Viewp
28
29
  x: number;
29
30
  y: number;
30
31
  };
31
- /** Clamp zoom to [ZOOM_MIN, ZOOM_MAX]. */
32
- declare function clampZoom(zoom: number): number;
32
+ /** Clamp zoom to the design system's limits (VIEW: ZOOM_MIN–ZOOM_MAX), which apply to the zoom relative to the
33
+ * layer's fit (`fit`: the fit-to-view scale), as in the design system's map (scale = fit × zoom). */
34
+ declare function clampZoom(zoom: number, fit?: number): number;
33
35
  /**
34
36
  * Pan the viewport by a screen-space delta (positive = right/down).
35
37
  */
@@ -43,7 +45,7 @@ declare function setViewportCenter(x: number, y: number, viewport: ViewportState
43
45
  * @param pivotX - Optional screen-space X pivot
44
46
  * @param pivotY - Optional screen-space Y pivot
45
47
  */
46
- declare function zoomViewport(delta: number, viewport: ViewportState, pivotX?: number, pivotY?: number, canvasWidth?: number, canvasHeight?: number): ViewportState;
48
+ declare function zoomViewport(delta: number, viewport: ViewportState, pivotX?: number, pivotY?: number, canvasWidth?: number, canvasHeight?: number, fit?: number): ViewportState;
47
49
  /**
48
50
  * Create a viewport centred on a node (world coordinates) at the given zoom level.
49
51
  */
@@ -9,8 +9,8 @@ import {
9
9
  setViewportCenter,
10
10
  worldToScreen,
11
11
  zoomViewport
12
- } from "../chunk-LJYSKSCE.js";
13
- import "../chunk-LDJRGT2Q.js";
12
+ } from "../chunk-W2CAOOJJ.js";
13
+ import "../chunk-UAMEJG2C.js";
14
14
  export {
15
15
  calculateViewportBounds,
16
16
  clampZoom,
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Visualli
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,6 @@
1
+ # Notices
2
+
3
+ - **Code, tokens, CSS and geometry** in this folder: MIT (see LICENSE).
4
+ - **Fonts** — all SIL Open Font License 1.1 (https://openfontlicense.org): Caveat, Kalam, Atkinson Hyperlegible Next, Atkinson Hyperlegible Mono. Bundled files keep their license; hosted ones load from Google Fonts.
5
+ - **Trademarks** — "Visualli", the Visualli logo, wordmark and tree mark are trademarks and are *not* licensed here; none are included. You may say a viewer is "compatible with the .visualli spec".
6
+ - The display face used in Visualli's own app chrome is licensed separately and is not part of this folder; where a spec style asks for `--font-display` it falls back to Atkinson Hyperlegible Next.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualli/core",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "Framework-agnostic core logic, types, and engines for Visualli",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,16 +55,23 @@
55
55
  "types": "./dist/config/index.d.ts",
56
56
  "import": "./dist/config/index.js",
57
57
  "require": "./dist/config/index.cjs"
58
+ },
59
+ "./theme": {
60
+ "types": "./dist/theme/index.d.ts",
61
+ "import": "./dist/theme/index.js",
62
+ "require": "./dist/theme/index.cjs"
58
63
  }
59
64
  },
60
65
  "files": [
61
66
  "dist",
62
- "src"
67
+ "src",
68
+ "licenses"
63
69
  ],
64
70
  "scripts": {
65
- "build": "tsup",
66
- "typecheck": "tsc --noEmit",
67
- "lint": "eslint src --ext .ts"
71
+ "build": "node ../../../../scripts/gen-design-system.mjs && tsup",
72
+ "check-types": "tsc --noEmit",
73
+ "lint": "eslint src --max-warnings 0",
74
+ "test": "vitest run"
68
75
  },
69
76
  "dependencies": {
70
77
  "@visualli/bindings": "*",
@@ -73,6 +80,7 @@
73
80
  "devDependencies": {
74
81
  "@types/node": "^22.0.0",
75
82
  "@types/rbush": "^3.0.3",
83
+ "@visualli/eslint-config": "*",
76
84
  "typescript": "^5.5.4"
77
85
  },
78
86
  "engines": {
@@ -23,7 +23,6 @@ import {
23
23
  ACTIVE_BLOB_TYPES,
24
24
  BLOB_LAYER_CONFIG,
25
25
  NODE_LAYER_CONFIG,
26
- BLOB_TEXT_OFFSETS,
27
26
  getBlobTypeForLayer,
28
27
  drawBlobPath
29
28
  } from '@visualli/core/config';
@@ -36,12 +35,11 @@ import {
36
35
  - **`ACTIVE_BLOB_TYPES`** - Array of active blob type indices
37
36
  - **`BLOB_LAYER_CONFIG`** - Configuration for blob rendering layers
38
37
  - **`NODE_LAYER_CONFIG`** - Configuration for node layer
39
- - **`BLOB_TEXT_OFFSETS`** - Text positioning offsets per shape
40
38
  - **`getBlobTypeForLayer(level: number)`** - Get blob type for a specific tree level
41
39
  - **`drawBlobPath(ctx, radiusX, radiusY, blobType)`** - Draw blob path on canvas
42
40
 
43
- ### Text Scaling (`textScaling.ts`)
44
- - Text scaling configuration utilities
41
+ ### Idea size (`ideaSize.ts`)
42
+ - The design system's idea sizing and label growth (`idea.ts`); renderers pass their text measurement
45
43
 
46
44
  ## Adding New Configuration
47
45
 
@@ -267,7 +267,6 @@ console.log('Shape 0 bounding box:', bbox);
267
267
  import {
268
268
  BLOB_LAYER_CONFIG,
269
269
  NODE_LAYER_CONFIG,
270
- BLOB_TEXT_OFFSETS,
271
270
  ACTIVE_BLOB_TYPES
272
271
  } from '@visualli/core/config';
273
272
 
@@ -277,9 +276,6 @@ console.log(BLOB_LAYER_CONFIG); // 3 layers with opacity, rotation, scale, etc.
277
276
  // Node layer configuration
278
277
  console.log(NODE_LAYER_CONFIG); // Main node rendering config
279
278
 
280
- // Text offsets for each shape
281
- console.log(BLOB_TEXT_OFFSETS); // [0, 0, 0, 0, 0, -0.10]
282
-
283
279
  // Active shape indices
284
280
  console.log(ACTIVE_BLOB_TYPES); // [0, 1, 2, 3, 4, 5]
285
281
  ```
@@ -1,7 +1,6 @@
1
1
  // ─── Config Barrel Export ────────────────────────────────────────────────────
2
2
  //
3
- // Automatically exports all configuration modules.
4
- // Add new config files here to make them available via `@visualli/core/config`.
3
+ // Design-system geometry and idea sizing (all derived from generated/).
5
4
 
6
- export * from './blobShapes.js';
7
- export * from './textScaling.js';
5
+ export * from '../rendering/nodeGeometry.js';
6
+ export * from '../rendering/ideaSize.js';
@@ -1,3 +1,3 @@
1
1
  export * from './performanceConstants.js';
2
- export * from './design.js';
2
+ export * from './layout.js';
3
3
  export * from './renderConfig.js';
@@ -0,0 +1,11 @@
1
+ // ─── Layout constants ────────────────────────────────────────────────────────
2
+ //
3
+ // Non-visual layout metrics (world units). Everything visual (colours, fonts,
4
+ // radii, spacing, motion) comes from the design system: see ../theme.
5
+
6
+ export const LAYOUT_SPACING = {
7
+ nodeSpacing: 200,
8
+ levelSpacing: 150,
9
+ containerPadding: 20,
10
+ gridSize: 50,
11
+ } as const;