@surfaces-ui/components 0.6.0 → 0.7.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/NOTICE +50 -0
- package/dist/appComponents.d.ts +9 -0
- package/dist/appComponents.js +105 -1
- package/dist/appComponents.js.map +1 -1
- package/dist/brand/MovingMark.d.ts +15 -0
- package/dist/brand/MovingMark.js +52 -0
- package/dist/brand/MovingMark.js.map +1 -0
- package/dist/brand/SurfacesMark.d.ts +9 -0
- package/dist/brand/SurfacesMark.js +12 -0
- package/dist/brand/SurfacesMark.js.map +1 -0
- package/dist/brand/index.d.ts +3 -0
- package/dist/brand/index.js +3 -0
- package/dist/brand/index.js.map +1 -0
- package/dist/brand/markMotion.d.ts +29 -0
- package/dist/brand/markMotion.js +89 -0
- package/dist/brand/markMotion.js.map +1 -0
- package/dist/chart/Chart.d.ts +8 -4
- package/dist/chart/Chart.js +19 -8
- package/dist/chart/Chart.js.map +1 -1
- package/dist/chart/advice.d.ts +4 -2
- package/dist/chart/advice.js +14 -1
- package/dist/chart/advice.js.map +1 -1
- package/dist/chart/option.d.ts +17 -2
- package/dist/chart/option.js +146 -3
- package/dist/chart/option.js.map +1 -1
- package/dist/controls/ItemControls.d.ts +6 -2
- package/dist/controls/ItemControls.js +8 -3
- package/dist/controls/ItemControls.js.map +1 -1
- package/dist/controls/OutlineIcon.d.ts +9 -0
- package/dist/controls/OutlineIcon.js +12 -0
- package/dist/controls/OutlineIcon.js.map +1 -0
- package/dist/feedback/ErrorPage.d.ts +27 -0
- package/dist/feedback/ErrorPage.js +12 -0
- package/dist/feedback/ErrorPage.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/loading/ChartArt.d.ts +8 -0
- package/dist/loading/ChartArt.js +29 -0
- package/dist/loading/ChartArt.js.map +1 -0
- package/dist/loading/DraftCard.d.ts +10 -0
- package/dist/loading/DraftCard.js +38 -0
- package/dist/loading/DraftCard.js.map +1 -0
- package/dist/loading/Loading.d.ts +49 -0
- package/dist/loading/Loading.js +38 -0
- package/dist/loading/Loading.js.map +1 -0
- package/dist/locale/locale.d.ts +1 -0
- package/dist/locale/locale.js +1 -0
- package/dist/locale/locale.js.map +1 -1
- package/dist/result/QueryResult.js +2 -1
- package/dist/result/QueryResult.js.map +1 -1
- package/dist/schema/SchemaExplorer.d.ts +4 -0
- package/dist/schema/SchemaExplorer.js +46 -28
- package/dist/schema/SchemaExplorer.js.map +1 -1
- package/dist/styles.css +809 -67
- package/dist/styles.layer.css +809 -67
- package/dist/text/Markdown.js +21 -8
- package/dist/text/Markdown.js.map +1 -1
- package/dist/workspace/icons.js +2 -1
- package/dist/workspace/icons.js.map +1 -1
- package/package.json +11 -6
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { ChartArt } from "./ChartArt.js";
|
|
4
|
+
const M = "metric";
|
|
5
|
+
const chart = (kind) => ({ chart: kind });
|
|
6
|
+
/** The layouts a card tries, one after another: rows of parts. A part that is rows itself is a column of its own. */
|
|
7
|
+
const LAYOUTS = [
|
|
8
|
+
[["title"], ["text"], [M, M, M], [chart("combo"), chart("scatter")]],
|
|
9
|
+
[["filters"], ["title"], [chart("gantt"), chart("heatmap")]],
|
|
10
|
+
[["title"], [chart("sankey"), [[M], [M]]], ["rows"]],
|
|
11
|
+
[["title"], ["text"], [chart("stacked"), chart("funnel"), chart("table")]],
|
|
12
|
+
[["filters"], ["title"], [chart("histogram"), chart("confusion")], [chart("pareto"), chart("area")]],
|
|
13
|
+
[["title"], [M, M, M], [chart("line"), chart("rows")]],
|
|
14
|
+
];
|
|
15
|
+
const THIN = new Set(["title", "text", "filters"]);
|
|
16
|
+
function Rows({ rows, at = 0 }) {
|
|
17
|
+
return (_jsx("div", { className: "sf-draft-rows", children: rows.map((row, r) => (_jsx("div", { className: "sf-draft-row", "data-thin": THIN.has(row[0]) || undefined, children: row.map((part, c) => {
|
|
18
|
+
// Parts arrive in reading order: a row at a time, and along a row.
|
|
19
|
+
const order = at + r * 3 + c;
|
|
20
|
+
return Array.isArray(part) ? (_jsx(Rows, { rows: part, at: order }, c)) : (_jsx("div", { className: "sf-draft-part", "data-kind": typeof part === "string" ? part : "chart", style: { "--sf-draft-order": order }, children: typeof part === "object" && _jsx(ChartArt, { kind: part.chart }) }, c));
|
|
21
|
+
}) }, r))) }));
|
|
22
|
+
}
|
|
23
|
+
function Card({ first }) {
|
|
24
|
+
const [turn, setTurn] = useState(first);
|
|
25
|
+
return (_jsx("div", { className: "sf-draft-slot", children: _jsxs("div", { className: "sf-draft-card", "data-tone": (turn % 6) + 1,
|
|
26
|
+
// The card's own leaving brings the next one; a part's animation ending inside it does not.
|
|
27
|
+
onAnimationEnd: (e) => e.target === e.currentTarget && setTurn((n) => n + 1), children: [_jsx(Rows, { rows: LAYOUTS[turn % LAYOUTS.length] }), _jsx("span", { className: "sf-draft-pen" })] }, turn) }));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A page sketching itself on a card, part by part under a pen, then thrown aside for another layout: for while a page
|
|
31
|
+
* is made or opened. Decoration beside the words that say so (`Loading` puts them together), hidden from assistive
|
|
32
|
+
* technology. Where motion is reduced it is one finished sketch, standing still.
|
|
33
|
+
*/
|
|
34
|
+
export function DraftCard({ cards = 1 }) {
|
|
35
|
+
const count = Math.max(1, Math.min(3, Math.round(cards) || 1));
|
|
36
|
+
return (_jsx("div", { className: "sf-draft", "data-fan": count > 1 || undefined, "aria-hidden": "true", children: Array.from({ length: count }, (_, i) => (_jsx(Card, { first: i }, i))) }));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=DraftCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DraftCard.js","sourceRoot":"","sources":["../../src/loading/DraftCard.tsx"],"names":[],"mappings":";AAAA,OA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AAQ,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,CACL,cAAK,SAAS,EAAC,eAAe,YAC5B,eAEE,SAAS,EAAC,eAAe,eACd,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC;YACzB,4FAA4F;YAC5F,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,aAAa,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,aAE5E,KAAC,IAAI,IAAC,IAAI,EAAE,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAE,GAAI,EAC/C,eAAM,SAAS,EAAC,cAAc,GAAG,KAP5B,IAAI,CAQL,GACF,CACP,CAAC;AACJ,CAAC;AAOD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,GAAG,CAAC,EAAkB;IACrD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/D,OAAO,CACL,cAAK,SAAS,EAAC,UAAU,cAAW,KAAK,GAAG,CAAC,IAAI,SAAS,iBAAc,MAAM,YAC3E,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAEvC,KAAC,IAAI,IAAS,KAAK,EAAE,CAAC,IAAX,CAAC,CAAc,CAC3B,CAAC,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { type CSSProperties, useState } from \"react\";\nimport { ChartArt, type LoaderChart } from \"./ChartArt.js\";\n\ntype Part = \"title\" | \"text\" | \"filters\" | \"metric\" | \"rows\" | { chart: LoaderChart } | Part[][];\n\nconst M: Part = \"metric\";\nconst chart = (kind: LoaderChart): Part => ({ chart: kind });\n\n/** The layouts a card tries, one after another: rows of parts. A part that is rows itself is a column of its own. */\nconst LAYOUTS: Part[][][] = [\n [[\"title\"], [\"text\"], [M, M, M], [chart(\"combo\"), chart(\"scatter\")]],\n [[\"filters\"], [\"title\"], [chart(\"gantt\"), chart(\"heatmap\")]],\n [[\"title\"], [chart(\"sankey\"), [[M], [M]]], [\"rows\"]],\n [[\"title\"], [\"text\"], [chart(\"stacked\"), chart(\"funnel\"), chart(\"table\")]],\n [[\"filters\"], [\"title\"], [chart(\"histogram\"), chart(\"confusion\")], [chart(\"pareto\"), chart(\"area\")]],\n [[\"title\"], [M, M, M], [chart(\"line\"), chart(\"rows\")]],\n];\n\nconst THIN = new Set<Part>([\"title\", \"text\", \"filters\"]);\n\nfunction Rows({ rows, at = 0 }: { rows: Part[][]; at?: number }) {\n return (\n <div className=\"sf-draft-rows\">\n {rows.map((row, r) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a layout does not change.\n <div key={r} className=\"sf-draft-row\" data-thin={THIN.has(row[0]!) || undefined}>\n {row.map((part, c) => {\n // Parts arrive in reading order: a row at a time, and along a row.\n const order = at + r * 3 + c;\n return Array.isArray(part) ? (\n // biome-ignore lint/suspicious/noArrayIndexKey: a layout does not change.\n <Rows key={c} rows={part} at={order} />\n ) : (\n // biome-ignore lint/suspicious/noArrayIndexKey: a layout does not change.\n <div key={c} className=\"sf-draft-part\" data-kind={typeof part === \"string\" ? part : \"chart\"} style={{ \"--sf-draft-order\": order } as CSSProperties}>\n {typeof part === \"object\" && <ChartArt kind={part.chart} />}\n </div>\n );\n })}\n </div>\n ))}\n </div>\n );\n}\n\nfunction Card({ first }: { first: number }) {\n const [turn, setTurn] = useState(first);\n return (\n <div className=\"sf-draft-slot\">\n <div\n key={turn}\n className=\"sf-draft-card\"\n data-tone={(turn % 6) + 1}\n // The card's own leaving brings the next one; a part's animation ending inside it does not.\n onAnimationEnd={(e) => e.target === e.currentTarget && setTurn((n) => n + 1)}\n >\n <Rows rows={LAYOUTS[turn % LAYOUTS.length]!} />\n <span className=\"sf-draft-pen\" />\n </div>\n </div>\n );\n}\n\nexport interface DraftCardProps {\n /** How many cards, 1 to 3: fanned out when there is more than one, for several drafts made at once. Default 1. */\n cards?: number;\n}\n\n/**\n * A page sketching itself on a card, part by part under a pen, then thrown aside for another layout: for while a page\n * is made or opened. Decoration beside the words that say so (`Loading` puts them together), hidden from assistive\n * technology. Where motion is reduced it is one finished sketch, standing still.\n */\nexport function DraftCard({ cards = 1 }: DraftCardProps) {\n const count = Math.max(1, Math.min(3, Math.round(cards) || 1));\n return (\n <div className=\"sf-draft\" data-fan={count > 1 || undefined} aria-hidden=\"true\">\n {Array.from({ length: count }, (_, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: the cards keep their places.\n <Card key={i} first={i} />\n ))}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type LoaderChart } from "./ChartArt.js";
|
|
3
|
+
export interface ChartLoaderProps {
|
|
4
|
+
/** The chart to draw. Without it one is picked by `seed`, or by the loader's place in the page. */
|
|
5
|
+
chart?: LoaderChart;
|
|
6
|
+
/** Picks the chart: the same words always pick the same one, so a loader taken down and put back is not another. */
|
|
7
|
+
seed?: string;
|
|
8
|
+
/** Its width, in px or any CSS length. Default 2.5rem. */
|
|
9
|
+
size?: number | string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A small chart that draws itself and keeps moving, the same one for as long as the wait lasts. Decoration beside the
|
|
13
|
+
* words that say what is waited for, so it is hidden from assistive technology. Where motion is reduced it stands still.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ChartLoader({ chart, seed, size }: ChartLoaderProps): import("react").JSX.Element;
|
|
16
|
+
export interface LoadingProps {
|
|
17
|
+
/** What is being waited for: "Opening the report…". */
|
|
18
|
+
label: string;
|
|
19
|
+
/** "inline" (the default): a small chart beside the words. "page": a card sketching itself above them, for a page or a canvas. */
|
|
20
|
+
size?: "inline" | "page";
|
|
21
|
+
/** "page": how many cards, 1 to 3, fanned out when there is more than one. Default 1. */
|
|
22
|
+
cards?: number;
|
|
23
|
+
/** "inline": the chart to draw. */
|
|
24
|
+
chart?: LoaderChart;
|
|
25
|
+
/** A picture of the host's own in place of the chart or the card, such as `MovingMark`. */
|
|
26
|
+
picture?: ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* What is being waited for, with something that moves while it is. It is a live region, so the words are read out; a
|
|
31
|
+
* wait too short to read (a fifth of a second) shows nothing. Put `aria-busy` on what is being loaded.
|
|
32
|
+
*/
|
|
33
|
+
export declare function Loading({ label, size, cards, chart, picture, className }: LoadingProps): import("react").JSX.Element;
|
|
34
|
+
export interface WorkingLineProps {
|
|
35
|
+
/** What is being done now, in words: "Reading the orders table…". */
|
|
36
|
+
label: string;
|
|
37
|
+
/** When it began, as `Date.now()` has it: the time it has been is shown. Without it no time is. */
|
|
38
|
+
since?: number;
|
|
39
|
+
/** Picks the chart, so the same turn keeps the same one. */
|
|
40
|
+
seed?: string;
|
|
41
|
+
/** Reads a change of words out. Default true; false inside something that is itself read out, such as a chat's log. */
|
|
42
|
+
announce?: boolean;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* What an agent or a long job is doing now, with a chart that keeps moving and how long it has been. Give it only what
|
|
47
|
+
* is known to be happening. The time is not read out, so a screen reader hears only what changes.
|
|
48
|
+
*/
|
|
49
|
+
export declare function WorkingLine({ label, since, seed, announce, className }: WorkingLineProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useState } from "react";
|
|
3
|
+
import { ChartArt, LOADER_CHARTS } from "./ChartArt.js";
|
|
4
|
+
import { DraftCard } from "./DraftCard.js";
|
|
5
|
+
const hash = (words) => [...words].reduce((h, ch) => (h * 31 + ch.charCodeAt(0)) >>> 0, 7);
|
|
6
|
+
/**
|
|
7
|
+
* A small chart that draws itself and keeps moving, the same one for as long as the wait lasts. Decoration beside the
|
|
8
|
+
* words that say what is waited for, so it is hidden from assistive technology. Where motion is reduced it stands still.
|
|
9
|
+
*/
|
|
10
|
+
export function ChartLoader({ chart, seed, size }) {
|
|
11
|
+
const place = useId();
|
|
12
|
+
return (_jsx("span", { className: "sf-chart-loader", "aria-hidden": "true", style: size === undefined ? undefined : { inlineSize: size }, children: _jsx(ChartArt, { kind: chart ?? LOADER_CHARTS[hash(seed ?? place) % LOADER_CHARTS.length] }) }));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* What is being waited for, with something that moves while it is. It is a live region, so the words are read out; a
|
|
16
|
+
* wait too short to read (a fifth of a second) shows nothing. Put `aria-busy` on what is being loaded.
|
|
17
|
+
*/
|
|
18
|
+
export function Loading({ label, size = "inline", cards = 1, chart, picture, className }) {
|
|
19
|
+
return (_jsxs("div", { className: ["sf-loading", className].filter(Boolean).join(" "), "data-size": size, role: "status", children: [picture ? (_jsx("span", { className: "sf-loading-picture", "aria-hidden": "true", children: picture })) : size === "page" ? (_jsx(DraftCard, { cards: cards })) : (_jsx(ChartLoader, { chart: chart })), _jsx("span", { className: "sf-loading-label", children: label })] }));
|
|
20
|
+
}
|
|
21
|
+
const clock = (seconds) => `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
|
|
22
|
+
/**
|
|
23
|
+
* What an agent or a long job is doing now, with a chart that keeps moving and how long it has been. Give it only what
|
|
24
|
+
* is known to be happening. The time is not read out, so a screen reader hears only what changes.
|
|
25
|
+
*/
|
|
26
|
+
export function WorkingLine({ label, since, seed, announce = true, className }) {
|
|
27
|
+
const [now, setNow] = useState();
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (since === undefined)
|
|
30
|
+
return;
|
|
31
|
+
const tell = () => setNow(Date.now());
|
|
32
|
+
tell();
|
|
33
|
+
const timer = setInterval(tell, 1000);
|
|
34
|
+
return () => clearInterval(timer);
|
|
35
|
+
}, [since]);
|
|
36
|
+
return (_jsxs("div", { className: ["sf-working", className].filter(Boolean).join(" "), children: [_jsx(ChartLoader, { seed: seed }), _jsx("span", { className: "sf-working-label", role: announce ? "status" : undefined, children: label }), since !== undefined && now !== undefined && (_jsx("span", { className: "sf-working-time", "aria-hidden": "true", children: clock(Math.max(0, Math.floor((now - since) / 1000))) }))] }));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=Loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loading.js","sourceRoot":"","sources":["../../src/loading/Loading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAoB,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAW3C,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AAEnG;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAoB;IACjE,MAAM,KAAK,GAAG,KAAK,EAAE,CAAC;IACtB,OAAO,CACL,eAAM,SAAS,EAAC,iBAAiB,iBAAa,MAAM,EAAC,KAAK,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,YAC/G,KAAC,QAAQ,IAAC,IAAI,EA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,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO;QAChC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACtC,IAAI,EAAE,CAAC;QACP,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,OAAO,CACL,eAAK,SAAS,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aACjE,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,GAAI,EAC3B,eAAM,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,YACrE,KAAK,GACD,EACN,KAAK,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,IAAI,CAC3C,eAAM,SAAS,EAAC,iBAAiB,iBAAa,MAAM,YACjD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAChD,CACR,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { type ReactNode, useEffect, useId, useState } from \"react\";\nimport { ChartArt, LOADER_CHARTS, type LoaderChart } from \"./ChartArt.js\";\nimport { DraftCard } from \"./DraftCard.js\";\n\nexport interface ChartLoaderProps {\n /** The chart to draw. Without it one is picked by `seed`, or by the loader's place in the page. */\n chart?: LoaderChart;\n /** Picks the chart: the same words always pick the same one, so a loader taken down and put back is not another. */\n seed?: string;\n /** Its width, in px or any CSS length. Default 2.5rem. */\n size?: number | string;\n}\n\nconst hash = (words: string) => [...words].reduce((h, ch) => (h * 31 + ch.charCodeAt(0)) >>> 0, 7);\n\n/**\n * A small chart that draws itself and keeps moving, the same one for as long as the wait lasts. Decoration beside the\n * words that say what is waited for, so it is hidden from assistive technology. Where motion is reduced it stands still.\n */\nexport function ChartLoader({ chart, seed, size }: ChartLoaderProps) {\n const place = useId();\n return (\n <span className=\"sf-chart-loader\" aria-hidden=\"true\" style={size === undefined ? undefined : { inlineSize: size }}>\n <ChartArt kind={chart ?? LOADER_CHARTS[hash(seed ?? place) % LOADER_CHARTS.length]!} />\n </span>\n );\n}\n\nexport interface LoadingProps {\n /** What is being waited for: \"Opening the report…\". */\n label: string;\n /** \"inline\" (the default): a small chart beside the words. \"page\": a card sketching itself above them, for a page or a canvas. */\n size?: \"inline\" | \"page\";\n /** \"page\": how many cards, 1 to 3, fanned out when there is more than one. Default 1. */\n cards?: number;\n /** \"inline\": the chart to draw. */\n chart?: LoaderChart;\n /** A picture of the host's own in place of the chart or the card, such as `MovingMark`. */\n picture?: ReactNode;\n className?: string;\n}\n\n/**\n * What is being waited for, with something that moves while it is. It is a live region, so the words are read out; a\n * wait too short to read (a fifth of a second) shows nothing. Put `aria-busy` on what is being loaded.\n */\nexport function Loading({ label, size = \"inline\", cards = 1, chart, picture, className }: LoadingProps) {\n return (\n <div className={[\"sf-loading\", className].filter(Boolean).join(\" \")} data-size={size} role=\"status\">\n {picture ? (\n <span className=\"sf-loading-picture\" aria-hidden=\"true\">\n {picture}\n </span>\n ) : size === \"page\" ? (\n <DraftCard cards={cards} />\n ) : (\n <ChartLoader chart={chart} />\n )}\n <span className=\"sf-loading-label\">{label}</span>\n </div>\n );\n}\n\nexport interface WorkingLineProps {\n /** What is being done now, in words: \"Reading the orders table…\". */\n label: string;\n /** When it began, as `Date.now()` has it: the time it has been is shown. Without it no time is. */\n since?: number;\n /** Picks the chart, so the same turn keeps the same one. */\n seed?: string;\n /** Reads a change of words out. Default true; false inside something that is itself read out, such as a chat's log. */\n announce?: boolean;\n className?: string;\n}\n\nconst clock = (seconds: number) => `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, \"0\")}`;\n\n/**\n * What an agent or a long job is doing now, with a chart that keeps moving and how long it has been. Give it only what\n * is known to be happening. The time is not read out, so a screen reader hears only what changes.\n */\nexport function WorkingLine({ label, since, seed, announce = true, className }: WorkingLineProps) {\n const [now, setNow] = useState<number>();\n useEffect(() => {\n if (since === undefined) return;\n const tell = () => setNow(Date.now());\n tell();\n const timer = setInterval(tell, 1000);\n return () => clearInterval(timer);\n }, [since]);\n return (\n <div className={[\"sf-working\", className].filter(Boolean).join(\" \")}>\n <ChartLoader seed={seed} />\n <span className=\"sf-working-label\" role={announce ? \"status\" : undefined}>\n {label}\n </span>\n {since !== undefined && now !== undefined && (\n <span className=\"sf-working-time\" aria-hidden=\"true\">\n {clock(Math.max(0, Math.floor((now - since) / 1000)))}\n </span>\n )}\n </div>\n );\n}\n"]}
|
package/dist/locale/locale.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export declare const defaultLabels: {
|
|
|
49
49
|
readonly "grid.copiedRow": "the row";
|
|
50
50
|
readonly "grid.copiedColumnName": "the column name";
|
|
51
51
|
readonly "grid.copiedSql": "the SQL";
|
|
52
|
+
readonly "code.copyFailed": "Could not copy: the browser did not allow it. The code is selected, so you can copy it yourself.";
|
|
52
53
|
readonly "grid.copyFailed": "Could not copy: the browser refused access to the clipboard.";
|
|
53
54
|
readonly "grid.movedLeft": "Moved {name} left.";
|
|
54
55
|
readonly "grid.movedRight": "Moved {name} right.";
|
package/dist/locale/locale.js
CHANGED
|
@@ -75,6 +75,7 @@ export const defaultLabels = {
|
|
|
75
75
|
"grid.copiedRow": "the row",
|
|
76
76
|
"grid.copiedColumnName": "the column name",
|
|
77
77
|
"grid.copiedSql": "the SQL",
|
|
78
|
+
"code.copyFailed": "Could not copy: the browser did not allow it. The code is selected, so you can copy it yourself.",
|
|
78
79
|
"grid.copyFailed": "Could not copy: the browser refused access to the clipboard.",
|
|
79
80
|
"grid.movedLeft": "Moved {name} left.",
|
|
80
81
|
"grid.movedRight": "Moved {name} right.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/locale/locale.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,IAAI,OAAO,GAAG,OAAO,CAAC;AACtB,MAAM,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;AACrD,MAAM,WAAW,GAAG,IAAI,GAAG,EAA+B,CAAC;AAE3D;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,8EAA8E;IAC9E,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;AAChF,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,SAAS;IACvB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,wIAAwI;AACxI,MAAM,UAAU,YAAY,CAAC,OAAO,GAA6B,EAAE;IACjE,MAAM,GAAG,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IACpD,IAAI,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,UAAU,CAAC,OAAO,GAA+B,EAAE;IACjE,MAAM,GAAG,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IACpD,IAAI,MAAM,GAAG,WAAW,CAAC,GAAG,CA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C,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["/**\n * The locale every number and date in the components is written in, and the\n * words they show. Both are page-wide: one locale and one set of words per\n * page. A host sets them once, before the components render, with\n * `setLocale` and `setLabels` or the `SurfacesText` component.\n */\n\nlet current = \"en-US\";\nconst formats = new Map<string, Intl.NumberFormat>();\nconst dateFormats = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * Sets the locale (a BCP 47 tag such as \"de-DE\") for every number and date the\n * components write. Platform forms with an underscore (\"en_US\", as iOS and\n * Android write them) are accepted.\n */\nexport function setLocale(locale: string): void {\n // Throws a RangeError on a malformed tag here rather than on the next render.\n current = Intl.getCanonicalLocales(locale.replaceAll(\"_\", \"-\"))[0] ?? \"en-US\";\n}\n\n/** The locale numbers and dates are written in. Defaults to \"en-US\". */\nexport function getLocale(): string {\n return current;\n}\n\n/** A number format in the current locale, kept for reuse. Call it when formatting, not once at load, so a later `setLocale` applies. */\nexport function numberFormat(options: Intl.NumberFormatOptions = {}): Intl.NumberFormat {\n const key = `${current}|${JSON.stringify(options)}`;\n let format = formats.get(key);\n if (!format) {\n format = new Intl.NumberFormat(current, options);\n formats.set(key, format);\n }\n return format;\n}\n\n/** A date and time format in the current locale, kept for reuse. */\nexport function dateFormat(options: Intl.DateTimeFormatOptions = {}): Intl.DateTimeFormat {\n const key = `${current}|${JSON.stringify(options)}`;\n let format = dateFormats.get(key);\n if (!format) {\n format = new Intl.DateTimeFormat(current, options);\n dateFormats.set(key, format);\n }\n return format;\n}\n\n/**\n * Every word the data-display components show, in English. `{name}` marks a\n * value filled in when the words are shown. Replace any of them with\n * `setLabels`, for another language or plainer words.\n */\nexport const defaultLabels = {\n // Cell values\n \"cell.null\": \"null\",\n \"cell.true\": \"true\",\n \"cell.false\": \"false\",\n\n // DataGrid\n \"grid.label\": \"Query result\",\n \"grid.sortAscending\": \"Sort ascending\",\n \"grid.sortDescending\": \"Sort descending\",\n \"grid.clearSorting\": \"Clear sorting\",\n \"grid.moveLeft\": \"Move left\",\n \"grid.moveRight\": \"Move right\",\n \"grid.hideColumn\": \"Hide column\",\n \"grid.showAllColumns\": \"Show all columns\",\n \"grid.showAllColumnsHidden\": \"Show all columns ({count} hidden)\",\n \"grid.resetWidth\": \"Reset width\",\n \"grid.resetWidthHint\": \"Double-click edge\",\n \"grid.resetLayout\": \"Reset column layout\",\n \"grid.copyColumnName\": \"Copy column name\",\n \"grid.sqlCountValues\": \"SQL: count each value\",\n \"grid.sqlRange\": \"SQL: range and missing values\",\n \"grid.copyValue\": \"Copy value\",\n \"grid.copyRowJson\": \"Copy row as JSON\",\n \"grid.filterToValue\": \"Filter to this value\",\n \"grid.leaveValueOut\": \"Leave this value out\",\n \"grid.copied\": \"Copied {what}.\",\n \"grid.copiedCell\": \"the cell\",\n \"grid.copiedRow\": \"the row\",\n \"grid.copiedColumnName\": \"the column name\",\n \"grid.copiedSql\": \"the SQL\",\n \"grid.copyFailed\": \"Could not copy: the browser refused access to the clipboard.\",\n \"grid.movedLeft\": \"Moved {name} left.\",\n \"grid.movedRight\": \"Moved {name} right.\",\n \"grid.moved\": \"Moved {name}.\",\n \"grid.columnMenu\": \"{name} column\",\n \"grid.cellMenu\": \"{name} cell\",\n \"grid.activeCellMenu\": \"Cell\",\n \"grid.failed\": \"Query failed\",\n \"grid.loading\": \"Loading…\",\n \"grid.rows\": \"{count} rows\",\n \"grid.rowsOne\": \"{count} row\",\n \"grid.noRows\": \"No rows match.\",\n \"grid.showHidden\": \"Show {count} hidden columns\",\n \"grid.showHiddenOne\": \"Show {count} hidden column\",\n \"grid.elapsed\": \"{ms} ms\",\n \"grid.asOf\": \"As of {time}\",\n \"grid.runAgain\": \"Run again\",\n \"grid.previous\": \"Previous\",\n \"grid.next\": \"Next\",\n \"grid.page\": \"Page {page} of {pages}\",\n\n // PivotTable\n \"pivot.label\": \"Pivot table\",\n \"pivot.loading\": \"Loading…\",\n \"pivot.choose\": \"Choose rows or columns and a measure.\",\n \"pivot.empty\": \"No rows match.\",\n \"pivot.total\": \"Total\",\n \"pivot.all\": \"All\",\n \"pivot.none\": \"(none)\",\n \"pivot.truncated\": \"This pivot has more than {limit} cells, so some are missing. Add a filter or choose columns with fewer values.\",\n \"pivot.hiddenColumns\": \"Showing the first {shown} of {total} column values.\",\n\n // Chart\n \"chart.empty\": \"No data to chart.\",\n \"chart.missingX\": \"Rows with no {x} are not drawn{detail}.\",\n \"chart.description\": \"{type} chart of {measures} by {x}\",\n \"chart.coloursRepeat\": \"{count} series share {colours} colours, so some repeat. Filter, or split by a column with fewer values.\",\n \"chart.advice\": \"{message} Better: {instead}\",\n \"chart.sampleNote\": \"Showing a random sample of {count} rows.\",\n \"chart.firstNote\": \"Showing the first {count} points.\",\n \"chart.largestNote\": \"Showing the largest {count} points.\",\n\n // RowList\n \"rows.loading\": \"Loading…\",\n \"rows.empty\": \"Nothing to show.\",\n \"rows.more\": \"Show more\",\n \"rows.some\": \"Showing the first {count}.\",\n \"rows.full\": \"Showing the first {count}. Filter to find others.\",\n\n // Metric, Sparkline, BulletGraph\n \"metric.loading\": \"…\",\n \"metric.none\": \"–\",\n \"sparkline.summary\": \"{label}: {now} now, from {first}; low {low}, high {high} over {count} {grain}s.\",\n \"sparkline.empty\": \"{label}: no data.\",\n \"bullet.loading\": \"{label}: loading.\",\n \"bullet.empty\": \"{label}: no data.\",\n \"bullet.reading\": \"{label}: {value}{band}{target}.\",\n \"bullet.targetMet\": \"; target {target}, met\",\n \"bullet.targetNotMet\": \"; target {target}, not met\",\n \"bullet.target\": \"Target {target}\",\n\n // FilterBar\n \"filter.active\": \"Active filters\",\n \"filter.remove\": \"Remove filter {filter}\",\n \"filter.form\": \"Add a filter\",\n \"filter.column\": \"Column\",\n \"filter.comparison\": \"Comparison\",\n \"filter.value\": \"Value\",\n \"filter.typeOrPick\": \"Type or pick a value\",\n \"filter.add\": \"Add filter\",\n \"filter.quickRange\": \"Quick date range\",\n \"filter.quickRangeChoose\": \"Quick range…\",\n \"filter.range7d\": \"Last 7 days\",\n \"filter.range30d\": \"Last 30 days\",\n \"filter.range90d\": \"Last 90 days\",\n \"filter.range12m\": \"Last 12 months\",\n \"filter.rangeMonth\": \"This month\",\n \"filter.rangeYear\": \"This year\",\n \"filter.isEmpty\": \"is empty\",\n \"filter.isNotEmpty\": \"is not empty\",\n \"filter.contains\": \"contains\",\n \"filter.is\": \"is\",\n \"filter.isNot\": \"is not\",\n \"filter.startsWith\": \"starts with\",\n \"filter.endsWith\": \"ends with\",\n \"filter.enterWholeNumber\": \"Enter a whole number.\",\n \"filter.enterNumber\": \"Enter a number.\",\n \"filter.enterTrueFalse\": \"Enter true or false.\",\n \"filter.enterDate\": \"Enter a date like 2026-01-31.\",\n \"filter.enterValue\": \"Enter a value.\",\n\n // QueryResult\n \"result.views\": \"Result view\",\n \"result.tabTable\": \"Table\",\n \"result.tabChart\": \"Chart\",\n \"result.tabPivot\": \"Pivot\",\n \"result.stopExport\": \"Stop export\",\n \"result.downloadCsv\": \"Download CSV\",\n \"result.copySql\": \"Copy SQL\",\n \"result.cancelQuery\": \"Cancel query\",\n \"result.format\": \"Format\",\n \"result.formatColumn\": \"Column to format\",\n \"result.chooseColumn\": \"Choose a column…\",\n \"result.howToShow\": \"How to show {column}\",\n \"result.asItIs\": \"As it is\",\n \"result.formatNumber\": \"Number\",\n \"result.formatCompact\": \"Short number (1.2M)\",\n \"result.formatCurrency\": \"Currency\",\n \"result.formatPercent\": \"Percent\",\n \"result.formatText\": \"Plain text\",\n \"result.formatDate\": \"Date only\",\n \"result.formatDatetime\": \"Date and time\",\n \"result.preparing\": \"Preparing the file…\",\n \"result.rowsSoFar\": \"{count} rows so far…\",\n \"result.saved\": \"Saved {count} rows.\",\n \"result.savedTruncated\": \"Saved {count} rows. The server's row limit was reached, so the file is not the whole result.\",\n \"result.exportStopped\": \"Export stopped.\",\n \"result.sqlCopied\": \"SQL copied.\",\n \"result.copyNotAllowed\": \"Copying is not allowed here.\",\n \"result.sqlSent\": \"SQL sent to the engine\",\n \"result.plan\": \"How the engine will run it\",\n \"result.stored\": \"The query ran once and its result was kept, so sorting, filtering and paging read the kept rows instead of running it again.\",\n \"result.chooseChart\": \"Choose columns to chart.\",\n \"result.choosePivot\": \"Choose what goes in the rows and the values.\",\n \"result.chartType\": \"Type\",\n \"result.slices\": \"Slices\",\n \"result.xAxis\": \"X axis\",\n \"result.yAxis\": \"Y axis\",\n \"result.every\": \"Every\",\n \"result.bins\": \"Bins\",\n \"result.binsEach\": \"each value\",\n \"result.binsAbout\": \"about {count}\",\n \"result.splitBy\": \"Split by\",\n \"result.nothing\": \"nothing\",\n \"result.legend\": \"Legend\",\n \"result.automatic\": \"automatic\",\n \"result.legendHidden\": \"hidden\",\n \"result.stack\": \"Stack\",\n \"result.plotEachRow\": \"Plot each row\",\n \"result.series\": \"Series {number}\",\n \"result.of\": \"of\",\n \"result.drawnAs\": \"Drawn as\",\n \"result.drawnAsChart\": \"chart type ({type})\",\n \"result.scale\": \"Scale\",\n \"result.leftAxis\": \"left axis\",\n \"result.rightAxis\": \"right axis\",\n \"result.removeSeries\": \"Remove series {number}\",\n \"result.remove\": \"Remove\",\n \"result.addSeries\": \"Add series\",\n \"result.rows\": \"Rows\",\n \"result.columns\": \"Columns\",\n \"result.none\": \"none\",\n \"result.datesBy\": \"Dates by\",\n \"result.values\": \"Values\",\n \"result.sum\": \"sum\",\n \"result.avg\": \"average\",\n \"result.median\": \"median\",\n \"result.count\": \"count of rows\",\n \"result.countDistinct\": \"distinct count\",\n \"result.min\": \"minimum\",\n \"result.max\": \"maximum\",\n \"result.stddev\": \"standard deviation\",\n \"result.p90\": \"90th percentile\",\n\n // Form\n \"form.submit\": \"Submit\",\n \"form.choose\": \"Choose…\",\n \"form.required\": \"(required)\",\n \"form.needsAttention\": \"Nothing was sent. {count} fields need attention.\",\n \"form.needsAttentionOne\": \"Nothing was sent. One field needs attention.\",\n \"form.sent\": \"Sent.\",\n \"form.notSaved\": \"The backend did not save it.\",\n \"form.saved\": \"Saved.\",\n \"form.couldNotSend\": \"Could not send: {error}\",\n \"form.sending\": \"Sending…\",\n \"form.connected\": \"Saved by the backend this page is connected to.\",\n \"form.notConnected\": \"Not connected to a backend: what you submit goes only to this page.\",\n\n // StepFlow\n \"flow.done\": \"Done\",\n \"flow.current\": \"In progress\",\n \"flow.waiting\": \"Waiting for you\",\n \"flow.pending\": \"Not started\",\n \"flow.failed\": \"Failed\",\n \"flow.skipped\": \"Skipped\",\n \"flow.count\": \"{done} of {total} done\",\n\n // PlanReview\n \"plan.riskLow\": \"Low risk\",\n \"plan.riskMedium\": \"Check this\",\n \"plan.riskHigh\": \"Changes or removes data\",\n \"plan.proposedBy\": \"Proposed by {who}. Nothing runs until you approve.\",\n \"plan.required\": \"Required\",\n \"plan.affects\": \"Affects: {what}\",\n \"plan.whatItWouldRun\": \"What it would run\",\n \"plan.approved\": \"Approved {count} of {total} steps.\",\n \"plan.rejected\": \"Rejected. Nothing was run.\",\n \"plan.decisionNote\": \" Note: {note}\",\n \"plan.noteLabel\": \"Note for the record (optional)\",\n \"plan.approve\": \"Approve {count} steps\",\n \"plan.approveOne\": \"Approve {count} step\",\n \"plan.reject\": \"Reject\",\n\n // ActionReceipt\n \"receipt.done\": \"Done\",\n \"receipt.partial\": \"Partly done\",\n \"receipt.failed\": \"Failed\",\n \"receipt.ran\": \"Ran\",\n \"receipt.by\": \"by {who}\",\n \"receipt.approved\": \"Approved\",\n \"receipt.noApproval\": \"No one approved this.\",\n \"receipt.whatChanged\": \"What changed\",\n \"receipt.what\": \"What\",\n \"receipt.before\": \"Before\",\n \"receipt.after\": \"After\",\n \"receipt.whatRan\": \"What ran\",\n \"receipt.cannotUndo\": \"This cannot be undone from here.\",\n \"receipt.undoClosed\": \"It could be undone until {time}; that time has passed.\",\n \"receipt.undoUntil\": \"Can be undone until {time}.\",\n \"receipt.undoRequested\": \"Undo requested. You will be asked to confirm it.\",\n\n // DataTable\n \"table.selectPage\": \"Select every row on this page\",\n \"table.selectRow\": \"Select {name}\",\n \"table.empty\": \"Nothing to show.\",\n \"table.loading\": \"Loading…\",\n \"table.rowControls\": \"{name} actions\",\n \"table.actions\": \"Actions\",\n \"table.select\": \"Select\",\n\n // SelectionBar\n \"selection.label\": \"With the selected rows\",\n \"selection.count\": \"{count} selected\",\n \"selection.pageSelected\": \"All {count} on this page are selected.\",\n \"selection.selectAllMatching\": \"Select all {total} that match\",\n \"selection.allMatching\": \"All {total} that match are selected.\",\n \"selection.onlyPage\": \"Only this page\",\n \"selection.clear\": \"Clear\",\n\n // Pagination\n \"pages.label\": \"Pages\",\n \"pages.range\": \"{from}–{to} of {total}\",\n \"pages.previous\": \"Previous\",\n \"pages.next\": \"Next\",\n\n // ConfirmDialog\n \"confirm.confirm\": \"Confirm\",\n \"confirm.cancel\": \"Cancel\",\n\n // Combobox\n \"combobox.loading\": \"Looking…\",\n \"combobox.none\": \"Nothing matches.\",\n \"combobox.count\": \"{count} suggestions\",\n \"combobox.countOne\": \"1 suggestion\",\n\n // ReportBuilder\n \"report.untitled\": \"Untitled\",\n \"report.untitledReport\": \"Untitled report\",\n \"report.title\": \"Report title\",\n \"report.tileTitle\": \"Title of {title}\",\n \"report.tileControls\": \"{title} controls\",\n \"report.mode\": \"Mode\",\n \"report.build\": \"Build\",\n \"report.view\": \"View\",\n \"report.builder\": \"Build a view\",\n \"report.body\": \"Report\",\n \"report.changing\": \"Changing “{title}”.\",\n \"report.leaveAsItWas\": \"Leave it as it was\",\n \"report.leftAsItWas\": \"Left as it was.\",\n \"report.updateView\": \"Update view\",\n \"report.addToReport\": \"Add to report\",\n \"report.maxViews\": \"A report holds at most {max} views.\",\n \"report.needMeasure\": \"Put a metric on “Measure” first: a view needs something to measure.\",\n \"report.emptyBuild\": \"Nothing on the report yet. Make a view above and press “Add to report”; each one you add appears here, and they all follow the same filters.\",\n \"report.emptyView\": \"This report has no views yet. Switch to Build to make one.\",\n} as const;\n\n/** The name of one replaceable word or sentence. A name not in `defaultLabels` is a type error. */\nexport type LabelKey = keyof typeof defaultLabels;\n/** Every label, by name. */\nexport type Labels = Record<LabelKey, string>;\n\nlet labels: Labels = { ...defaultLabels };\n\n/** Replaces some of the words. Names not given keep their current text. */\nexport function setLabels(partial: Partial<Labels>): void {\n const next = { ...labels };\n for (const [key, text] of Object.entries(partial)) {\n if (typeof text === \"string\" && key in defaultLabels) next[key as LabelKey] = text;\n }\n labels = next;\n}\n\n/** Puts every word back to its English default. */\nexport function resetLabels(): void {\n labels = { ...defaultLabels };\n}\n\n/** The text for a label, with each `{name}` replaced by `vars.name`. A name with no value is left as written. */\nexport function label(key: LabelKey, vars?: Record<string, string | number>): string {\n const text = labels[key];\n if (!vars) return text;\n return text.replace(/\\{(\\w+)\\}/g, (whole, name: string) => (name in vars ? String(vars[name]) : whole));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/locale/locale.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,IAAI,OAAO,GAAG,OAAO,CAAC;AACtB,MAAM,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;AACrD,MAAM,WAAW,GAAG,IAAI,GAAG,EAA+B,CAAC;AAE3D;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,8EAA8E;IAC9E,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;AAChF,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,SAAS;IACvB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,wIAAwI;AACxI,MAAM,UAAU,YAAY,CAAC,OAAO,GAA6B,EAAE;IACjE,MAAM,GAAG,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,O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O,CAAC,EAAE,CAAC;QAClD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,GAAG,IAAI,aAAa;YAAE,IAAI,CAAC,GAAe,CAAC,GAAG,IAAI,CAAC;IACrF,CAAC;IACD,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,WAAW;IACzB,MAAM,GAAG,EAAE,GAAG,aAAa,EAAE,CAAC;AAChC,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,KAAK,CAAC,GAAa,EAAE,IAAsC;IACzE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1G,CAAC","sourcesContent":["/**\n * The locale every number and date in the components is written in, and the\n * words they show. Both are page-wide: one locale and one set of words per\n * page. A host sets them once, before the components render, with\n * `setLocale` and `setLabels` or the `SurfacesText` component.\n */\n\nlet current = \"en-US\";\nconst formats = new Map<string, Intl.NumberFormat>();\nconst dateFormats = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * Sets the locale (a BCP 47 tag such as \"de-DE\") for every number and date the\n * components write. Platform forms with an underscore (\"en_US\", as iOS and\n * Android write them) are accepted.\n */\nexport function setLocale(locale: string): void {\n // Throws a RangeError on a malformed tag here rather than on the next render.\n current = Intl.getCanonicalLocales(locale.replaceAll(\"_\", \"-\"))[0] ?? \"en-US\";\n}\n\n/** The locale numbers and dates are written in. Defaults to \"en-US\". */\nexport function getLocale(): string {\n return current;\n}\n\n/** A number format in the current locale, kept for reuse. Call it when formatting, not once at load, so a later `setLocale` applies. */\nexport function numberFormat(options: Intl.NumberFormatOptions = {}): Intl.NumberFormat {\n const key = `${current}|${JSON.stringify(options)}`;\n let format = formats.get(key);\n if (!format) {\n format = new Intl.NumberFormat(current, options);\n formats.set(key, format);\n }\n return format;\n}\n\n/** A date and time format in the current locale, kept for reuse. */\nexport function dateFormat(options: Intl.DateTimeFormatOptions = {}): Intl.DateTimeFormat {\n const key = `${current}|${JSON.stringify(options)}`;\n let format = dateFormats.get(key);\n if (!format) {\n format = new Intl.DateTimeFormat(current, options);\n dateFormats.set(key, format);\n }\n return format;\n}\n\n/**\n * Every word the data-display components show, in English. `{name}` marks a\n * value filled in when the words are shown. Replace any of them with\n * `setLabels`, for another language or plainer words.\n */\nexport const defaultLabels = {\n // Cell values\n \"cell.null\": \"null\",\n \"cell.true\": \"true\",\n \"cell.false\": \"false\",\n\n // DataGrid\n \"grid.label\": \"Query result\",\n \"grid.sortAscending\": \"Sort ascending\",\n \"grid.sortDescending\": \"Sort descending\",\n \"grid.clearSorting\": \"Clear sorting\",\n \"grid.moveLeft\": \"Move left\",\n \"grid.moveRight\": \"Move right\",\n \"grid.hideColumn\": \"Hide column\",\n \"grid.showAllColumns\": \"Show all columns\",\n \"grid.showAllColumnsHidden\": \"Show all columns ({count} hidden)\",\n \"grid.resetWidth\": \"Reset width\",\n \"grid.resetWidthHint\": \"Double-click edge\",\n \"grid.resetLayout\": \"Reset column layout\",\n \"grid.copyColumnName\": \"Copy column name\",\n \"grid.sqlCountValues\": \"SQL: count each value\",\n \"grid.sqlRange\": \"SQL: range and missing values\",\n \"grid.copyValue\": \"Copy value\",\n \"grid.copyRowJson\": \"Copy row as JSON\",\n \"grid.filterToValue\": \"Filter to this value\",\n \"grid.leaveValueOut\": \"Leave this value out\",\n \"grid.copied\": \"Copied {what}.\",\n \"grid.copiedCell\": \"the cell\",\n \"grid.copiedRow\": \"the row\",\n \"grid.copiedColumnName\": \"the column name\",\n \"grid.copiedSql\": \"the SQL\",\n \"code.copyFailed\": \"Could not copy: the browser did not allow it. The code is selected, so you can copy it yourself.\",\n \"grid.copyFailed\": \"Could not copy: the browser refused access to the clipboard.\",\n \"grid.movedLeft\": \"Moved {name} left.\",\n \"grid.movedRight\": \"Moved {name} right.\",\n \"grid.moved\": \"Moved {name}.\",\n \"grid.columnMenu\": \"{name} column\",\n \"grid.cellMenu\": \"{name} cell\",\n \"grid.activeCellMenu\": \"Cell\",\n \"grid.failed\": \"Query failed\",\n \"grid.loading\": \"Loading…\",\n \"grid.rows\": \"{count} rows\",\n \"grid.rowsOne\": \"{count} row\",\n \"grid.noRows\": \"No rows match.\",\n \"grid.showHidden\": \"Show {count} hidden columns\",\n \"grid.showHiddenOne\": \"Show {count} hidden column\",\n \"grid.elapsed\": \"{ms} ms\",\n \"grid.asOf\": \"As of {time}\",\n \"grid.runAgain\": \"Run again\",\n \"grid.previous\": \"Previous\",\n \"grid.next\": \"Next\",\n \"grid.page\": \"Page {page} of {pages}\",\n\n // PivotTable\n \"pivot.label\": \"Pivot table\",\n \"pivot.loading\": \"Loading…\",\n \"pivot.choose\": \"Choose rows or columns and a measure.\",\n \"pivot.empty\": \"No rows match.\",\n \"pivot.total\": \"Total\",\n \"pivot.all\": \"All\",\n \"pivot.none\": \"(none)\",\n \"pivot.truncated\": \"This pivot has more than {limit} cells, so some are missing. Add a filter or choose columns with fewer values.\",\n \"pivot.hiddenColumns\": \"Showing the first {shown} of {total} column values.\",\n\n // Chart\n \"chart.empty\": \"No data to chart.\",\n \"chart.missingX\": \"Rows with no {x} are not drawn{detail}.\",\n \"chart.description\": \"{type} chart of {measures} by {x}\",\n \"chart.coloursRepeat\": \"{count} series share {colours} colours, so some repeat. Filter, or split by a column with fewer values.\",\n \"chart.advice\": \"{message} Better: {instead}\",\n \"chart.sampleNote\": \"Showing a random sample of {count} rows.\",\n \"chart.firstNote\": \"Showing the first {count} points.\",\n \"chart.largestNote\": \"Showing the largest {count} points.\",\n\n // RowList\n \"rows.loading\": \"Loading…\",\n \"rows.empty\": \"Nothing to show.\",\n \"rows.more\": \"Show more\",\n \"rows.some\": \"Showing the first {count}.\",\n \"rows.full\": \"Showing the first {count}. Filter to find others.\",\n\n // Metric, Sparkline, BulletGraph\n \"metric.loading\": \"…\",\n \"metric.none\": \"–\",\n \"sparkline.summary\": \"{label}: {now} now, from {first}; low {low}, high {high} over {count} {grain}s.\",\n \"sparkline.empty\": \"{label}: no data.\",\n \"bullet.loading\": \"{label}: loading.\",\n \"bullet.empty\": \"{label}: no data.\",\n \"bullet.reading\": \"{label}: {value}{band}{target}.\",\n \"bullet.targetMet\": \"; target {target}, met\",\n \"bullet.targetNotMet\": \"; target {target}, not met\",\n \"bullet.target\": \"Target {target}\",\n\n // FilterBar\n \"filter.active\": \"Active filters\",\n \"filter.remove\": \"Remove filter {filter}\",\n \"filter.form\": \"Add a filter\",\n \"filter.column\": \"Column\",\n \"filter.comparison\": \"Comparison\",\n \"filter.value\": \"Value\",\n \"filter.typeOrPick\": \"Type or pick a value\",\n \"filter.add\": \"Add filter\",\n \"filter.quickRange\": \"Quick date range\",\n \"filter.quickRangeChoose\": \"Quick range…\",\n \"filter.range7d\": \"Last 7 days\",\n \"filter.range30d\": \"Last 30 days\",\n \"filter.range90d\": \"Last 90 days\",\n \"filter.range12m\": \"Last 12 months\",\n \"filter.rangeMonth\": \"This month\",\n \"filter.rangeYear\": \"This year\",\n \"filter.isEmpty\": \"is empty\",\n \"filter.isNotEmpty\": \"is not empty\",\n \"filter.contains\": \"contains\",\n \"filter.is\": \"is\",\n \"filter.isNot\": \"is not\",\n \"filter.startsWith\": \"starts with\",\n \"filter.endsWith\": \"ends with\",\n \"filter.enterWholeNumber\": \"Enter a whole number.\",\n \"filter.enterNumber\": \"Enter a number.\",\n \"filter.enterTrueFalse\": \"Enter true or false.\",\n \"filter.enterDate\": \"Enter a date like 2026-01-31.\",\n \"filter.enterValue\": \"Enter a value.\",\n\n // QueryResult\n \"result.views\": \"Result view\",\n \"result.tabTable\": \"Table\",\n \"result.tabChart\": \"Chart\",\n \"result.tabPivot\": \"Pivot\",\n \"result.stopExport\": \"Stop export\",\n \"result.downloadCsv\": \"Download CSV\",\n \"result.copySql\": \"Copy SQL\",\n \"result.cancelQuery\": \"Cancel query\",\n \"result.format\": \"Format\",\n \"result.formatColumn\": \"Column to format\",\n \"result.chooseColumn\": \"Choose a column…\",\n \"result.howToShow\": \"How to show {column}\",\n \"result.asItIs\": \"As it is\",\n \"result.formatNumber\": \"Number\",\n \"result.formatCompact\": \"Short number (1.2M)\",\n \"result.formatCurrency\": \"Currency\",\n \"result.formatPercent\": \"Percent\",\n \"result.formatText\": \"Plain text\",\n \"result.formatDate\": \"Date only\",\n \"result.formatDatetime\": \"Date and time\",\n \"result.preparing\": \"Preparing the file…\",\n \"result.rowsSoFar\": \"{count} rows so far…\",\n \"result.saved\": \"Saved {count} rows.\",\n \"result.savedTruncated\": \"Saved {count} rows. The server's row limit was reached, so the file is not the whole result.\",\n \"result.exportStopped\": \"Export stopped.\",\n \"result.sqlCopied\": \"SQL copied.\",\n \"result.copyNotAllowed\": \"Copying is not allowed here.\",\n \"result.sqlSent\": \"SQL sent to the engine\",\n \"result.plan\": \"How the engine will run it\",\n \"result.stored\": \"The query ran once and its result was kept, so sorting, filtering and paging read the kept rows instead of running it again.\",\n \"result.chooseChart\": \"Choose columns to chart.\",\n \"result.choosePivot\": \"Choose what goes in the rows and the values.\",\n \"result.chartType\": \"Type\",\n \"result.slices\": \"Slices\",\n \"result.xAxis\": \"X axis\",\n \"result.yAxis\": \"Y axis\",\n \"result.every\": \"Every\",\n \"result.bins\": \"Bins\",\n \"result.binsEach\": \"each value\",\n \"result.binsAbout\": \"about {count}\",\n \"result.splitBy\": \"Split by\",\n \"result.nothing\": \"nothing\",\n \"result.legend\": \"Legend\",\n \"result.automatic\": \"automatic\",\n \"result.legendHidden\": \"hidden\",\n \"result.stack\": \"Stack\",\n \"result.plotEachRow\": \"Plot each row\",\n \"result.series\": \"Series {number}\",\n \"result.of\": \"of\",\n \"result.drawnAs\": \"Drawn as\",\n \"result.drawnAsChart\": \"chart type ({type})\",\n \"result.scale\": \"Scale\",\n \"result.leftAxis\": \"left axis\",\n \"result.rightAxis\": \"right axis\",\n \"result.removeSeries\": \"Remove series {number}\",\n \"result.remove\": \"Remove\",\n \"result.addSeries\": \"Add series\",\n \"result.rows\": \"Rows\",\n \"result.columns\": \"Columns\",\n \"result.none\": \"none\",\n \"result.datesBy\": \"Dates by\",\n \"result.values\": \"Values\",\n \"result.sum\": \"sum\",\n \"result.avg\": \"average\",\n \"result.median\": \"median\",\n \"result.count\": \"count of rows\",\n \"result.countDistinct\": \"distinct count\",\n \"result.min\": \"minimum\",\n \"result.max\": \"maximum\",\n \"result.stddev\": \"standard deviation\",\n \"result.p90\": \"90th percentile\",\n\n // Form\n \"form.submit\": \"Submit\",\n \"form.choose\": \"Choose…\",\n \"form.required\": \"(required)\",\n \"form.needsAttention\": \"Nothing was sent. {count} fields need attention.\",\n \"form.needsAttentionOne\": \"Nothing was sent. One field needs attention.\",\n \"form.sent\": \"Sent.\",\n \"form.notSaved\": \"The backend did not save it.\",\n \"form.saved\": \"Saved.\",\n \"form.couldNotSend\": \"Could not send: {error}\",\n \"form.sending\": \"Sending…\",\n \"form.connected\": \"Saved by the backend this page is connected to.\",\n \"form.notConnected\": \"Not connected to a backend: what you submit goes only to this page.\",\n\n // StepFlow\n \"flow.done\": \"Done\",\n \"flow.current\": \"In progress\",\n \"flow.waiting\": \"Waiting for you\",\n \"flow.pending\": \"Not started\",\n \"flow.failed\": \"Failed\",\n \"flow.skipped\": \"Skipped\",\n \"flow.count\": \"{done} of {total} done\",\n\n // PlanReview\n \"plan.riskLow\": \"Low risk\",\n \"plan.riskMedium\": \"Check this\",\n \"plan.riskHigh\": \"Changes or removes data\",\n \"plan.proposedBy\": \"Proposed by {who}. Nothing runs until you approve.\",\n \"plan.required\": \"Required\",\n \"plan.affects\": \"Affects: {what}\",\n \"plan.whatItWouldRun\": \"What it would run\",\n \"plan.approved\": \"Approved {count} of {total} steps.\",\n \"plan.rejected\": \"Rejected. Nothing was run.\",\n \"plan.decisionNote\": \" Note: {note}\",\n \"plan.noteLabel\": \"Note for the record (optional)\",\n \"plan.approve\": \"Approve {count} steps\",\n \"plan.approveOne\": \"Approve {count} step\",\n \"plan.reject\": \"Reject\",\n\n // ActionReceipt\n \"receipt.done\": \"Done\",\n \"receipt.partial\": \"Partly done\",\n \"receipt.failed\": \"Failed\",\n \"receipt.ran\": \"Ran\",\n \"receipt.by\": \"by {who}\",\n \"receipt.approved\": \"Approved\",\n \"receipt.noApproval\": \"No one approved this.\",\n \"receipt.whatChanged\": \"What changed\",\n \"receipt.what\": \"What\",\n \"receipt.before\": \"Before\",\n \"receipt.after\": \"After\",\n \"receipt.whatRan\": \"What ran\",\n \"receipt.cannotUndo\": \"This cannot be undone from here.\",\n \"receipt.undoClosed\": \"It could be undone until {time}; that time has passed.\",\n \"receipt.undoUntil\": \"Can be undone until {time}.\",\n \"receipt.undoRequested\": \"Undo requested. You will be asked to confirm it.\",\n\n // DataTable\n \"table.selectPage\": \"Select every row on this page\",\n \"table.selectRow\": \"Select {name}\",\n \"table.empty\": \"Nothing to show.\",\n \"table.loading\": \"Loading…\",\n \"table.rowControls\": \"{name} actions\",\n \"table.actions\": \"Actions\",\n \"table.select\": \"Select\",\n\n // SelectionBar\n \"selection.label\": \"With the selected rows\",\n \"selection.count\": \"{count} selected\",\n \"selection.pageSelected\": \"All {count} on this page are selected.\",\n \"selection.selectAllMatching\": \"Select all {total} that match\",\n \"selection.allMatching\": \"All {total} that match are selected.\",\n \"selection.onlyPage\": \"Only this page\",\n \"selection.clear\": \"Clear\",\n\n // Pagination\n \"pages.label\": \"Pages\",\n \"pages.range\": \"{from}–{to} of {total}\",\n \"pages.previous\": \"Previous\",\n \"pages.next\": \"Next\",\n\n // ConfirmDialog\n \"confirm.confirm\": \"Confirm\",\n \"confirm.cancel\": \"Cancel\",\n\n // Combobox\n \"combobox.loading\": \"Looking…\",\n \"combobox.none\": \"Nothing matches.\",\n \"combobox.count\": \"{count} suggestions\",\n \"combobox.countOne\": \"1 suggestion\",\n\n // ReportBuilder\n \"report.untitled\": \"Untitled\",\n \"report.untitledReport\": \"Untitled report\",\n \"report.title\": \"Report title\",\n \"report.tileTitle\": \"Title of {title}\",\n \"report.tileControls\": \"{title} controls\",\n \"report.mode\": \"Mode\",\n \"report.build\": \"Build\",\n \"report.view\": \"View\",\n \"report.builder\": \"Build a view\",\n \"report.body\": \"Report\",\n \"report.changing\": \"Changing “{title}”.\",\n \"report.leaveAsItWas\": \"Leave it as it was\",\n \"report.leftAsItWas\": \"Left as it was.\",\n \"report.updateView\": \"Update view\",\n \"report.addToReport\": \"Add to report\",\n \"report.maxViews\": \"A report holds at most {max} views.\",\n \"report.needMeasure\": \"Put a metric on “Measure” first: a view needs something to measure.\",\n \"report.emptyBuild\": \"Nothing on the report yet. Make a view above and press “Add to report”; each one you add appears here, and they all follow the same filters.\",\n \"report.emptyView\": \"This report has no views yet. Switch to Build to make one.\",\n} as const;\n\n/** The name of one replaceable word or sentence. A name not in `defaultLabels` is a type error. */\nexport type LabelKey = keyof typeof defaultLabels;\n/** Every label, by name. */\nexport type Labels = Record<LabelKey, string>;\n\nlet labels: Labels = { ...defaultLabels };\n\n/** Replaces some of the words. Names not given keep their current text. */\nexport function setLabels(partial: Partial<Labels>): void {\n const next = { ...labels };\n for (const [key, text] of Object.entries(partial)) {\n if (typeof text === \"string\" && key in defaultLabels) next[key as LabelKey] = text;\n }\n labels = next;\n}\n\n/** Puts every word back to its English default. */\nexport function resetLabels(): void {\n labels = { ...defaultLabels };\n}\n\n/** The text for a label, with each `{name}` replaced by `vars.name`. A name with no value is left as written. */\nexport function label(key: LabelKey, vars?: Record<string, string | number>): string {\n const text = labels[key];\n if (!vars) return text;\n return text.replace(/\\{(\\w+)\\}/g, (whole, name: string) => (name in vars ? String(vars[name]) : whole));\n}\n"]}
|
|
@@ -10,6 +10,7 @@ import { formatCell, isNumeric } from "../data/format.js";
|
|
|
10
10
|
import { FilterBar } from "../filter/FilterBar.js";
|
|
11
11
|
import { valueFilter } from "@surfaces-ui/data";
|
|
12
12
|
import { DataGrid } from "../grid/DataGrid.js";
|
|
13
|
+
import { copyText } from "../menu/ContextMenu.js";
|
|
13
14
|
import { label as text, numberFormat } from "../locale/locale.js";
|
|
14
15
|
import { PivotTable } from "../pivot/PivotTable.js";
|
|
15
16
|
import { QueryPlan } from "../plan/QueryPlan.js";
|
|
@@ -152,7 +153,7 @@ export function QueryResult(props) {
|
|
|
152
153
|
}
|
|
153
154
|
};
|
|
154
155
|
const copySql = () => {
|
|
155
|
-
void
|
|
156
|
+
void copyText(info?.executedSql || sql).then((ok) => setTool({ status: text(ok ? "result.sqlCopied" : "result.copyNotAllowed") }));
|
|
156
157
|
};
|
|
157
158
|
const formatKind = formats[formatColumn]?.kind ?? "";
|
|
158
159
|
// A one-row probe tells us the result's columns before any view is configured.
|