@datalayer/cells 0.0.0-stage → 0.0.2

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 (96) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -2
  3. package/lib/chrome/index.d.ts +7 -0
  4. package/lib/chrome/index.d.ts.map +1 -0
  5. package/lib/chrome/index.js +7 -0
  6. package/lib/chrome/index.js.map +1 -0
  7. package/lib/collab/index.d.ts +7 -0
  8. package/lib/collab/index.d.ts.map +1 -0
  9. package/lib/collab/index.js +7 -0
  10. package/lib/collab/index.js.map +1 -0
  11. package/lib/core/axis.d.ts +103 -0
  12. package/lib/core/axis.d.ts.map +1 -0
  13. package/lib/core/axis.js +470 -0
  14. package/lib/core/axis.js.map +1 -0
  15. package/lib/core/cells.d.ts +71 -0
  16. package/lib/core/cells.d.ts.map +1 -0
  17. package/lib/core/cells.js +285 -0
  18. package/lib/core/cells.js.map +1 -0
  19. package/lib/core/commands.d.ts +157 -0
  20. package/lib/core/commands.d.ts.map +1 -0
  21. package/lib/core/commands.js +620 -0
  22. package/lib/core/commands.js.map +1 -0
  23. package/lib/core/format.d.ts +52 -0
  24. package/lib/core/format.d.ts.map +1 -0
  25. package/lib/core/format.js +264 -0
  26. package/lib/core/format.js.map +1 -0
  27. package/lib/core/history.d.ts +42 -0
  28. package/lib/core/history.d.ts.map +1 -0
  29. package/lib/core/history.js +63 -0
  30. package/lib/core/history.js.map +1 -0
  31. package/lib/core/index.d.ts +23 -0
  32. package/lib/core/index.d.ts.map +1 -0
  33. package/lib/core/index.js +28 -0
  34. package/lib/core/index.js.map +1 -0
  35. package/lib/core/model.d.ts +116 -0
  36. package/lib/core/model.d.ts.map +1 -0
  37. package/lib/core/model.js +330 -0
  38. package/lib/core/model.js.map +1 -0
  39. package/lib/core/patches.d.ts +140 -0
  40. package/lib/core/patches.d.ts.map +1 -0
  41. package/lib/core/patches.js +272 -0
  42. package/lib/core/patches.js.map +1 -0
  43. package/lib/core/reactor.d.ts +24 -0
  44. package/lib/core/reactor.d.ts.map +1 -0
  45. package/lib/core/reactor.js +48 -0
  46. package/lib/core/reactor.js.map +1 -0
  47. package/lib/core/selection.d.ts +81 -0
  48. package/lib/core/selection.d.ts.map +1 -0
  49. package/lib/core/selection.js +175 -0
  50. package/lib/core/selection.js.map +1 -0
  51. package/lib/core/strings.d.ts +19 -0
  52. package/lib/core/strings.d.ts.map +1 -0
  53. package/lib/core/strings.js +61 -0
  54. package/lib/core/strings.js.map +1 -0
  55. package/lib/core/styles.d.ts +48 -0
  56. package/lib/core/styles.d.ts.map +1 -0
  57. package/lib/core/styles.js +102 -0
  58. package/lib/core/styles.js.map +1 -0
  59. package/lib/core/values.d.ts +20 -0
  60. package/lib/core/values.d.ts.map +1 -0
  61. package/lib/core/values.js +39 -0
  62. package/lib/core/values.js.map +1 -0
  63. package/lib/core/workbook.d.ts +59 -0
  64. package/lib/core/workbook.d.ts.map +1 -0
  65. package/lib/core/workbook.js +101 -0
  66. package/lib/core/workbook.js.map +1 -0
  67. package/lib/core/zone.d.ts +48 -0
  68. package/lib/core/zone.d.ts.map +1 -0
  69. package/lib/core/zone.js +89 -0
  70. package/lib/core/zone.js.map +1 -0
  71. package/lib/csv/index.d.ts +7 -0
  72. package/lib/csv/index.d.ts.map +1 -0
  73. package/lib/csv/index.js +7 -0
  74. package/lib/csv/index.js.map +1 -0
  75. package/lib/index.d.ts +8 -0
  76. package/lib/index.d.ts.map +1 -0
  77. package/lib/index.js +13 -0
  78. package/lib/index.js.map +1 -0
  79. package/lib/plugin/index.d.ts +7 -0
  80. package/lib/plugin/index.d.ts.map +1 -0
  81. package/lib/plugin/index.js +7 -0
  82. package/lib/plugin/index.js.map +1 -0
  83. package/lib/points/index.d.ts +154 -0
  84. package/lib/points/index.d.ts.map +1 -0
  85. package/lib/points/index.js +50 -0
  86. package/lib/points/index.js.map +1 -0
  87. package/lib/points/resolve.d.ts +56 -0
  88. package/lib/points/resolve.d.ts.map +1 -0
  89. package/lib/points/resolve.js +106 -0
  90. package/lib/points/resolve.js.map +1 -0
  91. package/lib/xlsx/index.d.ts +7 -0
  92. package/lib/xlsx/index.d.ts.map +1 -0
  93. package/lib/xlsx/index.js +7 -0
  94. package/lib/xlsx/index.js.map +1 -0
  95. package/package.json +116 -4
  96. package/style/cells.css +7 -0
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@datalayer/cells/csv`: CSV and TSV in and out.
3
+ *
4
+ * @module csv
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/csv/index.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AAEH,OAAO,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022-2026 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/csv/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `@datalayer/cells`: a spreadsheet drawn on canvas, as a React component.
3
+ * Everything of `./core` is re-exported here, so a host imports from one place.
4
+ *
5
+ * @module cells
6
+ */
7
+ export * from './core/index.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH,cAAc,iBAAiB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Copyright (c) 2022-2026 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * `@datalayer/cells`: a spreadsheet drawn on canvas, as a React component.
8
+ * Everything of `./core` is re-exported here, so a host imports from one place.
9
+ *
10
+ * @module cells
11
+ */
12
+ export * from './core/index.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AAEH,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@datalayer/cells/plugin`: the Reactor plugin.
3
+ *
4
+ * @module plugin
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AAEH,OAAO,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022-2026 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,154 @@
1
+ import type { CommandContext, CommandResult } from '../core/commands.js';
2
+ import type { Patch, PatchOp } from '../core/patches.js';
3
+ import type { Style } from '../core/styles.js';
4
+ import type { CellValue } from '../core/values.js';
5
+ import type { Zone } from '../core/zone.js';
6
+ export type { PatchOp } from '../core/patches.js';
7
+ /** A command handler: refuses with reasons, or turns a command into patches. */
8
+ export interface CommandHandler<C extends {
9
+ type: string;
10
+ } = {
11
+ type: string;
12
+ } & Record<string, unknown>> {
13
+ readonly type: C['type'];
14
+ /** Refusals with reasons; omitted means always allowed. */
15
+ allow?(context: CommandContext, command: C): CommandResult;
16
+ /** The patches that perform the command, computed from the current state; applied in order. */
17
+ apply(context: CommandContext, command: C): Patch[];
18
+ /** F4 when not editing: the same command at a new selection (§3.2). */
19
+ repeat?(command: C, selection: {
20
+ sheet: string;
21
+ zones: readonly Zone[];
22
+ }): C | undefined;
23
+ }
24
+ /** An argument of a formula function, as autocomplete and the compiler read it. */
25
+ export interface FunctionArgument {
26
+ readonly name: string;
27
+ readonly type: 'scalar' | 'range' | 'lazy';
28
+ readonly optional?: boolean;
29
+ readonly repeating?: boolean;
30
+ readonly description?: string;
31
+ }
32
+ /** A formula function (§3.4). The engine's calling convention lands with the compiler (C4-02). */
33
+ export interface FormulaFunction {
34
+ /** Upper-case, as typed: `SUM`, `XLOOKUP`. */
35
+ readonly name: string;
36
+ readonly args: readonly FunctionArgument[];
37
+ readonly returns: 'number' | 'string' | 'boolean' | 'any';
38
+ readonly compute: (...args: unknown[]) => CellValue | Promise<CellValue>;
39
+ readonly volatile?: boolean;
40
+ readonly async?: boolean;
41
+ readonly description: string;
42
+ readonly examples: readonly string[];
43
+ }
44
+ /** A cell type drawn on canvas: a checkbox, a link, a progress bar. */
45
+ export interface CellType {
46
+ readonly id: string;
47
+ render(ctx: CanvasRenderingContext2D, rect: {
48
+ x: number;
49
+ y: number;
50
+ width: number;
51
+ height: number;
52
+ }, value: CellValue, style: Style, theme: Readonly<Record<string, unknown>>): void;
53
+ hitTest?(point: {
54
+ x: number;
55
+ y: number;
56
+ }, rect: {
57
+ width: number;
58
+ height: number;
59
+ }): boolean;
60
+ onClick?(cell: {
61
+ sheet: string;
62
+ row: number;
63
+ col: number;
64
+ }, value: CellValue): Patch[] | void;
65
+ /** A React component editing this type; typed loosely so the core needs no React. */
66
+ readonly editor?: unknown;
67
+ accessibleName?(value: CellValue): string;
68
+ }
69
+ /** A render layer, drawn after the core layers of the same kind (§3.3). */
70
+ export interface RenderLayer {
71
+ readonly id: string;
72
+ readonly layer: 'background' | 'cells' | 'overlay';
73
+ draw(ctx: CanvasRenderingContext2D, viewport: {
74
+ sheet: string;
75
+ zone: Zone;
76
+ }, model: unknown): void;
77
+ }
78
+ /** A clipboard handler: one per feature (§3.5). */
79
+ export interface ClipboardHandler {
80
+ readonly id: string;
81
+ copy(context: CommandContext, zone: Zone): unknown;
82
+ paste(context: CommandContext, slice: unknown, target: Zone, options: {
83
+ special?: string;
84
+ }): Patch[];
85
+ }
86
+ /** A fill-handle series rule (§3.5). */
87
+ export interface FillRule {
88
+ readonly id: string;
89
+ match(values: readonly CellValue[]): unknown | undefined;
90
+ next(series: unknown, index: number): CellValue;
91
+ }
92
+ /** Reads a file format into the native format (`CellsWorkbook`). */
93
+ export interface Importer {
94
+ readonly id: string;
95
+ readonly mime: string;
96
+ readonly extensions: readonly string[];
97
+ read(input: ReadableStream<Uint8Array> | Uint8Array | string): Promise<unknown>;
98
+ }
99
+ /** Writes a workbook out. */
100
+ export interface Exporter {
101
+ readonly id: string;
102
+ readonly mime: string;
103
+ readonly extension: string;
104
+ write(model: unknown): Promise<Blob | Uint8Array | string>;
105
+ }
106
+ /** A read-only, paged virtual source of columns (§3.11). */
107
+ export interface DataSource {
108
+ readonly id: string;
109
+ readonly rowCount: number;
110
+ readonly columns: readonly {
111
+ readonly name: string;
112
+ readonly type?: string;
113
+ }[];
114
+ fetch(rows: {
115
+ from: number;
116
+ to: number;
117
+ }): Promise<readonly (readonly CellValue[])[]>;
118
+ }
119
+ /** The collaboration provider: exactly one, or none for "collaboration off" (§3.9). */
120
+ export interface CollabProvider {
121
+ readonly id: string;
122
+ connect(doc: unknown, room: string): unknown;
123
+ }
124
+ /** A toolbar or menu entry, naming a Reactor command by id. */
125
+ export interface CommandItem {
126
+ readonly command: string;
127
+ readonly group?: string;
128
+ }
129
+ export declare const CellsPatchOps: import("@datalayer/reactor").ContributionPoint<PatchOp<any>>;
130
+ export declare const CellsCommands: import("@datalayer/reactor").ContributionPoint<CommandHandler<any>>;
131
+ export declare const CellsFunctions: import("@datalayer/reactor").ContributionPoint<FormulaFunction>;
132
+ export declare const CellsCellTypes: import("@datalayer/reactor").ContributionPoint<CellType>;
133
+ export declare const CellsRenderLayers: import("@datalayer/reactor").ContributionPoint<RenderLayer>;
134
+ export declare const CellsClipboard: import("@datalayer/reactor").ContributionPoint<ClipboardHandler>;
135
+ export declare const CellsFillRules: import("@datalayer/reactor").ContributionPoint<FillRule>;
136
+ export declare const CellsImporters: import("@datalayer/reactor").ContributionPoint<Importer>;
137
+ export declare const CellsExporters: import("@datalayer/reactor").ContributionPoint<Exporter>;
138
+ export declare const CellsDataSources: import("@datalayer/reactor").ContributionPoint<DataSource>;
139
+ export declare const CellsCollabProvider: import("@datalayer/reactor").ContributionPoint<CollabProvider>;
140
+ export declare const CellsToolbarItems: import("@datalayer/reactor").ContributionPoint<CommandItem>;
141
+ export declare const CellsMenuItems: import("@datalayer/reactor").ContributionPoint<CommandItem>;
142
+ /** What an edit gate is asked about: may this command apply? */
143
+ export interface EditGateContext {
144
+ readonly command: {
145
+ readonly type: string;
146
+ };
147
+ readonly context: CommandContext;
148
+ }
149
+ /** A plugin may veto a command before it applies; the veto is a refusal with the gate's reason. */
150
+ export declare const CellsEditGate: import("@datalayer/reactor").Gate<EditGateContext>;
151
+ /** Every point Cells opens, as `CellsCorePlugin` declares them. */
152
+ export declare const CELLS_POINTS: readonly [import("@datalayer/reactor").ContributionPoint<PatchOp<any>>, import("@datalayer/reactor").ContributionPoint<CommandHandler<any>>, import("@datalayer/reactor").ContributionPoint<FormulaFunction>, import("@datalayer/reactor").ContributionPoint<CellType>, import("@datalayer/reactor").ContributionPoint<RenderLayer>, import("@datalayer/reactor").ContributionPoint<ClipboardHandler>, import("@datalayer/reactor").ContributionPoint<FillRule>, import("@datalayer/reactor").ContributionPoint<Importer>, import("@datalayer/reactor").ContributionPoint<Exporter>, import("@datalayer/reactor").ContributionPoint<DataSource>, import("@datalayer/reactor").ContributionPoint<CollabProvider>, import("@datalayer/reactor").ContributionPoint<CommandItem>, import("@datalayer/reactor").ContributionPoint<CommandItem>, import("@datalayer/reactor").Gate<EditGateContext>];
153
+ export { PointTable, firstContribution, optionalContribution, type CellsPlatform, type PointTableOptions, type Resolved, } from './resolve.js';
154
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@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takes.
8
+ *
9
+ * Every extension of Cells is a contribution to one of these points, from a
10
+ * Reactor plugin (`definePlugin` from `@datalayer/reactor`); the built-in
11
+ * features contribute through the same points. The ids are the contract
12
+ * between plugins: `datalayer.cells.*`.
13
+ *
14
+ * @module points
15
+ */
16
+ import { defineContributionPoint, defineGate } from '@datalayer/reactor';
17
+ export const CellsPatchOps = defineContributionPoint('datalayer.cells.patchOp');
18
+ export const CellsCommands = defineContributionPoint('datalayer.cells.command');
19
+ export const CellsFunctions = defineContributionPoint('datalayer.cells.function');
20
+ export const CellsCellTypes = defineContributionPoint('datalayer.cells.cellType');
21
+ export const CellsRenderLayers = defineContributionPoint('datalayer.cells.renderLayer');
22
+ export const CellsClipboard = defineContributionPoint('datalayer.cells.clipboard');
23
+ export const CellsFillRules = defineContributionPoint('datalayer.cells.fillRule');
24
+ export const CellsImporters = defineContributionPoint('datalayer.cells.importer');
25
+ export const CellsExporters = defineContributionPoint('datalayer.cells.exporter');
26
+ export const CellsDataSources = defineContributionPoint('datalayer.cells.dataSource');
27
+ export const CellsCollabProvider = defineContributionPoint('datalayer.cells.collabProvider');
28
+ export const CellsToolbarItems = defineContributionPoint('datalayer.cells.toolbarItem');
29
+ export const CellsMenuItems = defineContributionPoint('datalayer.cells.menuItem');
30
+ /** A plugin may veto a command before it applies; the veto is a refusal with the gate's reason. */
31
+ export const CellsEditGate = defineGate('datalayer.cells.gate.edit');
32
+ /** Every point Cells opens, as `CellsCorePlugin` declares them. */
33
+ export const CELLS_POINTS = [
34
+ CellsPatchOps,
35
+ CellsCommands,
36
+ CellsFunctions,
37
+ CellsCellTypes,
38
+ CellsRenderLayers,
39
+ CellsClipboard,
40
+ CellsFillRules,
41
+ CellsImporters,
42
+ CellsExporters,
43
+ CellsDataSources,
44
+ CellsCollabProvider,
45
+ CellsToolbarItems,
46
+ CellsMenuItems,
47
+ CellsEditGate,
48
+ ];
49
+ export { PointTable, firstContribution, optionalContribution, } from './resolve.js';
50
+ //# sourceMappingURL=index.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;AACnE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,aAAa;CACL,CAAC;AAEX,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,oBAAoB,GAIrB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Reading Reactor contribution points the way a spreadsheet must: once, into
3
+ * an indexed table, rebuilt only when the platform changed.
4
+ *
5
+ * Reading a point is an activation event and returns a fresh array; the
6
+ * evaluator and the renderer cannot pay that per cell or per frame. A
7
+ * {@link PointTable} keeps the last resolution and the platform revision it
8
+ * was made at, and resolves again only when the revision moved.
9
+ *
10
+ * @module points/resolve
11
+ */
12
+ import type { ContributionPoint, ReactorPlatformView } from '@datalayer/reactor';
13
+ /** The platform as a table reads it: contributions, and the revision that dates them. */
14
+ export type CellsPlatform = ReactorPlatformView & {
15
+ getRevision: () => number;
16
+ };
17
+ /** A contribution as a table keeps it: the value, and who contributed it. */
18
+ export interface Resolved<T> {
19
+ readonly value: T;
20
+ readonly plugin: string;
21
+ readonly id: string;
22
+ }
23
+ export interface PointTableOptions<T> {
24
+ /** What the point is, in words, for the refusals ("formula function"). */
25
+ readonly label: string;
26
+ /** The key a contribution is found by (a function's upper-cased name, a command's type). */
27
+ readonly key: (value: T) => string;
28
+ /** Checks a contribution's shape; throws a sentence when it is wrong. */
29
+ readonly check?: (value: T) => void;
30
+ }
31
+ /**
32
+ * A point resolved into a `Map` by key. A key contributed twice is refused
33
+ * with a sentence naming both plugins: two plugins fighting over one name is
34
+ * a bug, and the loser would otherwise fail invisibly.
35
+ */
36
+ export declare class PointTable<T> {
37
+ #private;
38
+ constructor(platform: CellsPlatform, point: ContributionPoint<T>, options: PointTableOptions<T>);
39
+ /** The contribution of that key, or `undefined`. */
40
+ get(key: string): Resolved<T> | undefined;
41
+ /** Every contribution, in Reactor's order (`order`, then contribution order). */
42
+ all(): readonly Resolved<T>[];
43
+ keys(): IterableIterator<string>;
44
+ /** The platform revision the table was last resolved at. */
45
+ get revision(): number;
46
+ }
47
+ /**
48
+ * The one contribution of a point that must have exactly one winner: the
49
+ * first by `order`. None is refused, and so is a tie at the winning `order`
50
+ * (two providers with equal claim), as personal-agent-protocol's
51
+ * `firstContribution` does.
52
+ */
53
+ export declare function firstContribution<T>(platform: ReactorPlatformView, point: ContributionPoint<T>, label: string): Resolved<T>;
54
+ /** Like {@link firstContribution}, but none is allowed: the feature is off. A tie is still refused. */
55
+ export declare function optionalContribution<T>(platform: ReactorPlatformView, point: ContributionPoint<T>, label: string): Resolved<T> | undefined;
56
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/points/resolve.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAgB,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE/F,yFAAyF;AACzF,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG;IAAE,WAAW,EAAE,MAAM,MAAM,CAAA;CAAE,CAAC;AAEhF,6EAA6E;AAC7E,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4FAA4F;IAC5F,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC;IACnC,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACrC;AAED;;;;GAIG;AACH,qBAAa,UAAU,CAAC,CAAC;;gBAQX,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAM/F,oDAAoD;IACpD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS;IAKzC,iFAAiF;IACjF,GAAG,IAAI,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE;IAK7B,IAAI,IAAI,gBAAgB,CAAC,MAAM,CAAC;IAKhC,4DAA4D;IAC5D,IAAI,QAAQ,IAAI,MAAM,CAGrB;CA6BF;AAeD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC3B,KAAK,EAAE,MAAM,GACZ,QAAQ,CAAC,CAAC,CAAC,CAMb;AAED,uGAAuG;AACvG,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC3B,KAAK,EAAE,MAAM,GACZ,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAYzB"}
@@ -0,0 +1,106 @@
1
+ /*
2
+ * Copyright (c) 2022-2026 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ /**
7
+ * A point resolved into a `Map` by key. A key contributed twice is refused
8
+ * with a sentence naming both plugins: two plugins fighting over one name is
9
+ * a bug, and the loser would otherwise fail invisibly.
10
+ */
11
+ export class PointTable {
12
+ #platform;
13
+ #point;
14
+ #options;
15
+ #revision = -1;
16
+ #byKey = new Map();
17
+ #ordered = [];
18
+ constructor(platform, point, options) {
19
+ this.#platform = platform;
20
+ this.#point = point;
21
+ this.#options = options;
22
+ }
23
+ /** The contribution of that key, or `undefined`. */
24
+ get(key) {
25
+ this.#refresh();
26
+ return this.#byKey.get(key);
27
+ }
28
+ /** Every contribution, in Reactor's order (`order`, then contribution order). */
29
+ all() {
30
+ this.#refresh();
31
+ return this.#ordered;
32
+ }
33
+ keys() {
34
+ this.#refresh();
35
+ return this.#byKey.keys();
36
+ }
37
+ /** The platform revision the table was last resolved at. */
38
+ get revision() {
39
+ this.#refresh();
40
+ return this.#revision;
41
+ }
42
+ #refresh() {
43
+ const revision = this.#platform.getRevision();
44
+ if (revision === this.#revision)
45
+ return;
46
+ const contributions = this.#platform.getContributions(this.#point);
47
+ const byKey = new Map();
48
+ const ordered = [];
49
+ for (const c of contributions) {
50
+ const resolved = checked(c, this.#options);
51
+ const key = this.#options.key(c.value);
52
+ const taken = byKey.get(key);
53
+ if (taken !== undefined) {
54
+ throw new Error(`The ${this.#options.label} '${key}' is contributed twice to ${this.#point.id}: ` +
55
+ `by ${taken.plugin} (id '${taken.id}') and by ${c.plugin} (id '${c.id}'). ` +
56
+ `Disable one of the two plugins, or rename one ${this.#options.label}.`);
57
+ }
58
+ byKey.set(key, resolved);
59
+ ordered.push(resolved);
60
+ }
61
+ // The read itself may have woken lazy plugins, which bumps the revision on
62
+ // a microtask: record the revision read *before* that, so their
63
+ // contributions are picked up on the next access.
64
+ this.#revision = revision;
65
+ this.#byKey = byKey;
66
+ this.#ordered = ordered;
67
+ }
68
+ }
69
+ function checked(c, options) {
70
+ if (options.check) {
71
+ try {
72
+ options.check(c.value);
73
+ }
74
+ catch (error) {
75
+ throw new Error(`${c.plugin} contributes a malformed ${options.label} (id '${c.id}'): ${error.message}`);
76
+ }
77
+ }
78
+ return { value: c.value, plugin: c.plugin, id: c.id };
79
+ }
80
+ /**
81
+ * The one contribution of a point that must have exactly one winner: the
82
+ * first by `order`. None is refused, and so is a tie at the winning `order`
83
+ * (two providers with equal claim), as personal-agent-protocol's
84
+ * `firstContribution` does.
85
+ */
86
+ export function firstContribution(platform, point, label) {
87
+ const found = optionalContribution(platform, point, label);
88
+ if (found === undefined) {
89
+ throw new Error(`No plugin contributes a ${label} (${point.id}).`);
90
+ }
91
+ return found;
92
+ }
93
+ /** Like {@link firstContribution}, but none is allowed: the feature is off. A tie is still refused. */
94
+ export function optionalContribution(platform, point, label) {
95
+ const contributions = platform.getContributions(point);
96
+ const [first, second] = contributions;
97
+ if (first === undefined)
98
+ return undefined;
99
+ if (second !== undefined && second.order === first.order) {
100
+ throw new Error(`Two plugins contribute a ${label} (${point.id}) at the same order ${first.order}: ` +
101
+ `${first.plugin} (id '${first.id}') and ${second.plugin} (id '${second.id}'). ` +
102
+ `Give one a lower order, or disable one.`);
103
+ }
104
+ return { value: first.value, plugin: first.plugin, id: first.id };
105
+ }
106
+ //# sourceMappingURL=resolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/points/resolve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmCH;;;;GAIG;AACH,MAAM,OAAO,UAAU;IACZ,SAAS,CAAgB;IACzB,MAAM,CAAuB;IAC7B,QAAQ,CAAuB;IACxC,SAAS,GAAG,CAAC,CAAC,CAAC;IACf,MAAM,GAAG,IAAI,GAAG,EAAuB,CAAC;IACxC,QAAQ,GAAkB,EAAE,CAAC;IAE7B,YAAY,QAAuB,EAAE,KAA2B,EAAE,OAA6B;QAC7F,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,oDAAoD;IACpD,GAAG,CAAC,GAAW;QACb,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED,iFAAiF;IACjF,GAAG;QACD,IAAI,CAAC,QAAQ,EAAE,CA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A6B,EAC7B,KAA2B,EAC3B,KAAa;IAEb,MAAM,aAAa,GAAG,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC;IACtC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CACb,4BAA4B,KAAK,KAAK,KAAK,CAAC,EAAE,uBAAuB,KAAK,CAAC,KAAK,IAAI;YAClF,GAAG,KAAK,CAAC,MAAM,SAAS,KAAK,CAAC,EAAE,UAAU,MAAM,CAAC,MAAM,SAAS,MAAM,CAAC,EAAE,MAAM;YAC/E,yCAAyC,CAC5C,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;AACpE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@datalayer/cells/xlsx`: XLSX in and out, loaded lazily.
3
+ *
4
+ * @module xlsx
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xlsx/index.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AAEH,OAAO,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022-2026 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/xlsx/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
package/package.json CHANGED
@@ -1,6 +1,118 @@
1
1
  {
2
2
  "name": "@datalayer/cells",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/datalayer/cells.git"
7
+ },
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "description": "A spreadsheet drawn on canvas, exposed as a React component, over a headless model that also runs in Node and in workers.",
12
+ "license": "MIT",
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/index.d.ts",
16
+ "sideEffects": [
17
+ "*.css"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "types": "./lib/index.d.ts",
22
+ "import": "./lib/index.js"
23
+ },
24
+ "./core": {
25
+ "types": "./lib/core/index.d.ts",
26
+ "import": "./lib/core/index.js"
27
+ },
28
+ "./csv": {
29
+ "types": "./lib/csv/index.d.ts",
30
+ "import": "./lib/csv/index.js"
31
+ },
32
+ "./xlsx": {
33
+ "types": "./lib/xlsx/index.d.ts",
34
+ "import": "./lib/xlsx/index.js"
35
+ },
36
+ "./collab": {
37
+ "types": "./lib/collab/index.d.ts",
38
+ "import": "./lib/collab/index.js"
39
+ },
40
+ "./chrome": {
41
+ "types": "./lib/chrome/index.d.ts",
42
+ "import": "./lib/chrome/index.js"
43
+ },
44
+ "./plugin": {
45
+ "types": "./lib/plugin/index.d.ts",
46
+ "import": "./lib/plugin/index.js"
47
+ },
48
+ "./style/cells.css": "./style/cells.css"
49
+ },
50
+ "typesVersions": {
51
+ "*": {
52
+ "core": [
53
+ "lib/core/index.d.ts"
54
+ ],
55
+ "csv": [
56
+ "lib/csv/index.d.ts"
57
+ ],
58
+ "xlsx": [
59
+ "lib/xlsx/index.d.ts"
60
+ ],
61
+ "collab": [
62
+ "lib/collab/index.d.ts"
63
+ ],
64
+ "chrome": [
65
+ "lib/chrome/index.d.ts"
66
+ ],
67
+ "plugin": [
68
+ "lib/plugin/index.d.ts"
69
+ ]
70
+ }
71
+ },
72
+ "files": [
73
+ "lib",
74
+ "style"
75
+ ],
76
+ "keywords": [
77
+ "datalayer",
78
+ "spreadsheet",
79
+ "canvas",
80
+ "react",
81
+ "formulas",
82
+ "grid"
83
+ ],
84
+ "scripts": {
85
+ "bench": "node scripts/bench.mjs",
86
+ "bench:compare": "node scripts/bench-compare.mjs",
87
+ "build": "tsc -p tsconfig.json",
88
+ "build:lib": "tsc -p tsconfig.json",
89
+ "check:node": "node scripts/check-node-load.mjs",
90
+ "clean": "rm -rf lib",
91
+ "format": "prettier --write .",
92
+ "lint": "prettier --check . && node scripts/check-headers.mjs",
93
+ "size": "node scripts/size.mjs",
94
+ "test": "vitest run",
95
+ "typecheck": "tsc -p tsconfig.typecheck.json",
96
+ "watch:lib": "tsc -w -p tsconfig.json"
97
+ },
98
+ "peerDependencies": {
99
+ "@datalayer/reactor": "^1.3.2",
100
+ "react": "^18.3.1 || ^19.0.0",
101
+ "react-dom": "^18.3.1 || ^19.0.0"
102
+ },
103
+ "devDependencies": {
104
+ "@datalayer/reactor": "^1.3.2",
105
+ "@playwright/test": "^1.56.0",
106
+ "@types/node": "^24",
107
+ "@types/react": "19.2.18",
108
+ "@types/react-dom": "19.2.5",
109
+ "esbuild": "^0.25.12",
110
+ "fast-check": "^4.10.2",
111
+ "jsdom": "^26.1.0",
112
+ "prettier": "^3.6.2",
113
+ "react": "19.2.8",
114
+ "react-dom": "19.2.8",
115
+ "typescript": "5.9.3",
116
+ "vitest": "^3.2.4"
117
+ }
118
+ }
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Copyright (c) 2022-2026 Datalayer, Inc.
3
+ *
4
+ * MIT License
5
+ */
6
+
7
+ /* The DOM parts of the grid: the editor overlay and the accessibility mirror. */