@holistics/anfra-sdk 0.14.1 → 0.14.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.
package/dist/app.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { S as Sdk } from './bootstrap-MhTSkiA1.js';
2
- export { A as AnfraPlugins, a as App, C as Control, b as CrossFilter, D as DateDrillControl, c as DeprecatedFeatures, E as Edge, F as Filter, d as FrameKernel, e as FrameMenuItem, I as InstalledPlugins, M as Mapping, f as ModalInput, O as OVERLAY_ID, g as Opened, h as PluginApi, i as PluginMembers, j as PluginName, P as PluginSetup, k as PopoverInput, l as PopoverSide, Q as Query, m as STRUCTURE_ATTRIBUTES, V as VERSION, n as bootstrap, o as buildStructure, p as createSdk, q as parseRef } from './bootstrap-MhTSkiA1.js';
1
+ import { S as Sdk } from './bootstrap-n07aQzlx.js';
2
+ export { A as AnfraPlugins, a as App, C as Control, b as CrossFilter, D as DateDrillControl, c as DeprecatedFeatures, E as Edge, F as Filter, d as FrameKernel, e as FrameMenuItem, I as InstalledPlugins, M as Mapping, f as ModalInput, O as OVERLAY_ID, g as Opened, h as PluginApi, i as PluginMembers, j as PluginName, P as PluginSetup, k as PopoverInput, l as PopoverSide, Q as Query, m as STRUCTURE_ATTRIBUTES, V as VERSION, n as bootstrap, o as buildStructure, p as createSdk, q as parseRef } from './bootstrap-n07aQzlx.js';
3
3
  export { D as DataAppError, P as PermissionError, Q as QueryError, T as TransportError, V as ValidationError } from './errors-CKvqVaqU.js';
4
4
  export { A as Aggregation, a as AppDeclaration, b as AppJson, c as ArrowType, B as Backend, d as BackendCondition, e as BackendDateDrill, f as BackendExportRequest, g as BackendFilter, h as BackendLineageRequest, i as BackendQueryRequest, j as BackendQueryResult, k as BackendSort, C as ColumnMeta, l as Condition, m as ConditionValue, n as ControlMappingJson, o as CrossFilterJson, D as DatasetDescriptor, p as DateDrillDeclaration, q as DateGrain, r as DateTransformation, E as EntityKind, s as EntityRef, t as EntityUsage, u as ExecuteOptions, v as ExecuteSummary, w as ExportFormat, x as ExportFormatOptions, y as ExportOptions, z as ExportResult, F as FILTER_AGGREGATIONS, G as FieldLineage, H as FieldSuggestionsRequest, I as FilterAggregation, J as FilterDeclaration, K as FilterValueType, L as InspectedApp, M as InspectedControl, N as InspectedError, O as InspectedQuery, P as InspectedSelection, Q as InspectedStructure, R as LineageCard, S as LineageDiagram, T as LineageNode, U as LineageOptions, V as LineageResult, W as LineageTarget, X as Listener, Y as LocateKind, Z as LocateTarget, _ as MappingJson, $ as Operator, a0 as QueryDebug, a1 as QueryDeclaration, a2 as QueryInput, a3 as QueryResult, a4 as QuerySort, a5 as QueryState, a6 as QueryTimings, a7 as RenderFormat, a8 as RenderRequest, a9 as Rendering, aa as Row, ab as SdkEnvironment, ac as SdkFeatures, ad as Selection, ae as SelectionCondition, af as SemanticType, ag as StructureKind, ah as StructureNode, ai as Unsubscribe, aj as User } from './types-CWNv6N0y.js';
5
- export { B as BridgeError, a as BridgeMessage, D as DEFAULT_TOKENS, F as FrameMessage, H as HostMessage, M as MenuEntry, b as MenuTarget, c as MenuTargetKind, N as NodeTarget, P as PROVISION_ELEMENT_ID, d as PluginInfo, e as Provision, R as RowsTarget, T as THEME_TOKENS, f as TargetRect, g as Theme, h as ThemeInput, i as ThemeScheme, j as ThemeToken, k as ThemeTokens, l as checkTarget, r as resolveTheme } from './menu-CdGVKc4_.js';
5
+ export { B as BridgeError, a as BridgeMessage, D as DEFAULT_TOKENS, b as DESIGN_TOKENS, F as FrameMessage, H as HostMessage, M as MenuEntry, c as MenuTarget, d as MenuTargetKind, N as NodeTarget, P as PROVISION_ELEMENT_ID, e as PluginInfo, f as Provision, R as RowsTarget, T as THEME_TOKENS, g as TargetRect, h as Theme, i as ThemeInput, j as ThemeScheme, k as ThemeToken, l as ThemeTokens, m as checkTarget, n as designTheme, r as resolveTheme } from './menu-COEAKOnm.js';
6
6
 
7
7
  declare const SANDBOX_GLOBAL = "Anfra";
8
8
  /**
package/dist/app.js CHANGED
@@ -22,18 +22,20 @@ import {
22
22
  createSdk,
23
23
  installSandbox,
24
24
  parseRef
25
- } from "./chunk-HRV45ULB.js";
25
+ } from "./chunk-DFZTWEXW.js";
26
26
  import {
27
27
  FILTER_AGGREGATIONS
28
28
  } from "./chunk-XIUFHRZE.js";
29
29
  import "./chunk-S6XLP6U4.js";
30
30
  import {
31
31
  DEFAULT_TOKENS,
32
+ DESIGN_TOKENS,
32
33
  PROVISION_ELEMENT_ID,
33
34
  THEME_TOKENS,
35
+ designTheme,
34
36
  resolveTheme
35
- } from "./chunk-F6MRA7J4.js";
36
- import "./chunk-Q46CZIEK.js";
37
+ } from "./chunk-RXPNL7UR.js";
38
+ import "./chunk-KA6ZNM7N.js";
37
39
  import {
38
40
  DataAppError,
39
41
  PermissionError,
@@ -47,6 +49,7 @@ export {
47
49
  Control,
48
50
  CrossFilter,
49
51
  DEFAULT_TOKENS,
52
+ DESIGN_TOKENS,
50
53
  DataAppError,
51
54
  DateDrillControl,
52
55
  FILTER_AGGREGATIONS,
@@ -70,6 +73,7 @@ export {
70
73
  buildStructure,
71
74
  checkTarget,
72
75
  createSdk,
76
+ designTheme,
73
77
  installSandbox,
74
78
  parseRef,
75
79
  resolveTheme
@@ -1,6 +1,6 @@
1
1
  import { D as DataAppError, V as ValidationError, Q as QueryError, P as PermissionError, T as TransportError } from './errors-CKvqVaqU.js';
2
2
  import { X as Listener, ai as Unsubscribe, D as DatasetDescriptor, y as ExportOptions, z as ExportResult, a8 as RenderRequest, a9 as Rendering, W as LineageTarget, U as LineageOptions, V as LineageResult, E as EntityKind, l as Condition, J as FilterDeclaration, K as FilterValueType, B as Backend, m as ConditionValue, p as DateDrillDeclaration, q as DateGrain, I as FilterAggregation, n as ControlMappingJson, o as CrossFilterJson, ac as SdkFeatures, ad as Selection, ae as SelectionCondition, aa as Row, Y as LocateKind, a1 as QueryDeclaration, a5 as QueryState, a3 as QueryResult, a4 as QuerySort, a as AppDeclaration, u as ExecuteOptions, v as ExecuteSummary, f as BackendExportRequest, b as AppJson, L as InspectedApp, aj as User, ab as SdkEnvironment, Q as InspectedStructure } from './types-CWNv6N0y.js';
3
- import { d as PluginInfo, i as ThemeScheme, k as ThemeTokens, g as Theme, c as MenuTargetKind, b as MenuTarget, N as NodeTarget } from './menu-CdGVKc4_.js';
3
+ import { e as PluginInfo, j as ThemeScheme, l as ThemeTokens, h as Theme, d as MenuTargetKind, c as MenuTarget, N as NodeTarget } from './menu-COEAKOnm.js';
4
4
 
5
5
  interface NotificationTarget {
6
6
  notifyChange(): void;
package/dist/build.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { FrameHalf } from './host.js';
2
2
  import './types-CWNv6N0y.js';
3
- import './menu-CdGVKc4_.js';
3
+ import './menu-COEAKOnm.js';
4
4
 
5
5
  /**
6
6
  * @holistics/anfra-sdk/build: building an SDK plugin's frame half into the script source a host
@@ -1,6 +1,6 @@
1
1
  // src/host/plugin.ts
2
2
  var NAME = /^[a-z][a-z0-9-]*$/;
3
- var RESERVED_NAMES = /* @__PURE__ */ new Set(["anfra", "plugins", "theme"]);
3
+ var RESERVED_NAMES = /* @__PURE__ */ new Set(["anfra", "panel", "plugins", "theme"]);
4
4
  var MEMBER = /^[A-Za-z][A-Za-z0-9]*$/;
5
5
  function checkPlugin(plugin) {
6
6
  if (typeof plugin?.name !== "string" || !NAME.test(plugin.name)) {
@@ -12,10 +12,10 @@ import {
12
12
  PROVISION_ELEMENT_ID,
13
13
  applyTheme,
14
14
  resolveTheme
15
- } from "./chunk-F6MRA7J4.js";
15
+ } from "./chunk-RXPNL7UR.js";
16
16
  import {
17
17
  version
18
- } from "./chunk-Q46CZIEK.js";
18
+ } from "./chunk-KA6ZNM7N.js";
19
19
  import {
20
20
  DataAppError,
21
21
  PermissionError,
@@ -846,14 +846,14 @@ function installContentUi(kernel) {
846
846
  // src/app/overlay.ts
847
847
  var OVERLAY_ID = "anfra-overlay";
848
848
  var FLASH_MS = 1500;
849
- var BOX_STYLE = "position:fixed;box-sizing:border-box;background:rgba(37,99,235,0.22);outline:1px solid #2563eb;outline-offset:-1px;";
850
- var LABEL_STYLE = "position:fixed;max-width:60vw;display:flex;gap:6px;align-items:baseline;padding:3px 8px;border-radius:4px;background:#0f172a;color:#f8fafc;font:12px/1.4 system-ui,sans-serif;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,0.35);";
849
+ var BOX_STYLE = "position:fixed;box-sizing:border-box;background:oklch(0.546 0.215 262.9 / 0.22);outline:1px solid oklch(0.546 0.215 262.9);outline-offset:-1px;";
850
+ var LABEL_STYLE = "position:fixed;max-width:60vw;display:flex;gap:6px;align-items:baseline;padding:3px 8px;border-radius:4px;background:oklch(0.208 0.04 265.8);color:oklch(0.984 0.003 247.9);font:12px/1.4 system-ui,sans-serif;white-space:nowrap;box-shadow:0 2px 8px oklch(0 0 0 / 0.35);";
851
851
  var PART_STYLE = {
852
- kind: "color:#94a3b8;",
853
- name: "color:#93c5fd;font-weight:700;",
854
- label: "color:#f8fafc;",
855
- note: "color:#94a3b8;",
856
- size: "color:#94a3b8;margin-left:10px;"
852
+ kind: "color:oklch(0.711 0.035 256.8);",
853
+ name: "color:oklch(0.809 0.096 251.8);font-weight:700;",
854
+ label: "color:oklch(0.984 0.003 247.9);",
855
+ note: "color:oklch(0.711 0.035 256.8);",
856
+ size: "color:oklch(0.711 0.035 256.8);margin-left:10px;"
857
857
  };
858
858
  var Overlay = class {
859
859
  constructor(doc) {
@@ -585,11 +585,11 @@ button { font: inherit; color: inherit; cursor: pointer; }
585
585
  button:disabled { cursor: default; }
586
586
  :focus-visible { outline: 2px solid var(--anfra-color-accent); outline-offset: 1px; }
587
587
  .pane { height: 100%; display: flex; flex-direction: column; min-height: 0;
588
- --hover: color-mix(in srgb, var(--anfra-color-fg) 7%, transparent);
589
- --subtle: color-mix(in srgb, var(--anfra-color-fg) 4%, transparent);
590
- --accent-bg: color-mix(in srgb, var(--anfra-color-accent) 14%, transparent);
588
+ --hover: var(--anfra-color-hover);
589
+ --subtle: var(--anfra-color-bg-sunken);
590
+ --accent-bg: var(--anfra-color-selected);
591
591
  --danger-bg: color-mix(in srgb, var(--anfra-color-danger) 14%, transparent);
592
- --ok: light-dark(#059669, #34d399); --warn: light-dark(#d97706, #fbbf24); --run: light-dark(#0284c7, #38bdf8);
592
+ --ok: var(--anfra-color-success); --warn: var(--anfra-color-warning); --run: light-dark(oklch(0.588 0.139 242), oklch(0.754 0.139 232.7));
593
593
  --warn-bg: color-mix(in srgb, var(--warn) 16%, transparent); --ok-bg: color-mix(in srgb, var(--ok) 16%, transparent); }
594
594
  .body { flex: 1; min-height: 0; overflow: auto; padding: 4px 14px 16px; }
595
595
  .body.split { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
@@ -628,7 +628,7 @@ code.wrap { overflow-wrap: anywhere; }
628
628
  .segments button { border: 0; border-radius: 6px; background: none; padding: 2px 8px; font-size: 12px; font-weight: 500; color: var(--anfra-color-muted); white-space: nowrap; }
629
629
  .segments button:hover { color: var(--anfra-color-fg); }
630
630
  /* The selected one is raised, in ink: violet is for links, selection and focus. */
631
- .segments button[aria-pressed="true"] { background: var(--anfra-color-bg); color: var(--anfra-color-fg); box-shadow: 0 0 0 1px var(--anfra-color-border), 0 1px 2px rgb(0 0 0 / 0.08); }
631
+ .segments button[aria-pressed="true"] { background: var(--anfra-color-bg); color: var(--anfra-color-fg); box-shadow: 0 0 0 1px var(--anfra-color-border), 0 1px 2px oklch(0 0 0 / 0.08); }
632
632
  .row-action { flex: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--anfra-color-muted); }
633
633
  .row-action:hover:not(:disabled) { background: var(--hover); color: var(--anfra-color-accent); }
634
634
  .row-action:disabled { opacity: 0.4; cursor: default; }
@@ -668,7 +668,7 @@ code.wrap { overflow-wrap: anywhere; }
668
668
  /* Popovers */
669
669
  .pop-trigger { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 4px; color: inherit; }
670
670
  /* Plain tooltips are one line of text or a few, with their line breaks; rich ones lay out their own. */
671
- .tooltip { position: fixed; inset: auto; margin: 0; z-index: 10; width: max-content; max-width: 280px; padding: 5px 8px; border: 1px solid var(--anfra-color-border); border-radius: 6px; background: var(--anfra-color-bg); color: var(--anfra-color-fg); box-shadow: 0 6px 20px rgb(0 0 0 / 0.15); font: 12px/1.45 var(--anfra-font); white-space: pre-line; overflow-wrap: anywhere; pointer-events: none; }
671
+ .tooltip { position: fixed; inset: auto; margin: 0; z-index: 10; width: max-content; max-width: 280px; padding: 5px 8px; border: 1px solid var(--anfra-color-border); border-radius: 6px; background: var(--anfra-color-bg); color: var(--anfra-color-fg); box-shadow: 0 6px 20px oklch(0 0 0 / 0.15); font: 12px/1.45 var(--anfra-font); white-space: pre-line; overflow-wrap: anywhere; pointer-events: none; }
672
672
  .tooltip.rich { max-width: 340px; padding: 8px 10px; white-space: normal; }
673
673
  /* Code */
674
674
  .code { margin-top: 6px; border: 1px solid var(--anfra-color-border); border-radius: 6px; overflow: hidden; position: relative; }
@@ -680,15 +680,15 @@ code.wrap { overflow-wrap: anywhere; }
680
680
  .code-corner { position: absolute; top: 2px; right: 2px; }
681
681
  .code-text { margin: 0; max-height: 240px; overflow: auto; padding: 8px 10px; font-size: 12px; line-height: 1.5; background: var(--subtle); }
682
682
  .code-empty { margin: 0; padding: 8px 10px; font-size: 12px; color: var(--anfra-color-muted); background: var(--subtle); }
683
- .tok-kw { color: light-dark(#6d28d9, #c4b5fd); font-weight: 600; } .tok-str { color: light-dark(#047857, #6ee7b7); }
684
- .tok-key { color: light-dark(#0f766e, #5eead4); }
683
+ .tok-kw { color: light-dark(oklch(0.491 0.241 292.6), oklch(0.811 0.101 293.6)); font-weight: 600; } .tok-str { color: light-dark(oklch(0.508 0.105 165.6), oklch(0.845 0.13 165)); }
684
+ .tok-key { color: light-dark(oklch(0.511 0.086 186.4), oklch(0.855 0.125 181.1)); }
685
685
  /* An AQL string, shown across its lines: the text stays the JSON, escapes and all, so a copy of
686
686
  it is too; the line breaks and the indent under its key are generated, which a copy leaves out. */
687
687
  .json-nl { opacity: 0.45; }
688
688
  .json-br::after { content: "\\A" attr(data-indent); white-space: pre; }
689
689
  /* The indent every line of the AQL shares: kept in the text, so the copy is exact, but not shown. */
690
690
  .json-dedent { font-size: 0; }
691
- .tok-num { color: light-dark(#b45309, #fcd34d); } .tok-com { color: var(--anfra-color-muted); font-style: italic; } .tok-fn { color: light-dark(#1d4ed8, #93c5fd); }
691
+ .tok-num { color: light-dark(oklch(0.555 0.146 49), oklch(0.879 0.153 91.6)); } .tok-com { color: var(--anfra-color-muted); font-style: italic; } .tok-fn { color: light-dark(oklch(0.488 0.217 264.4), oklch(0.809 0.096 251.8)); }
692
692
  /* Tables */
693
693
  .table-wrap { overflow: auto; max-height: 320px; border: 1px solid var(--anfra-color-border); border-radius: 6px; }
694
694
  table { border-collapse: collapse; font-size: 12px; width: max-content; min-width: 100%; }
@@ -706,8 +706,8 @@ tbody tr:last-child td { border-bottom: 0; }
706
706
  .node .label, .node .app { color: var(--anfra-color-muted); overflow: hidden; text-overflow: ellipsis; }
707
707
  .node.problem .name { color: var(--anfra-color-danger); }
708
708
  .kind { flex: none; padding: 0 6px; border-radius: 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
709
- .kind.container { background: color-mix(in srgb, light-dark(#7c3aed, #a78bfa) 18%, transparent); color: light-dark(#7c3aed, #a78bfa); }
710
- .kind.block { background: color-mix(in srgb, light-dark(#2563eb, #93c5fd) 18%, transparent); color: light-dark(#2563eb, #93c5fd); }
709
+ .kind.container { background: color-mix(in srgb, light-dark(oklch(0.541 0.247 293), oklch(0.709 0.159 293.5)) 18%, transparent); color: light-dark(oklch(0.541 0.247 293), oklch(0.709 0.159 293.5)); }
710
+ .kind.block { background: color-mix(in srgb, light-dark(oklch(0.546 0.215 262.9), oklch(0.809 0.096 251.8)) 18%, transparent); color: light-dark(oklch(0.546 0.215 262.9), oklch(0.809 0.096 251.8)); }
711
711
  .kind.query { background: var(--ok-bg); color: var(--ok); }
712
712
  .kind.control { background: var(--warn-bg); color: var(--warn); }
713
713
  /* The actions keep their place and sit in the row's height, so showing them moves nothing. */
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.14.1";
2
+ var version = "0.14.2";
3
3
 
4
4
  export {
5
5
  version
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  version
3
- } from "./chunk-Q46CZIEK.js";
3
+ } from "./chunk-KA6ZNM7N.js";
4
4
 
5
5
  // src/plugins/version.ts
6
6
  var PLUGIN_VERSION = version;
@@ -0,0 +1,135 @@
1
+ // src/common/bridge.ts
2
+ var PROVISION_ELEMENT_ID = "anfra-provision";
3
+
4
+ // src/common/theme.ts
5
+ var THEME_TOKENS = [
6
+ "color-bg",
7
+ "color-fg",
8
+ "color-muted",
9
+ "color-border",
10
+ "color-accent",
11
+ "color-danger",
12
+ "radius",
13
+ "font",
14
+ "font-mono",
15
+ "color-bg-sunken",
16
+ "color-fg-weak",
17
+ "color-border-strong",
18
+ "color-hover",
19
+ "color-active",
20
+ "color-selected",
21
+ "color-warning",
22
+ "color-success"
23
+ ];
24
+ var FONT = "'Inter Variable', ui-sans-serif, system-ui, sans-serif";
25
+ var FONT_MONO = "'Geist Mono Variable', ui-monospace, monospace";
26
+ var DEFAULT_TOKENS = {
27
+ light: {
28
+ "color-bg": "oklch(1 0 0)",
29
+ "color-bg-sunken": "oklch(0.973 0.005 95.1)",
30
+ "color-fg": "oklch(0.201 0.022 301.1)",
31
+ "color-fg-weak": "oklch(0.392 0.021 304.3)",
32
+ "color-muted": "oklch(0.485 0.022 306.3)",
33
+ "color-border": "oklch(0.201 0.022 301.1 / 0.12)",
34
+ "color-border-strong": "oklch(0.201 0.022 301.1 / 0.24)",
35
+ "color-accent": "oklch(0.484 0.181 298.1)",
36
+ "color-danger": "oklch(0.501 0.17 27.2)",
37
+ "color-warning": "oklch(0.501 0.1 70.3)",
38
+ "color-success": "oklch(0.479 0.1 151.8)",
39
+ "color-hover": "oklch(0.201 0.022 301.1 / 0.05)",
40
+ "color-active": "oklch(0.201 0.022 301.1 / 0.09)",
41
+ "color-selected": "oklch(0.946 0.027 304.8)",
42
+ radius: "10px",
43
+ font: FONT,
44
+ "font-mono": FONT_MONO
45
+ },
46
+ dark: {
47
+ "color-bg": "oklch(0.19 0.012 300)",
48
+ "color-bg-sunken": "oklch(0.157 0.009 296.9)",
49
+ "color-fg": "oklch(0.961 0.007 304.2)",
50
+ "color-fg-weak": "oklch(0.879 0.016 302.5)",
51
+ "color-muted": "oklch(0.835 0.018 300)",
52
+ "color-border": "oklch(0.343 0.025 298.2)",
53
+ "color-border-strong": "oklch(0.392 0.021 304.3)",
54
+ "color-accent": "oklch(0.845 0.085 300)",
55
+ "color-danger": "oklch(0.82 0.09 27)",
56
+ "color-warning": "oklch(0.84 0.12 69.6)",
57
+ "color-success": "oklch(0.8 0.12 151.9)",
58
+ "color-hover": "oklch(1 0 0 / 0.06)",
59
+ "color-active": "oklch(1 0 0 / 0.1)",
60
+ "color-selected": "oklch(0.565 0.194 300.3 / 0.18)",
61
+ radius: "10px",
62
+ font: FONT,
63
+ "font-mono": FONT_MONO
64
+ }
65
+ };
66
+ var DESIGN_TOKENS = {
67
+ "color-bg": "--anfra-color-background-default",
68
+ "color-bg-sunken": "--anfra-color-background-secondary-default",
69
+ "color-fg": "--anfra-color-text-default",
70
+ "color-fg-weak": "--anfra-color-text-weak",
71
+ "color-muted": "--anfra-color-text-placeholder",
72
+ "color-border": "--anfra-color-border-default",
73
+ "color-border-strong": "--anfra-color-border-strong",
74
+ "color-accent": "--anfra-color-text-highlight-default",
75
+ "color-danger": "--anfra-color-text-danger-default",
76
+ "color-warning": "--anfra-color-text-warning-default",
77
+ "color-success": "--anfra-color-text-success-default",
78
+ "color-hover": "--anfra-color-background-hover",
79
+ "color-active": "--anfra-color-background-active",
80
+ "color-selected": "--anfra-color-background-interactive-highlight-default",
81
+ radius: "--anfra-radius-lg",
82
+ font: "--anfra-font-sans",
83
+ "font-mono": "--anfra-font-mono"
84
+ };
85
+ function designTheme(scheme, style) {
86
+ const tokens = {};
87
+ for (const name of THEME_TOKENS) {
88
+ const value = style.getPropertyValue(DESIGN_TOKENS[name]).trim();
89
+ if (value) tokens[name] = value;
90
+ }
91
+ return { scheme, tokens };
92
+ }
93
+ var UNSAFE_VALUE = /[;{}<>]|url\(|expression\(|@import|\\/i;
94
+ function resolveTheme(input) {
95
+ const given = typeof input === "object" && input !== null ? input : {};
96
+ const scheme = given.scheme === "dark" ? "dark" : "light";
97
+ const tokens = { ...DEFAULT_TOKENS[scheme] };
98
+ const set = typeof given.tokens === "object" && given.tokens !== null ? given.tokens : {};
99
+ const taken = /* @__PURE__ */ new Set();
100
+ for (const name of THEME_TOKENS) {
101
+ const value = set[name];
102
+ if (typeof value === "string" && value.trim() !== "" && value.length <= 200 && !UNSAFE_VALUE.test(value)) {
103
+ tokens[name] = value.trim();
104
+ taken.add(name);
105
+ }
106
+ }
107
+ for (const [name, { from, value }] of Object.entries(DERIVED)) {
108
+ if (taken.has(name) || !from.some((source) => taken.has(source))) continue;
109
+ const derived = value(tokens);
110
+ if (derived.length <= 200) tokens[name] = derived;
111
+ }
112
+ return Object.freeze({ scheme, tokens: Object.freeze(tokens) });
113
+ }
114
+ var DERIVED = {
115
+ "color-bg-sunken": { from: ["color-fg", "color-bg"], value: (t) => `color-mix(in srgb, ${t["color-fg"]} 4%, ${t["color-bg"]})` },
116
+ "color-fg-weak": { from: ["color-fg", "color-bg"], value: (t) => `color-mix(in srgb, ${t["color-fg"]} 80%, ${t["color-bg"]})` },
117
+ "color-border-strong": { from: ["color-fg", "color-border"], value: (t) => `color-mix(in srgb, ${t["color-fg"]} 10%, ${t["color-border"]})` },
118
+ "color-hover": { from: ["color-fg"], value: (t) => `color-mix(in srgb, ${t["color-fg"]} 7%, transparent)` },
119
+ "color-active": { from: ["color-fg"], value: (t) => `color-mix(in srgb, ${t["color-fg"]} 12%, transparent)` },
120
+ "color-selected": { from: ["color-accent"], value: (t) => `color-mix(in srgb, ${t["color-accent"]} 14%, transparent)` }
121
+ };
122
+ function applyTheme(style, theme) {
123
+ for (const name of THEME_TOKENS) style.setProperty(`--anfra-${name}`, theme.tokens[name]);
124
+ style.setProperty("color-scheme", theme.scheme);
125
+ }
126
+
127
+ export {
128
+ PROVISION_ELEMENT_ID,
129
+ THEME_TOKENS,
130
+ DEFAULT_TOKENS,
131
+ DESIGN_TOKENS,
132
+ designTheme,
133
+ resolveTheme,
134
+ applyTheme
135
+ };
package/dist/common.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { D as DataAppError, P as PermissionError, Q as QueryError, T as TransportError, V as ValidationError } from './errors-CKvqVaqU.js';
2
2
  export { A as Aggregation, a as AppDeclaration, b as AppJson, c as ArrowType, B as Backend, d as BackendCondition, e as BackendDateDrill, f as BackendExportRequest, g as BackendFilter, h as BackendLineageRequest, i as BackendQueryRequest, j as BackendQueryResult, k as BackendSort, C as ColumnMeta, l as Condition, m as ConditionValue, n as ControlMappingJson, o as CrossFilterJson, D as DatasetDescriptor, p as DateDrillDeclaration, q as DateGrain, r as DateTransformation, E as EntityKind, s as EntityRef, t as EntityUsage, u as ExecuteOptions, v as ExecuteSummary, w as ExportFormat, x as ExportFormatOptions, y as ExportOptions, z as ExportResult, F as FILTER_AGGREGATIONS, G as FieldLineage, H as FieldSuggestionsRequest, I as FilterAggregation, J as FilterDeclaration, K as FilterValueType, L as InspectedApp, M as InspectedControl, N as InspectedError, O as InspectedQuery, P as InspectedSelection, Q as InspectedStructure, R as LineageCard, S as LineageDiagram, T as LineageNode, U as LineageOptions, V as LineageResult, W as LineageTarget, X as Listener, Y as LocateKind, Z as LocateTarget, _ as MappingJson, $ as Operator, a0 as QueryDebug, a1 as QueryDeclaration, a2 as QueryInput, a3 as QueryResult, a4 as QuerySort, a5 as QueryState, a6 as QueryTimings, a7 as RenderFormat, a8 as RenderRequest, a9 as Rendering, aa as Row, ab as SdkEnvironment, ac as SdkFeatures, ad as Selection, ae as SelectionCondition, af as SemanticType, ag as StructureKind, ah as StructureNode, ai as Unsubscribe, aj as User } from './types-CWNv6N0y.js';
3
- export { B as BridgeError, a as BridgeMessage, D as DEFAULT_TOKENS, F as FrameMessage, H as HostMessage, M as MenuEntry, b as MenuTarget, c as MenuTargetKind, N as NodeTarget, P as PROVISION_ELEMENT_ID, d as PluginInfo, e as Provision, R as RowsTarget, T as THEME_TOKENS, f as TargetRect, g as Theme, h as ThemeInput, i as ThemeScheme, j as ThemeToken, k as ThemeTokens, l as checkTarget, r as resolveTheme } from './menu-CdGVKc4_.js';
3
+ export { B as BridgeError, a as BridgeMessage, D as DEFAULT_TOKENS, b as DESIGN_TOKENS, F as FrameMessage, H as HostMessage, M as MenuEntry, c as MenuTarget, d as MenuTargetKind, N as NodeTarget, P as PROVISION_ELEMENT_ID, e as PluginInfo, f as Provision, R as RowsTarget, T as THEME_TOKENS, g as TargetRect, h as Theme, i as ThemeInput, j as ThemeScheme, k as ThemeToken, l as ThemeTokens, m as checkTarget, n as designTheme, r as resolveTheme } from './menu-COEAKOnm.js';
package/dist/common.js CHANGED
@@ -7,10 +7,12 @@ import {
7
7
  } from "./chunk-XIUFHRZE.js";
8
8
  import {
9
9
  DEFAULT_TOKENS,
10
+ DESIGN_TOKENS,
10
11
  PROVISION_ELEMENT_ID,
11
12
  THEME_TOKENS,
13
+ designTheme,
12
14
  resolveTheme
13
- } from "./chunk-F6MRA7J4.js";
15
+ } from "./chunk-RXPNL7UR.js";
14
16
  import {
15
17
  DataAppError,
16
18
  PermissionError,
@@ -21,6 +23,7 @@ import {
21
23
  import "./chunk-PKBMQBKP.js";
22
24
  export {
23
25
  DEFAULT_TOKENS,
26
+ DESIGN_TOKENS,
24
27
  DataAppError,
25
28
  FILTER_AGGREGATIONS,
26
29
  PROVISION_ELEMENT_ID,
@@ -30,5 +33,6 @@ export {
30
33
  TransportError,
31
34
  ValidationError,
32
35
  checkTarget,
36
+ designTheme,
33
37
  resolveTheme
34
38
  };
@@ -23,7 +23,7 @@ import {
23
23
  queryTrust,
24
24
  table,
25
25
  trustIndicator
26
- } from "./chunk-GOUDXWG4.js";
26
+ } from "./chunk-F6B3EGFV.js";
27
27
  import "./chunk-K633QHGO.js";
28
28
  import {
29
29
  entityNodeKey,
@@ -12,7 +12,7 @@ import {
12
12
  link,
13
13
  note,
14
14
  popover
15
- } from "./chunk-GOUDXWG4.js";
15
+ } from "./chunk-F6B3EGFV.js";
16
16
  import {
17
17
  controlMappings,
18
18
  crossFilters,
package/dist/host.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PluginInfo, Theme, ThemeInput, Provision } from './app.js';
2
2
  import { DatasetDescriptor, User } from './app.js';
3
- import { C as Command, T as Tab, a as CallOptions, P as Panel, b as CommandState, c as Plugin, M as Middleware, d as CommandContribution, e as TabContribution, f as Contribution } from './plugin-BmIDirTx.js';
4
- export { g as CallContext, h as CallDefinition, i as CallHandler, j as Caller, k as CommandRun, l as CommandStateContext, E as EventCheck, F as FrameHalf, H as HandlerCallOptions, m as HandlerContext, n as HostHalf, o as MountContext, S as Snapshot, p as TabContext, q as definePlugin } from './plugin-BmIDirTx.js';
3
+ import { C as Command, T as Tab, a as CallOptions, P as Panel, b as CommandState, c as Plugin, M as Middleware, d as CommandContribution, e as TabContribution, f as Contribution } from './plugin-CMJFCV3-.js';
4
+ export { g as CallContext, h as CallDefinition, i as CallHandler, j as Caller, k as CommandRun, l as CommandStateContext, E as EventCheck, F as FrameHalf, H as HandlerCallOptions, m as HandlerContext, n as HostHalf, o as MountContext, p as PanelVerb, S as Snapshot, q as TabContext, r as definePlugin } from './plugin-CMJFCV3-.js';
5
5
 
6
6
  interface HostOptions {
7
7
  /** The plugins this page's Data Apps get. `core` is required: the app model runs its queries with it. */