@imajiner/admin-sdk 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/shared.d.ts +1 -1
- package/dist/shared.js +1 -1
- package/dist/ui.d.ts +12 -0
- package/dist/ui.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ definePlugin({ pages: { 'Shop/Reports': Reports } });
|
|
|
37
37
|
| `@imajiner/admin-sdk/ui` | The panel's UI components and hooks (buttons, cards, forms, tables, dialogs, `useBreadcrumbs`…). |
|
|
38
38
|
| `@imajiner/admin-sdk/vite` | `sunrice({ entry, outDir?, fileName? })`, the Vite plugin. |
|
|
39
39
|
|
|
40
|
-
Use the SDK version that matches your `sunrice/admin` version (`0.
|
|
40
|
+
Use the SDK version that matches your `sunrice/admin` version (`0.7.x` with the panel's `0.7.x`): they're released together.
|
|
41
41
|
|
|
42
42
|
The panel's docs explain the PHP side (registering the bundle, routes and permissions) and the full UI: [Admin pages in React](https://github.com/Digital-Citra-Kreatif/sunrice/blob/main/packages/admin/docs/frontend.md).
|
|
43
43
|
|
package/dist/shared.d.ts
CHANGED
|
@@ -15,6 +15,6 @@ export declare const SHARED_MODULES: {
|
|
|
15
15
|
readonly 'react-dom': readonly ["createPortal", "flushSync", "preconnect", "prefetchDNS", "preinit", "preinitModule", "preload", "preloadModule", "requestFormReset", "unstable_batchedUpdates", "useFormState", "useFormStatus", "version"];
|
|
16
16
|
readonly 'react-dom/client': readonly ["createRoot", "hydrateRoot", "version"];
|
|
17
17
|
readonly '@inertiajs/react': readonly ["App", "Deferred", "Form", "Head", "InfiniteScroll", "Link", "WhenMounted", "WhenVisible", "config", "createInertiaApp", "http", "progress", "resetLayoutProps", "router", "setLayoutProps", "useForm", "useFormContext", "useHttp", "usePage", "usePoll", "usePrefetch", "useRemember"];
|
|
18
|
-
readonly '@imajiner/admin-sdk/ui': readonly ["Badge", "Button", "Card", "CardContent", "CardDescription", "CardFooter", "CardHeader", "CardTitle", "Checkbox", "CodeEditor", "CollapsibleCard", "Command", "CommandEmpty", "CommandGroup", "CommandInput", "CommandItem", "CommandList", "CommandSeparator", "DatePicker", "DeveloperHelp", "Dialog", "DialogContent", "DialogDescription", "DialogFooter", "DialogHeader", "DialogTitle", "DialogTrigger", "DropdownMenu", "DropdownMenuCheckboxItem", "DropdownMenuContent", "DropdownMenuItem", "DropdownMenuLabel", "DropdownMenuSeparator", "DropdownMenuTrigger", "FormSections", "Input", "KeptEditsNotice", "Label", "LanguageTabs", "LinkAttributes", "LinkSourcePicker", "MediaPickerInput", "moveItem", "PageHeader", "Popover", "PopoverAnchor", "PopoverContent", "PopoverTrigger", "registerCommandSource", "RichTextEditor", "Select", "SelectContent", "SelectItem", "SelectTrigger", "SelectValue", "Separator", "SettingsLayout", "SettingsNav", "Skeleton", "SortableHandle", "SortableList", "Switch", "Table", "TableBody", "TableCell", "TableHead", "TableHeader", "TableRow", "Tabs", "TabsContent", "TabsList", "TabsTrigger", "Textarea", "Tooltip", "TooltipContent", "TooltipTrigger", "toast", "TrashBanner", "TrashHint", "TrashTitle", "useBreadcrumbs", "useEditLock", "useTablePreferences", "useUnsavedChanges", "ViewingNotice"];
|
|
18
|
+
readonly '@imajiner/admin-sdk/ui': readonly ["Badge", "Button", "Card", "CardContent", "CardDescription", "CardFooter", "CardHeader", "CardTitle", "cardSummary", "Checkbox", "CodeEditor", "CollapsibleCard", "CollapsibleCardGroup", "Command", "CommandEmpty", "CommandGroup", "CommandInput", "CommandItem", "CommandList", "CommandSeparator", "DatePicker", "DeveloperHelp", "Dialog", "DialogContent", "DialogDescription", "DialogFooter", "DialogHeader", "DialogTitle", "DialogTrigger", "DropdownMenu", "DropdownMenuCheckboxItem", "DropdownMenuContent", "DropdownMenuItem", "DropdownMenuLabel", "DropdownMenuSeparator", "DropdownMenuTrigger", "FormSections", "Input", "KeptEditsNotice", "Label", "LanguageTabs", "LinkAttributes", "LinkSourcePicker", "MediaPickerInput", "moveItem", "PageHeader", "Popover", "PopoverAnchor", "PopoverContent", "PopoverTrigger", "registerCommandSource", "RichTextEditor", "Select", "SelectContent", "SelectItem", "SelectTrigger", "SelectValue", "Separator", "SettingsLayout", "SettingsNav", "Skeleton", "SortableHandle", "SortableList", "Switch", "Table", "TableBody", "TableCell", "TableHead", "TableHeader", "TableRow", "Tabs", "TabsContent", "TabsList", "TabsTrigger", "Textarea", "Tooltip", "TooltipContent", "TooltipTrigger", "toast", "TrashBanner", "TrashHint", "TrashTitle", "useBreadcrumbs", "useEditLock", "useTablePreferences", "useUnsavedChanges", "ViewingNotice"];
|
|
19
19
|
};
|
|
20
20
|
export type SharedModuleName = keyof typeof SHARED_MODULES;
|
package/dist/shared.js
CHANGED
|
@@ -30,7 +30,7 @@ export const SHARED_MODULES = {
|
|
|
30
30
|
'usePoll', 'usePrefetch', 'useRemember',
|
|
31
31
|
],
|
|
32
32
|
'@imajiner/admin-sdk/ui': [
|
|
33
|
-
'Badge', 'Button', 'Card', 'CardContent', 'CardDescription', 'CardFooter', 'CardHeader', 'CardTitle', 'Checkbox', 'CodeEditor', 'CollapsibleCard',
|
|
33
|
+
'Badge', 'Button', 'Card', 'CardContent', 'CardDescription', 'CardFooter', 'CardHeader', 'CardTitle', 'cardSummary', 'Checkbox', 'CodeEditor', 'CollapsibleCard', 'CollapsibleCardGroup',
|
|
34
34
|
'Command', 'CommandEmpty', 'CommandGroup', 'CommandInput', 'CommandItem', 'CommandList', 'CommandSeparator', 'DatePicker', 'DeveloperHelp',
|
|
35
35
|
'Dialog', 'DialogContent', 'DialogDescription', 'DialogFooter', 'DialogHeader', 'DialogTitle', 'DialogTrigger',
|
|
36
36
|
'DropdownMenu', 'DropdownMenuCheckboxItem', 'DropdownMenuContent', 'DropdownMenuItem', 'DropdownMenuLabel', 'DropdownMenuSeparator', 'DropdownMenuTrigger',
|
package/dist/ui.d.ts
CHANGED
|
@@ -39,6 +39,14 @@ export declare const CodeEditor: ComponentType<{
|
|
|
39
39
|
"aria-describedby"?: string;
|
|
40
40
|
className?: string;
|
|
41
41
|
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Cards that fold together: with two or more CollapsibleCards inside, a
|
|
44
|
+
* "Collapse all" / "Expand all" button sits above them, at the right.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CollapsibleCardGroup: ComponentType<{
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
className?: string;
|
|
49
|
+
}>;
|
|
42
50
|
/**
|
|
43
51
|
* A card whose header folds its content away (animated); the choice is
|
|
44
52
|
* remembered per `storageKey`, and `hasErrors` opens it so a validation
|
|
@@ -47,6 +55,8 @@ export declare const CodeEditor: ComponentType<{
|
|
|
47
55
|
export declare const CollapsibleCard: ComponentType<{
|
|
48
56
|
title: ReactNode;
|
|
49
57
|
description?: ReactNode;
|
|
58
|
+
/** What's inside in one line, shown in place of the description while folded. */
|
|
59
|
+
summary?: ReactNode;
|
|
50
60
|
storageKey?: string;
|
|
51
61
|
defaultOpen?: boolean;
|
|
52
62
|
hasErrors?: boolean;
|
|
@@ -229,6 +239,8 @@ export declare const MediaPickerInput: ComponentType<{
|
|
|
229
239
|
onChange: (value: number | number[] | null) => void;
|
|
230
240
|
}>;
|
|
231
241
|
/** A copy of `items` with the one at `from` moved to `to` (what SortableList's onReorder did). */
|
|
242
|
+
/** A folded card's one-line summary: the first few filled-in values, joined with " · " (markup stripped, lists counted, yes/no left out). */
|
|
243
|
+
export declare const cardSummary: (values: readonly unknown[], max?: number) => string;
|
|
232
244
|
export declare const moveItem: <T>(items: readonly T[], from: number, to: number) => T[];
|
|
233
245
|
/** An item the command palette (Cmd/Ctrl+K) lists. */
|
|
234
246
|
export interface CommandItem {
|
package/dist/ui.js
CHANGED
|
@@ -23,6 +23,11 @@ export const Checkbox = m.Checkbox;
|
|
|
23
23
|
* when an editor first shows, with a plain textarea meanwhile.
|
|
24
24
|
*/
|
|
25
25
|
export const CodeEditor = m.CodeEditor;
|
|
26
|
+
/**
|
|
27
|
+
* Cards that fold together: with two or more CollapsibleCards inside, a
|
|
28
|
+
* "Collapse all" / "Expand all" button sits above them, at the right.
|
|
29
|
+
*/
|
|
30
|
+
export const CollapsibleCardGroup = m.CollapsibleCardGroup;
|
|
26
31
|
/**
|
|
27
32
|
* A card whose header folds its content away (animated); the choice is
|
|
28
33
|
* remembered per `storageKey`, and `hasErrors` opens it so a validation
|
|
@@ -98,6 +103,8 @@ export const LinkSourcePicker = m.LinkSourcePicker;
|
|
|
98
103
|
*/
|
|
99
104
|
export const MediaPickerInput = m.MediaPickerInput;
|
|
100
105
|
/** A copy of `items` with the one at `from` moved to `to` (what SortableList's onReorder did). */
|
|
106
|
+
/** A folded card's one-line summary: the first few filled-in values, joined with " · " (markup stripped, lists counted, yes/no left out). */
|
|
107
|
+
export const cardSummary = m.cardSummary;
|
|
101
108
|
export const moveItem = m.moveItem;
|
|
102
109
|
/**
|
|
103
110
|
* Adds a source of results to the command palette, asked while the person
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imajiner/admin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Build admin pages for Sunrice panel plugins: shares the panel's React, Inertia and UI components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/Digital-Citra-Kreatif/sunrice/blob/main/packages/admin/docs/frontend.md",
|