derive-dashboards 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/dist/charts/kinds/area-marks.mjs +2 -1
- package/dist/charts/kinds/funnel-words.mjs +1 -1
- package/dist/charts/kinds/grid-marks.mjs +9 -4
- package/dist/charts/theme.d.mts +13 -13
- package/dist/charts/theme.mjs +17 -14
- package/dist/charts-react/Overlay.mjs +1 -0
- package/dist/charts-react/chart-unlayered.css +1 -107
- package/dist/charts-react/chart.css +1 -121
- package/dist/charts-react/tip-place.mjs +30 -15
- package/dist/core/document/display-comparisons.mjs +49 -0
- package/dist/core/document/display-validation.d.mts +12 -0
- package/dist/core/document/display-validation.mjs +56 -0
- package/dist/core/document/display.d.mts +6 -12
- package/dist/core/document/display.mjs +23 -48
- package/dist/core/engine/dialect.d.mts +2 -0
- package/dist/core/engine/index.mjs +1 -1
- package/dist/core/engine/levels.mjs +33 -1
- package/dist/core/engine/postgres.mjs +1 -0
- package/dist/core/engine/rank.mjs +1 -1
- package/dist/core/engine/reader.d.mts +4 -0
- package/dist/core/engine/sql-partition.mjs +45 -0
- package/dist/core/engine/sql-reads.mjs +4 -1
- package/dist/core/engine/statement.mjs +4 -4
- package/dist/core/engine/version.d.mts +1 -1
- package/dist/core/engine/version.mjs +1 -1
- package/dist/core/error/codes.d.mts +1 -1
- package/dist/core/error/codes.mjs +1 -1
- package/dist/core/index.d.mts +6 -5
- package/dist/core/index.mjs +8 -7
- package/dist/core/model/validate/fields.mjs +1 -1
- package/dist/core/query/drill/compose.d.mts +2 -0
- package/dist/core/query/drill/compose.mjs +1 -1
- package/dist/core/query/drill/synthetic.mjs +1 -1
- package/dist/core/query/drill/types.d.mts +7 -0
- package/dist/core/query/drill/types.mjs +3 -1
- package/dist/core/schema/answers.d.mts +1176 -362
- package/dist/core/schema/drill-answers.mjs +19 -1
- package/dist/core/schema/drill.d.mts +21 -6
- package/dist/core/schema/drill.mjs +7 -1
- package/dist/core/schema/tools.mjs +13 -0
- package/dist/core/time/index.d.mts +2 -2
- package/dist/core/time/text-time.d.mts +9 -2
- package/dist/core/time/text-time.mjs +18 -3
- package/dist/core/types/api.d.mts +1 -1
- package/dist/core/types/api.mjs +1 -1
- package/dist/core/types/drill-api.d.mts +22 -2
- package/dist/dashboard-documents.d.mts +8 -0
- package/dist/dashboard-documents.mjs +52 -0
- package/dist/drill-access.mjs +40 -3
- package/dist/drill-comparison.mjs +71 -0
- package/dist/drill-crumbs.mjs +21 -2
- package/dist/drill-group-seal.mjs +13 -0
- package/dist/drill-open.mjs +7 -1
- package/dist/drill-seal.mjs +4 -6
- package/dist/drill-views.mjs +5 -13
- package/dist/drill.mjs +28 -58
- package/dist/editing.mjs +1 -1
- package/dist/endpoints/drill.mjs +2 -3
- package/dist/endpoints/index.d.mts +20 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +6 -27
- package/dist/llms.txt +1 -1
- package/dist/react/Cell.mjs +2 -2
- package/dist/react/DashboardList.mjs +3 -3
- package/dist/react/Editing.mjs +3 -3
- package/dist/react/Header.mjs +2 -2
- package/dist/react/History.mjs +3 -3
- package/dist/react/Parts.mjs +2 -2
- package/dist/react/RowBody.d.mts +2 -4
- package/dist/react/RowBody.mjs +14 -39
- package/dist/react/Tile.mjs +4 -5
- package/dist/react/builder/FilterEditor.mjs +2 -2
- package/dist/react/builder/Picker.mjs +3 -3
- package/dist/react/builder/RangeEditor.mjs +3 -3
- package/dist/react/builder/Time.mjs +3 -3
- package/dist/react/builder/Values.mjs +2 -2
- package/dist/react/builder/WidgetBuilder.mjs +2 -2
- package/dist/react/drill/Bars.mjs +34 -38
- package/dist/react/drill/Comparison.mjs +204 -0
- package/dist/react/drill/Controls.mjs +8 -12
- package/dist/react/drill/DrillDrawer.mjs +42 -0
- package/dist/react/drill/DrillPanel.mjs +61 -41
- package/dist/react/drill/Header.mjs +65 -35
- package/dist/react/drill/ItemLink.mjs +40 -0
- package/dist/react/drill/Items.d.mts +2 -1
- package/dist/react/drill/Items.mjs +126 -99
- package/dist/react/drill/ItemsBody.mjs +38 -0
- package/dist/react/drill/ItemsFoot.mjs +24 -19
- package/dist/react/drill/Notes.mjs +23 -13
- package/dist/react/drill/PanelBody.mjs +7 -25
- package/dist/react/drill/RecordRow.mjs +47 -0
- package/dist/react/drill/Trend.mjs +186 -0
- package/dist/react/drill/board.mjs +21 -11
- package/dist/react/drill/drawer-context.mjs +5 -0
- package/dist/react/drill/item-parts.mjs +53 -35
- package/dist/react/drill/item-type.d.mts +2 -2
- package/dist/react/drill/lazy.d.mts +1 -4
- package/dist/react/drill/lazy.mjs +29 -11
- package/dist/react/drill/panel-focus.mjs +18 -7
- package/dist/react/drill/props.d.mts +7 -1
- package/dist/react/drill/props.mjs +39 -8
- package/dist/react/drill/record-page.mjs +61 -0
- package/dist/react/drill/state.mjs +17 -2
- package/dist/react/drill/trend-touch.mjs +33 -0
- package/dist/react/drill/useDrill.d.mts +3 -3
- package/dist/react/drill/useDrill.mjs +35 -15
- package/dist/react/drill/words.d.mts +14 -0
- package/dist/react/drill/words.mjs +19 -7
- package/dist/react/english.d.mts +1 -0
- package/dist/react/english.mjs +1 -0
- package/dist/react/filters/chip.mjs +2 -2
- package/dist/react/filters/menu-search.mjs +5 -5
- package/dist/react/filters/menu.mjs +2 -2
- package/dist/react/filters/number.mjs +2 -2
- package/dist/react/filters/operator.mjs +2 -2
- package/dist/react/filters/phone.mjs +2 -2
- package/dist/react/filters/values.mjs +4 -4
- package/dist/react/format-time.d.mts +1 -0
- package/dist/react/format-time.mjs +39 -33
- package/dist/react/format.mjs +10 -1
- package/dist/react/renderers/list.mjs +8 -10
- package/dist/react/renderers/table-cells.mjs +38 -9
- package/dist/react/renderers/table-measure.mjs +2 -0
- package/dist/react/renderers/table-row.mjs +64 -7
- package/dist/react/renderers/table-sort.mjs +2 -8
- package/dist/react/renderers/table.mjs +16 -15
- package/dist/react/theme-unlayered.css +1 -3148
- package/dist/react/theme.css +1 -3150
- package/dist/recharts/parts.mjs +1 -1
- package/dist/skills/derive-dashboards/SKILL.md +4 -2
- package/dist/store/apply.mjs +2 -2
- package/dist/store/editor.mjs +2 -2
- package/dist/store/writer.mjs +2 -2
- package/package.json +1 -1
package/dist/recharts/parts.mjs
CHANGED
|
@@ -80,7 +80,7 @@ const TOOLTIP = {
|
|
|
80
80
|
contentStyle: {
|
|
81
81
|
background: "var(--dd-surface)",
|
|
82
82
|
border: "1px solid var(--dd-line)",
|
|
83
|
-
borderRadius: "var(--dd-radius)",
|
|
83
|
+
borderRadius: "var(--dd-tooltip-radius, 5px)",
|
|
84
84
|
color: "var(--dd-ink)"
|
|
85
85
|
},
|
|
86
86
|
labelStyle: { color: "var(--dd-muted)" },
|
|
@@ -59,10 +59,12 @@ app (Base UI or Radix), `npx derive-dashboards add filter-bar`.
|
|
|
59
59
|
A widget's `kind` picks its tile (`number`, `table`, `list`, `line`, `bar`) and its `display`
|
|
60
60
|
sets that tile's options, each typed (`docs/react.md`, Lists, Numbers and Tables). A number
|
|
61
61
|
takes `value` and `secondary` (which entry is large, and a second figure under it); a table
|
|
62
|
-
takes `bars`, `heat
|
|
62
|
+
takes `bars`, `heat`, `compact` and `comparisons`. For example, `comparisons: { Discount:
|
|
63
|
+
["shown.coupon", "shown.plan"] }` opens the selected row by coupon, then by plan. Keys match
|
|
64
|
+
raw group values exactly. Put free-text fields in the source’s `drill.prefer`. An option
|
|
63
65
|
names a query entry by its own id, and a wrong name stops the server with the names it could
|
|
64
66
|
be. On a dashboard in code, `display: { ... } satisfies DisplayOf<"table">` has the compiler
|
|
65
|
-
check an option's name and type. Every tile with rows has a CSV button;
|
|
67
|
+
check an option's name and type. A custom renderer opens the group with `drill.compare`. A host can catch `DashboardDocumentError` to read startup validation issues. Every tile with rows has a CSV button;
|
|
66
68
|
`<DashboardsProvider csv={false}>` leaves it out, and `downloadCsv(title, csvOf(answer, messages))`
|
|
67
69
|
saves the same file from a button of your own.
|
|
68
70
|
|
package/dist/store/apply.mjs
CHANGED
|
@@ -56,7 +56,7 @@ function summed(row, current, fresh) {
|
|
|
56
56
|
* nothing, a refused command refuses the batch with its reason. The commands are kept, in
|
|
57
57
|
* order, so a publish on top of someone else's version can replay them.
|
|
58
58
|
*/
|
|
59
|
-
function applyDraft(db, a) {
|
|
59
|
+
function applyDraft(db, a, model) {
|
|
60
60
|
return inTransaction(db, async (tx) => {
|
|
61
61
|
const { row } = await openDraft(tx, a);
|
|
62
62
|
const { fresh, acknowledged } = await newCommands(tx, row.id, a.commands);
|
|
@@ -68,7 +68,7 @@ function applyDraft(db, a) {
|
|
|
68
68
|
expectRevision(row, a.expectedRevision);
|
|
69
69
|
const outcome = reduceAll(current.doc, fresh.map((c) => bodyOf(c)));
|
|
70
70
|
if (!outcome.ok) throw new HttpError(400, "EDIT_REFUSED", outcome.issue.message, { issues: [outcome.issue] });
|
|
71
|
-
const wrong = editedDisplayIssues(current.doc, outcome.doc);
|
|
71
|
+
const wrong = editedDisplayIssues(current.doc, outcome.doc, model);
|
|
72
72
|
if (wrong[0] !== void 0) throw new HttpError(400, "EDIT_REFUSED", wrong[0].message, { issues: wrong });
|
|
73
73
|
const revision = current.revision + 1;
|
|
74
74
|
const at = now();
|
package/dist/store/editor.mjs
CHANGED
|
@@ -6,14 +6,14 @@ import { undo } from "./undo.mjs";
|
|
|
6
6
|
import { unpublished } from "./unpublished.mjs";
|
|
7
7
|
// src/store/editor.ts
|
|
8
8
|
/** A person's or an agent's own draft: opened, edited, stepped back, dropped. */
|
|
9
|
-
function draftMethods(db) {
|
|
9
|
+
function draftMethods(db, model) {
|
|
10
10
|
return {
|
|
11
11
|
getDraft: async (a) => {
|
|
12
12
|
const row = await dashboardRow(db, a.tenant, { id: a.id }) === null ? null : await draftRow(db, a.id, a.author);
|
|
13
13
|
return row === null || row.state !== "open" ? null : draftOf(row);
|
|
14
14
|
},
|
|
15
15
|
startDraft: (a) => startDraft(db, a),
|
|
16
|
-
applyDraft: (a) => applyDraft(db, a),
|
|
16
|
+
applyDraft: (a) => applyDraft(db, a, model),
|
|
17
17
|
discardDraft: (a) => discardDraft(db, a),
|
|
18
18
|
unpublished: (a) => unpublished(db, a),
|
|
19
19
|
undo: (a) => undo(db, a)
|
package/dist/store/writer.mjs
CHANGED
|
@@ -6,13 +6,13 @@ import { createReader } from "./reader.mjs";
|
|
|
6
6
|
* The store over any adapter: the read path, drafts, and publishing. Every write is one
|
|
7
7
|
* transaction on the adapter; every lookup is by the tenant's hash and checks the stored tenant.
|
|
8
8
|
*/
|
|
9
|
-
function createStore(db) {
|
|
9
|
+
function createStore(db, model) {
|
|
10
10
|
const reader = createReader(db);
|
|
11
11
|
return {
|
|
12
12
|
get: (a) => reader.get(a),
|
|
13
13
|
list: (a) => reader.list(a),
|
|
14
14
|
getVersion: (a) => reader.getVersion(a),
|
|
15
|
-
...draftMethods(db),
|
|
15
|
+
...draftMethods(db, model),
|
|
16
16
|
...publishMethods(db)
|
|
17
17
|
};
|
|
18
18
|
}
|
package/package.json
CHANGED