@morphemeris/armilla-core 0.2.0 → 0.3.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/dist/armilla.d.ts +7 -2
- package/dist/armilla.js +15 -3
- package/dist/default-themes.generated.d.ts +10 -0
- package/dist/default-themes.generated.js +5181 -0
- package/dist/default-themes.test.d.ts +1 -0
- package/dist/default-themes.test.js +83 -0
- package/dist/surface.d.ts +1 -0
- package/dist/surface.js +1 -0
- package/docs/themes.md +12 -0
- package/package.json +2 -1
package/dist/armilla.d.ts
CHANGED
|
@@ -29,8 +29,13 @@ export declare function unbookmark(s: string): ViewStateDoc;
|
|
|
29
29
|
export declare function explain(scene: Scene, themeChain: readonly ThemeDoc[], markId: string, property: string): Explanation;
|
|
30
30
|
/** Validate a workspace, returning it normalized (spec §12). */
|
|
31
31
|
export declare function validateWorkspace(workspace: WorkspaceDoc): Workspace;
|
|
32
|
-
/**
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The compiled-in default theme (spec §10.2), or, with a `version`, the
|
|
34
|
+
* historical snapshot `default_v<version>` a host supplies as the pinned base
|
|
35
|
+
* of a chain whose leaf says `extends: "default_v<version>"`. Versions run
|
|
36
|
+
* `1..=DEFAULT_THEME_VERSION`; anything else throws.
|
|
37
|
+
*/
|
|
38
|
+
export declare function defaultTheme(version?: number): ThemeDoc;
|
|
34
39
|
/** Build a table panel's row model (spec §12.1). */
|
|
35
40
|
export declare function tableRows(chartInput: ChartInputDoc, viewState: ViewStateDoc, environment: EnvironmentDoc, options: TableOptions): TableModel;
|
|
36
41
|
/** Build the map panels' line model (spec §12.2). */
|
package/dist/armilla.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_THEME_VERSION, defaultThemeHistory } from './default-themes.generated.js';
|
|
1
2
|
import { wasm } from './runtime.js';
|
|
2
3
|
/** A core failure: the spec §15 error record as a JavaScript error. */
|
|
3
4
|
export class ArmillaError extends Error {
|
|
@@ -71,9 +72,20 @@ export function explain(scene, themeChain, markId, property) {
|
|
|
71
72
|
export function validateWorkspace(workspace) {
|
|
72
73
|
return call(() => wasm().validate_workspace(JSON.stringify(workspace)));
|
|
73
74
|
}
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
/**
|
|
76
|
+
* The compiled-in default theme (spec §10.2), or, with a `version`, the
|
|
77
|
+
* historical snapshot `default_v<version>` a host supplies as the pinned base
|
|
78
|
+
* of a chain whose leaf says `extends: "default_v<version>"`. Versions run
|
|
79
|
+
* `1..=DEFAULT_THEME_VERSION`; anything else throws.
|
|
80
|
+
*/
|
|
81
|
+
export function defaultTheme(version) {
|
|
82
|
+
if (version === undefined)
|
|
83
|
+
return call(() => wasm().default_theme());
|
|
84
|
+
const doc = Number.isInteger(version) ? defaultThemeHistory[version] : undefined;
|
|
85
|
+
if (doc === undefined) {
|
|
86
|
+
throw new Error(`unknown default-theme version ${String(version)}: the history is 1..=${String(DEFAULT_THEME_VERSION)}`);
|
|
87
|
+
}
|
|
88
|
+
return structuredClone(doc);
|
|
77
89
|
}
|
|
78
90
|
/** Build a table panel's row model (spec §12.1). */
|
|
79
91
|
export function tableRows(chartInput, viewState, environment, options) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED by scripts/gen-default-themes.mjs — do not edit.
|
|
3
|
+
* Source: crates/core/themes/history/default_v<n>.json (append-only).
|
|
4
|
+
* The versioned default-theme bases hosts pin via `extends: "default_v<n>"`
|
|
5
|
+
* (spec §10.2); `DEFAULT_THEME_VERSION` is the newest, matching the built-in
|
|
6
|
+
* default's content.
|
|
7
|
+
*/
|
|
8
|
+
import type { ThemeDoc } from './types.js';
|
|
9
|
+
export declare const DEFAULT_THEME_VERSION: number;
|
|
10
|
+
export declare const defaultThemeHistory: Readonly<Record<number, ThemeDoc>>;
|