arethesis 0.1.5 → 0.2.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.
- package/CHANGELOG.md +32 -0
- package/README.md +3 -3
- package/dist/arethesis.js +84 -9
- package/dist/arethesis.js.map +1 -1
- package/dist/components.js +2340 -136
- package/dist/components.js.map +1 -1
- package/dist/core/arethesis.d.ts +1 -1
- package/dist/{arethesis-jPH9QdQE.js → fuzzy-Dnlbxdby.js} +731 -324
- package/dist/fuzzy-Dnlbxdby.js.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/kit/cell-editor.d.ts +47 -0
- package/dist/kit/cell-editor.d.ts.map +1 -0
- package/dist/kit/chart.d.ts +55 -0
- package/dist/kit/chart.d.ts.map +1 -0
- package/dist/kit/command-palette.d.ts +52 -0
- package/dist/kit/command-palette.d.ts.map +1 -0
- package/dist/kit/data-table.d.ts +6 -1
- package/dist/kit/data-table.d.ts.map +1 -1
- package/dist/kit/index.d.ts +18 -1
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/markdown/highlight.d.ts +29 -0
- package/dist/kit/markdown/highlight.d.ts.map +1 -0
- package/dist/kit/markdown/render.d.ts +31 -0
- package/dist/kit/markdown/render.d.ts.map +1 -0
- package/dist/kit/markdown-editor.d.ts +52 -0
- package/dist/kit/markdown-editor.d.ts.map +1 -0
- package/dist/kit/sheet/formula.d.ts +106 -0
- package/dist/kit/sheet/formula.d.ts.map +1 -0
- package/dist/kit/sheet/model.d.ts +28 -0
- package/dist/kit/sheet/model.d.ts.map +1 -0
- package/dist/kit/sheet/sheet.d.ts +45 -0
- package/dist/kit/sheet/sheet.d.ts.map +1 -0
- package/dist/kit/theme-boot.generated.d.ts +2 -0
- package/dist/kit/theme-boot.generated.d.ts.map +1 -1
- package/dist/kit/theme.d.ts +5 -3
- package/dist/kit/theme.d.ts.map +1 -1
- package/dist/mixins/editable.d.ts.map +1 -1
- package/dist/mixins/grid-navigation.d.ts.map +1 -1
- package/dist/mixins/index.d.ts +2 -0
- package/dist/mixins/index.d.ts.map +1 -1
- package/dist/mixins/listbox.d.ts +19 -0
- package/dist/mixins/listbox.d.ts.map +1 -0
- package/dist/realtime/collab/anchors.d.ts +10 -0
- package/dist/realtime/collab/anchors.d.ts.map +1 -0
- package/dist/realtime/collab/collab-session.d.ts +46 -1
- package/dist/realtime/collab/collab-session.d.ts.map +1 -1
- package/dist/realtime/collab/cursor-overlay.d.ts +10 -0
- package/dist/realtime/collab/cursor-overlay.d.ts.map +1 -1
- package/dist/realtime/collab/textarea-adapter.d.ts +13 -0
- package/dist/realtime/collab/textarea-adapter.d.ts.map +1 -1
- package/dist/realtime/collab/undo-manager.d.ts +44 -0
- package/dist/realtime/collab/undo-manager.d.ts.map +1 -0
- package/dist/realtime/ot/client.d.ts +1 -1
- package/dist/realtime/ot/client.d.ts.map +1 -1
- package/dist/realtime/ot/server.d.ts +13 -1
- package/dist/realtime/ot/server.d.ts.map +1 -1
- package/dist/realtime/types.d.ts +29 -1
- package/dist/realtime/types.d.ts.map +1 -1
- package/dist/theme-polychrome-boot.js +17 -0
- package/dist/theme-polychrome.css +310 -0
- package/dist/theme.css +312 -1
- package/dist/tokens/base.tokens.json +18 -0
- package/dist/tokens/dark-high-contrast.tokens.json +11 -0
- package/dist/tokens/dark.tokens.json +81 -0
- package/dist/tokens/light-high-contrast.tokens.json +11 -0
- package/dist/tokens/light.tokens.json +81 -0
- package/dist/tokens/polychrome.base.tokens.json +45 -0
- package/dist/tokens/polychrome.dark-high-contrast.tokens.json +183 -0
- package/dist/tokens/polychrome.dark.tokens.json +321 -0
- package/dist/tokens/polychrome.light-high-contrast.tokens.json +115 -0
- package/dist/tokens/polychrome.light.tokens.json +418 -0
- package/dist/tokens/polychrome.resolver.json +78 -0
- package/dist/utils/fuzzy.d.ts +21 -0
- package/dist/utils/fuzzy.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -1
- package/dist/arethesis-jPH9QdQE.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -39,8 +39,12 @@ export { OTDocumentServer, CollabServer } from './realtime/ot/server';
|
|
|
39
39
|
export { CollabSession, CollabManager } from './realtime/collab/collab-session';
|
|
40
40
|
export type { CollabEvents, CollabOptions, CollabStatus } from './realtime/collab/collab-session';
|
|
41
41
|
export { TextareaAdapter } from './realtime/collab/textarea-adapter';
|
|
42
|
-
export type { EditorAdapter } from './realtime/collab/textarea-adapter';
|
|
43
|
-
export { CursorOverlay, caretCoordinates } from './realtime/collab/cursor-overlay';
|
|
42
|
+
export type { EditorAdapter, CollabApplyDetail } from './realtime/collab/textarea-adapter';
|
|
43
|
+
export { CursorOverlay, caretCoordinates, rangeRects } from './realtime/collab/cursor-overlay';
|
|
44
|
+
export { UndoManager, caretAfter } from './realtime/collab/undo-manager';
|
|
45
|
+
export type { UndoManagerOptions } from './realtime/collab/undo-manager';
|
|
46
|
+
export { transformRange, mapRange } from './realtime/collab/anchors';
|
|
47
|
+
export type { TextRange } from './realtime/collab/anchors';
|
|
44
48
|
export type * from './realtime/types';
|
|
45
49
|
export * from './mixins/index';
|
|
46
50
|
export { PluginManager, registerBuiltInPlugin } from './plugins/plugin-manager';
|
|
@@ -54,6 +58,8 @@ export type * from './plugins/types';
|
|
|
54
58
|
export { sanitizeHtml, htmlToText } from './utils/sanitize';
|
|
55
59
|
export type { SanitizeOptions } from './utils/sanitize';
|
|
56
60
|
export { sanitizeUrl } from './utils/url';
|
|
61
|
+
export { fuzzyMatch, fuzzyFilter } from './utils/fuzzy';
|
|
62
|
+
export type { FuzzyMatch } from './utils/fuzzy';
|
|
57
63
|
export { parseDate, formatDatePattern, toDateInputValue, toDateTimeInputValue } from './utils/dates';
|
|
58
64
|
export { getPath, setPath, deepMerge, deepEqual } from './utils/path';
|
|
59
65
|
export { Emitter } from './utils/emitter';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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O,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5E,mBAAmB,iBAAiB,CAAC;AAGrC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ListboxOption } from '../mixins/listbox';
|
|
2
|
+
export type CellMove = 'up' | 'down' | 'left' | 'right' | 'none';
|
|
3
|
+
export type CellEditorType = 'text' | 'number' | 'date' | 'email' | 'url' | 'select';
|
|
4
|
+
export interface CellEditorOptions {
|
|
5
|
+
cell: HTMLElement;
|
|
6
|
+
/** A positioned element containing the cell (usually its scroll container); the editor is placed in it. */
|
|
7
|
+
host: HTMLElement;
|
|
8
|
+
/** The raw value to edit (not the formatted text). */
|
|
9
|
+
value: string;
|
|
10
|
+
type?: CellEditorType;
|
|
11
|
+
choices?: Array<string | ListboxOption>;
|
|
12
|
+
/** What is being edited, for the input's name and announcements (e.g. "Name"). */
|
|
13
|
+
label: string;
|
|
14
|
+
/** `'enter'`: started by typing; arrows commit and move. `'edit'`: arrows move the caret. @default 'edit' */
|
|
15
|
+
mode?: 'enter' | 'edit';
|
|
16
|
+
/** Where the caret starts: an offset, `'end'` or `'all'` (select everything). @default 'end' */
|
|
17
|
+
caret?: number | 'end' | 'all';
|
|
18
|
+
/** Text to start with instead of `value` (type-to-edit replaces the value). */
|
|
19
|
+
initialText?: string;
|
|
20
|
+
/** Where Enter goes after committing. @default 'none' */
|
|
21
|
+
enterMoves?: 'down' | 'none';
|
|
22
|
+
/** Return `true` or an error message. */
|
|
23
|
+
validate?: (value: string) => true | string | Promise<true | string>;
|
|
24
|
+
/** Save the new value. Called only when it changed and is valid. */
|
|
25
|
+
commit: (value: string) => void | Promise<void>;
|
|
26
|
+
/** The editor closed: whether a new value was committed, and where to move. */
|
|
27
|
+
onClose?: (result: {
|
|
28
|
+
committed: boolean;
|
|
29
|
+
move: CellMove;
|
|
30
|
+
reason: 'commit' | 'cancel' | 'blur';
|
|
31
|
+
}) => void;
|
|
32
|
+
/** Screen-reader announcements. @default a shared polite live region */
|
|
33
|
+
announce?: (message: string) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface CellEditor {
|
|
36
|
+
/** The input (or, for choices, the combobox). */
|
|
37
|
+
readonly input: HTMLElement;
|
|
38
|
+
readonly mode: 'enter' | 'edit';
|
|
39
|
+
readonly closed: boolean;
|
|
40
|
+
/** Validate and commit; resolves to whether the editor closed. */
|
|
41
|
+
commit(move?: CellMove): Promise<boolean>;
|
|
42
|
+
cancel(): void;
|
|
43
|
+
/** Re-align with the cell (after scrolling or resizing). */
|
|
44
|
+
reposition(): void;
|
|
45
|
+
}
|
|
46
|
+
export declare function openCellEditor(o: CellEditorOptions): CellEditor;
|
|
47
|
+
//# sourceMappingURL=cell-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-editor.d.ts","sourceRoot":"","sources":["../../src/kit/cell-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKrE,M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,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,UAAU;IACzB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,kEAAkE;IAClE,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,IAAI,IAAI,CAAC;IACf,4DAA4D;IAC5D,UAAU,IAAI,IAAI,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,iBAAiB,GAAG,UAAU,CAgK/D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Component } from '../components/component';
|
|
2
|
+
export type ChartType = 'line' | 'area' | 'bar' | 'stacked-bar';
|
|
3
|
+
export type ChartX = number | string | Date;
|
|
4
|
+
export type ChartRow = {
|
|
5
|
+
x: ChartX;
|
|
6
|
+
} & Record<string, unknown>;
|
|
7
|
+
export interface ChartSeries {
|
|
8
|
+
key: string;
|
|
9
|
+
label: string;
|
|
10
|
+
/** Any CSS color. @default `var(--ar-chart-N)` by position */
|
|
11
|
+
color?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ChartConfig {
|
|
14
|
+
type: ChartType;
|
|
15
|
+
/** Accessible name, and the data table's caption. */
|
|
16
|
+
label: string;
|
|
17
|
+
series: ChartSeries[];
|
|
18
|
+
data?: ChartRow[];
|
|
19
|
+
x?: {
|
|
20
|
+
type?: 'time' | 'number' | 'category';
|
|
21
|
+
format?: (x: ChartX) => string;
|
|
22
|
+
};
|
|
23
|
+
y?: {
|
|
24
|
+
min?: number;
|
|
25
|
+
max?: number;
|
|
26
|
+
format?: (value: number) => string;
|
|
27
|
+
label?: string;
|
|
28
|
+
};
|
|
29
|
+
/** Keep at most this many points (streaming). */
|
|
30
|
+
maxPoints?: number;
|
|
31
|
+
/** Plot height in px. @default 220 (40 for sparklines) */
|
|
32
|
+
height?: number;
|
|
33
|
+
/** Just the line: no axes, legend, tooltip or table button. */
|
|
34
|
+
sparkline?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** "Nice" axis ticks: 1, 2, 2.5 or 5 times a power of ten. */
|
|
37
|
+
export declare function niceTicks(min: number, max: number, count?: number): number[];
|
|
38
|
+
export declare class Chart extends Component {
|
|
39
|
+
#private;
|
|
40
|
+
/** Set up (or replace) the chart. */
|
|
41
|
+
configure(config: ChartConfig): void;
|
|
42
|
+
get config(): ChartConfig | null;
|
|
43
|
+
get data(): readonly ChartRow[];
|
|
44
|
+
/** Replace all the data. */
|
|
45
|
+
setData(rows: ChartRow[]): void;
|
|
46
|
+
/** Add a point at the end (dropping the oldest beyond `maxPoints`). */
|
|
47
|
+
push(row: ChartRow): void;
|
|
48
|
+
/** Show or hide a series (its color doesn't change). */
|
|
49
|
+
setSeriesVisible(key: string, visible: boolean): void;
|
|
50
|
+
protected onConnected(): void;
|
|
51
|
+
protected onDisconnected(): void;
|
|
52
|
+
/** Draw now (normally batched to the next frame). */
|
|
53
|
+
redraw(): void;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/kit/chart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,aAAa,CAAC;AAChE,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAC5C,MAAM,MAAM,QAAQ,GAAG;IAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;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EAAE,GAAG,IAAI;IAM/B,uEAAuE;IACvE,IAAI,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAOzB,wDAAwD;IACxD,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;cAclC,WAAW,IAAI,IAAI;cAWnB,cAAc,IAAI,IAAI;IAsJzC,qDAAqD;IACrD,MAAM,IAAI,IAAI;CAoPf"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component } from '../components/component';
|
|
2
|
+
export interface PaletteCommand {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
/** Shown under the title, and searched (with less weight). */
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
/** Other words that should find this command. */
|
|
8
|
+
keywords?: string[];
|
|
9
|
+
/** Shortcut hint, e.g. "Ctrl+Shift+L". */
|
|
10
|
+
shortcut?: string;
|
|
11
|
+
/** A short glyph shown before the title. */
|
|
12
|
+
icon?: string;
|
|
13
|
+
run: () => void | Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export interface PaletteSource {
|
|
16
|
+
id: string;
|
|
17
|
+
/** Group heading. */
|
|
18
|
+
label: string;
|
|
19
|
+
/** All commands (filtered by the palette). */
|
|
20
|
+
commands?: () => PaletteCommand[];
|
|
21
|
+
/** Or search yourself, for large or remote data: return matches for a query. */
|
|
22
|
+
search?: (query: string) => PaletteCommand[] | Promise<PaletteCommand[]>;
|
|
23
|
+
/** Most items shown from this source. @default 8 */
|
|
24
|
+
limit?: number;
|
|
25
|
+
/** Lower comes first. @default 0 */
|
|
26
|
+
order?: number;
|
|
27
|
+
}
|
|
28
|
+
/** A source that searches objects of one type in the store. */
|
|
29
|
+
export declare function storeSource<T>(options: {
|
|
30
|
+
type: string;
|
|
31
|
+
label: string;
|
|
32
|
+
title: (data: T) => string;
|
|
33
|
+
subtitle?: (data: T) => string;
|
|
34
|
+
icon?: string;
|
|
35
|
+
run: (data: T, id: string) => void;
|
|
36
|
+
limit?: number;
|
|
37
|
+
order?: number;
|
|
38
|
+
}): PaletteSource;
|
|
39
|
+
export declare class CommandPalette extends Component {
|
|
40
|
+
#private;
|
|
41
|
+
static get observedAttributes(): string[];
|
|
42
|
+
attributeChangedCallback(): void;
|
|
43
|
+
/** Add (or replace) a source of commands. Returns a function that removes it. */
|
|
44
|
+
addSource(source: PaletteSource): () => void;
|
|
45
|
+
removeSource(id: string): void;
|
|
46
|
+
get isOpen(): boolean;
|
|
47
|
+
protected onConnected(): void;
|
|
48
|
+
/** Open the palette, optionally with a query. */
|
|
49
|
+
open(query?: string): void;
|
|
50
|
+
close(): void;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=command-palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../src/kit/command-palette.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMpD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,cAAc,EAAE,CAAC;IAClC,gFAAgF;IAChF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,cAAc,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IACzE,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoBD,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,aAAa,CAoBhB;AASD,qBAAa,cAAe,SAAQ,SAAS;;IAc3C,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,wBAAwB,IAAI,IAAI;IAIhC,iFAAiF;IACjF,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,IAAI;IAM5C,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI9B,IAAI,MAAM,IAAI,OAAO,CAEpB;cAEkB,WAAW,IAAI,IAAI;IAmDtC,iDAAiD;IACjD,IAAI,CAAC,KAAK,SAAK,GAAG,IAAI;IAWtB,KAAK,IAAI,IAAI;CAuJd"}
|
package/dist/kit/data-table.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component } from '../components/component';
|
|
2
2
|
import { DisplayType, FieldBindConfig, FieldValidationConfig } from '../binding/types';
|
|
3
3
|
import { ListView, ListViewConfig, SortConfig, StoredObject } from '../data/types';
|
|
4
|
+
import { CellEditor } from './cell-editor';
|
|
4
5
|
export interface DataTableColumn {
|
|
5
6
|
field: string;
|
|
6
7
|
label: string;
|
|
@@ -8,7 +9,7 @@ export interface DataTableColumn {
|
|
|
8
9
|
/** Extra binding options (format, currency, locale, …). */
|
|
9
10
|
bind?: Omit<FieldBindConfig, 'selector' | 'field'>;
|
|
10
11
|
sortable?: boolean;
|
|
11
|
-
/** Allow inline editing (Enter, F2,
|
|
12
|
+
/** Allow inline editing (a click, Enter, F2, or typing). */
|
|
12
13
|
editable?: boolean | {
|
|
13
14
|
type?: 'text' | 'number' | 'date' | 'email' | 'url' | 'select';
|
|
14
15
|
choices?: string[];
|
|
@@ -33,6 +34,8 @@ export interface DataTableConfig {
|
|
|
33
34
|
} | ((id: string, changes: Record<string, unknown>) => Promise<unknown>);
|
|
34
35
|
/** Accessible table caption. */
|
|
35
36
|
caption?: string;
|
|
37
|
+
/** Where Enter goes after saving an edit: stay on the cell, or move down. @default 'none' */
|
|
38
|
+
enterMoves?: 'down' | 'none';
|
|
36
39
|
/** Text when the list is empty. @default 'No results' */
|
|
37
40
|
emptyText?: string;
|
|
38
41
|
/** Infinite scroll threshold in px. @default 400 */
|
|
@@ -52,6 +55,8 @@ export declare class DataTable extends Component {
|
|
|
52
55
|
protected loadTemplate(templateId: string): Promise<DocumentFragment | null>;
|
|
53
56
|
protected onItemRender(element: Element, obj: StoredObject): void;
|
|
54
57
|
protected onListChange(view: ListView): void;
|
|
58
|
+
/** The cell being edited, if any. */
|
|
59
|
+
get editing(): CellEditor | null;
|
|
55
60
|
protected onDisconnected(): void;
|
|
56
61
|
}
|
|
57
62
|
//# sourceMappingURL=data-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/kit/data-table.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/kit/data-table.ts"],"names":[],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AE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACtI,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6FAA6F;IAC7F,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoBD,qBAAa,SAAU,SAAQ,SAAS;;IAOtC,6CAA6C;IAC7C,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAOxC,IAAI,IAAI,IAAI,QAAQ,GAAG,IAAI,CAE1B;IAED,iCAAiC;IACjC,IAAI,QAAQ,IAAI,MAAM,GAAG,IAAI,CAE5B;IAED,oDAAoD;IACpD,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3D,qDAAqD;IACrD,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;cAkGjB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;cAuBxE,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,GAAG,IAAI;cAIvD,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAmBrD,qCAAqC;IACrC,IAAI,OAAO,IAAI,UAAU,GAAG,IAAI,CAE/B;cAgGkB,cAAc,IAAI,IAAI;CAG1C"}
|
package/dist/kit/index.d.ts
CHANGED
|
@@ -19,6 +19,23 @@ export { FlexView } from './flex-view';
|
|
|
19
19
|
export type { FlexPanelConfig, FlexViewConfig } from './flex-view';
|
|
20
20
|
export { List } from './list';
|
|
21
21
|
export { Form } from './form';
|
|
22
|
-
export {
|
|
22
|
+
export { Chart, niceTicks } from './chart';
|
|
23
|
+
export type { ChartConfig, ChartRow, ChartSeries, ChartType, ChartX } from './chart';
|
|
24
|
+
export { CommandPalette, storeSource } from './command-palette';
|
|
25
|
+
export type { PaletteCommand, PaletteSource } from './command-palette';
|
|
26
|
+
export { Sheet } from './sheet/sheet';
|
|
27
|
+
export type { SheetConfig } from './sheet/sheet';
|
|
28
|
+
export { SheetModel } from './sheet/model';
|
|
29
|
+
export { parse as parseFormula, evaluate as evaluateFormula, shiftFormula, FormulaError, address, parseAddress, colName, colIndex } from './sheet/formula';
|
|
30
|
+
export type { CellValue, ErrorCode } from './sheet/formula';
|
|
31
|
+
export { openCellEditor } from './cell-editor';
|
|
32
|
+
export type { CellEditor, CellEditorOptions, CellMove, CellEditorType } from './cell-editor';
|
|
33
|
+
export { MarkdownEditor } from './markdown-editor';
|
|
34
|
+
export type { MarkdownLayout, MarkdownMark } from './markdown-editor';
|
|
35
|
+
export { renderMarkdown, renderInline, markdownOutline } from './markdown/render';
|
|
36
|
+
export type { OutlineEntry } from './markdown/render';
|
|
37
|
+
export { highlightMarkdown, highlightLine, highlightInline } from './markdown/highlight';
|
|
38
|
+
export type { LineState } from './markdown/highlight';
|
|
39
|
+
export { setTheme, setContrast, getTheme, getContrast, applyStoredTheme, themeBootScript, themeBootHtml, CRITICAL_CSS, POLYCHROME_CRITICAL_CSS, THEME_STORAGE_KEY, CONTRAST_STORAGE_KEY, } from './theme';
|
|
23
40
|
export type { ThemeChoice, ContrastChoice, ThemeStorageOptions } from './theme';
|
|
24
41
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/kit/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kit/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,eAAe,EAAE,e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tC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,QAAQ,IAAI,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3J,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClF,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACzF,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown syntax highlighting for a source editor, one line at a time.
|
|
3
|
+
*
|
|
4
|
+
* The output's text is exactly the input's (only wrapped in spans), so it
|
|
5
|
+
* can sit behind a transparent textarea and line up character for
|
|
6
|
+
* character. Only colors and weights change, never widths, provided the
|
|
7
|
+
* font is monospaced.
|
|
8
|
+
*
|
|
9
|
+
* Lines are highlighted independently given the state left by the previous
|
|
10
|
+
* line (whether it's inside a fenced code block), so an editor only has to
|
|
11
|
+
* re-highlight the lines that changed.
|
|
12
|
+
*
|
|
13
|
+
* @module kit/markdown/highlight
|
|
14
|
+
*/
|
|
15
|
+
export interface LineState {
|
|
16
|
+
/** The opening fence (``` or ~~~…) while inside a code block. */
|
|
17
|
+
fence: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare const START_STATE: LineState;
|
|
20
|
+
/** Highlight inline Markdown. */
|
|
21
|
+
export declare function highlightInline(text: string): string;
|
|
22
|
+
/** Highlight one line, given the state after the previous line. */
|
|
23
|
+
export declare function highlightLine(line: string, state: LineState): {
|
|
24
|
+
html: string;
|
|
25
|
+
state: LineState;
|
|
26
|
+
};
|
|
27
|
+
/** Highlight a whole document; returns one HTML string per line. */
|
|
28
|
+
export declare function highlightMarkdown(source: string): string[];
|
|
29
|
+
//# sourceMappingURL=highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../../src/kit/markdown/highlight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,SAAS;IACxB,iEAAiE;IACjE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,EAAE,SAA2B,CAAC;AAetD,iCAAiC;AACjC,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA2BpD;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAkChG;AAED,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAO1D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small, safe Markdown renderer: the CommonMark core most documents use,
|
|
3
|
+
* plus GFM tables, task lists and strikethrough.
|
|
4
|
+
*
|
|
5
|
+
* Supported: ATX headings, paragraphs and hard breaks, emphasis, strong,
|
|
6
|
+
* `code`, fenced code blocks, block quotes, nested bulleted, numbered and
|
|
7
|
+
* task lists, links, images, autolinks, horizontal rules, strikethrough and
|
|
8
|
+
* pipe tables. Raw HTML is not supported: it's shown as text.
|
|
9
|
+
*
|
|
10
|
+
* Every piece of text is escaped, URLs go through `sanitizeUrl`, and the
|
|
11
|
+
* result goes through `sanitizeHtml`, so the output is safe to insert.
|
|
12
|
+
* Block elements carry `data-line` (the 0-based source line), so a preview
|
|
13
|
+
* can be scrolled in step with the source.
|
|
14
|
+
*
|
|
15
|
+
* @module kit/markdown/render
|
|
16
|
+
*/
|
|
17
|
+
/** Render inline Markdown (already a single block's text) to HTML. */
|
|
18
|
+
export declare function renderInline(text: string): string;
|
|
19
|
+
/** Render Markdown to sanitized HTML. */
|
|
20
|
+
export declare function renderMarkdown(source: string): string;
|
|
21
|
+
export interface OutlineEntry {
|
|
22
|
+
level: number;
|
|
23
|
+
text: string;
|
|
24
|
+
/** 0-based source line. */
|
|
25
|
+
line: number;
|
|
26
|
+
/** Offset of the heading's first character in the source. */
|
|
27
|
+
offset: number;
|
|
28
|
+
}
|
|
29
|
+
/** The ATX headings of a document (outside code blocks), for an outline. */
|
|
30
|
+
export declare function markdownOutline(source: string): OutlineEntry[];
|
|
31
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/kit/markdown/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAmBH,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA+BjD;AAqKD,yCAAyC;AACzC,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE,CAc9D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component } from '../components/component';
|
|
2
|
+
import { OutlineEntry } from './markdown/render';
|
|
3
|
+
export type MarkdownLayout = 'split' | 'write' | 'preview';
|
|
4
|
+
/** A highlighted range, e.g. a comment. */
|
|
5
|
+
export interface MarkdownMark {
|
|
6
|
+
id: string;
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
/** CSS color (hex, rgb() or hsl()). */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** Drawn more strongly, e.g. the comment being read. */
|
|
12
|
+
active?: boolean;
|
|
13
|
+
}
|
|
14
|
+
type Command = 'bold' | 'italic' | 'strike' | 'code' | 'heading' | 'quote' | 'bullet' | 'numbered' | 'task' | 'link' | 'codeblock';
|
|
15
|
+
export declare class MarkdownEditor extends Component {
|
|
16
|
+
#private;
|
|
17
|
+
static get observedAttributes(): string[];
|
|
18
|
+
attributeChangedCallback(name: string): void;
|
|
19
|
+
/** The textarea being edited. */
|
|
20
|
+
get textarea(): HTMLTextAreaElement | null;
|
|
21
|
+
get value(): string;
|
|
22
|
+
get layout(): MarkdownLayout;
|
|
23
|
+
set layout(layout: MarkdownLayout);
|
|
24
|
+
/** The document's headings. */
|
|
25
|
+
get outline(): OutlineEntry[];
|
|
26
|
+
/** Ranges to highlight (comments and the like), in document positions. */
|
|
27
|
+
get annotations(): MarkdownMark[];
|
|
28
|
+
set annotations(marks: MarkdownMark[]);
|
|
29
|
+
protected onConnected(): void;
|
|
30
|
+
protected onDisconnected(): void;
|
|
31
|
+
/** Re-read the textarea (call after changing its value from code without an `input` event). */
|
|
32
|
+
refresh(): void;
|
|
33
|
+
/** Replace `from`–`to` with `text` as a user edit (it fires `input`), then select `select`. */
|
|
34
|
+
replaceRange(from: number, to: number, text: string, select?: [number, number]): void;
|
|
35
|
+
/** Undo your last edit. */
|
|
36
|
+
undo(): boolean;
|
|
37
|
+
/** Redo your last undone edit. */
|
|
38
|
+
redo(): boolean;
|
|
39
|
+
/** Apply a toolbar command to the selection. */
|
|
40
|
+
format(command: Command): void;
|
|
41
|
+
openFind(): void;
|
|
42
|
+
closeFind(): void;
|
|
43
|
+
/** Move to the next (1) or previous (-1) match. */
|
|
44
|
+
findNext(direction?: 1 | -1): void;
|
|
45
|
+
replaceCurrent(): void;
|
|
46
|
+
/** Replace every match, as one edit (one undo step). */
|
|
47
|
+
replaceAll(): void;
|
|
48
|
+
/** Scroll the source so that a position is visible (optionally moving the caret there). */
|
|
49
|
+
revealOffset(offset: number, moveCaret?: boolean): void;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=markdown-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-editor.d.ts","sourceRoot":"","sources":["../../src/kit/markdown-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMpD,OAAO,EAAmC,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGvF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3D,2CAA2C;AAC3C,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MA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WhB,SAAS,IAAI,IAAI;IAgCjB,mDAAmD;IACnD,QAAQ,CAAC,SAAS,GAAE,CAAC,GAAG,CAAC,CAAK,GAAG,IAAI;IAgBrC,cAAc,IAAI,IAAI;IActB,wDAAwD;IACxD,UAAU,IAAI,IAAI;IAoBlB,2FAA2F;IAC3F,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,UAAO,GAAG,IAAI;CA2BrD"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spreadsheet formulas: addresses, a tokenizer and parser for `=` expressions,
|
|
3
|
+
* and an evaluator.
|
|
4
|
+
*
|
|
5
|
+
* Supported: numbers, "strings", TRUE/FALSE; `+ - * / ^ &` and comparisons
|
|
6
|
+
* (`= <> < > <= >=`); references (`A1`, `$A$1`) and ranges (`A1:B9`); and the
|
|
7
|
+
* functions SUM, AVERAGE (AVG), MIN, MAX, COUNT, IF, ROUND, ABS, CONCAT.
|
|
8
|
+
* Errors are values, as in other spreadsheets: `#REF!`, `#DIV/0!`,
|
|
9
|
+
* `#VALUE!`, `#NAME?`, `#CYCLE!` and `#ERROR!` (unparseable).
|
|
10
|
+
*
|
|
11
|
+
* @module kit/sheet/formula
|
|
12
|
+
*/
|
|
13
|
+
export type ErrorCode = '#REF!' | '#DIV/0!' | '#VALUE!' | '#NAME?' | '#CYCLE!' | '#ERROR!';
|
|
14
|
+
export declare class FormulaError {
|
|
15
|
+
readonly code: ErrorCode;
|
|
16
|
+
constructor(code: ErrorCode);
|
|
17
|
+
toString(): string;
|
|
18
|
+
}
|
|
19
|
+
export type CellValue = number | string | boolean | FormulaError;
|
|
20
|
+
/** 0-based column index of a column name: A → 0, Z → 25, AA → 26. */
|
|
21
|
+
export declare function colIndex(name: string): number;
|
|
22
|
+
/** Column name of a 0-based index. */
|
|
23
|
+
export declare function colName(index: number): string;
|
|
24
|
+
export declare const address: (row: number, col: number) => string;
|
|
25
|
+
/** Parse "B7" into 0-based `{ row, col }`, or null. */
|
|
26
|
+
export declare function parseAddress(addr: string): {
|
|
27
|
+
row: number;
|
|
28
|
+
col: number;
|
|
29
|
+
} | null;
|
|
30
|
+
type Token = {
|
|
31
|
+
t: 'num';
|
|
32
|
+
v: number;
|
|
33
|
+
} | {
|
|
34
|
+
t: 'str';
|
|
35
|
+
v: string;
|
|
36
|
+
} | {
|
|
37
|
+
t: 'bool';
|
|
38
|
+
v: boolean;
|
|
39
|
+
} | {
|
|
40
|
+
t: 'ref';
|
|
41
|
+
v: string;
|
|
42
|
+
} | {
|
|
43
|
+
t: 'name';
|
|
44
|
+
v: string;
|
|
45
|
+
} | {
|
|
46
|
+
t: 'op';
|
|
47
|
+
v: string;
|
|
48
|
+
} | {
|
|
49
|
+
t: '(' | ')' | ',' | ':';
|
|
50
|
+
};
|
|
51
|
+
export declare function tokenize(src: string): Token[];
|
|
52
|
+
export type Node = {
|
|
53
|
+
k: 'num';
|
|
54
|
+
v: number;
|
|
55
|
+
} | {
|
|
56
|
+
k: 'str';
|
|
57
|
+
v: string;
|
|
58
|
+
} | {
|
|
59
|
+
k: 'bool';
|
|
60
|
+
v: boolean;
|
|
61
|
+
} | {
|
|
62
|
+
k: 'ref';
|
|
63
|
+
ref: string;
|
|
64
|
+
} | {
|
|
65
|
+
k: 'range';
|
|
66
|
+
from: string;
|
|
67
|
+
to: string;
|
|
68
|
+
} | {
|
|
69
|
+
k: 'unary';
|
|
70
|
+
op: string;
|
|
71
|
+
arg: Node;
|
|
72
|
+
} | {
|
|
73
|
+
k: 'bin';
|
|
74
|
+
op: string;
|
|
75
|
+
l: Node;
|
|
76
|
+
r: Node;
|
|
77
|
+
} | {
|
|
78
|
+
k: 'call';
|
|
79
|
+
name: string;
|
|
80
|
+
args: Node[];
|
|
81
|
+
};
|
|
82
|
+
/** Parse a formula (without the leading `=`). Throws a FormulaError on bad syntax. */
|
|
83
|
+
export declare function parse(src: string): Node;
|
|
84
|
+
/** Every cell a formula reads (ranges expanded). */
|
|
85
|
+
export declare function references(node: Node, limits?: {
|
|
86
|
+
rows: number;
|
|
87
|
+
cols: number;
|
|
88
|
+
}): string[];
|
|
89
|
+
export declare function expandRange(from: string, to: string, limits?: {
|
|
90
|
+
rows: number;
|
|
91
|
+
cols: number;
|
|
92
|
+
}): string[];
|
|
93
|
+
export interface EvalContext {
|
|
94
|
+
/** The value of a cell (already computed). */
|
|
95
|
+
get(ref: string): CellValue;
|
|
96
|
+
rows: number;
|
|
97
|
+
cols: number;
|
|
98
|
+
}
|
|
99
|
+
export declare function evaluate(node: Node, ctx: EvalContext): CellValue;
|
|
100
|
+
/**
|
|
101
|
+
* Shift a formula's relative references by `dRow`/`dCol` (for fill and
|
|
102
|
+
* paste). `$`-anchored parts stay; references pushed off the sheet become `#REF!`.
|
|
103
|
+
*/
|
|
104
|
+
export declare function shiftFormula(raw: string, dRow: number, dCol: number): string;
|
|
105
|
+
export {};
|
|
106
|
+
//# sourceMappingURL=formula.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formula.d.ts","sourceRoot":"","sources":["../../../src/kit/sheet/formula.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAE3F,qBAAa,YAAY;IACX,QAAQ,CAAC,IAAI,EAAE,SAAS;gBAAf,IAAI,EAAE,SAAS;IACpC,QAAQ,IAAI,MAAM;CAGnB;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;AAIjE,qEAAqE;AACrE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI7C;AAED,sCAAsC;AACtC,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7C;AAED,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM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
4
|
+
readonly cols: number;
|
|
5
|
+
private raw;
|
|
6
|
+
private values;
|
|
7
|
+
private asts;
|
|
8
|
+
/** cell → the cells it reads */
|
|
9
|
+
private deps;
|
|
10
|
+
/** cell → the cells that read it */
|
|
11
|
+
private readers;
|
|
12
|
+
constructor(rows: number, cols: number);
|
|
13
|
+
/** What was typed into a cell ('' if empty). */
|
|
14
|
+
getRaw(addr: string): string;
|
|
15
|
+
/** A cell's computed value ('' if empty). */
|
|
16
|
+
getValue(addr: string): CellValue;
|
|
17
|
+
/** Every non-empty cell's raw content. */
|
|
18
|
+
entries(): Array<[string, string]>;
|
|
19
|
+
/** Set cells (raw content; '' clears). Returns every cell whose value changed. */
|
|
20
|
+
set(changes: Record<string, string>): Set<string>;
|
|
21
|
+
private parsed;
|
|
22
|
+
/** Update the graph edges for a cell. */
|
|
23
|
+
private link;
|
|
24
|
+
private recalculate;
|
|
25
|
+
/** Compute one cell; returns whether its value changed. */
|
|
26
|
+
private compute;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/kit/sheet/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAA6C,KAAK,SAAS,EAAa,MAAM,WAAW,CAAC;AAEjG,qBAAa,UAAU;IAST,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM;IARxD,OAAO,CAAC,GAAG,CAA6B;IACxC,OAAO,CAAC,MAAM,CAAgC;IAC9C,OAAO,CAAC,IAAI,CAA0C;IACtD,gCAAgC;IAChC,OAAO,CAAC,IAAI,CAAkC;IAC9C,oCAAoC;IACpC,OAAO,CAAC,OAAO,CAAkC;gBAE5B,IAAI,EAAE,MAAM,EAAW,IAAI,EAAE,MAAM;IAExD,gDAAgD;IAChD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI5B,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;IAIjC,0CAA0C;IAC1C,OAAO,IAAI,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAIlC,kFAAkF;IAClF,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAYjD,OAAO,CAAC,MAAM;IAed,yCAAyC;IACzC,OAAO,CAAC,IAAI;IAWZ,OAAO,CAAC,WAAW;IA0CnB,2DAA2D;IAC3D,OAAO,CAAC,OAAO;CAkBhB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Component } from '../../components/component';
|
|
2
|
+
import { CellValue } from './formula';
|
|
3
|
+
import { SheetModel } from './model';
|
|
4
|
+
export interface SheetConfig {
|
|
5
|
+
rows?: number;
|
|
6
|
+
cols?: number;
|
|
7
|
+
/** Initial contents: raw text or `=formulas` by address. */
|
|
8
|
+
cells?: Record<string, string>;
|
|
9
|
+
/** Accessible name. @default 'Spreadsheet' */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Format a computed number for display. */
|
|
12
|
+
formatNumber?: (value: number, addr: string) => string;
|
|
13
|
+
/** Column widths in px by column letter. */
|
|
14
|
+
widths?: Record<string, number>;
|
|
15
|
+
/** Read-only cells (e.g. headings) by address. */
|
|
16
|
+
readOnly?: (addr: string) => boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class Sheet extends Component {
|
|
19
|
+
#private;
|
|
20
|
+
configure(config: SheetConfig): void;
|
|
21
|
+
/** The model behind the sheet (raw content and computed values). */
|
|
22
|
+
get model(): SheetModel;
|
|
23
|
+
get active(): string;
|
|
24
|
+
/** The selected range, e.g. "B2:C5" (or one address). */
|
|
25
|
+
get selection(): string;
|
|
26
|
+
getValue(addr: string): CellValue;
|
|
27
|
+
/**
|
|
28
|
+
* Set cells from code. Local changes (the default) are undoable and fire
|
|
29
|
+
* `sheet:change`; `{ remote: true }` applies someone else's edit, briefly
|
|
30
|
+
* highlighting it.
|
|
31
|
+
*/
|
|
32
|
+
setCells(changes: Record<string, string>, options?: {
|
|
33
|
+
remote?: boolean;
|
|
34
|
+
by?: string;
|
|
35
|
+
}): void;
|
|
36
|
+
/** Move the active cell (and selection) to an address. */
|
|
37
|
+
select(addr: string, extend?: boolean): void;
|
|
38
|
+
undo(): boolean;
|
|
39
|
+
redo(): boolean;
|
|
40
|
+
protected onConnected(): void;
|
|
41
|
+
protected onDisconnected(): void;
|
|
42
|
+
/** Render now (normally batched to the next frame). */
|
|
43
|
+
redraw(): void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../src/kit/sheet/sheet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAKvD,OAAO,EAA8D,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACvG,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACvD,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,kDAAkD;IAClD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACtC;AAmBD,qBAAa,KAAM,SAAQ,SAAS;;IAoBlC,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAUpC,oEAAoE;IACpE,IAAI,KAAK,IAAI,UAAU,CAEtB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,yDAAyD;IACzD,IAAI,SAAS,IAAI,MAAM,CAKtB;IAED,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;IAIjC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI;IAmBhG,0DAA0D;IAC1D,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG,IAAI;IA6B1C,IAAI,IAAI,OAAO;IASf,IAAI,IAAI,OAAO;cAWI,WAAW,IAAI,IAAI;cAMnB,cAAc,IAAI,IAAI;IAmDzC,uDAAuD;IACvD,MAAM,IAAI,IAAI;CA2Wf"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/** Background, text color and color-scheme for every theme: what a page needs before its stylesheet loads. */
|
|
2
2
|
export declare const CRITICAL_CSS = ":root{background:#ffffff;color:#161a23;color-scheme:light}@media (prefers-color-scheme: dark){:root:not([data-theme='light']){background:#0f1117;color:#e8eaf1;color-scheme:dark}}:root[data-theme='dark']{background:#0f1117;color:#e8eaf1;color-scheme:dark}@media (prefers-contrast: more){:root:not([data-contrast='standard']){background:#ffffff;color:#000000;color-scheme:light}}:root[data-contrast='more']{background:#ffffff;color:#000000;color-scheme:light}@media (prefers-contrast: more) and (prefers-color-scheme: dark){:root:not([data-contrast='standard']):not([data-theme='light']){background:#000000;color:#ffffff;color-scheme:dark}}@media (prefers-contrast: more){:root[data-theme='dark']:not([data-contrast='standard']){background:#000000;color:#ffffff;color-scheme:dark}}@media (prefers-color-scheme: dark){:root[data-contrast='more']:not([data-theme='light']){background:#000000;color:#ffffff;color-scheme:dark}}:root[data-theme='dark'][data-contrast='more']{background:#000000;color:#ffffff;color-scheme:dark}";
|
|
3
|
+
/** The same for the Polychrome theme. */
|
|
4
|
+
export declare const POLYCHROME_CRITICAL_CSS = ":root{background:#f5eedf;color:#1d1712;color-scheme:light}@media (prefers-color-scheme: dark){:root:not([data-theme='light']){background:#14100c;color:#efe4d0;color-scheme:dark}}:root[data-theme='dark']{background:#14100c;color:#efe4d0;color-scheme:dark}@media (prefers-contrast: more){:root:not([data-contrast='standard']){background:#f5eedf;color:#000000;color-scheme:light}}:root[data-contrast='more']{background:#f5eedf;color:#000000;color-scheme:light}@media (prefers-contrast: more) and (prefers-color-scheme: dark){:root:not([data-contrast='standard']):not([data-theme='light']){background:#000000;color:#ffffff;color-scheme:dark}}@media (prefers-contrast: more){:root[data-theme='dark']:not([data-contrast='standard']){background:#000000;color:#ffffff;color-scheme:dark}}@media (prefers-color-scheme: dark){:root[data-contrast='more']:not([data-theme='light']){background:#000000;color:#ffffff;color-scheme:dark}}:root[data-theme='dark'][data-contrast='more']{background:#000000;color:#ffffff;color-scheme:dark}";
|
|
3
5
|
//# sourceMappingURL=theme-boot.generated.d.ts.map
|