@jini-ai/ui 0.7.0 → 0.7.2
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
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## 0.7.2
|
|
2
|
+
|
|
3
|
+
### Patch Changes
|
|
4
|
+
|
|
5
|
+
- @jini-ai/agentic@0.7.2
|
|
6
|
+
- @jini-ai/core@0.7.2
|
|
7
|
+
- @jini-ai/platform@0.7.2
|
|
8
|
+
- @jini-ai/ui-kit@0.7.2
|
|
9
|
+
|
|
10
|
+
## 0.7.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [873f10c]
|
|
15
|
+
- @jini-ai/core@0.7.1
|
|
16
|
+
- @jini-ai/agentic@0.7.1
|
|
17
|
+
- @jini-ai/platform@0.7.1
|
|
18
|
+
- @jini-ai/ui-kit@0.7.1
|
|
19
|
+
|
|
1
20
|
## 0.7.0
|
|
2
21
|
|
|
3
22
|
### Minor Changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MouseEvent, type SyntheticEvent } from "react";
|
|
2
|
+
export interface ImagePreviewModalController {
|
|
3
|
+
dialogRef: React.RefObject<HTMLDialogElement | null>;
|
|
4
|
+
/** Prevent native Escape-close and route through onClose; the open prop/effect owns lifecycle. */
|
|
5
|
+
handleNativeCancel: (e: SyntheticEvent<HTMLDialogElement>) => void;
|
|
6
|
+
/** The dialog box is content-sized: a target on the dialog itself, rather than a child, is backdrop. */
|
|
7
|
+
handleBackdropClick: (e: MouseEvent<HTMLDialogElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useImagePreviewModal({ open, onClose }: {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
}): ImagePreviewModalController;
|
|
13
|
+
//# sourceMappingURL=ImagePreviewModal.hooks.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Isolate native dialog lifecycle in an injectable hook so rendering can use a fake controller.
|
|
4
|
+
* showModal/close are synchronous browser APIs: no async port or disposed-after-unmount guard
|
|
5
|
+
* is needed. Separate helpers keep each fallback branch shallow rather than nesting in the effect.
|
|
6
|
+
*/
|
|
7
|
+
/** Idempotent native open; the attribute fallback supports DOM environments without showModal. */
|
|
8
|
+
function openDialog(dialog) {
|
|
9
|
+
if (typeof dialog.showModal === "function") {
|
|
10
|
+
if (!dialog.open)
|
|
11
|
+
dialog.showModal();
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
dialog.setAttribute("open", "");
|
|
15
|
+
}
|
|
16
|
+
/** Mirror the attribute fallback where a DOM environment has no native close method. */
|
|
17
|
+
function closeDialog(dialog) {
|
|
18
|
+
if (typeof dialog.close === "function") {
|
|
19
|
+
if (dialog.open)
|
|
20
|
+
dialog.close();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
dialog.removeAttribute("open");
|
|
24
|
+
}
|
|
25
|
+
export function useImagePreviewModal({ open, onClose }) {
|
|
26
|
+
const dialogRef = useRef(null);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const dialog = dialogRef.current;
|
|
29
|
+
if (!dialog)
|
|
30
|
+
return;
|
|
31
|
+
if (open)
|
|
32
|
+
openDialog(dialog);
|
|
33
|
+
else
|
|
34
|
+
closeDialog(dialog);
|
|
35
|
+
}, [open]);
|
|
36
|
+
function handleNativeCancel(e) {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
onClose();
|
|
39
|
+
}
|
|
40
|
+
function handleBackdropClick(e) {
|
|
41
|
+
if (e.target === dialogRef.current)
|
|
42
|
+
onClose();
|
|
43
|
+
}
|
|
44
|
+
return { dialogRef, handleNativeCancel, handleBackdropClick };
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=ImagePreviewModal.hooks.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Generic, product-neutral React UI primitives and feature domains. Framework-free types, decision rules, catalogs, and host port contracts live behind ./core (no React, no DOM). The Excalidraw and Lexical editors live behind ./sketch-editor and ./lexical-rich-text-editor; the GrapesJS-backed inline HTML editor lives behind ./html-editor.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -289,19 +289,19 @@
|
|
|
289
289
|
"shiki": "^1.24.4",
|
|
290
290
|
"tailwind-merge": "^2.6.0",
|
|
291
291
|
"zod": "^3.25.76",
|
|
292
|
-
"@jini-ai/
|
|
293
|
-
"@jini-ai/
|
|
294
|
-
"@jini-ai/
|
|
295
|
-
"@jini-ai/
|
|
296
|
-
"@jini-ai/
|
|
292
|
+
"@jini-ai/integrations": "^0.7.2",
|
|
293
|
+
"@jini-ai/agent-runtime": "^0.7.2",
|
|
294
|
+
"@jini-ai/platform": "^0.7.2",
|
|
295
|
+
"@jini-ai/core": "^0.7.2",
|
|
296
|
+
"@jini-ai/agentic": "^0.7.2"
|
|
297
297
|
},
|
|
298
298
|
"dependencies": {
|
|
299
299
|
"micromark": "^4.0.0",
|
|
300
300
|
"micromark-extension-gfm": "^3.0.0",
|
|
301
|
-
"@jini-ai/
|
|
302
|
-
"@jini-ai/
|
|
303
|
-
"@jini-ai/
|
|
304
|
-
"@jini-ai/
|
|
301
|
+
"@jini-ai/agentic": "^0.7.2",
|
|
302
|
+
"@jini-ai/platform": "^0.7.2",
|
|
303
|
+
"@jini-ai/ui-kit": "^0.7.2",
|
|
304
|
+
"@jini-ai/core": "^0.7.2"
|
|
305
305
|
},
|
|
306
306
|
"peerDependencies": {
|
|
307
307
|
"@tanstack/react-query": "^5.0.0",
|