vastgrid 0.2.0 → 0.2.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/dist/core/types.d.ts +1 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/package.json +3 -3
- package/src/core/types.ts +1 -0
package/dist/core/types.d.ts
CHANGED
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,eAAe,EACf,SAAS,EACT,YAAY,EACZ,WAAW,EACX,SAAS,EACT,SAAS,EACT,IAAI,EACJ,MAAM,EACP,MAAM,eAAe,CAAC;AAEvB,oGAAoG;AACpG,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0CAA0C;AAC1C,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,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AY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACxD,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;QACrD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACpD,GAAG,IAAI,CAAC;CACV"}
|
package/dist/core/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GridError","Error","constructor","code","message","extra","name","reason","undefined","path","details","op"],"sources":["types.ts"],"sourcesContent":["import type {\n Capabilities,\n Column,\n CommandError,\n DisplayedColumn,\n ErrorCode,\n GridDocument,\n GridSession,\n JsonValue,\n Operation,\n Plan,\n RowKey,\n} from \"vastgrid-spec\";\n\n/** The table's edits version and the number of cells written so far (§8.2 of the specification). */\nexport interface Edits {\n version: number;\n cells: number;\n}\n\n/** What `open` and `info` give (§8.2). */\nexport interface TableInfo {\n /** The engine's id of the open table, for later requests. */\n table: string;\n revision: string | null;\n edits: Edits;\n status: \"loading\" | \"ready\" | \"error\";\n progress: number | null;\n /** Null while the table loads. */\n rowCount: number | null;\n readableRows: number;\n columns: Column[];\n capabilities: Capabilities;\n format?: string;\n byteSize?: number;\n notes?: string[];\n sheets?: { name: string; hidden?: boolean }[];\n sheet?: string;\n error?: string;\n /** The file changed on disk since the table, which has written cells, was read (§7.6); `reload` reads it again. */\n fileChanged?: boolean;\n}\n\n/** A view as `rows` reports it (§8.2, §9). */\nexport interface ViewInfo {\n hash: string;\n status: \"building\" | \"ready\";\n rowCount: number;\n rowCountExact: boolean;\n readableRows: number;\n columns: Column[];\n edits: Edits;\n partial?: boolean;\n}\n\n/** The result of `rows` (§8.2), with its block in the structured encoding. */\nexport interface RowsResult {\n view: ViewInfo;\n start: number;\n end: number;\n rowIds: number[] | null;\n block: { bytes: Uint8Array };\n truncated?: Record<string, number[]>;\n}\n\n/** The `read` options of `open` (§8.2). */\nexport interface OpenOptions {\n sheet?: string;\n headerRow?: number;\n keepEmptyRows?: boolean;\n keepEmptyColumns?: boolean;\n}\n\n/** A request (§8.1). */\nexport interface RequestMessage {\n v: 2;\n id: number;\n op: Operation;\n [member: string]: unknown;\n}\n\n/**\n * Rows read on a server for the first render (§7 of react.md): the table, the plan they were read for, and\n * the answer of `rows`. A store given them shows these rows before it reads any.\n */\nexport interface InitialView {\n table: TableInfo;\n plan: Plan;\n rows: RowsResult;\n}\n\n/** A failed request (§8.7), or a response that does not follow §8 (`internal`). */\nexport class GridError extends Error {\n readonly code: ErrorCode;\n readonly reason?: string;\n readonly path?: string;\n readonly details?: Record<string, unknown>;\n /** The operation of the request that failed. */\n readonly op?: Operation;\n\n constructor(\n code: ErrorCode,\n message: string,\n extra: { reason?: string; path?: string; details?: Record<string, unknown>; op?: Operation } = {},\n ) {\n super(message);\n this.name = \"GridError\";\n this.code = code;\n if (extra.reason !== undefined) this.reason = extra.reason;\n if (extra.path !== undefined) this.path = extra.path;\n if (extra.details !== undefined) this.details = extra.details;\n if (extra.op !== undefined) this.op = extra.op;\n }\n}\n\n/** What a dispatched command came to: its output, or why it failed (§4.2 of react.md). */\nexport type CommandOutcome = { ok: true; output?: unknown } | { ok: false; error: CommandError | GridError };\n\n/** One update of a `write` request (§7.2 of the specification). */\nexport interface WriteUpdate {\n readonly key: RowKey;\n readonly column: string;\n readonly value: JsonValue;\n readonly previous?: JsonValue;\n}\n\n/**\n * The last write that failed (§6.6 of react.md), which `retryWrite` sends again and `discardWrite` forgets.\n * `retry` tells how it can be sent again: the same write (`\"retry\"`), after an `edit_conflict` without the\n * `previous` values (`\"overwrite\"`), or not at all (null): the table has another revision now, or the engine\n * refused the values or the cells.\n */\nexport interface FailedWrite {\n /** The command whose write it was. */\n readonly command: string;\n readonly updates: readonly WriteUpdate[];\n readonly revision: string | null;\n readonly rowKey?: string | readonly string[];\n readonly error: GridError;\n readonly retry: \"retry\" | \"overwrite\" | null;\n}\n\n/** What the grid shows. A snapshot is never changed: the store makes a new one for every change. */\nexport interface GridSnapshot {\n readonly document: GridDocument;\n readonly session: GridSession;\n /** Null until the table is open. */\n readonly table: TableInfo | null;\n /** The view on screen; null until its first rows are read. */\n readonly view: ViewInfo | null;\n /** The displayed columns of the view on screen (§5.1.1), in display order. */\n readonly displayed: readonly DisplayedColumn[];\n /** A plan whose view is being read to replace the one on screen. */\n readonly pending: { readonly plan: Plan } | null;\n readonly status: \"idle\" | \"opening\" | \"ready\" | \"error\";\n /** The last failure that belongs to no command. */\n readonly error: GridError | null;\n /** The last write that failed, until it is sent again or discarded. */\n readonly failedWrite: FailedWrite | null;\n /**\n * The totals row (§5.1): the total of each displayed column that has one, over the whole view on screen, with\n * the types of the values; null without totals, or for a view that groups rows.\n */\n readonly totals: {\n readonly values: Readonly<Record<string, JsonValue>>;\n readonly columns: Readonly<Record<string, Column>>;\n } | null;\n}\n"],"mappings":"AAcA;;AAMA;;AAuBA;;AAYA;;AAUA;;
|
|
1
|
+
{"version":3,"names":["GridError","Error","constructor","code","message","extra","name","reason","undefined","path","details","op"],"sources":["types.ts"],"sourcesContent":["import type {\n Capabilities,\n Column,\n CommandError,\n DisplayedColumn,\n ErrorCode,\n GridDocument,\n GridSession,\n JsonValue,\n Operation,\n Plan,\n RowKey,\n} from \"vastgrid-spec\";\n\n/** The table's edits version and the number of cells written so far (§8.2 of the specification). */\nexport interface Edits {\n version: number;\n cells: number;\n}\n\n/** What `open` and `info` give (§8.2). */\nexport interface TableInfo {\n /** The engine's id of the open table, for later requests. */\n table: string;\n revision: string | null;\n edits: Edits;\n status: \"loading\" | \"ready\" | \"error\";\n progress: number | null;\n /** Null while the table loads. */\n rowCount: number | null;\n readableRows: number;\n columns: Column[];\n capabilities: Capabilities;\n format?: string;\n byteSize?: number;\n notes?: string[];\n sheets?: { name: string; hidden?: boolean }[];\n sheet?: string;\n error?: string;\n /** The file changed on disk since the table, which has written cells, was read (§7.6); `reload` reads it again. */\n fileChanged?: boolean;\n}\n\n/** A view as `rows` reports it (§8.2, §9). */\nexport interface ViewInfo {\n hash: string;\n status: \"building\" | \"ready\";\n rowCount: number;\n rowCountExact: boolean;\n readableRows: number;\n columns: Column[];\n edits: Edits;\n partial?: boolean;\n}\n\n/** The result of `rows` (§8.2), with its block in the structured encoding. */\nexport interface RowsResult {\n view: ViewInfo;\n start: number;\n end: number;\n rowIds: number[] | null;\n block: { bytes: Uint8Array };\n truncated?: Record<string, number[]>;\n}\n\n/** The `read` options of `open` (§8.2). */\nexport interface OpenOptions {\n sheet?: string;\n headerRow?: number;\n delimiter?: string;\n keepEmptyRows?: boolean;\n keepEmptyColumns?: boolean;\n}\n\n/** A request (§8.1). */\nexport interface RequestMessage {\n v: 2;\n id: number;\n op: Operation;\n [member: string]: unknown;\n}\n\n/**\n * Rows read on a server for the first render (§7 of react.md): the table, the plan they were read for, and\n * the answer of `rows`. A store given them shows these rows before it reads any.\n */\nexport interface InitialView {\n table: TableInfo;\n plan: Plan;\n rows: RowsResult;\n}\n\n/** A failed request (§8.7), or a response that does not follow §8 (`internal`). */\nexport class GridError extends Error {\n readonly code: ErrorCode;\n readonly reason?: string;\n readonly path?: string;\n readonly details?: Record<string, unknown>;\n /** The operation of the request that failed. */\n readonly op?: Operation;\n\n constructor(\n code: ErrorCode,\n message: string,\n extra: { reason?: string; path?: string; details?: Record<string, unknown>; op?: Operation } = {},\n ) {\n super(message);\n this.name = \"GridError\";\n this.code = code;\n if (extra.reason !== undefined) this.reason = extra.reason;\n if (extra.path !== undefined) this.path = extra.path;\n if (extra.details !== undefined) this.details = extra.details;\n if (extra.op !== undefined) this.op = extra.op;\n }\n}\n\n/** What a dispatched command came to: its output, or why it failed (§4.2 of react.md). */\nexport type CommandOutcome = { ok: true; output?: unknown } | { ok: false; error: CommandError | GridError };\n\n/** One update of a `write` request (§7.2 of the specification). */\nexport interface WriteUpdate {\n readonly key: RowKey;\n readonly column: string;\n readonly value: JsonValue;\n readonly previous?: JsonValue;\n}\n\n/**\n * The last write that failed (§6.6 of react.md), which `retryWrite` sends again and `discardWrite` forgets.\n * `retry` tells how it can be sent again: the same write (`\"retry\"`), after an `edit_conflict` without the\n * `previous` values (`\"overwrite\"`), or not at all (null): the table has another revision now, or the engine\n * refused the values or the cells.\n */\nexport interface FailedWrite {\n /** The command whose write it was. */\n readonly command: string;\n readonly updates: readonly WriteUpdate[];\n readonly revision: string | null;\n readonly rowKey?: string | readonly string[];\n readonly error: GridError;\n readonly retry: \"retry\" | \"overwrite\" | null;\n}\n\n/** What the grid shows. A snapshot is never changed: the store makes a new one for every change. */\nexport interface GridSnapshot {\n readonly document: GridDocument;\n readonly session: GridSession;\n /** Null until the table is open. */\n readonly table: TableInfo | null;\n /** The view on screen; null until its first rows are read. */\n readonly view: ViewInfo | null;\n /** The displayed columns of the view on screen (§5.1.1), in display order. */\n readonly displayed: readonly DisplayedColumn[];\n /** A plan whose view is being read to replace the one on screen. */\n readonly pending: { readonly plan: Plan } | null;\n readonly status: \"idle\" | \"opening\" | \"ready\" | \"error\";\n /** The last failure that belongs to no command. */\n readonly error: GridError | null;\n /** The last write that failed, until it is sent again or discarded. */\n readonly failedWrite: FailedWrite | null;\n /**\n * The totals row (§5.1): the total of each displayed column that has one, over the whole view on screen, with\n * the types of the values; null without totals, or for a view that groups rows.\n */\n readonly totals: {\n readonly values: Readonly<Record<string, JsonValue>>;\n readonly columns: Readonly<Record<string, Column>>;\n } | null;\n}\n"],"mappings":"AAcA;;AAMA;;AAuBA;;AAYA;;AAUA;;AASA;;AAQA;AACA;AACA;AACA;;AAOA;AACA,OAAO,MAAMA,SAAS,SAASC,KAAK,CAAC;EAKnC;;EAGAC,WAAWA,CACTC,IAAe,EACfC,OAAe,EACfC,KAA4F,GAAG,CAAC,CAAC,EACjG;IACA,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,WAAW;IACvB,IAAI,CAACH,IAAI,GAAGA,IAAI;IAChB,IAAIE,KAAK,CAACE,MAAM,KAAKC,SAAS,EAAE,IAAI,CAACD,MAAM,GAAGF,KAAK,CAACE,MAAM;IAC1D,IAAIF,KAAK,CAACI,IAAI,KAAKD,SAAS,EAAE,IAAI,CAACC,IAAI,GAAGJ,KAAK,CAACI,IAAI;IACpD,IAAIJ,KAAK,CAACK,OAAO,KAAKF,SAAS,EAAE,IAAI,CAACE,OAAO,GAAGL,KAAK,CAACK,OAAO;IAC7D,IAAIL,KAAK,CAACM,EAAE,KAAKH,SAAS,EAAE,IAAI,CAACG,EAAE,GAAGN,KAAK,CAACM,EAAE;EAChD;AACF;;AAEA;;AAGA;;AAQA;AACA;AACA;AACA;AACA;AACA;;AAWA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vastgrid",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A canvas data grid for React that opens tables of any size like a spreadsheet: sort, filter, group, pivot, edit, undo and export, driven by a typed document, session and commands.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"node": ">=20"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"vastgrid-spec": "0.2.
|
|
62
|
+
"vastgrid-spec": "0.2.1"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"react": "^19.3.0",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"vastgrid-js": "0.2.
|
|
77
|
+
"vastgrid-js": "0.2.1"
|
|
78
78
|
}
|
|
79
79
|
}
|