@stephen-netu/design-system 0.1.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 (204) hide show
  1. package/README.md +66 -0
  2. package/package.json +130 -0
  3. package/src/b0-app-shell/clarification-overlay/ClarificationOverlay.svelte +221 -0
  4. package/src/b0-app-shell/clarification-overlay/index.ts +1 -0
  5. package/src/b0-app-shell/command-bar/CommandBar.svelte +565 -0
  6. package/src/b0-app-shell/index.ts +14 -0
  7. package/src/base.css +152 -0
  8. package/src/d0-data-viz/BarChart.svelte +236 -0
  9. package/src/d0-data-viz/CheckpointBar.svelte +574 -0
  10. package/src/d0-data-viz/CheckpointPill.svelte +297 -0
  11. package/src/d0-data-viz/MetricCard.svelte +159 -0
  12. package/src/d0-data-viz/SparkLine.svelte +66 -0
  13. package/src/d0-data-viz/StorageMap.svelte +182 -0
  14. package/src/d0-data-viz/Timeline.svelte +188 -0
  15. package/src/d0-data-viz/checkpoint-types.ts +162 -0
  16. package/src/d0-data-viz/d0-tokens.css +32 -0
  17. package/src/d0-data-viz/index.ts +58 -0
  18. package/src/d0-data-viz/storage-map-types.ts +142 -0
  19. package/src/d0-data-viz/theme-integration.ts +134 -0
  20. package/src/d0-data-viz/types.ts +53 -0
  21. package/src/demos/BspSizingInfographic.svelte +386 -0
  22. package/src/demos/BspZoneDemo.svelte +255 -0
  23. package/src/demos/ControlRoomDemo.svelte +570 -0
  24. package/src/demos/NodepadBlocksShowcase.svelte +189 -0
  25. package/src/demos/index.ts +7 -0
  26. package/src/editor/CodeEditor.svelte +188 -0
  27. package/src/editor/FindReplaceDialog.svelte +516 -0
  28. package/src/editor/MarkdownEditor.svelte +660 -0
  29. package/src/editor/index.ts +2 -0
  30. package/src/entity-graph-view/WorldView.svelte +171 -0
  31. package/src/entity-graph-view/index.ts +6 -0
  32. package/src/entity-graph-view/types.ts +364 -0
  33. package/src/epistemic/index.ts +2 -0
  34. package/src/epistemic/types.ts +134 -0
  35. package/src/epistemic/utils.ts +32 -0
  36. package/src/f0-forms/checkbox/Checkbox.svelte +158 -0
  37. package/src/f0-forms/field/FormField.svelte +91 -0
  38. package/src/f0-forms/index.ts +11 -0
  39. package/src/f0-forms/radio/RadioGroup.svelte +192 -0
  40. package/src/f0-forms/search/SearchBar.svelte +99 -0
  41. package/src/f0-forms/select/Select.svelte +198 -0
  42. package/src/f0-forms/textarea/TextArea.svelte +170 -0
  43. package/src/f0-forms/toggle/FormToggle.svelte +147 -0
  44. package/src/f0-forms/validation/validate.ts +47 -0
  45. package/src/fabric/ai/ChatPanel.svelte +648 -0
  46. package/src/fabric/ai/index.ts +11 -0
  47. package/src/fabric/data/index.ts +21 -0
  48. package/src/fabric/feedback/StatusBar.svelte +274 -0
  49. package/src/fabric/feedback/ToastContainer.svelte +122 -0
  50. package/src/fabric/feedback/index.ts +14 -0
  51. package/src/fabric/index.ts +37 -0
  52. package/src/fabric/input/CommandBar.svelte +79 -0
  53. package/src/fabric/input/KeyboardShortcuts.svelte +388 -0
  54. package/src/fabric/input/index.ts +12 -0
  55. package/src/fabric/layout/GlassBox.svelte +193 -0
  56. package/src/fabric/layout/KanbanBoard.svelte +158 -0
  57. package/src/fabric/layout/KanbanCard.svelte +226 -0
  58. package/src/fabric/layout/KanbanColumn.svelte +278 -0
  59. package/src/fabric/layout/index.ts +17 -0
  60. package/src/fabric/navigation/ActivityRail.svelte +271 -0
  61. package/src/fabric/navigation/index.ts +11 -0
  62. package/src/g0-geo/SovereignMap.svelte +149 -0
  63. package/src/g0-geo/index.ts +2 -0
  64. package/src/index.ts +68 -0
  65. package/src/l0-layout/block-writer/BlockConnectionLines.svelte +98 -0
  66. package/src/l0-layout/block-writer/BlockContent.svelte +213 -0
  67. package/src/l0-layout/block-writer/BlockHeader.svelte +230 -0
  68. package/src/l0-layout/block-writer/BlockItem.svelte +177 -0
  69. package/src/l0-layout/block-writer/BlockWriter.svelte +219 -0
  70. package/src/l0-layout/block-writer/block-writer-types.ts +63 -0
  71. package/src/l0-layout/block-writer/index.ts +24 -0
  72. package/src/l0-layout/block-writer/markdown.ts +110 -0
  73. package/src/l0-layout/chat-view/ChatViewLayout.svelte +61 -0
  74. package/src/l0-layout/epistemic/AllayDetailPanel.svelte +113 -0
  75. package/src/l0-layout/epistemic/AssayDetailPanel.svelte +164 -0
  76. package/src/l0-layout/epistemic/AvenueTrace.svelte +253 -0
  77. package/src/l0-layout/epistemic/KnowledgeDetailPanel.svelte +204 -0
  78. package/src/l0-layout/epistemic/ParadigmLens.svelte +170 -0
  79. package/src/l0-layout/epistemic/ProvenanceChain.svelte +164 -0
  80. package/src/l0-layout/epistemic/TrustView.svelte +195 -0
  81. package/src/l0-layout/epistemic/index.ts +7 -0
  82. package/src/l0-layout/grove/AccordCard.svelte +156 -0
  83. package/src/l0-layout/grove/GroveCard.svelte +197 -0
  84. package/src/l0-layout/grove/MemberBadge.svelte +96 -0
  85. package/src/l0-layout/grove/MemberList.svelte +59 -0
  86. package/src/l0-layout/grove/grove-types.ts +29 -0
  87. package/src/l0-layout/grove/index.ts +14 -0
  88. package/src/l0-layout/index.ts +45 -0
  89. package/src/l0-layout/kanban/KanbanBoard.svelte +71 -0
  90. package/src/l0-layout/kanban/KanbanCard.svelte +276 -0
  91. package/src/l0-layout/kanban/KanbanColumn.svelte +198 -0
  92. package/src/l0-layout/kanban/KanbanViewLayout.svelte +61 -0
  93. package/src/l0-layout/workspace/WorkspaceLayout.svelte +93 -0
  94. package/src/n0-node-graph/GraphEditor.svelte +342 -0
  95. package/src/n0-node-graph/GraphHistory.svelte +122 -0
  96. package/src/n0-node-graph/Node.svelte +269 -0
  97. package/src/n0-node-graph/NodeCanvas.svelte +187 -0
  98. package/src/n0-node-graph/NodeEdge.svelte +152 -0
  99. package/src/n0-node-graph/NodePalette.svelte +318 -0
  100. package/src/n0-node-graph/NodePort.svelte +128 -0
  101. package/src/n0-node-graph/index.ts +33 -0
  102. package/src/n0-node-graph/n0-tokens.css +29 -0
  103. package/src/n0-node-graph/node-port-types.ts +19 -0
  104. package/src/n0-node-graph/types.ts +96 -0
  105. package/src/n0-node-graph/validate.test.ts +722 -0
  106. package/src/n0-node-graph/validate.ts +371 -0
  107. package/src/n1-flow-canvas/FlowCanvas.svelte +202 -0
  108. package/src/n1-flow-canvas/graph-state.svelte.ts +95 -0
  109. package/src/n1-flow-canvas/index.ts +21 -0
  110. package/src/n1-flow-canvas/layout.ts +118 -0
  111. package/src/n1-flow-canvas/layout.worker.ts +128 -0
  112. package/src/n1-flow-canvas/types.ts +102 -0
  113. package/src/n1-flow-canvas/utils.ts +146 -0
  114. package/src/n2-manifold-disk/ManifoldDisk.svelte +314 -0
  115. package/src/n2-manifold-disk/index.ts +6 -0
  116. package/src/n2-manifold-disk/poincare.ts +184 -0
  117. package/src/n3-force-graph/ForceGraph.svelte +180 -0
  118. package/src/n3-force-graph/GraphTooltip.svelte +99 -0
  119. package/src/n3-force-graph/animated-edge.ts +107 -0
  120. package/src/n3-force-graph/health-node.ts +128 -0
  121. package/src/n3-force-graph/index.ts +31 -0
  122. package/src/n3-force-graph/types.ts +94 -0
  123. package/src/n4-adaptive-manifold/AdaptiveManifold.svelte +1165 -0
  124. package/src/n4-adaptive-manifold/DetailCard.svelte +212 -0
  125. package/src/n4-adaptive-manifold/SuggestionIndicator.svelte +91 -0
  126. package/src/n4-adaptive-manifold/classifier.ts +139 -0
  127. package/src/n4-adaptive-manifold/index.ts +45 -0
  128. package/src/n4-adaptive-manifold/n4-tokens.css +155 -0
  129. package/src/n4-adaptive-manifold/orchestrator.ts +301 -0
  130. package/src/n4-adaptive-manifold/phase-theme.ts +92 -0
  131. package/src/n4-adaptive-manifold/pinnacle-events.ts +135 -0
  132. package/src/n4-adaptive-manifold/providers/gravitational-provider.ts +191 -0
  133. package/src/n4-adaptive-manifold/providers/manifold-provider.ts +276 -0
  134. package/src/n4-adaptive-manifold/transition.ts +90 -0
  135. package/src/n4-adaptive-manifold/types.ts +313 -0
  136. package/src/p0-primitives/index.ts +6 -0
  137. package/src/p0-primitives/tokens/control-room.css +309 -0
  138. package/src/p0-primitives/tokens/index.ts +6 -0
  139. package/src/p0-primitives/tokens/tokens.css +140 -0
  140. package/src/p0-primitives/tokens/tokens.json +132 -0
  141. package/src/p0-primitives/types/index.ts +123 -0
  142. package/src/p0-primitives/types/plugin-types.ts +74 -0
  143. package/src/p0-primitives/utils/index.ts +39 -0
  144. package/src/platform/hud-protocol.ts +20 -0
  145. package/src/platform/index.ts +3 -0
  146. package/src/s0-state/create-store.ts +84 -0
  147. package/src/s0-state/derived.ts +41 -0
  148. package/src/s0-state/index.ts +6 -0
  149. package/src/showcase/Showcase.svelte +401 -0
  150. package/src/spatial/BspTilingCanvas.svelte +232 -0
  151. package/src/spatial/ForceCanvas.svelte +289 -0
  152. package/src/spatial/LodRenderer.svelte +334 -0
  153. package/src/spatial/SnapZoomCamera.svelte +185 -0
  154. package/src/spatial/ZoneTiler.svelte +311 -0
  155. package/src/spatial/camera-types.ts +45 -0
  156. package/src/spatial/content-proportional-bsp.ts +253 -0
  157. package/src/spatial/force-canvas-types.ts +102 -0
  158. package/src/spatial/index.ts +15 -0
  159. package/src/spatial/lod-types.ts +70 -0
  160. package/src/spatial/zone-tiler-types.ts +177 -0
  161. package/src/stores/vaultStore.svelte +14 -0
  162. package/src/t0-transport/connection.ts +34 -0
  163. package/src/t0-transport/error.ts +37 -0
  164. package/src/t0-transport/events.ts +50 -0
  165. package/src/t0-transport/index.ts +6 -0
  166. package/src/t0-transport/invoke.ts +30 -0
  167. package/src/tauri/index.ts +13 -0
  168. package/src/u0-primitives/allay-gauge/AllayGauge.svelte +90 -0
  169. package/src/u0-primitives/allay-gauge/index.ts +1 -0
  170. package/src/u0-primitives/animated-icon/AnimatedIcon.svelte +273 -0
  171. package/src/u0-primitives/animated-icon/README.md +53 -0
  172. package/src/u0-primitives/animated-icon/index.ts +31 -0
  173. package/src/u0-primitives/assay-badge/AssayBadge.svelte +121 -0
  174. package/src/u0-primitives/assay-badge/AssaySignalBar.svelte +83 -0
  175. package/src/u0-primitives/assay-badge/index.ts +2 -0
  176. package/src/u0-primitives/avatar/Avatar.svelte +177 -0
  177. package/src/u0-primitives/badge/Badge.svelte +149 -0
  178. package/src/u0-primitives/button/Button.svelte +304 -0
  179. package/src/u0-primitives/card/Card.svelte +182 -0
  180. package/src/u0-primitives/dropdown/Dropdown.svelte +305 -0
  181. package/src/u0-primitives/expert-badge/ExpertBadge.svelte +89 -0
  182. package/src/u0-primitives/expert-badge/index.ts +1 -0
  183. package/src/u0-primitives/index.ts +35 -0
  184. package/src/u0-primitives/input/Input.svelte +237 -0
  185. package/src/u0-primitives/modal/Modal.svelte +331 -0
  186. package/src/u0-primitives/modal/index.ts +1 -0
  187. package/src/u0-primitives/spinner/Spinner.svelte +129 -0
  188. package/src/u0-primitives/tabs/Tabs.svelte +225 -0
  189. package/src/u0-primitives/tabs/tabs-types.ts +11 -0
  190. package/src/u0-primitives/toggle/Toggle.svelte +161 -0
  191. package/src/u0-primitives/tooltip/Tooltip.svelte +234 -0
  192. package/src/v0-diagrams/DiagramPanel.svelte +68 -0
  193. package/src/v0-diagrams/MarkmapDiagram.svelte +56 -0
  194. package/src/v0-diagrams/MermaidDiagram.svelte +53 -0
  195. package/src/v0-diagrams/index.ts +4 -0
  196. package/src/v0-diagrams/types.ts +28 -0
  197. package/src/v0-diagrams/v0-tokens.css +6 -0
  198. package/src/vite-env.d.ts +7 -0
  199. package/src/x0-enchanted-blocks/ENCHANTED_BLOCKS_SPEC.md +457 -0
  200. package/src/x0-enchanted-blocks/components/EnchantedBlock.svelte +485 -0
  201. package/src/x0-enchanted-blocks/components/NodepadBlock.svelte +262 -0
  202. package/src/x0-enchanted-blocks/core/block-layout.ts +211 -0
  203. package/src/x0-enchanted-blocks/core/block-types.ts +227 -0
  204. package/src/x0-enchanted-blocks/index.ts +46 -0
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Theme Integration for D0 Data Viz
3
+ *
4
+ * This module provides integration with the LEAP theme system for
5
+ * checkpoint visualization components. Colors are customizable via
6
+ * the themeStore settings panel.
7
+ *
8
+ * @module d0-data-viz/theme
9
+ *
10
+ * @example
11
+ * ```svelte
12
+ * <script>
13
+ * import { CheckpointBar } from '@sov/design-system';
14
+ * import { themeStore } from '$lib/stores/themeStore.svelte';
15
+ *
16
+ * // Colors automatically applied from themeStore
17
+ * // Users customize via Settings > Appearance > Checkpoint Colors
18
+ * </script>
19
+ *
20
+ * <CheckpointBar {checkpoints} {currentSeqno} />
21
+ * ```
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * // Programmatic color customization
26
+ * import { themeStore } from '$lib/stores/themeStore.svelte';
27
+ *
28
+ * themeStore.setCustomToken('d0-checkpoint-rust', '#ff6b35'); // Orange rust
29
+ * themeStore.setCustomToken('d0-checkpoint-ui', '#00d4aa'); // Teal UI
30
+ * themeStore.setCustomToken('d0-checkpoint-substrate', '#ff3366'); // Pink substrate
31
+ * ```
32
+ */
33
+
34
+ import { getCheckpointColor } from './checkpoint-types';
35
+ import type { CheckpointComponentType } from './checkpoint-types';
36
+
37
+ /**
38
+ * CSS variable names for checkpoint colors.
39
+ * These are set by themeStore and consumed by CheckpointBar.
40
+ */
41
+ export const CHECKPOINT_CSS_VARS: Record<CheckpointComponentType, string> = {
42
+ 'rust-crate': '--d0-checkpoint-rust',
43
+ 'ui-bundle': '--d0-checkpoint-ui',
44
+ 'config': '--d0-checkpoint-config',
45
+ 'faculty-state': '--d0-checkpoint-faculty',
46
+ 'substrate-binary': '--d0-checkpoint-substrate',
47
+ 'system-snapshot': '--d0-checkpoint-aggregate',
48
+ } as const;
49
+
50
+ /**
51
+ * Human-readable labels for checkpoint color settings.
52
+ * Use these in settings panel UI.
53
+ */
54
+ export const CHECKPOINT_COLOR_LABELS: Record<CheckpointComponentType, string> = {
55
+ 'rust-crate': 'Rust Crate',
56
+ 'ui-bundle': 'UI Bundle',
57
+ 'config': 'Config File',
58
+ 'faculty-state': 'Faculty State',
59
+ 'substrate-binary': 'Substrate Binary',
60
+ 'system-snapshot': 'Aggregate Snapshot',
61
+ } as const;
62
+
63
+ /**
64
+ * Default colors for light and dark themes.
65
+ * Used when themeStore hasn't applied custom values.
66
+ */
67
+ export const CHECKPOINT_DEFAULT_COLORS: Record<
68
+ CheckpointComponentType,
69
+ { light: string; dark: string }
70
+ > = {
71
+ 'rust-crate': { light: '#8a5a28', dark: '#b87333' },
72
+ 'ui-bundle': { light: '#2d6b6e', dark: '#5f9ea0' },
73
+ 'config': { light: '#7c6fae', dark: '#a99fd6' },
74
+ 'faculty-state': { light: '#d4a03d', dark: '#e6c470' },
75
+ 'substrate-binary': { light: '#c75a5a', dark: '#d98a8a' },
76
+ 'system-snapshot': { light: '#6b7280', dark: '#9ca3af' },
77
+ } as const;
78
+
79
+ /**
80
+ * Get the effective checkpoint color for a component type.
81
+ * Returns the themeStore CSS variable reference for runtime,
82
+ * or a fallback color for SSR/initial render.
83
+ *
84
+ * @param type - The checkpoint component type
85
+ * @param isDark - Whether to use dark theme fallback
86
+ * @returns CSS color value (variable reference or hex)
87
+ */
88
+ export function getEffectiveCheckpointColor(
89
+ type: CheckpointComponentType,
90
+ isDark = true
91
+ ): string {
92
+ // Return CSS variable reference for runtime
93
+ // Browser will resolve from themeStore-set values
94
+ const cssVar = CHECKPOINT_CSS_VARS[type];
95
+ const fallback = getCheckpointColor(type, isDark);
96
+
97
+ // For SSR safety, return fallback directly
98
+ // For client-side, return CSS var with fallback
99
+ if (typeof window === 'undefined') {
100
+ return fallback;
101
+ }
102
+
103
+ return `var(${cssVar}, ${fallback})`;
104
+ }
105
+
106
+ /**
107
+ * Re-export for convenience.
108
+ * @deprecated Use getEffectiveCheckpointColor for theme-aware colors
109
+ */
110
+ export { getCheckpointColor };
111
+
112
+ /**
113
+ * Integration with themeStore CUSTOMIZABLE_TOKENS.
114
+ *
115
+ * These tokens are registered in themeStore and appear in the
116
+ * settings panel under "Checkpoint" category.
117
+ */
118
+ export const THEME_INTEGRATION = {
119
+ /** Category name in settings panel */
120
+ category: 'Checkpoint',
121
+
122
+ /** Token prefix for checkpoint colors */
123
+ tokenPrefix: 'd0-checkpoint-',
124
+
125
+ /** All customizable checkpoint tokens */
126
+ tokens: [
127
+ { name: 'd0-checkpoint-rust', label: 'Rust Crate', component: 'rust-crate' },
128
+ { name: 'd0-checkpoint-ui', label: 'UI Bundle', component: 'ui-bundle' },
129
+ { name: 'd0-checkpoint-config', label: 'Config', component: 'config' },
130
+ { name: 'd0-checkpoint-faculty', label: 'Faculty', component: 'faculty-state' },
131
+ { name: 'd0-checkpoint-substrate', label: 'Substrate Binary', component: 'substrate-binary' },
132
+ { name: 'd0-checkpoint-aggregate', label: 'Aggregate', component: 'system-snapshot' },
133
+ ],
134
+ } as const;
@@ -0,0 +1,53 @@
1
+ // D0 Data Viz — Core Types
2
+ // Pure TypeScript — no Svelte, no DOM dependencies
3
+
4
+ // === Data Primitives ===
5
+
6
+ export interface DataPoint {
7
+ label: string;
8
+ value: number;
9
+ color?: string;
10
+ }
11
+
12
+ export interface DataSeries {
13
+ id: string;
14
+ label: string;
15
+ data: DataPoint[];
16
+ color?: string;
17
+ }
18
+
19
+ // === Chart ===
20
+
21
+ export interface ChartProps {
22
+ series: DataSeries[];
23
+ width?: number;
24
+ height?: number;
25
+ }
26
+
27
+ // === Metric Card ===
28
+
29
+ export interface MetricCardProps {
30
+ label: string;
31
+ value: string | number;
32
+ unit?: string;
33
+ trend?: 'up' | 'down' | 'flat';
34
+ trendValue?: string;
35
+ /** 'default' = card block; 'inline' = compact horizontal for toolbars/headers */
36
+ size?: 'default' | 'inline';
37
+ }
38
+
39
+ // === Timeline ===
40
+
41
+ export interface TimelineEntry {
42
+ id: string;
43
+ timestamp: string;
44
+ label: string;
45
+ description?: string;
46
+ color?: string;
47
+ icon?: string;
48
+ }
49
+
50
+ export interface TimelineProps {
51
+ entries: TimelineEntry[];
52
+ orientation?: 'horizontal' | 'vertical';
53
+ }
@@ -0,0 +1,386 @@
1
+ <script lang="ts">
2
+ // BSP Sizing Infographic — Static data guaranteed to show all categories
3
+ interface SizingInfo {
4
+ zoneId: string;
5
+ contentArea: number;
6
+ lines: number;
7
+ fits: string[];
8
+ content: string;
9
+ }
10
+
11
+ // Static data with real content representing Pretext-measured zones
12
+ const sizingInfo: SizingInfo[] = [
13
+ // Tiny: < 2000 px² — minimal content, just badges
14
+ { zoneId: 'tiny-1', contentArea: 420, lines: 1, fits: ['ID badge', 'Color'], content: 'Hi.' },
15
+ { zoneId: 'tiny-2', contentArea: 840, lines: 2, fits: ['ID badge', 'Color'], content: 'OK.' },
16
+ { zoneId: 'tiny-3', contentArea: 1260, lines: 2, fits: ['ID badge', 'Color'], content: 'Todo.' },
17
+
18
+ // Small: 2000-8000 px² — short tasks/notes
19
+ { zoneId: 'small-1', contentArea: 2520, lines: 3, fits: ['Title', 'Type chip'], content: 'Short task item for today.' },
20
+ { zoneId: 'small-2', contentArea: 3360, lines: 4, fits: ['Title', 'Type chip', 'Preview'], content: 'Quick note about BSP layout approach and spatial design.' },
21
+ { zoneId: 'small-3', contentArea: 4620, lines: 5, fits: ['Title', 'Type chip', 'Preview'], content: 'Reference link to Nodepad documentation and spatial canvas patterns.' },
22
+ { zoneId: 'small-4', contentArea: 5880, lines: 6, fits: ['Title', 'Type chip', 'Preview'], content: 'Question: How do we integrate Pretext measurement with ZoneTiler for proportional sizing?' },
23
+
24
+ // Medium: 8000-20000 px² — full paragraphs
25
+ { zoneId: 'medium-1', contentArea: 8400, lines: 7, fits: ['Full title', '3-7 lines', 'Type chip'], content: 'Medium complexity note that demonstrates how cards flow and resize based on their actual content measurements using Pretext library for DOM-free measurement.' },
26
+ { zoneId: 'medium-2', contentArea: 10500, lines: 8, fits: ['Full title', '3-7 lines', 'Annotation'], content: 'Research on spatial canvas patterns and BSP tiling approaches. Key insight: ZoneTiler creates clean divisions with draggable dividers between zones for intuitive navigation.' },
27
+ { zoneId: 'medium-3', contentArea: 12600, lines: 9, fits: ['Full title', '3-7 lines', 'Inline edit'], content: 'How do we integrate BSP tiling with content-proportional sizing?\n\nKey points to consider:\n- Binary space partitioning\n- Content-adaptive zones\n- Draggable dividers' },
28
+ { zoneId: 'medium-4', contentArea: 15400, lines: 10, fits: ['Full title', '3-7 lines', 'Inline edit'], content: 'Nodepad natural flow concept adaptation for KOS. The spatial canvas should allow cards to size themselves based on content, avoiding wasted space from fixed-size containers that force scrolling or truncation.' },
29
+
30
+ // Large: > 20000 px² — substantial content, full editing
31
+ { zoneId: 'large-1', contentArea: 21000, lines: 12, fits: ['Complete', 'Full editing', 'Type selector'], content: 'BSP creates superior spatial organization for complex workspaces.\n\nBenefits of this approach:\n- Clean divisions between content areas\n- Predictable layout that users can navigate\n- Content-aware sizing prevents wasted space\n- Tiny zones become colored indicator blocks\n- Large zones support full editing capabilities' },
32
+ { zoneId: 'large-2', contentArea: 25200, lines: 14, fits: ['Complete', 'Full editing', 'Annotations'], content: 'ZoneTiler implementation notes for LEAP design system.\n\nFeatures implemented:\n- h/j/k/l keyboard navigation between zones\n- Ctrl+Shift+H/V to split zones\n- Draggable dividers for manual resize\n- Focus management with visual indicators\n- Content measurement via Pretext\n- Proportional sizing algorithms\n- Minimized block rendering for tiny zones' },
33
+ { zoneId: 'large-3', contentArea: 29400, lines: 16, fits: ['Complete', 'Full editing', 'Annotations', 'History'], content: 'Research on content-proportional layouts for spatial canvases.\n\nKey findings from analysis:\n- Cards should size themselves to their content\n- Layout algorithms should adapt to content, not force content into fixed layouts\n- No forced rectangular constraints that create wasted space\n- Tight packing of content blocks\n- Automatic downgrade to indicator blocks when content is too small for meaningful display\n- Upgrade to full editing mode when sufficient space available' },
34
+ { zoneId: 'huge-1', contentArea: 33600, lines: 18, fits: ['Complete', 'Full editing', 'All features'], content: 'Complete ZoneTiler implementation with content-proportional BSP layout.\n\nThis zone demonstrates full editing capabilities with:\n- Complete content visibility\n- Full inline editing with stable cursor\n- Type selector chips (Task, Idea, Question, Claim, Reference, Definition)\n- Annotation support with metadata\n- Keyboard shortcuts for power users\n- Drag-and-drop zone resizing\n- Automatic content measurement and re-layout\n- Responsive sizing based on available canvas space\n- Integration with Nodepad block system\n- Brass/copper aesthetic consistent with KOS design system\n\nThis is substantial content that requires a large zone for effective editing and viewing.' },
35
+ ];
36
+
37
+ // Categorize
38
+ const tiny = sizingInfo.filter(s => s.contentArea < 2000);
39
+ const small = sizingInfo.filter(s => s.contentArea >= 2000 && s.contentArea < 8000);
40
+ const medium = sizingInfo.filter(s => s.contentArea >= 8000 && s.contentArea < 20000);
41
+ const large = sizingInfo.filter(s => s.contentArea >= 20000);
42
+ </script>
43
+
44
+ <div class="infographic">
45
+ <header>
46
+ <h2>BSP Zone Sizing — What Fits Where</h2>
47
+ <p class="subtitle">Content-proportional allocation (xkcd radiation-style)</p>
48
+
49
+ </header>
50
+
51
+ <div class="scale-container">
52
+ <!-- Tiny zones -->
53
+ <div class="scale-section tiny">
54
+ <h3>🔴 Tiny Zones (Colored Blocks) — {tiny.length} zones</h3>
55
+ <div class="threshold">&lt; 2,000 px²</div>
56
+ <div class="fits-list">
57
+ <span class="fits-yes">Color indicator</span>
58
+ <span class="fits-yes">ID badge</span>
59
+ <span class="fits-no">No readable text</span>
60
+ <span class="fits-no">No editing</span>
61
+ </div>
62
+ <div class="examples">
63
+ {#each tiny as info}
64
+ <div class="zone-preview tiny-block" style="--w: {Math.max(30, Math.sqrt(info.contentArea) * 0.8)}px; --h: {Math.max(30, Math.sqrt(info.contentArea) * 0.8)}px;" title="{info.content}">
65
+ <div class="block-indicator">
66
+ {info.content.slice(0, 8)}
67
+ </div>
68
+ </div>
69
+ {:else}
70
+ <div class="empty-section">No zones in this category</div>
71
+ {/each}
72
+ </div>
73
+ </div>
74
+
75
+ <!-- Small zones -->
76
+ <div class="scale-section small">
77
+ <h3>🟠 Small Zones (Titles Only) — {small.length} zones</h3>
78
+ <div class="threshold">2,000 — 8,000 px²</div>
79
+ <div class="fits-list">
80
+ <span class="fits-yes">Title line</span>
81
+ <span class="fits-yes">Type chip</span>
82
+ <span class="fits-maybe">1-2 lines preview</span>
83
+ <span class="fits-no">Full content</span>
84
+ </div>
85
+ <div class="examples">
86
+ {#each small as info}
87
+ <div class="zone-preview small-block" style="--w: {Math.max(60, Math.sqrt(info.contentArea) * 0.9)}px; --h: {Math.max(40, info.lines * 12)}px;">
88
+ <div class="content-preview" title="{info.zoneId}: {Math.round(info.contentArea)}px²">
89
+ <div class="mini-content">{info.content.slice(0, 60)}{info.content.length > 60 ? '...' : ''}</div>
90
+ <div class="mini-lines">{info.lines} lines</div>
91
+ </div>
92
+ </div>
93
+ {:else}
94
+ <div class="empty-section">No zones in this category</div>
95
+ {/each}
96
+ </div>
97
+ </div>
98
+
99
+ <!-- Medium zones -->
100
+ <div class="scale-section medium">
101
+ <h3>🟡 Medium Zones (Preview Mode) — {medium.length} zones</h3>
102
+ <div class="threshold">8,000 — 20,000 px²</div>
103
+ <div class="fits-list">
104
+ <span class="fits-yes">Full title</span>
105
+ <span class="fits-yes">3-7 lines content</span>
106
+ <span class="fits-yes">Type chip + annotation</span>
107
+ <span class="fits-maybe">Inline editing</span>
108
+ </div>
109
+ <div class="examples">
110
+ {#each medium as info}
111
+ <div class="zone-preview medium-block" style="--w: {Math.max(100, info.contentArea / 80)}px; --h: {Math.max(60, info.lines * 14)}px;">
112
+ <div class="content-preview" title="{info.zoneId}: {Math.round(info.contentArea)}px²">
113
+ <div class="preview-body real-content">{info.content.slice(0, 180)}{info.content.length > 180 ? '...' : ''}</div>
114
+ <div class="preview-meta">{info.lines} lines • {info.contentArea < 10000 ? Math.round(info.contentArea) : Math.round(info.contentArea/1000)+'K'} px²</div>
115
+ </div>
116
+ </div>
117
+ {:else}
118
+ <div class="empty-section">No zones in this category</div>
119
+ {/each}
120
+ </div>
121
+ </div>
122
+
123
+ <!-- Large zones -->
124
+ <div class="scale-section large">
125
+ <h3>🟢 Large Zones (Full Edit) — {large.length} zones</h3>
126
+ <div class="threshold">&gt; 20,000 px²</div>
127
+ <div class="fits-list">
128
+ <span class="fits-yes">Complete content</span>
129
+ <span class="fits-yes">Full editing</span>
130
+ <span class="fits-yes">Type selector</span>
131
+ <span class="fits-yes">Annotations</span>
132
+ </div>
133
+ <div class="examples">
134
+ {#each large as info}
135
+ <div class="zone-preview large-block" style="--w: {Math.max(140, info.contentArea / 150)}px; --h: {Math.max(100, info.lines * 14)}px;">
136
+ <div class="content-preview" title="{info.zoneId}: {Math.round(info.contentArea)}px²">
137
+ <div class="preview-body large real-content">{info.content.slice(0, 400)}{info.content.length > 400 ? '...' : ''}</div>
138
+ <div class="preview-meta">{info.lines} lines • {Math.round(info.contentArea/1000)}K px²</div>
139
+ </div>
140
+ </div>
141
+ {:else}
142
+ <div class="empty-section">No zones in this category</div>
143
+ {/each}
144
+ </div>
145
+ </div>
146
+ </div>
147
+
148
+ <footer>
149
+ <p><strong>Magic formula:</strong> ZoneSize ∝ ContentArea → Tiny = ColoredBlock, Huge = FullEdit</p>
150
+ <p class="note">Pretext measures content → BSP splits proportionally → No wasted micro-zones</p>
151
+ </footer>
152
+ </div>
153
+
154
+ <style>
155
+ .infographic {
156
+ padding: 24px;
157
+ max-width: 900px;
158
+ margin: 0 auto;
159
+ font-family: system-ui, sans-serif;
160
+ color: var(--color-text-primary, #e8e4dc);
161
+ background: var(--color-bg, #1a1918);
162
+ min-height: 100vh;
163
+ overflow-y: auto;
164
+ }
165
+
166
+ header {
167
+ text-align: center;
168
+ margin-bottom: 32px;
169
+ }
170
+
171
+ .debug {
172
+ margin-top: 16px;
173
+ padding: 12px;
174
+ background: rgba(184, 115, 51, 0.1);
175
+ border: 1px solid var(--color-accent, #b87333);
176
+ border-radius: 6px;
177
+ font-family: monospace;
178
+ font-size: 12px;
179
+ text-align: left;
180
+ }
181
+
182
+ .debug ul {
183
+ margin: 8px 0;
184
+ padding-left: 20px;
185
+ }
186
+
187
+ .debug li {
188
+ margin: 2px 0;
189
+ }
190
+
191
+ h2 {
192
+ margin: 0 0 8px 0;
193
+ font-size: 24px;
194
+ color: var(--color-accent, #b87333);
195
+ }
196
+
197
+ .subtitle {
198
+ margin: 0;
199
+ color: var(--color-text-muted, #706858);
200
+ font-size: 14px;
201
+ }
202
+
203
+ .scale-container {
204
+ display: flex;
205
+ flex-direction: column;
206
+ gap: 24px;
207
+ }
208
+
209
+ .scale-section {
210
+ background: var(--color-bg-panel, #222);
211
+ border-radius: 8px;
212
+ padding: 16px;
213
+ border-left: 4px solid;
214
+ }
215
+
216
+ .scale-section.tiny { border-color: #e74c3c; }
217
+ .scale-section.small { border-color: #e67e22; }
218
+ .scale-section.medium { border-color: #f1c40f; }
219
+ .scale-section.large { border-color: #2ecc71; }
220
+
221
+ h3 {
222
+ margin: 0 0 8px 0;
223
+ font-size: 16px;
224
+ }
225
+
226
+ .threshold {
227
+ font-family: monospace;
228
+ font-size: 12px;
229
+ color: var(--color-text-muted, #706858);
230
+ margin-bottom: 12px;
231
+ }
232
+
233
+ .fits-list {
234
+ display: flex;
235
+ flex-wrap: wrap;
236
+ gap: 8px;
237
+ margin-bottom: 16px;
238
+ }
239
+
240
+ .fits-list span {
241
+ font-size: 12px;
242
+ padding: 2px 8px;
243
+ border-radius: 4px;
244
+ }
245
+
246
+ .fits-yes { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
247
+ .fits-maybe { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
248
+ .fits-no { background: rgba(231, 76, 60, 0.2); color: #e74c3c; text-decoration: line-through; }
249
+
250
+ .examples {
251
+ display: flex;
252
+ flex-wrap: wrap;
253
+ gap: 12px;
254
+ padding: 12px;
255
+ background: rgba(0, 0, 0, 0.2);
256
+ border-radius: 6px;
257
+ min-height: 60px;
258
+ }
259
+
260
+ .empty-section {
261
+ color: var(--color-text-muted, #706858);
262
+ font-size: 12px;
263
+ font-style: italic;
264
+ padding: 20px;
265
+ width: 100%;
266
+ text-align: center;
267
+ }
268
+
269
+ .zone-preview {
270
+ position: relative;
271
+ background: var(--color-bg-elevated, #2a2826);
272
+ border-radius: 4px;
273
+ display: flex;
274
+ align-items: center;
275
+ justify-content: center;
276
+ overflow: hidden;
277
+ }
278
+
279
+ .tiny-block {
280
+ width: var(--w);
281
+ height: var(--h);
282
+ }
283
+
284
+ .block-indicator {
285
+ width: 100%;
286
+ height: 100%;
287
+ background: linear-gradient(135deg, #b87333, #8b5a2b);
288
+ display: flex;
289
+ align-items: center;
290
+ justify-content: center;
291
+ font-size: 10px;
292
+ font-weight: bold;
293
+ color: #1a1918;
294
+ }
295
+
296
+ .small-block {
297
+ width: var(--w);
298
+ height: var(--h);
299
+ }
300
+
301
+ .medium-block {
302
+ width: var(--w);
303
+ height: var(--h);
304
+ min-width: 100px;
305
+ min-height: 60px;
306
+ }
307
+
308
+ .large-block {
309
+ width: var(--w);
310
+ height: var(--h);
311
+ min-width: 140px;
312
+ min-height: 100px;
313
+ }
314
+
315
+ .content-preview {
316
+ padding: 8px;
317
+ font-size: 11px;
318
+ width: 100%;
319
+ }
320
+
321
+ .mini-title {
322
+ font-weight: bold;
323
+ margin-bottom: 2px;
324
+ }
325
+
326
+ .mini-lines {
327
+ color: var(--color-text-muted, #706858);
328
+ font-size: 10px;
329
+ }
330
+
331
+ .preview-header {
332
+ font-weight: bold;
333
+ margin-bottom: 4px;
334
+ font-size: 11px;
335
+ }
336
+
337
+ .preview-body {
338
+ color: var(--color-text-secondary, #a89b8c);
339
+ font-size: 10px;
340
+ line-height: 1.4;
341
+ }
342
+
343
+ .preview-body.large {
344
+ font-size: 11px;
345
+ }
346
+
347
+ .mini-content {
348
+ font-size: 10px;
349
+ line-height: 1.3;
350
+ overflow: hidden;
351
+ display: -webkit-box;
352
+ -webkit-line-clamp: 2;
353
+ -webkit-box-orient: vertical;
354
+ }
355
+
356
+ .real-content {
357
+ white-space: pre-wrap;
358
+ overflow: hidden;
359
+ display: -webkit-box;
360
+ -webkit-line-clamp: 6;
361
+ -webkit-box-orient: vertical;
362
+ }
363
+
364
+ .preview-meta {
365
+ color: var(--color-text-muted, #706858);
366
+ font-size: 9px;
367
+ margin-top: 4px;
368
+ }
369
+
370
+ footer {
371
+ margin-top: 32px;
372
+ padding-top: 16px;
373
+ border-top: 1px solid var(--color-border, #333);
374
+ text-align: center;
375
+ }
376
+
377
+ footer p {
378
+ margin: 4px 0;
379
+ font-size: 13px;
380
+ }
381
+
382
+ footer .note {
383
+ color: var(--color-text-muted, #706858);
384
+ font-size: 12px;
385
+ }
386
+ </style>