@owlmeans/web-panel 0.1.18-rc.50 → 0.1.18-rc.51

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.
Files changed (52) hide show
  1. package/README.md +2 -2
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/web-panel/SKILL.md +1 -1
  4. package/build/auth/entrypoints.d.ts +1 -9
  5. package/build/auth/entrypoints.d.ts.map +1 -1
  6. package/build/entrypoints.d.ts +1 -7
  7. package/build/entrypoints.d.ts.map +1 -1
  8. package/package.json +29 -29
  9. package/build/@/components/ui/dropdown-menu.d.ts +0 -26
  10. package/build/@/components/ui/dropdown-menu.d.ts.map +0 -1
  11. package/build/@/components/ui/dropdown-menu.js +0 -51
  12. package/build/@/components/ui/dropdown-menu.js.map +0 -1
  13. package/build/components/menu/component.d.ts +0 -15
  14. package/build/components/menu/component.d.ts.map +0 -1
  15. package/build/components/menu/component.js +0 -146
  16. package/build/components/menu/component.js.map +0 -1
  17. package/build/components/menu/index.d.ts +0 -3
  18. package/build/components/menu/index.d.ts.map +0 -1
  19. package/build/components/menu/index.js +0 -3
  20. package/build/components/menu/index.js.map +0 -1
  21. package/build/components/menu/types.d.ts +0 -138
  22. package/build/components/menu/types.d.ts.map +0 -1
  23. package/build/components/menu/types.js +0 -17
  24. package/build/components/menu/types.js.map +0 -1
  25. package/build/hooks/index.d.ts +0 -2
  26. package/build/hooks/index.d.ts.map +0 -1
  27. package/build/hooks/index.js +0 -2
  28. package/build/hooks/index.js.map +0 -1
  29. package/build/hooks/use-mobile.d.ts +0 -16
  30. package/build/hooks/use-mobile.d.ts.map +0 -1
  31. package/build/hooks/use-mobile.js +0 -30
  32. package/build/hooks/use-mobile.js.map +0 -1
  33. package/build/jobs/component.d.ts +0 -19
  34. package/build/jobs/component.d.ts.map +0 -1
  35. package/build/jobs/component.js +0 -55
  36. package/build/jobs/component.js.map +0 -1
  37. package/build/jobs/index.d.ts +0 -4
  38. package/build/jobs/index.d.ts.map +0 -1
  39. package/build/jobs/index.js +0 -3
  40. package/build/jobs/index.js.map +0 -1
  41. package/build/jobs/toasts.d.ts +0 -14
  42. package/build/jobs/toasts.d.ts.map +0 -1
  43. package/build/jobs/toasts.js +0 -39
  44. package/build/jobs/toasts.js.map +0 -1
  45. package/build/jobs/types.d.ts +0 -21
  46. package/build/jobs/types.d.ts.map +0 -1
  47. package/build/jobs/types.js +0 -2
  48. package/build/jobs/types.js.map +0 -1
  49. package/build/utils.d.ts +0 -13
  50. package/build/utils.d.ts.map +0 -1
  51. package/build/utils.js +0 -14
  52. package/build/utils.js.map +0 -1
package/README.md CHANGED
@@ -11,7 +11,7 @@ but never started.
11
11
  ## Installation
12
12
 
13
13
  ```sh
14
- bun add @owlmeans/web-panel@^0.1.18-rc.50
14
+ bun add @owlmeans/web-panel@^0.1.18-rc.51
15
15
  ```
16
16
 
17
17
  Peer requirements (the consuming app provides these): `react`, `react-dom`,
@@ -463,7 +463,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
463
463
  your project's skill store (`.agents/skills/`):
464
464
 
465
465
  ```sh
466
- npx @owlmeans/agent-skills@^0.1.18-rc.28
466
+ npx @owlmeans/agent-skills@^0.1.18-rc.30
467
467
  ```
468
468
 
469
469
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/web-panel",
4
- "version": "0.1.18-rc.50",
5
- "generatedAt": "2026-09-17T08:16:11.258Z",
4
+ "version": "0.1.18-rc.51",
5
+ "generatedAt": "2026-09-19T13:42:56.279Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/web-panel
9
9
 
10
10
  **Layer:** Web (React)
11
- **Install:** `"@owlmeans/web-panel": "^0.1.18-rc.50"` in `dependencies`
11
+ **Install:** `"@owlmeans/web-panel": "^0.1.18-rc.51"` in `dependencies`
12
12
 
13
13
  ## Key Exports
14
14
 
@@ -1,10 +1,2 @@
1
- export declare const entrypoints: (import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<import("@owlmeans/entrypoint").OpenRequest, import("@owlmeans/entrypoint").OpenValue>> | import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
2
- body: import("@owlmeans/auth").AllowanceRequest;
3
- }, import("@owlmeans/auth").AllowanceResponse>> | import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
4
- body: import("@owlmeans/auth").AuthCredentials;
5
- }, import("@owlmeans/auth").AuthToken>> | import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
6
- query: Partial<import("@owlmeans/auth").AuthToken>;
7
- }, undefined>> | import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
8
- query: import("@owlmeans/auth").AuthToken;
9
- }, undefined>>)[];
1
+ export declare const entrypoints: import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<any>[];
10
2
  //# sourceMappingURL=entrypoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../../src/auth/entrypoints.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW;;;;;;;;iBAAuC,CAAA"}
1
+ {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../../src/auth/entrypoints.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,uEAAuC,CAAA"}
@@ -1,8 +1,2 @@
1
- export declare const entrypoints: (import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<import("@owlmeans/entrypoint").OpenRequest, import("@owlmeans/entrypoint").OpenValue>> | import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
2
- query: import("@owlmeans/auth").AuthToken;
3
- }, undefined>> | import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
4
- query: import("@owlmeans/auth-common").SurrogateQuery;
5
- }, undefined>> | import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
6
- body: import("@owlmeans/auth").AuthToken;
7
- }, import("@owlmeans/auth").AuthToken>>)[];
1
+ export declare const entrypoints: import("@owlmeans/client-entrypoint").ClientProtocolEntrypoint<any>[];
8
2
  //# sourceMappingURL=entrypoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW;;;;;;0CAA4C,CAAA"}
1
+ {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,uEAA4C,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/web-panel",
3
- "version": "0.1.18-rc.50",
3
+ "version": "0.1.18-rc.51",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -44,33 +44,33 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@hookform/resolvers": "^5.2.2",
47
- "@owlmeans/api-config-client": "^0.1.18-rc.27",
48
- "@owlmeans/auth": "^0.1.18-rc.27",
49
- "@owlmeans/auth-common": "^0.1.18-rc.29",
50
- "@owlmeans/basic-envelope": "^0.1.18-rc.28",
51
- "@owlmeans/client": "^0.1.18-rc.32",
52
- "@owlmeans/client-auth": "^0.1.18-rc.37",
53
- "@owlmeans/client-config": "^0.1.18-rc.29",
54
- "@owlmeans/client-context": "^0.1.18-rc.30",
55
- "@owlmeans/client-entrypoint": "^0.1.18-rc.29",
56
- "@owlmeans/client-flow": "^0.1.18-rc.33",
57
- "@owlmeans/client-i18n": "^0.1.18-rc.31",
58
- "@owlmeans/client-panel": "^0.1.18-rc.38",
59
- "@owlmeans/client-route": "^0.1.18-rc.30",
60
- "@owlmeans/client-socket": "^0.1.18-rc.30",
61
- "@owlmeans/config": "^0.1.18-rc.29",
62
- "@owlmeans/context": "^0.1.18-rc.25",
63
- "@owlmeans/entrypoint": "^0.1.18-rc.28",
64
- "@owlmeans/error": "^0.1.18-rc.27",
65
- "@owlmeans/flow": "^0.1.18-rc.30",
66
- "@owlmeans/i18n": "^0.1.18-rc.28",
67
- "@owlmeans/route": "^0.1.18-rc.26",
68
- "@owlmeans/state": "^0.1.18-rc.26",
69
- "@owlmeans/web-client": "^0.1.18-rc.41",
70
- "@owlmeans/web-consent": "^0.1.18-rc.22",
71
- "@owlmeans/web-db": "^0.1.18-rc.30",
72
- "@owlmeans/web-flow": "^0.1.18-rc.33",
73
- "@owlmeans/web-router": "^0.1.18-rc.30",
47
+ "@owlmeans/api-config-client": "^0.1.18-rc.28",
48
+ "@owlmeans/auth": "^0.1.18-rc.28",
49
+ "@owlmeans/auth-common": "^0.1.18-rc.30",
50
+ "@owlmeans/basic-envelope": "^0.1.18-rc.29",
51
+ "@owlmeans/client": "^0.1.18-rc.33",
52
+ "@owlmeans/client-auth": "^0.1.18-rc.39",
53
+ "@owlmeans/client-config": "^0.1.18-rc.30",
54
+ "@owlmeans/client-context": "^0.1.18-rc.31",
55
+ "@owlmeans/client-entrypoint": "^0.1.18-rc.30",
56
+ "@owlmeans/client-flow": "^0.1.18-rc.35",
57
+ "@owlmeans/client-i18n": "^0.1.18-rc.32",
58
+ "@owlmeans/client-panel": "^0.1.18-rc.39",
59
+ "@owlmeans/client-route": "^0.1.18-rc.31",
60
+ "@owlmeans/client-socket": "^0.1.18-rc.31",
61
+ "@owlmeans/config": "^0.1.18-rc.30",
62
+ "@owlmeans/context": "^0.1.18-rc.26",
63
+ "@owlmeans/entrypoint": "^0.1.18-rc.29",
64
+ "@owlmeans/error": "^0.1.18-rc.28",
65
+ "@owlmeans/flow": "^0.1.18-rc.31",
66
+ "@owlmeans/i18n": "^0.1.18-rc.29",
67
+ "@owlmeans/route": "^0.1.18-rc.27",
68
+ "@owlmeans/state": "^0.1.18-rc.27",
69
+ "@owlmeans/web-client": "^0.1.18-rc.42",
70
+ "@owlmeans/web-consent": "^0.1.18-rc.23",
71
+ "@owlmeans/web-db": "^0.1.18-rc.31",
72
+ "@owlmeans/web-flow": "^0.1.18-rc.34",
73
+ "@owlmeans/web-router": "^0.1.18-rc.31",
74
74
  "i18next-browser-languagedetector": "^8.0.0",
75
75
  "qrcode.react": "^4.2.0",
76
76
  "react-google-recaptcha": "^3.1.0",
@@ -95,7 +95,7 @@
95
95
  },
96
96
  "devDependencies": {
97
97
  "@owlmeans/dep-config": "workspace:*",
98
- "@owlmeans/test-ui": "^0.1.18-rc.30",
98
+ "@owlmeans/test-ui": "^0.1.18-rc.31",
99
99
  "@radix-ui/react-alert-dialog": "^1.1.15",
100
100
  "@radix-ui/react-label": "^2.1.0",
101
101
  "@radix-ui/react-navigation-menu": "^1.2.14",
@@ -1,26 +0,0 @@
1
- import * as React from "react";
2
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
- declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
4
- declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
5
- declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
6
- declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
7
- declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
8
- declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
9
- inset?: boolean;
10
- variant?: "default" | "destructive";
11
- }): React.JSX.Element;
12
- declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
13
- declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
14
- declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
15
- declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
16
- inset?: boolean;
17
- }): React.JSX.Element;
18
- declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
19
- declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
20
- declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
21
- declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
22
- inset?: boolean;
23
- }): React.JSX.Element;
24
- declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
25
- export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
26
- //# sourceMappingURL=dropdown-menu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../../src/@/components/ui/dropdown-menu.tsx"],"names":[],"mappings":"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Ae,EACf,sBAAsB,EACtB,sBAAsB,GACvB,CAAA"}
@@ -1,51 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
4
- import { cn } from "@/lib/utils";
5
- function DropdownMenu({ ...props }) {
6
- return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
7
- }
8
- function DropdownMenuPortal({ ...props }) {
9
- return (_jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props }));
10
- }
11
- function DropdownMenuTrigger({ ...props }) {
12
- return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props }));
13
- }
14
- function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
15
- return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className), ...props }) }));
16
- }
17
- function DropdownMenuGroup({ ...props }) {
18
- return (_jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
19
- }
20
- function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
21
- return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
22
- }
23
- function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
24
- return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
25
- }
26
- function DropdownMenuRadioGroup({ ...props }) {
27
- return (_jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
28
- }
29
- function DropdownMenuRadioItem({ className, children, ...props }) {
30
- return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
31
- }
32
- function DropdownMenuLabel({ className, inset, ...props }) {
33
- return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className), ...props }));
34
- }
35
- function DropdownMenuSeparator({ className, ...props }) {
36
- return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("bg-border -mx-1 my-1 h-px", className), ...props }));
37
- }
38
- function DropdownMenuShortcut({ className, ...props }) {
39
- return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props }));
40
- }
41
- function DropdownMenuSub({ ...props }) {
42
- return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
43
- }
44
- function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
45
- return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto size-4" })] }));
46
- }
47
- function DropdownMenuSubContent({ className, ...props }) {
48
- return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className), ...props }));
49
- }
50
- export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
51
- //# sourceMappingURL=dropdown-menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../../src/@/components/ui/dropdown-menu.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEtE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,SAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACgD;IACxD,OAAO,KAAC,qBAAqB,CAAC,IAAI,iBAAW,eAAe,KAAK,KAAK,GAAI,CAAA;AAC5E,CAAC;AAED,SAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACkD;IAC1D,OAAO,CACL,KAAC,qBAAqB,CAAC,MAAM,iBAAW,sBAAsB,KAAK,KAAK,GAAI,CAC7E,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,EAC3B,GAAG,KAAK,EACmD;IAC3D,OAAO,CACL,KAAC,qBAAqB,CAAC,OAAO,iBAClB,uBAAuB,KAC7B,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,UAAU,GAAG,CAAC,EACd,GAAG,KAAK,EACmD;IAC3D,OAAO,CACL,KAAC,qBAAqB,CAAC,MAAM,cAC3B,KAAC,qBAAqB,CAAC,OAAO,iBAClB,uBAAuB,EACjC,UAAU,EAAE,UAAU,EACtB,SAA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,SAAS,EAAC,gBAAgB,GAAG,IACd,CACpC,CAAA;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACsD;IAC9D,OAAO,CACL,KAAC,qBAAqB,CAAC,UAAU,iBACrB,2BAA2B,EACrC,SAAS,EAAE,EAAE,CACX,+eAA+e,EAC/e,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,CAAA"}
@@ -1,15 +0,0 @@
1
- import type { FC } from 'react';
2
- import type { PanelMenuProps } from './types.js';
3
- /**
4
- * The application menu — one dropdown, described as data.
5
- *
6
- * Built on the shadcn `dropdown-menu` primitive under the `@` contract: the specifier is emitted
7
- * verbatim and resolves to the CONSUMING app's own copy, so an app must vendor
8
- * `dropdown-menu.tsx` and declare `@radix-ui/react-dropdown-menu` alongside the other Radix peers.
9
- *
10
- * Entries are a closed union rather than children because every kind has different focus,
11
- * keyboard and close-on-select behaviour, and because the same description then serves a
12
- * collapsed toolbar, a header overflow and a mobile shell without any of them re-deriving it.
13
- */
14
- export declare const PanelMenu: FC<PanelMenuProps>;
15
- //# sourceMappingURL=component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/menu/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAA;AAsB1C,OAAO,KAAK,EAC0B,cAAc,EACnD,MAAM,YAAY,CAAA;AAkDnB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAkKxC,CAAA"}
@@ -1,146 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { isValidElement, useCallback, useMemo, useState } from 'react';
3
- import { Menu } from 'lucide-react';
4
- import { defaultNavTranslate, resolveNavLabel } from '@owlmeans/client-panel';
5
- import { useContext, useNavigate } from '@owlmeans/client';
6
- import { cn } from '@/lib/utils';
7
- import { Button } from '@/components/ui/button';
8
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu';
9
- import { PanelMenuEntryKind } from './types.js';
10
- /**
11
- * Drop the entries nobody asked to see, then the rules those leave behind.
12
- *
13
- * A caller composes a menu from optional blocks — a project section that only exists on a
14
- * project screen, an auth row that only exists while signed in — and expresses "not now" as
15
- * `hidden`. Filtering the entries alone leaves the separators that framed them, so the menu
16
- * opens onto a leading rule, a doubled rule, or a rule under the last item. Normalising here
17
- * rather than at every call site is the whole reason the entries are data.
18
- */
19
- const usable = (entries) => {
20
- const visible = entries.filter(entry => entry.hidden !== true);
21
- const kept = [];
22
- for (const entry of visible) {
23
- if (entry.kind !== PanelMenuEntryKind.Separator) {
24
- kept.push(entry);
25
- continue;
26
- }
27
- const previous = kept[kept.length - 1];
28
- if (previous != null && previous.kind !== PanelMenuEntryKind.Separator) {
29
- kept.push(entry);
30
- }
31
- }
32
- while (kept.length > 0 && kept[kept.length - 1].kind === PanelMenuEntryKind.Separator) {
33
- kept.pop();
34
- }
35
- return kept;
36
- };
37
- const labelOf = (translate, entry) => resolveNavLabel(translate, entry.label, entry.labelKey ?? (entry.alias != null ? `modules.${entry.alias}` : `menu.${entry.key}`), entry.alias ?? entry.key);
38
- const renderWidget = (entry, className) => {
39
- if (isValidElement(entry.render) || typeof entry.render !== 'function') {
40
- return entry.render;
41
- }
42
- const Widget = entry.render;
43
- return _jsx(Widget, { className: className });
44
- };
45
- /**
46
- * The application menu — one dropdown, described as data.
47
- *
48
- * Built on the shadcn `dropdown-menu` primitive under the `@` contract: the specifier is emitted
49
- * verbatim and resolves to the CONSUMING app's own copy, so an app must vendor
50
- * `dropdown-menu.tsx` and declare `@radix-ui/react-dropdown-menu` alongside the other Radix peers.
51
- *
52
- * Entries are a closed union rather than children because every kind has different focus,
53
- * keyboard and close-on-select behaviour, and because the same description then serves a
54
- * collapsed toolbar, a header overflow and a mobile shell without any of them re-deriving it.
55
- */
56
- export const PanelMenu = ({ entries, translate = defaultNavTranslate, trigger, triggerLabel, indicator, align = 'end', side, triggerClassName, contentClassName, open, onOpenChange, testId, className, style, }) => {
57
- const context = useContext();
58
- const nav = useNavigate();
59
- const [selfOpen, setSelfOpen] = useState(false);
60
- const isOpen = open ?? selfOpen;
61
- const setOpen = useCallback((next) => {
62
- setSelfOpen(next);
63
- onOpenChange?.(next);
64
- }, [onOpenChange]);
65
- /**
66
- * The path an alias addresses, resolved SYNCHRONOUSLY.
67
- *
68
- * `Link` asks `entrypoint.url()` and settles a frame later, which is fine for a link that is
69
- * already on screen. A menu's content mounts at the moment it opens, so an href that arrives
70
- * afterwards is missing exactly while the user is reading the row: not focusable as a link,
71
- * not middle-clickable, no status-bar target. `path()` is a lookup against the entrypoint's own
72
- * declaration, so it answers immediately — and answers `undefined` for a path carrying route
73
- * parameters, where there is no honest URL to show yet.
74
- */
75
- const hrefOf = useMemo(() => (alias) => {
76
- try {
77
- const path = context.entrypoint(alias).path();
78
- return path.includes(':') ? undefined : path;
79
- }
80
- catch {
81
- // An alias the app never elevated addresses nothing. It must not take the menu down.
82
- return undefined;
83
- }
84
- }, [context]);
85
- const select = (entry) => {
86
- entry.onSelect?.();
87
- if (entry.href == null && entry.alias != null) {
88
- nav.press(entry.alias)();
89
- }
90
- };
91
- const renderItem = (entry) => {
92
- const external = entry.href != null;
93
- const href = entry.href ?? (entry.alias != null ? hrefOf(entry.alias) : undefined);
94
- // An in-app link is the one case that cannot use Radix's `onSelect`. The anchor must call
95
- // `preventDefault()` or the browser performs a full page load, and Radix composes its own
96
- // click handler with `checkForDefaultPrevented: true` — so preventing the default also
97
- // cancels `onSelect`, and with it the automatic close. Both are driven explicitly below.
98
- // Left implicit, the row navigated nowhere and the menu stayed open.
99
- const inApp = !external && href != null;
100
- const body = _jsxs(_Fragment, { children: [entry.Icon != null ? _jsx(entry.Icon, { className: "size-4 shrink-0" }) : null, _jsx("span", { className: "flex-1 truncate", children: labelOf(translate, entry) }), entry.hint != null
101
- ? _jsx("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground", children: entry.hint })
102
- : null] });
103
- // `key` stays OUT of this bag — React refuses a key arriving through a spread.
104
- const shared = {
105
- disabled: entry.disabled,
106
- variant: entry.variant,
107
- 'aria-current': entry.active === true ? 'true' : undefined,
108
- className: cn(entry.active === true && 'bg-accent text-accent-foreground'),
109
- };
110
- // A menu entry is a real link wherever it addresses something. An `<a>` without `href` is
111
- // not focusable, does not answer the keyboard, cannot be opened in a new tab, and does not
112
- // even carry the `link` role.
113
- return href != null
114
- ? _jsx(DropdownMenuItem, { ...shared, onSelect: inApp ? undefined : () => select(entry), asChild: true, children: _jsx("a", { href: href, target: external && entry.open === true ? '_blank' : undefined, rel: external && entry.open === true ? 'noopener noreferrer' : undefined, onClick: inApp
115
- ? event => { event.preventDefault(); select(entry); setOpen(false); }
116
- : undefined, children: body }) }, entry.key)
117
- : _jsx(DropdownMenuItem, { ...shared, onSelect: () => select(entry), children: body }, entry.key);
118
- };
119
- const renderSub = (entry) => _jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [entry.Icon != null ? _jsx(entry.Icon, { className: "size-4 shrink-0" }) : null, _jsx("span", { className: "flex-1 truncate", children: labelOf(translate, entry) }), entry.hint != null
120
- ? _jsx("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground", children: entry.hint })
121
- : null] }), _jsx(DropdownMenuSubContent, { children: usable(entry.entries).map(nested => renderEntry(nested, true)) })] }, entry.key);
122
- const renderEntry = (entry, nested = false) => {
123
- switch (entry.kind) {
124
- case PanelMenuEntryKind.Separator:
125
- return _jsx(DropdownMenuSeparator, {}, entry.key);
126
- case PanelMenuEntryKind.Label:
127
- return _jsx(DropdownMenuLabel, { className: "truncate text-xs text-muted-foreground", children: labelOf(translate, entry) }, entry.key);
128
- case PanelMenuEntryKind.Sub:
129
- // One level. A dropdown that nests further is a navigation tree, not this primitive.
130
- return nested ? null : renderSub(entry);
131
- case PanelMenuEntryKind.Widget: {
132
- const caption = entry.label != null || entry.labelKey != null
133
- // Inline, the caption names a control on the same line and reads as an item's label;
134
- // stacked, it is a heading over the widget below it.
135
- ? _jsx("span", { className: cn('shrink-0', entry.inline === true ? 'text-sm' : 'text-xs text-muted-foreground'), children: labelOf(translate, entry) })
136
- : null;
137
- return _jsxs("div", { "data-panel-menu-row": entry.key, className: cn('flex min-w-0 gap-2 px-2 py-1.5 text-sm', entry.inline === true ? 'items-center' : 'flex-col items-stretch', entry.className), children: [caption, renderWidget(entry, 'min-w-0 flex-1')] }, entry.key);
138
- }
139
- default:
140
- return renderItem(entry);
141
- }
142
- };
143
- const rows = usable(entries);
144
- return _jsxs(DropdownMenu, { open: isOpen, onOpenChange: setOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: trigger ?? _jsxs(Button, { variant: "outline", size: "icon", "aria-label": triggerLabel, title: triggerLabel, "data-testid": testId, className: cn('relative', triggerClassName, className), style: style, children: [_jsx(Menu, { className: "size-4" }), indicator] }) }), _jsx(DropdownMenuContent, { align: align, side: side, className: cn('w-72', contentClassName), children: rows.map(entry => renderEntry(entry)) })] });
145
- };
146
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/menu/component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAA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;gBACE,OAAO,UAAU,CAAC,KAAK,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC,CAAA;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAE5B,OAAO,MAAC,YAAY,IAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,aACtD,KAAC,mBAAmB,IAAC,OAAO,kBACzB,OAAO,IAAI,MAAC,MAAM,IACjB,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,MAAM,gBACC,YAAY,EACxB,KAAK,EAAE,YAAY,iBACN,MAAM,EACnB,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,SAAS,CAAC,EACtD,KAAK,EAAE,KAAK,aAEZ,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,GAAG,EAC1B,SAAS,IACH,GACW,EACtB,KAAC,mBAAmB,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC,YACnF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,GAClB,IACT,CAAA;AACjB,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './types.js';
2
- export * from './component.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './types.js';
2
- export * from './component.js';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
@@ -1,138 +0,0 @@
1
- import type { ComponentType, ReactNode } from 'react';
2
- import type { NavTranslate } from '@owlmeans/client-panel';
3
- import type { StyledProps } from '../types.js';
4
- /**
5
- * What a menu row IS, rather than what it looks like.
6
- *
7
- * The kinds are closed on purpose: every one of them has its own focus, keyboard and
8
- * close-on-select semantics, and a caller that could hand in arbitrary JSX at the top level
9
- * would silently lose all three. `Widget` is the escape hatch, and it is a ROW rather than an
10
- * item precisely so its own controls keep working — see `PanelMenuWidgetEntry`.
11
- */
12
- export declare enum PanelMenuEntryKind {
13
- Item = "item",
14
- Widget = "widget",
15
- Label = "label",
16
- Separator = "separator",
17
- Sub = "sub"
18
- }
19
- interface PanelMenuEntryBase {
20
- /** Stable React key, and the default translation-key stem (`menu.<key>`). */
21
- key: string;
22
- /** Filtered out before rendering — including the separators it would orphan. */
23
- hidden?: boolean;
24
- }
25
- /**
26
- * A normal, focusable row that closes the menu when chosen.
27
- *
28
- * Exactly one of `alias` (a frontend entrypoint) or `href` (anything else) addresses a target,
29
- * the same union {@link PanelNavLink} uses — an alias never carries a URL, because the router
30
- * resolves it and a path that changes shape stays correct everywhere it is rendered. Give
31
- * neither and the row is a pure action driven by `onSelect`.
32
- */
33
- export interface PanelMenuItemEntry extends PanelMenuEntryBase {
34
- kind: PanelMenuEntryKind.Item;
35
- alias?: string;
36
- href?: string;
37
- /** Open in a new tab (`target="_blank"` + `rel="noopener noreferrer"`). */
38
- open?: boolean;
39
- /** Literal label. Absent, the label is resolved through `translate`. */
40
- label?: string;
41
- /** Translation key. Defaults to `modules.<alias>` for an alias row, else `menu.<key>`. */
42
- labelKey?: string;
43
- Icon?: ComponentType<{
44
- className?: string;
45
- }>;
46
- /** Right-aligned adornment — the current value, a shortcut, an external-link glyph. */
47
- hint?: ReactNode;
48
- onSelect?: () => void;
49
- disabled?: boolean;
50
- /** Marks the row as the one currently in effect (`aria-current`, muted background). */
51
- active?: boolean;
52
- variant?: 'default' | 'destructive';
53
- }
54
- /**
55
- * An arbitrary widget, rendered as a plain ROW and never as a menu item.
56
- *
57
- * A widget carries its own interactive controls, and a `DropdownMenuItem` around them takes
58
- * both the focus and the activation: Radix's roving tabindex swallows the inner button's
59
- * keyboard access, and `onSelect` closes the menu on any click that lands on the row — so a
60
- * "Top up" button inside an item dismisses the menu before its own handler is observed. The
61
- * row therefore takes no roving focus of its own and does not close the menu; the widget's
62
- * buttons are the only click targets, and they stay tabbable.
63
- */
64
- export interface PanelMenuWidgetEntry extends PanelMenuEntryBase {
65
- kind: PanelMenuEntryKind.Widget;
66
- /** A node, or a component the menu instantiates with its row `className`. */
67
- render: ReactNode | ComponentType<{
68
- className?: string;
69
- }>;
70
- label?: string;
71
- labelKey?: string;
72
- /** Put the caption beside the widget instead of above it. */
73
- inline?: boolean;
74
- className?: string;
75
- }
76
- /** A section heading. Not focusable, not selectable. */
77
- export interface PanelMenuLabelEntry extends PanelMenuEntryBase {
78
- kind: PanelMenuEntryKind.Label;
79
- label?: string;
80
- labelKey?: string;
81
- }
82
- /** A horizontal rule between blocks. Normalised away when it would lead, trail or double up. */
83
- export interface PanelMenuSeparatorEntry extends PanelMenuEntryBase {
84
- kind: PanelMenuEntryKind.Separator;
85
- }
86
- /**
87
- * A nested menu — one level deep.
88
- *
89
- * `entries` is the same union so a submenu can carry labels and separators, but a `Sub` inside
90
- * a `Sub` is rendered as nothing: a dropdown that nests further is a navigation tree, and this
91
- * primitive is not one.
92
- */
93
- export interface PanelMenuSubEntry extends PanelMenuEntryBase {
94
- kind: PanelMenuEntryKind.Sub;
95
- label?: string;
96
- labelKey?: string;
97
- Icon?: ComponentType<{
98
- className?: string;
99
- }>;
100
- /** Right-aligned adornment on the trigger — typically the current value. */
101
- hint?: ReactNode;
102
- entries: PanelMenuEntry[];
103
- }
104
- export type PanelMenuEntry = PanelMenuItemEntry | PanelMenuWidgetEntry | PanelMenuLabelEntry | PanelMenuSeparatorEntry | PanelMenuSubEntry;
105
- export interface PanelMenuProps extends StyledProps {
106
- entries: PanelMenuEntry[];
107
- /**
108
- * See {@link NavTranslate}. It is a PROP and never an implicit context read: an app mounted
109
- * with `renderApp` from `@owlmeans/web-client` has no i18n provider, and the panel i18n hook
110
- * dereferences `i18n.options` on the empty object `react-i18next` returns without an
111
- * instance — a throw inside render that blanks the whole app. Omitted, literal labels win and
112
- * the fallback is a humanized key.
113
- */
114
- translate?: NavTranslate;
115
- /** Replaces the default icon-button trigger entirely. */
116
- trigger?: ReactNode;
117
- /** Accessible name for the default trigger. */
118
- triggerLabel?: string;
119
- /**
120
- * Rendered on the trigger's top-right corner — a notification dot, a count. It is a slot
121
- * rather than a `tone` enum because what deserves attention is the application's judgement,
122
- * not the menu's.
123
- */
124
- indicator?: ReactNode;
125
- align?: 'start' | 'center' | 'end';
126
- side?: 'top' | 'right' | 'bottom' | 'left';
127
- /** Styles the default trigger. Merged over its defaults, never substituted. */
128
- triggerClassName?: string;
129
- /** Styles the dropdown surface. Merged over its defaults, never substituted. */
130
- contentClassName?: string;
131
- /** Controlled open state. Omitted, the menu owns it. */
132
- open?: boolean;
133
- onOpenChange?: (open: boolean) => void;
134
- /** Forwarded to the trigger as `data-testid`. */
135
- testId?: string;
136
- }
137
- export {};
138
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;;;;;GAOG;AACH,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,GAAG,QAAQ;CACZ;AAED,UAAU,kBAAkB;IAC1B,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAA;IACX,gFAAgF;IAChF,MAAM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C,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
@@ -1,17 +0,0 @@
1
- /**
2
- * What a menu row IS, rather than what it looks like.
3
- *
4
- * The kinds are closed on purpose: every one of them has its own focus, keyboard and
5
- * close-on-select semantics, and a caller that could hand in arbitrary JSX at the top level
6
- * would silently lose all three. `Widget` is the escape hatch, and it is a ROW rather than an
7
- * item precisely so its own controls keep working — see `PanelMenuWidgetEntry`.
8
- */
9
- export var PanelMenuEntryKind;
10
- (function (PanelMenuEntryKind) {
11
- PanelMenuEntryKind["Item"] = "item";
12
- PanelMenuEntryKind["Widget"] = "widget";
13
- PanelMenuEntryKind["Label"] = "label";
14
- PanelMenuEntryKind["Separator"] = "separator";
15
- PanelMenuEntryKind["Sub"] = "sub";
16
- })(PanelMenuEntryKind || (PanelMenuEntryKind = {}));
17
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/menu/types.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,qCAAe,CAAA;IACf,6CAAuB,CAAA;IACvB,iCAAW,CAAA;AACb,CAAC,EANW,kBAAkB,KAAlB,kBAAkB,QAM7B"}
@@ -1,2 +0,0 @@
1
- export * from './use-mobile.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './use-mobile.js';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -1,16 +0,0 @@
1
- /** Tailwind's `md` — the width at which the navigation shell swaps its side menu for the bar. */
2
- export declare const MOBILE_BREAKPOINT = 768;
3
- /**
4
- * Whether the viewport is narrower than Tailwind's `md`, for a component that has to pick a tree
5
- * rather than render both and hide one with `md:hidden`.
6
- *
7
- * It matches a media query instead of listening for `resize` the way `useBreakPoint` does: the
8
- * browser evaluates the query itself and notifies only when the answer flips, so dragging a window
9
- * across the whole width costs one render rather than one per frame.
10
- *
11
- * The answer is `false` before the first effect and on a server render, because `window` is the
12
- * only thing that knows the width. That makes the desktop tree the one server-rendered HTML and
13
- * the first client paint agree on, so hydration never mismatches.
14
- */
15
- export declare const useIsMobile: () => boolean;
16
- //# sourceMappingURL=use-mobile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAEA,iGAAiG;AACjG,eAAO,MAAM,iBAAiB,MAAM,CAAA;AAEpC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,QAAO,OAiB9B,CAAA"}
@@ -1,30 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- /** Tailwind's `md` — the width at which the navigation shell swaps its side menu for the bar. */
3
- export const MOBILE_BREAKPOINT = 768;
4
- /**
5
- * Whether the viewport is narrower than Tailwind's `md`, for a component that has to pick a tree
6
- * rather than render both and hide one with `md:hidden`.
7
- *
8
- * It matches a media query instead of listening for `resize` the way `useBreakPoint` does: the
9
- * browser evaluates the query itself and notifies only when the answer flips, so dragging a window
10
- * across the whole width costs one render rather than one per frame.
11
- *
12
- * The answer is `false` before the first effect and on a server render, because `window` is the
13
- * only thing that knows the width. That makes the desktop tree the one server-rendered HTML and
14
- * the first client paint agree on, so hydration never mismatches.
15
- */
16
- export const useIsMobile = () => {
17
- const [isMobile, setIsMobile] = useState(false);
18
- useEffect(() => {
19
- if (typeof window === 'undefined' || window.matchMedia == null) {
20
- return;
21
- }
22
- const query = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
23
- const read = () => setIsMobile(query.matches);
24
- read();
25
- query.addEventListener('change', read);
26
- return () => query.removeEventListener('change', read);
27
- }, []);
28
- return isMobile;
29
- };
30
- //# sourceMappingURL=use-mobile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-mobile.js","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C,iGAAiG;AACjG,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAEpC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAY,EAAE;IACvC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE/C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;YAC/D,OAAM;QACR,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,iBAAiB,GAAG,CAAC,KAAK,CAAC,CAAA;QAC1E,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC7C,IAAI,EAAE,CAAA;QACN,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;QAEtC,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACxD,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
@@ -1,19 +0,0 @@
1
- import type { FC } from 'react';
2
- import type { JobRecord } from '@owlmeans/queue';
3
- import type { JobProps, JobStatusProps } from './types.js';
4
- /**
5
- * A job's progress as a percentage, or `undefined` when there is nothing to show yet.
6
- *
7
- * `JobRecord.progress` is deliberately `unknown` — a processor reports whatever it counts — so the
8
- * three shapes worth understanding are read here and everything else falls through to the
9
- * indeterminate bar, which is the honest answer for "running, no idea how far".
10
- */
11
- export declare const jobProgressValue: (job: JobRecord) => number | undefined;
12
- /**
13
- * The bar for one job. A job with nothing to report animates indeterminately rather than sitting
14
- * at zero, because zero and "the processor never called `progress()`" look identical otherwise.
15
- */
16
- export declare const JobProgress: FC<JobProps>;
17
- /** The state pill. `data-state` carries the raw state, so a test never keys on the wording. */
18
- export declare const JobStatus: FC<JobStatusProps>;
19
- //# sourceMappingURL=component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/jobs/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGhD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,QAAS,SAAS,KAAG,MAAM,GAAG,SAW1D,CAAA;AAcD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,QAAQ,CASpC,CAAA;AAWD,+FAA+F;AAC/F,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAYxC,CAAA"}
@@ -1,55 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { JobState } from '@owlmeans/queue';
4
- import { Progress } from '@/components/ui/progress';
5
- import { cn } from '@/lib/utils';
6
- /**
7
- * A job's progress as a percentage, or `undefined` when there is nothing to show yet.
8
- *
9
- * `JobRecord.progress` is deliberately `unknown` — a processor reports whatever it counts — so the
10
- * three shapes worth understanding are read here and everything else falls through to the
11
- * indeterminate bar, which is the honest answer for "running, no idea how far".
12
- */
13
- export const jobProgressValue = (job) => {
14
- if (job.state === JobState.Completed) {
15
- return 100;
16
- }
17
- const progress = job.progress;
18
- const value = typeof progress === 'number' ? progress
19
- : typeof progress === 'object' && progress != null
20
- ? percentOf(progress)
21
- : undefined;
22
- return value == null ? undefined : Math.max(0, Math.min(100, value));
23
- };
24
- const percentOf = (progress) => {
25
- if (typeof progress.percent === 'number') {
26
- return progress.percent;
27
- }
28
- const { done, total } = progress;
29
- if (typeof done === 'number' && typeof total === 'number' && total > 0) {
30
- return (done / total) * 100;
31
- }
32
- return undefined;
33
- };
34
- /**
35
- * The bar for one job. A job with nothing to report animates indeterminately rather than sitting
36
- * at zero, because zero and "the processor never called `progress()`" look identical otherwise.
37
- */
38
- export const JobProgress = ({ job, className, style }) => {
39
- const value = useMemo(() => jobProgressValue(job), [job.state, job.progress]);
40
- return _jsx(Progress, { "data-slot": "job-progress", value: value, className: cn('w-full', className), style: style });
41
- };
42
- const STATE_STYLE = {
43
- [JobState.Waiting]: 'border-border bg-muted text-muted-foreground',
44
- [JobState.Delayed]: 'border-border bg-muted text-muted-foreground',
45
- [JobState.Active]: 'border-border bg-accent text-accent-foreground',
46
- [JobState.Completed]: 'border-primary/40 bg-primary/10 text-primary',
47
- [JobState.Failed]: 'border-destructive/40 bg-destructive/10 text-destructive',
48
- [JobState.Unknown]: 'border-border bg-muted text-muted-foreground',
49
- };
50
- /** The state pill. `data-state` carries the raw state, so a test never keys on the wording. */
51
- export const JobStatus = ({ job, labels, className, style }) => {
52
- const state = job.state ?? JobState.Unknown;
53
- return _jsx("span", { "data-slot": "job-status", "data-state": state, className: cn('inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium', STATE_STYLE[state], className), style: style, children: labels?.[state] ?? state });
54
- };
55
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/jobs/component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAA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,4 +0,0 @@
1
- export type * from './types.js';
2
- export * from './component.js';
3
- export * from './toasts.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jobs/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAE/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './component.js';
2
- export * from './toasts.js';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jobs/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA"}
@@ -1,14 +0,0 @@
1
- import type { JobRecord } from '@owlmeans/queue';
2
- import type { JobToastOptions } from './types.js';
3
- /**
4
- * Announce jobs as they finish, on the `Toaster` the layout already mounts.
5
- *
6
- * Hand it whatever the screen is already showing — `useJobs()` from `@owlmeans/client-job` maps
7
- * straight onto it — and it raises one toast per job the first time that job settles.
8
- *
9
- * **The first pass never toasts.** A screen opening onto a store seeded with yesterday's finished
10
- * jobs would otherwise fire a stack of them at once, so everything already settled when this
11
- * mounts is recorded as announced and only what settles afterwards is reported.
12
- */
13
- export declare const useJobToasts: (jobs: JobRecord[], opts?: JobToastOptions) => void;
14
- //# sourceMappingURL=toasts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toasts.d.ts","sourceRoot":"","sources":["../../src/jobs/toasts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,SAAU,SAAS,EAAE,SAAS,eAAe,KAAG,IAwBxE,CAAA"}
@@ -1,39 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
- import { toast } from 'sonner';
3
- import { isSettled, JobState } from '@owlmeans/queue';
4
- /**
5
- * Announce jobs as they finish, on the `Toaster` the layout already mounts.
6
- *
7
- * Hand it whatever the screen is already showing — `useJobs()` from `@owlmeans/client-job` maps
8
- * straight onto it — and it raises one toast per job the first time that job settles.
9
- *
10
- * **The first pass never toasts.** A screen opening onto a store seeded with yesterday's finished
11
- * jobs would otherwise fire a stack of them at once, so everything already settled when this
12
- * mounts is recorded as announced and only what settles afterwards is reported.
13
- */
14
- export const useJobToasts = (jobs, opts) => {
15
- const announced = useRef(new Set());
16
- const primed = useRef(false);
17
- // Re-run on what actually decides a toast, not on the array identity a caller rebuilds per render.
18
- const settlement = jobs.map(job => `${job.id}:${job.state}`).join(',');
19
- useEffect(() => {
20
- jobs.forEach(job => {
21
- if (job.id == null || !isSettled(job.state) || announced.current.has(job.id)) {
22
- return;
23
- }
24
- announced.current.add(job.id);
25
- if (!primed.current) {
26
- return;
27
- }
28
- const message = opts?.message?.(job) ?? job.name;
29
- if (job.state === JobState.Completed) {
30
- toast.success(message);
31
- }
32
- else {
33
- toast.error(job.error != null && job.error !== '' ? `${String(message)}: ${job.error}` : message);
34
- }
35
- });
36
- primed.current = true;
37
- }, [settlement]);
38
- };
39
- //# sourceMappingURL=toasts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toasts.js","sourceRoot":"","sources":["../../src/jobs/toasts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAIrD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAiB,EAAE,IAAsB,EAAQ,EAAE;IAC9E,MAAM,SAAS,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC,CAAA;IAChD,MAA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A"}
@@ -1,21 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { JobRecord, JobState } from '@owlmeans/queue';
3
- import type { StyledProps } from '../components/types.js';
4
- export interface JobProps extends StyledProps {
5
- job: JobRecord;
6
- }
7
- export interface JobStatusProps extends JobProps {
8
- /**
9
- * What each state is called on screen.
10
- *
11
- * There is no packaged wording: the states are broker vocabulary, and the sentence an app wants
12
- * for them ("Queued", "Rendering", "Ready") is the app's own copy in the app's own namespace.
13
- * Absent a label the raw state is rendered, which is data rather than an untranslated string.
14
- */
15
- labels?: Partial<Record<JobState, ReactNode>>;
16
- }
17
- export interface JobToastOptions {
18
- /** What the toast says. The job's own name when omitted. */
19
- message?: (job: JobRecord) => ReactNode;
20
- }
21
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/jobs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD,MAAM,WAAW,QAAS,SAAQ,WAAW;IAC3C,GAAG,EAAE,SAAS,CAAA;CACf;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAA;CAC9C;AAED,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,SAAS,CAAA;CACxC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/jobs/types.ts"],"names":[],"mappings":""}
package/build/utils.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import { type ClassValue } from 'clsx';
2
- /**
3
- * The class-name merger every component in this package is written against, exported so a
4
- * consuming application doesn't declare its own copy.
5
- *
6
- * This is deliberately NOT a re-export of `@/lib/utils`. That specifier is left verbatim in the
7
- * build and resolves to the CONSUMER's vendored file, so re-exporting it would hand an app back
8
- * its own function and fail outright wherever the `@` alias isn't configured. The vendored copy
9
- * under `src/@/lib/` stays exactly as shadcn emits it, because the package's own components must
10
- * keep resolving through the `@` contract.
11
- */
12
- export declare const cn: (...inputs: ClassValue[]) => string;
13
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAG5C;;;;;;;;;GASG;AACH,eAAO,MAAM,EAAE,cAAe,UAAU,EAAE,KAAG,MAA+B,CAAA"}
package/build/utils.js DELETED
@@ -1,14 +0,0 @@
1
- import { clsx } from 'clsx';
2
- import { twMerge } from 'tailwind-merge';
3
- /**
4
- * The class-name merger every component in this package is written against, exported so a
5
- * consuming application doesn't declare its own copy.
6
- *
7
- * This is deliberately NOT a re-export of `@/lib/utils`. That specifier is left verbatim in the
8
- * build and resolves to the CONSUMER's vendored file, so re-exporting it would hand an app back
9
- * its own function and fail outright wherever the `@` alias isn't configured. The vendored copy
10
- * under `src/@/lib/` stays exactly as shadcn emits it, because the package's own components must
11
- * keep resolving through the `@` contract.
12
- */
13
- export const cn = (...inputs) => twMerge(clsx(inputs));
14
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAoB,EAAU,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA"}