@crewlethq/ui 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -3
- package/dist/ArrangeList/index.js +2 -2
- package/dist/ArtifactCard/ArtifactCard.d.ts +3 -2
- package/dist/ArtifactCard/index.js +1 -1
- package/dist/ArtifactCover/ArtifactCover.d.ts +37 -0
- package/dist/ArtifactCover/DashboardCover.d.ts +46 -0
- package/dist/ArtifactCover/index.d.ts +6 -0
- package/dist/ArtifactCover/index.js +14 -0
- package/dist/ArtifactCover-D4MBEJ5H.css +67 -0
- package/dist/ArtifactIcon/ArtifactIcon.d.ts +29 -0
- package/dist/ArtifactIcon/index.d.ts +2 -0
- package/dist/ArtifactIcon/index.js +13 -0
- package/dist/AvatarPicker/index.js +6 -6
- package/dist/Canvas/Canvas.d.ts +13 -2
- package/dist/Canvas/index.js +1 -1
- package/dist/CanvasBoard/CanvasBoard.d.ts +117 -0
- package/dist/CanvasBoard/budget.d.ts +38 -0
- package/dist/CanvasBoard/index.d.ts +5 -0
- package/dist/CanvasBoard/index.js +10 -0
- package/dist/CanvasBoard-ZLPDINSM.css +236 -0
- package/dist/CanvasSchematic/CanvasSchematic.d.ts +31 -0
- package/dist/CanvasSchematic/index.d.ts +3 -0
- package/dist/CanvasSchematic/index.js +2 -0
- package/dist/CanvasSchematic-PLB3N46J.css +36 -0
- package/dist/ChangeMark/index.js +3 -3
- package/dist/CharacterPicker/index.js +2 -2
- package/dist/Checkbox/Checkbox.d.ts +6 -0
- package/dist/Checkbox/index.js +1 -1
- package/dist/{Checkbox-KT7RS6QQ.css → Checkbox-5UORUG3F.css} +16 -0
- package/dist/CommentThread/index.js +2 -2
- package/dist/DashboardCover-RMINBODB.css +143 -0
- package/dist/DataTable/index.js +3 -3
- package/dist/DataView/index.js +5 -5
- package/dist/DatasetSource/DatasetSource.d.ts +83 -0
- package/dist/DatasetSource/index.d.ts +3 -0
- package/dist/DatasetSource/index.js +7 -0
- package/dist/DatasetSource-47LBDMPR.css +129 -0
- package/dist/DocTabsEditor/DocTabsEditor.d.ts +60 -0
- package/dist/DocTabsEditor/index.d.ts +3 -0
- package/dist/DocTabsEditor/index.js +9 -0
- package/dist/DocTabsEditor-RCOWHX5J.css +78 -0
- package/dist/DownloadButton/index.js +2 -2
- package/dist/HuePicker/index.js +4 -4
- package/dist/LinkInterstitial/index.js +2 -2
- package/dist/MarkdownEditor/index.js +5 -5
- package/dist/MergeConflicts/MergeConflicts.d.ts +51 -0
- package/dist/MergeConflicts/index.d.ts +3 -0
- package/dist/MergeConflicts/index.js +9 -0
- package/dist/MergeConflicts-O44ESH4T.css +77 -0
- package/dist/Meter/index.js +1 -1
- package/dist/{Meter-5VCSFMZW.css → Meter-ZZRFUEOH.css} +15 -0
- package/dist/ObjectHeader/ObjectHeader.d.ts +7 -1
- package/dist/ObjectHeader/index.js +1 -1
- package/dist/{ObjectHeader-UNVYM2KD.css → ObjectHeader-D7GU7QNI.css} +15 -0
- package/dist/PeopleRail/index.js +3 -3
- package/dist/PresenceModel/index.d.ts +1 -1
- package/dist/PresenceModel/index.js +1 -1
- package/dist/PresenceModel/presence.d.ts +10 -2
- package/dist/PresenceStack/index.js +3 -3
- package/dist/PresenterView/PresenterView.d.ts +52 -0
- package/dist/PresenterView/index.d.ts +3 -0
- package/dist/PresenterView/index.js +8 -0
- package/dist/PresenterView-T2C6ZZ3N.css +103 -0
- package/dist/Section/index.js +1 -1
- package/dist/{Section-QRUPRIQ2.css → Section-QR3ILQVK.css} +4 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts +17 -0
- package/dist/SegmentedControl/index.js +4 -4
- package/dist/{SegmentedControl-PKBLJVSA.css → SegmentedControl-FLI45IOW.css} +13 -0
- package/dist/ShareDialog/index.js +3 -3
- package/dist/SheetGrid/SheetGrid.d.ts +24 -2
- package/dist/SheetGrid/index.js +11 -7
- package/dist/{SheetGrid-4HOXDVIB.css → SheetGrid-J3TKKXZL.css} +87 -17
- package/dist/SheetModel/edits.d.ts +7 -1
- package/dist/SheetModel/index.js +2 -2
- package/dist/SheetModel/labels.d.ts +9 -0
- package/dist/SheetModel/types.d.ts +6 -0
- package/dist/SlideCompare/SlideCompare.d.ts +52 -0
- package/dist/SlideCompare/index.d.ts +3 -0
- package/dist/SlideCompare/index.js +7 -0
- package/dist/SlideCompare-MGM3U2ME.css +80 -0
- package/dist/SlideFilmstrip/SlideFilmstrip.d.ts +50 -0
- package/dist/SlideFilmstrip/index.d.ts +3 -0
- package/dist/SlideFilmstrip/index.js +8 -0
- package/dist/SlideFilmstrip-BCLNAHFX.css +108 -0
- package/dist/SlideGrid/SlideGrid.d.ts +32 -0
- package/dist/SlideGrid/index.d.ts +3 -0
- package/dist/SlideGrid/index.js +5 -0
- package/dist/SlideGrid-RT6QEQEE.css +82 -0
- package/dist/SlideStage/SlideStage.d.ts +47 -0
- package/dist/SlideStage/index.d.ts +5 -0
- package/dist/SlideStage/index.js +4 -0
- package/dist/SlideStage/useSlideKeys.d.ts +21 -0
- package/dist/SlideStage-XIOTMMRU.css +32 -0
- package/dist/Switcher/index.js +2 -2
- package/dist/TableCells/index.js +2 -2
- package/dist/Tabs/index.js +2 -2
- package/dist/Tabs/roving.d.ts +1 -0
- package/dist/TagGroup/TagGroup.d.ts +16 -1
- package/dist/TagGroup/index.js +1 -1
- package/dist/{TagGroup-BCQZD7ZD.css → TagGroup-NAXTJHDS.css} +22 -0
- package/dist/ThemeGallery/index.js +2 -2
- package/dist/ThemeSwitcher/index.js +5 -5
- package/dist/TreeCanvas/index.js +2 -2
- package/dist/VersionCompare/VersionCompare.d.ts +8 -1
- package/dist/VersionCompare/index.js +5 -5
- package/dist/VersionTimeline/index.js +1 -1
- package/dist/{VersionTimeline-EBJ6MIPJ.css → VersionTimeline-6KRXEEOO.css} +7 -7
- package/dist/WidgetFrame/WidgetFrame.d.ts +73 -0
- package/dist/WidgetFrame/index.d.ts +3 -0
- package/dist/WidgetFrame/index.js +6 -0
- package/dist/WidgetFrame-4EFJOJMW.css +127 -0
- package/dist/chunk-3D7PSL2L.js +438 -0
- package/dist/{chunk-SJCKMSQK.js → chunk-5LUI3WQP.js} +1 -1
- package/dist/{chunk-TODND5AD.js → chunk-6J35F334.js} +7 -4
- package/dist/{chunk-IASV5UCP.js → chunk-7T42VQQT.js} +3 -1
- package/dist/{chunk-BJCFNRGH.js → chunk-BEHFTRMZ.js} +1 -1
- package/dist/chunk-BQYQWJPK.js +80 -0
- package/dist/{chunk-KLIEPFEZ.js → chunk-C2FRTWKO.js} +1 -1
- package/dist/{chunk-APS747CR.js → chunk-EHQTPVV4.js} +5 -3
- package/dist/{chunk-A2UXBCLO.js → chunk-FAQGGX2Z.js} +1 -1
- package/dist/chunk-FQCLKD7U.js +2 -0
- package/dist/{chunk-J4OKGJQ6.js → chunk-FVLCTCMV.js} +1 -1
- package/dist/{chunk-XJFOOXCF.js → chunk-HJEVSQN6.js} +1 -1
- package/dist/chunk-HONZQ4UR.js +107 -0
- package/dist/{chunk-5PSXBL73.js → chunk-HVIX5ECM.js} +1 -1
- package/dist/{chunk-36CWC2NH.js → chunk-INTEH4F3.js} +271 -143
- package/dist/{chunk-F6NZOVWL.js → chunk-IW55G7XG.js} +6 -2
- package/dist/chunk-KNLJL3VP.js +101 -0
- package/dist/chunk-KSSSFLE2.js +105 -0
- package/dist/{chunk-TXAFKH2A.js → chunk-KZOGQXSP.js} +6 -0
- package/dist/{chunk-CS65QSIJ.js → chunk-LZHLSQYK.js} +2 -2
- package/dist/chunk-MQEEQVG6.js +62 -0
- package/dist/chunk-NBWNLYWZ.js +62 -0
- package/dist/{chunk-YYZRLLLY.js → chunk-NHBP2XS5.js} +19 -3
- package/dist/chunk-O2EGEONV.js +90 -0
- package/dist/{chunk-YM3GJHGW.js → chunk-ODT5H4MN.js} +1 -1
- package/dist/{chunk-JCSXFAXG.js → chunk-OJRDEVHV.js} +1 -1
- package/dist/{chunk-U63Y5OCW.js → chunk-PRNX5AFE.js} +2 -2
- package/dist/chunk-Q4A5CGUB.js +43 -0
- package/dist/{chunk-7QL2OFP6.js → chunk-RCQXUT5K.js} +25 -9
- package/dist/{chunk-CBOICT64.js → chunk-RKKO7QHH.js} +2 -0
- package/dist/{chunk-TBIZSQHB.js → chunk-RSC7UJCR.js} +1 -1
- package/dist/chunk-RWA4H2TV.js +73 -0
- package/dist/{chunk-OQT7GSKJ.js → chunk-SGIQCI6Y.js} +1 -1
- package/dist/{chunk-35UKQ33X.js → chunk-SVW3VG72.js} +2 -2
- package/dist/{chunk-4PZ6FJKW.js → chunk-UGNUUVRI.js} +2 -2
- package/dist/chunk-UOR7TOAU.js +191 -0
- package/dist/{chunk-XMGB3ZAT.js → chunk-URUGEAFB.js} +3 -2
- package/dist/chunk-UZ7ZUSLH.js +179 -0
- package/dist/chunk-V2Z24W2Z.js +75 -0
- package/dist/{chunk-I7WXZOWA.js → chunk-VGE3G3T4.js} +3 -1
- package/dist/{chunk-UNZ7TVV5.js → chunk-W4XYY73O.js} +7 -9
- package/dist/{chunk-IPM2E6UI.js → chunk-WJDQ7XQA.js} +1 -1
- package/dist/{chunk-PPAQFGS2.js → chunk-YEKYVJQR.js} +1 -1
- package/dist/chunk-Z54BPRL6.js +74 -0
- package/dist/{chunk-S35G6PNC.js → chunk-Z7JYG5TF.js} +5 -4
- package/dist/chunk-ZZDY4XL7.js +112 -0
- package/dist/generated/index.d.ts +13 -0
- package/dist/generated/index.js +92 -79
- package/dist/index.js +92 -79
- package/dist/styles.css +1644 -153
- package/dist/utils/csv.d.ts +18 -0
- package/dist/utils/elementToPng.d.ts +49 -0
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/useDownload.d.ts +14 -4
- package/package.json +3 -3
- package/dist/chunk-E6UWRXNM.js +0 -52
- package/dist/chunk-M54K52ZU.js +0 -2
- package/dist/chunk-U5LQ2AS5.js +0 -1
- package/dist/{chunk-KG6XRG5Z.js → chunk-5OY4LJFH.js} +1 -1
- package/dist/{chunk-ZM7HLFOA.js → chunk-L2OQRPXJ.js} +1 -1
- package/dist/{chunk-MUGM7SEG.js → chunk-LFNUH4GY.js} +1 -1
- package/dist/{chunk-PBNP7H2C.js → chunk-M2VJGNCD.js} +1 -1
- /package/dist/{chunk-MSSZHDZI.js → chunk-SLRKS5PF.js} +0 -0
package/README.md
CHANGED
|
@@ -49,14 +49,15 @@ import { Button } from '@crewlethq/ui/Button'; // 8 KB of CSS, not 182 KB
|
|
|
49
49
|
| Documents and review | `DiffView` and `DiffSummary` with the line diff they draw (`diffLines`, `diffStat`, `collapseDiff`, `firstChangedLines`, `splitLines`, `MAX_DIFF_LINES`, with no React in it), `DiffList`, `VersionCompare`, `CommentThread` |
|
|
50
50
|
| Charts | `Legend`, `BarList`, `StackedBar`, `StackedColumns`, `ActivityStrip`, `TimeSeries`, `Sparkline`, the reading layer they share (`ChartTooltip`, `useChartHover`), and the ramp (`DATA_COLORS`, `DATA_COLOR_OTHER`, `dataColor`) |
|
|
51
51
|
| Marks | `Count`, `StatusDot`, `EmptyValue`, `VisuallyHidden` |
|
|
52
|
-
| Hooks and seams | `useModalLayer`, `usePopupLayer`, `LayerHost`, `useListbox`, `useOptionKeys`, `useHighlightRest` and `HIGHLIGHT_REST_MS`, `useClipboard`, `useDownload`, `downloadText`, `safeFilename`, `useOutcome`, `useAnnouncer`, `useNow`, `formatRelative`, `HeadingLevelProvider`, `cx`, the node hues (`NODE_HUES`, `NODE_HUE_NAMES`, `isNodeHue`) |
|
|
52
|
+
| Hooks and seams | `useModalLayer`, `usePopupLayer`, `LayerHost`, `useListbox`, `useOptionKeys`, `useHighlightRest` and `HIGHLIGHT_REST_MS`, `useClipboard`, `useDownload`, `downloadText`, `downloadBlob`, `safeFilename`, `toCsv`, `elementToPng` and `ElementToPngError`, `useOutcome`, `useAnnouncer`, `useNow`, `formatRelative`, `HeadingLevelProvider`, `cx`, the node hues (`NODE_HUES`, `NODE_HUE_NAMES`, `isNodeHue`) |
|
|
53
53
|
| Layout | `Container`, `Section`, `Card`, `Tabs`, `Accordion`, `Disclosure`, `Outline` (with `useActiveHeading` and `scrollToHeading`), `TreeGrid` |
|
|
54
54
|
| Arranging a page | `ArrangeBoard`, `ArrangeFrame` (with `useGridResize`), `ArrangeGroup`, `ArrangeList`, and the reorder hooks under them (`useReorder`, `useReorderLists`, `moveKey`) |
|
|
55
55
|
| Application shell | `AppShell` with `AppShell.Rail`, `AppShell.Topbar`, `AppShell.AccountRow` and `useAppShell`, `AuthLayout`, `SidebarNav` and `NavItem`, `BrandLockup`, `SearchTrigger`, `PageHeader`, `Toolbar`, `Stack`, `Inline`, `Spacer`, `AutoGrid`, `ErrorBoundary`, `useShortcut`, `useFullscreen` |
|
|
56
56
|
| Preferences | `ThemeToggle`, `ThemeSwitcher`, `DensitySwitcher`, `ThemeGallery`, `ThemeSwatch`, `useThemePreference`, `useDensityPreference`, `useSystemTheme`, `resolveTheme`, `applyStoredPreferences`, and the framework-free `applyTheme`, `applyPalette`, `applyDensity` with `THEME_PREFERENCES`, `DENSITY_PREFERENCES` and their guards |
|
|
57
|
-
| Artifacts | `SandboxedFrame`, `LinkInterstitial` and `openExternal`, `VersionTimeline`, `ShareDialog` with the role ladder (`ARTIFACT_ROLES`, `SHAREABLE_ROLES`, `roleAtLeast`), `PrincipalPicker`, `Principal` and `PrincipalAvatar`, `ArtifactCard` and `ArtifactKindGlyph`, `AccessDeniedCard`, and `FrameProtocol` (the wire between a host page and an embedded artifact, with no React in it) |
|
|
57
|
+
| Artifacts | `SandboxedFrame`, `LinkInterstitial` and `openExternal`, `VersionTimeline`, `ShareDialog` with the role ladder (`ARTIFACT_ROLES`, `SHAREABLE_ROLES`, `roleAtLeast`), `PrincipalPicker`, `Principal` and `PrincipalAvatar`, `ArtifactCard` and `ArtifactKindGlyph`, `CanvasBoard` (a design's artboards and notes on a `Canvas`, with the visibility budget `liveBoards`), `CanvasSchematic` (a design's cover, drawn from its boards' frames), `AccessDeniedCard`, `ArtifactIcon` (with `artifactIconGlyph` and `ARTIFACT_ICON_WORDS`), the native gallery covers (`DocCover`, `SheetCover`, `DashboardCover`), `MergeConflicts`, the dashboard pieces (`WidgetFrame`, `DatasetSource` and `DatasetSourceList`), and `FrameProtocol` (the wire between a host page and an embedded artifact, with no React in it) |
|
|
58
58
|
| Sheets | `SheetGrid`, the cells on their own (`CheckboxCell`, `TextCell`, `LongTextCell`, `NumberCell`, `SelectCell`, `MultiSelectCell`, `PersonCell`, `StatusCell`, `DateCell`, `UrlCell`, `RatingCell`, and `SheetCell` for any type), `ChangeMark`, and `SheetModel` (every rule a sheet is drawn from, with no React in it: values, parsing, the keyboard model, TSV, the pending edits of D23) |
|
|
59
|
-
| Presence | `PresenceStack`, `PresenceRing` and `presenceHueClass`, `CursorFlag`, `LiveCursor`, `FollowBanner`, `PeopleRail` (with `peopleRailKey`), and `PresenceModel` (the roster order, one entry per person, the session hues
|
|
59
|
+
| Presence | `PresenceStack`, `PresenceRing` and `presenceHueClass`, `CursorFlag`, `LiveCursor`, `FollowBanner`, `PeopleRail` (with `peopleRailKey`), and `PresenceModel` (the roster order, one entry per person, the session hues from `PRESENCE_HUES`, with no React in it) |
|
|
60
|
+
| Presentations | `SlideStage` (a slide laid out at 1920 by 1080 and scaled to its box, with `SLIDE_WIDTH` and `SLIDE_HEIGHT`), `useSlideKeys` (the keys a show and a clicker send), `SlideFilmstrip`, `SlideGrid`, `SlideCompare` (with `SLIDE_COMPARE_LABELS`), `PresenterView` (with `formatStopwatch`) |
|
|
60
61
|
|
|
61
62
|
Storybook stories live under `apps/storybook/src/stories`.
|
|
62
63
|
|
|
@@ -203,6 +204,77 @@ places:
|
|
|
203
204
|
- A surface that pans or zooms dispatches `LAYER_REPOSITION_EVENT` on its host
|
|
204
205
|
when the content beneath it moves, and every panel anchored inside follows.
|
|
205
206
|
|
|
207
|
+
## Changes in 0.25.0
|
|
208
|
+
|
|
209
|
+
0.25.0 adds the pieces the slides, dashboard, doc and sheet artifact kinds are drawn with, and the fixes from the artifact audit. Every new piece draws content the host renders itself and takes its data and callbacks as props, so nothing in it parses an artifact or knows a route.
|
|
210
|
+
|
|
211
|
+
Slides:
|
|
212
|
+
|
|
213
|
+
**`SlideStage`** lays a slide out at its authored size, 1920 by 1080 (`SLIDE_WIDTH`, `SLIDE_HEIGHT`), and scales it as a whole to its box, measured whenever the box resizes, so a thumbnail, the editor and a projector show the same line breaks. `fit="width"` is as wide as its column at 16:9; `fit="contain"` is as large as fits both ways, letterboxed, for Present; a fixed `scale` is for print. It is a group announced as a slide, named by `label`.
|
|
214
|
+
|
|
215
|
+
**`useSlideKeys`** answers the keys every presentation and every clicker sends: forward on Right, Down, Page Down, Space and Enter, back on Left, Up, Page Up and Backspace, Home and End to the ends, Escape out. It listens at the document while `enabled`, and leaves alone a field the reader is typing in, a composition, a key a nearer surface handled, and modified keys.
|
|
216
|
+
|
|
217
|
+
**`SlideFilmstrip`** is the column of thumbnails beside a deck's stage: the slide on the stage marked `aria-current`, one tab stop whose arrow keys move to the next slide, and, with `onReorder`, a handle per slide that moves it by drag or by its arrow keys and announces where it landed. A hidden slide is dimmed and says so.
|
|
218
|
+
|
|
219
|
+
**`SlideGrid`** lays every slide out by the outline's sections, numbered across the deck, each a button that opens its slide.
|
|
220
|
+
|
|
221
|
+
**`SlideCompare`** compares two versions of a deck slide by slide: each slide's older and newer drawings side by side, paired by its id, a slide one version lacks drawn as an empty side naming that version, and every change said in words beside a glyph (Changed, Added, Removed, Moved from 6 to 7), the list opening with the count of each. Unchanged slides fold away behind one control.
|
|
222
|
+
|
|
223
|
+
**`VersionCompare`** takes `versions`, a comparison the host draws in the versions lens in place of the two panes, for content compared item by item (a deck's slides, which two independent panes could not line up).
|
|
224
|
+
|
|
225
|
+
**`PresenterView`** is the presenter's own screen: the slide the room sees, the next one, the speaker notes large and on their own scroll, a timer that pauses, resumes and resets (`formatStopwatch` reads it as m:ss), and controls that stop at the ends of the deck.
|
|
226
|
+
|
|
227
|
+
Dashboards:
|
|
228
|
+
|
|
229
|
+
**`WidgetFrame`** is one figure on a dashboard, drawn inside the host's `ArrangeFrame`: its title, the figure, and the citation line every figure carries, the dataset's title (`WidgetSource.label`) then "live" or "as of" a relative time, the exact instant on hover. With `onCite` the citation is a button that opens the host's Sources rail at that dataset; `actions` holds the host's menu. `source.status` (`DatasetStatus`: `loading`, `live`, `ready`, `stale`, `refused`, `failed`) decides the body: a placeholder while loading, a marked citation when stale, and for `refused` and `failed` a calm sentence (`detail`, else the default words) IN PLACE of the figure, which is never drawn, so a host that passed rows by mistake still shows none.
|
|
230
|
+
|
|
231
|
+
**`DatasetSource`** is one entry of a Sources rail: the dataset's title, its source kind as a chip (`DatasetSourceKind`: `store`, `engine`, `file`, `calc`, drawn Datastore, Engine, File, Calculated, renamed through `labels.kinds`), its `definition`, then where its rows stand, how many there are and its `refresh` promise. With `onSelect` the summary is a toggle (`aria-pressed`) and the host's rows preview (`children`) is drawn under it when `selected`, outside the button. **`DatasetSourceList`** is the rail itself, a named list of entries. `DATASET_SOURCE_KINDS` lists the kinds.
|
|
232
|
+
|
|
233
|
+
**`downloadBlob`** saves any bytes the page holds (a chart's PNG, an archive) and answers whether the browser took them, under the name it offered; `downloadText` now saves through it, so text and binary files share one path. **`toCsv`** writes a table as RFC 4180 CSV (CRLF line ends, quoted where needed, doubled quotes) and defuses a TEXT cell that a spreadsheet would run as a formula (one starting with `=`, `+`, `-`, `@`, a tab or a carriage return) with a leading apostrophe; a number is never prefixed, so `-3` stays a value. **`elementToPng`** rasterises a drawn chart in the browser: one `<svg>` is serialised with its computed styles inlined (CSS variables resolved), anything else is cloned into an SVG `foreignObject`, and a failure rejects with **`ElementToPngError`**, whose `reason` (`unsupported`, `tainted`, `empty`) a host maps to its own words. **`serializeElement`** is the serialisation half on its own.
|
|
234
|
+
|
|
235
|
+
Docs, sheets and every kind:
|
|
236
|
+
|
|
237
|
+
**`DocCover`, `SheetCover` and `DashboardCover`** are the native gallery covers for `ArtifactCard.preview`, one module (`@crewlethq/ui/ArtifactCover`) sharing one frame: a doc's opening, rendered by the host's own Markdown renderer, set as a small page that fades at the card's edge; and a sheet's first columns and rows (at most `SHEET_COVER_COLUMNS` and `SHEET_COVER_ROWS`) as a hairline grid; and a dashboard's headline figures: up to three `stats`, each the reader's own value when the gallery holds it and otherwise its label and the title of the dataset it cites (never a placeholder number), else a schematic of the board's first widgets on its twelve columns (`layout`), else the kind's glyph. All three are decorative, as the card's preview is.
|
|
238
|
+
|
|
239
|
+
**`MergeConflicts`** settles a three-way merge of one text: each passage both edits changed shows the other side's lines (`theirs`, "version 4") beside the draft's, and the person keeps theirs, yours or both. Nothing is pre-chosen, `onApply` reports one `MergeChoice` per clash in order once each has one, and focus moves to its heading when it opens. The merge itself stays the host's.
|
|
240
|
+
|
|
241
|
+
**`ArtifactIcon`** draws the one short word an artifact's author gave it ("chart", "calendar") as a glyph, from a closed, case-insensitive vocabulary (`ARTIFACT_ICON_WORDS`, looked up by `artifactIconGlyph`), and the kind's glyph for any other word. **`ObjectHeader`** takes a `description`, the author's sentence under the title, clamped to two lines.
|
|
242
|
+
|
|
243
|
+
**`CanvasBoard` draws a design.** Artboards sit on a dotted `Canvas` at their own size with their titles above them, and titles and stickies (on `Note`'s papers) sit beside them. A board renders what the caller draws inside it only while it is on screen and at least `minLiveWidth` pixels wide, and at most `maxLive` (twelve) at once, so a canvas of sixty boards runs a dozen pages; the rest draw a titled placeholder of their size. `liveBoards` is that budget on its own, with no React in it. A live board is covered by a shield that pans like the field around it until a click hands the board the pointer, and Escape gives it back. With `editable`, a board's title moves it and its corner resizes it, by pointer or arrow keys, and notes are moved, resized, retyped and deleted; each finished gesture is reported once, in whole canvas pixels.
|
|
244
|
+
|
|
245
|
+
**`CanvasSchematic` draws a design's cover** from its boards' frames alone: every board where the canvas places it, the cover board marked and titled, notes as faint blocks.
|
|
246
|
+
|
|
247
|
+
**`Canvas` reports its view.** `onViewChange` is called with the view and the viewport's size from the first fit on, with an easing's destination rather than each step of it.
|
|
248
|
+
|
|
249
|
+
**`DocTabsEditor`** is a document's tabs as an editor arranges them: each tab's title edited at its field and held to the host's `titleProblem` there, the open tab marked (`selected`, `onSelect`), tabs moved by their handle, the arrow keys or Move up and Move down, removed (never the last), and a new tab added by its title after the open one. The host owns the tabs; every change is reported.
|
|
250
|
+
|
|
251
|
+
Fixes from the artifact audit:
|
|
252
|
+
|
|
253
|
+
- **`SheetGrid`**: a row's number carries its actions (on the active row, on hover, and Shift+F10) with Delete row through `onDeleteRow`, which the host confirms. A refusal is announced as it arrives, and the sync strip holds it as "N changes not saved" (`SheetSyncState.refused`) until the reader dismisses it through `onDismissRefused`, which calls `SheetPendingEdits.dismissAll`, so a refused write is never followed by "Saved". Text and long text edit in an overlay at least the column's width that wraps and grows to six lines. `fit="content"` sizes the grid to its rows, capped by `height` or `--crewlet-sheet-max-height`. List editors show a filter only above eight choices, and multi-select cells keep their chips on one line with a "+N" count.
|
|
254
|
+
- **`TagGroup`** takes `overflow="fit"`: one line, with the tags that do not fit counted in a static "+N" chip.
|
|
255
|
+
- **`SegmentedControl`**: `capped` draws a count as a floor ("50+"); a disabled option with `describedBy` stays focusable and says why it cannot be chosen; a pill row wraps inside its container; and a value changed from outside the row puts the tab stop back on the choice.
|
|
256
|
+
- **`Checkbox`** takes `size="sm"`, the label at the compact step for a dense form row.
|
|
257
|
+
- **`Section`** keeps its title on one line and lets the hint give way beside it. **`Meter`** draws its track with an edge on any ground, a minimum fill above zero, and moves its figure to its own line rather than cutting the label.
|
|
258
|
+
- **`VersionTimeline`** reads a version's kind ("Published") on the meta line, marks the version on show by fill alone, and its label action reads "Label". **`ShareDialog`**'s default title names its object in curly quotes.
|
|
259
|
+
- Presence hands out **`PRESENCE_HUES`**, the node hues without purple, so a collaborator is never ringed in the accent's hue. An agent whose chosen hue is purple keeps it.
|
|
260
|
+
- **`@crewlethq/artifact-kit`**: a page's sheet is as tall as its rows, and its sync strip offers Dismiss for refused changes.
|
|
261
|
+
|
|
262
|
+
What to change:
|
|
263
|
+
|
|
264
|
+
- A complete `SheetLabels` object of your own (rather than overrides through `labels` or `sheetLabels()`) needs the new keys `dismiss`, `notSaved`, `rowActions`, `deleteRow` and `rowActionsHelp`.
|
|
265
|
+
- A host that draws `SheetGrid` with `SheetPendingEdits` passes `onDismissRefused={() => edits.dismissAll()}`; without it, a refusal holds the strip at "not saved" until its cell is edited again.
|
|
266
|
+
- A test that finds a version's label action by the name "Name" finds it by "Label".
|
|
267
|
+
|
|
268
|
+
## Changes in 0.24.0
|
|
269
|
+
|
|
270
|
+
**The `markdown` artifact kind is now `doc`**, as the engine names it (`artifacts.KindDoc`). `ArtifactKind`, `ARTIFACT_KINDS`, `ArtifactKindGlyph` and `ArtifactCard` take `doc`, and the card's default label for it is "Doc".
|
|
271
|
+
|
|
272
|
+
What to change: pass `kind="doc"` wherever you passed `kind="markdown"`, and rename the `markdown` key of a custom `labels.kinds` to `doc`.
|
|
273
|
+
|
|
274
|
+
**`ArtifactKind` names every kind the engine ships**: `html`, `doc`, `slides`, `design`, `dashboard` and `sheet`, in the engine's order (`artifacts.Kinds`), which `ARTIFACT_KINDS` lists. Each draws its own glyph where a card has no preview (`slides` a presentation, `design` a palette, `dashboard` a dashboard layout), and its own default label ("Slides", "Design", "Dashboard"). A custom `labels.kinds` passes only the kinds it renames. `@crewlethq/icons` adds `PresentationGlyph`.
|
|
275
|
+
|
|
276
|
+
What to change: a `Record<ArtifactKind, ...>` of your own needs the three new keys.
|
|
277
|
+
|
|
206
278
|
## Changes in 0.23.0
|
|
207
279
|
|
|
208
280
|
**A text field's edge is quieter.** `Input`, the textarea, `TagsInput`, `MarkdownEditor` and the typed boxes inside `DateTimePicker` and `TimeWindowPicker` draw `--color-border-field` (new in `@crewlethq/tokens` 0.23.0): the secondary button's edge lifted only as far as 3:1 on the surfaces a field stands on, rather than the control boundary that was the brightest edge on the page. Under the pointer the edge steps up to `--color-border-control`; it used to step down to the hover hairline and fade. Checkboxes, switches and editors inside a row keep `--color-border-control`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ArrangeList, DEFAULT_ARRANGE_LABELS } from '../chunk-
|
|
1
|
+
export { ArrangeList, DEFAULT_ARRANGE_LABELS } from '../chunk-5LUI3WQP.js';
|
|
2
2
|
import '../chunk-A722MUNR.js';
|
|
3
3
|
import '../chunk-XJ2QEBMM.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-7T42VQQT.js';
|
|
5
5
|
import '../chunk-6QFAK2WV.js';
|
|
6
6
|
import '../chunk-PQADV6P6.js';
|
|
7
7
|
import '../chunk-RSAQOKH3.js';
|
|
@@ -4,8 +4,9 @@ import { type AvatarStackMember } from '../Avatar/index.js';
|
|
|
4
4
|
import { type Principal } from '../Principal/index.js';
|
|
5
5
|
import { type TimeValue } from '../RelativeTime/index.js';
|
|
6
6
|
/** What an artifact is, as the engine names it (`artifacts.Kind`), which decides how it is drawn. */
|
|
7
|
-
export type ArtifactKind = 'html' | '
|
|
8
|
-
|
|
7
|
+
export type ArtifactKind = 'html' | 'doc' | 'slides' | 'design' | 'dashboard' | 'sheet';
|
|
8
|
+
/** Every kind, in the engine's order (`artifacts.Kinds`). */
|
|
9
|
+
export declare const ARTIFACT_KINDS: readonly ["html", "doc", "slides", "design", "dashboard", "sheet"];
|
|
9
10
|
/** The glyph a kind is drawn with, wherever a kind is drawn, at a glyph size step or in px. */
|
|
10
11
|
export declare function ArtifactKindGlyph({ kind, size }: {
|
|
11
12
|
kind: ArtifactKind;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ARTIFACT_KINDS, ArtifactCard, ArtifactKindGlyph } from '../chunk-
|
|
1
|
+
export { ARTIFACT_KINDS, ArtifactCard, ArtifactKindGlyph } from '../chunk-6J35F334.js';
|
|
2
2
|
import '../chunk-4KP4RC3O.js';
|
|
3
3
|
import '../chunk-3CZ7XAVY.js';
|
|
4
4
|
import '../chunk-EUCC37WY.js';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The native covers a gallery card draws in `ArtifactCard.preview`, one per
|
|
4
|
+
* kind whose content can be drawn small (D64): never a screenshot, always the
|
|
5
|
+
* artifact's own content drawn by the design system at card size. A card
|
|
6
|
+
* whose kind has no cover keeps its glyph.
|
|
7
|
+
*
|
|
8
|
+
* The dashboard's cover is DashboardCover.tsx beside this file. All three
|
|
9
|
+
* share one frame, `.crewlet-artifact-cover`, so a card draws each the same way.
|
|
10
|
+
*
|
|
11
|
+
* DECORATIVE. The card is one link named by its title and described by its
|
|
12
|
+
* facts, and its preview is hidden from assistive tech, so a cover carries no
|
|
13
|
+
* names, roles or focusable parts of its own.
|
|
14
|
+
*/
|
|
15
|
+
export interface DocCoverProps {
|
|
16
|
+
/**
|
|
17
|
+
* The opening of the doc, rendered by the host's own Markdown renderer as
|
|
18
|
+
* the plain elements `Document` styles. It is clipped to the card, so a
|
|
19
|
+
* host passes a few lines rather than the whole document.
|
|
20
|
+
*/
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** A doc's cover: its opening, set as a small page that fades out at the card's edge. */
|
|
25
|
+
export declare function DocCover({ children, className }: DocCoverProps): import("react").JSX.Element;
|
|
26
|
+
export interface SheetCoverProps {
|
|
27
|
+
/** The first columns' names. */
|
|
28
|
+
columns: readonly string[];
|
|
29
|
+
/** The first rows, each a cell's text per column. */
|
|
30
|
+
rows: readonly (readonly string[])[];
|
|
31
|
+
className?: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
/** The columns and rows a sheet cover draws at most; past them a card has no room. */
|
|
34
|
+
export declare const SHEET_COVER_COLUMNS = 4;
|
|
35
|
+
export declare const SHEET_COVER_ROWS = 5;
|
|
36
|
+
/** A sheet's cover: its first columns and rows as a small grid. */
|
|
37
|
+
export declare function SheetCover({ columns, rows, className }: SheetCoverProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
/** One headline figure a cover draws. */
|
|
3
|
+
export interface DashboardCoverStat {
|
|
4
|
+
/** The widget's title: "Open tasks". */
|
|
5
|
+
label: string;
|
|
6
|
+
/**
|
|
7
|
+
* The figure as THIS reader sees it, already formatted. Unset when the
|
|
8
|
+
* gallery does not hold it, and then the cover draws `source` in its place,
|
|
9
|
+
* never a placeholder number.
|
|
10
|
+
*/
|
|
11
|
+
value?: string | undefined;
|
|
12
|
+
/** The title of the dataset the figure is drawn from. */
|
|
13
|
+
source?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** What one widget of the board is, for the schematic. */
|
|
16
|
+
export type DashboardCoverWidgetKind = 'stat' | 'chart' | 'table' | 'note';
|
|
17
|
+
/** One widget of the board, for the schematic: its width in grid columns and what it is. */
|
|
18
|
+
export interface DashboardCoverWidget {
|
|
19
|
+
/** Columns of a twelve-column grid, 1 to 12. */
|
|
20
|
+
w: number;
|
|
21
|
+
kind: DashboardCoverWidgetKind;
|
|
22
|
+
}
|
|
23
|
+
export interface DashboardCoverProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
24
|
+
/** The board's first headline figures. At most three are drawn. */
|
|
25
|
+
stats?: readonly DashboardCoverStat[] | undefined;
|
|
26
|
+
/** The board's first widgets, drawn as a schematic when there are no stats. */
|
|
27
|
+
layout?: readonly DashboardCoverWidget[] | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A dashboard artifact's cover in a gallery, passed as `ArtifactCard`'s
|
|
31
|
+
* `preview`: drawn natively, never a screenshot.
|
|
32
|
+
*
|
|
33
|
+
* THE READER'S NUMBERS OR NONE. A dashboard's figures are decided per reader,
|
|
34
|
+
* so a cover that baked in one reader's numbers would show every other reader
|
|
35
|
+
* figures they may not be allowed to see. A stat the gallery holds for this
|
|
36
|
+
* reader draws its value; one it does not draws its label and the title of
|
|
37
|
+
* the dataset it cites, so the card still says what the board measures.
|
|
38
|
+
*
|
|
39
|
+
* Without stats, a schematic of the board's first widgets on its twelve
|
|
40
|
+
* columns says what shape the board is. With neither, the kind's glyph.
|
|
41
|
+
*
|
|
42
|
+
* DECORATIVE where `ArtifactCard` draws it: the card hides its preview from
|
|
43
|
+
* assistive technology, because the card's own title and facts are what a
|
|
44
|
+
* screen reader reads. Drawn on its own, the stats remain readable text.
|
|
45
|
+
*/
|
|
46
|
+
export declare function DashboardCover({ stats, layout, className, ...rest }: DashboardCoverProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './ArtifactCover.css';
|
|
2
|
+
import './DashboardCover.css';
|
|
3
|
+
export { DocCover, SheetCover, SHEET_COVER_COLUMNS, SHEET_COVER_ROWS } from './ArtifactCover.js';
|
|
4
|
+
export type { DocCoverProps, SheetCoverProps } from './ArtifactCover.js';
|
|
5
|
+
export { DashboardCover } from './DashboardCover.js';
|
|
6
|
+
export type { DashboardCoverProps, DashboardCoverStat, DashboardCoverWidget, DashboardCoverWidgetKind, } from './DashboardCover.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { DashboardCover, DocCover, SHEET_COVER_COLUMNS, SHEET_COVER_ROWS, SheetCover } from '../chunk-MQEEQVG6.js';
|
|
2
|
+
import '../chunk-WI6K5M5X.js';
|
|
3
|
+
import '../chunk-6J35F334.js';
|
|
4
|
+
import '../chunk-4KP4RC3O.js';
|
|
5
|
+
import '../chunk-3CZ7XAVY.js';
|
|
6
|
+
import '../chunk-EUCC37WY.js';
|
|
7
|
+
import '../chunk-UAN5NE7M.js';
|
|
8
|
+
import '../chunk-5OM447RW.js';
|
|
9
|
+
import '../chunk-YZCJ63JF.js';
|
|
10
|
+
import '../chunk-AV2DXAEL.js';
|
|
11
|
+
import '../chunk-PQADV6P6.js';
|
|
12
|
+
import '../chunk-BHHIIK3M.js';
|
|
13
|
+
import '../chunk-BZFWDIV6.js';
|
|
14
|
+
import '../chunk-ODEQTPFM.js';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* The frame every native cover shares (DocCover, SheetCover, DashboardCover):
|
|
2
|
+
it fills a card's preview edge to edge and clips whatever runs past it. */
|
|
3
|
+
.crewlet-artifact-cover {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
align-self: stretch;
|
|
6
|
+
width: 100%;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* A doc's cover: a small page, inset from the card's edges, whose text runs
|
|
12
|
+
off the bottom under a fade rather than stopping mid-line at a hard edge. */
|
|
13
|
+
.crewlet-doc-cover {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: block;
|
|
16
|
+
padding: var(--spacing-3) var(--spacing-4) 0;
|
|
17
|
+
background: var(--color-surface-elevated);
|
|
18
|
+
color: var(--color-text-primary);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.crewlet-doc-cover::after {
|
|
22
|
+
content: '';
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset: auto 0 0;
|
|
25
|
+
height: 40%;
|
|
26
|
+
background: linear-gradient(to bottom, transparent, var(--color-surface-elevated));
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.crewlet-doc-cover__page {
|
|
31
|
+
font-size: var(--font-size-2xs);
|
|
32
|
+
line-height: 1.45;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.crewlet-doc-cover__page > :first-child {
|
|
36
|
+
margin-top: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.crewlet-doc-cover__page h1,
|
|
40
|
+
.crewlet-doc-cover__page h2,
|
|
41
|
+
.crewlet-doc-cover__page h3 {
|
|
42
|
+
font-size: var(--font-size-sm);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* A sheet's cover: its first columns and rows as a hairline grid. */
|
|
46
|
+
.crewlet-sheet-cover {
|
|
47
|
+
display: grid;
|
|
48
|
+
grid-template-columns: repeat(var(--crewlet-sheet-cover-columns), minmax(0, 1fr));
|
|
49
|
+
grid-auto-rows: min-content;
|
|
50
|
+
background: var(--color-surface-elevated);
|
|
51
|
+
font-size: var(--font-size-2xs);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.crewlet-sheet-cover__cell {
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
padding: var(--spacing-1) var(--spacing-2);
|
|
57
|
+
border-bottom: 1px solid var(--color-border-default);
|
|
58
|
+
color: var(--color-text-secondary);
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
text-overflow: ellipsis;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.crewlet-sheet-cover__cell--head {
|
|
64
|
+
background: var(--color-surface-inset);
|
|
65
|
+
color: var(--color-text-tertiary);
|
|
66
|
+
font-weight: var(--font-weight-medium);
|
|
67
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An artifact's own icon: the one short word its author gave it ("chart",
|
|
3
|
+
* "calendar"), drawn as a glyph, with the kind's glyph when the word names
|
|
4
|
+
* nothing this design system draws.
|
|
5
|
+
*
|
|
6
|
+
* A CLOSED VOCABULARY, not a lookup into every glyph by name. The word is
|
|
7
|
+
* typed by a person or an agent into a free field, so it is matched against a
|
|
8
|
+
* small table of common words, case-insensitive, and anything else falls back
|
|
9
|
+
* to the kind: an unknown word never draws a broken or arbitrary mark, and a
|
|
10
|
+
* glyph renamed in the icon set is one edit here rather than a stored word
|
|
11
|
+
* that silently stops matching.
|
|
12
|
+
*/
|
|
13
|
+
import { ChartColumnGlyph, type GlyphSize } from '@crewlethq/icons/glyphs';
|
|
14
|
+
import { type ArtifactKind } from '../ArtifactCard/index.js';
|
|
15
|
+
type Glyph = typeof ChartColumnGlyph;
|
|
16
|
+
/** Every word an icon may be, for a hint or a picker. */
|
|
17
|
+
export declare const ARTIFACT_ICON_WORDS: readonly string[];
|
|
18
|
+
/** The glyph an icon word names, or null for a word outside the vocabulary (or none). */
|
|
19
|
+
export declare function artifactIconGlyph(word: string | undefined | null): Glyph | null;
|
|
20
|
+
export interface ArtifactIconProps {
|
|
21
|
+
/** The artifact's icon word, as its author typed it. */
|
|
22
|
+
icon?: string | undefined | null;
|
|
23
|
+
/** The kind, whose glyph is drawn when the word names nothing. */
|
|
24
|
+
kind: ArtifactKind;
|
|
25
|
+
size?: GlyphSize | undefined;
|
|
26
|
+
}
|
|
27
|
+
/** An artifact's icon word as a glyph, or its kind's glyph. Decorative: the title names the artifact. */
|
|
28
|
+
export declare function ArtifactIcon({ icon, kind, size }: ArtifactIconProps): import("react").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { ARTIFACT_ICON_WORDS, ArtifactIcon, artifactIconGlyph } from '../chunk-V2Z24W2Z.js';
|
|
2
|
+
import '../chunk-6J35F334.js';
|
|
3
|
+
import '../chunk-4KP4RC3O.js';
|
|
4
|
+
import '../chunk-3CZ7XAVY.js';
|
|
5
|
+
import '../chunk-EUCC37WY.js';
|
|
6
|
+
import '../chunk-UAN5NE7M.js';
|
|
7
|
+
import '../chunk-5OM447RW.js';
|
|
8
|
+
import '../chunk-YZCJ63JF.js';
|
|
9
|
+
import '../chunk-AV2DXAEL.js';
|
|
10
|
+
import '../chunk-PQADV6P6.js';
|
|
11
|
+
import '../chunk-BHHIIK3M.js';
|
|
12
|
+
import '../chunk-BZFWDIV6.js';
|
|
13
|
+
import '../chunk-ODEQTPFM.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { AvatarPicker } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { AvatarPicker } from '../chunk-PRNX5AFE.js';
|
|
2
|
+
import '../chunk-SGIQCI6Y.js';
|
|
3
|
+
import '../chunk-RCQXUT5K.js';
|
|
4
|
+
import '../chunk-HJEVSQN6.js';
|
|
5
5
|
import '../chunk-BWRGFKJP.js';
|
|
6
6
|
import '../chunk-AYKXMIOR.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-HVIX5ECM.js';
|
|
8
|
+
import '../chunk-RKKO7QHH.js';
|
|
9
9
|
import '../chunk-5OM447RW.js';
|
|
10
10
|
import '../chunk-BHHIIK3M.js';
|
|
11
11
|
import '../chunk-HMPFGIWM.js';
|
package/dist/Canvas/Canvas.d.ts
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
* Ported from the engine dashboard's `ui/Canvas.tsx`, with its suite.
|
|
74
74
|
*/
|
|
75
75
|
import { type ReactNode, type Ref } from 'react';
|
|
76
|
-
import { type CanvasPoint, type CanvasRect } from './geometry.js';
|
|
76
|
+
import { type CanvasPoint, type CanvasRect, type CanvasSize, type CanvasView } from './geometry.js';
|
|
77
77
|
/**
|
|
78
78
|
* How a view change moves: a correction to where the reader already is, or the
|
|
79
79
|
* chart travelling somewhere else. See the state that holds it, below.
|
|
@@ -243,7 +243,18 @@ export interface CanvasProps {
|
|
|
243
243
|
labels?: Partial<CanvasLabels> | undefined;
|
|
244
244
|
/** Called once, when the first measured layout has been fitted. */
|
|
245
245
|
onReady?: (() => void) | undefined;
|
|
246
|
+
/**
|
|
247
|
+
* Called with the view and the viewport's size whenever either changes,
|
|
248
|
+
* from the first fit on.
|
|
249
|
+
*
|
|
250
|
+
* THE VIEW IT IS GIVEN IS WHERE THE CONTENT IS GOING, not where an easing
|
|
251
|
+
* has got to: a fit or a zoom step reports its destination at once, so a
|
|
252
|
+
* surface that mounts what is on screen (a design's live artboards) mounts
|
|
253
|
+
* what the reader will see when the move lands, rather than chasing every
|
|
254
|
+
* frame of it.
|
|
255
|
+
*/
|
|
256
|
+
onViewChange?: ((view: CanvasView, viewport: CanvasSize) => void) | undefined;
|
|
246
257
|
ref?: Ref<CanvasHandle> | undefined;
|
|
247
258
|
className?: string | undefined;
|
|
248
259
|
}
|
|
249
|
-
export declare function Canvas({ label, content, children, overlay, controls, controlsPlacement, controlsExtra, controlsBelow, hint, largestItemWidth, dimmed, ground, touch, labels, onReady, ref, className, }: CanvasProps): import("react").JSX.Element;
|
|
260
|
+
export declare function Canvas({ label, content, children, overlay, controls, controlsPlacement, controlsExtra, controlsBelow, hint, largestItemWidth, dimmed, ground, touch, labels, onReady, onViewChange, ref, className, }: CanvasProps): import("react").JSX.Element;
|
package/dist/Canvas/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, CANVAS_FIT_PADDING, CANVAS_FOCUS_CONTEXT, CANVAS_MAX_ZOOM, CANVAS_MIN_ZOOM, CANVAS_PAN_MARGIN, CANVAS_PAN_STEP, CANVAS_REVEAL_PADDING, CANVAS_TAP_SLOP, CANVAS_WHEEL_LINE_PX, CANVAS_WHEEL_ZOOM_PER_PIXEL, CANVAS_ZOOM_CEILING, CANVAS_ZOOM_LIMITS, CANVAS_ZOOM_STEP, Canvas, IDENTITY_VIEW, anchorView, beyondSlop, clampPan, clampZoom, fitView, panBy, pinchView, regionView, revealView, screenRect, toScreen, toWorld, wheelPixels, wheelZoomFactor, zoomAt, zoomLimits } from '../chunk-
|
|
1
|
+
export { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, CANVAS_FIT_PADDING, CANVAS_FOCUS_CONTEXT, CANVAS_MAX_ZOOM, CANVAS_MIN_ZOOM, CANVAS_PAN_MARGIN, CANVAS_PAN_STEP, CANVAS_REVEAL_PADDING, CANVAS_TAP_SLOP, CANVAS_WHEEL_LINE_PX, CANVAS_WHEEL_ZOOM_PER_PIXEL, CANVAS_ZOOM_CEILING, CANVAS_ZOOM_LIMITS, CANVAS_ZOOM_STEP, Canvas, IDENTITY_VIEW, anchorView, beyondSlop, clampPan, clampZoom, fitView, panBy, pinchView, regionView, revealView, screenRect, toScreen, toWorld, wheelPixels, wheelZoomFactor, zoomAt, zoomLimits } from '../chunk-KZOGQXSP.js';
|
|
2
2
|
import '../chunk-VYOKRN2I.js';
|
|
3
3
|
import '../chunk-OG6CL3EB.js';
|
|
4
4
|
import '../chunk-HMPFGIWM.js';
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A canvas of artboards and notes: a design.
|
|
3
|
+
*
|
|
4
|
+
* WHAT IT DRAWS. Each artboard is a frame of its own size, placed on the
|
|
5
|
+
* canvas at its position, with its title above it; the caller renders what is
|
|
6
|
+
* inside (for a design, a sandboxed page). Notes are titles laid over groups of
|
|
7
|
+
* boards and coloured stickies beside them, drawn here as plain text.
|
|
8
|
+
*
|
|
9
|
+
* THE VISIBILITY BUDGET (budget.ts). A board's content is rendered only while
|
|
10
|
+
* the board is on screen and drawn wide enough to read, and at most
|
|
11
|
+
* [CANVAS_BOARD_MAX_LIVE] at once; every other board draws as a placeholder of
|
|
12
|
+
* its size, so a canvas of sixty boards runs a dozen pages, not sixty.
|
|
13
|
+
*
|
|
14
|
+
* A PAGE INSIDE A BOARD NEVER TAKES THE CANVAS'S POINTER BY SURPRISE. A live
|
|
15
|
+
* board is covered by a shield that pans the canvas like the field around it;
|
|
16
|
+
* a click (not a drag) on it activates that board, and only then does the page
|
|
17
|
+
* receive the pointer. Escape gives the pointer back to the canvas.
|
|
18
|
+
*
|
|
19
|
+
* EDITING (`editable`). A board's title bar becomes its move handle and a
|
|
20
|
+
* corner its resize handle, by pointer or by the arrow keys (Shift for a larger
|
|
21
|
+
* step); a note gains the same handles, and its text is edited in place. Each
|
|
22
|
+
* finished gesture is reported once, with whole canvas pixels, and the caller
|
|
23
|
+
* decides what a change is (for a design, a new version of its canvas).
|
|
24
|
+
*
|
|
25
|
+
* THE CHROME STAYS ONE SIZE ON SCREEN. Titles and handles are counter-scaled
|
|
26
|
+
* by the zoom, so a board's label is readable and its handle is a full pointer
|
|
27
|
+
* target whatever the zoom, while the board itself scales with the canvas.
|
|
28
|
+
*/
|
|
29
|
+
import { type ReactNode, type Ref } from 'react';
|
|
30
|
+
import { type CanvasHandle, type CanvasLabels } from '../Canvas/index.js';
|
|
31
|
+
/** An artboard: an id, its frame in canvas pixels and its title. */
|
|
32
|
+
export interface CanvasBoardItem {
|
|
33
|
+
id: string;
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
w: number;
|
|
37
|
+
h: number;
|
|
38
|
+
title: string;
|
|
39
|
+
}
|
|
40
|
+
/** A sticky's colour, a name drawn from the theme's own palette. */
|
|
41
|
+
export type CanvasNoteColor = 'yellow' | 'pink' | 'blue' | 'green' | 'purple';
|
|
42
|
+
/** Every sticky colour, the first being a sticky's default. */
|
|
43
|
+
export declare const CANVAS_NOTE_COLORS: readonly ["yellow", "pink", "blue", "green", "purple"];
|
|
44
|
+
/** A note: a title over a group of boards, or a sticky beside them. */
|
|
45
|
+
export interface CanvasBoardNote {
|
|
46
|
+
id: string;
|
|
47
|
+
kind: 'title' | 'sticky';
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
w: number;
|
|
51
|
+
h: number;
|
|
52
|
+
text: string;
|
|
53
|
+
color?: CanvasNoteColor | undefined;
|
|
54
|
+
}
|
|
55
|
+
/** A frame as an edit reports it. */
|
|
56
|
+
export interface CanvasBoardRect {
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
w: number;
|
|
60
|
+
h: number;
|
|
61
|
+
}
|
|
62
|
+
/** Every string the board renders itself. */
|
|
63
|
+
export interface CanvasBoardLabels {
|
|
64
|
+
/** A board's size, read after its title: "1440 by 900". */
|
|
65
|
+
size: (w: number, h: number) => string;
|
|
66
|
+
/** The control that opens one board full size. */
|
|
67
|
+
open: (title: string) => string;
|
|
68
|
+
/** The move handle of a board or note, in edit mode. */
|
|
69
|
+
move: (title: string) => string;
|
|
70
|
+
/** The resize handle of a board or note, in edit mode. */
|
|
71
|
+
resize: (title: string) => string;
|
|
72
|
+
/** The control that edits a note's text. */
|
|
73
|
+
editNote: string;
|
|
74
|
+
/** The control that deletes a note. */
|
|
75
|
+
removeNote: string;
|
|
76
|
+
/** The field a note's text is typed into. */
|
|
77
|
+
noteText: string;
|
|
78
|
+
/** Said by a board whose page is not running because it is off screen or too small. */
|
|
79
|
+
paused: string;
|
|
80
|
+
/** Said by an active board, so a reader knows how to give the pointer back. */
|
|
81
|
+
active: string;
|
|
82
|
+
}
|
|
83
|
+
export interface CanvasBoardProps {
|
|
84
|
+
/** The accessible name of the canvas, such as "Launch landing page". */
|
|
85
|
+
label: string;
|
|
86
|
+
boards: readonly CanvasBoardItem[];
|
|
87
|
+
notes?: readonly CanvasBoardNote[] | undefined;
|
|
88
|
+
/** What a live board draws inside its frame. Called only for live boards. */
|
|
89
|
+
renderBoard: (board: CanvasBoardItem) => ReactNode;
|
|
90
|
+
/** The most boards live at once. */
|
|
91
|
+
maxLive?: number | undefined;
|
|
92
|
+
/** The narrowest a board may be drawn on screen and still be live, in pixels. */
|
|
93
|
+
minLiveWidth?: number | undefined;
|
|
94
|
+
/** Whether a person may move and resize boards and edit notes. */
|
|
95
|
+
editable?: boolean | undefined;
|
|
96
|
+
/** The smallest and largest side a board or note may be given, in canvas pixels. */
|
|
97
|
+
minSide?: number | undefined;
|
|
98
|
+
maxSide?: number | undefined;
|
|
99
|
+
/** A board was moved or resized, reported once when the gesture ends. */
|
|
100
|
+
onBoardChange?: ((id: string, rect: CanvasBoardRect) => void) | undefined;
|
|
101
|
+
/** A note was moved, resized or retyped. */
|
|
102
|
+
onNoteChange?: ((note: CanvasBoardNote) => void) | undefined;
|
|
103
|
+
/** A note was deleted. */
|
|
104
|
+
onNoteRemove?: ((id: string) => void) | undefined;
|
|
105
|
+
/** The control that opens one board full size; absent, there is none. */
|
|
106
|
+
onOpen?: ((id: string) => void) | undefined;
|
|
107
|
+
/** The board that holds the pointer changed; null is the canvas itself. */
|
|
108
|
+
onActivate?: ((id: string | null) => void) | undefined;
|
|
109
|
+
/** Anything else in the canvas's control bar. */
|
|
110
|
+
controlsExtra?: ReactNode | undefined;
|
|
111
|
+
labels?: Partial<CanvasBoardLabels> | undefined;
|
|
112
|
+
canvasLabels?: Partial<CanvasLabels> | undefined;
|
|
113
|
+
/** The canvas underneath, for a caller that reveals or fits a board. */
|
|
114
|
+
canvasRef?: Ref<CanvasHandle> | undefined;
|
|
115
|
+
className?: string | undefined;
|
|
116
|
+
}
|
|
117
|
+
export declare function CanvasBoard({ label, boards, notes, renderBoard, maxLive, minLiveWidth, editable, minSide, maxSide, onBoardChange, onNoteChange, onNoteRemove, onOpen, onActivate, controlsExtra, labels, canvasLabels, canvasRef, className, }: CanvasBoardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which artboards a canvas frames at once: the visibility budget.
|
|
3
|
+
*
|
|
4
|
+
* WHY A BUDGET. Every live artboard is a document of its own (a sandboxed
|
|
5
|
+
* frame running its own scripts), so a canvas of sixty boards zoomed out would
|
|
6
|
+
* otherwise run sixty pages at once, most of them drawn smaller than a thumb.
|
|
7
|
+
* A board is live only while it is on screen AND drawn wide enough to read,
|
|
8
|
+
* and at most a fixed number are live together, the largest on screen first.
|
|
9
|
+
* Every other board draws as a titled placeholder of its size.
|
|
10
|
+
*
|
|
11
|
+
* Pure arithmetic over the canvas's view, so it is tested without a layout.
|
|
12
|
+
*/
|
|
13
|
+
import type { CanvasSize, CanvasView } from '../Canvas/index.js';
|
|
14
|
+
/** A board's frame on the canvas, in world units. */
|
|
15
|
+
export interface BoardFrame {
|
|
16
|
+
id: string;
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
w: number;
|
|
20
|
+
h: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The most boards live at once. Twelve covers a landing page's sections on
|
|
24
|
+
* one screen with room, and is well under what a browser runs smoothly as
|
|
25
|
+
* separate documents.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CANVAS_BOARD_MAX_LIVE = 12;
|
|
28
|
+
/**
|
|
29
|
+
* The narrowest a board may be drawn, in screen pixels, and still be live:
|
|
30
|
+
* below it a page's text is unreadable, so running it buys nothing.
|
|
31
|
+
*/
|
|
32
|
+
export declare const CANVAS_BOARD_MIN_LIVE_WIDTH = 160;
|
|
33
|
+
/**
|
|
34
|
+
* The boards to frame for a view: those on screen and at least `minWidth`
|
|
35
|
+
* pixels wide there, the most visible area first, at most `max` of them,
|
|
36
|
+
* answered in the order `boards` lists them.
|
|
37
|
+
*/
|
|
38
|
+
export declare function liveBoards(boards: readonly BoardFrame[], view: CanvasView, viewport: CanvasSize, max?: number, minWidth?: number): string[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './CanvasBoard.css';
|
|
2
|
+
export { CanvasBoard, CANVAS_NOTE_COLORS } from './CanvasBoard.js';
|
|
3
|
+
export type { CanvasBoardItem, CanvasBoardLabels, CanvasBoardNote, CanvasBoardProps, CanvasBoardRect, CanvasNoteColor, } from './CanvasBoard.js';
|
|
4
|
+
export { CANVAS_BOARD_MAX_LIVE, CANVAS_BOARD_MIN_LIVE_WIDTH, liveBoards } from './budget.js';
|
|
5
|
+
export type { BoardFrame } from './budget.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { CANVAS_BOARD_MAX_LIVE, CANVAS_BOARD_MIN_LIVE_WIDTH, CANVAS_NOTE_COLORS, CanvasBoard, liveBoards } from '../chunk-3D7PSL2L.js';
|
|
2
|
+
import '../chunk-63WJLRB2.js';
|
|
3
|
+
import '../chunk-KZOGQXSP.js';
|
|
4
|
+
import '../chunk-VYOKRN2I.js';
|
|
5
|
+
import '../chunk-OG6CL3EB.js';
|
|
6
|
+
import '../chunk-HMPFGIWM.js';
|
|
7
|
+
import '../chunk-R25RGPUB.js';
|
|
8
|
+
import '../chunk-4FQT6ZAY.js';
|
|
9
|
+
import '../chunk-BZFWDIV6.js';
|
|
10
|
+
import '../chunk-ODEQTPFM.js';
|