@qwanyx/ai-editor 1.5.7 → 1.5.8
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export interface ImageMetadata {
|
|
2
3
|
src: string;
|
|
3
4
|
alt?: string;
|
|
@@ -13,6 +14,6 @@ export interface ImageMetadataDialogProps {
|
|
|
13
14
|
initialData?: Partial<ImageMetadata>;
|
|
14
15
|
title?: string;
|
|
15
16
|
}
|
|
16
|
-
export declare function ImageMetadataDialog({ isOpen, onClose, onSave, initialData, title, }: ImageMetadataDialogProps):
|
|
17
|
+
export declare function ImageMetadataDialog({ isOpen, onClose, onSave, initialData, title, }: ImageMetadataDialogProps): React.ReactPortal | null;
|
|
17
18
|
export default ImageMetadataDialog;
|
|
18
19
|
//# sourceMappingURL=ImageMetadataDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageMetadataDialog.d.ts","sourceRoot":"","sources":["../../src/components/ImageMetadataDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageMetadataDialog.d.ts","sourceRoot":"","sources":["../../src/components/ImageMetadataDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAOlD,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAA;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAmID,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,OAAO,EACP,MAAM,EACN,WAAW,EACX,KAAgC,GACjC,EAAE,wBAAwB,4BAgN1B;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.ImageMetadataDialog = ImageMetadataDialog;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const react_dom_1 = require("react-dom");
|
|
7
8
|
// ============================================
|
|
8
9
|
// Styles
|
|
9
10
|
// ============================================
|
|
@@ -171,12 +172,15 @@ function ImageMetadataDialog({ isOpen, onClose, onSave, initialData, title = 'Pr
|
|
|
171
172
|
if (!isOpen)
|
|
172
173
|
return null;
|
|
173
174
|
const canSave = src.trim().length > 0;
|
|
174
|
-
|
|
175
|
+
// Use portal to render outside React tree - avoids Lexical capturing keyboard events
|
|
176
|
+
if (typeof document === 'undefined')
|
|
177
|
+
return null;
|
|
178
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)("div", { style: styles.overlay, onClick: onClose, children: (0, jsx_runtime_1.jsxs)("div", { style: styles.dialog, onClick: (e) => e.stopPropagation(), onKeyDown: (e) => e.stopPropagation(), children: [(0, jsx_runtime_1.jsx)("div", { style: styles.header, children: (0, jsx_runtime_1.jsx)("h3", { style: styles.headerTitle, children: title }) }), (0, jsx_runtime_1.jsxs)("div", { style: styles.content, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsxs)("label", { style: styles.label, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: styles.labelIcon, children: "link" }), "URL de l'image *"] }), (0, jsx_runtime_1.jsx)("input", { type: "url", value: src, onChange: (e) => {
|
|
175
179
|
setSrc(e.target.value);
|
|
176
180
|
setPreviewError(false);
|
|
177
181
|
}, placeholder: "https://example.com/image.jpg", style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur, onKeyDown: (e) => e.stopPropagation() })] }), src && !previewError && ((0, jsx_runtime_1.jsx)("img", { src: src, alt: "Preview", style: styles.preview, onError: () => setPreviewError(true) })), (0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsxs)("label", { style: styles.label, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: styles.labelIcon, children: "title" }), "Titre"] }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: imageTitle, onChange: (e) => setImageTitle(e.target.value), placeholder: "Titre de l'image", style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur, onKeyDown: (e) => e.stopPropagation() })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsxs)("label", { style: styles.label, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: styles.labelIcon, children: "description" }), "Texte alternatif"] }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: alt, onChange: (e) => setAlt(e.target.value), placeholder: "Description de l'image", style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur, onKeyDown: (e) => e.stopPropagation() })] }), (0, jsx_runtime_1.jsx)("hr", { style: styles.separator }), (0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsxs)("label", { style: styles.label, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: styles.labelIcon, children: "photo_camera" }), "Photographe"] }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: photographer, onChange: (e) => setPhotographer(e.target.value), placeholder: "Nom du photographe", style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur, onKeyDown: (e) => e.stopPropagation() })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsxs)("label", { style: styles.label, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: styles.labelIcon, children: "copyright" }), "Copyright"] }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: copyright, onChange: (e) => setCopyright(e.target.value), placeholder: "Ex: \u00A9 2024 Nom", style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur, onKeyDown: (e) => e.stopPropagation() })] }), (0, jsx_runtime_1.jsxs)("div", { style: { ...styles.field, marginBottom: 0 }, children: [(0, jsx_runtime_1.jsxs)("label", { style: styles.label, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: styles.labelIcon, children: "chat" }), "Commentaire / L\u00E9gende"] }), (0, jsx_runtime_1.jsx)("textarea", { value: comment, onChange: (e) => setComment(e.target.value), placeholder: "L\u00E9gende ou commentaire affich\u00E9 sous l'image", rows: 3, style: styles.textarea, onFocus: handleInputFocus, onBlur: handleInputBlur, onKeyDown: (e) => e.stopPropagation() })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.footer, children: [(0, jsx_runtime_1.jsx)("button", { onClick: onClose, style: styles.cancelButton, children: "Annuler" }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSave, disabled: !canSave, style: {
|
|
178
182
|
...styles.saveButton,
|
|
179
183
|
...(canSave ? {} : styles.saveButtonDisabled),
|
|
180
|
-
}, children: "Enregistrer" })] })] }) }));
|
|
184
|
+
}, children: "Enregistrer" })] })] }) }), document.body);
|
|
181
185
|
}
|
|
182
186
|
exports.default = ImageMetadataDialog;
|