@aperture-browser/session-react 0.0.0-nightly.156.86df3ffe328b → 0.0.0-nightly.158.e9ed26eebaf2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +37 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { Fragment, createContext, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { SessionError as SessionError$1 } from "@aperture-browser/session-client";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { AppWindow, ArrowDownToLine, ArrowLeft, ArrowRight, ArrowUpFromLine, Bot, Camera, Check, CheckIcon, ChevronLeft, ChevronLeftIcon, ChevronRight, ChevronRightIcon, Circle, CircleAlert, CircleCheck, CircleCheckIcon, ClipboardList, ClipboardPaste, Copy, Download, ExternalLink, Eye, FileIcon, Film, FolderOpen, Gauge, Globe2, Hand, Hourglass, Image, Images, InfoIcon, Keyboard, Layers2, Link2, Loader2, Loader2Icon, Maximize2, Monitor, MoreHorizontal, MoreVertical, MousePointer2, OctagonXIcon, PanelRight, Paperclip, Pause, Pencil, Play, Plus, Radio, RefreshCw, RotateCcw, Scissors, Search, Smartphone, Square, SunMoon, TextSelect, Trash2, TriangleAlertIcon, Undo2, Unplug, Volume2, VolumeX, X, XIcon } from "lucide-react";
|
|
6
|
+
import { AppWindow, ArrowDownToLine, ArrowLeft, ArrowRight, ArrowUpFromLine, Bot, Camera, Check, CheckIcon, ChevronLeft, ChevronLeftIcon, ChevronRight, ChevronRightIcon, Circle, CircleAlert, CircleCheck, CircleCheckIcon, ClipboardList, ClipboardPaste, Copy, Download, ExternalLink, Eye, FileIcon, Film, FolderOpen, Gauge, Globe2, Hand, History, Hourglass, Image, Images, InfoIcon, Keyboard, Layers2, Link2, Loader2, Loader2Icon, Maximize2, Monitor, MoreHorizontal, MoreVertical, MousePointer2, OctagonXIcon, PanelRight, Paperclip, Pause, Pencil, Play, Plus, Radio, RefreshCw, RotateCcw, Scissors, Search, Smartphone, Square, SunMoon, TextSelect, Trash2, TriangleAlertIcon, Undo2, Unplug, Volume2, VolumeX, X, XIcon } from "lucide-react";
|
|
7
7
|
import { useTheme } from "next-themes";
|
|
8
8
|
import { Toaster, toast } from "sonner";
|
|
9
9
|
import { Drawer } from "@base-ui/react/drawer";
|
|
@@ -4638,7 +4638,8 @@ function BrowserViewport({ className }) {
|
|
|
4638
4638
|
}) })]
|
|
4639
4639
|
})
|
|
4640
4640
|
}) : null,
|
|
4641
|
-
open && snapshot.
|
|
4641
|
+
open && snapshot.restoring !== void 0 ? /* @__PURE__ */ jsx(Restored, { restoring: snapshot.restoring }) : null,
|
|
4642
|
+
open && snapshot.restoring === void 0 && snapshot.targets.length === 0 ? /* @__PURE__ */ jsxs(Empty, {
|
|
4642
4643
|
className: "aperture:absolute aperture:inset-0 aperture:border-none",
|
|
4643
4644
|
"data-session-empty": "",
|
|
4644
4645
|
children: [/* @__PURE__ */ jsxs(EmptyHeader, { children: [
|
|
@@ -4671,6 +4672,40 @@ function BrowserViewport({ className }) {
|
|
|
4671
4672
|
]
|
|
4672
4673
|
});
|
|
4673
4674
|
}
|
|
4675
|
+
const counted = (count, one, many) => `${count} ${count === 1 ? one : many}`;
|
|
4676
|
+
/** What is being put into the session's browser, of what there is of each. */
|
|
4677
|
+
const beingPut = ({ tabs, cookies, origins }) => [
|
|
4678
|
+
tabs > 0 ? counted(tabs, "tab", "tabs") : void 0,
|
|
4679
|
+
cookies > 0 ? counted(cookies, "cookie", "cookies") : void 0,
|
|
4680
|
+
origins > 0 ? `the storage of ${counted(origins, "site", "sites")}` : void 0
|
|
4681
|
+
].filter((part) => part !== void 0);
|
|
4682
|
+
/**
|
|
4683
|
+
* Over the picture while the session is given what its browser starts with: the tabs are
|
|
4684
|
+
* seen to arrive behind it, and nothing is pressed through it, as a press on a page that
|
|
4685
|
+
* is not yet what it is to be is a wrong one. The session takes no input meanwhile either.
|
|
4686
|
+
*/
|
|
4687
|
+
function Restored({ restoring }) {
|
|
4688
|
+
const parts = beingPut(restoring);
|
|
4689
|
+
const failed = restoring.failure !== void 0;
|
|
4690
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4691
|
+
"data-session-restoring": failed ? "failed" : "underway",
|
|
4692
|
+
className: "aperture:absolute aperture:inset-0 aperture:z-20 aperture:flex aperture:items-center aperture:justify-center aperture:bg-background/60 aperture:backdrop-blur-[2px]",
|
|
4693
|
+
children: /* @__PURE__ */ jsx(Empty, {
|
|
4694
|
+
className: "aperture:max-w-sm aperture:flex-none aperture:rounded-xl aperture:border aperture:border-solid aperture:bg-card/95 aperture:shadow-sm",
|
|
4695
|
+
children: /* @__PURE__ */ jsxs(EmptyHeader, { children: [
|
|
4696
|
+
/* @__PURE__ */ jsx(EmptyMedia, {
|
|
4697
|
+
variant: "icon",
|
|
4698
|
+
children: failed ? /* @__PURE__ */ jsx(History, {}) : /* @__PURE__ */ jsx(Spinner, {})
|
|
4699
|
+
}),
|
|
4700
|
+
/* @__PURE__ */ jsx(EmptyTitle, { children: failed ? "The session was not restored" : "Restoring the session" }),
|
|
4701
|
+
/* @__PURE__ */ jsx(EmptyDescription, {
|
|
4702
|
+
role: failed ? "alert" : "status",
|
|
4703
|
+
children: failed ? restoring.failure : parts.length === 0 ? "What its browser starts with is on its way." : `Putting in ${parts.join(", ")}.`
|
|
4704
|
+
})
|
|
4705
|
+
] })
|
|
4706
|
+
})
|
|
4707
|
+
});
|
|
4708
|
+
}
|
|
4674
4709
|
function Placeholder({ children }) {
|
|
4675
4710
|
return /* @__PURE__ */ jsx("div", {
|
|
4676
4711
|
className: "aperture:pointer-events-none aperture:absolute aperture:inset-0 aperture:flex aperture:flex-col aperture:items-center aperture:justify-center aperture:gap-2 aperture:text-sm aperture:text-muted-foreground",
|