@malloy-publisher/sdk 0.3.0 → 0.4.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/README.md +22 -9
- package/dist/DocumentStorageProvider-CyOJ0hqf.es.js +24443 -0
- package/dist/DocumentStorageProvider-DGPQEd_l.cjs.js +134 -0
- package/dist/RenderedResult-BnPzJ9Jf.es.js +549 -0
- package/dist/RenderedResult-Dp22kZsQ.cjs.js +115 -0
- package/dist/{ServerProvider-DSK9rfSY.es.js → ServerProvider-BWOEKg0O.es.js} +1256 -1318
- package/dist/ServerProvider-Cc489A3f.cjs.js +1 -0
- package/dist/builder/index.cjs.js +105 -0
- package/dist/builder/index.d.ts +2 -0
- package/dist/builder/index.es.js +9482 -0
- package/dist/builder-entry.d.ts +8 -0
- package/dist/client/api.d.ts +100 -42
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/AppDialog.d.ts +30 -0
- package/dist/components/BackLink.d.ts +32 -0
- package/dist/components/Dashboard/Dashboard.d.ts +19 -14
- package/dist/components/Dashboard/DashboardBar.d.ts +21 -0
- package/dist/components/Dashboard/DashboardGrid.d.ts +67 -0
- package/dist/components/Dashboard/DashboardTile.d.ts +6 -1
- package/dist/components/Dashboard/ExploreDialog.d.ts +18 -0
- package/dist/components/Dashboard/RowsDialog.d.ts +47 -0
- package/dist/components/Dashboard/TileCard.d.ts +44 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/Dashboard/promoteMeasureRow.d.ts +7 -3
- package/dist/components/Dashboard/telemetry.d.ts +48 -0
- package/dist/components/DashboardBuilder/AddTileDialog.d.ts +35 -0
- package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +31 -0
- package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +118 -0
- package/dist/components/DashboardBuilder/DashboardEditor.d.ts +30 -0
- package/dist/components/DashboardBuilder/DiffDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/DrillDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/FilterDialog.d.ts +54 -0
- package/dist/components/DashboardBuilder/FilterStrip.d.ts +17 -0
- package/dist/components/DashboardBuilder/SettingsPopover.d.ts +20 -0
- package/dist/components/DashboardBuilder/TileFrame.d.ts +42 -0
- package/dist/components/DashboardBuilder/TileMenu.d.ts +24 -0
- package/dist/components/DashboardBuilder/catalog.d.ts +62 -0
- package/dist/components/DashboardBuilder/controls.d.ts +157 -0
- package/dist/components/DashboardBuilder/diff.d.ts +35 -0
- package/dist/components/DashboardBuilder/document.d.ts +218 -0
- package/dist/components/DashboardBuilder/layout.d.ts +71 -0
- package/dist/components/DashboardBuilder/malloyText.d.ts +45 -0
- package/dist/components/DashboardBuilder/newDashboard.d.ts +17 -0
- package/dist/components/DashboardBuilder/preview.d.ts +60 -0
- package/dist/components/DashboardBuilder/readDocument.d.ts +106 -0
- package/dist/components/DashboardBuilder/sortable.d.ts +51 -0
- package/dist/components/DashboardBuilder/spliceDocument.d.ts +53 -0
- package/dist/components/DashboardBuilder/testing/fixtures.d.ts +10 -0
- package/dist/components/DashboardBuilder/useBuilderShortcuts.d.ts +22 -0
- package/dist/components/DashboardBuilder/useDashboardEditor.d.ts +63 -0
- package/dist/components/DashboardBuilder/useDraft.d.ts +13 -0
- package/dist/components/DashboardBuilder/useFilterForm.d.ts +65 -0
- package/dist/components/DashboardBuilder/useTileReorder.d.ts +22 -0
- package/dist/components/DashboardBuilder/useTileResize.d.ts +29 -0
- package/dist/components/DocumentStorage/DocumentStorageProvider.d.ts +7 -0
- package/dist/components/DocumentStorage/index.d.ts +1 -1
- package/dist/components/FloatingIconButton.d.ts +16 -0
- package/dist/components/ItemRow.d.ts +38 -0
- package/dist/components/Materializations/MaterializationDetailDialog.d.ts +1 -2
- package/dist/components/Materializations/MaterializationRunsList.d.ts +1 -5
- package/dist/components/Materializations/Materializations.d.ts +7 -3
- package/dist/components/Materializations/ScopeButton.d.ts +18 -0
- package/dist/components/Materializations/SectionLabel.d.ts +7 -4
- package/dist/components/Materializations/TriggerLabel.d.ts +14 -0
- package/dist/components/Materializations/index.d.ts +0 -1
- package/dist/components/Package/ContentTypeIcon.d.ts +3 -5
- package/dist/components/Package/NewDashboardDialog.d.ts +18 -0
- package/dist/components/Package/index.d.ts +0 -1
- package/dist/components/PackageSection.d.ts +23 -0
- package/dist/components/Prose.d.ts +46 -0
- package/dist/components/RenderedResult/ResultPanel.d.ts +30 -0
- package/dist/components/RenderedResult/index.d.ts +1 -0
- package/dist/components/buttons.d.ts +53 -0
- package/dist/components/drill/index.d.ts +1 -1
- package/dist/components/drill/resolveDrill.d.ts +22 -0
- package/dist/components/drill/useDrill.d.ts +11 -2
- package/dist/components/index.d.ts +6 -0
- package/dist/components/styles.d.ts +49 -44
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useCrudMutation.d.ts +42 -0
- package/dist/hooks/useDocumentControls.d.ts +70 -0
- package/dist/hooks/useQueryResult.d.ts +40 -0
- package/dist/index.cjs.js +22 -273
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +16888 -44451
- package/dist/telemetry/consoleEvents.d.ts +60 -0
- package/dist/utils/malloyLiteral.d.ts +11 -0
- package/dist/utils/sha256.d.ts +2 -0
- package/package.json +24 -9
- package/src/builder-entry.ts +55 -0
- package/src/components/AppDialog.tsx +115 -0
- package/src/components/BackLink.tsx +83 -0
- package/src/components/Connections/AddConnectionDialog.tsx +50 -70
- package/src/components/Connections/DeleteConnectionDialog.tsx +23 -50
- package/src/components/Connections/EditConnectionDialog.tsx +54 -73
- package/src/components/Dashboard/Dashboard.spec.tsx +7 -10
- package/src/components/Dashboard/Dashboard.tsx +165 -175
- package/src/components/Dashboard/DashboardBar.tsx +88 -0
- package/src/components/Dashboard/DashboardGrid.tsx +124 -0
- package/src/components/Dashboard/DashboardTile.spec.tsx +30 -6
- package/src/components/Dashboard/DashboardTile.tsx +66 -123
- package/src/components/Dashboard/ExploreDialog.tsx +84 -0
- package/src/components/Dashboard/RowsDialog.spec.ts +42 -0
- package/src/components/Dashboard/RowsDialog.tsx +234 -0
- package/src/components/Dashboard/TileCard.tsx +120 -0
- package/src/components/Dashboard/index.ts +2 -0
- package/src/components/Dashboard/promoteMeasureRow.spec.ts +70 -0
- package/src/components/Dashboard/promoteMeasureRow.ts +33 -2
- package/src/components/Dashboard/telemetry.ts +51 -0
- package/src/components/Dashboard/tileGridColumn.spec.ts +1 -1
- package/src/components/DashboardBuilder/AddTileDialog.tsx +247 -0
- package/src/components/DashboardBuilder/BuilderToolbar.tsx +162 -0
- package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +852 -0
- package/src/components/DashboardBuilder/DashboardBuilder.tsx +666 -0
- package/src/components/DashboardBuilder/DashboardEditor.package.spec.tsx +163 -0
- package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +188 -0
- package/src/components/DashboardBuilder/DashboardEditor.tsx +567 -0
- package/src/components/DashboardBuilder/DiffDialog.tsx +122 -0
- package/src/components/DashboardBuilder/DrillDialog.tsx +269 -0
- package/src/components/DashboardBuilder/FilterDialog.tsx +562 -0
- package/src/components/DashboardBuilder/FilterStrip.tsx +126 -0
- package/src/components/DashboardBuilder/SettingsPopover.tsx +168 -0
- package/src/components/DashboardBuilder/TileFrame.tsx +380 -0
- package/src/components/DashboardBuilder/TileMenu.tsx +188 -0
- package/src/components/DashboardBuilder/catalog.spec.ts +215 -0
- package/src/components/DashboardBuilder/catalog.ts +225 -0
- package/src/components/DashboardBuilder/controls.spec.ts +243 -0
- package/src/components/DashboardBuilder/controls.ts +398 -0
- package/src/components/DashboardBuilder/diff.spec.ts +44 -0
- package/src/components/DashboardBuilder/diff.ts +93 -0
- package/src/components/DashboardBuilder/document.ts +209 -0
- package/src/components/DashboardBuilder/keepRowStructure.spec.ts +84 -0
- package/src/components/DashboardBuilder/layout.ts +143 -0
- package/src/components/DashboardBuilder/malloyText.spec.ts +84 -0
- package/src/components/DashboardBuilder/malloyText.ts +151 -0
- package/src/components/DashboardBuilder/moveIntoGap.spec.ts +90 -0
- package/src/components/DashboardBuilder/newDashboard.spec.ts +40 -0
- package/src/components/DashboardBuilder/newDashboard.ts +48 -0
- package/src/components/DashboardBuilder/preview.spec.ts +149 -0
- package/src/components/DashboardBuilder/preview.ts +172 -0
- package/src/components/DashboardBuilder/readDocument.spec.ts +375 -0
- package/src/components/DashboardBuilder/readDocument.ts +467 -0
- package/src/components/DashboardBuilder/sortable.tsx +151 -0
- package/src/components/DashboardBuilder/spliceDocument.spec.ts +1161 -0
- package/src/components/DashboardBuilder/spliceDocument.ts +1135 -0
- package/src/components/DashboardBuilder/testing/fixtures.ts +48 -0
- package/src/components/DashboardBuilder/useBuilderShortcuts.ts +88 -0
- package/src/components/DashboardBuilder/useDashboardEditor.spec.ts +311 -0
- package/src/components/DashboardBuilder/useDashboardEditor.ts +201 -0
- package/src/components/DashboardBuilder/useDraft.ts +43 -0
- package/src/components/DashboardBuilder/useFilterForm.spec.tsx +144 -0
- package/src/components/DashboardBuilder/useFilterForm.ts +352 -0
- package/src/components/DashboardBuilder/useTileReorder.spec.tsx +97 -0
- package/src/components/DashboardBuilder/useTileReorder.ts +115 -0
- package/src/components/DashboardBuilder/useTileResize.spec.tsx +121 -0
- package/src/components/DashboardBuilder/useTileResize.ts +110 -0
- package/src/components/DashboardBuilder/withGaps.spec.ts +96 -0
- package/src/components/DocumentStorage/DocumentStorageProvider.tsx +12 -0
- package/src/components/DocumentStorage/index.ts +1 -0
- package/src/components/Environment/About.tsx +16 -62
- package/src/components/Environment/AddPackageDialog.tsx +85 -154
- package/src/components/Environment/Connections.tsx +125 -205
- package/src/components/Environment/DeletePackageDialog.tsx +32 -77
- package/src/components/Environment/EditPackageDialog.tsx +46 -58
- package/src/components/Environment/Environment.tsx +34 -36
- package/src/components/Environment/Packages.tsx +63 -128
- package/src/components/FloatingIconButton.tsx +41 -0
- package/src/components/Home/AddEnvironmentDialog.tsx +47 -70
- package/src/components/Home/DeleteEnvironmentDialog.tsx +32 -77
- package/src/components/Home/EditEnvironmentDialog.tsx +47 -61
- package/src/components/Home/Home.tsx +101 -214
- package/src/components/ItemRow.tsx +165 -0
- package/src/components/Materializations/CreateMaterializationDialog.tsx +34 -51
- package/src/components/Materializations/DeleteMaterializationDialog.tsx +31 -53
- package/src/components/Materializations/MaterializationDetailDialog.tsx +60 -69
- package/src/components/Materializations/MaterializationRunsList.tsx +29 -42
- package/src/components/Materializations/Materializations.tsx +137 -140
- package/src/components/Materializations/ScopeButton.tsx +85 -0
- package/src/components/Materializations/SectionLabel.tsx +7 -4
- package/src/components/Materializations/SetScheduleDialog.tsx +48 -89
- package/src/components/Materializations/TriggerLabel.tsx +36 -0
- package/src/components/Materializations/cron.spec.ts +113 -0
- package/src/components/Materializations/index.ts +0 -1
- package/src/components/Materializations/utils.spec.ts +182 -0
- package/src/components/Model/Model.tsx +6 -23
- package/src/components/Model/ModelCell.tsx +33 -72
- package/src/components/Notebook/Notebook.tsx +25 -88
- package/src/components/Notebook/NotebookCell.tsx +35 -183
- package/src/components/Package/ContentTypeIcon.spec.ts +22 -37
- package/src/components/Package/ContentTypeIcon.tsx +10 -12
- package/src/components/Package/NewDashboardDialog.spec.tsx +129 -0
- package/src/components/Package/NewDashboardDialog.tsx +265 -0
- package/src/components/Package/Package.tsx +179 -238
- package/src/components/Package/index.ts +0 -1
- package/src/components/PackageSection.tsx +85 -0
- package/src/components/Prose.spec.tsx +85 -0
- package/src/components/Prose.tsx +179 -0
- package/src/components/QueryResult/QueryResult.tsx +15 -43
- package/src/components/RenderedResult/RenderedResult.lifecycle.spec.tsx +198 -0
- package/src/components/RenderedResult/RenderedResult.tsx +22 -8
- package/src/components/RenderedResult/ResultContainer.tsx +4 -12
- package/src/components/RenderedResult/ResultPanel.spec.tsx +49 -0
- package/src/components/RenderedResult/ResultPanel.tsx +73 -0
- package/src/components/RenderedResult/index.ts +1 -0
- package/src/components/ResultsDialog.tsx +8 -32
- package/src/components/buttons.tsx +114 -0
- package/src/components/designSystem.spec.tsx +316 -0
- package/src/components/drill/index.ts +1 -0
- package/src/components/drill/resolveDrill.ts +22 -1
- package/src/components/drill/useDrill.spec.tsx +94 -0
- package/src/components/drill/useDrill.tsx +52 -12
- package/src/components/given/GivensPanel.tsx +1 -1
- package/src/components/given/paramCodec.spec.ts +1 -1
- package/src/components/index.ts +16 -0
- package/src/components/styles.ts +49 -122
- package/src/hooks/index.ts +13 -0
- package/src/hooks/useCrudMutation.spec.tsx +119 -0
- package/src/hooks/useCrudMutation.tsx +85 -0
- package/src/hooks/useDocumentControls.ts +170 -0
- package/src/hooks/useQueryResult.ts +82 -0
- package/src/index.ts +9 -0
- package/src/telemetry/consoleEvents.spec.ts +130 -0
- package/src/telemetry/consoleEvents.ts +124 -0
- package/src/theme/defaults.ts +34 -23
- package/src/theme/resolveTheme.spec.ts +9 -4
- package/src/theme/resolveTheme.ts +12 -8
- package/src/utils/malloyLiteral.spec.ts +43 -0
- package/src/utils/malloyLiteral.ts +76 -0
- package/src/utils/sha256.ts +13 -0
- package/test/README.md +1 -1
- package/test/serverProvider.tsx +5 -2
- package/vite.config.ts +5 -0
- package/dist/ServerProvider-CGnLjzag.cjs.js +0 -1
- package/dist/components/Materializations/CreateEnvMaterializationDialog.d.ts +0 -14
- package/dist/components/Materializations/EnvironmentMaterializations.d.ts +0 -7
- package/dist/components/Materializations/ScheduleCard.d.ts +0 -20
- package/dist/components/Materializations/TriggerChip.d.ts +0 -10
- package/dist/components/Package/Models.d.ts +0 -6
- package/src/components/Materializations/CreateEnvMaterializationDialog.tsx +0 -179
- package/src/components/Materializations/EnvironmentMaterializations.tsx +0 -267
- package/src/components/Materializations/ScheduleCard.tsx +0 -231
- package/src/components/Materializations/TriggerChip.tsx +0 -44
- package/src/components/Package/Models.tsx +0 -71
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import AddIcon from "@mui/icons-material/Add";
|
|
5
|
+
import CheckIcon from "@mui/icons-material/Check";
|
|
6
|
+
import TuneIcon from "@mui/icons-material/Tune";
|
|
7
|
+
import EditOutlinedIcon from "@mui/icons-material/EditOutlined";
|
|
8
|
+
import RedoIcon from "@mui/icons-material/Redo";
|
|
9
|
+
import UndoIcon from "@mui/icons-material/Undo";
|
|
10
|
+
import { Button, Chip, Divider, IconButton, Tooltip } from "@mui/material";
|
|
11
|
+
import type { ReactNode } from "react";
|
|
12
|
+
import { usePublisherTheme } from "../../theme/ThemeContext";
|
|
13
|
+
import { DashboardBar } from "../Dashboard/DashboardBar";
|
|
14
|
+
import { MOD } from "./useBuilderShortcuts";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The edit bar across the top of the builder: that you are editing on the
|
|
18
|
+
* left, what you can do about it on the right, in the same {@link DashboardBar}
|
|
19
|
+
* the reader's view uses, so switching modes swaps the contents of one bar
|
|
20
|
+
* rather than replacing one bar with a different one.
|
|
21
|
+
*
|
|
22
|
+
* The right-hand controls are grouped by what they do, separated rather than
|
|
23
|
+
* run together: change the page (a tile, its settings), take a change back or
|
|
24
|
+
* put it down (undo, redo, save), and leave (Done, where the reader's view has
|
|
25
|
+
* Edit). Sticky, so undo and save stay in reach on a long dashboard; the
|
|
26
|
+
* reader's own header (title and description) stays in the page below it
|
|
27
|
+
* rather than being repeated here.
|
|
28
|
+
*/
|
|
29
|
+
export interface BuilderToolbarProps {
|
|
30
|
+
canUndo: boolean;
|
|
31
|
+
canRedo: boolean;
|
|
32
|
+
onUndo: () => void;
|
|
33
|
+
onRedo: () => void;
|
|
34
|
+
dirty: boolean;
|
|
35
|
+
saving: boolean;
|
|
36
|
+
/** Absent when the builder has nowhere to save: no Save, no unsaved marker. */
|
|
37
|
+
onSave?: () => void;
|
|
38
|
+
/** The host's way out of editing: Done, at the right edge. */
|
|
39
|
+
actions?: ReactNode;
|
|
40
|
+
/** Open the add-tile picker. Absent when the host passed no catalog to pick from. */
|
|
41
|
+
onAddTile?: () => void;
|
|
42
|
+
/** Open the page's settings, anchored to the button that asked. */
|
|
43
|
+
onSettings: (anchor: HTMLElement) => void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function BuilderToolbar({
|
|
47
|
+
canUndo,
|
|
48
|
+
canRedo,
|
|
49
|
+
onUndo,
|
|
50
|
+
onRedo,
|
|
51
|
+
dirty,
|
|
52
|
+
saving,
|
|
53
|
+
onSave,
|
|
54
|
+
actions,
|
|
55
|
+
onAddTile,
|
|
56
|
+
onSettings,
|
|
57
|
+
}: BuilderToolbarProps) {
|
|
58
|
+
const { theme } = usePublisherTheme();
|
|
59
|
+
return (
|
|
60
|
+
<DashboardBar
|
|
61
|
+
left={
|
|
62
|
+
<Chip
|
|
63
|
+
// The app's theme makes every chip small; this one stands in a
|
|
64
|
+
// row of buttons, so it says otherwise and takes their height
|
|
65
|
+
// and type size. One size across the bar, or the state reads as
|
|
66
|
+
// a label that shrank away from the controls.
|
|
67
|
+
size="medium"
|
|
68
|
+
variant="outlined"
|
|
69
|
+
icon={<EditOutlinedIcon sx={{ fontSize: 20 }} />}
|
|
70
|
+
label="Editing"
|
|
71
|
+
sx={{
|
|
72
|
+
height: 37,
|
|
73
|
+
fontSize: "0.875rem",
|
|
74
|
+
fontWeight: 500,
|
|
75
|
+
// The app's own chip: the page's edge and its secondary
|
|
76
|
+
// text, not a filled blue badge borrowed from the drill
|
|
77
|
+
// link, which read as a notification rather than a state.
|
|
78
|
+
border: theme.border,
|
|
79
|
+
color: theme.tileTitle,
|
|
80
|
+
"& .MuiChip-icon": { color: "inherit" },
|
|
81
|
+
"& .MuiChip-label": { fontSize: "0.875rem" },
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
}
|
|
85
|
+
>
|
|
86
|
+
{/* What the page is made of. */}
|
|
87
|
+
{onAddTile && (
|
|
88
|
+
<Button
|
|
89
|
+
startIcon={<AddIcon />}
|
|
90
|
+
onClick={onAddTile}
|
|
91
|
+
aria-label="Add tile"
|
|
92
|
+
>
|
|
93
|
+
Tile
|
|
94
|
+
</Button>
|
|
95
|
+
)}
|
|
96
|
+
<Button
|
|
97
|
+
startIcon={<TuneIcon />}
|
|
98
|
+
onClick={(event) => onSettings(event.currentTarget)}
|
|
99
|
+
>
|
|
100
|
+
Settings
|
|
101
|
+
</Button>
|
|
102
|
+
|
|
103
|
+
{/* What happens to a change: take it back, or put it down. */}
|
|
104
|
+
<Divider orientation="vertical" flexItem sx={{ mx: 0.5 }} />
|
|
105
|
+
<Tooltip title={`Undo (${MOD}Z)`}>
|
|
106
|
+
{/* A span, because a disabled button dispatches no events and a
|
|
107
|
+
tooltip on one would never show. */}
|
|
108
|
+
<span>
|
|
109
|
+
<IconButton
|
|
110
|
+
aria-label="Undo"
|
|
111
|
+
disabled={!canUndo}
|
|
112
|
+
onClick={onUndo}
|
|
113
|
+
sx={{ width: 37, height: 37 }}
|
|
114
|
+
>
|
|
115
|
+
<UndoIcon fontSize="small" />
|
|
116
|
+
</IconButton>
|
|
117
|
+
</span>
|
|
118
|
+
</Tooltip>
|
|
119
|
+
<Tooltip title={`Redo (${MOD}⇧Z)`}>
|
|
120
|
+
<span>
|
|
121
|
+
<IconButton
|
|
122
|
+
aria-label="Redo"
|
|
123
|
+
disabled={!canRedo}
|
|
124
|
+
onClick={onRedo}
|
|
125
|
+
sx={{ width: 37, height: 37 }}
|
|
126
|
+
>
|
|
127
|
+
<RedoIcon fontSize="small" />
|
|
128
|
+
</IconButton>
|
|
129
|
+
</span>
|
|
130
|
+
</Tooltip>
|
|
131
|
+
{onSave && (
|
|
132
|
+
<>
|
|
133
|
+
<Tooltip title={dirty ? `Save (${MOD}S)` : ""}>
|
|
134
|
+
<span>
|
|
135
|
+
<Button
|
|
136
|
+
variant={dirty ? "contained" : "outlined"}
|
|
137
|
+
disabled={!dirty || saving}
|
|
138
|
+
onClick={onSave}
|
|
139
|
+
startIcon={
|
|
140
|
+
!dirty && !saving ? <CheckIcon /> : undefined
|
|
141
|
+
}
|
|
142
|
+
sx={{ minWidth: 124 }}
|
|
143
|
+
>
|
|
144
|
+
{/* Says what will happen, then that it is happening,
|
|
145
|
+
then what did. */}
|
|
146
|
+
{saving ? "Saving…" : dirty ? "Save changes" : "Saved"}
|
|
147
|
+
</Button>
|
|
148
|
+
</span>
|
|
149
|
+
</Tooltip>
|
|
150
|
+
</>
|
|
151
|
+
)}
|
|
152
|
+
|
|
153
|
+
{/* Leaving, where the reader's view has Edit. */}
|
|
154
|
+
{actions && (
|
|
155
|
+
<>
|
|
156
|
+
<Divider orientation="vertical" flexItem sx={{ mx: 0.5 }} />
|
|
157
|
+
{actions}
|
|
158
|
+
</>
|
|
159
|
+
)}
|
|
160
|
+
</DashboardBar>
|
|
161
|
+
);
|
|
162
|
+
}
|