{"_id":"@ai-path/lattica-react","_rev":"4-1d370da153dcff38014b878087ab8885","name":"@ai-path/lattica-react","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@ai-path/lattica-react","version":"0.1.0","license":"MIT","_id":"@ai-path/lattica-react@0.1.0","maintainers":[{"name":"fsakurai","email":"f-sakurai@ai-path.jp"}],"dist":{"shasum":"3d0a265c6dd0f6a7d1aa046611d7a35094e3ba2b","tarball":"https://registry.npmjs.org/@ai-path/lattica-react/-/lattica-react-0.1.0.tgz","fileCount":8,"integrity":"sha512-8YL+tzPjiS7eCWvLu5eiMRoCIbyMnYTYwrzZ/OcbUlm76C1FlhmXOLMJ/J0fw/SeXYWcy0DLZy9SMs5kP1LagQ==","signatures":[{"sig":"MEQCIFTTbuysNbG72a8Sv4jh8TGZJUoqkB7b7u7Axwzo4dbnAiARFVMKQkgaABU0jB/HGBl1f3F0kzjTUqAxmEwmrcCOIQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":874858},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"2e14dee9aa41d49bc8899cc2091f182e6f3dd349","scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"fsakurai","email":"f-sakurai@ai-path.jp"},"_npmVersion":"10.9.3","description":"React bindings for Lattica: a canvas-rendered, virtualized data grid with DOM editing overlay, multi-level grouping headers, and IME-aware editing.","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"@ai-path/lattica-core":"workspace:*","@ai-path/lattica-data":"workspace:*","@ai-path/lattica-formula":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/lattica-react_0.1.0_1783152247159_0.8592657793775031","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @ai-path/tb-react (product: Taible). Install @ai-path/tb-react instead."},"0.1.1":{"name":"@ai-path/lattica-react","version":"0.1.1","license":"MIT","_id":"@ai-path/lattica-react@0.1.1","maintainers":[{"name":"fsakurai","email":"f-sakurai@ai-path.jp"}],"dist":{"shasum":"744bc022025b5ee71c14e1765f7ceebf4088428a","tarball":"https://registry.npmjs.org/@ai-path/lattica-react/-/lattica-react-0.1.1.tgz","fileCount":9,"integrity":"sha512-rF/8ku5CCvscbPw1JIu8eFnNmlplswRmWM+pAQVHKIOSfMY5YweEEey8o7F9CBF5zmxNTySvEVGeqyMmghS4cw==","signatures":[{"sig":"MEYCIQDf1P6n32G7psHaKGJ8dvxa2Eh4671SkNjK4tNUHVzJwAIhALYBoYa6BaCIEvxUUP3WGvTxPPVF97fXcObdh2thRtAY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":875928},"main":"./dist/index.cjs","type":"module","_from":"file:/tmp/lattica-publish/ai-path-lattica-react-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"fsakurai","email":"f-sakurai@ai-path.jp"},"_resolved":"/tmp/lattica-publish/ai-path-lattica-react-0.1.1.tgz","_integrity":"sha512-rF/8ku5CCvscbPw1JIu8eFnNmlplswRmWM+pAQVHKIOSfMY5YweEEey8o7F9CBF5zmxNTySvEVGeqyMmghS4cw==","_npmVersion":"10.9.3","description":"React bindings for Lattica: a canvas-rendered, virtualized data grid with DOM editing overlay, multi-level grouping headers, and IME-aware editing.","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"@ai-path/lattica-core":"0.1.0","@ai-path/lattica-data":"0.1.1","@ai-path/lattica-formula":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/lattica-react_0.1.1_1783159896704_0.25446435642275045","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @ai-path/tb-react (product: Taible). Install @ai-path/tb-react instead."},"0.1.2":{"name":"@ai-path/lattica-react","version":"0.1.2","license":"MIT","_id":"@ai-path/lattica-react@0.1.2","maintainers":[{"name":"fsakurai","email":"f-sakurai@ai-path.jp"}],"dist":{"shasum":"435296f1dc85cf6b7bae6b3f6e309ca9dfc8a44c","tarball":"https://registry.npmjs.org/@ai-path/lattica-react/-/lattica-react-0.1.2.tgz","fileCount":9,"integrity":"sha512-6uGTLd5bUAfAKlemNDpN/Sb/Ua23Kn6AeZmgpCQjRWEoSNvYSYxvywntGrJc6N0F6uZKdeejeI1WTSkVVvIAGQ==","signatures":[{"sig":"MEYCIQCszdFkZS1fH93MqVvkc5bwe8Tek6PVn/7ONs9wruVKxgIhAN6yPvrxsOJpClwSTSsu6WCAGjvGOKvCQZ5bcObO0CFM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":966750},"main":"./dist/index.cjs","type":"module","_from":"file:ai-path-lattica-react-0.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"fsakurai","email":"f-sakurai@ai-path.jp"},"_resolved":"/private/var/folders/tf/0c43660d4k1dg4ssxq0n63ww0000gn/T/c7788d24a4cb4cb581d50e353532e6ae/ai-path-lattica-react-0.1.2.tgz","_integrity":"sha512-6uGTLd5bUAfAKlemNDpN/Sb/Ua23Kn6AeZmgpCQjRWEoSNvYSYxvywntGrJc6N0F6uZKdeejeI1WTSkVVvIAGQ==","_npmVersion":"10.9.3","description":"React bindings for Lattica: a canvas-rendered, virtualized data grid with DOM editing overlay, multi-level grouping headers, and IME-aware editing.","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"@ai-path/lattica-core":"0.1.1","@ai-path/lattica-data":"0.1.2","@ai-path/lattica-formula":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/lattica-react_0.1.2_1783177113834_0.4229711527393514","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @ai-path/tb-react (product: Taible). Install @ai-path/tb-react instead."}},"time":{"created":"2026-07-04T08:04:06.984Z","modified":"2026-07-04T16:08:52.965Z","0.1.0":"2026-07-04T08:04:07.334Z","0.1.1":"2026-07-04T10:11:36.842Z","0.1.2":"2026-07-04T14:58:34.020Z"},"license":"MIT","description":"React bindings for Lattica: a canvas-rendered, virtualized data grid with DOM editing overlay, multi-level grouping headers, and IME-aware editing.","maintainers":[{"name":"fsakurai","email":"f-sakurai@ai-path.jp"}],"readme":"# @ai-path/lattica-react\n\nThe canvas-rendered, virtualized React data grid for Lattica. `<LatticaGrid>` is\na thin view over a headless `GridController` that owns the formula engine,\nrow/column sizing, selection, and undo. The cell body is painted on a single\n`<canvas>` for performance, while headers and the active-cell editor stay in the\nDOM for accessibility and IME-aware input. All non-trivial math lives in pure,\ntested modules (geometry, scene, painter, keyboard, scroll, measure).\n\n## Install\n\n```sh\npnpm add @ai-path/lattica-react\n```\n\n## API overview\n\n### LatticaGrid + useGridController\n\nCreate a controller with `useGridController` and pass it to `<LatticaGrid>`.\n\n```tsx\nimport { LatticaGrid, useGridController } from '@ai-path/lattica-react';\n\nfunction Sheet() {\n  const controller = useGridController({ rowCount: 1000, colCount: 26 });\n  controller.setCellText(0, 0, 'Hello');\n  controller.setCellText(1, 0, '=2+2');\n  return <LatticaGrid controller={controller} width={800} height={500} />;\n}\n```\n\n`LatticaGridProps` also accepts `columns` (multi-level `ColumnNode[]`), `theme`\n(`Partial<GridTheme>`), `className`, `style`, and a `contextMenu` builder.\n\n### Driving the controller\n\nThe controller exposes intent-level methods that the view renders:\n\n```ts\ncontroller.setCellText(2, 0, '=SUM(A1:A2)'); // undoable edit\ncontroller.getDisplay(2, 0);                 // formatted value, e.g. '4'\ncontroller.toggleSort(0);                    // sort by visual column 0\ncontroller.setColumnFilter(1, [{ kind: 'gt', value: 100 }]);\ncontroller.runSearch('total', { caseSensitive: false }); // returns hit count\ncontroller.undoLast();\n```\n\n### Cell types\n\nThe `CellTypeRegistry` maps a column type name to a `CellRenderer`.\n`defaultCellTypes` ships with `text`, `number`, and `boolean` renderers\n(`builtinRenderers`); register your own and assign it to a column.\n\n```ts\nimport { defaultCellTypes, drawCellText, type CellRenderer } from '@ai-path/lattica-react';\n\nconst badge: CellRenderer = (ctx) => drawCellText({ ...ctx, align: 'center' });\ndefaultCellTypes.register('badge', badge);\ncontroller.setColumnType(2, 'badge'); // physical column index\n```\n\n### Theming & presets\n\n```ts\nimport { resolveTheme, themePresets, getPreset, darkTheme } from '@ai-path/lattica-react';\n\nconst theme = resolveTheme({ ...darkTheme });\nconst preset = getPreset('highContrast'); // from themePresets\n```\n\n### Other exports\n\n- Geometry/hit-testing: `hitTest`, `cellRect`, `columnAt`, `rowAt`, `maxScroll`.\n- Rendering internals: `buildScene`, `paintScene` (`Canvas2D`), `visibleIndices`.\n- Interaction: `interpretKey`, `ShortcutRegistry` / `normalizeChord`, `buildMenu` / `findItem` / `runItem`.\n- Sizing: `wrapText`, `autoColumnWidth`, `autoRowHeight`.\n- Accessibility: `gridAria`, `rowAria`, `cellAria`, `columnHeaderAria`, `rowHeaderAria`.\n- i18n: `I18n`, `enUS`, `jaJP`.\n- Resize hit-testing: `hitColumnBorder`, `hitRowBorder`, `hitResizeHandle`.\n","readmeFilename":"README.md"}