@helix-x/datagrid-ui 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,6 +7,32 @@ and persisted column preferences.
7
7
  Its only runtime requirement is React. Styling is plain Tailwind utility
8
8
  classes, so there is no CSS file to import and no theme engine to configure.
9
9
 
10
+ ## Example
11
+
12
+ A runnable Vite gallery with a mock stock-market API lives in
13
+ [`example/`](https://github.com/suryakand/datagrid-ui/tree/main/example):
14
+
15
+ ```bash
16
+ cd example
17
+ npm install
18
+ npm run dev
19
+ ```
20
+
21
+ Four examples, all against a real server-side backend:
22
+
23
+ | | |
24
+ | --- | --- |
25
+ | **Server-side market data** | 480 symbols; paging, sorting and all four filter kinds resolved on the server, plus inline editing with server-side validation |
26
+ | **Images in rows** | company logos and analyst avatars, lazy-loaded with reserved boxes and error fallbacks |
27
+ | **Live updates** | an SSE feed patched in with `api.updateRows()` — no refetch, no lost scroll position |
28
+ | **Theme customization** | accent, density and dark mode driven entirely by CSS custom properties |
29
+
30
+ Each example sits behind a **Preview / Code** toggle — the running grid, or its
31
+ real source — and is followed by a **How it works** section pairing the
32
+ explanation with the code that implements it, deep-linked to the exact lines on
33
+ GitHub. Every snippet is extracted from the source files at build time, so none
34
+ of it can drift.
35
+
10
36
  ## Install
11
37
 
12
38
  The package is a standalone module — it can be installed from a registry, a
@@ -110,6 +136,40 @@ ids, permission checks, event handlers — belongs in `context`, which is passed
110
136
  to every `cellRenderer`. Changing `context` re-renders cells without rebuilding
111
137
  a single column definition.
112
138
 
139
+ ## API documentation
140
+
141
+ Full generated reference: **<https://suryakand.github.io/datagrid-ui/>**
142
+
143
+ Every exported symbol carries a doc comment — parameters, return values,
144
+ defaults, and runnable examples on the types you actually write
145
+ ([`ColumnDef`][cd], [`DataGridProps`][dgp], [`HxDataSource`][ds],
146
+ [`GridApi`][api]). The comments ship inside `dist/index.d.ts` too, so they
147
+ appear on hover in any editor without visiting the site.
148
+
149
+ [cd]: https://suryakand.github.io/datagrid-ui/interfaces/ColumnDef.html
150
+ [dgp]: https://suryakand.github.io/datagrid-ui/interfaces/DataGridProps.html
151
+ [ds]: https://suryakand.github.io/datagrid-ui/interfaces/HxDataSource.html
152
+ [api]: https://suryakand.github.io/datagrid-ui/interfaces/GridApi.html
153
+
154
+ Build it locally:
155
+
156
+ ```bash
157
+ npm run docs # -> docs/
158
+ npm run docs:watch
159
+ ```
160
+
161
+ The generator is [TypeDoc][td], not JSDoc. It reads the same `/** ... */`
162
+ comments but takes parameter and return types from TypeScript itself, so
163
+ signatures cannot drift from the code the way hand-written `@param {Type}`
164
+ annotations do.
165
+
166
+ [td]: https://typedoc.org
167
+
168
+ `typedoc.json` turns on link, export and coverage validation, and CI builds with
169
+ `--treatWarningsAsErrors`. A broken `{@link}`, a type referenced from the public
170
+ API but never exported, or a new export with no doc comment fails the docs build
171
+ rather than shipping a gap.
172
+
113
173
  ## Local development
114
174
 
115
175
  ```bash
@@ -117,6 +177,7 @@ npm install # build toolchain only; React comes from the host app
117
177
  npm run build # dist/ — ESM, CJS and .d.ts
118
178
  npm run dev # rebuild on change
119
179
  npm run typecheck
180
+ npm run docs # docs/ — generated API reference
120
181
  ```
121
182
 
122
183
  When an app consumes this package through a relative path or `npm link`, npm
@@ -130,6 +191,25 @@ should still be told to dedupe:
130
191
  resolve: { dedupe: ['react', 'react-dom'] }
131
192
  ```
132
193
 
194
+ ## Releasing
195
+
196
+ Two workflows, deliberately separate:
197
+
198
+ | Workflow | Trigger | What it does |
199
+ | --- | --- | --- |
200
+ | `.github/workflows/publish.yml` | push to `main` | typecheck, build, publish to npm, tag `v<version>`, create the GitHub release, then commit the next version bump |
201
+ | `.github/workflows/docs.yml` | the publish workflow completing successfully | rebuild the API reference at the released commit and deploy it to GitHub Pages |
202
+
203
+ The docs workflow keys off `workflow_run` rather than `on: release`. The publish
204
+ job creates its release with the default `GITHUB_TOKEN`, and events raised by
205
+ that token deliberately do not trigger further workflows — an `on: release`
206
+ trigger would never fire. It also checks out the publish run's `head_sha`, so
207
+ the documentation describes the code that was actually released rather than the
208
+ version-bump commit pushed on top of it.
209
+
210
+ **Repository settings this needs:** Pages source set to **GitHub Actions**
211
+ (Settings → Pages), and an `NPM_TOKEN` secret for the publish workflow.
212
+
133
213
  ## Packaging
134
214
 
135
215
  `npm pack` produces an installable tarball; `prepack` rebuilds `dist/` first,
package/dist/index.cjs CHANGED
@@ -1754,10 +1754,15 @@ function CheckboxEditor({
1754
1754
 
1755
1755
  // src/components/editors/registry.ts
1756
1756
  var BUILTIN_EDITORS = {
1757
+ /** Single-line text input. See {@link TextEditor}. */
1757
1758
  text: TextEditor,
1759
+ /** Numeric input that writes `null` when cleared. See {@link NumberEditor}. */
1758
1760
  number: NumberEditor,
1761
+ /** Native date input over `YYYY-MM-DD`. See {@link DateEditor}. */
1759
1762
  date: DateEditor,
1763
+ /** Dropdown over `editorParams.options`. See {@link SelectEditor}. */
1760
1764
  select: SelectEditor,
1765
+ /** Boolean checkbox. See {@link CheckboxEditor}. */
1761
1766
  checkbox: CheckboxEditor
1762
1767
  };
1763
1768
  var ALIGN_CLASS = {