@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
|
@@ -5,7 +5,7 @@ import React from "react";
|
|
|
5
5
|
import styled, { css } from "styled-components";
|
|
6
6
|
import { PlayIcon, TreeDotsIcon } from "../../../components/Icons";
|
|
7
7
|
import { STACKED_CARD_CONTROL_CLASS, StackedCardCollapseGlyph as CollapseGlyph, StackedCardCoverButton as CoverButton, StackedCardPlayBadge as PlayBadge, StackedCardRemoveCoverGlyph as RemoveCoverGlyph } from "../../../components/StackedCard";
|
|
8
|
-
import { Body2 } from "../../../components/Typography";
|
|
8
|
+
import { Body2, Caption2 } from "../../../components/Typography";
|
|
9
9
|
import { Typography } from "../../../components/Typography/Typography";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -23,6 +23,20 @@ import { Typography } from "../../../components/Typography/Typography";
|
|
|
23
23
|
* the same words.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
+
/* ------------------------------------------------------------------ */
|
|
27
|
+
/* The font stack for raw text */
|
|
28
|
+
/* ------------------------------------------------------------------ */
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* There is no global CSS reset in this Storybook, so a raw element (a `<span>`
|
|
32
|
+
* holding a date, a `<button>` holding a word) falls back to the browser default
|
|
33
|
+
* — a SERIF face at the UA's own size. Anything that is not a DS `Typography`
|
|
34
|
+
* has to name the font itself. Use a DS Typography where one fits; use this
|
|
35
|
+
* where the app itself sets the size in CSS (the column card's date row is a
|
|
36
|
+
* plain `div` in `view.project_tasks_column_mode.less`, not a Typography).
|
|
37
|
+
*/
|
|
38
|
+
export const CARD_FONT = "-apple-system, BlinkMacSystemFont, \"Roboto\",\n \"Helvetica Neue\", Arial, sans-serif";
|
|
39
|
+
|
|
26
40
|
/* ------------------------------------------------------------------ */
|
|
27
41
|
/* Per-type cover ratios */
|
|
28
42
|
/* ------------------------------------------------------------------ */
|
|
@@ -91,27 +105,60 @@ export const StyledClamp = styled(Body2).withConfig({
|
|
|
91
105
|
componentId: "sc-1x5md9a-1"
|
|
92
106
|
})(["display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;"]);
|
|
93
107
|
|
|
108
|
+
/**
|
|
109
|
+
* The title block — everything the title row stacks to the LEFT of the "…"
|
|
110
|
+
* menu. A card that only has a title puts the clamp straight in the row; a card
|
|
111
|
+
* that puts a line above or below it (the project a task belongs to, the client
|
|
112
|
+
* a project is for) stacks them here so the row keeps its two-child shape:
|
|
113
|
+
* text block, then the fixed-width menu.
|
|
114
|
+
*/
|
|
115
|
+
export const StyledTitleBlock = styled.div.withConfig({
|
|
116
|
+
displayName: "shared__StyledTitleBlock",
|
|
117
|
+
componentId: "sc-1x5md9a-2"
|
|
118
|
+
})(["display:flex;flex-direction:column;min-width:0;"]);
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The project a card's entity lives in, above the title.
|
|
122
|
+
*
|
|
123
|
+
* On a canvas a task card has lost the column that used to say which project it
|
|
124
|
+
* came from, so the card says it itself. One line, one treatment, shared by
|
|
125
|
+
* every content type that can carry it (the whiteboard's own task face already
|
|
126
|
+
* wrote it this way: `Caption 2` tertiary, tight above the title, ellipsis on
|
|
127
|
+
* overflow — a project name is a reference, never a second title).
|
|
128
|
+
*/
|
|
129
|
+
export const StyledProjectLine = styled(Caption2).withConfig({
|
|
130
|
+
displayName: "shared__StyledProjectLine",
|
|
131
|
+
componentId: "sc-1x5md9a-3"
|
|
132
|
+
})(["display:block;margin-bottom:2px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"]);
|
|
133
|
+
export const CardProjectLine = _ref2 => {
|
|
134
|
+
let children = _ref2.children;
|
|
135
|
+
return /*#__PURE__*/React.createElement(StyledProjectLine, {
|
|
136
|
+
color: "tertiary",
|
|
137
|
+
className: "sc-project"
|
|
138
|
+
}, children);
|
|
139
|
+
};
|
|
140
|
+
|
|
94
141
|
/** A favicon square — a solid data colour stands in for the real favicon. */
|
|
95
142
|
export const StyledFavicon = styled.span.withConfig({
|
|
96
143
|
displayName: "shared__StyledFavicon",
|
|
97
|
-
componentId: "sc-1x5md9a-
|
|
98
|
-
})(["display:inline-flex;width:16px;height:16px;border-radius:4px;background:", ";flex-shrink:0;"],
|
|
99
|
-
let $bg =
|
|
144
|
+
componentId: "sc-1x5md9a-4"
|
|
145
|
+
})(["display:inline-flex;width:16px;height:16px;border-radius:4px;background:", ";flex-shrink:0;"], _ref3 => {
|
|
146
|
+
let $bg = _ref3.$bg;
|
|
100
147
|
return $bg;
|
|
101
148
|
});
|
|
102
149
|
|
|
103
150
|
/** A small pill for link metadata (media kind, duration, …). */
|
|
104
151
|
export const StyledChip = styled.span.withConfig({
|
|
105
152
|
displayName: "shared__StyledChip",
|
|
106
|
-
componentId: "sc-1x5md9a-
|
|
153
|
+
componentId: "sc-1x5md9a-5"
|
|
107
154
|
})(["display:inline-flex;align-items:center;padding:2px 8px;border-radius:10px;background:var(--color-theme-300);color:var(--color-theme-800);font-size:11px;white-space:nowrap;"]);
|
|
108
155
|
|
|
109
156
|
/** A solid-colour cover fill (swatch value, generic link cover, image stand-in). */
|
|
110
157
|
export const StyledColorCover = styled.div.withConfig({
|
|
111
158
|
displayName: "shared__StyledColorCover",
|
|
112
|
-
componentId: "sc-1x5md9a-
|
|
113
|
-
})(["width:100%;height:100%;background:", ";"],
|
|
114
|
-
let $color =
|
|
159
|
+
componentId: "sc-1x5md9a-6"
|
|
160
|
+
})(["width:100%;height:100%;background:", ";"], _ref4 => {
|
|
161
|
+
let $color = _ref4.$color;
|
|
115
162
|
return $color;
|
|
116
163
|
});
|
|
117
164
|
|
|
@@ -121,12 +168,12 @@ export const StyledColorCover = styled.div.withConfig({
|
|
|
121
168
|
|
|
122
169
|
const StyledPlaceholder = styled.button.withConfig({
|
|
123
170
|
displayName: "shared__StyledPlaceholder",
|
|
124
|
-
componentId: "sc-1x5md9a-
|
|
125
|
-
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;width:100%;height:", "px;padding:0;border:0;background:transparent;color:var(--color-theme-600);text-align:center;cursor:pointer;", " > svg{width:40px;height:40px;color:var(--color-theme-500);}"],
|
|
126
|
-
let $height =
|
|
171
|
+
componentId: "sc-1x5md9a-7"
|
|
172
|
+
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;width:100%;height:", "px;padding:0;border:0;background:transparent;color:var(--color-theme-600);text-align:center;cursor:pointer;", " > svg{width:40px;height:40px;color:var(--color-theme-500);}"], _ref5 => {
|
|
173
|
+
let $height = _ref5.$height;
|
|
127
174
|
return $height != null ? $height : 150;
|
|
128
|
-
},
|
|
129
|
-
let $dashed =
|
|
175
|
+
}, _ref6 => {
|
|
176
|
+
let $dashed = _ref6.$dashed;
|
|
130
177
|
return $dashed && css(["margin:8px;width:calc(100% - 16px);border:1.5px dashed var(--color-theme-400);border-radius:6px;&:hover{border-color:var(--sc-selection-ring);color:var(--color-theme-700);}"]);
|
|
131
178
|
});
|
|
132
179
|
|
|
@@ -135,12 +182,12 @@ const StyledPlaceholder = styled.button.withConfig({
|
|
|
135
182
|
* sentence-case invitation (ActiveCollab voice). Interactive by design — the
|
|
136
183
|
* whole frame is a button — and distinct from the loading skeleton.
|
|
137
184
|
*/
|
|
138
|
-
export const Placeholder =
|
|
139
|
-
let icon =
|
|
140
|
-
label =
|
|
141
|
-
height =
|
|
142
|
-
dashed =
|
|
143
|
-
rest = _objectWithoutPropertiesLoose(
|
|
185
|
+
export const Placeholder = _ref7 => {
|
|
186
|
+
let icon = _ref7.icon,
|
|
187
|
+
label = _ref7.label,
|
|
188
|
+
height = _ref7.height,
|
|
189
|
+
dashed = _ref7.dashed,
|
|
190
|
+
rest = _objectWithoutPropertiesLoose(_ref7, _excluded);
|
|
144
191
|
return /*#__PURE__*/React.createElement(StyledPlaceholder, _extends({
|
|
145
192
|
type: "button",
|
|
146
193
|
$height: height,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","names":["React","styled","css","PlayIcon","TreeDotsIcon","STACKED_CARD_CONTROL_CLASS","StackedCardCollapseGlyph","CollapseGlyph","StackedCardCoverButton","CoverButton","StackedCardPlayBadge","PlayBadge","StackedCardRemoveCoverGlyph","RemoveCoverGlyph","Body2","Typography","COVER_RATIO_HERO","COVER_RATIO_IMAGE","COVER_RATIO_SWATCH","playControl","createElement","coverManagement","_temp","_ref","_ref$removeLabel","removeLabel","onCollapse","onRemove","Fragment","type","onClick","StyledEntityDots","button","withConfig","displayName","componentId","EntityDots","props","_extends","className","StyledClamp","StyledFavicon","span","_ref2","$bg","StyledChip","StyledColorCover","div","_ref3","$color","StyledPlaceholder","_ref4","$height","_ref5","$dashed","Placeholder","_ref6","icon","label","height","dashed","rest","_objectWithoutPropertiesLoose","_excluded","as","variant","color"],"sources":["../../../../../src/presentation/stackedCard/content/shared.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from \"react\";\n\nimport styled, { css } from \"styled-components\";\n\nimport { PlayIcon, TreeDotsIcon } from \"../../../components/Icons\";\nimport {\n STACKED_CARD_CONTROL_CLASS,\n StackedCardCollapseGlyph as CollapseGlyph,\n StackedCardCoverButton as CoverButton,\n StackedCardPlayBadge as PlayBadge,\n StackedCardRemoveCoverGlyph as RemoveCoverGlyph,\n} from \"../../../components/StackedCard\";\nimport { Body2 } from \"../../../components/Typography\";\nimport { Typography } from \"../../../components/Typography/Typography\";\n\n/**\n * Content-level chrome shared by the typed StackedCard components.\n *\n * These live OUTSIDE the shell on purpose. The shell is hollow; the \"…\" entity\n * menu, the cover-management controls, the clamp, the favicon, the chips and\n * the placeholder frame are content concerns, so they belong here where the\n * typed cards (TaskCard, LinkCard, …) compose them.\n *\n * The card itself — the shell, the Stack/StackRow/Cover primitives and the\n * cover chrome — is the shipped design-system component,\n * `components/StackedCard`. These stories import it under the concept\n * vocabulary (Cover, StackRow, …) so the spec prose and the code keep using\n * the same words.\n */\n\n/* ------------------------------------------------------------------ */\n/* Per-type cover ratios */\n/* ------------------------------------------------------------------ */\n\n/**\n * The design system ships one default cover ratio\n * (`STACKED_CARD_COVER_RATIO`). How tall a cover reads is a decision of the\n * content type, so the variants live here with the content: a link hero, a\n * full-bleed image, a colour swatch band.\n */\nexport const COVER_RATIO_HERO = \"320 / 190\";\nexport const COVER_RATIO_IMAGE = \"260 / 168\";\nexport const COVER_RATIO_SWATCH = \"260 / 104\";\n\n/* ------------------------------------------------------------------ */\n/* Cover chrome — media control + cover management */\n/* ------------------------------------------------------------------ */\n\n/** Centered media control (play), for a cover that wraps audio/video. */\nexport const playControl = (\n <PlayBadge>\n <PlayIcon />\n </PlayBadge>\n);\n\n/**\n * Top-right cover management. Acts on the COVER (collapse it, remove it) — not\n * on the entity. Callers wire the click handlers; the default is inert chrome\n * for the static demos.\n */\nexport const coverManagement = ({\n removeLabel = \"Remove cover\",\n onCollapse,\n onRemove,\n}: {\n removeLabel?: string;\n onCollapse?: () => void;\n onRemove?: () => void;\n} = {}): ReactElement => (\n <>\n <CoverButton type=\"button\" aria-label=\"Collapse cover\" onClick={onCollapse}>\n <CollapseGlyph />\n </CoverButton>\n <CoverButton type=\"button\" aria-label={removeLabel} onClick={onRemove}>\n <RemoveCoverGlyph />\n </CoverButton>\n </>\n);\n\n/* ------------------------------------------------------------------ */\n/* Entity \"…\" menu — acts on the ENTITY, lives in a content row */\n/* ------------------------------------------------------------------ */\n\nconst StyledEntityDots = styled.button`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: 0;\n border-radius: 6px;\n cursor: pointer;\n color: var(--color-theme-700);\n background: var(--color-theme-200);\n\n svg {\n width: 16px;\n height: 16px;\n display: block;\n }\n\n &:hover {\n background: var(--color-theme-300);\n }\n`;\n\nexport const EntityDots = (\n props: React.ButtonHTMLAttributes<HTMLButtonElement>\n): ReactElement => (\n <StyledEntityDots\n type=\"button\"\n aria-label=\"Options\"\n data-fixed\n className={STACKED_CARD_CONTROL_CLASS}\n {...props}\n >\n <TreeDotsIcon />\n </StyledEntityDots>\n);\n\n/* ------------------------------------------------------------------ */\n/* Text + inline bits */\n/* ------------------------------------------------------------------ */\n\n/** Two-line title clamp — the card's name row content. */\nexport const StyledClamp = styled(Body2)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n\n/** A favicon square — a solid data colour stands in for the real favicon. */\nexport const StyledFavicon = styled.span<{ $bg: string }>`\n display: inline-flex;\n width: 16px;\n height: 16px;\n border-radius: 4px;\n background: ${({ $bg }) => $bg};\n flex-shrink: 0;\n`;\n\n/** A small pill for link metadata (media kind, duration, …). */\nexport const StyledChip = styled.span`\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 10px;\n background: var(--color-theme-300);\n color: var(--color-theme-800);\n font-size: 11px;\n white-space: nowrap;\n`;\n\n/** A solid-colour cover fill (swatch value, generic link cover, image stand-in). */\nexport const StyledColorCover = styled.div<{ $color: string }>`\n width: 100%;\n height: 100%;\n background: ${({ $color }) => $color};\n`;\n\n/* ------------------------------------------------------------------ */\n/* Placeholder frame — the interactive empty state, per type */\n/* ------------------------------------------------------------------ */\n\nconst StyledPlaceholder = styled.button<{\n $height?: number;\n $dashed?: boolean;\n}>`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n height: ${({ $height }) => $height ?? 150}px;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--color-theme-600);\n text-align: center;\n cursor: pointer;\n\n ${({ $dashed }) =>\n $dashed &&\n css`\n margin: 8px;\n width: calc(100% - 16px);\n border: 1.5px dashed var(--color-theme-400);\n border-radius: 6px;\n\n &:hover {\n border-color: var(--sc-selection-ring);\n color: var(--color-theme-700);\n }\n `}\n\n > svg {\n width: 40px;\n height: 40px;\n color: var(--color-theme-500);\n }\n`;\n\n/**\n * The shared placeholder frame. Each type supplies its own icon and verb-first,\n * sentence-case invitation (ActiveCollab voice). Interactive by design — the\n * whole frame is a button — and distinct from the loading skeleton.\n */\nexport const Placeholder = ({\n icon,\n label,\n height,\n dashed,\n ...rest\n}: {\n icon: ReactNode;\n label: ReactNode;\n height?: number;\n dashed?: boolean;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>): ReactElement => (\n <StyledPlaceholder type=\"button\" $height={height} $dashed={dashed} {...rest}>\n {icon}\n <Typography as=\"span\" variant=\"Body 2\" color=\"secondary\">\n {label}\n </Typography>\n </StyledPlaceholder>\n);\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAmC,OAAO;AAEtD,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,QAAQ,EAAEC,YAAY,QAAQ,2BAA2B;AAClE,SACEC,0BAA0B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AA;AAAA,gSAU3BgB,KAAA;EAAA,IAAGC,OAAO,GAAAD,KAAA,CAAPC,OAAO;EAAA,OAAOA,OAAO,WAAPA,OAAO,GAAI,GAAG;AAAA,GAQvCC,KAAA;EAAA,IAAGC,OAAO,GAAAD,KAAA,CAAPC,OAAO;EAAA,OACVA,OAAO,IACPpD,GAAG,kLAUF;AAAA,EAOJ;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMqD,WAAW,GAAGC,KAAA;EAAA,IACzBC,IAAI,GAAAD,KAAA,CAAJC,IAAI;IACJC,KAAK,GAAAF,KAAA,CAALE,KAAK;IACLC,MAAM,GAAAH,KAAA,CAANG,MAAM;IACNC,MAAM,GAAAJ,KAAA,CAANI,MAAM;IACHC,IAAI,GAAAC,6BAAA,CAAAN,KAAA,EAAAO,SAAA;EAAA,oBAOP/D,KAAA,CAAAoB,aAAA,CAAC8B,iBAAiB,EAAAZ,QAAA;IAACT,IAAI,EAAC,QAAQ;IAACuB,OAAO,EAAEO,MAAO;IAACL,OAAO,EAAEM;EAAO,GAAKC,IAAI,GACxEJ,IAAI,eACLzD,KAAA,CAAAoB,aAAA,CAACL,UAAU;IAACiD,EAAE,EAAC,MAAM;IAACC,OAAO,EAAC,QAAQ;IAACC,KAAK,EAAC;EAAW,GACrDR,KACS,CACK,CAAC;AAAA,CACrB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"shared.js","names":["React","styled","css","PlayIcon","TreeDotsIcon","STACKED_CARD_CONTROL_CLASS","StackedCardCollapseGlyph","CollapseGlyph","StackedCardCoverButton","CoverButton","StackedCardPlayBadge","PlayBadge","StackedCardRemoveCoverGlyph","RemoveCoverGlyph","Body2","Caption2","Typography","CARD_FONT","COVER_RATIO_HERO","COVER_RATIO_IMAGE","COVER_RATIO_SWATCH","playControl","createElement","coverManagement","_temp","_ref","_ref$removeLabel","removeLabel","onCollapse","onRemove","Fragment","type","onClick","StyledEntityDots","button","withConfig","displayName","componentId","EntityDots","props","_extends","className","StyledClamp","StyledTitleBlock","div","StyledProjectLine","CardProjectLine","_ref2","children","color","StyledFavicon","span","_ref3","$bg","StyledChip","StyledColorCover","_ref4","$color","StyledPlaceholder","_ref5","$height","_ref6","$dashed","Placeholder","_ref7","icon","label","height","dashed","rest","_objectWithoutPropertiesLoose","_excluded","as","variant"],"sources":["../../../../../src/presentation/stackedCard/content/shared.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from \"react\";\n\nimport styled, { css } from \"styled-components\";\n\nimport { PlayIcon, TreeDotsIcon } from \"../../../components/Icons\";\nimport {\n STACKED_CARD_CONTROL_CLASS,\n StackedCardCollapseGlyph as CollapseGlyph,\n StackedCardCoverButton as CoverButton,\n StackedCardPlayBadge as PlayBadge,\n StackedCardRemoveCoverGlyph as RemoveCoverGlyph,\n} from \"../../../components/StackedCard\";\nimport { Body2, Caption2 } from \"../../../components/Typography\";\nimport { Typography } from \"../../../components/Typography/Typography\";\n\n/**\n * Content-level chrome shared by the typed StackedCard components.\n *\n * These live OUTSIDE the shell on purpose. The shell is hollow; the \"…\" entity\n * menu, the cover-management controls, the clamp, the favicon, the chips and\n * the placeholder frame are content concerns, so they belong here where the\n * typed cards (TaskCard, LinkCard, …) compose them.\n *\n * The card itself — the shell, the Stack/StackRow/Cover primitives and the\n * cover chrome — is the shipped design-system component,\n * `components/StackedCard`. These stories import it under the concept\n * vocabulary (Cover, StackRow, …) so the spec prose and the code keep using\n * the same words.\n */\n\n/* ------------------------------------------------------------------ */\n/* The font stack for raw text */\n/* ------------------------------------------------------------------ */\n\n/**\n * There is no global CSS reset in this Storybook, so a raw element (a `<span>`\n * holding a date, a `<button>` holding a word) falls back to the browser default\n * — a SERIF face at the UA's own size. Anything that is not a DS `Typography`\n * has to name the font itself. Use a DS Typography where one fits; use this\n * where the app itself sets the size in CSS (the column card's date row is a\n * plain `div` in `view.project_tasks_column_mode.less`, not a Typography).\n */\nexport const CARD_FONT = `-apple-system, BlinkMacSystemFont, \"Roboto\",\n \"Helvetica Neue\", Arial, sans-serif`;\n\n/* ------------------------------------------------------------------ */\n/* Per-type cover ratios */\n/* ------------------------------------------------------------------ */\n\n/**\n * The design system ships one default cover ratio\n * (`STACKED_CARD_COVER_RATIO`). How tall a cover reads is a decision of the\n * content type, so the variants live here with the content: a link hero, a\n * full-bleed image, a colour swatch band.\n */\nexport const COVER_RATIO_HERO = \"320 / 190\";\nexport const COVER_RATIO_IMAGE = \"260 / 168\";\nexport const COVER_RATIO_SWATCH = \"260 / 104\";\n\n/* ------------------------------------------------------------------ */\n/* Cover chrome — media control + cover management */\n/* ------------------------------------------------------------------ */\n\n/** Centered media control (play), for a cover that wraps audio/video. */\nexport const playControl = (\n <PlayBadge>\n <PlayIcon />\n </PlayBadge>\n);\n\n/**\n * Top-right cover management. Acts on the COVER (collapse it, remove it) — not\n * on the entity. Callers wire the click handlers; the default is inert chrome\n * for the static demos.\n */\nexport const coverManagement = ({\n removeLabel = \"Remove cover\",\n onCollapse,\n onRemove,\n}: {\n removeLabel?: string;\n onCollapse?: () => void;\n onRemove?: () => void;\n} = {}): ReactElement => (\n <>\n <CoverButton type=\"button\" aria-label=\"Collapse cover\" onClick={onCollapse}>\n <CollapseGlyph />\n </CoverButton>\n <CoverButton type=\"button\" aria-label={removeLabel} onClick={onRemove}>\n <RemoveCoverGlyph />\n </CoverButton>\n </>\n);\n\n/* ------------------------------------------------------------------ */\n/* Entity \"…\" menu — acts on the ENTITY, lives in a content row */\n/* ------------------------------------------------------------------ */\n\nconst StyledEntityDots = styled.button`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: 0;\n border-radius: 6px;\n cursor: pointer;\n color: var(--color-theme-700);\n background: var(--color-theme-200);\n\n svg {\n width: 16px;\n height: 16px;\n display: block;\n }\n\n &:hover {\n background: var(--color-theme-300);\n }\n`;\n\nexport const EntityDots = (\n props: React.ButtonHTMLAttributes<HTMLButtonElement>\n): ReactElement => (\n <StyledEntityDots\n type=\"button\"\n aria-label=\"Options\"\n data-fixed\n className={STACKED_CARD_CONTROL_CLASS}\n {...props}\n >\n <TreeDotsIcon />\n </StyledEntityDots>\n);\n\n/* ------------------------------------------------------------------ */\n/* Text + inline bits */\n/* ------------------------------------------------------------------ */\n\n/** Two-line title clamp — the card's name row content. */\nexport const StyledClamp = styled(Body2)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n`;\n\n/**\n * The title block — everything the title row stacks to the LEFT of the \"…\"\n * menu. A card that only has a title puts the clamp straight in the row; a card\n * that puts a line above or below it (the project a task belongs to, the client\n * a project is for) stacks them here so the row keeps its two-child shape:\n * text block, then the fixed-width menu.\n */\nexport const StyledTitleBlock = styled.div`\n display: flex;\n flex-direction: column;\n min-width: 0;\n`;\n\n/**\n * The project a card's entity lives in, above the title.\n *\n * On a canvas a task card has lost the column that used to say which project it\n * came from, so the card says it itself. One line, one treatment, shared by\n * every content type that can carry it (the whiteboard's own task face already\n * wrote it this way: `Caption 2` tertiary, tight above the title, ellipsis on\n * overflow — a project name is a reference, never a second title).\n */\nexport const StyledProjectLine = styled(Caption2)`\n display: block;\n margin-bottom: 2px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n`;\n\nexport const CardProjectLine = ({\n children,\n}: {\n children: ReactNode;\n}): ReactElement => (\n <StyledProjectLine color=\"tertiary\" className=\"sc-project\">\n {children}\n </StyledProjectLine>\n);\n\n/** A favicon square — a solid data colour stands in for the real favicon. */\nexport const StyledFavicon = styled.span<{ $bg: string }>`\n display: inline-flex;\n width: 16px;\n height: 16px;\n border-radius: 4px;\n background: ${({ $bg }) => $bg};\n flex-shrink: 0;\n`;\n\n/** A small pill for link metadata (media kind, duration, …). */\nexport const StyledChip = styled.span`\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 10px;\n background: var(--color-theme-300);\n color: var(--color-theme-800);\n font-size: 11px;\n white-space: nowrap;\n`;\n\n/** A solid-colour cover fill (swatch value, generic link cover, image stand-in). */\nexport const StyledColorCover = styled.div<{ $color: string }>`\n width: 100%;\n height: 100%;\n background: ${({ $color }) => $color};\n`;\n\n/* ------------------------------------------------------------------ */\n/* Placeholder frame — the interactive empty state, per type */\n/* ------------------------------------------------------------------ */\n\nconst StyledPlaceholder = styled.button<{\n $height?: number;\n $dashed?: boolean;\n}>`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n height: ${({ $height }) => $height ?? 150}px;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--color-theme-600);\n text-align: center;\n cursor: pointer;\n\n ${({ $dashed }) =>\n $dashed &&\n css`\n margin: 8px;\n width: calc(100% - 16px);\n border: 1.5px dashed var(--color-theme-400);\n border-radius: 6px;\n\n &:hover {\n border-color: var(--sc-selection-ring);\n color: var(--color-theme-700);\n }\n `}\n\n > svg {\n width: 40px;\n height: 40px;\n color: var(--color-theme-500);\n }\n`;\n\n/**\n * The shared placeholder frame. Each type supplies its own icon and verb-first,\n * sentence-case invitation (ActiveCollab voice). Interactive by design — the\n * whole frame is a button — and distinct from the loading skeleton.\n */\nexport const Placeholder = ({\n icon,\n label,\n height,\n dashed,\n ...rest\n}: {\n icon: ReactNode;\n label: ReactNode;\n height?: number;\n dashed?: boolean;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>): ReactElement => (\n <StyledPlaceholder type=\"button\" $height={height} $dashed={dashed} {...rest}>\n {icon}\n <Typography as=\"span\" variant=\"Body 2\" color=\"secondary\">\n {label}\n </Typography>\n </StyledPlaceholder>\n);\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAmC,OAAO;AAEtD,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAE/C,SAASC,QAAQ,EAAEC,YAAY,QAAQ,2BAA2B;AAClE,SACEC,0BAA0B,EAC1BC,wBAAwB,IAAIC,aAAa,EACzCC,sBAAsB,IAAIC,WAAW,EACrCC,oBAAoB,IAAIC,SAAS,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A,CAAAsB,aAAA,CAACN,UAAU;IAACwD,EAAE,EAAC,MAAM;IAACC,OAAO,EAAC,QAAQ;IAACxB,KAAK,EAAC;EAAW,GACrDiB,KACS,CACK,CAAC;AAAA,CACrB","ignoreList":[]}
|
|
@@ -2,31 +2,54 @@ import React, { ReactElement, ReactNode } from "react";
|
|
|
2
2
|
export declare const ToolSurface: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
export declare const verticalDivider = "\n .divider {\n width: 1px;\n height: 24px;\n background-color: var(--color-theme-400);\n margin: 0 6px;\n flex-shrink: 0;\n }\n";
|
|
4
4
|
export declare const StyledBottomDock: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The floating second toolbar row — a small pill above the dock that holds the
|
|
7
|
+
* members of one tool family (Circle / Rectangle / Triangle, or Task / Project).
|
|
8
|
+
*
|
|
9
|
+
* It is the same surface as the dock itself, so a family reads as an extension
|
|
10
|
+
* of the button that opened it rather than as a different kind of UI. Only one
|
|
11
|
+
* pill is ever up, because only one tool is ever armed.
|
|
12
|
+
*/
|
|
13
|
+
export declare const StyledToolPill: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
14
|
export declare const StyledHint: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../..").ICaptionProps & Omit<import("../../components/Typography/Typography").ITypographyProps, "variant" | "weight"> & React.RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
7
15
|
export declare const TOOL_HINTS: {
|
|
8
16
|
readonly circle: "Click to drop a default circle, or draw one to size. Press O for a circle.";
|
|
9
17
|
readonly roundedRectangle: "Click to drop a default rectangle, or draw one to size. Press R for a rectangle.";
|
|
10
18
|
readonly triangle: "Click to drop a default triangle, or draw one to size. Press Y for a triangle.";
|
|
11
19
|
readonly connector: "Drag from one element to another to connect them. Press C to connect.";
|
|
20
|
+
readonly projectElements: "Put a task or a project on the board — pick which above, then draw its card.";
|
|
21
|
+
readonly project: "Draw a box to place a project card, then pick the project it shows.";
|
|
22
|
+
readonly task: "Draw a box to place a task card, then pick the task it shows.";
|
|
12
23
|
readonly link: "Draw a box to place a link, or paste a URL anywhere. Press L for link.";
|
|
13
24
|
readonly file: "Draw a box to place a file, or drop one on the board. Press F for file.";
|
|
14
25
|
readonly sticky: "Click anywhere on the canvas to drop a sticky note. Press S for a sticky note.";
|
|
15
26
|
readonly text: "Click anywhere on the canvas to start typing. Press T for text.";
|
|
16
27
|
readonly draw: "Click and drag to draw freehand. Press D for the pen.";
|
|
17
|
-
readonly shapes: "
|
|
28
|
+
readonly shapes: "Pick a shape above, then draw it on the board. Press R for a rectangle.";
|
|
18
29
|
};
|
|
19
30
|
export type ToolHintKey = keyof typeof TOOL_HINTS;
|
|
20
31
|
export type ShapeTool = "circle" | "roundedRectangle" | "triangle";
|
|
21
32
|
/**
|
|
22
|
-
* The armed board tool. Link, File and the three shapes are
|
|
23
|
-
* turns the next canvas click into "drop the default-size
|
|
24
|
-
* drag into "draw one this big"; everything else stays a
|
|
25
|
-
* otherwise always in select mode.
|
|
33
|
+
* The armed board tool. Link, File, Project, Task and the three shapes are
|
|
34
|
+
* wired — arming one turns the next canvas click into "drop the default-size
|
|
35
|
+
* element here" and a drag into "draw one this big"; everything else stays a
|
|
36
|
+
* mock, so the board is otherwise always in select mode.
|
|
26
37
|
*/
|
|
27
|
-
export type BoardTool = "select" | "link" | "file" | ShapeTool;
|
|
38
|
+
export type BoardTool = "select" | "link" | "file" | "project" | "task" | ShapeTool;
|
|
28
39
|
export declare const SHAPE_TOOLS: readonly ShapeTool[];
|
|
29
40
|
export declare const isShapeTool: (tool: BoardTool) => tool is ShapeTool;
|
|
41
|
+
/**
|
|
42
|
+
* What a dock button arms the instant its pill opens.
|
|
43
|
+
*
|
|
44
|
+
* Opening a family and choosing inside it are two separate decisions, and the
|
|
45
|
+
* second one has a right answer often enough that asking for it every time is
|
|
46
|
+
* just a toll: a shape is usually a rectangle, and the thing people put on a
|
|
47
|
+
* board is usually a task. So the pill opens with that member already armed and
|
|
48
|
+
* the gesture can start immediately — picking another member is a correction,
|
|
49
|
+
* not a required step.
|
|
50
|
+
*/
|
|
51
|
+
export declare const DEFAULT_SHAPE_TOOL: ShapeTool;
|
|
52
|
+
export declare const DEFAULT_PROJECT_ELEMENT_TOOL: BoardTool;
|
|
30
53
|
export declare const SHAPE_DEFAULT_SIZES: Record<ShapeTool, {
|
|
31
54
|
width: number;
|
|
32
55
|
height: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottomDock.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/bottomDock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"bottomDock.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/bottomDock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AA4BjE,eAAO,MAAM,WAAW,oEA2BvB,CAAC;AAGF,eAAO,MAAM,eAAe,sJAQ3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,oEAU5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,oEAAwB,CAAC;AAIpD,eAAO,MAAM,UAAU,mQAQtB,CAAC;AAGF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;CAsBb,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,kBAAkB,GAAG,UAAU,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,MAAM,GACN,MAAM,GACN,SAAS,GACT,MAAM,GACN,SAAS,CAAC;AAEd,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAI3C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,MAAM,SAAS,KAAG,IAAI,IAAI,SACH,CAAC;AAEpD;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAA8B,CAAC;AAChE,eAAO,MAAM,4BAA4B,EAAE,SAAkB,CAAC;AAI9D,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,SAAS,EACT;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAKlC,CAAC;AAIF,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,oDAAoD;AACpD,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,UAAU,GAAI,iEAOxB,eAAe,KAAG,YAYpB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,SAAS,CAAC;IACtB,YAAY,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACzC;AAMD,eAAO,MAAM,UAAU,GAAI,+BAGxB,eAAe,KAAG,YAyKpB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { IconButton } from "../../components/IconButton";
|
|
5
|
-
import { AttachmentIcon, CircleIcon, ConnectionIcon, DrawIcon, InsertLinkIcon, RoundedRectangleIcon, ShapesIcon, NoteIcon, TextIcon, TriangleIcon } from "../../components/Icons";
|
|
5
|
+
import { AttachmentIcon, CircleIcon, ConnectionIcon, DrawIcon, InsertLinkIcon, ProjectIcon, ProjectStarIcon, RoundedRectangleIcon, ShapesIcon, NoteIcon, TaskIcon, TextIcon, TriangleIcon } from "../../components/Icons";
|
|
6
6
|
import { Tooltip } from "../../components/Tooltip";
|
|
7
7
|
import { Caption1 } from "../../components/Typography";
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ import { Caption1 } from "../../components/Typography";
|
|
|
14
14
|
export const ToolSurface = styled.div.withConfig({
|
|
15
15
|
displayName: "bottomDock__ToolSurface",
|
|
16
16
|
componentId: "sc-1xsxwg0-0"
|
|
17
|
-
})(["display:flex;align-items:center;gap:2px;padding:6px;border-radius:14px;background-color:var(--page-paper-main);box-shadow:0 6px 24px rgba(0,0,0,0.16);border:1px solid var(--border-primary);"]);
|
|
17
|
+
})(["display:flex;align-items:center;gap:2px;padding:6px;border-radius:14px;background-color:var(--page-paper-main);box-shadow:0 6px 24px rgba(0,0,0,0.16);border:1px solid var(--border-primary);svg > [stroke],svg > g [stroke]{stroke:currentColor;}"]);
|
|
18
18
|
|
|
19
19
|
/* vertical separator used inside the toolbars */
|
|
20
20
|
export const verticalDivider = "\n .divider {\n width: 1px;\n height: 24px;\n background-color: var(--color-theme-400);\n margin: 0 6px;\n flex-shrink: 0;\n }\n";
|
|
@@ -23,9 +23,16 @@ export const StyledBottomDock = styled.div.withConfig({
|
|
|
23
23
|
componentId: "sc-1xsxwg0-1"
|
|
24
24
|
})(["position:absolute;left:50%;bottom:18px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:10px;max-width:calc(100% - 32px);"]);
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The floating second toolbar row — a small pill above the dock that holds the
|
|
28
|
+
* members of one tool family (Circle / Rectangle / Triangle, or Task / Project).
|
|
29
|
+
*
|
|
30
|
+
* It is the same surface as the dock itself, so a family reads as an extension
|
|
31
|
+
* of the button that opened it rather than as a different kind of UI. Only one
|
|
32
|
+
* pill is ever up, because only one tool is ever armed.
|
|
33
|
+
*/
|
|
34
|
+
export const StyledToolPill = styled(ToolSurface).withConfig({
|
|
35
|
+
displayName: "bottomDock__StyledToolPill",
|
|
29
36
|
componentId: "sc-1xsxwg0-2"
|
|
30
37
|
})([""]);
|
|
31
38
|
|
|
@@ -42,24 +49,40 @@ export const TOOL_HINTS = {
|
|
|
42
49
|
roundedRectangle: "Click to drop a default rectangle, or draw one to size. Press R for a rectangle.",
|
|
43
50
|
triangle: "Click to drop a default triangle, or draw one to size. Press Y for a triangle.",
|
|
44
51
|
connector: "Drag from one element to another to connect them. Press C to connect.",
|
|
52
|
+
projectElements: "Put a task or a project on the board — pick which above, then draw its card.",
|
|
53
|
+
project: "Draw a box to place a project card, then pick the project it shows.",
|
|
54
|
+
task: "Draw a box to place a task card, then pick the task it shows.",
|
|
45
55
|
link: "Draw a box to place a link, or paste a URL anywhere. Press L for link.",
|
|
46
56
|
file: "Draw a box to place a file, or drop one on the board. Press F for file.",
|
|
47
57
|
sticky: "Click anywhere on the canvas to drop a sticky note. Press S for a sticky note.",
|
|
48
58
|
text: "Click anywhere on the canvas to start typing. Press T for text.",
|
|
49
59
|
draw: "Click and drag to draw freehand. Press D for the pen.",
|
|
50
|
-
shapes: "
|
|
60
|
+
shapes: "Pick a shape above, then draw it on the board. Press R for a rectangle."
|
|
51
61
|
};
|
|
52
62
|
|
|
53
63
|
/**
|
|
54
|
-
* The armed board tool. Link, File and the three shapes are
|
|
55
|
-
* turns the next canvas click into "drop the default-size
|
|
56
|
-
* drag into "draw one this big"; everything else stays a
|
|
57
|
-
* otherwise always in select mode.
|
|
64
|
+
* The armed board tool. Link, File, Project, Task and the three shapes are
|
|
65
|
+
* wired — arming one turns the next canvas click into "drop the default-size
|
|
66
|
+
* element here" and a drag into "draw one this big"; everything else stays a
|
|
67
|
+
* mock, so the board is otherwise always in select mode.
|
|
58
68
|
*/
|
|
59
69
|
|
|
60
70
|
export const SHAPE_TOOLS = ["circle", "roundedRectangle", "triangle"];
|
|
61
71
|
export const isShapeTool = tool => SHAPE_TOOLS.includes(tool);
|
|
62
72
|
|
|
73
|
+
/**
|
|
74
|
+
* What a dock button arms the instant its pill opens.
|
|
75
|
+
*
|
|
76
|
+
* Opening a family and choosing inside it are two separate decisions, and the
|
|
77
|
+
* second one has a right answer often enough that asking for it every time is
|
|
78
|
+
* just a toll: a shape is usually a rectangle, and the thing people put on a
|
|
79
|
+
* board is usually a task. So the pill opens with that member already armed and
|
|
80
|
+
* the gesture can start immediately — picking another member is a correction,
|
|
81
|
+
* not a required step.
|
|
82
|
+
*/
|
|
83
|
+
export const DEFAULT_SHAPE_TOOL = "roundedRectangle";
|
|
84
|
+
export const DEFAULT_PROJECT_ELEMENT_TOOL = "task";
|
|
85
|
+
|
|
63
86
|
/* What a plain click drops — mirrors DEFAULT_SHAPE_SIZES in
|
|
64
87
|
new-activecollab-front, and is exactly what the hover preview promises. */
|
|
65
88
|
export const SHAPE_DEFAULT_SIZES = {
|
|
@@ -100,7 +123,10 @@ export const ToolButton = _ref => {
|
|
|
100
123
|
onMouseLeave: onMouseLeave
|
|
101
124
|
}, children));
|
|
102
125
|
};
|
|
103
|
-
/* Bottom-centre tool dock
|
|
126
|
+
/* Bottom-centre tool dock: the family pill (when one is open), the main
|
|
127
|
+
toolbar, and the shared hint line. The dock is anchored by its BOTTOM edge,
|
|
128
|
+
so a pill appearing or disappearing grows the stack upwards and never moves
|
|
129
|
+
the toolbar itself. */
|
|
104
130
|
export const BottomDock = _ref2 => {
|
|
105
131
|
let activeTool = _ref2.activeTool,
|
|
106
132
|
onToolChange = _ref2.onToolChange;
|
|
@@ -116,37 +142,58 @@ export const BottomDock = _ref2 => {
|
|
|
116
142
|
gesture happens on the canvas, so that is exactly when the instruction is
|
|
117
143
|
needed. */
|
|
118
144
|
const hint = hoverHint != null ? hoverHint : activeTool === "select" ? null : TOOL_HINTS[activeTool];
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
145
|
+
|
|
146
|
+
/* Which pill is up. Both are DERIVED from the armed tool rather than kept as
|
|
147
|
+
their own open/closed state: opening a pill always arms one of its members,
|
|
148
|
+
so "a member of this family is armed" and "this pill is showing" are the
|
|
149
|
+
same fact. Deriving it is what makes every way of leaving the family close
|
|
150
|
+
the pill for free — another dock tool, Esc on the canvas, or the gesture
|
|
151
|
+
finishing and disarming the tool. Two states could disagree; one cannot. */
|
|
152
|
+
const shapesOpen = isShapeTool(activeTool);
|
|
153
|
+
const projectElementsOpen = activeTool === "task" || activeTool === "project";
|
|
154
|
+
return /*#__PURE__*/React.createElement(StyledBottomDock, null, shapesOpen ? /*#__PURE__*/React.createElement(StyledToolPill, null, /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
155
|
+
tip: "Circle",
|
|
123
156
|
active: activeTool === "circle",
|
|
124
|
-
onClick: () => onToolChange(
|
|
125
|
-
}, hoverProps("circle")), /*#__PURE__*/React.createElement(CircleIcon, null))
|
|
126
|
-
|
|
127
|
-
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
128
|
-
variant: "text gray",
|
|
157
|
+
onClick: () => onToolChange("circle")
|
|
158
|
+
}, hoverProps("circle")), /*#__PURE__*/React.createElement(CircleIcon, null)), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
159
|
+
tip: "Rectangle",
|
|
129
160
|
active: activeTool === "roundedRectangle",
|
|
130
|
-
onClick: () => onToolChange(
|
|
131
|
-
}, hoverProps("roundedRectangle")), /*#__PURE__*/React.createElement(RoundedRectangleIcon, null))
|
|
132
|
-
|
|
133
|
-
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
134
|
-
variant: "text gray",
|
|
161
|
+
onClick: () => onToolChange("roundedRectangle")
|
|
162
|
+
}, hoverProps("roundedRectangle")), /*#__PURE__*/React.createElement(RoundedRectangleIcon, null)), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
163
|
+
tip: "Triangle",
|
|
135
164
|
active: activeTool === "triangle",
|
|
136
|
-
onClick: () => onToolChange(
|
|
137
|
-
}, hoverProps("triangle")), /*#__PURE__*/React.createElement(TriangleIcon, null)))
|
|
165
|
+
onClick: () => onToolChange("triangle")
|
|
166
|
+
}, hoverProps("triangle")), /*#__PURE__*/React.createElement(TriangleIcon, null))) : null, projectElementsOpen ? /*#__PURE__*/React.createElement(StyledToolPill, null, /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
167
|
+
tip: "Task",
|
|
168
|
+
active: activeTool === "task",
|
|
169
|
+
onClick: () => onToolChange("task")
|
|
170
|
+
}, hoverProps("task")), /*#__PURE__*/React.createElement(TaskIcon, null)), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
171
|
+
tip: "Project",
|
|
172
|
+
active: activeTool === "project",
|
|
173
|
+
onClick: () => onToolChange("project")
|
|
174
|
+
}, hoverProps("project")), /*#__PURE__*/React.createElement(ProjectIcon, null))) : null, /*#__PURE__*/React.createElement(ToolSurface, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
138
175
|
title: "Sticky Note"
|
|
139
176
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
140
|
-
variant: "text gray"
|
|
177
|
+
variant: "text gray",
|
|
178
|
+
onClick: () => onToolChange("select")
|
|
141
179
|
}, hoverProps("sticky")), /*#__PURE__*/React.createElement(NoteIcon, null))), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
142
|
-
tip: "Text"
|
|
180
|
+
tip: "Text",
|
|
181
|
+
onClick: () => onToolChange("select")
|
|
143
182
|
}, hoverProps("text")), /*#__PURE__*/React.createElement(TextIcon, null)), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
144
|
-
tip: "Draw"
|
|
183
|
+
tip: "Draw",
|
|
184
|
+
onClick: () => onToolChange("select")
|
|
145
185
|
}, hoverProps("draw")), /*#__PURE__*/React.createElement(DrawIcon, null)), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
146
|
-
tip: "Shape"
|
|
186
|
+
tip: "Shape",
|
|
187
|
+
active: shapesOpen,
|
|
188
|
+
onClick: () => onToolChange(shapesOpen ? "select" : DEFAULT_SHAPE_TOOL)
|
|
147
189
|
}, hoverProps("shapes")), /*#__PURE__*/React.createElement(ShapesIcon, null)), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
148
|
-
tip: "Connect"
|
|
190
|
+
tip: "Connect",
|
|
191
|
+
onClick: () => onToolChange("select")
|
|
149
192
|
}, hoverProps("connector")), /*#__PURE__*/React.createElement(ConnectionIcon, null)), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
193
|
+
tip: "Project Elements",
|
|
194
|
+
active: projectElementsOpen,
|
|
195
|
+
onClick: () => onToolChange(projectElementsOpen ? "select" : DEFAULT_PROJECT_ELEMENT_TOOL)
|
|
196
|
+
}, hoverProps("projectElements")), /*#__PURE__*/React.createElement(ProjectStarIcon, null)), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
150
197
|
tip: "Link",
|
|
151
198
|
active: activeTool === "link",
|
|
152
199
|
onClick: () => onToolChange(activeTool === "link" ? "select" : "link")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottomDock.js","names":["React","useState","styled","IconButton","AttachmentIcon","CircleIcon","ConnectionIcon","DrawIcon","InsertLinkIcon","RoundedRectangleIcon","ShapesIcon","NoteIcon","TextIcon","TriangleIcon","Tooltip","Caption1","ToolSurface","div","withConfig","displayName","componentId","verticalDivider","StyledBottomDock","StyledShapePicker","StyledHint","TOOL_HINTS","circle","roundedRectangle","triangle","connector","link","file","sticky","text","draw","shapes","SHAPE_TOOLS","isShapeTool","tool","includes","SHAPE_DEFAULT_SIZES","width","height","CARD_PREVIEW_HEIGHT","ToolButton","_ref","tip","active","children","onClick","onMouseEnter","onMouseLeave","createElement","title","variant","BottomDock","_ref2","activeTool","onToolChange","_useState","hoverHint","setHoverHint","hoverProps","hint","_extends","color","className","undefined"],"sources":["../../../../src/presentation/whiteboard/bottomDock.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode, useState } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport { IconButton } from \"../../components/IconButton\";\nimport {\n AttachmentIcon,\n CircleIcon,\n ConnectionIcon,\n DrawIcon,\n InsertLinkIcon,\n RoundedRectangleIcon,\n ShapesIcon,\n NoteIcon,\n TextIcon,\n TriangleIcon,\n} from \"../../components/Icons\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { Caption1 } from \"../../components/Typography\";\n\n/* ------------------------------------------------------------------ */\n/* Floating toolbar surfaces */\n/* ------------------------------------------------------------------ */\n\n/* A floating, rounded toolbar surface (paper + shadow). */\nexport const ToolSurface = styled.div`\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 6px;\n border-radius: 14px;\n background-color: var(--page-paper-main);\n box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);\n border: 1px solid var(--border-primary);\n`;\n\n/* vertical separator used inside the toolbars */\nexport const verticalDivider = `\n .divider {\n width: 1px;\n height: 24px;\n background-color: var(--color-theme-400);\n margin: 0 6px;\n flex-shrink: 0;\n }\n`;\n\nexport const StyledBottomDock = styled.div`\n position: absolute;\n left: 50%;\n bottom: 18px;\n transform: translateX(-50%);\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 10px;\n max-width: calc(100% - 32px);\n`;\n\n/* shape sub-toolbar: Circle / Rectangle / Triangle */\nexport const StyledShapePicker = styled(ToolSurface)``;\n\n/* Reserve two Caption1 lines (2 × 16px) so showing/hiding the hint never\n shifts the dock; visibility keeps the reserved space when hidden. */\nexport const StyledHint = styled(Caption1)`\n text-align: center;\n padding: 0 16px;\n min-height: 32px;\n\n &.hint-hidden {\n visibility: hidden;\n }\n`;\n\n/* Per-tool hint shown under the dock only while that tool is hovered. */\nexport const TOOL_HINTS = {\n circle:\n \"Click to drop a default circle, or draw one to size. Press O for a circle.\",\n roundedRectangle:\n \"Click to drop a default rectangle, or draw one to size. Press R for a rectangle.\",\n triangle:\n \"Click to drop a default triangle, or draw one to size. Press Y for a triangle.\",\n connector:\n \"Drag from one element to another to connect them. Press C to connect.\",\n link: \"Draw a box to place a link, or paste a URL anywhere. Press L for link.\",\n file: \"Draw a box to place a file, or drop one on the board. Press F for file.\",\n sticky:\n \"Click anywhere on the canvas to drop a sticky note. Press S for a sticky note.\",\n text: \"Click anywhere on the canvas to start typing. Press T for text.\",\n draw: \"Click and drag to draw freehand. Press D for the pen.\",\n shapes:\n \"Start drawing the shape on canvas to see the result. Press R to draw a rectangle.\",\n} as const;\n\nexport type ToolHintKey = keyof typeof TOOL_HINTS;\n\nexport type ShapeTool = \"circle\" | \"roundedRectangle\" | \"triangle\";\n\n/**\n * The armed board tool. Link, File and the three shapes are wired — arming one\n * turns the next canvas click into \"drop the default-size element here\" and a\n * drag into \"draw one this big\"; everything else stays a mock, so the board is\n * otherwise always in select mode.\n */\nexport type BoardTool = \"select\" | \"link\" | \"file\" | ShapeTool;\n\nexport const SHAPE_TOOLS: readonly ShapeTool[] = [\n \"circle\",\n \"roundedRectangle\",\n \"triangle\",\n];\n\nexport const isShapeTool = (tool: BoardTool): tool is ShapeTool =>\n (SHAPE_TOOLS as readonly string[]).includes(tool);\n\n/* What a plain click drops — mirrors DEFAULT_SHAPE_SIZES in\n new-activecollab-front, and is exactly what the hover preview promises. */\nexport const SHAPE_DEFAULT_SIZES: Record<\n ShapeTool,\n { width: number; height: number }\n> = {\n roundedRectangle: { width: 100, height: 60 },\n circle: { width: 80, height: 80 },\n triangle: { width: 80, height: 80 },\n};\n\n/* Cards are auto-height, so their hover preview uses the app's nominal wire\n height (DEFAULT_LINK_CARD_SIZE / DEFAULT_FILE_CARD_SIZE). */\nexport const CARD_PREVIEW_HEIGHT = 240;\n\n/** The kinds of card the draw gesture can place. */\nexport type DrawableTool = Exclude<BoardTool, \"select\">;\n\nexport interface ToolButtonProps {\n tip: string;\n active?: boolean;\n children: ReactNode;\n onClick?: () => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n}\n\nexport const ToolButton = ({\n tip,\n active,\n children,\n onClick,\n onMouseEnter,\n onMouseLeave,\n}: ToolButtonProps): ReactElement => (\n <Tooltip title={tip}>\n <IconButton\n variant=\"text gray\"\n active={active}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n {children}\n </IconButton>\n </Tooltip>\n);\n\nexport interface BottomDockProps {\n activeTool: BoardTool;\n onToolChange: (tool: BoardTool) => void;\n}\n\n/* Bottom-centre tool dock (shape picker + main toolbar + hint). */\nexport const BottomDock = ({\n activeTool,\n onToolChange,\n}: BottomDockProps): ReactElement => {\n const [hoverHint, setHoverHint] = useState<string | null>(null);\n\n const hoverProps = (tool: ToolHintKey): Record<string, () => void> => ({\n onMouseEnter: () => setHoverHint(TOOL_HINTS[tool]),\n onMouseLeave: () => setHoverHint(null),\n });\n\n /* An armed tool keeps its hint up after the pointer leaves the dock — the\n gesture happens on the canvas, so that is exactly when the instruction is\n needed. */\n const hint =\n hoverHint ?? (activeTool === \"select\" ? null : TOOL_HINTS[activeTool]);\n\n return (\n <StyledBottomDock>\n <StyledShapePicker>\n <Tooltip title=\"Circle\">\n <IconButton\n variant=\"text gray\"\n active={activeTool === \"circle\"}\n onClick={() =>\n onToolChange(activeTool === \"circle\" ? \"select\" : \"circle\")\n }\n {...hoverProps(\"circle\")}\n >\n <CircleIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Rectangle\">\n <IconButton\n variant=\"text gray\"\n active={activeTool === \"roundedRectangle\"}\n onClick={() =>\n onToolChange(\n activeTool === \"roundedRectangle\"\n ? \"select\"\n : \"roundedRectangle\"\n )\n }\n {...hoverProps(\"roundedRectangle\")}\n >\n <RoundedRectangleIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Triangle\">\n <IconButton\n variant=\"text gray\"\n active={activeTool === \"triangle\"}\n onClick={() =>\n onToolChange(activeTool === \"triangle\" ? \"select\" : \"triangle\")\n }\n {...hoverProps(\"triangle\")}\n >\n <TriangleIcon />\n </IconButton>\n </Tooltip>\n </StyledShapePicker>\n\n <ToolSurface>\n <Tooltip title=\"Sticky Note\">\n <IconButton variant=\"text gray\" {...hoverProps(\"sticky\")}>\n <NoteIcon />\n </IconButton>\n </Tooltip>\n <ToolButton tip=\"Text\" {...hoverProps(\"text\")}>\n <TextIcon />\n </ToolButton>\n <ToolButton tip=\"Draw\" {...hoverProps(\"draw\")}>\n <DrawIcon />\n </ToolButton>\n <ToolButton tip=\"Shape\" {...hoverProps(\"shapes\")}>\n <ShapesIcon />\n </ToolButton>\n <ToolButton tip=\"Connect\" {...hoverProps(\"connector\")}>\n <ConnectionIcon />\n </ToolButton>\n <ToolButton\n tip=\"Link\"\n active={activeTool === \"link\"}\n onClick={() =>\n onToolChange(activeTool === \"link\" ? \"select\" : \"link\")\n }\n {...hoverProps(\"link\")}\n >\n <InsertLinkIcon />\n </ToolButton>\n <ToolButton\n tip=\"File\"\n active={activeTool === \"file\"}\n onClick={() =>\n onToolChange(activeTool === \"file\" ? \"select\" : \"file\")\n }\n {...hoverProps(\"file\")}\n >\n <AttachmentIcon />\n </ToolButton>\n </ToolSurface>\n\n <StyledHint color=\"tertiary\" className={hint ? undefined : \"hint-hidden\"}>\n {hint ?? \" \"}\n </StyledHint>\n </StyledBottomDock>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAA6BC,QAAQ,QAAQ,OAAO;AAEhE,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SACEC,cAAc,EACdC,UAAU,EACVC,cAAc,EACdC,QAAQ,EACRC,cAAc,EACdC,oBAAoB,EACpBC,UAAU,EACVC,QAAQ,EACRC,QAAQ,EACRC,YAAY,QACP,wBAAwB;AAC/B,SAASC,OAAO,QAAQ,0BAA0B;AAClD,SAASC,QAAQ,QAAQ,6BAA6B;;AAEtD;AACA;AACA;;AAEA;AACA,OAAO,MAAMC,WAAW,GAAGd,MAAM,CA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AAA,CAAAoD,aAAA,CAAC5C,cAAc,MAAE,CACP,CAAC,eACbR,KAAA,CAAAoD,aAAA,CAACR,UAAU,EAAAoB,QAAA;IACTlB,GAAG,EAAC,MAAM;IACVC,MAAM,EAAEU,UAAU,KAAK,MAAO;IAC9BR,OAAO,EAAEA,CAAA,KACPS,YAAY,CAACD,UAAU,KAAK,MAAM,GAAG,QAAQ,GAAG,MAAM;EACvD,GACGK,UAAU,CAAC,MAAM,CAAC,gBAEtB9D,KAAA,CAAAoD,aAAA,CAAChD,cAAc,MAAE,CACP,CACD,CAAC,eAEdJ,KAAA,CAAAoD,aAAA,CAAC5B,UAAU;IAACyC,KAAK,EAAC,UAAU;IAACC,SAAS,EAAEH,IAAI,GAAGI,SAAS,GAAG;EAAc,GACtEJ,IAAI,WAAJA,IAAI,GAAI,GACC,CACI,CAAC;AAEvB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"bottomDock.js","names":["React","useState","styled","IconButton","AttachmentIcon","CircleIcon","ConnectionIcon","DrawIcon","InsertLinkIcon","ProjectIcon","ProjectStarIcon","RoundedRectangleIcon","ShapesIcon","NoteIcon","TaskIcon","TextIcon","TriangleIcon","Tooltip","Caption1","ToolSurface","div","withConfig","displayName","componentId","verticalDivider","StyledBottomDock","StyledToolPill","StyledHint","TOOL_HINTS","circle","roundedRectangle","triangle","connector","projectElements","project","task","link","file","sticky","text","draw","shapes","SHAPE_TOOLS","isShapeTool","tool","includes","DEFAULT_SHAPE_TOOL","DEFAULT_PROJECT_ELEMENT_TOOL","SHAPE_DEFAULT_SIZES","width","height","CARD_PREVIEW_HEIGHT","ToolButton","_ref","tip","active","children","onClick","onMouseEnter","onMouseLeave","createElement","title","variant","BottomDock","_ref2","activeTool","onToolChange","_useState","hoverHint","setHoverHint","hoverProps","hint","shapesOpen","projectElementsOpen","_extends","color","className","undefined"],"sources":["../../../../src/presentation/whiteboard/bottomDock.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode, useState } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport { IconButton } from \"../../components/IconButton\";\nimport {\n AttachmentIcon,\n CircleIcon,\n ConnectionIcon,\n DrawIcon,\n InsertLinkIcon,\n ProjectIcon,\n ProjectStarIcon,\n RoundedRectangleIcon,\n ShapesIcon,\n NoteIcon,\n TaskIcon,\n TextIcon,\n TriangleIcon,\n} from \"../../components/Icons\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { Caption1 } from \"../../components/Typography\";\n\n/* ------------------------------------------------------------------ */\n/* Floating toolbar surfaces */\n/* ------------------------------------------------------------------ */\n\n/* A floating, rounded toolbar surface (paper + shadow). */\nexport const ToolSurface = styled.div`\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 6px;\n border-radius: 14px;\n background-color: var(--page-paper-main);\n box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);\n border: 1px solid var(--border-primary);\n\n /* A DS button colours its icon by declaring svg { fill: currentColor }, so\n every FILLED glyph follows the button's active and hover states for free.\n Three glyphs here are not filled: RoundedRectangleIcon and TriangleIcon are\n outlines with a stroke of var(--color-theme-600) baked into the path, and\n ProjectIcon draws its ruler as a stroked rect. Nothing about the button\n could ever reach them — an armed rectangle stayed exactly as grey as an\n unarmed one. This extends the same currentColor contract to a declared\n stroke.\n\n Scoped to direct children and to shapes inside a <g>, NOT to every\n descendant: ProjectIcon cuts its ruler with a <mask> whose <line> is\n stroked BLACK on purpose. In a mask only luminance matters, so recolouring\n that line would turn a clean diagonal cut into a half-transparent smear. */\n svg > [stroke],\n svg > g [stroke] {\n stroke: currentColor;\n }\n`;\n\n/* vertical separator used inside the toolbars */\nexport const verticalDivider = `\n .divider {\n width: 1px;\n height: 24px;\n background-color: var(--color-theme-400);\n margin: 0 6px;\n flex-shrink: 0;\n }\n`;\n\nexport const StyledBottomDock = styled.div`\n position: absolute;\n left: 50%;\n bottom: 18px;\n transform: translateX(-50%);\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 10px;\n max-width: calc(100% - 32px);\n`;\n\n/**\n * The floating second toolbar row — a small pill above the dock that holds the\n * members of one tool family (Circle / Rectangle / Triangle, or Task / Project).\n *\n * It is the same surface as the dock itself, so a family reads as an extension\n * of the button that opened it rather than as a different kind of UI. Only one\n * pill is ever up, because only one tool is ever armed.\n */\nexport const StyledToolPill = styled(ToolSurface)``;\n\n/* Reserve two Caption1 lines (2 × 16px) so showing/hiding the hint never\n shifts the dock; visibility keeps the reserved space when hidden. */\nexport const StyledHint = styled(Caption1)`\n text-align: center;\n padding: 0 16px;\n min-height: 32px;\n\n &.hint-hidden {\n visibility: hidden;\n }\n`;\n\n/* Per-tool hint shown under the dock only while that tool is hovered. */\nexport const TOOL_HINTS = {\n circle:\n \"Click to drop a default circle, or draw one to size. Press O for a circle.\",\n roundedRectangle:\n \"Click to drop a default rectangle, or draw one to size. Press R for a rectangle.\",\n triangle:\n \"Click to drop a default triangle, or draw one to size. Press Y for a triangle.\",\n connector:\n \"Drag from one element to another to connect them. Press C to connect.\",\n projectElements:\n \"Put a task or a project on the board — pick which above, then draw its card.\",\n project:\n \"Draw a box to place a project card, then pick the project it shows.\",\n task: \"Draw a box to place a task card, then pick the task it shows.\",\n link: \"Draw a box to place a link, or paste a URL anywhere. Press L for link.\",\n file: \"Draw a box to place a file, or drop one on the board. Press F for file.\",\n sticky:\n \"Click anywhere on the canvas to drop a sticky note. Press S for a sticky note.\",\n text: \"Click anywhere on the canvas to start typing. Press T for text.\",\n draw: \"Click and drag to draw freehand. Press D for the pen.\",\n shapes:\n \"Pick a shape above, then draw it on the board. Press R for a rectangle.\",\n} as const;\n\nexport type ToolHintKey = keyof typeof TOOL_HINTS;\n\nexport type ShapeTool = \"circle\" | \"roundedRectangle\" | \"triangle\";\n\n/**\n * The armed board tool. Link, File, Project, Task and the three shapes are\n * wired — arming one turns the next canvas click into \"drop the default-size\n * element here\" and a drag into \"draw one this big\"; everything else stays a\n * mock, so the board is otherwise always in select mode.\n */\nexport type BoardTool =\n | \"select\"\n | \"link\"\n | \"file\"\n | \"project\"\n | \"task\"\n | ShapeTool;\n\nexport const SHAPE_TOOLS: readonly ShapeTool[] = [\n \"circle\",\n \"roundedRectangle\",\n \"triangle\",\n];\n\nexport const isShapeTool = (tool: BoardTool): tool is ShapeTool =>\n (SHAPE_TOOLS as readonly string[]).includes(tool);\n\n/**\n * What a dock button arms the instant its pill opens.\n *\n * Opening a family and choosing inside it are two separate decisions, and the\n * second one has a right answer often enough that asking for it every time is\n * just a toll: a shape is usually a rectangle, and the thing people put on a\n * board is usually a task. So the pill opens with that member already armed and\n * the gesture can start immediately — picking another member is a correction,\n * not a required step.\n */\nexport const DEFAULT_SHAPE_TOOL: ShapeTool = \"roundedRectangle\";\nexport const DEFAULT_PROJECT_ELEMENT_TOOL: BoardTool = \"task\";\n\n/* What a plain click drops — mirrors DEFAULT_SHAPE_SIZES in\n new-activecollab-front, and is exactly what the hover preview promises. */\nexport const SHAPE_DEFAULT_SIZES: Record<\n ShapeTool,\n { width: number; height: number }\n> = {\n roundedRectangle: { width: 100, height: 60 },\n circle: { width: 80, height: 80 },\n triangle: { width: 80, height: 80 },\n};\n\n/* Cards are auto-height, so their hover preview uses the app's nominal wire\n height (DEFAULT_LINK_CARD_SIZE / DEFAULT_FILE_CARD_SIZE). */\nexport const CARD_PREVIEW_HEIGHT = 240;\n\n/** The kinds of card the draw gesture can place. */\nexport type DrawableTool = Exclude<BoardTool, \"select\">;\n\nexport interface ToolButtonProps {\n tip: string;\n active?: boolean;\n children: ReactNode;\n onClick?: () => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n}\n\nexport const ToolButton = ({\n tip,\n active,\n children,\n onClick,\n onMouseEnter,\n onMouseLeave,\n}: ToolButtonProps): ReactElement => (\n <Tooltip title={tip}>\n <IconButton\n variant=\"text gray\"\n active={active}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n {children}\n </IconButton>\n </Tooltip>\n);\n\nexport interface BottomDockProps {\n activeTool: BoardTool;\n onToolChange: (tool: BoardTool) => void;\n}\n\n/* Bottom-centre tool dock: the family pill (when one is open), the main\n toolbar, and the shared hint line. The dock is anchored by its BOTTOM edge,\n so a pill appearing or disappearing grows the stack upwards and never moves\n the toolbar itself. */\nexport const BottomDock = ({\n activeTool,\n onToolChange,\n}: BottomDockProps): ReactElement => {\n const [hoverHint, setHoverHint] = useState<string | null>(null);\n\n const hoverProps = (tool: ToolHintKey): Record<string, () => void> => ({\n onMouseEnter: () => setHoverHint(TOOL_HINTS[tool]),\n onMouseLeave: () => setHoverHint(null),\n });\n\n /* An armed tool keeps its hint up after the pointer leaves the dock — the\n gesture happens on the canvas, so that is exactly when the instruction is\n needed. */\n const hint =\n hoverHint ?? (activeTool === \"select\" ? null : TOOL_HINTS[activeTool]);\n\n /* Which pill is up. Both are DERIVED from the armed tool rather than kept as\n their own open/closed state: opening a pill always arms one of its members,\n so \"a member of this family is armed\" and \"this pill is showing\" are the\n same fact. Deriving it is what makes every way of leaving the family close\n the pill for free — another dock tool, Esc on the canvas, or the gesture\n finishing and disarming the tool. Two states could disagree; one cannot. */\n const shapesOpen = isShapeTool(activeTool);\n const projectElementsOpen = activeTool === \"task\" || activeTool === \"project\";\n\n return (\n <StyledBottomDock>\n {/* Shapes pill — hidden until the Shape dock button opens it. Inside a\n pill a click is a plain choice, never a toggle off: the dock button is\n what closes the family, so clicking the armed shape again must not\n make the row that is being used disappear. */}\n {shapesOpen ? (\n <StyledToolPill>\n <ToolButton\n tip=\"Circle\"\n active={activeTool === \"circle\"}\n onClick={() => onToolChange(\"circle\")}\n {...hoverProps(\"circle\")}\n >\n <CircleIcon />\n </ToolButton>\n <ToolButton\n tip=\"Rectangle\"\n active={activeTool === \"roundedRectangle\"}\n onClick={() => onToolChange(\"roundedRectangle\")}\n {...hoverProps(\"roundedRectangle\")}\n >\n <RoundedRectangleIcon />\n </ToolButton>\n <ToolButton\n tip=\"Triangle\"\n active={activeTool === \"triangle\"}\n onClick={() => onToolChange(\"triangle\")}\n {...hoverProps(\"triangle\")}\n >\n <TriangleIcon />\n </ToolButton>\n </StyledToolPill>\n ) : null}\n\n {/* Project Elements pill — the same surface, the same button size and\n spacing, in the same slot above the dock. Task comes first because it\n is what the button arms by default. */}\n {projectElementsOpen ? (\n <StyledToolPill>\n <ToolButton\n tip=\"Task\"\n active={activeTool === \"task\"}\n onClick={() => onToolChange(\"task\")}\n {...hoverProps(\"task\")}\n >\n <TaskIcon />\n </ToolButton>\n <ToolButton\n tip=\"Project\"\n active={activeTool === \"project\"}\n onClick={() => onToolChange(\"project\")}\n {...hoverProps(\"project\")}\n >\n <ProjectIcon />\n </ToolButton>\n </StyledToolPill>\n ) : null}\n\n <ToolSurface>\n {/* The tools that are still mocks arm nothing — but they do DISARM, so\n reaching for one closes whatever pill is up and ends the gesture the\n board was waiting for. A dead button that also leaves the previous\n tool armed would be the confusing half of \"not implemented yet\". */}\n <Tooltip title=\"Sticky Note\">\n <IconButton\n variant=\"text gray\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"sticky\")}\n >\n <NoteIcon />\n </IconButton>\n </Tooltip>\n <ToolButton\n tip=\"Text\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"text\")}\n >\n <TextIcon />\n </ToolButton>\n <ToolButton\n tip=\"Draw\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"draw\")}\n >\n <DrawIcon />\n </ToolButton>\n {/* Opening the family and arming its default member are one click: the\n pill appears with Rectangle already armed, so the next thing the\n pointer does can be the drawing itself. */}\n <ToolButton\n tip=\"Shape\"\n active={shapesOpen}\n onClick={() =>\n onToolChange(shapesOpen ? \"select\" : DEFAULT_SHAPE_TOOL)\n }\n {...hoverProps(\"shapes\")}\n >\n <ShapesIcon />\n </ToolButton>\n <ToolButton\n tip=\"Connect\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"connector\")}\n >\n <ConnectionIcon />\n </ToolButton>\n <ToolButton\n tip=\"Project Elements\"\n active={projectElementsOpen}\n onClick={() =>\n onToolChange(\n projectElementsOpen ? \"select\" : DEFAULT_PROJECT_ELEMENT_TOOL\n )\n }\n {...hoverProps(\"projectElements\")}\n >\n <ProjectStarIcon />\n </ToolButton>\n <ToolButton\n tip=\"Link\"\n active={activeTool === \"link\"}\n onClick={() =>\n onToolChange(activeTool === \"link\" ? \"select\" : \"link\")\n }\n {...hoverProps(\"link\")}\n >\n <InsertLinkIcon />\n </ToolButton>\n <ToolButton\n tip=\"File\"\n active={activeTool === \"file\"}\n onClick={() =>\n onToolChange(activeTool === \"file\" ? \"select\" : \"file\")\n }\n {...hoverProps(\"file\")}\n >\n <AttachmentIcon />\n </ToolButton>\n </ToolSurface>\n\n <StyledHint color=\"tertiary\" className={hint ? undefined : \"hint-hidden\"}>\n {hint ?? \" \"}\n </StyledHint>\n </StyledBottomDock>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAA6BC,QAAQ,QAAQ,OAAO;AAEhE,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SACEC,cAAc,EACdC,UAAU,EACVC,cAAc,EACdC,QAAQ,EACRC,cAAc,EACdC,WAAW,EACXC,eAAe,EACfC,oBAAoB,EACpBC,UAAU,EACVC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,YAAY,QACP,wBAAwB;AAC/B,SAASC,OAAO,QAAQ,0BAA0B;AAClD,SAASC,QAAQ,QAAQ,6BAA6B;;AAEtD;AACA;AACA;;AAEA;AACA,OAAO,MAAMC,WAAW,GAAGjB,MAAM,CAACkB,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0PA2BpC;;AAED;AACA,OAAO,MAAMC,eAAe,sJAQ3B;AAED,OAAO,MAAMC,gBAAgB,GAAGvB,MAAM,CAACkB,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,qKAUzC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AG,EAAC,MAAM;IACVC,MAAM,EAAEU,UAAU,KAAK,MAAO;IAC9BR,OAAO,EAAEA,CAAA,KACPS,YAAY,CAACD,UAAU,KAAK,MAAM,GAAG,QAAQ,GAAG,MAAM;EACvD,GACGK,UAAU,CAAC,MAAM,CAAC,gBAEtBtE,KAAA,CAAA4D,aAAA,CAACxD,cAAc,MAAE,CACP,CACD,CAAC,eAEdJ,KAAA,CAAA4D,aAAA,CAACjC,UAAU;IAACgD,KAAK,EAAC,UAAU;IAACC,SAAS,EAAEL,IAAI,GAAGM,SAAS,GAAG;EAAc,GACtEN,IAAI,WAAJA,IAAI,GAAI,GACC,CACI,CAAC;AAEvB,CAAC","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@ import { BoardTool } from "./bottomDock";
|
|
|
3
3
|
import { CanvasElementDef, GridSize, ShapeElementState, StickyTextStyle } from "./elements";
|
|
4
4
|
import { FileElementDef } from "./fileElement";
|
|
5
5
|
import { LinkElementDef } from "./linkElement";
|
|
6
|
+
import { ProjectElementDef } from "./projectElements";
|
|
6
7
|
/**
|
|
7
8
|
* A card is full of its own controls — the URL field, the display toggle, the
|
|
8
9
|
* retry button, the toolbar. A mousedown on any of them selects the element but
|
|
@@ -47,6 +48,8 @@ export interface CanvasElementsProps {
|
|
|
47
48
|
setLinks: React.Dispatch<React.SetStateAction<LinkElementDef[]>>;
|
|
48
49
|
files: FileElementDef[];
|
|
49
50
|
setFiles: React.Dispatch<React.SetStateAction<FileElementDef[]>>;
|
|
51
|
+
projectElements: ProjectElementDef[];
|
|
52
|
+
setProjectElements: React.Dispatch<React.SetStateAction<ProjectElementDef[]>>;
|
|
50
53
|
createdShapes: CanvasElementDef[];
|
|
51
54
|
setCreatedShapes: React.Dispatch<React.SetStateAction<CanvasElementDef[]>>;
|
|
52
55
|
sizes: Record<string, {
|
|
@@ -57,5 +60,5 @@ export interface CanvasElementsProps {
|
|
|
57
60
|
locks: Record<string, boolean>;
|
|
58
61
|
setLocks: React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
|
|
59
62
|
}
|
|
60
|
-
export declare const CanvasElements: ({ gridSize, snapToGrid, activeTool, onToolUsed, selectedId, onSelectedIdChange: setSelectedId, positions, setPositions, shapes, setShapes, stickyStyle, setStickyStyle, links, setLinks, files, setFiles, createdShapes, setCreatedShapes, sizes, rotations, locks, setLocks, }: CanvasElementsProps) => ReactElement;
|
|
63
|
+
export declare const CanvasElements: ({ gridSize, snapToGrid, activeTool, onToolUsed, selectedId, onSelectedIdChange: setSelectedId, positions, setPositions, shapes, setShapes, stickyStyle, setStickyStyle, links, setLinks, files, setFiles, projectElements, setProjectElements, createdShapes, setCreatedShapes, sizes, rotations, locks, setLocks, }: CanvasElementsProps) => ReactElement;
|
|
61
64
|
//# sourceMappingURL=canvasElements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvasElements.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/canvasElements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,YAAY,EAKb,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,SAAS,EAMV,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,gBAAgB,EAChB,QAAQ,EAGR,iBAAiB,EAEjB,eAAe,EAShB,MAAM,YAAY,CAAC;AACpB,OAAO,EAGL,cAAc,EAIf,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,cAAc,EAMf,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"canvasElements.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/canvasElements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,YAAY,EAKb,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,SAAS,EAMV,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,gBAAgB,EAChB,QAAQ,EAGR,iBAAiB,EAEjB,eAAe,EAShB,MAAM,YAAY,CAAC;AACpB,OAAO,EAGL,cAA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