@sheetpane/grid 0.0.0-stage → 0.1.0

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 (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +429 -2
  3. package/custom-elements.json +1246 -0
  4. package/dist/errors/element.d.ts +108 -0
  5. package/dist/errors/element.d.ts.map +1 -0
  6. package/dist/errors/element.js +456 -0
  7. package/dist/errors/element.js.map +1 -0
  8. package/dist/errors/index.d.ts +2 -0
  9. package/dist/errors/index.d.ts.map +1 -0
  10. package/dist/errors/index.js +3 -0
  11. package/dist/errors/index.js.map +1 -0
  12. package/dist/excel/element.d.ts +434 -0
  13. package/dist/excel/element.d.ts.map +1 -0
  14. package/dist/excel/element.js +3382 -0
  15. package/dist/excel/element.js.map +1 -0
  16. package/dist/excel/geometry.d.ts +81 -0
  17. package/dist/excel/geometry.d.ts.map +1 -0
  18. package/dist/excel/geometry.js +137 -0
  19. package/dist/excel/geometry.js.map +1 -0
  20. package/dist/excel/index.d.ts +2 -0
  21. package/dist/excel/index.d.ts.map +1 -0
  22. package/dist/excel/index.js +3 -0
  23. package/dist/excel/index.js.map +1 -0
  24. package/dist/excel/selection.d.ts +103 -0
  25. package/dist/excel/selection.d.ts.map +1 -0
  26. package/dist/excel/selection.js +189 -0
  27. package/dist/excel/selection.js.map +1 -0
  28. package/dist/excel/styles.d.ts +3 -0
  29. package/dist/excel/styles.d.ts.map +1 -0
  30. package/dist/excel/styles.js +206 -0
  31. package/dist/excel/styles.js.map +1 -0
  32. package/dist/frameworks/elements.d.ts +136 -0
  33. package/dist/frameworks/jsx.d.ts +64 -0
  34. package/dist/frameworks/jsx.js +2 -0
  35. package/dist/frameworks/solid.d.ts +133 -0
  36. package/dist/frameworks/solid.js +2 -0
  37. package/dist/frameworks/svelte.d.ts +102 -0
  38. package/dist/frameworks/svelte.js +2 -0
  39. package/dist/frameworks/vue.d.ts +69 -0
  40. package/dist/frameworks/vue.js +2 -0
  41. package/dist/index.d.ts +23 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +25 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/llms-full.txt +8028 -0
  46. package/dist/llms.txt +111 -0
  47. package/dist/pane/index.d.ts +2 -0
  48. package/dist/pane/index.d.ts.map +1 -0
  49. package/dist/pane/index.js +3 -0
  50. package/dist/pane/index.js.map +1 -0
  51. package/dist/pane/registry.d.ts +33 -0
  52. package/dist/pane/registry.d.ts.map +1 -0
  53. package/dist/pane/registry.js +73 -0
  54. package/dist/pane/registry.js.map +1 -0
  55. package/dist/pane/rules.d.ts +231 -0
  56. package/dist/pane/rules.d.ts.map +1 -0
  57. package/dist/pane/rules.js +792 -0
  58. package/dist/pane/rules.js.map +1 -0
  59. package/dist/pane/store.d.ts +385 -0
  60. package/dist/pane/store.d.ts.map +1 -0
  61. package/dist/pane/store.js +1028 -0
  62. package/dist/pane/store.js.map +1 -0
  63. package/dist/pane/types.d.ts +130 -0
  64. package/dist/pane/types.d.ts.map +1 -0
  65. package/dist/pane/types.js +22 -0
  66. package/dist/pane/types.js.map +1 -0
  67. package/dist/plugins/host.d.ts +56 -0
  68. package/dist/plugins/host.d.ts.map +1 -0
  69. package/dist/plugins/host.js +124 -0
  70. package/dist/plugins/host.js.map +1 -0
  71. package/dist/plugins/types.d.ts +159 -0
  72. package/dist/plugins/types.d.ts.map +1 -0
  73. package/dist/plugins/types.js +12 -0
  74. package/dist/plugins/types.js.map +1 -0
  75. package/dist/rules.schema.json +52 -0
  76. package/dist/shared/dom.d.ts +23 -0
  77. package/dist/shared/dom.d.ts.map +1 -0
  78. package/dist/shared/dom.js +32 -0
  79. package/dist/shared/dom.js.map +1 -0
  80. package/dist/skills-bin.d.ts +3 -0
  81. package/dist/skills-bin.d.ts.map +1 -0
  82. package/dist/skills-bin.js +9 -0
  83. package/dist/skills-bin.js.map +1 -0
  84. package/dist/style.css +3 -0
  85. package/dist/tokens.d.ts +49 -0
  86. package/dist/tokens.d.ts.map +1 -0
  87. package/dist/tokens.js +43 -0
  88. package/dist/tokens.js.map +1 -0
  89. package/dist/vscode.css-custom-data.json +365 -0
  90. package/dist/vscode.html-custom-data.json +218 -0
  91. package/dist/web-types.json +914 -0
  92. package/package.json +72 -3
@@ -0,0 +1,159 @@
1
+ import type { Cell, PatchContext } from '@sheetpane/export';
2
+ import type { ImportedSheet, ImportedWorkbook } from '@sheetpane/import';
3
+ import type { Mode, Selection, SheetpaneError, Snapshot } from '../pane/types.js';
4
+ import type { WorkbookStore } from '../pane/store.js';
5
+ /** The six hooks a plugin may provide (SR-GRID decision 17). */
6
+ export type HookName = 'format' | 'decorate' | 'derive' | 'validate' | 'overlay' | 'exportPatch';
7
+ /** {@link HookName} as a list. */
8
+ export declare const HOOKS: readonly HookName[];
9
+ /** Hooks with exactly one provider per pane; a second provider throws at registration. */
10
+ export declare const SINGLE_PROVIDER: readonly HookName[];
11
+ /** The CSS a `decorate` hook may return — and never `font-family` (SR-LAW-5). */
12
+ export declare const STYLE_PROPS: readonly ['background-color', 'background-image', 'color', 'font-weight', 'font-style', 'font-size', 'text-decoration', 'text-align', 'vertical-align', 'white-space', 'border-top', 'border-right', 'border-bottom', 'border-left', 'padding-left'];
13
+ /** One CSS property a `decorate` hook may set. */
14
+ export type StyleProp = (typeof STYLE_PROPS)[number];
15
+ /** A `decorate` result: CSS properties from {@link STYLE_PROPS} to their values. */
16
+ export type StyleSubset = Partial<Record<StyleProp, string>>;
17
+ /** One cell, as a hook sees it. */
18
+ export interface CellContext {
19
+ readonly store: WorkbookStore;
20
+ readonly book: ImportedWorkbook;
21
+ readonly sheet: ImportedSheet;
22
+ readonly ref: string;
23
+ readonly row: number;
24
+ readonly col: number;
25
+ /** The current value (a user change applied). */
26
+ readonly value: Cell;
27
+ /** The cell's style index (`s`), the change map's `style` entry applied by plugins themselves. */
28
+ readonly styleIndex: number | undefined;
29
+ }
30
+ /** What every plugin hook but `format` and `decorate` is given. */
31
+ export interface PluginContext {
32
+ readonly store: WorkbookStore;
33
+ readonly book: ImportedWorkbook;
34
+ snapshot(): Snapshot;
35
+ /** During `exportPatch`: the options the host passed to `export(options)` (e.g. `{ comments: false }`). */
36
+ readonly exportOptions?: Readonly<Record<string, unknown>>;
37
+ }
38
+ /** What `derive` is told: the workbook loaded, or cells changed (by the user, or by undo). */
39
+ export type DeriveInput = {
40
+ kind: 'load';
41
+ } | {
42
+ kind: 'change';
43
+ cells: {
44
+ sheet: string;
45
+ ref: string;
46
+ value: Cell;
47
+ }[];
48
+ };
49
+ /** One recalculated cell. `clear: true` removes the cell's derived entry (its value and text are then ignored). */
50
+ export interface DerivedChange {
51
+ sheet: string;
52
+ ref: string;
53
+ value: Cell;
54
+ text: string;
55
+ clear?: boolean;
56
+ }
57
+ /** What `validate` returns: an error without the fields the store owns. */
58
+ /** `key` tells apart a provider's findings that share a sheet, range and type (several notes on one cell); it is not stored on the error. */
59
+ export type ErrorDraft = Omit<SheetpaneError, 'v' | 'id' | 'matchesExpected' | 'createdAt' | 'status' | 'cellChanged'> & {
60
+ status?: 'open' | 'resolved';
61
+ cellChanged?: boolean;
62
+ key?: string;
63
+ };
64
+ /** One switch a plugin offers in the Download menu; its `key` reaches `exportPatch` as `ctx.exportOptions[key]`. */
65
+ export interface ExportOption {
66
+ key: string;
67
+ label: string;
68
+ default: boolean;
69
+ }
70
+ /** Something drawn in sheet space (pictures, charts). `rect` is in pixels at 100 % zoom from the top-left of A1. */
71
+ export interface OverlayItem {
72
+ id: string;
73
+ sheet: string;
74
+ rect: {
75
+ x: number;
76
+ y: number;
77
+ width: number;
78
+ height: number;
79
+ };
80
+ render(): HTMLElement;
81
+ /** The item's accessible name; re-read on every overlay pass, so it may change (W-21). */
82
+ alt?: string;
83
+ /** `img` (default): a picture; `group`: an item holding controls a keyboard or a screen reader can reach. */
84
+ role?: 'img' | 'group';
85
+ /** Pointer events pass through to the cells below (an outline, a highlight). */
86
+ passThrough?: boolean;
87
+ }
88
+ /** Sheet geometry a plugin needs to place things (W-20). Pixels at 100 % zoom. */
89
+ export interface Geometry {
90
+ colX(col: number): number;
91
+ colWidth(col: number): number;
92
+ rowY(row: number): number;
93
+ rowHeight(row: number): number;
94
+ }
95
+ /** The six places a plugin's controls render (SR-GRID decision 19). */
96
+ export type SlotName = 'format-row' | 'selbar' | 'cellbar' | 'status' | 'cell' | 'overlay';
97
+ /** {@link SlotName} as a list. */
98
+ export declare const SLOTS: readonly SlotName[];
99
+ /** A control a plugin describes and the grid renders (plugins verdict, slots). */
100
+ export interface ControlDescriptor {
101
+ id: string;
102
+ slot: SlotName;
103
+ /** Controls render in group order, then in the order given. */
104
+ group: string;
105
+ label: string;
106
+ /** Inline SVG markup (no external URL). */
107
+ icon?: string;
108
+ shortcut?: string;
109
+ mode: Mode | 'both';
110
+ isActive?(snap: Snapshot, sel: Selection): boolean;
111
+ /** Greyed out and not runnable for this selection (Merge on one cell, the format row on a CSV). */
112
+ disabled?(snap: Snapshot, sel: Selection): boolean;
113
+ /** A label that follows the selection (Merge ↔ Unmerge); `label` otherwise. */
114
+ labelFor?(snap: Snapshot, sel: Selection): string;
115
+ run?(store: WorkbookStore, sel: Selection): void;
116
+ /** `status` slot: the text to show; `cell` slot: whether the cell carries the mark. */
117
+ text?(snap: Snapshot, sel: Selection): string;
118
+ appliesTo?(cell: CellContext): boolean;
119
+ /** A dropdown instead of a button (format-row, selbar, cellbar): its choices, the current one, what choosing does. */
120
+ options?(snap: Snapshot, sel: Selection): {
121
+ value: string;
122
+ label: string;
123
+ }[];
124
+ value?(snap: Snapshot, sel: Selection): string;
125
+ choose?(store: WorkbookStore, sel: Selection, value: string): void;
126
+ /** `cell` slot: the choices the mark's menu offers for this cell (W-18's list arrow); picking calls `choose`. */
127
+ cellOptions?(cell: CellContext): string[];
128
+ /**
129
+ * `selbar` controls: the menus the control also joins (W-49) — the cell's right-click menu, the
130
+ * header menu (right-click a column or row header) and the tab menu (right-click a sheet tab, where
131
+ * `run` gets that tab's sheet). Absent: the cell menu only, as before.
132
+ */
133
+ menus?: readonly ('cell' | 'header' | 'tab')[];
134
+ /** Why the control is disabled, said in its tooltip (W-49: "CSV can't store hidden rows"). */
135
+ disabledReason?(snap: Snapshot, sel: Selection): string | undefined;
136
+ }
137
+ /**
138
+ * A plugin: a plain object naming the hooks it provides, the functions for them and its
139
+ * controls (SR-GRID decisions 17–19). Register it with {@link registerPlugin}.
140
+ */
141
+ export interface Plugin {
142
+ id: string;
143
+ /** The hooks this plugin provides. */
144
+ provides: HookName[];
145
+ /** For `decorate`: the plugins whose result this one overrides, per property. */
146
+ after?: string[];
147
+ format?(cell: CellContext): string | undefined;
148
+ decorate?(cell: CellContext): StyleSubset | undefined;
149
+ derive?(input: DeriveInput, ctx: PluginContext): DerivedChange[] | Promise<DerivedChange[]>;
150
+ validate?(sheet: string, ctx: PluginContext): ErrorDraft[];
151
+ overlay?(sheet: string, ctx: PluginContext & {
152
+ geometry: Geometry;
153
+ }): OverlayItem[];
154
+ exportPatch?(patch: PatchContext, ctx: PluginContext): void | Promise<void>;
155
+ controls?: ControlDescriptor[];
156
+ /** Options this plugin reads from `ctx.exportOptions`, offered as checkboxes in the Download menu (W-34): `{ comments: true }`. */
157
+ exportOptions?: readonly ExportOption[];
158
+ }
159
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,gEAAgE;AAChE,MAAM,MAAM,QAAQ,GAAG,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AAC;IAC/C,QAAQ,CAAC,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;IACtD,MAAM,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC5F,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,UAAU,EAAE,CAAC;IAC3D,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG;QAAE,QAAQ,EAAE,QAAQ,CAAA;KAAE,GAAG,WAAW,EAAE,CAAC;IACpF,WAAW,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,mIAAmI;IACnI,aAAa,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CACzC"}
@@ -0,0 +1,12 @@
1
+ /** {@link HookName} as a list. */
2
+ export const HOOKS = ['format', 'decorate', 'derive', 'validate', 'overlay', 'exportPatch'];
3
+ /** Hooks with exactly one provider per pane; a second provider throws at registration. */
4
+ export const SINGLE_PROVIDER = ['format', 'derive'];
5
+ /** The CSS a `decorate` hook may return — and never `font-family` (SR-LAW-5). */
6
+ export const STYLE_PROPS = [
7
+ 'background-color', 'background-image', 'color', 'font-weight', 'font-style', 'font-size', 'text-decoration', 'text-align', 'vertical-align', 'white-space',
8
+ 'border-top', 'border-right', 'border-bottom', 'border-left', 'padding-left',
9
+ ];
10
+ /** {@link SlotName} as a list. */
11
+ export const SLOTS = ['format-row', 'selbar', 'cellbar', 'status', 'cell', 'overlay'];
12
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AASA,kCAAkC;AAClC,MAAM,CAAC,MAAM,KAAK,GAAwB,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AACjH,0FAA0F;AAC1F,MAAM,CAAC,MAAM,eAAe,GAAwB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEzE,iFAAiF;AACjF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,kBAAkB,EAAE,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa;IAC3J,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc;CACpE,CAAC;AAoEX,kCAAkC;AAClC,MAAM,CAAC,MAAM,KAAK,GAAwB,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC"}
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://unpkg.com/@sheetpane/grid/rules.schema.json",
4
+ "title": "sheetpane rules file",
5
+ "description": "Rules a host ships for <sheetpane-excel>: per sheet (\"*\" for every sheet), by column title and by cell or range. Failures become errors in <sheetpane-errors>. SR-GRID decision 22d.",
6
+ "type": "object",
7
+ "required": ["version", "sheets"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "$schema": { "type": "string" },
11
+ "version": { "const": 1, "description": "The document's version; this grid reads 1." },
12
+ "sheets": {
13
+ "type": "object",
14
+ "description": "Keyed by sheet name; \"*\" applies to every sheet, and a named sheet's rule for the same title wins.",
15
+ "additionalProperties": { "$ref": "#/$defs/sheet" }
16
+ }
17
+ },
18
+ "$defs": {
19
+ "sheet": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "headerRow": { "type": "integer", "minimum": 1, "description": "The row holding the column titles (1-based)." },
24
+ "columns": { "type": "object", "description": "Rules by column title, matched trimmed and case-insensitive.", "additionalProperties": { "$ref": "#/$defs/rule" } },
25
+ "cells": { "type": "object", "description": "Rules by A1 cell or range, e.g. \"B1\" or \"H3:H40\".", "propertyNames": { "pattern": "^\\$?[A-Za-z]{1,3}\\$?[0-9]+(:\\$?[A-Za-z]{1,3}\\$?[0-9]+)?$" }, "additionalProperties": { "$ref": "#/$defs/rule" } }
26
+ }
27
+ },
28
+ "value": { "type": ["string", "number", "boolean"] },
29
+ "bound": { "type": ["number", "string"], "description": "A number, or for type \"date\" an ISO date or a serial." },
30
+ "rule": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "properties": {
34
+ "required": { "type": "boolean" },
35
+ "type": { "enum": ["text", "number", "integer", "date", "boolean"] },
36
+ "min": { "$ref": "#/$defs/bound" },
37
+ "max": { "$ref": "#/$defs/bound" },
38
+ "minLength": { "type": "integer", "minimum": 0 },
39
+ "maxLength": { "type": "integer", "minimum": 0 },
40
+ "pattern": { "type": "string", "description": "A regular expression tested against the cell's text (not over 10,000 characters)." },
41
+ "oneOf": { "type": "array", "items": { "$ref": "#/$defs/value" }, "description": "The valid values." },
42
+ "noneOf": { "type": "array", "items": { "$ref": "#/$defs/value" }, "description": "Values that are never valid." },
43
+ "equals": { "$ref": "#/$defs/value", "description": "The one valid value." },
44
+ "unique": { "type": "boolean", "description": "No other row of the column holds it (column rules)." },
45
+ "message": { "type": "string", "description": "Replaces the generated message." },
46
+ "note": { "type": "string", "description": "For whoever maintains the rules; never shown as the message." },
47
+ "severity": { "enum": ["error", "warning", "note"] },
48
+ "onInvalid": { "enum": ["flag", "block"] }
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,23 @@
1
+ export declare const esc: (s: string) => string;
2
+ /** The element names register only where `customElements` exists — importing in Node is safe (SR-LAW-8). */
3
+ export declare function define(name: string, ctor: CustomElementConstructor): void;
4
+ /** A base class that is `HTMLElement` in a browser and a plain class in Node, so the module imports anywhere. */
5
+ export declare const ElementBase: typeof HTMLElement;
6
+ export declare const ICON: {
7
+ sheet: string;
8
+ view: string;
9
+ edit: string;
10
+ find: string;
11
+ download: string;
12
+ close: string;
13
+ flag: string;
14
+ prev: string;
15
+ next: string;
16
+ undo: string;
17
+ redo: string;
18
+ upload: string;
19
+ freeze: string;
20
+ };
21
+ /** Fires a bubbling, composed `sheetpane-*` event (contract verdict: DOM events only). */
22
+ export declare function fire<T>(el: EventTarget, name: string, detail: T, cancelable?: boolean): boolean;
23
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/shared/dom.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,MAAO,MAAM,WAAgH,CAAC;AAE9I,4GAA4G;AAC5G,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAGzE;AAED,iHAAiH;AACjH,eAAO,MAAM,WAAW,EAAE,OAAO,WAAiG,CAAC;AAGnI,eAAO,MAAM,IAAI;IACf,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,MAAM;CACP,CAAC;AAEF,0FAA0F;AAC1F,wBAAgB,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,UAAQ,GAAG,OAAO,CAE7F"}
@@ -0,0 +1,32 @@
1
+ // Small DOM helpers shared by the elements.
2
+ export const esc = (s) => s.replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
3
+ /** The element names register only where `customElements` exists — importing in Node is safe (SR-LAW-8). */
4
+ export function define(name, ctor) {
5
+ const reg = globalThis.customElements;
6
+ if (reg && !reg.get(name))
7
+ reg.define(name, ctor);
8
+ }
9
+ /** A base class that is `HTMLElement` in a browser and a plain class in Node, so the module imports anywhere. */
10
+ export const ElementBase = (typeof HTMLElement !== 'undefined' ? HTMLElement : class {
11
+ });
12
+ const svg = (d) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${d}</svg>`;
13
+ export const ICON = {
14
+ sheet: svg('<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18M9 9v12"/>'),
15
+ view: svg('<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/>'),
16
+ edit: svg('<path d="M4 20h4L19 9l-4-4L4 16z"/><path d="M13 7l4 4"/>'),
17
+ find: svg('<circle cx="11" cy="11" r="6"/><path d="M20 20l-4.5-4.5"/>'),
18
+ download: svg('<path d="M12 4v12M7 11l5 5 5-5M4 20h16"/>'),
19
+ close: svg('<path d="M6 6l12 12M18 6L6 18"/>'),
20
+ flag: svg('<path d="M5 21V4h11l-2 4 2 4H5"/>'),
21
+ prev: svg('<path d="M15 6l-6 6 6 6"/>'),
22
+ next: svg('<path d="M9 6l6 6-6 6"/>'),
23
+ undo: svg('<path d="M9 14L4 9l5-5"/><path d="M4 9h11a5 5 0 0 1 0 10h-3"/>'),
24
+ redo: svg('<path d="M15 14l5-5-5-5"/><path d="M20 9H9a5 5 0 0 0 0 10h3"/>'),
25
+ upload: svg('<path d="M12 16V4M7 9l5-5 5 5M4 20h16"/>'),
26
+ freeze: svg('<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18M9 3v18"/>'),
27
+ };
28
+ /** Fires a bubbling, composed `sheetpane-*` event (contract verdict: DOM events only). */
29
+ export function fire(el, name, detail, cancelable = false) {
30
+ return el.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true, cancel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9C,IAAI,EAAE,GAAG,CAAC,mCAAmC,CAAC;IAC9C,IAAI,EAAE,GAAG,CAAC,4BAA4B,CAAC;IACvC,IAAI,EAAE,GAAG,CAAC,0BAA0B,CAAC;IACrC,IAAI,EAAE,GAAG,CAAC,gEAAgE,CAAC;IAC3E,IAAI,EAAE,GAAG,CAAC,gEAAgE,CAAC;IAC3E,MAAM,EAAE,GAAG,CAAC,0CAA0C,CAAC;IACvD,MAAM,EAAE,GAAG,CAAC,6EAA6E,CAAC;CAC3F,CAAC;AAEF,0FAA0F;AAC1F,MAAM,UAAU,IAAI,CAAI,EAAe,EAAE,IAAY,EAAE,MAAS,EAAE,UAAU,GAAG,KAAK;IAClF,OAAO,EAAE,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;AACxG,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=skills-bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills-bin.d.ts","sourceRoot":"","sources":["../src/skills-bin.ts"],"names":[],"mappings":";AAQA,OAAO,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ // `npx sheetpane-skills …` for a host that installed @sheetpane/grid (W-35): npm and pnpm link only
3
+ // direct dependencies' bins, and hosts install the grid, not @sheetpane/skills — so the grid forwards.
4
+ // Node only; nothing here runs in a browser, and the grid's index never imports it.
5
+ const { main } = await import('@sheetpane/skills/bin');
6
+ const proc = globalThis.process;
7
+ proc.exitCode = await main(proc.argv.slice(2));
8
+ export {};
9
+ //# sourceMappingURL=skills-bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills-bin.js","sourceRoot":"","sources":["../src/skills-bin.ts"],"names":[],"mappings":";AACA,oGAAoG;AACpG,uGAAuG;AACvG,oFAAoF;AACpF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;AACvD,MAAM,IAAI,GAAI,UAA4E,CAAC,OAAO,CAAC;AACnG,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/C,OAAO,EAAE,CAAC"}
package/dist/style.css ADDED
@@ -0,0 +1,3 @@
1
+ sheetpane-excel,sheetpane-errors{--sp-ground:#F6F6F4;--sp-surface:#FFFFFF;--sp-sunken:#EFEFEB;--sp-line:#E2E2DD;--sp-line-strong:#CBCBC5;--sp-cell:#FFFFFF;--sp-head:#F3F3F0;--sp-grid:#E6E6E1;--sp-ink:#16171A;--sp-ink-2:#45484F;--sp-ink-3:#63666E;--sp-accent:#2346C8;--sp-accent-ink:#1A36A0;--sp-accent-soft:#EBEEFB;--sp-pass:#16703E;--sp-pass-soft:#E6F2EA;--sp-fail:#B42318;--sp-fail-soft:#FBE9E7;--sp-warn:#875600;--sp-warn-soft:#FBF0D9;--sp-changed:#C46A00;--sp-changed-soft:#FDF1E3;--sp-note:#6B55CC;--sp-ref-1:#2346C8;--sp-ref-2:#6B55CC;--sp-ref-3:#C46A00;--sp-on-solid:#FFFFFF;--sp-hit:#FFF4C2;--sp-hit-current:#FFE07A;--sp-r-sm:4px;--sp-r:6px;--sp-r-lg:10px;--sp-r-xl:14px;--sp-shadow:0 1px 2px rgba(22,23,26,.06),0 6px 20px rgba(22,23,26,.08);--sp-shadow-lg:0 24px 64px rgba(22,23,26,.22);}
2
+ sheetpane-excel[theme=dark],sheetpane-errors[theme=dark]{--sp-ground:#16171A;--sp-surface:#262729;--sp-cell:#262729;--sp-sunken:#3A3B3D;--sp-head:#313234;--sp-grid:#3E3F41;--sp-line:#47484A;--sp-line-strong:#6B6C6D;--sp-ink:#F6F6F4;--sp-ink-2:#C9C9C8;--sp-ink-3:#A1A1A1;--sp-accent:#8C9EDE;--sp-accent-ink:#B7C1E7;--sp-accent-soft:#1A254E;--sp-pass:#86B399;--sp-pass-soft:#163225;--sp-fail:#D2827B;--sp-fail-soft:#451B19;--sp-warn:#CAB692;--sp-warn-soft:#412F10;--sp-changed:#D39449;--sp-changed-soft:#4A3012;--sp-note:#AA9DDE;--sp-ref-1:#8C9EDE;--sp-ref-2:#AA9DDE;--sp-ref-3:#D8A262;--sp-on-solid:#16171A;--sp-hit:#4A3D12;--sp-hit-current:#7A5F12;--sp-shadow:0 1px 2px rgba(0,0,0,.4),0 6px 20px rgba(0,0,0,.45);--sp-shadow-lg:0 24px 64px rgba(0,0,0,.6);}
3
+ @media (prefers-color-scheme:dark){sheetpane-excel[theme=auto],sheetpane-errors[theme=auto]{--sp-ground:#16171A;--sp-surface:#262729;--sp-cell:#262729;--sp-sunken:#3A3B3D;--sp-head:#313234;--sp-grid:#3E3F41;--sp-line:#47484A;--sp-line-strong:#6B6C6D;--sp-ink:#F6F6F4;--sp-ink-2:#C9C9C8;--sp-ink-3:#A1A1A1;--sp-accent:#8C9EDE;--sp-accent-ink:#B7C1E7;--sp-accent-soft:#1A254E;--sp-pass:#86B399;--sp-pass-soft:#163225;--sp-fail:#D2827B;--sp-fail-soft:#451B19;--sp-warn:#CAB692;--sp-warn-soft:#412F10;--sp-changed:#D39449;--sp-changed-soft:#4A3012;--sp-note:#AA9DDE;--sp-ref-1:#8C9EDE;--sp-ref-2:#AA9DDE;--sp-ref-3:#D8A262;--sp-on-solid:#16171A;--sp-hit:#4A3D12;--sp-hit-current:#7A5F12;--sp-shadow:0 1px 2px rgba(0,0,0,.4),0 6px 20px rgba(0,0,0,.45);--sp-shadow-lg:0 24px 64px rgba(0,0,0,.6);}}
@@ -0,0 +1,49 @@
1
+ /** The light theme's design tokens, applied as `--sp-<name>` on both elements (SR-GRID decision 15a). */
2
+ export declare const TOKENS: {
3
+ readonly ground: '#F6F6F4';
4
+ readonly surface: '#FFFFFF';
5
+ readonly sunken: '#EFEFEB';
6
+ readonly line: '#E2E2DD';
7
+ readonly 'line-strong': '#CBCBC5';
8
+ readonly cell: '#FFFFFF';
9
+ readonly head: '#F3F3F0';
10
+ readonly grid: '#E6E6E1';
11
+ readonly ink: '#16171A';
12
+ readonly 'ink-2': '#45484F';
13
+ readonly 'ink-3': '#63666E';
14
+ readonly accent: '#2346C8';
15
+ readonly 'accent-ink': '#1A36A0';
16
+ readonly 'accent-soft': '#EBEEFB';
17
+ readonly pass: '#16703E';
18
+ readonly 'pass-soft': '#E6F2EA';
19
+ readonly fail: '#B42318';
20
+ readonly 'fail-soft': '#FBE9E7';
21
+ readonly warn: '#875600';
22
+ readonly 'warn-soft': '#FBF0D9';
23
+ readonly changed: '#C46A00';
24
+ readonly 'changed-soft': '#FDF1E3';
25
+ readonly note: '#6B55CC';
26
+ readonly 'ref-1': '#2346C8';
27
+ readonly 'ref-2': '#6B55CC';
28
+ readonly 'ref-3': '#C46A00';
29
+ readonly 'on-solid': '#FFFFFF';
30
+ readonly hit: '#FFF4C2';
31
+ readonly 'hit-current': '#FFE07A';
32
+ readonly 'r-sm': '4px';
33
+ readonly r: '6px';
34
+ readonly 'r-lg': '10px';
35
+ readonly 'r-xl': '14px';
36
+ readonly shadow: '0 1px 2px rgba(22,23,26,.06),0 6px 20px rgba(22,23,26,.08)';
37
+ readonly 'shadow-lg': '0 24px 64px rgba(22,23,26,.22)';
38
+ };
39
+ /** A token's name; its custom property is `--sp-<name>`. */
40
+ export type TokenName = keyof typeof TOKENS;
41
+ /** The `theme` attribute on both elements. */
42
+ export type Theme = 'light' | 'dark' | 'auto';
43
+ /** The dark set (W-29 DoD 3, accepted by the decider 2026-10-18 from sp-plugins.css `.spx-dark`). */
44
+ export declare const DARK_TOKENS: Partial<Record<TokenName, string>>;
45
+ /** Token defaults on the host element, then the dark set for `theme="dark"` and, when the page prefers dark, `theme="auto"`. */
46
+ export declare const TOKENS_CSS: string;
47
+ /** The same for light-DOM use (dist/style.css). */
48
+ export declare const TOKENS_STYLESHEET: string;
49
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAOA,yGAAyG;AACzG,eAAO,MAAM,MAAM;aACjB,MAAM,EAAE,SAAS;aAAE,OAAO,EAAE,SAAS;aAAE,MAAM,EAAE,SAAS;aAAE,IAAI,EAAE,SAAS;aAAE,aAAa,EAAE,SAAS;aACnG,IAAI,EAAE,SAAS;aAAE,IAAI,EAAE,SAAS;aAAE,IAAI,EAAE,SAAS;aACjD,GAAG,EAAE,SAAS;aAAE,OAAO,EAAE,SAAS;aAAE,OAAO,EAAE,SAAS;aACtD,MAAM,EAAE,SAAS;aAAE,YAAY,EAAE,SAAS;aAAE,aAAa,EAAE,SAAS;aACpE,IAAI,EAAE,SAAS;aAAE,WAAW,EAAE,SAAS;aAAE,IAAI,EAAE,SAAS;aAAE,WAAW,EAAE,SAAS;aAAE,IAAI,EAAE,SAAS;aAAE,WAAW,EAAE,SAAS;aACzH,OAAO,EAAE,SAAS;aAAE,cAAc,EAAE,SAAS;aAAE,IAAI,EAAE,SAAS;aAC9D,OAAO,EAAE,SAAS;aAAE,OAAO,EAAE,SAAS;aAAE,OAAO,EAAE,SAAS;aAAE,UAAU,EAAE,SAAS;aACjF,GAAG,EAAE,SAAS;aAAE,aAAa,EAAE,SAAS;aACxC,MAAM,EAAE,KAAK;aAAE,CAAC,EAAE,KAAK;aAAE,MAAM,EAAE,MAAM;aAAE,MAAM,EAAE,MAAM;aACvD,MAAM,EAAE,4DAA4D;aACpE,WAAW,EAAE,gCAAgC;CACrC,CAAC;AAEX,4DAA4D;AAC5D,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,MAAM,CAAC;AAE5C,8CAA8C;AAC9C,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9C,qGAAqG;AACrG,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAU1D,CAAC;AAIF,gIAAgI;AAChI,eAAO,MAAM,UAAU,QAEyE,CAAC;AAEjG,mDAAmD;AACnD,eAAO,MAAM,iBAAiB,QAG7B,CAAC"}
package/dist/tokens.js ADDED
@@ -0,0 +1,43 @@
1
+ // The Proof design tokens as `--sp-*` custom properties (grid verdict decision 3;
2
+ // W-29). One source: the shadow roots adopt TOKENS_CSS, and the build writes
3
+ // TOKENS_STYLESHEET to dist/style.css. No font is named anywhere (SR-LAW-5).
4
+ // Two themes: light (the default) and dark — every dark colour is a mix of
5
+ // Proof's ink #16171A and ground #F6F6F4 with the light hues, shipped as hex
6
+ // (no color-mix() at runtime). A host may override any --sp-* on the element.
7
+ /** The light theme's design tokens, applied as `--sp-<name>` on both elements (SR-GRID decision 15a). */
8
+ export const TOKENS = {
9
+ ground: '#F6F6F4', surface: '#FFFFFF', sunken: '#EFEFEB', line: '#E2E2DD', 'line-strong': '#CBCBC5',
10
+ cell: '#FFFFFF', head: '#F3F3F0', grid: '#E6E6E1',
11
+ ink: '#16171A', 'ink-2': '#45484F', 'ink-3': '#63666E',
12
+ accent: '#2346C8', 'accent-ink': '#1A36A0', 'accent-soft': '#EBEEFB',
13
+ pass: '#16703E', 'pass-soft': '#E6F2EA', fail: '#B42318', 'fail-soft': '#FBE9E7', warn: '#875600', 'warn-soft': '#FBF0D9',
14
+ changed: '#C46A00', 'changed-soft': '#FDF1E3', note: '#6B55CC',
15
+ 'ref-1': '#2346C8', 'ref-2': '#6B55CC', 'ref-3': '#C46A00', 'on-solid': '#FFFFFF',
16
+ hit: '#FFF4C2', 'hit-current': '#FFE07A',
17
+ 'r-sm': '4px', r: '6px', 'r-lg': '10px', 'r-xl': '14px',
18
+ shadow: '0 1px 2px rgba(22,23,26,.06),0 6px 20px rgba(22,23,26,.08)',
19
+ 'shadow-lg': '0 24px 64px rgba(22,23,26,.22)',
20
+ };
21
+ /** The dark set (W-29 DoD 3, accepted by the decider 2026-10-18 from sp-plugins.css `.spx-dark`). */
22
+ export const DARK_TOKENS = {
23
+ ground: '#16171A', surface: '#262729', cell: '#262729', sunken: '#3A3B3D', head: '#313234', grid: '#3E3F41',
24
+ line: '#47484A', 'line-strong': '#6B6C6D', ink: '#F6F6F4', 'ink-2': '#C9C9C8', 'ink-3': '#A1A1A1',
25
+ accent: '#8C9EDE', 'accent-ink': '#B7C1E7', 'accent-soft': '#1A254E',
26
+ pass: '#86B399', 'pass-soft': '#163225', fail: '#D2827B', 'fail-soft': '#451B19', warn: '#CAB692', 'warn-soft': '#412F10',
27
+ changed: '#D39449', 'changed-soft': '#4A3012', note: '#AA9DDE',
28
+ 'ref-1': '#8C9EDE', 'ref-2': '#AA9DDE', 'ref-3': '#D8A262', 'on-solid': '#16171A',
29
+ hit: '#4A3D12', 'hit-current': '#7A5F12',
30
+ shadow: '0 1px 2px rgba(0,0,0,.4),0 6px 20px rgba(0,0,0,.45)',
31
+ 'shadow-lg': '0 24px 64px rgba(0,0,0,.6)',
32
+ };
33
+ const decls = (t) => Object.entries(t).map(([k, v]) => `--sp-${k}:${v};`).join('');
34
+ /** Token defaults on the host element, then the dark set for `theme="dark"` and, when the page prefers dark, `theme="auto"`. */
35
+ export const TOKENS_CSS = `:host{${decls(TOKENS)}color-scheme:light}
36
+ :host([theme=dark]){${decls(DARK_TOKENS)}color-scheme:dark}
37
+ @media (prefers-color-scheme:dark){:host([theme=auto]){${decls(DARK_TOKENS)}color-scheme:dark}}`;
38
+ /** The same for light-DOM use (dist/style.css). */
39
+ export const TOKENS_STYLESHEET = `sheetpane-excel,sheetpane-errors{${decls(TOKENS)}}
40
+ sheetpane-excel[theme=dark],sheetpane-errors[theme=dark]{${decls(DARK_TOKENS)}}
41
+ @media (prefers-color-scheme:dark){sheetpane-excel[theme=auto],sheetpane-errors[theme=auto]{${decls(DARK_TOKENS)}}}
42
+ `;
43
+ //# sourceMappingURL=tokens.js.map
@@ -0,0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