@opengrid-ui/arco 0.0.0-stage → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Han-wangyu and OpenGrid contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Han-wangyu and OpenGrid contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ export { ArcoGridTheme, ProGrid } from './theme.js';
2
+ export type { ProGridProps } from '@opengrid-ui/pro';
3
+ export { fromArcoColumns } from './migrate.js';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import l,{useContext as g,useRef as u}from"react";import{ConfigProvider as s,Tooltip as T}from"@arco-design/web-react";import{GridEnvironmentProvider as P,localeFromHost as h,ProGrid as v}from"@opengrid-ui/pro";var G={"--og-bg":"var(--color-bg-2, #fff)","--og-header":"var(--color-fill-1, #f2f3f5)","--og-text":"var(--color-text-1, #1d2129)","--og-border":"var(--color-border-2, #e5e6eb)","--og-hover":"var(--color-fill-1, #f2f3f5)","--og-primary":"rgb(var(--primary-6, 22, 93, 255))","--og-radius":"var(--border-radius-medium, 4px)"},b={light:{"--color-bg-2":"#fff","--color-fill-1":"#f2f3f5","--color-border-2":"#e5e6eb","--color-text-1":"#1d2129"},dark:{"--color-bg-2":"#232324","--color-fill-1":"#303033","--color-border-2":"#484849","--color-text-1":"#f6f6f6"}};function c({children:i,mode:r="host",locale:e,tokens:o}){let n=g(s.ConfigContext),d=u(null),t=p=>d.current??p,a=e??h(n.locale?.locale),f={...G,...r==="host"?{}:b[r],...o};return l.createElement("div",{className:"og-theme","data-og-theme":"arco",lang:a,style:f,ref:d},l.createElement(s,{getPopupContainer:t},l.createElement(P,{value:{locale:a,tooltip:(p,m)=>l.createElement(T,{content:p,getPopupContainer:t},m)}},i)))}function C({mode:i,gridLocale:r,tokens:e,...o}){return l.createElement(c,{...i&&{mode:i},...r&&{locale:r},...e&&{tokens:e}},l.createElement(v,{...o}))}import{migrateColumn as x,migrationFields as y}from"@opengrid-ui/pro";var M=[...y,"render","placeholder","editable"];function k(i){let r=[];function e(o,n){let d=o.dataIndex?.replace(/\[(\d+)\]/g,".$1").split(".");return x({...o,field:d,render:o.render??(o.placeholder===void 0?void 0:t=>t==null?o.placeholder:String(t)),children:o.children?.map((t,a)=>e(t,`${n}.${a}`))},n,o,r,M)}return{columns:i.map((o,n)=>e(o,String(n))),diagnostics:r}}export{c as ArcoGridTheme,C as ProGrid,k as fromArcoColumns};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/theme.tsx", "../src/migrate.ts"],
4
+ "sourcesContent": ["import React, { useContext, useRef } from 'react';\nimport type { CSSProperties, ReactNode } from 'react';\nimport { ConfigProvider, Tooltip } from '@arco-design/web-react';\nimport { GridEnvironmentProvider, localeFromHost, ProGrid as BaseGrid } from '@opengrid-ui/pro';\nimport type { GridLocale, GridTokens, ProGridProps, ThemeMode } from '@opengrid-ui/pro';\n\nconst bridge: GridTokens = {\n '--og-bg': 'var(--color-bg-2, #fff)',\n '--og-header': 'var(--color-fill-1, #f2f3f5)',\n '--og-text': 'var(--color-text-1, #1d2129)',\n '--og-border': 'var(--color-border-2, #e5e6eb)',\n '--og-hover': 'var(--color-fill-1, #f2f3f5)',\n '--og-primary': 'rgb(var(--primary-6, 22, 93, 255))',\n '--og-radius': 'var(--border-radius-medium, 4px)',\n};\nconst palettes = {\n light: { '--color-bg-2': '#fff', '--color-fill-1': '#f2f3f5', '--color-border-2': '#e5e6eb', '--color-text-1': '#1d2129' },\n dark: { '--color-bg-2': '#232324', '--color-fill-1': '#303033', '--color-border-2': '#484849', '--color-text-1': '#f6f6f6' },\n};\n\ninterface ThemeProps {\n children: ReactNode;\n mode?: ThemeMode;\n locale?: GridLocale;\n tokens?: GridTokens;\n}\n\nexport function ArcoGridTheme({ children, mode = 'host', locale, tokens }: ThemeProps) {\n const host = useContext(ConfigProvider.ConfigContext);\n const scope = useRef<HTMLDivElement>(null);\n const getPopupContainer = (node: HTMLElement) => scope.current ?? node;\n const activeLocale = locale ?? localeFromHost(host.locale?.locale);\n const style = { ...bridge, ...(mode === 'host' ? {} : palettes[mode]), ...tokens } as CSSProperties;\n return <div className=\"og-theme\" data-og-theme=\"arco\" lang={activeLocale} style={style} ref={scope}>\n <ConfigProvider getPopupContainer={getPopupContainer}>\n <GridEnvironmentProvider value={{\n locale: activeLocale,\n tooltip: (content, trigger) => <Tooltip content={content} getPopupContainer={getPopupContainer}>{trigger}</Tooltip>,\n }}>{children}</GridEnvironmentProvider>\n </ConfigProvider>\n </div>;\n}\n\nexport function ProGrid<T>({ mode, gridLocale, tokens, ...props }: ProGridProps<T> & {\n mode?: ThemeMode; gridLocale?: GridLocale; tokens?: GridTokens;\n}) {\n return <ArcoGridTheme {...(mode && { mode })} {...(gridLocale && { locale: gridLocale })} {...(tokens && { tokens })}>\n <BaseGrid {...props} />\n </ArcoGridTheme>;\n}\n", "import type { TableColumnProps } from '@arco-design/web-react';\nimport { migrateColumn, migrationFields } from '@opengrid-ui/pro';\nimport type { MigrationDiagnostic, MigrationResult, ProColumn } from '@opengrid-ui/pro';\n\nconst supported = [...migrationFields, 'render', 'placeholder', 'editable'];\n\nexport function fromArcoColumns<T>(source: readonly TableColumnProps<T>[]): MigrationResult<T> {\n const diagnostics: MigrationDiagnostic[] = [];\n function convert(column: TableColumnProps<T>, index: string): ProColumn<T> {\n const field = column.dataIndex?.replace(/\\[(\\d+)\\]/g, '.$1').split('.');\n return migrateColumn({\n ...column,\n field,\n render: column.render ?? (column.placeholder === undefined\n ? undefined : value => value == null ? column.placeholder : String(value)),\n children: column.children?.map((child, childIndex) => convert(child, `${index}.${childIndex}`)),\n }, index, column, diagnostics, supported);\n }\n return { columns: source.map((column, index) => convert(column, String(index))), diagnostics };\n}\n"],
5
+ "mappings": "AAAA,OAAOA,GAAS,cAAAC,EAAY,UAAAC,MAAc,QAE1C,OAAS,kBAAAC,EAAgB,WAAAC,MAAe,yBACxC,OAAS,2BAAAC,EAAyB,kBAAAC,EAAgB,WAAWC,MAAgB,mBAG7E,IAAMC,EAAqB,CACzB,UAAW,0BACX,cAAe,+BACf,YAAa,+BACb,cAAe,iCACf,aAAc,+BACd,eAAgB,qCAChB,cAAe,kCACjB,EACMC,EAAW,CACf,MAAO,CAAE,eAAgB,OAAQ,iBAAkB,UAAW,mBAAoB,UAAW,iBAAkB,SAAU,EACzH,KAAM,CAAE,eAAgB,UAAW,iBAAkB,UAAW,mBAAoB,UAAW,iBAAkB,SAAU,CAC7H,EASO,SAASC,EAAc,CAAE,SAAAC,EAAU,KAAAC,EAAO,OAAQ,OAAAC,EAAQ,OAAAC,CAAO,EAAe,CACrF,IAAMC,EAAOd,EAAWE,EAAe,aAAa,EAC9Ca,EAAQd,EAAuB,IAAI,EACnCe,EAAqBC,GAAsBF,EAAM,SAAWE,EAC5DC,EAAeN,GAAUP,EAAeS,EAAK,QAAQ,MAAM,EAC3DK,EAAQ,CAAE,GAAGZ,EAAQ,GAAII,IAAS,OAAS,CAAC,EAAIH,EAASG,CAAI,EAAI,GAAGE,CAAO,EACjF,OAAOd,EAAA,cAAC,OAAI,UAAU,WAAW,gBAAc,OAAO,KAAMmB,EAAc,MAAOC,EAAO,IAAKJ,GAC3FhB,EAAA,cAACG,EAAA,CAAe,kBAAmBc,GACjCjB,EAAA,cAACK,EAAA,CAAwB,MAAO,CAC9B,OAAQc,EACR,QAAS,CAACE,EAASC,IAAYtB,EAAA,cAACI,EAAA,CAAQ,QAASiB,EAAS,kBAAmBJ,GAAoBK,CAAQ,CAC3G,GAAIX,CAAS,CACf,CACF,CACF,CAEO,SAASY,EAAW,CAAE,KAAAX,EAAM,WAAAY,EAAY,OAAAV,EAAQ,GAAGW,CAAM,EAE7D,CACD,OAAOzB,EAAA,cAACU,EAAA,CAAe,GAAIE,GAAQ,CAAE,KAAAA,CAAK,EAAK,GAAIY,GAAc,CAAE,OAAQA,CAAW,EAAK,GAAIV,GAAU,CAAE,OAAAA,CAAO,GAChHd,EAAA,cAACO,EAAA,CAAU,GAAGkB,EAAO,CACvB,CACF,CChDA,OAAS,iBAAAC,EAAe,mBAAAC,MAAuB,mBAG/C,IAAMC,EAAY,CAAC,GAAGD,EAAiB,SAAU,cAAe,UAAU,EAEnE,SAASE,EAAmBC,EAA4D,CAC7F,IAAMC,EAAqC,CAAC,EAC5C,SAASC,EAAQC,EAA6BC,EAA6B,CACzE,IAAMC,EAAQF,EAAO,WAAW,QAAQ,aAAc,KAAK,EAAE,MAAM,GAAG,EACtE,OAAOP,EAAc,CACnB,GAAGO,EACH,MAAAE,EACA,OAAQF,EAAO,SAAWA,EAAO,cAAgB,OAC7C,OAAYG,GAASA,GAAS,KAAOH,EAAO,YAAc,OAAOG,CAAK,GAC1E,SAAUH,EAAO,UAAU,IAAI,CAACI,EAAOC,IAAeN,EAAQK,EAAO,GAAGH,CAAK,IAAII,CAAU,EAAE,CAAC,CAChG,EAAGJ,EAAOD,EAAQF,EAAaH,CAAS,CAC1C,CACA,MAAO,CAAE,QAASE,EAAO,IAAI,CAACG,EAAQC,IAAUF,EAAQC,EAAQ,OAAOC,CAAK,CAAC,CAAC,EAAG,YAAAH,CAAY,CAC/F",
6
+ "names": ["React", "useContext", "useRef", "ConfigProvider", "Tooltip", "GridEnvironmentProvider", "localeFromHost", "BaseGrid", "bridge", "palettes", "ArcoGridTheme", "children", "mode", "locale", "tokens", "host", "scope", "getPopupContainer", "node", "activeLocale", "style", "content", "trigger", "ProGrid", "gridLocale", "props", "migrateColumn", "migrationFields", "supported", "fromArcoColumns", "source", "diagnostics", "convert", "column", "index", "field", "value", "child", "childIndex"]
7
+ }
package/dist/llms.txt ADDED
@@ -0,0 +1,164 @@
1
+ # OpenGrid
2
+
3
+ OpenGrid is an MIT-licensed React data grid for CRUD, large local datasets, and spreadsheet editing. Use it with Arco Design, Ant Design, or the host-neutral ProGrid.
4
+
5
+ [Live documentation and sandbox](https://han-wangyu.github.io/opengrid-ui/) · [GitHub releases](https://github.com/Han-wangyu/opengrid-ui/releases) · [简体中文](https://han-wangyu.github.io/opengrid-ui/?lang=zh)
6
+
7
+ ## Install
8
+
9
+ Install the Core and Pro packages from npm.
10
+
11
+ ```sh
12
+ npm install @opengrid-ui/core @opengrid-ui/pro
13
+ ```
14
+
15
+ GitHub Releases also provides versioned tarballs with SHA-256 checksums.
16
+
17
+ ```sh
18
+ release=https://github.com/Han-wangyu/opengrid-ui/releases/download/v0.1.37
19
+ npm install "$release/opengrid-ui-core-0.1.37.tgz" "$release/opengrid-ui-pro-0.1.37.tgz"
20
+ ```
21
+
22
+ ```tsx
23
+ import { ProGrid } from '@opengrid-ui/pro';
24
+ import '@opengrid-ui/core/styles.css';
25
+ import '@opengrid-ui/pro/styles.css';
26
+
27
+ const rows = [{ id: 'A-104', name: 'Lumen', amount: 230 }];
28
+
29
+ export function Invoices() {
30
+ return (
31
+ <ProGrid
32
+ label="Invoices"
33
+ rows={rows}
34
+ getRowId={row => row.id}
35
+ columns={[
36
+ { id: 'name', title: 'Account', query: true },
37
+ { id: 'amount', title: 'Amount', valueType: 'money', sortable: true },
38
+ ]}
39
+ />
40
+ );
41
+ }
42
+ ```
43
+
44
+ For native tokens and scoped tooltips, install `@opengrid-ui/arco` or `@opengrid-ui/antd` and import its `ProGrid`. Check the peer versions and React 19 setup in the [packed React and TypeScript compatibility matrix](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/compat-matrix.spec.md).
45
+
46
+ ProGrid automatically sorts and filters local datasets above 5,000 rows in a Worker. Plain pages slice the supplied data directly. The [local query contract](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/pro-crud.spec.md#local-datasets) describes refresh and data ownership.
47
+
48
+ Pass `pageData` for a page already fetched by the host. Send the current rows and full result count, and use `pager={false}` to keep the host's pagination controls. [Host-owned pages](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/pro-crud.spec.md#host-owned-pages)
49
+
50
+ Enable cell editing by passing a `spreadsheet.commit` handler. Pro uses each column's value type for the editor and respects column-level edit permissions during inline edits and pastes. The [Pro contract](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/pro-crud.spec.md#spreadsheet-editors) describes value adapters and custom editors.
51
+
52
+ Enable Core header reordering with `<Grid columnReordering />`. Drag the grip, activate two grips, or focus a grip and press an arrow key. The [Core contract](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/core-engine.spec.md#column-reordering) covers grouped headers and storing column order.
53
+
54
+ Use `useServerTree` with Core to expand remote groups in place. The [server-side row model contract](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/ssrm.spec.md) describes block requests, projections and retries.
55
+
56
+ Configure a pivot report with `PivotSidebar`. The sidebar controls result columns, filters and grouping, and applies filters through the existing pivot Worker. [Pivot sidebar](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/analytics.spec.md#pivot-sidebar)
57
+
58
+ The installed packages include `dist/llms.txt` and `dist/skills/opengrid/SKILL.md`. Coding agents can read the guide and migration instructions from the same version as the installed package.
59
+
60
+ ## Packages
61
+
62
+ | Package | Provides |
63
+ | --- | --- |
64
+ | `core` | Real DOM virtualization, column pinning and reordering, keyboard selection, TSV, edit transactions and Worker data windows |
65
+ | `pro` | Query schema, tabs, controlled state, URL history, preferences and paged selection |
66
+ | `arco`, `antd` | Scoped tokens, locale and column migration |
67
+ | `engine-wasm` | Numeric sort, filter and aggregation, plus [incremental formula sessions](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/analytics.spec.md#formulas) |
68
+ | `plugin-pivot` | Grouping, [Worker and WASM pivot views](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/analytics.spec.md#pivot), advanced filters and [lazy server groups](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/ssrm.spec.md) |
69
+ | `plugin-excel` | Styled multi-sheet XLSX and streaming CSV/XLSX IO ([workbook text contract](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/excel.spec.md)) |
70
+ | `plugin-charts` | Sparklines, conditional formatting and [charts from a spreadsheet selection](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/charts.spec.md) |
71
+
72
+ ## Verify
73
+
74
+ Use Node.js 22, Corepack, and stable Rust with the WebAssembly target for repository builds. Consumers install the already-built packages.
75
+
76
+ ```sh
77
+ corepack enable
78
+ rustup target add wasm32-unknown-unknown --toolchain stable
79
+ pnpm install --frozen-lockfile
80
+ pnpm exec playwright install chromium
81
+ pnpm verify:m4
82
+ ```
83
+
84
+ The [live comparison](https://han-wangyu.github.io/opengrid-ui/benchmark/?engine=compare) sends the same navigation and sort commands to the JS and Rust/WASM workers on 50,000 or 500,000 rows. The [reference benchmarks](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/benchmarks/m5-reference.json) measure each engine independently. Read [AGENTS.md](https://github.com/Han-wangyu/opengrid-ui/blob/main/AGENTS.md), the [contribution guide](https://github.com/Han-wangyu/opengrid-ui/blob/main/CONTRIBUTING.md), or the [agent skill](https://github.com/Han-wangyu/opengrid-ui/blob/main/skills/opengrid/SKILL.md) before changing the public contract.
85
+
86
+ # OpenGrid architecture
87
+
88
+ OpenGrid is a client-side React toolkit for CRUD pages, large datasets, and spreadsheet editing. It is independently maintained and MIT licensed.
89
+
90
+ | Layer | Ownership |
91
+ | --- | --- |
92
+ | Arco and AntD adapters | Host tokens, scoped overlays and locale, migration converters |
93
+ | Pro | Column schema, form and tabs, query store, column preferences, toolbar, and paged selection |
94
+ | Core | TanStack column model, React external-store bridge, DOM viewport, and spreadsheet interactions |
95
+ | Compute and optional plugins | JavaScript worker, Rust WebAssembly, pivot, Excel, and charts |
96
+
97
+ The data plane accepts a columnar dataset, materializes sorted or filtered views, returns only the requested viewport, and applies versioned edit transactions. A dataset epoch and query generation help callers discard late responses. Paged CRUD renders supplied rows directly. Its query state has one commit point with cancellation, stale response rejection, URL synchronization and separate tab counts.
98
+
99
+ React 17 and TypeScript 4 are supported targets alongside React 18 and 19. All packages are tested from packed artifacts in isolated applications. The [compatibility matrix](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/compat-matrix.spec.md) checks published declarations with legacy Node, Node16, NodeNext, and Bundler resolution as supported by each compiler. Core emits scoped styles. Adapters map host visual tokens into each instance and attach overlays within the instance. When a React 17 Ant Design host enables CSS variables, an explicit light or dark grid theme gets a stable key for that mounted instance.
100
+
101
+ The [milestones](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/ROADMAP.md) define observable launch criteria. [Package contracts](https://github.com/Han-wangyu/opengrid-ui/tree/main/docs/specs/) and [decision records](https://github.com/Han-wangyu/opengrid-ui/tree/main/docs/adr/) define behavior and document changes.
102
+
103
+ The first virtualizer uses an eight-million-pixel physical scroll track and arithmetic row coordinates. It measures its live viewport and keeps an overscanned window plus a prefetched worker chunk. The reference benchmark runs one engine at a time in Chromium against the production build. The 500,000-row scroll gate captures the sampled renderer JavaScript heap peak in the same trace window as the frame measurements. The public comparison starts both engines on identical datasets and displays each panel's ingestion, paint and sort timings while the two engines share the browser.
104
+
105
+ Spreadsheet keyboard navigation reveals the target row within the visible body. Core computes the nearest logical offset from the row's bounds and projects it onto the physical track, accounting for sticky headers and pinned rows.
106
+
107
+ Spreadsheet focus uses the current selection, the last selected position, or the first mounted cell in the visible window. Focus entry can remount a virtualized cell on both axes. Active descendant IDs refer to mounted cells, and pointer focus follows the cell being clicked.
108
+
109
+ Keyboard shortcuts for selecting an entire sheet, row or column preserve the active cell independently of the range endpoints. The focus owner associates the retained cell with the accepted range by its coordinates, including for host-controlled selections.
110
+
111
+ Clipboard copy captures the selected ranges and reads them in bounded windows. Each completed window is encoded as TSV; the browser consumes the text as a single clipboard item. A promised payload lets the clipboard write start during the original user gesture.
112
+
113
+ For master/detail layouts, the virtualizer retains visual row positions. The spreadsheet indexes the expanded detail positions to move between data rows and to apply clipboard and fill operations in data order.
114
+
115
+ Core's opt-in column reordering applies sibling preferences to the definitions passed to TanStack. A pointer drag resolves the destination against logical column boxes and holds capture on the header while center columns virtualize. The same sibling rules serve keyboard moves and successive grip activation.
116
+
117
+ The horizontal virtualizer stores column offsets and pin boundaries with the layout. A binary search locates the first visible center column. The mounted leaves identify the grouped headers using a per-pane ancestry index, so horizontal scroll work follows the visible columns, pinned columns and header depth.
118
+
119
+ Local [merged cells](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/core-engine.spec.md#merged-cells) use a rectangle index over logical rows and columns. The viewport mounts each intersecting merge once, preserves the anchor used for accessibility and edits, and clips its paint to the scaled track beneath pinned columns.
120
+
121
+ Pro's committed query is distinct from form drafts and asynchronously restored column preferences. An opt-in saved query read waits up to its configured deadline. The first commit combines the resulting fields with the current URL and controlled props, replaces the history entry, and starts rows and category counts. A single query slot tracks active requests by normalized key, aborts superseded work and checks each generation. A separate slot handles category counts. A pending query intent can receive controlled acknowledgements across renders. The controller keeps its staged fields out of the accepted query until they are all confirmed. Export consumers receive the query corresponding to the last accepted batch of rows. For full-query Excel export, Pro opens a host-provided revision and passes ordered, validated blocks to the workbook handler. The Excel plugin owns file encoding. Migration converters preserve native field paths and emit diagnostics for callbacks with different semantics.
122
+
123
+ Category tabs track keyboard focus within each visible list. The committed query supplies the selected path and labels the shared grid panel. Host changes to the query view and a Pro-owned page reset use a single query commit.
124
+
125
+ Each URL-synchronized grid tracks its own decoded query in browser history. Only navigation that changes that query enters the controller's replay path, preserving pending input in other grids on the page.
126
+
127
+ The query form and the header filter dialog share schema inputs. Header filter edits stay local until an explicit column change. The accepted column value is copied into the query form while its other drafts are preserved. The header dialog mounts in the owning theme container.
128
+
129
+ Pro feeds Core header moves into the same column preference as the toolbar. It reconciles the visible heading tree with the schema's hidden leaves and uses the current visible pin panes for export order.
130
+
131
+ For large local Pro queries, the browser Worker caches sort and filter columns and returns a page of original row positions. Core's compute protocol serves applications that supply full columnar datasets and edit transactions. Both paths avoid feeding the complete row model through TanStack.
132
+
133
+ When an application supplies [host-owned pages](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/pro-crud.spec.md#host-owned-pages), Pro keeps the same query intent handling and renders the page supplied by the host. The host controls page loading, retry and the authoritative result metadata.
134
+
135
+ Spreadsheet mode adds a coordinate selection model and an on-demand cell editor. Core sends scalar values through validation and the edit interface, which accepts an authoritative transaction ACK and inverse patches. Pro selects editors and edit permissions through the same column schema used for display, search and filters. A recovering Worker client captures submitted inputs, replays confirmed batches against its owned dataset checkpoint, rebuilds active views and then resumes queued work.
136
+
137
+ The [compute protocol](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/wasm-protocol.spec.md) reuses the row order when a view's definition and dependencies remain current. Spreadsheet actions bridge to one edit transaction, and recovery retries an interrupted edit with its original transaction ID.
138
+
139
+ [Selection summaries](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/core-engine.spec.md#selection-summaries) run against Worker views when the spreadsheet uses raw source values. Sheets with custom value projections read bounded blocks and yield between batches of main-thread work.
140
+
141
+ Enterprise features are explicit imports. Core supports pinned rows, dynamic heights, local cell spans, row drag, trees and nested details. Each nested grid handles its own spreadsheet input. The pivot plugin owns grouping, aggregation, filters and server-side blocks. The Excel plugin indexes the ZIP directory and streams worksheet parts in workbook tab order. Its writer flushes compressed batches against sink backpressure and observes cancellation while waiting on rows or writes. The Charts plugin renders inline sparklines and conditional formats and maps a Core spreadsheet selection to a chart adapter's series and categories. The Rust worker shares the JS transaction and viewport contract while providing native numeric sorting, filters and aggregates.
142
+
143
+ The [server-side tree](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/ssrm.spec.md) keeps a sparse list of spans for the expanded hierarchy. Core reads the requested window through its tree source capability and renders loaded siblings while child blocks resolve. New windows release abandoned requests and reuse in-flight blocks where both windows overlap.
144
+
145
+ [Pivot and formula sessions](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/specs/analytics.spec.md) use dedicated Workers when their workflows become active. Large pivot views batch numeric reducers through a lazily loaded Rust kernel. JavaScript retains the layout and source-order semantics, the Worker reuses projected columns, and the host applies custom reducers. Formula sessions keep the dependency graph off the main thread, resume formulas as their references resolve, and use acknowledged raw values for recovery.
146
+
147
+ The pivot session applies filters against its cached projections before aggregation. Sidebar filter drafts stay in the UI until the host applies them. Report-column visibility and order change the rendered columns without a pivot computation.
148
+
149
+ # Roadmap
150
+
151
+ | Milestone | Deliverables | Exit criteria |
152
+ | --- | --- | --- |
153
+ | M0 | Workspace, published contracts, fixtures, structured verification | React 17/TS4, 18 and 19 packed hosts typecheck, build and run |
154
+ | M1 | Two-dimensional virtual grid, pinned columns, grouped headers, resizing, reordering, worker sorting, native themes, benchmark | 500,000 rows reach the final row and meet agreed paint, scroll, sort and size budgets. Column moves work across the virtual window, and four theme snapshots and dual-locale isolation pass |
155
+ | M2 | Pro schema, value types, tabs, forms, toolbar, persistence, URL, selection, migration adapters | Migrated Arco and AntD examples pass request-race, StrictMode, history and persistence cases |
156
+ | M3 | Range selection, fill handle, TSV, keyboard, editing, undo/redo, aggregates, context menu | Cross-window edit and undo after worker recovery pass on 500,000 rows. IME editing passes in browser |
157
+ | M4 | Grouping, pivot, SSRM with inline expansion, filters, detail, dynamic rows, merging, row drag, tree, Excel, charts, Rust/WASM formulas | Shared engine contract passes in both engines. WASM sort and size budgets pass. The server tree reaches the end of a large group with bounded block reads |
158
+ | M5 | Bilingual documentation, sandbox, benchmark, agent skill, published packages and React 17 adoption pilot | All verification layers pass. Docs and npm packages are reachable. The pilot passes on the agreed real list page |
159
+
160
+ The two first-release scenarios are a production-style Pro migration and a 500,000-row virtual grid. Performance claims require a recorded Chromium run and reference machine.
161
+
162
+ ## First delivery
163
+
164
+ The nine packages are available from npm and as versioned GitHub release tarballs. The M5 gate checks the deployed documentation and both distribution channels. An internal rollout remains pending. See the [status board](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/progress/STATUS.md) and [publishing workflow](https://github.com/Han-wangyu/opengrid-ui/blob/main/docs/releasing.md).
@@ -0,0 +1,3 @@
1
+ import type { TableColumnProps } from '@arco-design/web-react';
2
+ import type { MigrationResult } from '@opengrid-ui/pro';
3
+ export declare function fromArcoColumns<T>(source: readonly TableColumnProps<T>[]): MigrationResult<T>;
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: opengrid
3
+ description: Build and migrate OpenGrid React tables, CRUD pages, virtual grids, and spreadsheet interactions with Arco Design or Ant Design.
4
+ ---
5
+
6
+ # OpenGrid
7
+
8
+ Use this skill when adding an OpenGrid table or migrating native Arco or Ant Design columns.
9
+
10
+ 1. Match the host's React, TypeScript, and design-system versions against the compatibility matrix. Use the public tarballs from the tagged GitHub release.
11
+ 2. Import `@opengrid-ui/core/styles.css` and also `@opengrid-ui/pro/styles.css` when rendering ProGrid.
12
+ 3. Pick `@opengrid-ui/pro` for a host-neutral CRUD UI or the `arco` and `antd` adapter package for native tokens, locale, and overlays. Set a stable row ID.
13
+ 4. Declare fields, labels, search controls, and renderers in one column schema. Native converters return diagnostics. Resolve any diagnostic relevant to the current page.
14
+ 5. Use the single request callback for remote CRUD. Pass AbortSignal to the API and keep pagination and controls in the supplied dual-mode contract. Keep URL ownership with one layer.
15
+ 6. ProGrid sorts and filters local `rows` above 5,000 records in a Worker. For a large columnar dataset and explicit viewport control, initialize an engine, create a view, and pass `computedSource(engine, view)` to Core. Only enable spreadsheet writes when an authoritative transaction handler is available.
16
+ 7. Pass `columnReordering` to Core to expose drag, tap and keyboard moves. Use `columnReordering={{ order, onOrderChange }}` for a persisted order of group and leaf IDs. Each gesture stays within the original group and pin pane.
17
+ 8. For inline server groups, use `useServerTree` from the pivot plugin and pass its source to Core. Keep the provider and accessors stable, and return each path's total with its requested block. Include group and row identity fields in every projection.
18
+ 9. When a host request hook returns an already paginated result, pass `pageData={{ rows, total, loading }}`. Keep the host request and URL wiring through the existing query callbacks. Use `pager={false}` to keep the host's pager.
19
+ 10. For a configurable pivot report, use `PivotSidebar` with `columnSettings` and `filters`. Send the applied expression to `usePivot` and render `visiblePivotColumns` from the report. Import the pivot sidebar stylesheet once in the host.
20
+ 7. For chart actions, use the Charts plugin's `chartMenuItem` in `spreadsheet.contextMenu` and render the `ChartRange` delivered to your app. The selection reader works with local rows and computed viewports.
21
+ 8. Use `usePivot` to tie a pivot Worker to a React view. Use `createFormulaSession` for background formula recalculation and dispose it when leaving the workflow.
22
+ 9. Validate via an isolated consumer install and its actual host build. Exercise deep links, focus, overlays, edit/undo and representative scrolling with Chromium.
23
+
24
+ See [API contracts](https://github.com/Han-wangyu/opengrid-ui/tree/main/docs/specs), the [live sandbox](https://han-wangyu.github.io/opengrid-ui/) and the [benchmark methodology](https://github.com/Han-wangyu/opengrid-ui/tree/main/docs/benchmarks).
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { ReactNode } from 'react';
3
+ import type { GridLocale, GridTokens, ProGridProps, ThemeMode } from '@opengrid-ui/pro';
4
+ interface ThemeProps {
5
+ children: ReactNode;
6
+ mode?: ThemeMode;
7
+ locale?: GridLocale;
8
+ tokens?: GridTokens;
9
+ }
10
+ export declare function ArcoGridTheme({ children, mode, locale, tokens }: ThemeProps): React.JSX.Element;
11
+ export declare function ProGrid<T>({ mode, gridLocale, tokens, ...props }: ProGridProps<T> & {
12
+ mode?: ThemeMode;
13
+ gridLocale?: GridLocale;
14
+ tokens?: GridTokens;
15
+ }): React.JSX.Element;
16
+ export {};
package/package.json CHANGED
@@ -1,6 +1 @@
1
- {
2
- "name": "@opengrid-ui/arco",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {"name":"@opengrid-ui/arco","version":"0.1.37","license":"MIT","type":"module","repository":{"type":"git","url":"git+https://github.com/Han-wangyu/opengrid-ui.git","directory":"packages/arco"},"files":["dist","LICENSE"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"sideEffects":false,"publishConfig":{"access":"public"},"scripts":{"build":"node ../../scripts/build-package.mjs"},"peerDependencies":{"react":"^17.0.2 || ^18.0.0 || ^19.0.0","react-dom":"^17.0.2 || ^18.0.0 || ^19.0.0","@arco-design/web-react":">=2.62.1 <3"},"dependencies":{"@opengrid-ui/pro":"^0.1.37"},"devDependencies":{"@arco-design/web-react":"2.62.1"}}
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.