@softure-ai/theme-notion 0.10.3 → 0.11.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/CHANGELOG.md +32 -0
- package/README.md +70 -3
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/messages/en.d.ts +17 -0
- package/dist/messages/en.d.ts.map +1 -1
- package/dist/messages/en.js +17 -0
- package/dist/messages/en.js.map +1 -1
- package/dist/messages/index.d.ts +17 -0
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/notion/RouteLoading.d.ts +14 -0
- package/dist/notion/RouteLoading.d.ts.map +1 -0
- package/dist/notion/RouteLoading.js +11 -0
- package/dist/notion/RouteLoading.js.map +1 -0
- package/dist/notion/TopLoadingBar.d.ts +15 -0
- package/dist/notion/TopLoadingBar.d.ts.map +1 -0
- package/dist/notion/TopLoadingBar.js +10 -0
- package/dist/notion/TopLoadingBar.js.map +1 -0
- package/dist/notion/Upload.d.ts +64 -0
- package/dist/notion/Upload.d.ts.map +1 -0
- package/dist/notion/Upload.js +114 -0
- package/dist/notion/Upload.js.map +1 -0
- package/dist/notion/format-file-size.d.ts +3 -0
- package/dist/notion/format-file-size.d.ts.map +1 -0
- package/dist/notion/format-file-size.js +17 -0
- package/dist/notion/format-file-size.js.map +1 -0
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +17 -2
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/tabs-variants.d.ts +6 -0
- package/dist/ui/tabs-variants.d.ts.map +1 -0
- package/dist/ui/tabs-variants.js +26 -0
- package/dist/ui/tabs-variants.js.map +1 -0
- package/dist/ui/tabs.d.ts +3 -7
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +2 -25
- package/dist/ui/tabs.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +16 -0
- package/src/messages/en.ts +17 -0
- package/src/notion/RouteLoading.tsx +34 -0
- package/src/notion/TopLoadingBar.tsx +28 -0
- package/src/notion/Upload.tsx +324 -0
- package/src/notion/format-file-size.ts +16 -0
- package/src/ui/dialog.tsx +1 -1
- package/src/ui/progress.tsx +18 -1
- package/src/ui/tabs-variants.ts +29 -0
- package/src/ui/tabs.tsx +3 -29
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,38 @@ Newest first. Each version lists what changed for an app that uses the theme. Wh
|
|
|
4
4
|
production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
|
|
5
5
|
"Definition of done").
|
|
6
6
|
|
|
7
|
+
## 0.11.1
|
|
8
|
+
|
|
9
|
+
- `tabsListVariants` can be called from a Server Component (#1008): the class builder of `TabsList` moved out of the
|
|
10
|
+
`"use client"` tabs module into the plain `ui/tabs-variants.ts`, so the root export is the function itself, not a
|
|
11
|
+
client reference. Same API and classes. The theme contract no longer exempts it.
|
|
12
|
+
- `formatFileSize` can be called from a Server Component (#1005): it moved out of the `"use client"` upload module
|
|
13
|
+
into a plain one, so the root export is the function itself, not a client reference. An app that wrapped it in a
|
|
14
|
+
client component to render a size can call it directly again. The theme contract now checks that a client module
|
|
15
|
+
exports only components and hooks.
|
|
16
|
+
|
|
17
|
+
## 0.11.0
|
|
18
|
+
|
|
19
|
+
- An upload control (#950): `UploadField` (a labelled area whose touch-sized button opens the native file picker,
|
|
20
|
+
`accept`/`multiple`/`capture` passed through, with dropping on wide screens), `UploadList` and `UploadItem` (one row
|
|
21
|
+
per file: name, size by locale, a `Status` word for `queued`, `uploading`, `paused`, `done` or `failed`, a
|
|
22
|
+
determinate `Progress`, the error and Retry, Pause, Resume and Remove buttons by callback), and `formatFileSize`.
|
|
23
|
+
Controlled and transport-free: the app or its upload transport owns the items. Copy in `notionMessages.en.upload`,
|
|
24
|
+
replaced through `messages`. New exports only.
|
|
25
|
+
- `DialogFooter showCloseButton` renders its close button before `children` (#921): with a confirm button in
|
|
26
|
+
`children`, cancel sits left of confirm from `sm` and below it on a phone (`flex-col-reverse`), the order of
|
|
27
|
+
`AlertDialogFooter`. Before, the close button came last. The button already had `type="button"` (from Radix
|
|
28
|
+
`DialogClose`), so in a form dialog it closes the dialog without submitting the form; a test now guards that.
|
|
29
|
+
An app that wants another order places its own `DialogClose`.
|
|
30
|
+
- A thin top loading bar for wide screens (#923): `TopLoadingBar` is a 2 px, square `Progress` fixed to the top edge
|
|
31
|
+
on a transparent track, `pointer-events-none`, so the page stays usable while a route loads; driven by the pwa
|
|
32
|
+
counter (`buildLaunchProgressScript({ rootSlot: "top-loading-bar" })`) or indeterminate. `RouteLoading` streams it
|
|
33
|
+
with `LaunchScreen` and lets CSS pick: the launch screen below `md` or in an installed app, the bar in a wide browser
|
|
34
|
+
tab, so `app/loading.tsx` needs no request reading and pages stay static.
|
|
35
|
+
- `Progress` without a `value` is indeterminate: a third of the track slides across it (still, full and half-opaque
|
|
36
|
+
with reduced motion). Before, it drew an empty track. With a value it draws as before; its indicator carries the
|
|
37
|
+
indeterminate classes under `data-[state=indeterminate]:`.
|
|
38
|
+
|
|
7
39
|
## 0.10.3
|
|
8
40
|
|
|
9
41
|
- Dialog sizes for a popup: `DialogContent size` gains `"lg"` and `"sm"`. `lg` is the standard popup, centred with a
|
package/README.md
CHANGED
|
@@ -140,7 +140,11 @@ stages with a state, below), `Timeline` (dated entries on a vertical rail, below
|
|
|
140
140
|
`MiniProgress` (a compact bar with its figure inside, for a table cell or a tile, below),
|
|
141
141
|
`UpdatePrompt` (the offer to reload into a new build, for an installed app, below),
|
|
142
142
|
`InstallBar` (the offer to install the app on a phone, below),
|
|
143
|
-
`LaunchScreen` (an installed app's icon, name and progress while its first page loads, below)
|
|
143
|
+
`LaunchScreen` (an installed app's icon, name and progress while its first page loads, below),
|
|
144
|
+
`TopLoadingBar` (a thin bar at the top while a route loads on a wide screen, below),
|
|
145
|
+
`RouteLoading` (the launch screen or the top bar, picked by the browser, below),
|
|
146
|
+
`UploadField`, `UploadList` and `UploadItem` (pick or drop files, one row per file with progress, retry and remove,
|
|
147
|
+
below).
|
|
144
148
|
|
|
145
149
|
**Touch sizes.** The controls a phone view taps most reach the `touch-target` token (44 px, Apple's HIG and WCAG
|
|
146
150
|
2.5.5): `Button` sizes `touch` (44 px high, padded like `lg`) and `icon-touch` (44 × 44), `SelectTrigger`
|
|
@@ -437,6 +441,65 @@ export default function Loading() {
|
|
|
437
441
|
}
|
|
438
442
|
```
|
|
439
443
|
|
|
444
|
+
**`TopLoadingBar`.** The wide-screen counterpart of `LaunchScreen`: a `Progress` fixed to the top edge (`inset-x-0
|
|
445
|
+
top-0 z-50`), 2 px high, square, on a transparent track and `pointer-events-none`, so the page under it stays usable
|
|
446
|
+
while a route loads. Named by `label`; `value` (0–100) when the app knows the progress, otherwise it is indeterminate:
|
|
447
|
+
a third of the track sliding across it for ever (still, full and half-opaque with reduced motion). The inline `script`
|
|
448
|
+
(`buildLaunchProgressScript({ rootSlot: "top-loading-bar" })` from `@softure-ai/pwa`) gives it the launch counter's
|
|
449
|
+
values where the browser runs it, a streamed first load; its first value makes the bar determinate. A client-side
|
|
450
|
+
navigation never runs a script React inserts, so there the bar keeps sliding. Any `Progress` without a `value` is
|
|
451
|
+
indeterminate the same way.
|
|
452
|
+
|
|
453
|
+
**`RouteLoading`.** The loading state for the root `app/loading.tsx`, picked in the browser, so reading the request
|
|
454
|
+
(which makes static pages dynamic) is not needed: it streams both `LaunchScreen` and `TopLoadingBar` and CSS shows
|
|
455
|
+
the launch screen below `md` or in an installed app (`display-mode: standalone`), the top bar on a wide screen in a
|
|
456
|
+
browser tab (`md` and `display-mode: browser`). Each takes its own counter script:
|
|
457
|
+
|
|
458
|
+
```tsx
|
|
459
|
+
// app/loading.tsx
|
|
460
|
+
import { buildLaunchProgressScript, ICONS_PATH } from "@softure-ai/pwa";
|
|
461
|
+
const LAUNCH_SCRIPT = buildLaunchProgressScript();
|
|
462
|
+
const BAR_SCRIPT = buildLaunchProgressScript({ rootSlot: "top-loading-bar" });
|
|
463
|
+
export default function Loading() {
|
|
464
|
+
return (
|
|
465
|
+
<RouteLoading
|
|
466
|
+
name={messages.app.name}
|
|
467
|
+
iconSrc={`${ICONS_PATH}/icon-192.png`}
|
|
468
|
+
label={messages.pwa.launch.label}
|
|
469
|
+
launchScript={LAUNCH_SCRIPT}
|
|
470
|
+
barScript={BAR_SCRIPT}
|
|
471
|
+
/>
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
An app with a local top bar and a stand-in script object for `launchProgress` drops both for `RouteLoading` (or
|
|
477
|
+
`TopLoadingBar` with `rootSlot`).
|
|
478
|
+
|
|
479
|
+
**`UploadField`, `UploadList`, `UploadItem`.** A file upload control that holds no files and sends nothing: the app,
|
|
480
|
+
or its transport (e.g. `@softure-ai/files`), keeps the list and does the uploading. `UploadField` is a `Field` with a
|
|
481
|
+
`label` (and optional `description` and `error`) around a dashed area: a touch-sized `Button` opens the native
|
|
482
|
+
`<input type="file">` (`accept`, `multiple` and `capture` passed through, so a phone offers its files, photos and
|
|
483
|
+
camera), and from `md` up files can also be dropped on the area, which highlights while they are dragged over it. Each
|
|
484
|
+
pick or drop goes to `onFilesSelected(files)`: only the files matching `accept` (the picker enforces it, a drop is
|
|
485
|
+
checked by extension and MIME type), the first one without `multiple`; dropped files that do not match go to
|
|
486
|
+
`onFilesRejected`. `UploadList` is the named `ul`; `UploadItem` draws one `UploadFileItem` (`{ id, name, size, state,
|
|
487
|
+
progress?, error? }`): the name, the size by `locale` (`formatFileSize`, decimal steps, e.g. "52.4 MB"; a plain function, safe to call in a Server Component), the state as
|
|
488
|
+
a `Status` word (`queued` gray, `uploading` blue, `paused` orange, `done` green, `failed` red), a determinate
|
|
489
|
+
`Progress` while uploading or paused, and under a failed row its `error`. Buttons show with their callbacks, each
|
|
490
|
+
called with the item: Retry on a failed row (`onRetry`), Pause while uploading (`onPause`), Resume when paused
|
|
491
|
+
(`onResume`) and Remove in every state (`onRemove`). Copy is `notionMessages.en.upload` (`{name}` is the file's
|
|
492
|
+
name); `messages` replaces any of it.
|
|
493
|
+
|
|
494
|
+
```tsx
|
|
495
|
+
<UploadField label="Videos" accept="video/*" multiple onFilesSelected={(files) => uploads.add(files)} />
|
|
496
|
+
<UploadList label="Files">
|
|
497
|
+
{uploads.items.map((item) => (
|
|
498
|
+
<UploadItem key={item.id} item={item} onRetry={uploads.retry} onPause={uploads.pause} onResume={uploads.resume} onRemove={uploads.remove} />
|
|
499
|
+
))}
|
|
500
|
+
</UploadList>
|
|
501
|
+
```
|
|
502
|
+
|
|
440
503
|
**`SortableList`.** A list whose rows are reordered by dragging, built on the headless `@dnd-kit/core` and
|
|
441
504
|
`@dnd-kit/sortable`. On a touch screen a long press (`holdDelay`, 500 ms) lifts a row; moving more than `tolerance`
|
|
442
505
|
(8 px) before that scrolls instead, and a tap still activates the row. A mouse drags the same way; from the keyboard
|
|
@@ -530,7 +593,10 @@ Deltas from stock shadcn:
|
|
|
530
593
|
quarters of it from `sm`, the 1 rem gutter on a phone; its height is fixed and its content scrolls in a column
|
|
531
594
|
(an app with a fixed header and footer sets `p-0 gap-0` and scrolls its own body with
|
|
532
595
|
`min-h-0 flex-1 overflow-y-auto`). `size="sm"` is a small popup for little data: `max-w-md`, its height by
|
|
533
|
-
content up to the viewport's gutter, then scrolling. `
|
|
596
|
+
content up to the viewport's gutter, then scrolling. `DialogFooter showCloseButton` puts its close button
|
|
597
|
+
before `children`, so a form dialog's footer reads cancel then confirm (confirm on top on a phone); the button is
|
|
598
|
+
`type="button"`, so inside a `<form>` it closes the dialog without submitting. `card`: `shadow-card` instead of a
|
|
599
|
+
border.
|
|
534
600
|
- `checkbox` 16 px with a 1.5 px border, `radio-group` drawn the same (round, a `primary` dot), `switch` 26 × 16
|
|
535
601
|
(thumb shadow in `SWITCH_THUMB_SHADOW_CLASS`, for a native switch drawn the same), `tooltip` dark without an arrow,
|
|
536
602
|
`tabs` default to the `line` variant, `progress` 6 px.
|
|
@@ -538,7 +604,8 @@ Deltas from stock shadcn:
|
|
|
538
604
|
(`w-full min-w-0`, and the `Tabs` root gets `min-w-0`, so a grid or flex parent does not widen to the tabs), scrolls
|
|
539
605
|
sideways by touch, wheel and the arrow keys (focus moves to the next tab), keeps every trigger at its own width and
|
|
540
606
|
scrolls the active tab into the middle whenever it changes; it combines with `size="touch"`. Sets
|
|
541
|
-
`data-scrollable="true"` on the list.
|
|
607
|
+
`data-scrollable="true"` on the list. `tabsListVariants` (the list's class builder) lives in a plain module, so a
|
|
608
|
+
Server Component can call it to style its own list.
|
|
542
609
|
|
|
543
610
|
```tsx
|
|
544
611
|
<Tabs value={tab} onValueChange={setTab}>
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export * from "./ui/switch.js";
|
|
|
37
37
|
export { SWITCH_THUMB_SHADOW_CLASS } from "./ui/switch-thumb.js";
|
|
38
38
|
export * from "./ui/table.js";
|
|
39
39
|
export * from "./ui/tabs.js";
|
|
40
|
+
export { tabsListVariants } from "./ui/tabs-variants.js";
|
|
40
41
|
export * from "./ui/textarea.js";
|
|
41
42
|
export * from "./ui/tooltip.js";
|
|
42
43
|
export { ICON_STROKE_WIDTH } from "./notion/icon-stroke.js";
|
|
@@ -52,6 +53,7 @@ export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
|
52
53
|
export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
|
|
53
54
|
export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
|
|
54
55
|
export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
|
|
56
|
+
export { RouteLoading, type RouteLoadingProps } from "./notion/RouteLoading.js";
|
|
55
57
|
export { SheetMenu, SheetMenuButton, SheetMenuItem, type SheetMenuButtonProps } from "./notion/SheetMenu.js";
|
|
56
58
|
export { SidePanel, type SidePanelLayout, type SidePanelProps } from "./notion/SidePanel.js";
|
|
57
59
|
export { SortableActivator, SortableHandle, SortableItem, SortableList, type SortableActivatorProps, type SortableAnnouncements, type SortableDragBy, type SortableHandleProps, type SortableItemProps, type SortableListProps, type SortableMove, } from "./notion/Sortable.js";
|
|
@@ -60,6 +62,9 @@ export { Status, type StatusProps } from "./notion/Status.js";
|
|
|
60
62
|
export { Steps, type StepItem, type StepState, type StepsLayout, type StepsProps } from "./notion/Steps.js";
|
|
61
63
|
export { TabBar, type TabBarItem, type TabBarProps } from "./notion/TabBar.js";
|
|
62
64
|
export { Timeline, type TimelineItem, type TimelineItemFold, type TimelineItemSize, type TimelineLine, type TimelineProps } from "./notion/Timeline.js";
|
|
65
|
+
export { TopLoadingBar, type TopLoadingBarProps } from "./notion/TopLoadingBar.js";
|
|
66
|
+
export { UploadField, UploadItem, UploadList, type UploadFieldProps, type UploadFileItem, type UploadItemProps, type UploadListProps, type UploadMessages, type UploadMessagesOverride, type UploadState, } from "./notion/Upload.js";
|
|
67
|
+
export { formatFileSize } from "./notion/format-file-size.js";
|
|
63
68
|
export { UpdatePrompt, type UpdatePromptProps } from "./notion/UpdatePrompt.js";
|
|
64
69
|
export { TONES, TONE_COLORS, TONE_EDGE, TONE_FILL, TONE_TEXT, type Tone } from "./notion/tones.js";
|
|
65
70
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1E,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gB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,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACxJ,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ export * from "./ui/switch.js";
|
|
|
39
39
|
export { SWITCH_THUMB_SHADOW_CLASS } from "./ui/switch-thumb.js";
|
|
40
40
|
export * from "./ui/table.js";
|
|
41
41
|
export * from "./ui/tabs.js";
|
|
42
|
+
export { tabsListVariants } from "./ui/tabs-variants.js";
|
|
42
43
|
export * from "./ui/textarea.js";
|
|
43
44
|
export * from "./ui/tooltip.js";
|
|
44
45
|
export { ICON_STROKE_WIDTH } from "./notion/icon-stroke.js";
|
|
@@ -54,6 +55,7 @@ export { MiniProgress } from "./notion/MiniProgress.js";
|
|
|
54
55
|
export { PageFrame } from "./notion/PageFrame.js";
|
|
55
56
|
export { PageHeader } from "./notion/PageHeader.js";
|
|
56
57
|
export { PropertyList } from "./notion/PropertyList.js";
|
|
58
|
+
export { RouteLoading } from "./notion/RouteLoading.js";
|
|
57
59
|
export { SheetMenu, SheetMenuButton, SheetMenuItem } from "./notion/SheetMenu.js";
|
|
58
60
|
export { SidePanel } from "./notion/SidePanel.js";
|
|
59
61
|
export { SortableActivator, SortableHandle, SortableItem, SortableList, } from "./notion/Sortable.js";
|
|
@@ -62,6 +64,9 @@ export { Status } from "./notion/Status.js";
|
|
|
62
64
|
export { Steps } from "./notion/Steps.js";
|
|
63
65
|
export { TabBar } from "./notion/TabBar.js";
|
|
64
66
|
export { Timeline } from "./notion/Timeline.js";
|
|
67
|
+
export { TopLoadingBar } from "./notion/TopLoadingBar.js";
|
|
68
|
+
export { UploadField, UploadItem, UploadList, } from "./notion/Upload.js";
|
|
69
|
+
export { formatFileSize } from "./notion/format-file-size.js";
|
|
65
70
|
export { UpdatePrompt } from "./notion/UpdatePrompt.js";
|
|
66
71
|
export { TONES, TONE_COLORS, TONE_EDGE, TONE_FILL, TONE_TEXT } from "./notion/tones.js";
|
|
67
72
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,oGAAoG;AACpG,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAE1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C/E,OAAO,EAAE,QAAQ,EAA0G,MAAM,sBAAsB,CAAC;AACxJ,OAAO,EAAE,aAAa,EAA2B,MAAM,2BAA2B,CAAC;AACnF,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,GAQX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
|
package/dist/messages/en.d.ts
CHANGED
|
@@ -35,6 +35,23 @@ export declare const en: {
|
|
|
35
35
|
readonly cancelled: "Cancelled. {item} is back in place.";
|
|
36
36
|
readonly handle: "Drag to reorder";
|
|
37
37
|
};
|
|
38
|
+
readonly upload: {
|
|
39
|
+
readonly choose: "Choose files";
|
|
40
|
+
readonly chooseOne: "Choose a file";
|
|
41
|
+
readonly drop: "or drop them here";
|
|
42
|
+
readonly dropOne: "or drop it here";
|
|
43
|
+
readonly dropping: "Drop to add";
|
|
44
|
+
readonly retry: "Retry";
|
|
45
|
+
readonly pause: "Pause {name}";
|
|
46
|
+
readonly resume: "Resume {name}";
|
|
47
|
+
readonly remove: "Remove {name}";
|
|
48
|
+
readonly progress: "Upload of {name}";
|
|
49
|
+
readonly queued: "Queued";
|
|
50
|
+
readonly uploading: "Uploading";
|
|
51
|
+
readonly paused: "Paused";
|
|
52
|
+
readonly done: "Done";
|
|
53
|
+
readonly failed: "Failed";
|
|
54
|
+
};
|
|
38
55
|
readonly steps: {
|
|
39
56
|
readonly done: "Done";
|
|
40
57
|
readonly current: "Current";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCL,CAAC"}
|
package/dist/messages/en.js
CHANGED
|
@@ -18,6 +18,23 @@ export const en = {
|
|
|
18
18
|
cancelled: "Cancelled. {item} is back in place.",
|
|
19
19
|
handle: "Drag to reorder",
|
|
20
20
|
},
|
|
21
|
+
upload: {
|
|
22
|
+
choose: "Choose files",
|
|
23
|
+
chooseOne: "Choose a file",
|
|
24
|
+
drop: "or drop them here",
|
|
25
|
+
dropOne: "or drop it here",
|
|
26
|
+
dropping: "Drop to add",
|
|
27
|
+
retry: "Retry",
|
|
28
|
+
pause: "Pause {name}",
|
|
29
|
+
resume: "Resume {name}",
|
|
30
|
+
remove: "Remove {name}",
|
|
31
|
+
progress: "Upload of {name}",
|
|
32
|
+
queued: "Queued",
|
|
33
|
+
uploading: "Uploading",
|
|
34
|
+
paused: "Paused",
|
|
35
|
+
done: "Done",
|
|
36
|
+
failed: "Failed",
|
|
37
|
+
},
|
|
21
38
|
steps: { done: "Done", current: "Current", todo: "To do", failed: "Failed" },
|
|
22
39
|
command: { title: "Command Palette", description: "Search for a command to run..." },
|
|
23
40
|
};
|
package/dist/messages/en.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,UAAU,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE;IACjD,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;IAC1B,UAAU,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE;IACjC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;IACzB,SAAS,EAAE,E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AAO,EAAE,mDAAmD;QAC5D,SAAS,EAAE,qCAAqC;QAChD,MAAM,EAAE,iBAAiB;KAC1B;IACD,MAAM,EAAE;QACN,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,eAAe;QAC1B,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,iBAAiB;QAC1B,QAAQ,EAAE,aAAa;QACvB,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,cAAc;QACrB,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,eAAe;QACvB,QAAQ,EAAE,kBAAkB;QAC5B,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,WAAW;QACtB,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAAQ;KACjB;IACD,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;IAC5E,OAAO,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,gCAAgC,EAAE;CAC5E,CAAC"}
|
package/dist/messages/index.d.ts
CHANGED
|
@@ -34,6 +34,23 @@ export declare const notionMessages: {
|
|
|
34
34
|
readonly cancelled: "Cancelled. {item} is back in place.";
|
|
35
35
|
readonly handle: "Drag to reorder";
|
|
36
36
|
};
|
|
37
|
+
readonly upload: {
|
|
38
|
+
readonly choose: "Choose files";
|
|
39
|
+
readonly chooseOne: "Choose a file";
|
|
40
|
+
readonly drop: "or drop them here";
|
|
41
|
+
readonly dropOne: "or drop it here";
|
|
42
|
+
readonly dropping: "Drop to add";
|
|
43
|
+
readonly retry: "Retry";
|
|
44
|
+
readonly pause: "Pause {name}";
|
|
45
|
+
readonly resume: "Resume {name}";
|
|
46
|
+
readonly remove: "Remove {name}";
|
|
47
|
+
readonly progress: "Upload of {name}";
|
|
48
|
+
readonly queued: "Queued";
|
|
49
|
+
readonly uploading: "Uploading";
|
|
50
|
+
readonly paused: "Paused";
|
|
51
|
+
readonly done: "Done";
|
|
52
|
+
readonly failed: "Failed";
|
|
53
|
+
};
|
|
37
54
|
readonly steps: {
|
|
38
55
|
readonly done: "Done";
|
|
39
56
|
readonly current: "Current";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,qGAAqG;AACrG,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,qGAAqG;AACrG,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAS,CAAC;AAErC,MAAM,MAAM,cAAc,GAAG,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface RouteLoadingProps {
|
|
2
|
+
/** The app's name, on the launch screen. */
|
|
3
|
+
readonly name: string;
|
|
4
|
+
/** The app's icon, on the launch screen. */
|
|
5
|
+
readonly iconSrc: string;
|
|
6
|
+
/** Both bars' accessible name (`pwaMessages.en.launch.label` in `@softure-ai/pwa`). */
|
|
7
|
+
readonly label: string;
|
|
8
|
+
/** The launch screen's counter: `buildLaunchProgressScript()`. */
|
|
9
|
+
readonly launchScript?: string;
|
|
10
|
+
/** The top bar's counter: `buildLaunchProgressScript({ rootSlot: "top-loading-bar" })`. */
|
|
11
|
+
readonly barScript?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function RouteLoading({ name, iconSrc, label, launchScript, barScript }: RouteLoadingProps): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=RouteLoading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteLoading.d.ts","sourceRoot":"","sources":["../../src/notion/RouteLoading.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,2FAA2F;IAC3F,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BAahG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LaunchScreen } from "./LaunchScreen.js";
|
|
3
|
+
import { TopLoadingBar } from "./TopLoadingBar.js";
|
|
4
|
+
// The loading state for `app/loading.tsx`, picked by the browser so the page stays static: the full-screen
|
|
5
|
+
// `LaunchScreen` below the `md` breakpoint or in an installed app (`display-mode: standalone`), the thin
|
|
6
|
+
// `TopLoadingBar` on a wide screen in a browser tab (`display-mode: browser`). Both are streamed; CSS hides the other,
|
|
7
|
+
// so screen readers meet one. The wrapper draws no box (`contents`). Each rule is one stacked media query, so no two display rules compete on order.
|
|
8
|
+
export function RouteLoading({ name, iconSrc, label, launchScript, barScript }) {
|
|
9
|
+
return (_jsxs("div", { "data-slot": "route-loading", className: "contents", children: [_jsx(LaunchScreen, { name: name, iconSrc: iconSrc, label: label, script: launchScript, className: "md:[@media(display-mode:browser)]:hidden" }), _jsx(TopLoadingBar, { label: label, script: barScript, className: "hidden md:[@media(display-mode:browser)]:block" })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=RouteLoading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteLoading.js","sourceRoot":"","sources":["../../src/notion/RouteLoading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAenD,2GAA2G;AAC3G,yGAAyG;AACzG,uHAAuH;AACvH,qJAAqJ;AACrJ,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAqB;IAC/F,OAAO,CACL,4BAAe,eAAe,EAAC,SAAS,EAAC,UAAU,aACjD,KAAC,YAAY,IACX,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,YAAY,EACpB,SAAS,EAAC,0CAA0C,GACpD,EACF,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAC,gDAAgD,GAAG,IACzG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface TopLoadingBarProps {
|
|
2
|
+
/** The progress bar's accessible name (`pwaMessages.en.launch.label` in `@softure-ai/pwa`). */
|
|
3
|
+
readonly label: string;
|
|
4
|
+
/** 0–100 when the app knows the progress; left out, the bar slides indeterminately. */
|
|
5
|
+
readonly value?: number;
|
|
6
|
+
/**
|
|
7
|
+
* The counter's inline script (`buildLaunchProgressScript({ rootSlot: "top-loading-bar" })` from `@softure-ai/pwa`).
|
|
8
|
+
* Where the browser runs it (a streamed first load) its first value makes the bar determinate; where it does not
|
|
9
|
+
* (a client-side navigation) the bar keeps sliding.
|
|
10
|
+
*/
|
|
11
|
+
readonly script?: string;
|
|
12
|
+
readonly className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function TopLoadingBar({ label, value, script, className }: TopLoadingBarProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=TopLoadingBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TopLoadingBar.d.ts","sourceRoot":"","sources":["../../src/notion/TopLoadingBar.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,+FAA+F;IAC/F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uFAAuF;IACvF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAKD,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAOpF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { Progress } from "../ui/progress.js";
|
|
4
|
+
// A thin bar along the top edge while a route loads on a wide screen: 2 px, square, on a transparent track, above the
|
|
5
|
+
// page and never in the way of a pointer, so the page under it stays usable. `LaunchScreen` is its full-screen
|
|
6
|
+
// counterpart for a phone or an installed app; `RouteLoading` picks one of the two in the browser.
|
|
7
|
+
export function TopLoadingBar({ label, value, script, className }) {
|
|
8
|
+
return (_jsxs("div", { "data-slot": "top-loading-bar", className: cn("pointer-events-none fixed inset-x-0 top-0 z-50", className), children: [_jsx(Progress, { value: value, "aria-label": label, className: "h-0.5 rounded-none bg-transparent" }), script === undefined ? null : _jsx("script", { dangerouslySetInnerHTML: { __html: script } })] }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=TopLoadingBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TopLoadingBar.js","sourceRoot":"","sources":["../../src/notion/TopLoadingBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAgB7C,sHAAsH;AACtH,+GAA+G;AAC/G,mGAAmG;AACnG,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAsB;IACnF,OAAO,CACL,4BAAe,iBAAiB,EAAC,SAAS,EAAE,EAAE,CAAC,gDAAgD,EAAE,SAAS,CAAC,aACzG,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,gBAAc,KAAK,EAAE,SAAS,EAAC,mCAAmC,GAAG,EAC1F,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAQ,uBAAuB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAI,IAClF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type UploadState = "queued" | "uploading" | "paused" | "done" | "failed";
|
|
3
|
+
/** One file of an upload, as the app or its transport (e.g. `@softure-ai/files`) tracks it. */
|
|
4
|
+
export interface UploadFileItem {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly size: number;
|
|
8
|
+
readonly state: UploadState;
|
|
9
|
+
readonly progress?: number;
|
|
10
|
+
readonly error?: string;
|
|
11
|
+
}
|
|
12
|
+
/** The texts of the upload parts; `{name}` stands for the file's name. Built-in English: `notionMessages.en.upload`. */
|
|
13
|
+
export interface UploadMessages {
|
|
14
|
+
readonly choose: string;
|
|
15
|
+
readonly chooseOne: string;
|
|
16
|
+
readonly drop: string;
|
|
17
|
+
readonly dropOne: string;
|
|
18
|
+
readonly dropping: string;
|
|
19
|
+
readonly retry: string;
|
|
20
|
+
readonly pause: string;
|
|
21
|
+
readonly resume: string;
|
|
22
|
+
readonly remove: string;
|
|
23
|
+
readonly progress: string;
|
|
24
|
+
readonly queued: string;
|
|
25
|
+
readonly uploading: string;
|
|
26
|
+
readonly paused: string;
|
|
27
|
+
readonly done: string;
|
|
28
|
+
readonly failed: string;
|
|
29
|
+
}
|
|
30
|
+
/** The app's wording for the upload parts; each text left out keeps the built-in English one. */
|
|
31
|
+
export type UploadMessagesOverride = Partial<UploadMessages>;
|
|
32
|
+
export interface UploadFieldProps {
|
|
33
|
+
readonly label: ReactNode;
|
|
34
|
+
readonly description?: ReactNode;
|
|
35
|
+
readonly error?: ReactNode;
|
|
36
|
+
readonly accept?: string;
|
|
37
|
+
readonly multiple?: boolean;
|
|
38
|
+
readonly capture?: "user" | "environment";
|
|
39
|
+
readonly disabled?: boolean;
|
|
40
|
+
readonly onFilesSelected: (files: File[]) => void;
|
|
41
|
+
readonly onFilesRejected?: (files: File[]) => void;
|
|
42
|
+
readonly messages?: UploadMessagesOverride;
|
|
43
|
+
readonly id?: string;
|
|
44
|
+
readonly className?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function UploadField({ label, description, error, accept, multiple, capture, disabled, onFilesSelected, onFilesRejected, messages, id, className, }: UploadFieldProps): import("react").JSX.Element;
|
|
47
|
+
export interface UploadListProps {
|
|
48
|
+
readonly label: string;
|
|
49
|
+
readonly children: ReactNode;
|
|
50
|
+
readonly className?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function UploadList({ label, children, className }: UploadListProps): import("react").JSX.Element;
|
|
53
|
+
export interface UploadItemProps {
|
|
54
|
+
readonly item: UploadFileItem;
|
|
55
|
+
readonly onRetry?: (item: UploadFileItem) => void;
|
|
56
|
+
readonly onPause?: (item: UploadFileItem) => void;
|
|
57
|
+
readonly onResume?: (item: UploadFileItem) => void;
|
|
58
|
+
readonly onRemove?: (item: UploadFileItem) => void;
|
|
59
|
+
readonly locale?: string;
|
|
60
|
+
readonly messages?: UploadMessagesOverride;
|
|
61
|
+
readonly className?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function UploadItem({ item, onRetry, onPause, onResume, onRemove, locale, messages, className }: UploadItemProps): import("react").JSX.Element;
|
|
64
|
+
//# sourceMappingURL=Upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Upload.d.ts","sourceRoot":"","sources":["../../src/notion/Upload.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAahF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhF,+FAA+F;AAC/F,MAAM,WAAW,cAAc;IAE7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAE5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wHAAwH;AACxH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,M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KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAGD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,+BAMzE;AAeD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAE9B,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAEnD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAC3C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,+BAwD7H"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CircleAlert, CircleCheck, Clock, File as FileIcon, Pause, Play, RotateCw, Upload as UploadIcon, X } from "lucide-react";
|
|
4
|
+
import { useId, useRef, useState } from "react";
|
|
5
|
+
import { en } from "../messages/en.js";
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { Button } from "../ui/button.js";
|
|
8
|
+
import { Field, FieldDescription, FieldError, FieldLabel } from "../ui/field.js";
|
|
9
|
+
import { Progress } from "../ui/progress.js";
|
|
10
|
+
import { formatFileSize } from "./format-file-size.js";
|
|
11
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
12
|
+
import { Status } from "./Status.js";
|
|
13
|
+
function mergeMessages(override) {
|
|
14
|
+
return { ...en.upload, ...override };
|
|
15
|
+
}
|
|
16
|
+
function fillName(template, name) {
|
|
17
|
+
return template.replaceAll("{name}", name);
|
|
18
|
+
}
|
|
19
|
+
/** Whether a file matches an `accept` list (".pdf", "video/*", "image/png"), the way the browser's picker reads it. */
|
|
20
|
+
function isAccepted(file, accept) {
|
|
21
|
+
if (accept === undefined || accept.trim() === "")
|
|
22
|
+
return true;
|
|
23
|
+
const name = file.name.toLowerCase();
|
|
24
|
+
const type = file.type.toLowerCase();
|
|
25
|
+
return accept
|
|
26
|
+
.split(",")
|
|
27
|
+
.map((entry) => entry.trim().toLowerCase())
|
|
28
|
+
.filter((entry) => entry !== "")
|
|
29
|
+
.some((entry) => {
|
|
30
|
+
if (entry.startsWith("."))
|
|
31
|
+
return name.endsWith(entry);
|
|
32
|
+
if (entry.endsWith("/*"))
|
|
33
|
+
return type.startsWith(entry.slice(0, -1));
|
|
34
|
+
return type === entry;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// A labelled area to add files: a touch-sized button opens the native picker (so a phone offers its files, photos and
|
|
38
|
+
// camera), and on a wide screen files can also be dropped on the area. It holds no files of its own: it hands each pick
|
|
39
|
+
// or drop to `onFilesSelected`, and the app or its transport keeps the list (`UploadList`).
|
|
40
|
+
export function UploadField({ label, description, error, accept, multiple = false, capture, disabled = false, onFilesSelected, onFilesRejected, messages, id, className, }) {
|
|
41
|
+
const words = mergeMessages(messages);
|
|
42
|
+
const generatedId = useId();
|
|
43
|
+
const inputId = id ?? generatedId;
|
|
44
|
+
const descriptionId = `${inputId}-description`;
|
|
45
|
+
const errorId = `${inputId}-error`;
|
|
46
|
+
const inputRef = useRef(null);
|
|
47
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
48
|
+
const isInvalid = error !== undefined && error !== null && error !== false;
|
|
49
|
+
const describedBy = [description === undefined ? undefined : descriptionId, isInvalid ? errorId : undefined].filter(Boolean).join(" ") || undefined;
|
|
50
|
+
const handOver = (files) => {
|
|
51
|
+
const accepted = files.filter((file) => isAccepted(file, accept));
|
|
52
|
+
const rejected = files.filter((file) => !isAccepted(file, accept));
|
|
53
|
+
const selected = multiple ? accepted : accepted.slice(0, 1);
|
|
54
|
+
if (selected.length > 0)
|
|
55
|
+
onFilesSelected(selected);
|
|
56
|
+
if (rejected.length > 0)
|
|
57
|
+
onFilesRejected?.(rejected);
|
|
58
|
+
};
|
|
59
|
+
const handleDragOver = (event) => {
|
|
60
|
+
if (disabled)
|
|
61
|
+
return;
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
event.dataTransfer.dropEffect = "copy";
|
|
64
|
+
setIsDragging(true);
|
|
65
|
+
};
|
|
66
|
+
const handleDragLeave = (event) => {
|
|
67
|
+
// Moving onto a child fires a leave on the area too; only leaving the area itself ends the highlight.
|
|
68
|
+
if (event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget))
|
|
69
|
+
return;
|
|
70
|
+
setIsDragging(false);
|
|
71
|
+
};
|
|
72
|
+
const handleDrop = (event) => {
|
|
73
|
+
if (disabled)
|
|
74
|
+
return;
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
setIsDragging(false);
|
|
77
|
+
handOver(Array.from(event.dataTransfer.files));
|
|
78
|
+
};
|
|
79
|
+
return (_jsxs(Field, { "data-slot": "upload-field", "data-invalid": isInvalid || undefined, "data-disabled": disabled || undefined, className: className, children: [_jsx(FieldLabel, { htmlFor: inputId, children: label }), _jsxs("div", { "data-slot": "upload-drop-area", "data-dragging": isDragging || undefined, onDragOver: handleDragOver, onDragEnter: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, className: cn("flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-input p-4 text-center text-sm text-muted-foreground transition-colors duration-120", "md:flex-row md:gap-3", "data-[dragging=true]:border-primary data-[dragging=true]:bg-blue-bg", "group-data-[invalid=true]/field:border-destructive group-data-[disabled=true]/field:opacity-50"), children: [_jsx(UploadIcon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: "hidden size-5 shrink-0 md:block" }), _jsxs(Button, { type: "button", variant: "outline", size: "touch", className: "md:h-7", disabled: disabled, "aria-describedby": describedBy, onClick: () => inputRef.current?.click(), children: [_jsx(UploadIcon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: "md:hidden" }), multiple ? words.choose : words.chooseOne] }), _jsx("span", { "data-slot": "upload-drop-hint", "aria-hidden": "true", className: "hidden md:inline", children: isDragging ? words.dropping : multiple ? words.drop : words.dropOne }), _jsx("input", { ref: inputRef, id: inputId, type: "file", accept: accept, multiple: multiple, capture: capture, disabled: disabled, tabIndex: -1, "aria-describedby": describedBy, "aria-invalid": isInvalid || undefined, className: "sr-only", onChange: (event) => {
|
|
80
|
+
handOver(Array.from(event.currentTarget.files ?? []));
|
|
81
|
+
// Cleared, so picking the same file again after removing it is a change too.
|
|
82
|
+
event.currentTarget.value = "";
|
|
83
|
+
} })] }), description === undefined ? null : _jsx(FieldDescription, { id: descriptionId, children: description }), isInvalid ? _jsx(FieldError, { id: errorId, children: error }) : null] }));
|
|
84
|
+
}
|
|
85
|
+
// The files of an upload, one `UploadItem` per row.
|
|
86
|
+
export function UploadList({ label, children, className }) {
|
|
87
|
+
return (_jsx("ul", { "aria-label": label, "data-slot": "upload-list", className: cn("flex flex-col gap-1", className), children: children }));
|
|
88
|
+
}
|
|
89
|
+
const STATE_STATUS = {
|
|
90
|
+
queued: { color: "gray", icon: Clock },
|
|
91
|
+
uploading: { color: "blue", icon: UploadIcon },
|
|
92
|
+
paused: { color: "orange", icon: Pause },
|
|
93
|
+
done: { color: "green", icon: CircleCheck },
|
|
94
|
+
failed: { color: "red", icon: CircleAlert },
|
|
95
|
+
};
|
|
96
|
+
function clampProgress(value) {
|
|
97
|
+
if (value === undefined || !Number.isFinite(value))
|
|
98
|
+
return 0;
|
|
99
|
+
return Math.min(100, Math.max(0, value));
|
|
100
|
+
}
|
|
101
|
+
// One file of an upload: its name, size and state word, a progress bar while it uploads or waits paused, the reason and
|
|
102
|
+
// a Retry button when it failed, and a Remove button. The buttons are touch sized on a phone.
|
|
103
|
+
export function UploadItem({ item, onRetry, onPause, onResume, onRemove, locale = "en", messages, className }) {
|
|
104
|
+
const words = mergeMessages(messages);
|
|
105
|
+
const errorId = `${useId()}-error`;
|
|
106
|
+
const status = STATE_STATUS[item.state];
|
|
107
|
+
const hasProgress = item.state === "uploading" || item.state === "paused";
|
|
108
|
+
const hasError = item.state === "failed" && item.error !== undefined && item.error !== "";
|
|
109
|
+
return (_jsxs("li", { "data-slot": "upload-item", "data-upload": item.id, "data-state": item.state, className: cn("flex min-w-0 items-start gap-2 rounded-md px-2 py-1.5", className), children: [_jsx(FileIcon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: "mt-0.5 size-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2", children: [_jsx("span", { "data-slot": "upload-item-name", title: item.name, className: "min-w-0 truncate text-sm font-medium", children: item.name }), _jsx("span", { "data-slot": "upload-item-size", className: "shrink-0 text-small text-muted-foreground tabular-nums", children: formatFileSize(item.size, locale) }), _jsx(Status, { color: status.color, icon: status.icon, className: "shrink-0 text-small", children: words[item.state] })] }), hasProgress ? (_jsx(Progress, { value: clampProgress(item.progress), "aria-label": fillName(words.progress, item.name), indicatorClassName: item.state === "paused" ? "bg-orange" : undefined })) : null, hasError ? (_jsx("p", { id: errorId, "data-slot": "upload-item-error", className: "text-small text-destructive", children: item.error })) : null] }), _jsxs("div", { "data-slot": "upload-item-actions", className: "flex shrink-0 items-center gap-1", children: [item.state === "failed" && onRetry !== undefined ? (_jsxs(Button, { type: "button", variant: "outline", size: "touch", className: "md:h-7", "aria-describedby": hasError ? errorId : undefined, onClick: () => onRetry(item), children: [_jsx(RotateCw, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }), words.retry] })) : null, item.state === "uploading" && onPause !== undefined ? (_jsx(ItemIconButton, { icon: Pause, label: fillName(words.pause, item.name), onClick: () => onPause(item) })) : null, item.state === "paused" && onResume !== undefined ? (_jsx(ItemIconButton, { icon: Play, label: fillName(words.resume, item.name), onClick: () => onResume(item) })) : null, onRemove === undefined ? null : _jsx(ItemIconButton, { icon: X, label: fillName(words.remove, item.name), onClick: () => onRemove(item) })] })] }));
|
|
110
|
+
}
|
|
111
|
+
function ItemIconButton({ icon: Icon, label, onClick }) {
|
|
112
|
+
return (_jsx(Button, { type: "button", variant: "ghost", size: "icon-touch", className: "text-muted-foreground md:size-7", "aria-label": label, title: label, onClick: onClick, children: _jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) }));
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=Upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Upload.js","sourceRoot":"","sources":["../../src/notion/Upload.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,UAAU,EAAE,CAAC,EAAmB,MAAM,cAAc,CAAC;AAClJ,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAkC,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,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EAAC,SAAS,EAAC,iCAAiC,gBAAa,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,YACnJ,KAAC,IAAI,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,GACpD,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** A file size for people, in decimal steps (1 kB = 1000 bytes), written by the locale: `formatFileSize(1500)` is "1.5 kB". Safe on the server. */
|
|
2
|
+
export declare function formatFileSize(bytes: number, locale?: string): string;
|
|
3
|
+
//# sourceMappingURL=format-file-size.d.ts.map
|