@ai-gui/plugin-bigscreen 0.39.1 → 0.40.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
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @ai-gui/plugin-bigscreen
|
|
2
2
|
|
|
3
|
+
## 0.40.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- cb85d4a: `fit` — size a screen to the element it was mounted in.
|
|
8
|
+
|
|
9
|
+
A screen has always sized itself for a wall: a panel body takes the pixel height the fence names,
|
|
10
|
+
or its kind's default, and the screen ends up as tall as the sum of them. That is right for the
|
|
11
|
+
surface it was built for, a display with nothing else on it, and wrong for the one it grew into —
|
|
12
|
+
a panel embedded in a page, inside a card a few hundred pixels tall. There the panel drew at full
|
|
13
|
+
size and covered whatever was beneath it, because nothing in the screen ever consulted the box it
|
|
14
|
+
was put in. A host could not fix it from outside either: the height is set inline, and an inline
|
|
15
|
+
height beats any stylesheet the host can write.
|
|
16
|
+
|
|
17
|
+
With `fit: true` the host's element is the authority. The screen becomes a column that fills it,
|
|
18
|
+
the grid takes what the heading leaves, and a panel body flexes into its row instead of taking a
|
|
19
|
+
fixed height — the fence's own `height` is ignored, because a number in the document cannot know
|
|
20
|
+
the box. Default false, so every existing wall is unchanged.
|
|
21
|
+
|
|
22
|
+
Meant for a host that gives the screen a bounded box, and usually for one panel: a wall of twelve
|
|
23
|
+
squeezed into a card gives each of them a twelfth of a card.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- @ai-gui/core@0.40.0
|
|
28
|
+
|
|
3
29
|
## 0.39.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -901,6 +901,10 @@ const bigscreenCss = [
|
|
|
901
901
|
".aigui-bs-panel-title{display:flex;align-items:center;gap:.5rem;margin:0 0 .5rem;font-size:.8rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--aigui-bs-muted)}",
|
|
902
902
|
".aigui-bs-panel-mark{display:inline-block;width:4px;height:14px;border-radius:2px}",
|
|
903
903
|
".aigui-bs-panel-body{position:relative;flex:1 1 auto;width:100%;min-width:0;container-type:inline-size}",
|
|
904
|
+
".aigui-bs-fit{display:flex;flex-direction:column;min-height:0;height:100%}",
|
|
905
|
+
".aigui-bs-fit .aigui-bs-grid{flex:1 1 auto;min-height:0;grid-auto-rows:minmax(0,1fr)}",
|
|
906
|
+
".aigui-bs-fit .aigui-bs-panel{min-height:0;overflow:hidden}",
|
|
907
|
+
".aigui-bs-fit .aigui-bs-panel-body{min-height:0}",
|
|
904
908
|
".aigui-bs-kpi{display:flex;flex-direction:column;gap:.35rem;justify-content:center;height:100%}",
|
|
905
909
|
".aigui-bs-kpi-row{display:flex;align-items:baseline;gap:.35rem;min-width:0}",
|
|
906
910
|
".aigui-bs-kpi-value{font-size:2rem;font-size:clamp(1.2rem,13cqi,2.6rem);font-weight:800;line-height:1.05;letter-spacing:-.01em;white-space:nowrap}",
|
|
@@ -961,10 +965,10 @@ function bigscreen(options = {}) {
|
|
|
961
965
|
let destroy;
|
|
962
966
|
let disposed = false;
|
|
963
967
|
Promise.resolve().then(function() {
|
|
964
|
-
return require("./mount-
|
|
968
|
+
return require("./mount-DcJpc0Yi.cjs");
|
|
965
969
|
}).then(({ mountScreen }) => {
|
|
966
970
|
if (disposed) return;
|
|
967
|
-
destroy = mountScreen(el, definition, options.animate !== false, options.globe, options.events);
|
|
971
|
+
destroy = mountScreen(el, definition, options.animate !== false, options.globe, options.events, options.fit === true);
|
|
968
972
|
}).catch(() => {
|
|
969
973
|
const error = document.createElement("div");
|
|
970
974
|
error.setAttribute("data-aigui-bigscreen-error", "");
|
package/dist/index.d.cts
CHANGED
|
@@ -268,6 +268,26 @@ interface BigscreenOptions {
|
|
|
268
268
|
globe?: GlobeSkin;
|
|
269
269
|
/** What a click on a timeline item or a graph node does. */
|
|
270
270
|
events?: BigscreenEvents;
|
|
271
|
+
/**
|
|
272
|
+
* Fit the screen to the element it is mounted in, instead of drawing every panel at its own
|
|
273
|
+
* height.
|
|
274
|
+
*
|
|
275
|
+
* A screen is sized for a wall by default: each panel body takes the pixel height the fence
|
|
276
|
+
* names, or the default for its kind — a globe is 560 — and the screen ends up as tall as the
|
|
277
|
+
* sum of them. That is right for the surface it was built for, a display with nothing else on
|
|
278
|
+
* it, and wrong for the one it grew into: a panel embedded in a page, inside a card a few
|
|
279
|
+
* hundred pixels tall. There the panel drew at full size and covered whatever was beneath it,
|
|
280
|
+
* because nothing in the screen ever consults the box it was put in.
|
|
281
|
+
*
|
|
282
|
+
* With `fit`, the host's element is the authority. The screen becomes a column that fills it,
|
|
283
|
+
* the grid takes the space the heading leaves, and a panel body flexes into its row rather than
|
|
284
|
+
* taking a fixed height. The fence's own `height` is ignored — a number in the document cannot
|
|
285
|
+
* know the box, which is the whole point.
|
|
286
|
+
*
|
|
287
|
+
* Meant for a host that gives the screen a bounded box, and usually for one panel: a wall of
|
|
288
|
+
* twelve squeezed into a card gives each of them a twelfth of a card. Default false.
|
|
289
|
+
*/
|
|
290
|
+
fit?: boolean;
|
|
271
291
|
}
|
|
272
292
|
interface BigscreenError {
|
|
273
293
|
code: "invalid-json" | "invalid-definition" | "too-large";
|
package/dist/index.d.ts
CHANGED
|
@@ -268,6 +268,26 @@ interface BigscreenOptions {
|
|
|
268
268
|
globe?: GlobeSkin;
|
|
269
269
|
/** What a click on a timeline item or a graph node does. */
|
|
270
270
|
events?: BigscreenEvents;
|
|
271
|
+
/**
|
|
272
|
+
* Fit the screen to the element it is mounted in, instead of drawing every panel at its own
|
|
273
|
+
* height.
|
|
274
|
+
*
|
|
275
|
+
* A screen is sized for a wall by default: each panel body takes the pixel height the fence
|
|
276
|
+
* names, or the default for its kind — a globe is 560 — and the screen ends up as tall as the
|
|
277
|
+
* sum of them. That is right for the surface it was built for, a display with nothing else on
|
|
278
|
+
* it, and wrong for the one it grew into: a panel embedded in a page, inside a card a few
|
|
279
|
+
* hundred pixels tall. There the panel drew at full size and covered whatever was beneath it,
|
|
280
|
+
* because nothing in the screen ever consults the box it was put in.
|
|
281
|
+
*
|
|
282
|
+
* With `fit`, the host's element is the authority. The screen becomes a column that fills it,
|
|
283
|
+
* the grid takes the space the heading leaves, and a panel body flexes into its row rather than
|
|
284
|
+
* taking a fixed height. The fence's own `height` is ignored — a number in the document cannot
|
|
285
|
+
* know the box, which is the whole point.
|
|
286
|
+
*
|
|
287
|
+
* Meant for a host that gives the screen a bounded box, and usually for one panel: a wall of
|
|
288
|
+
* twelve squeezed into a card gives each of them a twelfth of a card. Default false.
|
|
289
|
+
*/
|
|
290
|
+
fit?: boolean;
|
|
271
291
|
}
|
|
272
292
|
interface BigscreenError {
|
|
273
293
|
code: "invalid-json" | "invalid-definition" | "too-large";
|
package/dist/index.js
CHANGED
|
@@ -900,6 +900,10 @@ const bigscreenCss = [
|
|
|
900
900
|
".aigui-bs-panel-title{display:flex;align-items:center;gap:.5rem;margin:0 0 .5rem;font-size:.8rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--aigui-bs-muted)}",
|
|
901
901
|
".aigui-bs-panel-mark{display:inline-block;width:4px;height:14px;border-radius:2px}",
|
|
902
902
|
".aigui-bs-panel-body{position:relative;flex:1 1 auto;width:100%;min-width:0;container-type:inline-size}",
|
|
903
|
+
".aigui-bs-fit{display:flex;flex-direction:column;min-height:0;height:100%}",
|
|
904
|
+
".aigui-bs-fit .aigui-bs-grid{flex:1 1 auto;min-height:0;grid-auto-rows:minmax(0,1fr)}",
|
|
905
|
+
".aigui-bs-fit .aigui-bs-panel{min-height:0;overflow:hidden}",
|
|
906
|
+
".aigui-bs-fit .aigui-bs-panel-body{min-height:0}",
|
|
903
907
|
".aigui-bs-kpi{display:flex;flex-direction:column;gap:.35rem;justify-content:center;height:100%}",
|
|
904
908
|
".aigui-bs-kpi-row{display:flex;align-items:baseline;gap:.35rem;min-width:0}",
|
|
905
909
|
".aigui-bs-kpi-value{font-size:2rem;font-size:clamp(1.2rem,13cqi,2.6rem);font-weight:800;line-height:1.05;letter-spacing:-.01em;white-space:nowrap}",
|
|
@@ -959,9 +963,9 @@ function bigscreen(options = {}) {
|
|
|
959
963
|
mount: (el) => {
|
|
960
964
|
let destroy;
|
|
961
965
|
let disposed = false;
|
|
962
|
-
import("./mount-
|
|
966
|
+
import("./mount-VIgmcKTf.js").then(({ mountScreen }) => {
|
|
963
967
|
if (disposed) return;
|
|
964
|
-
destroy = mountScreen(el, definition, options.animate !== false, options.globe, options.events);
|
|
968
|
+
destroy = mountScreen(el, definition, options.animate !== false, options.globe, options.events, options.fit === true);
|
|
965
969
|
}).catch(() => {
|
|
966
970
|
const error = document.createElement("div");
|
|
967
971
|
error.setAttribute("data-aigui-bigscreen-error", "");
|
|
@@ -322,7 +322,7 @@ function bodyHeight(panel) {
|
|
|
322
322
|
if (panel.kind === "timeline") return require_positions.timelineHeight(panel.lanes.length);
|
|
323
323
|
return DEFAULT_HEIGHT[panel.kind];
|
|
324
324
|
}
|
|
325
|
-
function mountPanel(panel, definition, c, animate, earth, events) {
|
|
325
|
+
function mountPanel(panel, definition, c, animate, earth, events, fit) {
|
|
326
326
|
const node = el("section", {
|
|
327
327
|
class: "aigui-bs-panel",
|
|
328
328
|
"data-aigui-bigscreen-panel": panel.kind
|
|
@@ -340,8 +340,10 @@ function mountPanel(panel, definition, c, animate, earth, events) {
|
|
|
340
340
|
node.appendChild(head);
|
|
341
341
|
}
|
|
342
342
|
const body = el("div", { class: "aigui-bs-panel-body" });
|
|
343
|
-
|
|
344
|
-
|
|
343
|
+
if (!fit) {
|
|
344
|
+
const height = panel.height ?? bodyHeight(panel);
|
|
345
|
+
if (height) body.style.height = `${height}px`;
|
|
346
|
+
}
|
|
345
347
|
node.appendChild(body);
|
|
346
348
|
let destroy = () => {};
|
|
347
349
|
try {
|
|
@@ -403,9 +405,10 @@ function mountPanel(panel, definition, c, animate, earth, events) {
|
|
|
403
405
|
* is the page's decision, not the fence's. `events` is the same bargain for clicks: what a claim
|
|
404
406
|
* or an entity does when it is clicked is the page's decision too.
|
|
405
407
|
*/
|
|
406
|
-
function mountScreen(host, definition, animate, earth, events) {
|
|
408
|
+
function mountScreen(host, definition, animate, earth, events, fit = false) {
|
|
407
409
|
const c = require_positions.palette(definition);
|
|
408
410
|
host.setAttribute("data-aigui-bigscreen", definition.theme);
|
|
411
|
+
host.classList.toggle("aigui-bs-fit", fit);
|
|
409
412
|
host.style.setProperty("--aigui-bs-accent", c.accent);
|
|
410
413
|
host.style.setProperty("--aigui-bs-text", c.text);
|
|
411
414
|
host.style.setProperty("--aigui-bs-muted", c.muted);
|
|
@@ -425,7 +428,7 @@ function mountScreen(host, definition, animate, earth, events) {
|
|
|
425
428
|
const grid = el("div", { class: "aigui-bs-grid" });
|
|
426
429
|
grid.style.gridTemplateColumns = `repeat(${definition.columns}, minmax(0, 1fr))`;
|
|
427
430
|
host.appendChild(grid);
|
|
428
|
-
const mounted = definition.panels.map((panel) => mountPanel(panel, definition, c, animate, earth, events));
|
|
431
|
+
const mounted = definition.panels.map((panel) => mountPanel(panel, definition, c, animate, earth, events, fit));
|
|
429
432
|
for (const { node } of mounted) grid.appendChild(node);
|
|
430
433
|
return () => {
|
|
431
434
|
for (const { destroy } of mounted) destroy();
|
|
@@ -321,7 +321,7 @@ function bodyHeight(panel) {
|
|
|
321
321
|
if (panel.kind === "timeline") return timelineHeight(panel.lanes.length);
|
|
322
322
|
return DEFAULT_HEIGHT[panel.kind];
|
|
323
323
|
}
|
|
324
|
-
function mountPanel(panel, definition, c, animate, earth, events) {
|
|
324
|
+
function mountPanel(panel, definition, c, animate, earth, events, fit) {
|
|
325
325
|
const node = el("section", {
|
|
326
326
|
class: "aigui-bs-panel",
|
|
327
327
|
"data-aigui-bigscreen-panel": panel.kind
|
|
@@ -339,8 +339,10 @@ function mountPanel(panel, definition, c, animate, earth, events) {
|
|
|
339
339
|
node.appendChild(head);
|
|
340
340
|
}
|
|
341
341
|
const body = el("div", { class: "aigui-bs-panel-body" });
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
if (!fit) {
|
|
343
|
+
const height = panel.height ?? bodyHeight(panel);
|
|
344
|
+
if (height) body.style.height = `${height}px`;
|
|
345
|
+
}
|
|
344
346
|
node.appendChild(body);
|
|
345
347
|
let destroy = () => {};
|
|
346
348
|
try {
|
|
@@ -402,9 +404,10 @@ function mountPanel(panel, definition, c, animate, earth, events) {
|
|
|
402
404
|
* is the page's decision, not the fence's. `events` is the same bargain for clicks: what a claim
|
|
403
405
|
* or an entity does when it is clicked is the page's decision too.
|
|
404
406
|
*/
|
|
405
|
-
function mountScreen(host, definition, animate, earth, events) {
|
|
407
|
+
function mountScreen(host, definition, animate, earth, events, fit = false) {
|
|
406
408
|
const c = palette(definition);
|
|
407
409
|
host.setAttribute("data-aigui-bigscreen", definition.theme);
|
|
410
|
+
host.classList.toggle("aigui-bs-fit", fit);
|
|
408
411
|
host.style.setProperty("--aigui-bs-accent", c.accent);
|
|
409
412
|
host.style.setProperty("--aigui-bs-text", c.text);
|
|
410
413
|
host.style.setProperty("--aigui-bs-muted", c.muted);
|
|
@@ -424,7 +427,7 @@ function mountScreen(host, definition, animate, earth, events) {
|
|
|
424
427
|
const grid = el("div", { class: "aigui-bs-grid" });
|
|
425
428
|
grid.style.gridTemplateColumns = `repeat(${definition.columns}, minmax(0, 1fr))`;
|
|
426
429
|
host.appendChild(grid);
|
|
427
|
-
const mounted = definition.panels.map((panel) => mountPanel(panel, definition, c, animate, earth, events));
|
|
430
|
+
const mounted = definition.panels.map((panel) => mountPanel(panel, definition, c, animate, earth, events, fit));
|
|
428
431
|
for (const { node } of mounted) grid.appendChild(node);
|
|
429
432
|
return () => {
|
|
430
433
|
for (const { destroy } of mounted) destroy();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-gui/plugin-bigscreen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Animated data walls for AIGUI — counting KPIs, sweeping gauges, growing ranks, self-drawing charts, turning 3D bars and globes, on a grid the model lays out.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"llm",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"echarts": "^5.5.1",
|
|
58
|
-
"@ai-gui/core": "0.
|
|
58
|
+
"@ai-gui/core": "0.40.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"echarts-gl": "^2.0.9"
|