@crewlethq/ui 0.34.2 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -0
- package/dist/AppShell/index.js +2 -2
- package/dist/ArtifactBar/ArtifactBar.d.ts +6 -0
- package/dist/ArtifactBar/index.d.ts +1 -0
- package/dist/ArtifactBar/index.js +2 -2
- package/dist/{ArtifactBar-C462VD4C.css → ArtifactBar-HV5AT4RG.css} +39 -2
- package/dist/ArtifactCard/index.d.ts +1 -0
- package/dist/ArtifactCard/index.js +2 -2
- package/dist/{ArtifactCard-XHRLAL7C.css → ArtifactCard-OGTMO2KI.css} +15 -16
- package/dist/ArtifactKindIllustration/ArtifactKindIllustration.d.ts +14 -1
- package/dist/ArtifactKindIllustration/index.d.ts +1 -0
- package/dist/ArtifactKindIllustration/index.js +1 -1
- package/dist/{ArtifactKindIllustration-4NG6IE3C.css → ArtifactKindIllustration-5FPRJQ3P.css} +32 -26
- package/dist/ArtifactKinds-CVD3FCYO.css +15 -0
- package/dist/AvatarPicker/index.js +2 -2
- package/dist/CanvasBoard/CanvasBoard.d.ts +30 -12
- package/dist/CanvasBoard/index.js +1 -1
- package/dist/ChangeMark/index.js +2 -2
- package/dist/ChoiceList/ChoiceList.d.ts +7 -1
- package/dist/ChoiceList/index.js +1 -1
- package/dist/{ChoiceList-2PQJS4DX.css → ChoiceList-RBL7FNQL.css} +39 -0
- package/dist/DataTable/index.js +2 -2
- package/dist/DataView/index.js +3 -3
- package/dist/DocTabsEditor/index.js +2 -2
- package/dist/{Editor-JMRD6AZW.js → Editor-BVQHBF7L.js} +4 -4
- package/dist/FileDrop/FileDrop.d.ts +64 -0
- package/dist/FileDrop/index.d.ts +3 -0
- package/dist/FileDrop/index.js +4 -0
- package/dist/FileDrop-WE7BNZGV.css +80 -0
- package/dist/FindingList/FindingList.d.ts +35 -0
- package/dist/FindingList/index.d.ts +3 -0
- package/dist/FindingList/index.js +3 -0
- package/dist/FindingList-PMYA2R6Q.css +71 -0
- package/dist/HuePicker/HuePicker.d.ts +9 -0
- package/dist/HuePicker/index.d.ts +1 -1
- package/dist/HuePicker/index.js +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/Menu/Menu.d.ts +6 -1
- package/dist/Menu/index.js +1 -1
- package/dist/RichEditor/index.js +3 -3
- package/dist/RichEditorMarkdown/index.js +3 -3
- package/dist/SheetColumnEditor/SheetColumnEditor.d.ts +94 -0
- package/dist/SheetColumnEditor/index.d.ts +3 -0
- package/dist/SheetColumnEditor/index.js +23 -0
- package/dist/SheetColumnEditor-BO2HKFRB.css +73 -0
- package/dist/SheetGrid/SheetGrid.d.ts +19 -1
- package/dist/SheetGrid/index.js +5 -4
- package/dist/{SheetGrid-GDPCCZ4V.css → SheetGrid-YRDXTIIZ.css} +48 -0
- package/dist/SheetModel/columns.d.ts +19 -0
- package/dist/SheetModel/index.d.ts +1 -0
- package/dist/SheetModel/index.js +1 -1
- package/dist/SheetModel/labels.d.ts +6 -0
- package/dist/SlideFilmstrip/SlideFilmstrip.d.ts +30 -1
- package/dist/SlideFilmstrip/index.js +5 -1
- package/dist/{SlideFilmstrip-5U6Z55GS.css → SlideFilmstrip-4ITZLMO4.css} +49 -0
- package/dist/SourceEditor/SourceEditor.d.ts +62 -0
- package/dist/SourceEditor/index.d.ts +3 -0
- package/dist/SourceEditor/index.js +3 -0
- package/dist/SourceEditor-G2C3STPX.css +160 -0
- package/dist/ThemeGallery/ThemeGallery.d.ts +10 -3
- package/dist/ThemeGallery/index.js +1 -1
- package/dist/{ThemeGallery-NITASULQ.css → ThemeGallery-HSUKBDWY.css} +9 -0
- package/dist/{chunk-UXXJDIYE.js → chunk-22CQQDFW.js} +1 -1
- package/dist/{chunk-EQ7P7DGN.js → chunk-3VD3G3IL.js} +2 -2
- package/dist/{chunk-SGHIAGPR.js → chunk-47JQAGRV.js} +1 -1
- package/dist/{chunk-7T5LSYZ2.js → chunk-7UYONN6K.js} +4 -3
- package/dist/{chunk-KK5OYNAF.js → chunk-BAKPMH3S.js} +8 -4
- package/dist/{chunk-3EB2AV3H.js → chunk-BUVCV3WI.js} +1 -1
- package/dist/{chunk-4B6LSFDS.js → chunk-CSQTDGTS.js} +1 -1
- package/dist/{chunk-WPX6A5BV.js → chunk-E35CMI5D.js} +22 -6
- package/dist/{chunk-EWAFN2IU.js → chunk-FF5OZV77.js} +281 -234
- package/dist/{chunk-OMLACFPP.js → chunk-FJJHD73S.js} +1 -1
- package/dist/chunk-J6YZ4IYV.js +341 -0
- package/dist/{chunk-VI5FWDZW.js → chunk-LFSIKGRQ.js} +17 -2
- package/dist/{chunk-ZADVT7IL.js → chunk-NKZCJRKO.js} +9 -4
- package/dist/chunk-NTB5LRRD.js +52 -0
- package/dist/{chunk-UOR7TOAU.js → chunk-OSFA5ROT.js} +86 -1
- package/dist/{chunk-T46NR3WP.js → chunk-PGZ2R3ON.js} +1 -1
- package/dist/chunk-PI7HKLIT.js +245 -0
- package/dist/{chunk-YZFLH463.js → chunk-QEFHYUCY.js} +1 -1
- package/dist/{chunk-NPQWKZTB.js → chunk-QFNWMWWY.js} +2 -2
- package/dist/{chunk-C7DKX453.js → chunk-QH6VYJ3X.js} +1 -1
- package/dist/{chunk-XV32RKQZ.js → chunk-QIXMNOBD.js} +67 -6
- package/dist/{chunk-GPHWCK7M.js → chunk-SUXP4OBT.js} +6 -3
- package/dist/{chunk-TRQCHF2F.js → chunk-SWD4QBL6.js} +1 -1
- package/dist/chunk-THDGBD6Y.js +154 -0
- package/dist/{chunk-C2FRTWKO.js → chunk-W3UVOZKL.js} +3 -2
- package/dist/{chunk-UDQW6UK7.js → chunk-W7QBBKUE.js} +34 -7
- package/dist/{chunk-QBXZLGK2.js → chunk-ZU3DUXD2.js} +3 -2
- package/dist/generated/index.d.ts +4 -0
- package/dist/generated/index.js +53 -49
- package/dist/index.js +53 -49
- package/dist/styles.css +652 -51
- package/dist/utils/csv.d.ts +35 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +1 -1
- package/package.json +3 -3
- /package/dist/{chunk-VFRSSP3W.js → chunk-3WCNHYXE.js} +0 -0
|
@@ -5,7 +5,7 @@ import { IconButton } from './chunk-4FQT6ZAY.js';
|
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
6
|
import './CanvasBoard-5NNSKY6A.css';
|
|
7
7
|
import { useState, useRef, useImperativeHandle, useCallback, useMemo, useEffect } from 'react';
|
|
8
|
-
import { MaximizeGlyph, PencilGlyph, TrashGlyph, MousePointer2Glyph, HandGlyph, TypeGlyph, StickyNoteGlyph } from '@crewlethq/icons/glyphs';
|
|
8
|
+
import { MaximizeGlyph, PencilGlyph, TrashGlyph, MousePointer2Glyph, HandGlyph, FrameGlyph, TypeGlyph, StickyNoteGlyph } from '@crewlethq/icons/glyphs';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
// src/CanvasBoard/budget.ts
|
|
@@ -65,12 +65,14 @@ var LABELS = {
|
|
|
65
65
|
tools: "Tools",
|
|
66
66
|
moveTool: "Move",
|
|
67
67
|
handTool: "Hand",
|
|
68
|
+
frameTool: "Frame",
|
|
68
69
|
textTool: "Text",
|
|
69
70
|
stickyTool: "Sticky note"
|
|
70
71
|
};
|
|
71
72
|
var TOOL_CURSOR = {
|
|
72
73
|
move: "pointer",
|
|
73
74
|
hand: "hand",
|
|
75
|
+
frame: "crosshair",
|
|
74
76
|
text: "text",
|
|
75
77
|
sticky: "crosshair"
|
|
76
78
|
};
|
|
@@ -228,6 +230,8 @@ function CanvasBoard({
|
|
|
228
230
|
onNoteChange,
|
|
229
231
|
onNoteRemove,
|
|
230
232
|
onNoteCreate,
|
|
233
|
+
onBoardCreate,
|
|
234
|
+
onBoardRemove,
|
|
231
235
|
onOpen,
|
|
232
236
|
onActivate,
|
|
233
237
|
selected: heldSelection,
|
|
@@ -256,9 +260,11 @@ function CanvasBoard({
|
|
|
256
260
|
const canvas = useRef(null);
|
|
257
261
|
useImperativeHandle(canvasRef, () => canvas.current, []);
|
|
258
262
|
const creates = editable && onNoteCreate !== void 0;
|
|
263
|
+
const frames = editable && onBoardCreate !== void 0;
|
|
259
264
|
const tools = [
|
|
260
265
|
{ id: "move", label: text.moveTool, icon: /* @__PURE__ */ jsx(MousePointer2Glyph, {}), shortcut: "V" },
|
|
261
266
|
{ id: "hand", label: text.handTool, icon: /* @__PURE__ */ jsx(HandGlyph, {}), shortcut: "H" },
|
|
267
|
+
...frames ? [{ id: "frame", label: text.frameTool, icon: /* @__PURE__ */ jsx(FrameGlyph, {}), shortcut: "F" }] : [],
|
|
262
268
|
...creates ? [
|
|
263
269
|
{ id: "text", label: text.textTool, icon: /* @__PURE__ */ jsx(TypeGlyph, {}), shortcut: "T" },
|
|
264
270
|
{ id: "sticky", label: text.stickyTool, icon: /* @__PURE__ */ jsx(StickyNoteGlyph, {}), shortcut: "S" }
|
|
@@ -328,11 +334,14 @@ function CanvasBoard({
|
|
|
328
334
|
if (!event.repeat) setSpaceHeld(true);
|
|
329
335
|
return;
|
|
330
336
|
}
|
|
331
|
-
if ((event.key === "Delete" || event.key === "Backspace") && editable && shownSelection
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
337
|
+
if ((event.key === "Delete" || event.key === "Backspace") && editable && shownSelection !== null) {
|
|
338
|
+
const remove = shownSelection.kind === "note" ? onNoteRemove : onBoardRemove;
|
|
339
|
+
if (remove) {
|
|
340
|
+
event.preventDefault();
|
|
341
|
+
remove(shownSelection.id);
|
|
342
|
+
setSelected(null);
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
336
345
|
}
|
|
337
346
|
const picked = toolForKey(tools, event);
|
|
338
347
|
if (picked !== void 0) {
|
|
@@ -344,6 +353,13 @@ function CanvasBoard({
|
|
|
344
353
|
const target = event.target instanceof Element ? event.target : null;
|
|
345
354
|
if (!target?.closest(".crewlet-canvas__viewport")) return;
|
|
346
355
|
if (target.closest(".crewlet-canvas-board__board, .crewlet-canvas-board__note")) return;
|
|
356
|
+
if (acting === "frame" && onBoardCreate && canvas.current) {
|
|
357
|
+
const at = canvas.current.worldAt({ x: event.clientX, y: event.clientY });
|
|
358
|
+
const id = onBoardCreate({ x: Math.round(at.x), y: Math.round(at.y) });
|
|
359
|
+
setTool("move");
|
|
360
|
+
if (id !== void 0) setSelected({ kind: "board", id });
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
347
363
|
if ((acting === "text" || acting === "sticky") && onNoteCreate && canvas.current) {
|
|
348
364
|
const at = canvas.current.worldAt({ x: event.clientX, y: event.clientY });
|
|
349
365
|
const id = onNoteCreate(acting === "text" ? "title" : "sticky", {
|