@qwanyx/ai-editor 1.4.1 → 1.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"PageEditor.d.ts","sourceRoot":"","sources":["../../src/components/PageEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EAOb,MAAM,eAAe,CAAA;AAsrBtB,MAAM,WAAW,eAAe;IAC9B,eAAe,CAAC,EAAE,YAAY,CAAA;IAC9B,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,SAAgB,GACjB,EAAE,eAAe,2CAYjB;AAED,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"PageEditor.d.ts","sourceRoot":"","sources":["../../src/components/PageEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EAOb,MAAM,eAAe,CAAA;AAosBtB,MAAM,WAAW,eAAe;IAC9B,eAAe,CAAC,EAAE,YAAY,CAAA;IAC9B,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,SAAgB,GACjB,EAAE,eAAe,2CAYjB;AAED,eAAe,UAAU,CAAA"}
@@ -253,7 +253,7 @@ function SectionOptionsPanel() {
253
253
  }, children: section.layoutType })] }), section.layoutType === 'ogilvy' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Colonnes" }), (0, jsx_runtime_1.jsxs)("select", { value: content.columns || 2, onChange: (e) => handleContentChange('columns', Number(e.target.value)), style: styles.optionInput, children: [(0, jsx_runtime_1.jsx)("option", { value: 2, children: "2 colonnes" }), (0, jsx_runtime_1.jsx)("option", { value: 3, children: "3 colonnes" })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Hauteur (lignes)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: content.columnLines || '', onChange: (e) => handleContentChange('columnLines', e.target.value ? Number(e.target.value) : undefined), placeholder: "auto", min: 5, max: 100, style: styles.optionInput })] }), (0, jsx_runtime_1.jsx)("div", { style: styles.optionGroup, children: (0, jsx_runtime_1.jsxs)("label", { style: { ...styles.optionLabel, display: 'flex', alignItems: 'center', gap: '0.5rem' }, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: content.dropCap?.enabled || false, onChange: (e) => handleContentChange('dropCap', {
254
254
  ...(content.dropCap || {}),
255
255
  enabled: e.target.checked
256
- }) }), "Lettrine"] }) }), (0, jsx_runtime_1.jsx)("div", { style: styles.optionGroup, children: (0, jsx_runtime_1.jsxs)("label", { style: { ...styles.optionLabel, display: 'flex', alignItems: 'center', gap: '0.5rem' }, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: content.legendAsterisk || false, onChange: (e) => handleContentChange('legendAsterisk', e.target.checked) }), "Ast\u00E9risque (*)"] }) })] })), section.layoutType === 'gallery' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Mode d'affichage" }), (0, jsx_runtime_1.jsxs)("select", { value: content.layout || 'grid', onChange: (e) => handleContentChange('layout', e.target.value), style: styles.optionInput, children: [(0, jsx_runtime_1.jsx)("option", { value: "grid", children: "Grille (hauteur fixe)" }), (0, jsx_runtime_1.jsx)("option", { value: "masonry", children: "Masonry (hauteur variable)" })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Largeur des images (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: content.imageWidth || 200, onChange: (e) => handleContentChange('imageWidth', Number(e.target.value)), min: 50, max: 800, step: 10, style: styles.optionInput })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Alignement" }), (0, jsx_runtime_1.jsxs)("select", { value: content.alignment || 'left', onChange: (e) => handleContentChange('alignment', e.target.value), style: styles.optionInput, children: [(0, jsx_runtime_1.jsx)("option", { value: "left", children: "Gauche" }), (0, jsx_runtime_1.jsx)("option", { value: "center", children: "Centr\u00E9" }), (0, jsx_runtime_1.jsx)("option", { value: "right", children: "Droite" }), (0, jsx_runtime_1.jsx)("option", { value: "distribute", children: "Distribuer" })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Espacement (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: content.gap || 8, onChange: (e) => handleContentChange('gap', Number(e.target.value)), min: 0, max: 50, style: styles.optionInput })] }), (0, jsx_runtime_1.jsx)("div", { style: styles.optionGroup, children: (0, jsx_runtime_1.jsxs)("label", { style: { ...styles.optionLabel, display: 'flex', alignItems: 'center', gap: '0.5rem' }, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: content.showCaptions || false, onChange: (e) => handleContentChange('showCaptions', e.target.checked) }), "Afficher les l\u00E9gendes"] }) })] })), (0, jsx_runtime_1.jsx)("hr", { style: { margin: '1.5rem 0', border: 'none', borderTop: '1px solid #e9ecef' } }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Couleur de fond" }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionRow, children: [(0, jsx_runtime_1.jsx)("input", { type: "color", value: section.backgroundColor || '#ffffff', onChange: (e) => handleChange('backgroundColor', e.target.value), style: styles.colorInput }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: section.backgroundColor || '', onChange: (e) => handleChange('backgroundColor', e.target.value), placeholder: "transparent", style: { ...styles.optionInput, flex: 1 } }), (0, jsx_runtime_1.jsx)("button", { onClick: () => handleChange('backgroundColor', undefined), style: {
256
+ }) }), "Lettrine"] }) }), (0, jsx_runtime_1.jsx)("div", { style: styles.optionGroup, children: (0, jsx_runtime_1.jsxs)("label", { style: { ...styles.optionLabel, display: 'flex', alignItems: 'center', gap: '0.5rem' }, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: content.legendAsterisk || false, onChange: (e) => handleContentChange('legendAsterisk', e.target.checked) }), "Ast\u00E9risque (*)"] }) })] })), section.layoutType === 'gallery' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Mode d'affichage" }), (0, jsx_runtime_1.jsxs)("select", { value: content.layout || 'grid', onChange: (e) => handleContentChange('layout', e.target.value), style: styles.optionInput, children: [(0, jsx_runtime_1.jsx)("option", { value: "grid", children: "Grille (hauteur fixe)" }), (0, jsx_runtime_1.jsx)("option", { value: "masonry", children: "Masonry (largeur fixe)" })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Hauteur des images (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: content.imageHeight || 200, onChange: (e) => handleContentChange('imageHeight', Number(e.target.value)), min: 50, max: 800, step: 10, style: styles.optionInput })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Alignement galerie" }), (0, jsx_runtime_1.jsxs)("select", { value: content.alignment || 'left', onChange: (e) => handleContentChange('alignment', e.target.value), style: styles.optionInput, children: [(0, jsx_runtime_1.jsx)("option", { value: "left", children: "Gauche" }), (0, jsx_runtime_1.jsx)("option", { value: "center", children: "Centr\u00E9" }), (0, jsx_runtime_1.jsx)("option", { value: "right", children: "Droite" }), (0, jsx_runtime_1.jsx)("option", { value: "distribute", children: "Distribuer" })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Espacement (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: content.gap || 8, onChange: (e) => handleContentChange('gap', Number(e.target.value)), min: 0, max: 50, style: styles.optionInput })] }), (0, jsx_runtime_1.jsx)("div", { style: styles.optionGroup, children: (0, jsx_runtime_1.jsxs)("label", { style: { ...styles.optionLabel, display: 'flex', alignItems: 'center', gap: '0.5rem' }, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: content.showCaptions || false, onChange: (e) => handleContentChange('showCaptions', e.target.checked) }), "Afficher les l\u00E9gendes"] }) }), content.showCaptions && ((0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Alignement l\u00E9gendes" }), (0, jsx_runtime_1.jsxs)("select", { value: content.captionAlign || 'left', onChange: (e) => handleContentChange('captionAlign', e.target.value), style: styles.optionInput, children: [(0, jsx_runtime_1.jsx)("option", { value: "left", children: "Gauche" }), (0, jsx_runtime_1.jsx)("option", { value: "right", children: "Droite" })] })] }))] })), (0, jsx_runtime_1.jsx)("hr", { style: { margin: '1.5rem 0', border: 'none', borderTop: '1px solid #e9ecef' } }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Couleur de fond" }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionRow, children: [(0, jsx_runtime_1.jsx)("input", { type: "color", value: section.backgroundColor || '#ffffff', onChange: (e) => handleChange('backgroundColor', e.target.value), style: styles.colorInput }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: section.backgroundColor || '', onChange: (e) => handleChange('backgroundColor', e.target.value), placeholder: "transparent", style: { ...styles.optionInput, flex: 1 } }), (0, jsx_runtime_1.jsx)("button", { onClick: () => handleChange('backgroundColor', undefined), style: {
257
257
  padding: '0.5rem',
258
258
  border: '1px solid #ddd',
259
259
  borderRadius: '4px',
@@ -1 +1 @@
1
- {"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/GalleryLayout.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAgB,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAkB,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAyF9D,wBAAgB,2BAA2B,IAAI,cAAc,CAS5D;AAmPD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,eAAe,GAChB,EAAE,oBAAoB,CAAC,cAAc,CAAC,2CAiItC"}
1
+ {"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/GalleryLayout.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAgB,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAkB,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAwF9D,wBAAgB,2BAA2B,IAAI,cAAc,CAU5D;AA+PD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,eAAe,GAChB,EAAE,oBAAoB,CAAC,cAAc,CAAC,2CAyKtC"}
@@ -13,19 +13,23 @@ const styles = {
13
13
  container: {
14
14
  width: '100%',
15
15
  },
16
- // Grid layout
16
+ // Grid layout - flexbox with fixed height images
17
17
  gridContainer: {
18
18
  display: 'flex',
19
19
  flexWrap: 'wrap',
20
+ alignItems: 'flex-start',
20
21
  },
21
- gridItem: {
22
- overflow: 'hidden',
22
+ // Image wrapper
23
+ imageWrapper: {
24
+ position: 'relative',
25
+ display: 'inline-block',
23
26
  },
27
+ // Image styles - fixed height, auto width (maintains aspect ratio)
24
28
  gridImage: {
25
- width: '100%',
26
29
  height: '100%',
27
- objectFit: 'cover',
30
+ width: 'auto',
28
31
  display: 'block',
32
+ objectFit: 'contain',
29
33
  },
30
34
  // Masonry layout
31
35
  masonryContainer: {
@@ -33,20 +37,18 @@ const styles = {
33
37
  },
34
38
  masonryItem: {
35
39
  breakInside: 'avoid',
36
- marginBottom: '8px',
37
40
  },
38
41
  masonryImage: {
39
42
  width: '100%',
40
43
  height: 'auto',
41
44
  display: 'block',
42
45
  },
43
- // Caption
46
+ // Caption - close to image
44
47
  caption: {
45
- fontSize: '0.75rem',
48
+ fontSize: '0.7rem',
46
49
  color: '#666',
47
- textAlign: 'center',
48
- padding: '4px 0',
49
- backgroundColor: 'rgba(255,255,255,0.9)',
50
+ padding: '2px 0',
51
+ lineHeight: 1.3,
50
52
  },
51
53
  // Edit mode
52
54
  addButton: {
@@ -83,9 +85,6 @@ const styles = {
83
85
  cursor: 'pointer',
84
86
  margin: '0 2px',
85
87
  },
86
- imageWrapper: {
87
- position: 'relative',
88
- },
89
88
  };
90
89
  // ============================================
91
90
  // Default Content
@@ -93,11 +92,12 @@ const styles = {
93
92
  function createDefaultGalleryContent() {
94
93
  return {
95
94
  images: [],
96
- imageWidth: 200,
95
+ imageHeight: 200,
97
96
  layout: 'grid',
98
97
  alignment: 'left',
99
98
  gap: 8,
100
99
  showCaptions: false,
100
+ captionAlign: 'left',
101
101
  };
102
102
  }
103
103
  // ============================================
@@ -117,9 +117,15 @@ function getAlignmentStyle(alignment) {
117
117
  return { justifyContent: 'flex-start' };
118
118
  }
119
119
  }
120
- function ImageItem({ image, index, isEditing, showCaption, onDelete, onEdit, style, imageStyle, }) {
120
+ function ImageItem({ image, index, isEditing, showCaption, captionAlign, imageHeight, onDelete, onEdit, containerStyle, }) {
121
121
  const [isHovered, setIsHovered] = (0, react_1.useState)(false);
122
- return ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.imageWrapper, ...style }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [(0, jsx_runtime_1.jsx)("img", { src: image.src, alt: image.alt || '', style: imageStyle }), showCaption && image.caption && ((0, jsx_runtime_1.jsx)("div", { style: styles.caption, children: image.caption })), isEditing && ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.editOverlay, opacity: isHovered ? 1 : 0 }, children: [(0, jsx_runtime_1.jsx)("button", { style: styles.editButton, onClick: () => onEdit(index), title: "Modifier", children: "\u270F\uFE0F" }), (0, jsx_runtime_1.jsx)("button", { style: styles.editButton, onClick: () => onDelete(index), title: "Supprimer", children: "\uD83D\uDDD1\uFE0F" })] }))] }));
122
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.imageWrapper, ...containerStyle }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [(0, jsx_runtime_1.jsx)("img", { src: image.src, alt: image.alt || '', style: {
123
+ ...styles.gridImage,
124
+ height: `${imageHeight}px`,
125
+ } }), showCaption && image.caption && ((0, jsx_runtime_1.jsx)("div", { style: {
126
+ ...styles.caption,
127
+ textAlign: captionAlign,
128
+ }, children: image.caption })), isEditing && ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.editOverlay, opacity: isHovered ? 1 : 0 }, children: [(0, jsx_runtime_1.jsx)("button", { style: styles.editButton, onClick: () => onEdit(index), title: "Modifier", children: "\u270F\uFE0F" }), (0, jsx_runtime_1.jsx)("button", { style: styles.editButton, onClick: () => onDelete(index), title: "Supprimer", children: "\uD83D\uDDD1\uFE0F" })] }))] }));
123
129
  }
124
130
  function AddImageDialog({ onAdd, onClose, editImage }) {
125
131
  const [url, setUrl] = (0, react_1.useState)(editImage?.src || '');
@@ -193,7 +199,8 @@ function GalleryLayout({ section, isEditing, onContentChange, }) {
193
199
  const [showAddDialog, setShowAddDialog] = (0, react_1.useState)(false);
194
200
  const [editingIndex, setEditingIndex] = (0, react_1.useState)(null);
195
201
  const gap = content.gap || 8;
196
- const imageWidth = content.imageWidth || 200;
202
+ const imageHeight = content.imageHeight || 200;
203
+ const captionAlign = content.captionAlign || 'left';
197
204
  const handleAddImage = (0, react_1.useCallback)((image) => {
198
205
  if (editingIndex !== null) {
199
206
  // Editing existing image
@@ -216,30 +223,38 @@ function GalleryLayout({ section, isEditing, onContentChange, }) {
216
223
  setEditingIndex(index);
217
224
  setShowAddDialog(true);
218
225
  }, []);
219
- // Grid Layout
226
+ // Grid Layout - fixed height, variable width (aspect ratio preserved)
220
227
  const renderGrid = () => ((0, jsx_runtime_1.jsx)("div", { style: {
221
228
  ...styles.gridContainer,
222
229
  gap: `${gap}px`,
223
230
  ...getAlignmentStyle(content.alignment),
224
- }, children: content.images.map((image, index) => ((0, jsx_runtime_1.jsx)(ImageItem, { image: image, index: index, isEditing: isEditing, showCaption: content.showCaptions || false, onDelete: handleDeleteImage, onEdit: handleEditImage, style: {
225
- ...styles.gridItem,
226
- width: `${imageWidth}px`,
227
- height: `${imageWidth}px`,
228
- }, imageStyle: styles.gridImage }, index))) }));
229
- // Masonry Layout
230
- const renderMasonry = () => {
231
- // Calculate column count based on container width
232
- // We'll use CSS columns for true masonry effect
233
- const columnWidth = imageWidth + gap;
234
- return ((0, jsx_runtime_1.jsx)("div", { style: {
235
- ...styles.masonryContainer,
236
- columnWidth: `${imageWidth}px`,
237
- columnGap: `${gap}px`,
238
- }, children: content.images.map((image, index) => ((0, jsx_runtime_1.jsx)(ImageItem, { image: image, index: index, isEditing: isEditing, showCaption: content.showCaptions || false, onDelete: handleDeleteImage, onEdit: handleEditImage, style: {
239
- ...styles.masonryItem,
240
- marginBottom: `${gap}px`,
241
- }, imageStyle: styles.masonryImage }, index))) }));
242
- };
231
+ }, children: content.images.map((image, index) => ((0, jsx_runtime_1.jsx)(ImageItem, { image: image, index: index, isEditing: isEditing, showCaption: content.showCaptions || false, captionAlign: captionAlign, imageHeight: imageHeight, onDelete: handleDeleteImage, onEdit: handleEditImage }, index))) }));
232
+ // Masonry Layout - CSS columns
233
+ const renderMasonry = () => ((0, jsx_runtime_1.jsx)("div", { style: {
234
+ ...styles.masonryContainer,
235
+ columnWidth: `${imageHeight * 1.5}px`, // Estimate based on typical aspect ratio
236
+ columnGap: `${gap}px`,
237
+ }, children: content.images.map((image, index) => ((0, jsx_runtime_1.jsx)("div", { style: {
238
+ ...styles.masonryItem,
239
+ marginBottom: `${gap}px`,
240
+ }, children: (0, jsx_runtime_1.jsxs)("div", { style: styles.imageWrapper, onMouseEnter: () => { }, onMouseLeave: () => { }, children: [(0, jsx_runtime_1.jsx)("img", { src: image.src, alt: image.alt || '', style: styles.masonryImage }), content.showCaptions && image.caption && ((0, jsx_runtime_1.jsx)("div", { style: {
241
+ ...styles.caption,
242
+ textAlign: captionAlign,
243
+ }, children: image.caption })), isEditing && ((0, jsx_runtime_1.jsxs)("div", { style: {
244
+ position: 'absolute',
245
+ top: '4px',
246
+ right: '4px',
247
+ display: 'flex',
248
+ gap: '2px',
249
+ }, children: [(0, jsx_runtime_1.jsx)("button", { style: {
250
+ ...styles.editButton,
251
+ padding: '0.25rem',
252
+ fontSize: '0.75rem',
253
+ }, onClick: () => handleEditImage(index), title: "Modifier", children: "\u270F\uFE0F" }), (0, jsx_runtime_1.jsx)("button", { style: {
254
+ ...styles.editButton,
255
+ padding: '0.25rem',
256
+ fontSize: '0.75rem',
257
+ }, onClick: () => handleDeleteImage(index), title: "Supprimer", children: "\uD83D\uDDD1\uFE0F" })] }))] }) }, index))) }));
243
258
  return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [content.images.length === 0 && !isEditing ? ((0, jsx_runtime_1.jsx)("div", { style: { textAlign: 'center', padding: '2rem', color: '#999' }, children: "Aucune image" })) : (content.layout === 'masonry' ? renderMasonry() : renderGrid()), isEditing && ((0, jsx_runtime_1.jsx)("div", { style: styles.addButton, onClick: () => {
244
259
  setEditingIndex(null);
245
260
  setShowAddDialog(true);
@@ -254,7 +269,7 @@ function GalleryLayout({ section, isEditing, onContentChange, }) {
254
269
  (0, index_1.registerLayout)({
255
270
  type: 'gallery',
256
271
  name: 'Galerie',
257
- description: 'Grille d\'images responsive avec modes grid et masonry',
272
+ description: 'Galerie d\'images à hauteur fixe (ratio préservé)',
258
273
  icon: '🖼️',
259
274
  component: GalleryLayout,
260
275
  defaultContent: createDefaultGalleryContent,
@@ -66,11 +66,12 @@ export interface OgilvyContent {
66
66
  }
67
67
  export interface GalleryContent {
68
68
  images: GalleryImage[];
69
- imageWidth: number;
69
+ imageHeight: number;
70
70
  layout: 'grid' | 'masonry';
71
71
  alignment: 'left' | 'center' | 'right' | 'distribute';
72
72
  gap?: number;
73
73
  showCaptions?: boolean;
74
+ captionAlign?: 'left' | 'right';
74
75
  }
75
76
  export interface GalleryImage {
76
77
  src: string;
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/types/page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAGD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAKnD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAOnD,CA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AAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAMD,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC7B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,CAAC,EACV,SAAS,CAAC,EAAE,gBAAgB,GAC3B,OAAO,CAAC,CAAC,CAAC,CAOZ;AAED,wBAAgB,eAAe,CAAC,MAAM,GAAE,UAAkB,GAAG,YAAY,CAQxE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwanyx/ai-editor",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "AI-powered WYSIWYG rich text editor",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",