@glasshome/ui 1.35.4 → 1.37.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/SPEC.md +11 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -3
- package/dist/lib/balance-rows.d.ts +7 -0
- package/dist/lib/dock-slot-classes.d.ts +1 -0
- package/dist/lib/hold.d.ts +33 -1
- package/dist/lib/motion-classes.d.ts +2 -0
- package/dist/solid/dock-edit.d.ts +28 -0
- package/dist/solid/dock-paging.d.ts +13 -0
- package/dist/solid/dock.d.ts +18 -1
- package/dist/solid/face-toggle.d.ts +17 -0
- package/dist/solid/glyph-tile.d.ts +18 -0
- package/dist/solid/icon-picker.d.ts +4 -0
- package/dist/solid/index.d.ts +8 -4
- package/dist/solid/index.js +5894 -5224
- package/dist/solid/media-store.d.ts +14 -3
- package/dist/solid/preview-tile.d.ts +14 -0
- package/dist/solid/slot-button.d.ts +9 -0
- package/dist/{utils-BhU5YZKh.js → utils-Duqv3Sgo.js} +680 -624
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/lib/balance-rows.ts +62 -0
- package/src/lib/dock-slot-classes.ts +4 -0
- package/src/lib/hold.ts +154 -3
- package/src/lib/motion-classes.ts +11 -0
- package/src/solid/dashboard-preview.tsx +21 -4
- package/src/solid/dock-edit.tsx +267 -0
- package/src/solid/dock-paging.ts +37 -0
- package/src/solid/dock.tsx +254 -73
- package/src/solid/face-toggle.tsx +93 -0
- package/src/solid/glyph-tile.tsx +77 -0
- package/src/solid/icon-picker.tsx +40 -21
- package/src/solid/image-picker.tsx +39 -15
- package/src/solid/index.ts +10 -3
- package/src/solid/media-store.ts +28 -8
- package/src/solid/preview-tile.tsx +75 -4
- package/src/solid/schema-form.tsx +4 -6
- package/src/solid/slot-button.tsx +45 -0
- package/src/solid/toggle-group.tsx +14 -6
- package/src/styles/theme.css +31 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Accessor } from "solid-js";
|
|
1
2
|
export type StoredMedia = {
|
|
2
3
|
id: string;
|
|
3
4
|
mimeType: string;
|
|
@@ -26,17 +27,27 @@ export type MediaIndex = {
|
|
|
26
27
|
};
|
|
27
28
|
/** "thumb" is a server-side derivative, longest edge ~400px, for grids. */
|
|
28
29
|
export type MediaVariant = "original" | "thumb";
|
|
29
|
-
export interface
|
|
30
|
+
export interface MediaUrls {
|
|
31
|
+
url(id: string, variant?: MediaVariant): string | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface MediaStore extends MediaUrls {
|
|
30
34
|
index(): Promise<MediaIndex>;
|
|
31
35
|
upload(file: File): Promise<StoredMedia>;
|
|
32
36
|
remove(id: string): Promise<void>;
|
|
33
37
|
url(id: string, variant?: MediaVariant): string;
|
|
38
|
+
/** false: this holder may not delete, so a gallery offers no Delete. */
|
|
39
|
+
readonly canRemove?: boolean;
|
|
34
40
|
}
|
|
35
41
|
/** `null` withholds the store from a tree, even where the host registered one. */
|
|
36
42
|
export declare const MediaStoreContext: import("solid-js").Context<MediaStore | null | undefined>;
|
|
37
|
-
/**
|
|
38
|
-
export declare
|
|
43
|
+
/** A tree's own url source, over the one the host provided. */
|
|
44
|
+
export declare const MediaUrlsContext: import("solid-js").Context<MediaUrls | undefined>;
|
|
45
|
+
/** Host apps call this once at startup; MediaStoreContext overrides it per-tree. An accessor is read each time a picker mounts. */
|
|
46
|
+
export declare function provideMediaStore(store: MediaStore | Accessor<MediaStore | null>): void;
|
|
47
|
+
/** Resolves stored ids to image urls in a tree that shows images but cannot manage them. */
|
|
48
|
+
export declare function provideMediaUrls(urls: MediaUrls): void;
|
|
39
49
|
export declare function useMediaStore(): MediaStore | undefined;
|
|
50
|
+
export declare function useMediaUrls(): MediaUrls | undefined;
|
|
40
51
|
/** One grid page. The picker and the library both slice by this, so neither can
|
|
41
52
|
* mount a whole 500-file library at once. */
|
|
42
53
|
export declare const MEDIA_PAGE_SIZE = 24;
|
|
@@ -5,6 +5,7 @@ declare const COLUMNS: {
|
|
|
5
5
|
readonly 4: "grid-cols-4";
|
|
6
6
|
};
|
|
7
7
|
declare const SHAPE: {
|
|
8
|
+
readonly film: "aspect-video";
|
|
8
9
|
readonly wide: "aspect-[16/10]";
|
|
9
10
|
readonly tile: "aspect-[5/4]";
|
|
10
11
|
};
|
|
@@ -13,9 +14,20 @@ export declare function PreviewTileGroup(props: {
|
|
|
13
14
|
onChange: (value: string) => void;
|
|
14
15
|
"aria-label": string;
|
|
15
16
|
columns?: keyof typeof COLUMNS;
|
|
17
|
+
/** A row that scrolls sideways below `sm`, a grid of `columns` from `sm` up. */
|
|
18
|
+
scroll?: boolean;
|
|
16
19
|
class?: string;
|
|
17
20
|
children: JSX.Element;
|
|
18
21
|
}): JSX.Element;
|
|
22
|
+
/** A button among the tiles that picks nothing: the way to a larger set. A glyph draws a dashed face; children draw a picture on a solid one. */
|
|
23
|
+
export declare function PreviewTileAction(props: {
|
|
24
|
+
label: string;
|
|
25
|
+
icon?: string;
|
|
26
|
+
onClick?: () => void;
|
|
27
|
+
shape?: keyof typeof SHAPE;
|
|
28
|
+
class?: string;
|
|
29
|
+
children?: JSX.Element;
|
|
30
|
+
}): JSX.Element;
|
|
19
31
|
/** A choice shown as what it produces: a picture, a preview card, a shape. */
|
|
20
32
|
export declare function PreviewTile(props: {
|
|
21
33
|
value: string;
|
|
@@ -28,6 +40,8 @@ export declare function PreviewTile(props: {
|
|
|
28
40
|
/** Beside the caption, after the label: provenance like `SourceMarks`. */
|
|
29
41
|
marks?: JSX.Element;
|
|
30
42
|
shape?: keyof typeof SHAPE;
|
|
43
|
+
/** An outline face with its content centred, for the choice that adds nothing. */
|
|
44
|
+
dashed?: boolean;
|
|
31
45
|
disabled?: boolean;
|
|
32
46
|
class?: string;
|
|
33
47
|
/** Fires on every click, including a re-pick of the checked tile. */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export interface SlotButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/** An empty place for something to land: the add slot's dashed outline. */
|
|
4
|
+
dashed?: boolean;
|
|
5
|
+
/** A name under the slot; it names the button too. */
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A button in the dock's slot shape: it holds the icon a dock item will wear. */
|
|
9
|
+
export declare function SlotButton(props: SlotButtonProps): JSX.Element;
|