@activecollab/components 2.0.408 → 2.0.409
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/cjs/components/Icons/collection/Project.js +98 -0
- package/dist/cjs/components/Icons/collection/Project.js.map +1 -0
- package/dist/cjs/components/Icons/collection/Task.js +61 -0
- package/dist/cjs/components/Icons/collection/Task.js.map +1 -0
- package/dist/cjs/components/Icons/collection/index.js +14 -0
- package/dist/cjs/components/Icons/collection/index.js.map +1 -1
- package/dist/cjs/presentation/stackedCard/content/NoteCard.js +7 -3
- package/dist/cjs/presentation/stackedCard/content/NoteCard.js.map +1 -1
- package/dist/cjs/presentation/stackedCard/content/ProjectCard.js +136 -0
- package/dist/cjs/presentation/stackedCard/content/ProjectCard.js.map +1 -0
- package/dist/cjs/presentation/stackedCard/content/TaskCard.js +183 -56
- package/dist/cjs/presentation/stackedCard/content/TaskCard.js.map +1 -1
- package/dist/cjs/presentation/stackedCard/content/index.js +11 -0
- package/dist/cjs/presentation/stackedCard/content/index.js.map +1 -1
- package/dist/cjs/presentation/stackedCard/content/shared.js +66 -19
- package/dist/cjs/presentation/stackedCard/content/shared.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/bottomDock.js +95 -32
- package/dist/cjs/presentation/whiteboard/bottomDock.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/canvasElements.js +196 -8
- package/dist/cjs/presentation/whiteboard/canvasElements.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/inspector.js +149 -47
- package/dist/cjs/presentation/whiteboard/inspector.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/outline.js +91 -18
- package/dist/cjs/presentation/whiteboard/outline.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/projectElements.js +883 -0
- package/dist/cjs/presentation/whiteboard/projectElements.js.map +1 -0
- package/dist/esm/components/Icons/collection/Project.d.ts +36 -0
- package/dist/esm/components/Icons/collection/Project.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/Project.js +91 -0
- package/dist/esm/components/Icons/collection/Project.js.map +1 -0
- package/dist/esm/components/Icons/collection/Task.d.ts +32 -0
- package/dist/esm/components/Icons/collection/Task.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/Task.js +54 -0
- package/dist/esm/components/Icons/collection/Task.js.map +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts +2 -0
- package/dist/esm/components/Icons/collection/index.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/index.js +2 -0
- package/dist/esm/components/Icons/collection/index.js.map +1 -1
- package/dist/esm/presentation/stackedCard/content/NoteCard.d.ts +8 -1
- package/dist/esm/presentation/stackedCard/content/NoteCard.d.ts.map +1 -1
- package/dist/esm/presentation/stackedCard/content/NoteCard.js +8 -4
- package/dist/esm/presentation/stackedCard/content/NoteCard.js.map +1 -1
- package/dist/esm/presentation/stackedCard/content/ProjectCard.d.ts +64 -0
- package/dist/esm/presentation/stackedCard/content/ProjectCard.d.ts.map +1 -0
- package/dist/esm/presentation/stackedCard/content/ProjectCard.js +128 -0
- package/dist/esm/presentation/stackedCard/content/ProjectCard.js.map +1 -0
- package/dist/esm/presentation/stackedCard/content/TaskCard.d.ts +64 -2
- package/dist/esm/presentation/stackedCard/content/TaskCard.d.ts.map +1 -1
- package/dist/esm/presentation/stackedCard/content/TaskCard.js +181 -58
- package/dist/esm/presentation/stackedCard/content/TaskCard.js.map +1 -1
- package/dist/esm/presentation/stackedCard/content/index.d.ts +1 -0
- package/dist/esm/presentation/stackedCard/content/index.d.ts.map +1 -1
- package/dist/esm/presentation/stackedCard/content/index.js +1 -0
- package/dist/esm/presentation/stackedCard/content/index.js.map +1 -1
- package/dist/esm/presentation/stackedCard/content/shared.d.ts +30 -0
- package/dist/esm/presentation/stackedCard/content/shared.d.ts.map +1 -1
- package/dist/esm/presentation/stackedCard/content/shared.js +66 -19
- package/dist/esm/presentation/stackedCard/content/shared.js.map +1 -1
- package/dist/esm/presentation/whiteboard/bottomDock.d.ts +30 -7
- package/dist/esm/presentation/whiteboard/bottomDock.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/bottomDock.js +79 -32
- package/dist/esm/presentation/whiteboard/bottomDock.js.map +1 -1
- package/dist/esm/presentation/whiteboard/canvasElements.d.ts +4 -1
- package/dist/esm/presentation/whiteboard/canvasElements.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/canvasElements.js +158 -7
- package/dist/esm/presentation/whiteboard/canvasElements.js.map +1 -1
- package/dist/esm/presentation/whiteboard/inspector.d.ts +35 -1
- package/dist/esm/presentation/whiteboard/inspector.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/inspector.js +170 -68
- package/dist/esm/presentation/whiteboard/inspector.js.map +1 -1
- package/dist/esm/presentation/whiteboard/outline.d.ts +23 -3
- package/dist/esm/presentation/whiteboard/outline.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/outline.js +89 -18
- package/dist/esm/presentation/whiteboard/outline.js.map +1 -1
- package/dist/esm/presentation/whiteboard/projectElements.d.ts +267 -0
- package/dist/esm/presentation/whiteboard/projectElements.d.ts.map +1 -0
- package/dist/esm/presentation/whiteboard/projectElements.js +824 -0
- package/dist/esm/presentation/whiteboard/projectElements.js.map +1 -0
- package/dist/index.js +629 -490
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,17 +2,45 @@ import React, { ReactElement } from "react";
|
|
|
2
2
|
import { CanvasElementDef, ShapeElementState, ShapeType, StickyTextStyle } from "./elements";
|
|
3
3
|
import { FileElementDef } from "./fileElement";
|
|
4
4
|
import { LinkElementDef } from "./linkElement";
|
|
5
|
+
import { ProjectElementDef } from "./projectElements";
|
|
5
6
|
export type RightPanel = "inspector" | "comments" | null;
|
|
6
7
|
export interface ElementTraits {
|
|
7
8
|
geometry: boolean;
|
|
8
9
|
fill: boolean;
|
|
10
|
+
renamable?: boolean;
|
|
9
11
|
fillTransparent?: boolean;
|
|
10
12
|
stroke: boolean;
|
|
11
13
|
text: boolean;
|
|
12
14
|
autoWidth?: boolean;
|
|
13
15
|
autoHeight?: boolean;
|
|
16
|
+
readOnly?: boolean;
|
|
14
17
|
}
|
|
15
18
|
export declare const elementTraits: (def: CanvasElementDef) => ElementTraits;
|
|
19
|
+
/**
|
|
20
|
+
* A project / task card's traits. It is the most constrained element on the
|
|
21
|
+
* board, and every "false" here is a fact about the card rather than a feature
|
|
22
|
+
* that has not been built yet:
|
|
23
|
+
*
|
|
24
|
+
* fill / stroke / text the card's appearance is the design system's, not
|
|
25
|
+
* the board's — recolouring it would make a task look
|
|
26
|
+
* like something it is not on another person's screen.
|
|
27
|
+
* autoHeight the card is content-sized; only its width is given.
|
|
28
|
+
* renamable the title belongs to the task / project record.
|
|
29
|
+
*
|
|
30
|
+
* Rotation is absent for the same reason it is absent on link and file cards:
|
|
31
|
+
* the Geometry group for a card simply does not render one.
|
|
32
|
+
*/
|
|
33
|
+
export declare const PROJECT_ELEMENT_TRAITS: ElementTraits;
|
|
34
|
+
/**
|
|
35
|
+
* A LIMITED-ACCESS card's traits: the project card's, with everything the
|
|
36
|
+
* viewer could have changed taken away.
|
|
37
|
+
*
|
|
38
|
+
* The panel is not empty, and that is deliberate — geometry still renders, so
|
|
39
|
+
* the viewer can see that the thing has a position and a size, which is
|
|
40
|
+
* precisely the amount that Workload's limited cell exposes (its data shape is
|
|
41
|
+
* a quantity and an offset). It simply cannot be edited.
|
|
42
|
+
*/
|
|
43
|
+
export declare const LIMITED_ELEMENT_TRAITS: ElementTraits;
|
|
16
44
|
export declare const TYPE_LABEL: Record<ShapeType, string>;
|
|
17
45
|
export declare const sameColor: (a: string | undefined, b: string) => boolean;
|
|
18
46
|
export declare const StyledInspectorSidebar: import("styled-components").StyledComponent<"aside", any, {}, never>;
|
|
@@ -40,6 +68,10 @@ export declare const NumberField: ({ label, value, min, unit, onCommit, }: Numbe
|
|
|
40
68
|
export declare const AutoField: ({ label }: {
|
|
41
69
|
label: string;
|
|
42
70
|
}) => ReactElement;
|
|
71
|
+
export declare const ReadOnlyField: ({ label, value, }: {
|
|
72
|
+
label: string;
|
|
73
|
+
value: string;
|
|
74
|
+
}) => ReactElement;
|
|
43
75
|
export interface OptionSelectProps {
|
|
44
76
|
options: {
|
|
45
77
|
id: string | number;
|
|
@@ -93,8 +125,10 @@ export interface RightInspectorProps {
|
|
|
93
125
|
files: FileElementDef[];
|
|
94
126
|
setFiles: React.Dispatch<React.SetStateAction<FileElementDef[]>>;
|
|
95
127
|
createdShapes: CanvasElementDef[];
|
|
128
|
+
projectElements: ProjectElementDef[];
|
|
129
|
+
setProjectElements: React.Dispatch<React.SetStateAction<ProjectElementDef[]>>;
|
|
96
130
|
locks: Record<string, boolean>;
|
|
97
131
|
setLocks: React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
|
|
98
132
|
}
|
|
99
|
-
export declare const RightInspector: ({ selectedId, positions, setPositions, sizes, setSizes, rotations, setRotations, shapes, setShapes, stickyStyle, setStickyStyle, links, setLinks, files, setFiles, createdShapes, locks, setLocks, }: RightInspectorProps) => ReactElement;
|
|
133
|
+
export declare const RightInspector: ({ selectedId, positions, setPositions, sizes, setSizes, rotations, setRotations, shapes, setShapes, stickyStyle, setStickyStyle, links, setLinks, files, setFiles, createdShapes, projectElements, setProjectElements, locks, setLocks, }: RightInspectorProps) => ReactElement;
|
|
100
134
|
//# sourceMappingURL=inspector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/inspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAoC,MAAM,OAAO,CAAC;AAI9E,OAAO,EAIL,gBAAgB,EAMhB,iBAAiB,EACjB,SAAS,EACT,eAAe,EAMhB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAkB,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE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|
4
4
|
import { BORDER_STYLE_OPTIONS, CANVAS_ELEMENTS, COLOR_OPTIONS, ELEMENT_BODIES, FONT_SIZE_OPTIONS, OPACITY_OPTIONS, RADIUS_OPTIONS, SHAPE_TYPE_ICON, THICKNESS_OPTIONS, ALIGN_OPTIONS, STYLE_OPTIONS } from "./elements";
|
|
5
5
|
import { formatFileSize } from "./fileElement";
|
|
6
6
|
import { OUTLINE_MAX_WIDTH, OUTLINE_MIN_WIDTH, OUTLINE_WIDTH, StyledChooseRow, StyledPanelChooseSlot } from "./outline";
|
|
7
|
+
import { projectElementTitle } from "./projectElements";
|
|
7
8
|
import { Checkbox } from "../../components/Checkbox";
|
|
8
9
|
import { ChooseV2 } from "../../components/ChooseV2";
|
|
9
10
|
import { Dot } from "../../components/Dot";
|
|
10
11
|
import { EditableText } from "../../components/EditableText";
|
|
11
12
|
import { IconButton } from "../../components/IconButton";
|
|
12
|
-
import { AttachmentIcon, CircleSlashIcon, InsertLinkIcon, NoteIcon } from "../../components/Icons";
|
|
13
|
+
import { AttachmentIcon, CircleSlashIcon, InsertLinkIcon, LockIcon, NoteIcon, ProjectIcon, TaskIcon } from "../../components/Icons";
|
|
13
14
|
import { Input, InputAdornment, InputNumber } from "../../components/Input";
|
|
14
15
|
import { Label } from "../../components/Label";
|
|
15
16
|
import { Select } from "../../components/Select";
|
|
16
17
|
import { SelectTrigger } from "../../components/SelectTrigger";
|
|
17
18
|
import { Tooltip } from "../../components/Tooltip";
|
|
18
|
-
import { Body2, Caption1 } from "../../components/Typography";
|
|
19
|
+
import { Body2, Caption1, Header3 } from "../../components/Typography";
|
|
19
20
|
|
|
20
21
|
/* ------------------------------------------------------------------ */
|
|
21
22
|
/* Right Inspector — selected-element properties panel */
|
|
@@ -46,6 +47,42 @@ export const elementTraits = def => def.kind === "sticky" ? {
|
|
|
46
47
|
stroke: true,
|
|
47
48
|
text: true
|
|
48
49
|
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A project / task card's traits. It is the most constrained element on the
|
|
53
|
+
* board, and every "false" here is a fact about the card rather than a feature
|
|
54
|
+
* that has not been built yet:
|
|
55
|
+
*
|
|
56
|
+
* fill / stroke / text the card's appearance is the design system's, not
|
|
57
|
+
* the board's — recolouring it would make a task look
|
|
58
|
+
* like something it is not on another person's screen.
|
|
59
|
+
* autoHeight the card is content-sized; only its width is given.
|
|
60
|
+
* renamable the title belongs to the task / project record.
|
|
61
|
+
*
|
|
62
|
+
* Rotation is absent for the same reason it is absent on link and file cards:
|
|
63
|
+
* the Geometry group for a card simply does not render one.
|
|
64
|
+
*/
|
|
65
|
+
export const PROJECT_ELEMENT_TRAITS = {
|
|
66
|
+
geometry: true,
|
|
67
|
+
fill: false,
|
|
68
|
+
stroke: false,
|
|
69
|
+
text: false,
|
|
70
|
+
autoHeight: true,
|
|
71
|
+
renamable: false
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A LIMITED-ACCESS card's traits: the project card's, with everything the
|
|
76
|
+
* viewer could have changed taken away.
|
|
77
|
+
*
|
|
78
|
+
* The panel is not empty, and that is deliberate — geometry still renders, so
|
|
79
|
+
* the viewer can see that the thing has a position and a size, which is
|
|
80
|
+
* precisely the amount that Workload's limited cell exposes (its data shape is
|
|
81
|
+
* a quantity and an offset). It simply cannot be edited.
|
|
82
|
+
*/
|
|
83
|
+
export const LIMITED_ELEMENT_TRAITS = _extends({}, PROJECT_ELEMENT_TRAITS, {
|
|
84
|
+
readOnly: true
|
|
85
|
+
});
|
|
49
86
|
export const TYPE_LABEL = {
|
|
50
87
|
rectangle: "Rectangle",
|
|
51
88
|
roundedRectangle: "Rounded Rectangle",
|
|
@@ -83,7 +120,7 @@ export const StyledPropGroups = styled.div.withConfig({
|
|
|
83
120
|
export const StyledInspectorHeader = styled.div.withConfig({
|
|
84
121
|
displayName: "inspector__StyledInspectorHeader",
|
|
85
122
|
componentId: "sc-do334k-4"
|
|
86
|
-
})(["display:flex;align-items:center;gap:8px;height:56px;padding:0 16px;box-sizing:border-box;flex-shrink:0;.inspector-type-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;color:var(--color-theme-700);}.inspector-type-icon svg{width:20px;height:20px;}.inspector-name{flex:1;min-width:0;}"]);
|
|
123
|
+
})(["display:flex;align-items:center;gap:8px;height:56px;padding:0 16px;box-sizing:border-box;flex-shrink:0;.inspector-type-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;color:var(--color-theme-700);}.inspector-type-icon svg{width:20px;height:20px;}.inspector-name{flex:1;min-width:0;}.inspector-name-static{padding:0 4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}"]);
|
|
87
124
|
|
|
88
125
|
/* Empty state — same muted treatment the outline uses for unnamed rows. */
|
|
89
126
|
export const StyledInspectorEmpty = styled.div.withConfig({
|
|
@@ -172,11 +209,24 @@ export const AutoField = _ref2 => {
|
|
|
172
209
|
weight: "regular"
|
|
173
210
|
}, label), /*#__PURE__*/React.createElement(StyledAutoField, null, "Auto"));
|
|
174
211
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
212
|
+
|
|
213
|
+
/* A geometry value the viewer may READ but not change — the same field
|
|
214
|
+
`AutoField` and the file card's Size already use, with a real value in it.
|
|
215
|
+
Showing the number greyed out is the point: a limited card still has a
|
|
216
|
+
position and a size, and those are the only facts about it there are. */
|
|
217
|
+
export const ReadOnlyField = _ref3 => {
|
|
218
|
+
let label = _ref3.label,
|
|
219
|
+
value = _ref3.value;
|
|
220
|
+
return /*#__PURE__*/React.createElement(StyledPropRow, null, /*#__PURE__*/React.createElement(Label, {
|
|
221
|
+
size: "small",
|
|
222
|
+
weight: "regular"
|
|
223
|
+
}, label), /*#__PURE__*/React.createElement(StyledAutoField, null, value));
|
|
224
|
+
};
|
|
225
|
+
export const OptionSelect = _ref4 => {
|
|
226
|
+
let options = _ref4.options,
|
|
227
|
+
value = _ref4.value,
|
|
228
|
+
triggerLabel = _ref4.triggerLabel,
|
|
229
|
+
onChange = _ref4.onChange;
|
|
180
230
|
return /*#__PURE__*/React.createElement(StyledControl, null, /*#__PURE__*/React.createElement(Select, {
|
|
181
231
|
type: "single",
|
|
182
232
|
disableSearch: true,
|
|
@@ -207,11 +257,11 @@ export const colorName = hex => {
|
|
|
207
257
|
/* The regular design-system named-colour picker (the one in the label dialogs):
|
|
208
258
|
a Select whose trigger is a Dot + colour name, and whose menu is the standard
|
|
209
259
|
dot-and-radio list. Custom colours are deferred. */
|
|
210
|
-
export const ColorPickerField =
|
|
211
|
-
let value =
|
|
212
|
-
disabled =
|
|
213
|
-
includeTransparent =
|
|
214
|
-
onSelect =
|
|
260
|
+
export const ColorPickerField = _ref5 => {
|
|
261
|
+
let value = _ref5.value,
|
|
262
|
+
disabled = _ref5.disabled,
|
|
263
|
+
includeTransparent = _ref5.includeTransparent,
|
|
264
|
+
onSelect = _ref5.onSelect;
|
|
215
265
|
const options = includeTransparent ? [TRANSPARENT_OPTION, ...COLOR_OPTIONS] : COLOR_OPTIONS;
|
|
216
266
|
const isTransparent = !value || sameColor(value, "transparent");
|
|
217
267
|
return /*#__PURE__*/React.createElement(StyledControl, {
|
|
@@ -238,26 +288,28 @@ export const ColorPickerField = _ref4 => {
|
|
|
238
288
|
}), colorName(value)))
|
|
239
289
|
}));
|
|
240
290
|
};
|
|
241
|
-
export const RightInspector =
|
|
291
|
+
export const RightInspector = _ref6 => {
|
|
242
292
|
var _sizes$def$id, _positions$def$id, _rotations$def$id, _names$def$id, _shape$align, _BORDER_STYLE_OPTIONS, _BORDER_STYLE_OPTIONS2;
|
|
243
|
-
let selectedId =
|
|
244
|
-
positions =
|
|
245
|
-
setPositions =
|
|
246
|
-
sizes =
|
|
247
|
-
setSizes =
|
|
248
|
-
rotations =
|
|
249
|
-
setRotations =
|
|
250
|
-
shapes =
|
|
251
|
-
setShapes =
|
|
252
|
-
stickyStyle =
|
|
253
|
-
setStickyStyle =
|
|
254
|
-
links =
|
|
255
|
-
setLinks =
|
|
256
|
-
files =
|
|
257
|
-
setFiles =
|
|
258
|
-
createdShapes =
|
|
259
|
-
|
|
260
|
-
|
|
293
|
+
let selectedId = _ref6.selectedId,
|
|
294
|
+
positions = _ref6.positions,
|
|
295
|
+
setPositions = _ref6.setPositions,
|
|
296
|
+
sizes = _ref6.sizes,
|
|
297
|
+
setSizes = _ref6.setSizes,
|
|
298
|
+
rotations = _ref6.rotations,
|
|
299
|
+
setRotations = _ref6.setRotations,
|
|
300
|
+
shapes = _ref6.shapes,
|
|
301
|
+
setShapes = _ref6.setShapes,
|
|
302
|
+
stickyStyle = _ref6.stickyStyle,
|
|
303
|
+
setStickyStyle = _ref6.setStickyStyle,
|
|
304
|
+
links = _ref6.links,
|
|
305
|
+
setLinks = _ref6.setLinks,
|
|
306
|
+
files = _ref6.files,
|
|
307
|
+
setFiles = _ref6.setFiles,
|
|
308
|
+
createdShapes = _ref6.createdShapes,
|
|
309
|
+
projectElements = _ref6.projectElements,
|
|
310
|
+
setProjectElements = _ref6.setProjectElements,
|
|
311
|
+
locks = _ref6.locks,
|
|
312
|
+
setLocks = _ref6.setLocks;
|
|
261
313
|
const _useState = useState(OUTLINE_WIDTH),
|
|
262
314
|
width = _useState[0],
|
|
263
315
|
setWidth = _useState[1];
|
|
@@ -303,6 +355,7 @@ export const RightInspector = _ref5 => {
|
|
|
303
355
|
const def = selectedId ? [...CANVAS_ELEMENTS, ...createdShapes].find(element => element.id === selectedId) : undefined;
|
|
304
356
|
const linkDef = selectedId ? links.find(link => link.id === selectedId) : undefined;
|
|
305
357
|
const fileDef = selectedId ? files.find(file => file.id === selectedId) : undefined;
|
|
358
|
+
const projectDef = selectedId ? projectElements.find(entry => entry.id === selectedId) : undefined;
|
|
306
359
|
const shell = content => /*#__PURE__*/React.createElement(StyledInspectorSidebar, {
|
|
307
360
|
style: {
|
|
308
361
|
width
|
|
@@ -336,11 +389,19 @@ export const RightInspector = _ref5 => {
|
|
|
336
389
|
|
|
337
390
|
/* The Locked checkbox — shown for every element kind, toggling a design lock
|
|
338
391
|
flag keyed by element id. */
|
|
339
|
-
|
|
392
|
+
/* `forced` is the limited-access case: the element is locked FOR THIS VIEWER
|
|
393
|
+
and the checkbox is the honest place to say so — ticked, and disabled so it
|
|
394
|
+
reads as a statement about the element rather than a switch that was left
|
|
395
|
+
on. */
|
|
396
|
+
const renderLocked = function (id, forced) {
|
|
340
397
|
var _locks$id;
|
|
398
|
+
if (forced === void 0) {
|
|
399
|
+
forced = false;
|
|
400
|
+
}
|
|
341
401
|
return /*#__PURE__*/React.createElement(StyledCheckboxRow, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
342
402
|
id: "wb-lock-" + id,
|
|
343
|
-
checked: (_locks$id = locks[id]) != null ? _locks$id : false,
|
|
403
|
+
checked: forced || ((_locks$id = locks[id]) != null ? _locks$id : false),
|
|
404
|
+
disabled: forced,
|
|
344
405
|
onChange: () => setLocks(current => {
|
|
345
406
|
var _current$id;
|
|
346
407
|
return _extends({}, current, {
|
|
@@ -354,11 +415,17 @@ export const RightInspector = _ref5 => {
|
|
|
354
415
|
}, "Locked"));
|
|
355
416
|
};
|
|
356
417
|
|
|
357
|
-
/* Geometry for a card (link / file): X/Y from the shared
|
|
358
|
-
editable width and an auto height (cards are
|
|
359
|
-
be rotated, so there is no Rotation field.
|
|
360
|
-
|
|
418
|
+
/* Geometry for a card (link / file / project / task): X/Y from the shared
|
|
419
|
+
positions map, an editable width and an auto height (cards are
|
|
420
|
+
content-sized). Cards cannot be rotated, so there is no Rotation field.
|
|
421
|
+
`readOnly` keeps the same three values in the same three places and swaps
|
|
422
|
+
the inputs for read-only fields — a limited card's geometry is information,
|
|
423
|
+
not a control. */
|
|
424
|
+
const renderCardGeometry = function (id, cardWidth, onWidth, readOnly) {
|
|
361
425
|
var _positions$id;
|
|
426
|
+
if (readOnly === void 0) {
|
|
427
|
+
readOnly = false;
|
|
428
|
+
}
|
|
362
429
|
const cardPosition = (_positions$id = positions[id]) != null ? _positions$id : {
|
|
363
430
|
x: 0,
|
|
364
431
|
y: 0
|
|
@@ -366,7 +433,10 @@ export const RightInspector = _ref5 => {
|
|
|
366
433
|
return /*#__PURE__*/React.createElement(StyledPropGroup, null, /*#__PURE__*/React.createElement(Body2, {
|
|
367
434
|
weight: "bold",
|
|
368
435
|
className: "group-title"
|
|
369
|
-
}, "Geometry"), /*#__PURE__*/React.createElement(StyledFieldGrid, null, /*#__PURE__*/React.createElement(
|
|
436
|
+
}, "Geometry"), /*#__PURE__*/React.createElement(StyledFieldGrid, null, readOnly ? /*#__PURE__*/React.createElement(ReadOnlyField, {
|
|
437
|
+
label: "X",
|
|
438
|
+
value: cardPosition.x + " px"
|
|
439
|
+
}) : /*#__PURE__*/React.createElement(NumberField, {
|
|
370
440
|
label: "X",
|
|
371
441
|
unit: "px",
|
|
372
442
|
value: cardPosition.x,
|
|
@@ -381,7 +451,10 @@ export const RightInspector = _ref5 => {
|
|
|
381
451
|
})
|
|
382
452
|
});
|
|
383
453
|
})
|
|
384
|
-
}), /*#__PURE__*/React.createElement(
|
|
454
|
+
}), readOnly ? /*#__PURE__*/React.createElement(ReadOnlyField, {
|
|
455
|
+
label: "Y",
|
|
456
|
+
value: cardPosition.y + " px"
|
|
457
|
+
}) : /*#__PURE__*/React.createElement(NumberField, {
|
|
385
458
|
label: "Y",
|
|
386
459
|
unit: "px",
|
|
387
460
|
value: cardPosition.y,
|
|
@@ -396,7 +469,10 @@ export const RightInspector = _ref5 => {
|
|
|
396
469
|
})
|
|
397
470
|
});
|
|
398
471
|
})
|
|
399
|
-
})), /*#__PURE__*/React.createElement(StyledFieldGrid, null, /*#__PURE__*/React.createElement(
|
|
472
|
+
})), /*#__PURE__*/React.createElement(StyledFieldGrid, null, readOnly ? /*#__PURE__*/React.createElement(ReadOnlyField, {
|
|
473
|
+
label: "Width",
|
|
474
|
+
value: cardWidth + " px"
|
|
475
|
+
}) : /*#__PURE__*/React.createElement(NumberField, {
|
|
400
476
|
label: "Width",
|
|
401
477
|
unit: "px",
|
|
402
478
|
value: cardWidth,
|
|
@@ -408,39 +484,65 @@ export const RightInspector = _ref5 => {
|
|
|
408
484
|
};
|
|
409
485
|
|
|
410
486
|
/* Header + panel switch + body, shared by every element kind — only the
|
|
411
|
-
groups inside differ.
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}, /*#__PURE__*/React.createElement(EditableText, {
|
|
417
|
-
value: headerName,
|
|
418
|
-
variant: "Header 3",
|
|
419
|
-
weight: "bold",
|
|
420
|
-
onSave: event => setNames(current => _extends({}, current, {
|
|
421
|
-
[id]: event.target.value
|
|
422
|
-
})),
|
|
423
|
-
inputProps: {
|
|
424
|
-
maxLength: 120
|
|
487
|
+
groups inside differ. `renamable` false swaps the live EditableText for
|
|
488
|
+
read-only text, for elements whose name is not the board's to change. */
|
|
489
|
+
const renderInspectorBody = function (icon, headerName, id, groups, renamable) {
|
|
490
|
+
if (renamable === void 0) {
|
|
491
|
+
renamable = true;
|
|
425
492
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
493
|
+
return /*#__PURE__*/React.createElement(StyledInspectorBody, null, /*#__PURE__*/React.createElement(StyledInspectorHeader, null, /*#__PURE__*/React.createElement("span", {
|
|
494
|
+
className: "inspector-type-icon"
|
|
495
|
+
}, icon), /*#__PURE__*/React.createElement("span", {
|
|
496
|
+
className: "inspector-name"
|
|
497
|
+
}, renamable ? /*#__PURE__*/React.createElement(EditableText, {
|
|
498
|
+
value: headerName,
|
|
499
|
+
variant: "Header 3",
|
|
500
|
+
weight: "bold",
|
|
501
|
+
onSave: event => setNames(current => _extends({}, current, {
|
|
502
|
+
[id]: event.target.value
|
|
503
|
+
})),
|
|
504
|
+
inputProps: {
|
|
505
|
+
maxLength: 120
|
|
506
|
+
}
|
|
507
|
+
}) : /*#__PURE__*/React.createElement(Header3, {
|
|
508
|
+
className: "inspector-name-static",
|
|
509
|
+
title: headerName
|
|
510
|
+
}, headerName))), /*#__PURE__*/React.createElement(StyledChooseRow, null, /*#__PURE__*/React.createElement(StyledPanelChooseSlot, null, /*#__PURE__*/React.createElement(ChooseV2, {
|
|
511
|
+
required: true,
|
|
512
|
+
options: [{
|
|
513
|
+
id: "properties",
|
|
514
|
+
name: "Properties"
|
|
515
|
+
}, {
|
|
516
|
+
id: "comments",
|
|
517
|
+
name: "Comments"
|
|
518
|
+
}],
|
|
519
|
+
selected: [tab],
|
|
520
|
+
onChange: selected => setTab(selected[0])
|
|
521
|
+
}))), tab === "comments" ? /*#__PURE__*/React.createElement(StyledInspectorEmpty, null, /*#__PURE__*/React.createElement(Body2, null, "The comments stream is coming soon.")) : /*#__PURE__*/React.createElement(StyledPropGroups, null, groups));
|
|
522
|
+
};
|
|
438
523
|
|
|
439
524
|
/* Nothing selected. */
|
|
440
|
-
if (!def && !linkDef && !fileDef) {
|
|
525
|
+
if (!def && !linkDef && !fileDef && !projectDef) {
|
|
441
526
|
return shell(/*#__PURE__*/React.createElement(StyledInspectorEmpty, null, /*#__PURE__*/React.createElement(Body2, null, "Select an element to see its properties.")));
|
|
442
527
|
}
|
|
443
528
|
|
|
529
|
+
/* Project / task card — the most constrained element here. Its look is not
|
|
530
|
+
the board's to change (no Fill, Stroke or Text), and its title belongs to
|
|
531
|
+
the record it shows, so the header is read-only. What is left is what the
|
|
532
|
+
board really does own: where the card sits, how wide it is, and whether it
|
|
533
|
+
is locked. */
|
|
534
|
+
if (projectDef) {
|
|
535
|
+
const limited = projectDef.limited === true;
|
|
536
|
+
const cardTraits = limited ? LIMITED_ELEMENT_TRAITS : PROJECT_ELEMENT_TRAITS;
|
|
537
|
+
return shell(renderInspectorBody(
|
|
538
|
+
/* A limited card gets a NEUTRAL icon. The task and project glyphs would
|
|
539
|
+
each say which kind of record is behind the card, and the kind is
|
|
540
|
+
part of what the viewer is not entitled to. */
|
|
541
|
+
limited ? /*#__PURE__*/React.createElement(LockIcon, null) : projectDef.kind === "project" ? /*#__PURE__*/React.createElement(ProjectIcon, null) : /*#__PURE__*/React.createElement(TaskIcon, null), projectElementTitle(projectDef), projectDef.id, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledPropGroup, null, renderLocked(projectDef.id, cardTraits.readOnly)), cardTraits.geometry ? renderCardGeometry(projectDef.id, projectDef.width, width => setProjectElements(current => current.map(entry => entry.id === projectDef.id ? _extends({}, entry, {
|
|
542
|
+
width
|
|
543
|
+
}) : entry)), cardTraits.readOnly) : null), cardTraits.renamable));
|
|
544
|
+
}
|
|
545
|
+
|
|
444
546
|
/* Link card — its URL plus the shared Locked flag. */
|
|
445
547
|
if (linkDef) {
|
|
446
548
|
var _names$linkDef$id, _linkDef$url;
|