@object-ui/plugin-charts 17.1.0 → 17.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +170 -0
- package/dist/AdvancedChartImpl.d.ts +2 -2
- package/dist/ChartContainerImpl.d.ts +19 -3
- package/dist/index.js +470 -451
- package/dist/index.umd.cjs +2 -2
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,175 @@
|
|
|
1
1
|
# @object-ui/plugin-charts
|
|
2
2
|
|
|
3
|
+
## 17.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9e9e9a9: `DrillDownConfig` now declares only keys a renderer reads, and `target: 'navigate'` is honoured on charts too (#3354).
|
|
8
|
+
|
|
9
|
+
**Removed — two keys no renderer has ever read.** `DrillDownConfig.view` (self-described as "reserved") and `DrillDownConfig.sort` ("default sort applied to the drill list") had zero read sites repo-wide: the drill drawer rendered its inline `object-data-table` regardless of `view`, and no widget put `sort` into the drilled table schema. Authoring either did nothing, silently. They are removed rather than implemented because nothing asked for them, and this interface is the shape the protocol's own `drillDown` declaration is being derived from (objectstack#5022) — left in place, they were about to become dead keys carrying protocol authority. Removing a declared key from a published interface is technically breaking for anyone who wrote one, but only in the sense that TypeScript now reports what was already true at runtime: the key did nothing. Per this repo's version policy the bump stays `minor` (the fixed release group tracks `@objectstack`'s major). A compile-time pin in `@object-ui/types` keeps both keys from drifting back without a reader.
|
|
10
|
+
|
|
11
|
+
**Fixed — `ObjectChart` no longer degrades `target: 'navigate'` to a drawer.** All five widgets share `DrillDownConfig`, whose `target` JSDoc promises `'navigate'` skips the in-place view and opens the object's full list page when the host provides drill navigation. `DrillDownDrawer` delivered that for the table / pivot / metric widgets, but `ObjectChart` draws its own drawer and branched on `'dialog'` only — so `'navigate'` fell through to the default side sheet, indistinguishable from `'drawer'` even with a host handler wired. The chart now routes `'navigate'` through `DrillNavigationContext.openRecordList` with the same merged filter the drawer would have used, and keeps the documented fallback: with no host navigation handler it degrades to the drawer. `'drawer'` / `'dialog'` behaviour is unchanged, and the header's "Open in list" escape hatch stays independent of `target`.
|
|
12
|
+
|
|
13
|
+
The `object-chart` registry input deliberately keeps advertising `target: 'drawer' | 'dialog'` only. `ChartDrillDownSchema` in `@objectstack/spec` declares the chart drill target as those two, strictly, and the publish-time react-page lint parses that schema against the authored literal — so listing `'navigate'` in the designer palette would offer authors a value the publish gate rejects. Widening the protocol union is a spec-side follow-up (objectstack#5435); `'navigate'` works today for any host that composes an `object-chart` schema directly.
|
|
14
|
+
|
|
15
|
+
- 524a635: `<ObjectChart>` declares `drillDown` as a registry input, so the SDUI save gate treats the segment drill as a contract prop instead of an unknown one (framework#5022).
|
|
16
|
+
|
|
17
|
+
The component has read `schema.drillDown` all along — it is what opens the drawer of underlying records when you click a bar or a slice — but the prop was declared in neither the protocol nor this registry entry. The manifest the save gate validates page JSX against is built verbatim from these `inputs`, so an author who wrote the drill got an `unknown-prop` diagnostic for a prop that works. `@objectstack/spec` now declares the shape (`ChartDrillDownSchema`, published on the react-tier `<ObjectChart>` contract); this is the renderer half.
|
|
18
|
+
|
|
19
|
+
The published input describes the six keys the spec declares — `enabled`, `filter`, `title`, `target` (`'drawer' | 'dialog'`), `columns`, `maxRows` — and deliberately not the wider `DrillDownConfig` this repo shares with the table / pivot / metric widgets: `ObjectChart` reads none of `mode` / `report` / `view` / `sort`, and does not implement `target: 'navigate'` (it renders the drawer instead — objectui#3354).
|
|
20
|
+
|
|
21
|
+
The untyped `(schema as any).drillDown` read is now typed as `DrillDownConfig`. Narrowing it to the spec's `ChartDrillDown` is left as a TODO on the version pin: `@objectstack/spec` is pinned at `^17.0.0-rc.2` here and the declaration lands in the next rc, and re-declaring the shape locally would be the fork that lets the two drift.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [18cd432]
|
|
26
|
+
- Updated dependencies [532cf8b]
|
|
27
|
+
- Updated dependencies [680080a]
|
|
28
|
+
- Updated dependencies [a7651e6]
|
|
29
|
+
- Updated dependencies [d915c47]
|
|
30
|
+
- Updated dependencies [b71fc92]
|
|
31
|
+
- Updated dependencies [65516ba]
|
|
32
|
+
- Updated dependencies [94c5b7c]
|
|
33
|
+
- Updated dependencies [ca0fa8f]
|
|
34
|
+
- Updated dependencies [34595eb]
|
|
35
|
+
- Updated dependencies [3889ffb]
|
|
36
|
+
- Updated dependencies [5781fb1]
|
|
37
|
+
- Updated dependencies [7e2406a]
|
|
38
|
+
- Updated dependencies [9e9e9a9]
|
|
39
|
+
- Updated dependencies [56409c2]
|
|
40
|
+
- Updated dependencies [042e09d]
|
|
41
|
+
- Updated dependencies [9cbcbf4]
|
|
42
|
+
- Updated dependencies [85c4c9c]
|
|
43
|
+
- Updated dependencies [fd54c3e]
|
|
44
|
+
- Updated dependencies [4eeb932]
|
|
45
|
+
- Updated dependencies [5c856ec]
|
|
46
|
+
- Updated dependencies [23018cc]
|
|
47
|
+
- Updated dependencies [53811d1]
|
|
48
|
+
- Updated dependencies [68b6a28]
|
|
49
|
+
- Updated dependencies [0554e88]
|
|
50
|
+
- Updated dependencies [d915c47]
|
|
51
|
+
- Updated dependencies [f44d872]
|
|
52
|
+
- Updated dependencies [28b2e65]
|
|
53
|
+
- Updated dependencies [509104a]
|
|
54
|
+
- Updated dependencies [825bbe3]
|
|
55
|
+
- Updated dependencies [6195841]
|
|
56
|
+
- Updated dependencies [5dd0127]
|
|
57
|
+
- Updated dependencies [06632e9]
|
|
58
|
+
- Updated dependencies [a415684]
|
|
59
|
+
- Updated dependencies [a4cff5b]
|
|
60
|
+
- Updated dependencies [175bd79]
|
|
61
|
+
- Updated dependencies [5af2852]
|
|
62
|
+
- Updated dependencies [f833d3a]
|
|
63
|
+
- Updated dependencies [a6ec93d]
|
|
64
|
+
- Updated dependencies [2a9513d]
|
|
65
|
+
- Updated dependencies [71be406]
|
|
66
|
+
- Updated dependencies [d22ae31]
|
|
67
|
+
- Updated dependencies [c7ed4c3]
|
|
68
|
+
- Updated dependencies [2409e1d]
|
|
69
|
+
- Updated dependencies [789fe3e]
|
|
70
|
+
- Updated dependencies [8d8094a]
|
|
71
|
+
- @object-ui/core@17.3.0
|
|
72
|
+
- @object-ui/components@17.3.0
|
|
73
|
+
- @object-ui/types@17.3.0
|
|
74
|
+
- @object-ui/i18n@17.3.0
|
|
75
|
+
- @object-ui/react@17.3.0
|
|
76
|
+
|
|
77
|
+
## 17.2.0
|
|
78
|
+
|
|
79
|
+
### Minor Changes
|
|
80
|
+
|
|
81
|
+
- 4a51e77: Stop declaring 14 symbols across ten packages under names `@objectstack/spec`
|
|
82
|
+
owns (objectui#3161, objectstack#4115 batch 7 — the long tail, one or two
|
|
83
|
+
entries per package). All ten packages leave the ledger, which drops from 17
|
|
84
|
+
collisions across 11 packages to 3 across 1.
|
|
85
|
+
|
|
86
|
+
**Renamed exports** — in every case the spec exports the same name for a
|
|
87
|
+
_different_ thing, so the old name was a mis-description rather than a dialect:
|
|
88
|
+
|
|
89
|
+
| package | was | now | what the spec's same-named export is |
|
|
90
|
+
| :------------------------- | :--------------------------------- | :--------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
91
|
+
| `@object-ui/fields` | `FieldWidgetProps` | `FieldWidgetComponentProps` | the DECLARED field-widget plugin props contract (a zod object; `field.type` is the `FieldType` enum, `readonly`/`required` carry defaults) |
|
|
92
|
+
| `@object-ui/layout` | `PageHeaderProps` | `PageHeaderComponentProps` | the authored `page:header` node — a zod schema of `title`, `subtitle`, an icon NAME, `breadcrumb`, `actions: string[]` |
|
|
93
|
+
| `@object-ui/layout` | `Page` | `PageNodeRenderer` | the authored page metadata DOCUMENT (`name`, `label`, `type`, `regions`) |
|
|
94
|
+
| `@object-ui/plugin-detail` | `ObjectFieldLike` | `ObjectDefFieldLike` | the i18n duck type `translateObject` walks (`help`/`description`, plus `[key: string]: any`) |
|
|
95
|
+
| `@object-ui/plugin-grid` | `ColumnSummaryConfig` | `ColumnSummarySetting` | the OBJECT form of `ListColumn.summary` **only** — the local one was the whole union, shorthand included |
|
|
96
|
+
| `@object-ui/plugin-grid` | `isMultiValueField` | `hasMultiValueShape` | the spec's classifier, which requires a def with a `type`; the local one is called with `undefined` |
|
|
97
|
+
| `@object-ui/collaboration` | `RealtimeConfig` | `RealtimeSubscriptionConfig` | the app's realtime DECLARATION (`enabled`, `transport`, `subscriptions[]`) |
|
|
98
|
+
| `@object-ui/plugin-charts` | `ChartConfig` | `ChartContainerConfig` | the authored chart document (`type`, `xAxis`, `series`, `showLegend`, …) |
|
|
99
|
+
| `@object-ui/plugin-form` | `FormSection` / `FormSectionProps` | `FormSectionContainer` / `FormSectionContainerProps` | the authored form-section metadata (`name`, `pane`, `visibleWhen`, `fields`) |
|
|
100
|
+
| `@object-ui/providers` | `Theme` | `ThemePreference` | a whole theme DOCUMENT (`name`, `label`, `colors`, `typography`) |
|
|
101
|
+
| `@object-ui/runner` | `App` (default export) | `RunnerApp` | the authored application metadata type **and** the `App.create()` builder |
|
|
102
|
+
| `@object-ui/sdui-parser` | `ValidationResult` | `ManifestValidationResult` | plugin-manifest validation (`{ valid, errors?, warnings? }`), exported from both `kernel` and `contracts` |
|
|
103
|
+
|
|
104
|
+
`ManifestValidationResult` follows the `<what was validated>Validation<Error|Result>`
|
|
105
|
+
convention registered on objectstack#4115 (`@object-ui/core` took
|
|
106
|
+
`SchemaNodeValidationResult` in batch 4). `PageHeaderComponentProps` deliberately
|
|
107
|
+
reuses the name `@object-ui/app-shell` already chose for its own header props in
|
|
108
|
+
batch 3, so one concept does not acquire two dialect names one package apart.
|
|
109
|
+
|
|
110
|
+
**Now derived from the spec instead of hand-written:**
|
|
111
|
+
|
|
112
|
+
- `@object-ui/fields` — `isFileIdToken` is re-exported from
|
|
113
|
+
`@objectstack/spec/data`. The local copy was character-for-character identical
|
|
114
|
+
to the spec's function while its comment said it "mirrors" it, so every
|
|
115
|
+
behaviour test passed and only reference identity could tell the two apart.
|
|
116
|
+
The regex is a wire decision: widening it server-side while a copy here kept
|
|
117
|
+
the old bound would make every new id read as "not a reference", and the
|
|
118
|
+
widget would submit the legacy inline blob to a backend expecting a reference.
|
|
119
|
+
- `@object-ui/plugin-detail` — `FeedFilterMode` is re-exported from
|
|
120
|
+
`@objectstack/spec/data`, in a file that already imported the sibling
|
|
121
|
+
`FeedItemType` from the spec.
|
|
122
|
+
- `@object-ui/plugin-grid` — the eleven-member aggregation union is now the
|
|
123
|
+
spec's `ColumnSummary` enum, so the total `Record<ColumnSummaryType, string>`
|
|
124
|
+
label map turns a member the spec adds into a compile error instead of a
|
|
125
|
+
blank footer cell. `ColumnSummarySetting` is `NonNullable<ListColumn['summary']>`,
|
|
126
|
+
i.e. whatever forms the spec itself accepts. `hasMultiValueShape` delegates to
|
|
127
|
+
the spec's `isMultiValueField` rather than re-deriving it from
|
|
128
|
+
`MULTI_OPTION_TYPES` / `MULTI_CAPABLE_TYPES`.
|
|
129
|
+
- `@object-ui/providers` — `ThemePreference` is the spec's `ThemeMode` union
|
|
130
|
+
plus the one legacy `'system'` spelling this provider still honours for stored
|
|
131
|
+
preferences, read off the schema's own `_zod` carrier so the package takes no
|
|
132
|
+
zod dependency.
|
|
133
|
+
|
|
134
|
+
`@objectstack/spec` moves from `devDependencies` to `dependencies` in
|
|
135
|
+
`@object-ui/fields` (it re-exports a runtime function) and `@object-ui/providers`
|
|
136
|
+
(its public `.d.ts` now references the spec).
|
|
137
|
+
|
|
138
|
+
Scored `minor`, not `major`, per this repo's fixed-group rule — objectui's major
|
|
139
|
+
tracks `@objectstack`, so breaking changes of our own ship as minor with the
|
|
140
|
+
semantics spelled out above (see AGENTS.md §版本号策略). A `major` here would carry
|
|
141
|
+
all 39 packages of the fixed group to `18.0.0` and off objectstack's 17.x line.
|
|
142
|
+
|
|
143
|
+
### Patch Changes
|
|
144
|
+
|
|
145
|
+
- Updated dependencies [4ae0ac4]
|
|
146
|
+
- Updated dependencies [696e3c1]
|
|
147
|
+
- Updated dependencies [bca45cc]
|
|
148
|
+
- Updated dependencies [a889e31]
|
|
149
|
+
- Updated dependencies [09d30a4]
|
|
150
|
+
- Updated dependencies [4bf612c]
|
|
151
|
+
- Updated dependencies [335041c]
|
|
152
|
+
- Updated dependencies [b414983]
|
|
153
|
+
- Updated dependencies [256f8cc]
|
|
154
|
+
- Updated dependencies [d9668a7]
|
|
155
|
+
- Updated dependencies [4b470b9]
|
|
156
|
+
- Updated dependencies [cb82705]
|
|
157
|
+
- Updated dependencies [f572849]
|
|
158
|
+
- Updated dependencies [f6e8d78]
|
|
159
|
+
- Updated dependencies [ea96284]
|
|
160
|
+
- Updated dependencies [d3584c6]
|
|
161
|
+
- Updated dependencies [a8ad6c0]
|
|
162
|
+
- Updated dependencies [444457c]
|
|
163
|
+
- Updated dependencies [850033c]
|
|
164
|
+
- Updated dependencies [022e4c3]
|
|
165
|
+
- Updated dependencies [009e25d]
|
|
166
|
+
- Updated dependencies [726b89c]
|
|
167
|
+
- @object-ui/types@17.2.0
|
|
168
|
+
- @object-ui/components@17.2.0
|
|
169
|
+
- @object-ui/core@17.2.0
|
|
170
|
+
- @object-ui/react@17.2.0
|
|
171
|
+
- @object-ui/i18n@17.2.0
|
|
172
|
+
|
|
3
173
|
## 17.1.0
|
|
4
174
|
|
|
5
175
|
### Minor Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChartContainerConfig } from './ChartContainerImpl';
|
|
2
2
|
import { NormalizedAxis, NormalizedSeries } from './normalizeChartSchema';
|
|
3
3
|
/**
|
|
4
4
|
* ObjectUI
|
|
@@ -16,7 +16,7 @@ export interface AdvancedChartImplProps {
|
|
|
16
16
|
*/
|
|
17
17
|
chartType?: 'bar' | 'column' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut' | 'radar' | 'scatter' | 'funnel' | 'combo' | 'treemap' | 'sankey';
|
|
18
18
|
data?: Array<Record<string, any>>;
|
|
19
|
-
config?:
|
|
19
|
+
config?: ChartContainerConfig;
|
|
20
20
|
xAxisKey?: string;
|
|
21
21
|
/**
|
|
22
22
|
* Plotted series, in the renderer's internal shape. Authors write the spec
|
|
@@ -11,7 +11,23 @@ declare const THEMES: {
|
|
|
11
11
|
readonly light: "";
|
|
12
12
|
readonly dark: ".dark";
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Per-series presentation for `<ChartContainer>`: a map from series dataKey to
|
|
16
|
+
* the legend label, icon and colour (or per-theme colours) that key renders
|
|
17
|
+
* with. Shadcn's chart primitive, kept in this package's own copy of it.
|
|
18
|
+
*
|
|
19
|
+
* Named `ChartContainerConfig`, not `ChartConfig` (objectui#3161,
|
|
20
|
+
* objectstack#4115 ledger batch 7). `@objectstack/spec/ui` owns `ChartConfig`
|
|
21
|
+
* for the authored chart METADATA — `type: bar | line | pie | …`, `xAxis`,
|
|
22
|
+
* `yAxis`, `series`, `showLegend`, `annotations` — and the collision was not
|
|
23
|
+
* theoretical here: `AdvancedChartImpl.tsx` declares `config?: ChartConfig`
|
|
24
|
+
* meaning THIS map, three lines above doc comments that say "Spec
|
|
25
|
+
* `ChartConfig.yAxis`" and "Spec `ChartConfig.showLegend`" meaning the other
|
|
26
|
+
* one. One identifier, two concepts, one file. `normalizeChartSchema` is the
|
|
27
|
+
* seam between them: it reads the authored spec chart and produces the
|
|
28
|
+
* renderer's axes/series, of which this map is the styling half.
|
|
29
|
+
*/
|
|
30
|
+
export type ChartContainerConfig = {
|
|
15
31
|
[k in string]: {
|
|
16
32
|
label?: React.ReactNode;
|
|
17
33
|
icon?: React.ComponentType;
|
|
@@ -24,7 +40,7 @@ export type ChartConfig = {
|
|
|
24
40
|
});
|
|
25
41
|
};
|
|
26
42
|
declare function ChartContainer({ id, className, children, config, disableSettleRemount, ...props }: React.ComponentProps<"div"> & {
|
|
27
|
-
config:
|
|
43
|
+
config: ChartContainerConfig;
|
|
28
44
|
children: React.ComponentProps<typeof ResponsiveContainer>["children"];
|
|
29
45
|
/**
|
|
30
46
|
* Skip the settle re-mount below. Set by callers that render their series with
|
|
@@ -36,7 +52,7 @@ declare function ChartContainer({ id, className, children, config, disableSettle
|
|
|
36
52
|
}): React.JSX.Element;
|
|
37
53
|
declare const ChartStyle: ({ id, config }: {
|
|
38
54
|
id: string;
|
|
39
|
-
config:
|
|
55
|
+
config: ChartContainerConfig;
|
|
40
56
|
}) => React.JSX.Element | null;
|
|
41
57
|
declare const ChartTooltip: typeof Tooltip;
|
|
42
58
|
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: any): React.JSX.Element | null;
|