@qwanyx/ai-editor 1.4.6 → 1.5.0
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/dist/components/PaddingEditor.d.ts +11 -0
- package/dist/components/PaddingEditor.d.ts.map +1 -0
- package/dist/components/PaddingEditor.js +185 -0
- package/dist/components/PageEditor.d.ts.map +1 -1
- package/dist/components/PageEditor.js +88 -35
- package/dist/components/Section.d.ts.map +1 -1
- package/dist/components/Section.js +16 -5
- package/dist/components/SectionOptionsModal.d.ts +11 -0
- package/dist/components/SectionOptionsModal.d.ts.map +1 -0
- package/dist/components/SectionOptionsModal.js +277 -0
- package/dist/context/PageContext.d.ts +5 -1
- package/dist/context/PageContext.d.ts.map +1 -1
- package/dist/context/PageContext.js +47 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/layouts/GalleryLayout.d.ts.map +1 -1
- package/dist/layouts/GalleryLayout.js +3 -5
- package/dist/types/page.d.ts +18 -0
- package/dist/types/page.d.ts.map +1 -1
- package/dist/types/page.js +9 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PaddingValues } from '../types/page';
|
|
2
|
+
export type { PaddingValues };
|
|
3
|
+
export interface PaddingEditorProps {
|
|
4
|
+
value: PaddingValues | string | undefined;
|
|
5
|
+
onChange: (value: PaddingValues) => void;
|
|
6
|
+
unit?: 'px' | 'rem';
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function PaddingEditor({ value, onChange, unit, label }: PaddingEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default PaddingEditor;
|
|
11
|
+
//# sourceMappingURL=PaddingEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaddingEditor.d.ts","sourceRoot":"","sources":["../../src/components/PaddingEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAM7C,YAAY,EAAE,aAAa,EAAE,CAAA;AAE7B,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAAA;IACzC,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IACxC,IAAI,CAAC,EAAE,IAAI,GAAG,KAAK,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AA2HD,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAW,EAAE,KAAK,EAAE,EAAE,kBAAkB,2CA0JxF;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PaddingEditor = PaddingEditor;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
// ============================================
|
|
8
|
+
// Styles
|
|
9
|
+
// ============================================
|
|
10
|
+
const styles = {
|
|
11
|
+
container: {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexDirection: 'column',
|
|
14
|
+
gap: '8px',
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
fontSize: '14px',
|
|
18
|
+
fontWeight: 500,
|
|
19
|
+
color: '#374151',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
gap: '8px',
|
|
23
|
+
},
|
|
24
|
+
editorWrapper: {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
gap: '12px',
|
|
28
|
+
},
|
|
29
|
+
visualEditor: {
|
|
30
|
+
width: '120px',
|
|
31
|
+
height: '80px',
|
|
32
|
+
position: 'relative',
|
|
33
|
+
backgroundColor: '#f3f4f6',
|
|
34
|
+
borderRadius: '4px',
|
|
35
|
+
border: '1px solid #d1d5db',
|
|
36
|
+
},
|
|
37
|
+
innerBox: {
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
backgroundColor: '#dbeafe',
|
|
40
|
+
border: '1px dashed #3b82f6',
|
|
41
|
+
borderRadius: '2px',
|
|
42
|
+
display: 'flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
fontSize: '10px',
|
|
46
|
+
color: '#6b7280',
|
|
47
|
+
},
|
|
48
|
+
inputsGrid: {
|
|
49
|
+
display: 'grid',
|
|
50
|
+
gridTemplateColumns: '1fr 1fr',
|
|
51
|
+
gridTemplateRows: '1fr 1fr',
|
|
52
|
+
gap: '8px',
|
|
53
|
+
flex: 1,
|
|
54
|
+
},
|
|
55
|
+
inputGroup: {
|
|
56
|
+
display: 'flex',
|
|
57
|
+
flexDirection: 'column',
|
|
58
|
+
gap: '2px',
|
|
59
|
+
},
|
|
60
|
+
inputLabel: {
|
|
61
|
+
fontSize: '10px',
|
|
62
|
+
color: '#6b7280',
|
|
63
|
+
textTransform: 'uppercase',
|
|
64
|
+
letterSpacing: '0.5px',
|
|
65
|
+
},
|
|
66
|
+
input: {
|
|
67
|
+
width: '100%',
|
|
68
|
+
padding: '6px 8px',
|
|
69
|
+
border: '1px solid #d1d5db',
|
|
70
|
+
borderRadius: '4px',
|
|
71
|
+
fontSize: '13px',
|
|
72
|
+
boxSizing: 'border-box',
|
|
73
|
+
outline: 'none',
|
|
74
|
+
},
|
|
75
|
+
linkButton: {
|
|
76
|
+
padding: '4px 8px',
|
|
77
|
+
border: '1px solid #d1d5db',
|
|
78
|
+
borderRadius: '4px',
|
|
79
|
+
backgroundColor: 'white',
|
|
80
|
+
cursor: 'pointer',
|
|
81
|
+
fontSize: '12px',
|
|
82
|
+
display: 'flex',
|
|
83
|
+
alignItems: 'center',
|
|
84
|
+
justifyContent: 'center',
|
|
85
|
+
color: '#6b7280',
|
|
86
|
+
},
|
|
87
|
+
linkButtonActive: {
|
|
88
|
+
backgroundColor: '#eff6ff',
|
|
89
|
+
borderColor: '#3b82f6',
|
|
90
|
+
color: '#3b82f6',
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
// ============================================
|
|
94
|
+
// Helper Functions
|
|
95
|
+
// ============================================
|
|
96
|
+
function parsePaddingString(value) {
|
|
97
|
+
if (!value)
|
|
98
|
+
return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
99
|
+
// Remove 'px' or 'rem' and split
|
|
100
|
+
const parts = value.replace(/px|rem/g, '').trim().split(/\s+/).map(Number);
|
|
101
|
+
if (parts.length === 1) {
|
|
102
|
+
return { top: parts[0], right: parts[0], bottom: parts[0], left: parts[0] };
|
|
103
|
+
}
|
|
104
|
+
else if (parts.length === 2) {
|
|
105
|
+
return { top: parts[0], right: parts[1], bottom: parts[0], left: parts[1] };
|
|
106
|
+
}
|
|
107
|
+
else if (parts.length === 3) {
|
|
108
|
+
return { top: parts[0], right: parts[1], bottom: parts[2], left: parts[1] };
|
|
109
|
+
}
|
|
110
|
+
else if (parts.length >= 4) {
|
|
111
|
+
return { top: parts[0], right: parts[1], bottom: parts[2], left: parts[3] };
|
|
112
|
+
}
|
|
113
|
+
return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
114
|
+
}
|
|
115
|
+
function normalizePadding(value) {
|
|
116
|
+
if (!value)
|
|
117
|
+
return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
118
|
+
if (typeof value === 'string')
|
|
119
|
+
return parsePaddingString(value);
|
|
120
|
+
return value;
|
|
121
|
+
}
|
|
122
|
+
// ============================================
|
|
123
|
+
// Component
|
|
124
|
+
// ============================================
|
|
125
|
+
function PaddingEditor({ value, onChange, unit = 'px', label }) {
|
|
126
|
+
const [padding, setPadding] = (0, react_1.useState)(() => normalizePadding(value));
|
|
127
|
+
const [linked, setLinked] = (0, react_1.useState)(false);
|
|
128
|
+
// Update internal state when value prop changes
|
|
129
|
+
(0, react_1.useEffect)(() => {
|
|
130
|
+
setPadding(normalizePadding(value));
|
|
131
|
+
}, [value]);
|
|
132
|
+
// Check if all values are equal for linked state
|
|
133
|
+
(0, react_1.useEffect)(() => {
|
|
134
|
+
const allEqual = padding.top === padding.right &&
|
|
135
|
+
padding.right === padding.bottom &&
|
|
136
|
+
padding.bottom === padding.left;
|
|
137
|
+
setLinked(allEqual && padding.top > 0);
|
|
138
|
+
}, [padding]);
|
|
139
|
+
const handleChange = (0, react_1.useCallback)((side, newValue) => {
|
|
140
|
+
let newPadding;
|
|
141
|
+
if (linked) {
|
|
142
|
+
// When linked, update all values
|
|
143
|
+
newPadding = { top: newValue, right: newValue, bottom: newValue, left: newValue };
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
newPadding = { ...padding, [side]: newValue };
|
|
147
|
+
}
|
|
148
|
+
setPadding(newPadding);
|
|
149
|
+
onChange(newPadding);
|
|
150
|
+
}, [linked, padding, onChange]);
|
|
151
|
+
const toggleLinked = (0, react_1.useCallback)(() => {
|
|
152
|
+
if (!linked) {
|
|
153
|
+
// When linking, set all values to the max of current values
|
|
154
|
+
const maxValue = Math.max(padding.top, padding.right, padding.bottom, padding.left);
|
|
155
|
+
const newPadding = { top: maxValue, right: maxValue, bottom: maxValue, left: maxValue };
|
|
156
|
+
setPadding(newPadding);
|
|
157
|
+
onChange(newPadding);
|
|
158
|
+
}
|
|
159
|
+
setLinked(!linked);
|
|
160
|
+
}, [linked, padding, onChange]);
|
|
161
|
+
// Calculate visual representation
|
|
162
|
+
const scale = 0.3;
|
|
163
|
+
const maxPadding = Math.max(padding.top, padding.right, padding.bottom, padding.left, 20);
|
|
164
|
+
const visualTop = Math.min((padding.top / maxPadding) * 25, 25);
|
|
165
|
+
const visualRight = Math.min((padding.right / maxPadding) * 30, 30);
|
|
166
|
+
const visualBottom = Math.min((padding.bottom / maxPadding) * 25, 25);
|
|
167
|
+
const visualLeft = Math.min((padding.left / maxPadding) * 30, 30);
|
|
168
|
+
const handleInputFocus = (e) => {
|
|
169
|
+
e.target.style.borderColor = '#3b82f6';
|
|
170
|
+
};
|
|
171
|
+
const handleInputBlur = (e) => {
|
|
172
|
+
e.target.style.borderColor = '#d1d5db';
|
|
173
|
+
};
|
|
174
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [label && ((0, jsx_runtime_1.jsxs)("label", { style: styles.label, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px', color: '#6b7280' }, children: "padding" }), label] })), (0, jsx_runtime_1.jsxs)("div", { style: styles.editorWrapper, children: [(0, jsx_runtime_1.jsx)("div", { style: styles.visualEditor, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
175
|
+
...styles.innerBox,
|
|
176
|
+
top: `${visualTop + 4}px`,
|
|
177
|
+
right: `${visualRight + 4}px`,
|
|
178
|
+
bottom: `${visualBottom + 4}px`,
|
|
179
|
+
left: `${visualLeft + 4}px`,
|
|
180
|
+
}, children: "contenu" }) }), (0, jsx_runtime_1.jsxs)("div", { style: styles.inputsGrid, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.inputGroup, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.inputLabel, children: "Haut" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: padding.top, onChange: (e) => handleChange('top', parseInt(e.target.value) || 0), min: 0, style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.inputGroup, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.inputLabel, children: "Droite" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: padding.right, onChange: (e) => handleChange('right', parseInt(e.target.value) || 0), min: 0, style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.inputGroup, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.inputLabel, children: "Bas" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: padding.bottom, onChange: (e) => handleChange('bottom', parseInt(e.target.value) || 0), min: 0, style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.inputGroup, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.inputLabel, children: "Gauche" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: padding.left, onChange: (e) => handleChange('left', parseInt(e.target.value) || 0), min: 0, style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur })] })] }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: toggleLinked, style: {
|
|
181
|
+
...styles.linkButton,
|
|
182
|
+
...(linked ? styles.linkButtonActive : {}),
|
|
183
|
+
}, title: linked ? 'Valeurs liées' : 'Lier les valeurs', children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '16px' }, children: linked ? 'link' : 'link_off' }) })] })] }));
|
|
184
|
+
}
|
|
185
|
+
exports.default = PaddingEditor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageEditor.d.ts","sourceRoot":"","sources":["../../src/components/PageEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"PageEditor.d.ts","sourceRoot":"","sources":["../../src/components/PageEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EAUb,MAAM,eAAe,CAAA;AAgsBtB,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,10 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
37
|
exports.PageEditor = PageEditor;
|
|
5
38
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const react_1 = require("react");
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
7
40
|
const page_1 = require("../types/page");
|
|
41
|
+
const PaddingEditor_1 = require("./PaddingEditor");
|
|
8
42
|
const PageContext_1 = require("../context/PageContext");
|
|
9
43
|
const Section_1 = require("./Section");
|
|
10
44
|
const layouts_1 = require("../layouts");
|
|
@@ -227,47 +261,57 @@ function LayoutPicker({ onSelect, onClose }) {
|
|
|
227
261
|
}, children: "Annuler" }) })] }) }));
|
|
228
262
|
}
|
|
229
263
|
// ============================================
|
|
230
|
-
//
|
|
264
|
+
// Page Options Panel (page-level settings)
|
|
231
265
|
// ============================================
|
|
232
|
-
function
|
|
233
|
-
const {
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
266
|
+
function PageOptionsPanel() {
|
|
267
|
+
const { document, setSectionGap, setSeparator, setPagePadding, setBackgroundColor, } = (0, PageContext_1.usePageContext)();
|
|
268
|
+
const separator = document.separator || page_1.DEFAULT_SEPARATOR;
|
|
269
|
+
const sectionGap = document.sectionGap ?? 16;
|
|
270
|
+
// Parse padding to PaddingValues
|
|
271
|
+
const parsePadding = (value) => {
|
|
272
|
+
if (!value)
|
|
273
|
+
return { top: 16, right: 16, bottom: 16, left: 16 };
|
|
274
|
+
if (typeof value === 'object')
|
|
275
|
+
return value;
|
|
276
|
+
const parts = value.replace(/px|rem/g, '').trim().split(/\s+/).map(Number);
|
|
277
|
+
if (parts.length === 1)
|
|
278
|
+
return { top: parts[0], right: parts[0], bottom: parts[0], left: parts[0] };
|
|
279
|
+
if (parts.length === 2)
|
|
280
|
+
return { top: parts[0], right: parts[1], bottom: parts[0], left: parts[1] };
|
|
281
|
+
if (parts.length === 4)
|
|
282
|
+
return { top: parts[0], right: parts[1], bottom: parts[2], left: parts[3] };
|
|
283
|
+
return { top: 16, right: 16, bottom: 16, left: 16 };
|
|
240
284
|
};
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
const newContent = { ...section.content, [key]: value };
|
|
244
|
-
updateSection(selectedSectionId, newContent);
|
|
285
|
+
const handlePaddingChange = (padding) => {
|
|
286
|
+
setPagePadding(padding);
|
|
245
287
|
};
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}, 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', {
|
|
255
|
-
...(content.dropCap || {}),
|
|
256
|
-
enabled: e.target.checked
|
|
257
|
-
}) }), "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: {
|
|
288
|
+
const handleSeparatorChange = (key, value) => {
|
|
289
|
+
setSeparator({ [key]: value });
|
|
290
|
+
};
|
|
291
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.optionsPanel, children: [(0, jsx_runtime_1.jsxs)("h3", { style: { marginBottom: '1.5rem', fontSize: '1.125rem', display: 'flex', alignItems: 'center', gap: '8px' }, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '20px' }, children: "settings" }), "Options de la page"] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsxs)("label", { style: styles.optionLabel, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '16px', marginRight: '6px', color: '#666' }, children: "height" }), "Espacement entre sections (px)"] }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: sectionGap, onChange: (e) => setSectionGap(Number(e.target.value)), min: 0, max: 100, style: styles.optionInput })] }), (0, jsx_runtime_1.jsx)("hr", { style: { margin: '1.5rem 0', border: 'none', borderTop: '1px solid #e9ecef' } }), (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', cursor: 'pointer' }, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: separator.enabled, onChange: (e) => handleSeparatorChange('enabled', e.target.checked) }), (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '16px', color: '#666' }, children: "horizontal_rule" }), "Separateur entre sections"] }) }), separator.enabled && ((0, jsx_runtime_1.jsxs)("div", { style: { marginLeft: '1.5rem', marginBottom: '1rem' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Epaisseur (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: separator.thickness, onChange: (e) => handleSeparatorChange('thickness', Number(e.target.value)), min: 1, max: 10, style: styles.optionInput })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Couleur" }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionRow, children: [(0, jsx_runtime_1.jsx)("input", { type: "color", value: separator.color, onChange: (e) => handleSeparatorChange('color', e.target.value), style: styles.colorInput }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: separator.color, onChange: (e) => handleSeparatorChange('color', e.target.value), style: { ...styles.optionInput, flex: 1 } })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Style" }), (0, jsx_runtime_1.jsxs)("select", { value: separator.style, onChange: (e) => handleSeparatorChange('style', e.target.value), style: styles.optionInput, children: [(0, jsx_runtime_1.jsx)("option", { value: "solid", children: "Solide" }), (0, jsx_runtime_1.jsx)("option", { value: "dashed", children: "Tirets" }), (0, jsx_runtime_1.jsx)("option", { value: "dotted", children: "Points" }), (0, jsx_runtime_1.jsx)("option", { value: "double", children: "Double" })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Largeur" }), (0, jsx_runtime_1.jsxs)("select", { value: separator.width, onChange: (e) => handleSeparatorChange('width', e.target.value), style: styles.optionInput, children: [(0, jsx_runtime_1.jsx)("option", { value: "full", children: "Pleine largeur" }), (0, jsx_runtime_1.jsx)("option", { value: "partial", children: "Partielle (avec marges)" })] })] }), separator.width === 'partial' && ((0, jsx_runtime_1.jsxs)("div", { style: styles.optionGroup, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.optionLabel, children: "Marge laterale (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: separator.margin || 40, onChange: (e) => handleSeparatorChange('margin', Number(e.target.value)), min: 0, max: 200, style: styles.optionInput })] })), (0, jsx_runtime_1.jsxs)("div", { style: { marginTop: '12px', padding: '8px', backgroundColor: '#f9fafb', borderRadius: '4px' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { fontSize: '11px', color: '#6b7280', marginBottom: '8px' }, children: "Apercu:" }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
292
|
+
borderTop: `${separator.thickness}px ${separator.style} ${separator.color}`,
|
|
293
|
+
marginLeft: separator.width === 'partial' ? `${separator.margin || 40}px` : 0,
|
|
294
|
+
marginRight: separator.width === 'partial' ? `${separator.margin || 40}px` : 0,
|
|
295
|
+
} })] })] })), (0, jsx_runtime_1.jsx)("hr", { style: { margin: '1.5rem 0', border: 'none', borderTop: '1px solid #e9ecef' } }), (0, jsx_runtime_1.jsx)("div", { style: styles.optionGroup, children: (0, jsx_runtime_1.jsx)(PaddingEditor_1.PaddingEditor, { value: parsePadding(document.padding), onChange: handlePaddingChange, label: "Padding de la page" }) }), (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.jsxs)("label", { style: styles.optionLabel, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '16px', marginRight: '6px', color: '#666' }, children: "format_color_fill" }), "Couleur de fond"] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.optionRow, children: [(0, jsx_runtime_1.jsx)("input", { type: "color", value: document.backgroundColor || '#ffffff', onChange: (e) => setBackgroundColor(e.target.value), style: styles.colorInput }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: document.backgroundColor || '', onChange: (e) => setBackgroundColor(e.target.value), placeholder: "transparent", style: { ...styles.optionInput, flex: 1 } }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setBackgroundColor(undefined), style: {
|
|
258
296
|
padding: '0.5rem',
|
|
259
297
|
border: '1px solid #ddd',
|
|
260
298
|
borderRadius: '4px',
|
|
261
299
|
backgroundColor: 'white',
|
|
262
300
|
cursor: 'pointer',
|
|
263
301
|
fontSize: '0.75rem',
|
|
264
|
-
}, children: "Reset" })] })] }), (0, jsx_runtime_1.jsxs)("div", { style:
|
|
302
|
+
}, children: "Reset" })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
303
|
+
marginTop: '2rem',
|
|
304
|
+
padding: '1rem',
|
|
305
|
+
backgroundColor: '#f0f9ff',
|
|
306
|
+
borderRadius: '8px',
|
|
307
|
+
border: '1px solid #bae6fd',
|
|
308
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '8px' }, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px', color: '#0284c7' }, children: "info" }), (0, jsx_runtime_1.jsx)("span", { style: { fontWeight: 500, color: '#0369a1' }, children: "Options des sections" })] }), (0, jsx_runtime_1.jsxs)("p", { style: { margin: 0, fontSize: '0.875rem', color: '#0369a1' }, children: ["Pour modifier les options d'une section specifique, double-cliquez sur sa barre d'outils ou cliquez sur l'icone ", (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '14px', verticalAlign: 'middle' }, children: "tune" })] })] })] }));
|
|
265
309
|
}
|
|
266
310
|
// ============================================
|
|
267
311
|
// Page Editor Inner (with context)
|
|
268
312
|
// ============================================
|
|
269
313
|
function PageEditorInner() {
|
|
270
|
-
const { document, isEditing,
|
|
314
|
+
const { document, isEditing, setFormat, addSection, } = (0, PageContext_1.usePageContext)();
|
|
271
315
|
const [activeTab, setActiveTab] = (0, react_1.useState)('edition');
|
|
272
316
|
const [showLayoutPicker, setShowLayoutPicker] = (0, react_1.useState)(false);
|
|
273
317
|
const handleAddSection = (0, react_1.useCallback)((layoutType) => {
|
|
@@ -280,14 +324,23 @@ function PageEditorInner() {
|
|
|
280
324
|
const handleFormatChange = (0, react_1.useCallback)((e) => {
|
|
281
325
|
setFormat(e.target.value);
|
|
282
326
|
}, [setFormat]);
|
|
283
|
-
// Auto-select first section when switching to options tab
|
|
284
|
-
(0, react_1.useEffect)(() => {
|
|
285
|
-
if (activeTab === 'options' && !selectedSectionId && document.sections.length > 0) {
|
|
286
|
-
selectSection(document.sections[0].id);
|
|
287
|
-
}
|
|
288
|
-
}, [activeTab, selectedSectionId, document.sections, selectSection]);
|
|
289
327
|
const isPreviewMode = activeTab === 'preview';
|
|
290
|
-
|
|
328
|
+
// Compute page container styles based on document settings
|
|
329
|
+
const sectionGap = document.sectionGap ?? 16;
|
|
330
|
+
const pagePadding = document.padding;
|
|
331
|
+
const separator = document.separator;
|
|
332
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.tabBar, children: [(0, jsx_runtime_1.jsx)(TabButton, { label: "\u00C9dition", isActive: activeTab === 'edition', onClick: () => setActiveTab('edition') }), (0, jsx_runtime_1.jsx)(TabButton, { label: "Pr\u00E9visualisation", isActive: activeTab === 'preview', onClick: () => setActiveTab('preview') }), (0, jsx_runtime_1.jsx)(TabButton, { label: "Options", isActive: activeTab === 'options', onClick: () => setActiveTab('options') })] }), activeTab === 'edition' && isEditing && ((0, jsx_runtime_1.jsxs)("div", { style: styles.toolbar, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.toolbarGroup, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.toolbarLabel, children: "Format:" }), (0, jsx_runtime_1.jsxs)("select", { value: document.format, onChange: handleFormatChange, style: styles.select, children: [(0, jsx_runtime_1.jsx)("option", { value: "web", children: "Web (scroll infini)" }), (0, jsx_runtime_1.jsx)("option", { value: "print", children: "Print (A4, Letter...)" }), (0, jsx_runtime_1.jsx)("option", { value: "video", children: "Video / Pr\u00E9sentation" })] })] }), document.format === 'print' && ((0, jsx_runtime_1.jsxs)("div", { style: styles.toolbarGroup, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.toolbarLabel, children: "Taille:" }), (0, jsx_runtime_1.jsx)("select", { style: styles.select, children: Object.entries(page_1.PRINT_PRESETS).map(([key, preset]) => ((0, jsx_runtime_1.jsx)("option", { value: key, children: preset.name }, key))) })] })), document.format === 'video' && ((0, jsx_runtime_1.jsxs)("div", { style: styles.toolbarGroup, children: [(0, jsx_runtime_1.jsx)("span", { style: styles.toolbarLabel, children: "Taille:" }), (0, jsx_runtime_1.jsx)("select", { style: styles.select, children: Object.entries(page_1.VIDEO_PRESETS).map(([key, preset]) => ((0, jsx_runtime_1.jsx)("option", { value: key, children: preset.name }, key))) })] })), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 } }), (0, jsx_runtime_1.jsx)("button", { style: styles.addButton, onClick: () => setShowLayoutPicker(true), children: "+ Ajouter une section" })] })), (0, jsx_runtime_1.jsx)("div", { style: styles.content, children: activeTab === 'options' ? ((0, jsx_runtime_1.jsx)(PageOptionsPanel, {})) : ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
333
|
+
...styles.pageContainer,
|
|
334
|
+
backgroundColor: document.backgroundColor || undefined,
|
|
335
|
+
padding: typeof pagePadding === 'object'
|
|
336
|
+
? `${pagePadding.top}px ${pagePadding.right}px ${pagePadding.bottom}px ${pagePadding.left}px`
|
|
337
|
+
: pagePadding || '1rem',
|
|
338
|
+
}, children: document.sections.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { style: styles.emptyState, children: [(0, jsx_runtime_1.jsx)("div", { style: styles.emptyStateTitle, children: "Page vide" }), (0, jsx_runtime_1.jsx)("div", { style: styles.emptyStateText, children: "Commencez par ajouter une section a votre page" }), isEditing && activeTab === 'edition' && ((0, jsx_runtime_1.jsx)("button", { style: styles.addButton, onClick: () => setShowLayoutPicker(true), children: "+ Ajouter une section" }))] })) : (document.sections.map((section, index) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: { marginBottom: index < document.sections.length - 1 ? `${sectionGap}px` : 0 }, children: (0, jsx_runtime_1.jsx)(Section_1.SectionComponent, { section: section, index: index, totalSections: document.sections.length, isPreviewMode: isPreviewMode }) }), separator?.enabled && index < document.sections.length - 1 && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
339
|
+
marginBottom: `${sectionGap}px`,
|
|
340
|
+
borderTop: `${separator.thickness}px ${separator.style} ${separator.color}`,
|
|
341
|
+
marginLeft: separator.width === 'partial' ? `${separator.margin || 40}px` : 0,
|
|
342
|
+
marginRight: separator.width === 'partial' ? `${separator.margin || 40}px` : 0,
|
|
343
|
+
} }))] }, section.id)))) })) }), showLayoutPicker && ((0, jsx_runtime_1.jsx)(LayoutPicker, { onSelect: handleAddSection, onClose: () => setShowLayoutPicker(false) }))] }));
|
|
291
344
|
}
|
|
292
345
|
function PageEditor({ initialDocument, onChange, className, isEditing = true, }) {
|
|
293
346
|
return ((0, jsx_runtime_1.jsx)(PageContext_1.PageProvider, { initialDocument: initialDocument, isEditing: isEditing, onChange: onChange, children: (0, jsx_runtime_1.jsx)("div", { className: className, style: { height: '100%' }, children: (0, jsx_runtime_1.jsx)(PageEditorInner, {}) }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../src/components/Section.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../src/components/Section.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AAkMtD,UAAU,qBAAqB;IAC7B,OAAO,EAAE,WAAW,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,aAAqB,EAAE,EAAE,qBAAqB,2CAoF/G;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -6,6 +6,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const layouts_1 = require("../layouts");
|
|
8
8
|
const PageContext_1 = require("../context/PageContext");
|
|
9
|
+
const SectionOptionsModal_1 = require("./SectionOptionsModal");
|
|
9
10
|
// ============================================
|
|
10
11
|
// Styles
|
|
11
12
|
// ============================================
|
|
@@ -81,7 +82,7 @@ function ToolbarButton({ onClick, title, children, danger, disabled }) {
|
|
|
81
82
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
82
83
|
}, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: children }));
|
|
83
84
|
}
|
|
84
|
-
function SectionToolbar({ sectionId, layoutType, index, canMoveUp, canMoveDown, isSelected, onSelect }) {
|
|
85
|
+
function SectionToolbar({ sectionId, layoutType, index, canMoveUp, canMoveDown, isSelected, onSelect, onDoubleClick }) {
|
|
85
86
|
const { moveSection, deleteSection, duplicateSection } = (0, PageContext_1.usePageContext)();
|
|
86
87
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
87
88
|
...styles.sectionToolbar,
|
|
@@ -92,20 +93,27 @@ function SectionToolbar({ sectionId, layoutType, index, canMoveUp, canMoveDown,
|
|
|
92
93
|
borderTopLeftRadius: '4px',
|
|
93
94
|
borderTopRightRadius: '4px',
|
|
94
95
|
cursor: 'pointer',
|
|
95
|
-
}, onClick: onSelect,
|
|
96
|
+
}, onClick: onSelect, onDoubleClick: (e) => {
|
|
97
|
+
e.stopPropagation();
|
|
98
|
+
onDoubleClick();
|
|
99
|
+
}, children: [(0, jsx_runtime_1.jsxs)("span", { style: styles.toolbarLabel, children: ["\u00A7", index + 1] }), (0, jsx_runtime_1.jsx)("span", { style: { color: '#999' }, children: layoutType }), (0, jsx_runtime_1.jsx)("span", { style: { color: '#bbb', fontSize: '0.65rem', marginLeft: '4px' }, children: "(double-clic pour options)" }), (0, jsx_runtime_1.jsxs)("div", { style: styles.toolbarActions, children: [(0, jsx_runtime_1.jsx)(ToolbarButton, { onClick: () => moveSection(sectionId, 'up'), title: "Monter", disabled: !canMoveUp, children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '14px' }, children: "arrow_upward" }) }), (0, jsx_runtime_1.jsx)(ToolbarButton, { onClick: () => moveSection(sectionId, 'down'), title: "Descendre", disabled: !canMoveDown, children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '14px' }, children: "arrow_downward" }) }), (0, jsx_runtime_1.jsx)(ToolbarButton, { onClick: () => duplicateSection(sectionId), title: "Dupliquer", children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '14px' }, children: "content_copy" }) }), (0, jsx_runtime_1.jsx)(ToolbarButton, { onClick: onDoubleClick, title: "Options", children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '14px' }, children: "tune" }) }), (0, jsx_runtime_1.jsx)(ToolbarButton, { onClick: () => {
|
|
96
100
|
if (window.confirm('Supprimer cette section ?')) {
|
|
97
101
|
deleteSection(sectionId);
|
|
98
102
|
}
|
|
99
|
-
}, title: "Supprimer", danger: true, children: "
|
|
103
|
+
}, title: "Supprimer", danger: true, children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '14px' }, children: "delete" }) })] })] }));
|
|
100
104
|
}
|
|
101
105
|
function SectionComponent({ section, index, totalSections, isPreviewMode = false }) {
|
|
102
|
-
const { isEditing, updateSection, selectedSectionId, selectSection } = (0, PageContext_1.usePageContext)();
|
|
106
|
+
const { isEditing, updateSection, updateSectionSettings, selectedSectionId, selectSection } = (0, PageContext_1.usePageContext)();
|
|
107
|
+
const [showOptionsModal, setShowOptionsModal] = (0, react_1.useState)(false);
|
|
103
108
|
const isSelected = selectedSectionId === section.id;
|
|
104
109
|
const showEditingUI = isEditing && !isPreviewMode;
|
|
105
110
|
const LayoutComponent = (0, layouts_1.getLayoutComponent)(section.layoutType);
|
|
106
111
|
const handleContentChange = (0, react_1.useCallback)((content) => {
|
|
107
112
|
updateSection(section.id, content);
|
|
108
113
|
}, [section.id, updateSection]);
|
|
114
|
+
const handleUpdateSettings = (0, react_1.useCallback)((settings) => {
|
|
115
|
+
updateSectionSettings(section.id, settings);
|
|
116
|
+
}, [section.id, updateSectionSettings]);
|
|
109
117
|
const wrapperStyle = {
|
|
110
118
|
...styles.wrapper,
|
|
111
119
|
...(isSelected && showEditingUI ? styles.wrapperSelected : {}),
|
|
@@ -122,6 +130,9 @@ function SectionComponent({ section, index, totalSections, isPreviewMode = false
|
|
|
122
130
|
selectSection(section.id);
|
|
123
131
|
}
|
|
124
132
|
};
|
|
125
|
-
|
|
133
|
+
const handleOpenOptions = () => {
|
|
134
|
+
setShowOptionsModal(true);
|
|
135
|
+
};
|
|
136
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: styles.container, children: [showEditingUI && ((0, jsx_runtime_1.jsx)(SectionToolbar, { sectionId: section.id, layoutType: section.layoutType, index: index, canMoveUp: index > 0, canMoveDown: index < totalSections - 1, isSelected: isSelected, onSelect: handleSelect, onDoubleClick: handleOpenOptions })), (0, jsx_runtime_1.jsx)("div", { style: wrapperStyle, className: section.className, children: (0, jsx_runtime_1.jsx)(LayoutComponent, { section: section, isEditing: showEditingUI, onContentChange: handleContentChange }) }), (0, jsx_runtime_1.jsx)(SectionOptionsModal_1.SectionOptionsModal, { isOpen: showOptionsModal, onClose: () => setShowOptionsModal(false), section: section, onUpdateSettings: handleUpdateSettings, onUpdateContent: handleContentChange })] }));
|
|
126
137
|
}
|
|
127
138
|
exports.default = SectionComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Section } from '../types/page';
|
|
2
|
+
export interface SectionOptionsModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
section: Section;
|
|
6
|
+
onUpdateSettings: (settings: Partial<Section>) => void;
|
|
7
|
+
onUpdateContent: (content: unknown) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function SectionOptionsModal({ isOpen, onClose, section, onUpdateSettings, onUpdateContent, }: SectionOptionsModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export default SectionOptionsModal;
|
|
11
|
+
//# sourceMappingURL=SectionOptionsModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionOptionsModal.d.ts","sourceRoot":"","sources":["../../src/components/SectionOptionsModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAOvC,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;IACtD,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAC5C;AAgMD,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,eAAe,GAChB,EAAE,wBAAwB,kDAgV1B;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SectionOptionsModal = SectionOptionsModal;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const PaddingEditor_1 = require("./PaddingEditor");
|
|
8
|
+
// ============================================
|
|
9
|
+
// Styles
|
|
10
|
+
// ============================================
|
|
11
|
+
const styles = {
|
|
12
|
+
overlay: {
|
|
13
|
+
position: 'fixed',
|
|
14
|
+
top: 0,
|
|
15
|
+
left: 0,
|
|
16
|
+
right: 0,
|
|
17
|
+
bottom: 0,
|
|
18
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
zIndex: 100000,
|
|
23
|
+
},
|
|
24
|
+
dialog: {
|
|
25
|
+
backgroundColor: 'white',
|
|
26
|
+
borderRadius: '12px',
|
|
27
|
+
boxShadow: '0 25px 50px rgba(0,0,0,0.25)',
|
|
28
|
+
width: '520px',
|
|
29
|
+
maxWidth: '90vw',
|
|
30
|
+
maxHeight: '85vh',
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'column',
|
|
33
|
+
overflow: 'hidden',
|
|
34
|
+
},
|
|
35
|
+
header: {
|
|
36
|
+
padding: '20px 24px 16px 24px',
|
|
37
|
+
borderBottom: '1px solid #e5e7eb',
|
|
38
|
+
display: 'flex',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
justifyContent: 'space-between',
|
|
41
|
+
},
|
|
42
|
+
headerTitle: {
|
|
43
|
+
margin: 0,
|
|
44
|
+
fontSize: '18px',
|
|
45
|
+
fontWeight: 600,
|
|
46
|
+
color: '#111827',
|
|
47
|
+
display: 'flex',
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
gap: '8px',
|
|
50
|
+
},
|
|
51
|
+
closeButton: {
|
|
52
|
+
padding: '4px',
|
|
53
|
+
border: 'none',
|
|
54
|
+
backgroundColor: 'transparent',
|
|
55
|
+
cursor: 'pointer',
|
|
56
|
+
borderRadius: '4px',
|
|
57
|
+
display: 'flex',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
justifyContent: 'center',
|
|
60
|
+
color: '#6b7280',
|
|
61
|
+
},
|
|
62
|
+
content: {
|
|
63
|
+
padding: '20px 24px',
|
|
64
|
+
overflowY: 'auto',
|
|
65
|
+
flex: 1,
|
|
66
|
+
},
|
|
67
|
+
section: {
|
|
68
|
+
marginBottom: '24px',
|
|
69
|
+
},
|
|
70
|
+
sectionTitle: {
|
|
71
|
+
fontSize: '14px',
|
|
72
|
+
fontWeight: 600,
|
|
73
|
+
color: '#374151',
|
|
74
|
+
marginBottom: '12px',
|
|
75
|
+
display: 'flex',
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
gap: '8px',
|
|
78
|
+
},
|
|
79
|
+
field: {
|
|
80
|
+
marginBottom: '16px',
|
|
81
|
+
},
|
|
82
|
+
label: {
|
|
83
|
+
display: 'flex',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
gap: '8px',
|
|
86
|
+
marginBottom: '6px',
|
|
87
|
+
fontSize: '14px',
|
|
88
|
+
fontWeight: 500,
|
|
89
|
+
color: '#374151',
|
|
90
|
+
},
|
|
91
|
+
labelIcon: {
|
|
92
|
+
fontSize: '18px',
|
|
93
|
+
color: '#6b7280',
|
|
94
|
+
},
|
|
95
|
+
input: {
|
|
96
|
+
width: '100%',
|
|
97
|
+
padding: '10px 12px',
|
|
98
|
+
border: '1px solid #d1d5db',
|
|
99
|
+
borderRadius: '8px',
|
|
100
|
+
fontSize: '14px',
|
|
101
|
+
boxSizing: 'border-box',
|
|
102
|
+
outline: 'none',
|
|
103
|
+
},
|
|
104
|
+
select: {
|
|
105
|
+
width: '100%',
|
|
106
|
+
padding: '10px 12px',
|
|
107
|
+
border: '1px solid #d1d5db',
|
|
108
|
+
borderRadius: '8px',
|
|
109
|
+
fontSize: '14px',
|
|
110
|
+
backgroundColor: 'white',
|
|
111
|
+
cursor: 'pointer',
|
|
112
|
+
outline: 'none',
|
|
113
|
+
},
|
|
114
|
+
colorRow: {
|
|
115
|
+
display: 'flex',
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
gap: '12px',
|
|
118
|
+
},
|
|
119
|
+
colorInput: {
|
|
120
|
+
width: '48px',
|
|
121
|
+
height: '40px',
|
|
122
|
+
padding: '2px',
|
|
123
|
+
borderRadius: '8px',
|
|
124
|
+
border: '1px solid #d1d5db',
|
|
125
|
+
cursor: 'pointer',
|
|
126
|
+
},
|
|
127
|
+
checkbox: {
|
|
128
|
+
display: 'flex',
|
|
129
|
+
alignItems: 'center',
|
|
130
|
+
gap: '8px',
|
|
131
|
+
cursor: 'pointer',
|
|
132
|
+
},
|
|
133
|
+
separator: {
|
|
134
|
+
border: 'none',
|
|
135
|
+
borderTop: '1px solid #e5e7eb',
|
|
136
|
+
margin: '20px 0',
|
|
137
|
+
},
|
|
138
|
+
footer: {
|
|
139
|
+
padding: '16px 24px',
|
|
140
|
+
borderTop: '1px solid #e5e7eb',
|
|
141
|
+
display: 'flex',
|
|
142
|
+
gap: '12px',
|
|
143
|
+
justifyContent: 'flex-end',
|
|
144
|
+
},
|
|
145
|
+
button: {
|
|
146
|
+
padding: '10px 20px',
|
|
147
|
+
border: 'none',
|
|
148
|
+
borderRadius: '8px',
|
|
149
|
+
fontSize: '14px',
|
|
150
|
+
fontWeight: 500,
|
|
151
|
+
cursor: 'pointer',
|
|
152
|
+
},
|
|
153
|
+
cancelButton: {
|
|
154
|
+
border: '1px solid #d1d5db',
|
|
155
|
+
backgroundColor: 'white',
|
|
156
|
+
color: '#374151',
|
|
157
|
+
},
|
|
158
|
+
saveButton: {
|
|
159
|
+
backgroundColor: '#3b82f6',
|
|
160
|
+
color: 'white',
|
|
161
|
+
},
|
|
162
|
+
resetButton: {
|
|
163
|
+
padding: '6px 12px',
|
|
164
|
+
border: '1px solid #d1d5db',
|
|
165
|
+
borderRadius: '6px',
|
|
166
|
+
backgroundColor: 'white',
|
|
167
|
+
fontSize: '12px',
|
|
168
|
+
cursor: 'pointer',
|
|
169
|
+
color: '#6b7280',
|
|
170
|
+
},
|
|
171
|
+
layoutBadge: {
|
|
172
|
+
padding: '4px 8px',
|
|
173
|
+
backgroundColor: '#f3f4f6',
|
|
174
|
+
borderRadius: '4px',
|
|
175
|
+
fontSize: '12px',
|
|
176
|
+
color: '#6b7280',
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
// ============================================
|
|
180
|
+
// Helper: Parse padding string
|
|
181
|
+
// ============================================
|
|
182
|
+
function parsePaddingString(value) {
|
|
183
|
+
if (!value)
|
|
184
|
+
return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
185
|
+
const parts = value.replace(/px|rem/g, '').trim().split(/\s+/).map(Number);
|
|
186
|
+
if (parts.length === 1)
|
|
187
|
+
return { top: parts[0], right: parts[0], bottom: parts[0], left: parts[0] };
|
|
188
|
+
if (parts.length === 2)
|
|
189
|
+
return { top: parts[0], right: parts[1], bottom: parts[0], left: parts[1] };
|
|
190
|
+
if (parts.length === 4)
|
|
191
|
+
return { top: parts[0], right: parts[1], bottom: parts[2], left: parts[3] };
|
|
192
|
+
return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
193
|
+
}
|
|
194
|
+
// ============================================
|
|
195
|
+
// Component
|
|
196
|
+
// ============================================
|
|
197
|
+
function SectionOptionsModal({ isOpen, onClose, section, onUpdateSettings, onUpdateContent, }) {
|
|
198
|
+
// Local state for settings
|
|
199
|
+
const [backgroundColor, setBackgroundColor] = (0, react_1.useState)(section.backgroundColor || '');
|
|
200
|
+
const [padding, setPadding] = (0, react_1.useState)(() => parsePaddingString(section.padding));
|
|
201
|
+
const [className, setClassName] = (0, react_1.useState)(section.className || '');
|
|
202
|
+
// Local state for content-specific options
|
|
203
|
+
const content = section.content;
|
|
204
|
+
const [columns, setColumns] = (0, react_1.useState)(content.columns || 2);
|
|
205
|
+
const [columnLines, setColumnLines] = (0, react_1.useState)(content.columnLines || 0);
|
|
206
|
+
const [dropCapEnabled, setDropCapEnabled] = (0, react_1.useState)(content.dropCap?.enabled || false);
|
|
207
|
+
const [legendAsterisk, setLegendAsterisk] = (0, react_1.useState)(content.legendAsterisk || false);
|
|
208
|
+
// Gallery options
|
|
209
|
+
const [galleryLayout, setGalleryLayout] = (0, react_1.useState)(content.layout || 'grid');
|
|
210
|
+
const [imageHeight, setImageHeight] = (0, react_1.useState)(content.imageHeight || 200);
|
|
211
|
+
const [galleryAlignment, setGalleryAlignment] = (0, react_1.useState)(content.alignment || 'left');
|
|
212
|
+
const [galleryGap, setGalleryGap] = (0, react_1.useState)(content.gap || 8);
|
|
213
|
+
const [showCaptions, setShowCaptions] = (0, react_1.useState)(content.showCaptions || false);
|
|
214
|
+
const [captionAlign, setCaptionAlign] = (0, react_1.useState)(content.captionAlign || 'left');
|
|
215
|
+
// Reset when section changes
|
|
216
|
+
(0, react_1.useEffect)(() => {
|
|
217
|
+
if (isOpen) {
|
|
218
|
+
setBackgroundColor(section.backgroundColor || '');
|
|
219
|
+
setPadding(parsePaddingString(section.padding));
|
|
220
|
+
setClassName(section.className || '');
|
|
221
|
+
const content = section.content;
|
|
222
|
+
setColumns(content.columns || 2);
|
|
223
|
+
setColumnLines(content.columnLines || 0);
|
|
224
|
+
setDropCapEnabled(content.dropCap?.enabled || false);
|
|
225
|
+
setLegendAsterisk(content.legendAsterisk || false);
|
|
226
|
+
setGalleryLayout(content.layout || 'grid');
|
|
227
|
+
setImageHeight(content.imageHeight || 200);
|
|
228
|
+
setGalleryAlignment(content.alignment || 'left');
|
|
229
|
+
setGalleryGap(content.gap || 8);
|
|
230
|
+
setShowCaptions(content.showCaptions || false);
|
|
231
|
+
setCaptionAlign(content.captionAlign || 'left');
|
|
232
|
+
}
|
|
233
|
+
}, [isOpen, section]);
|
|
234
|
+
const handleSave = () => {
|
|
235
|
+
// Update section settings
|
|
236
|
+
const paddingStr = padding.top === padding.right && padding.right === padding.bottom && padding.bottom === padding.left
|
|
237
|
+
? (padding.top > 0 ? `${padding.top}px` : undefined)
|
|
238
|
+
: `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px`;
|
|
239
|
+
onUpdateSettings({
|
|
240
|
+
backgroundColor: backgroundColor || undefined,
|
|
241
|
+
padding: paddingStr,
|
|
242
|
+
className: className || undefined,
|
|
243
|
+
});
|
|
244
|
+
// Update content based on layout type
|
|
245
|
+
if (section.layoutType === 'ogilvy') {
|
|
246
|
+
onUpdateContent({
|
|
247
|
+
...content,
|
|
248
|
+
columns,
|
|
249
|
+
columnLines: columnLines > 0 ? columnLines : undefined,
|
|
250
|
+
dropCap: { ...(content.dropCap || {}), enabled: dropCapEnabled },
|
|
251
|
+
legendAsterisk,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
else if (section.layoutType === 'gallery') {
|
|
255
|
+
onUpdateContent({
|
|
256
|
+
...content,
|
|
257
|
+
layout: galleryLayout,
|
|
258
|
+
imageHeight,
|
|
259
|
+
alignment: galleryAlignment,
|
|
260
|
+
gap: galleryGap,
|
|
261
|
+
showCaptions,
|
|
262
|
+
captionAlign,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
onClose();
|
|
266
|
+
};
|
|
267
|
+
const handleInputFocus = (e) => {
|
|
268
|
+
e.target.style.borderColor = '#3b82f6';
|
|
269
|
+
};
|
|
270
|
+
const handleInputBlur = (e) => {
|
|
271
|
+
e.target.style.borderColor = '#d1d5db';
|
|
272
|
+
};
|
|
273
|
+
if (!isOpen)
|
|
274
|
+
return null;
|
|
275
|
+
return ((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(), children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.header, children: [(0, jsx_runtime_1.jsxs)("h3", { style: styles.headerTitle, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '20px' }, children: "tune" }), "Options de la section", (0, jsx_runtime_1.jsx)("span", { style: styles.layoutBadge, children: section.layoutType })] }), (0, jsx_runtime_1.jsx)("button", { style: styles.closeButton, onClick: onClose, children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '20px' }, children: "close" }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.content, children: [section.layoutType === 'ogilvy' && ((0, jsx_runtime_1.jsxs)("div", { style: styles.section, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.sectionTitle, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px' }, children: "view_column" }), "Options Ogilvy"] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.label, children: "Colonnes" }), (0, jsx_runtime_1.jsxs)("select", { value: columns, onChange: (e) => setColumns(Number(e.target.value)), style: styles.select, onFocus: handleInputFocus, onBlur: handleInputBlur, 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.field, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.label, children: "Hauteur (lignes)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: columnLines || '', onChange: (e) => setColumnLines(Number(e.target.value) || 0), placeholder: "auto", min: 5, max: 100, style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur })] }), (0, jsx_runtime_1.jsx)("div", { style: styles.field, children: (0, jsx_runtime_1.jsxs)("label", { style: styles.checkbox, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: dropCapEnabled, onChange: (e) => setDropCapEnabled(e.target.checked) }), "Lettrine"] }) }), (0, jsx_runtime_1.jsx)("div", { style: styles.field, children: (0, jsx_runtime_1.jsxs)("label", { style: styles.checkbox, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: legendAsterisk, onChange: (e) => setLegendAsterisk(e.target.checked) }), "Ast\u00E9risque (*)"] }) })] })), section.layoutType === 'gallery' && ((0, jsx_runtime_1.jsxs)("div", { style: styles.section, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.sectionTitle, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px' }, children: "collections" }), "Options Galerie"] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.label, children: "Mode d'affichage" }), (0, jsx_runtime_1.jsxs)("select", { value: galleryLayout, onChange: (e) => setGalleryLayout(e.target.value), style: styles.select, onFocus: handleInputFocus, onBlur: handleInputBlur, 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.field, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.label, children: "Hauteur des images (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: imageHeight, onChange: (e) => setImageHeight(Number(e.target.value)), min: 50, max: 800, step: 10, style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.label, children: "Alignement" }), (0, jsx_runtime_1.jsxs)("select", { value: galleryAlignment, onChange: (e) => setGalleryAlignment(e.target.value), style: styles.select, onFocus: handleInputFocus, onBlur: handleInputBlur, children: [(0, jsx_runtime_1.jsx)("option", { value: "left", children: "Gauche" }), (0, jsx_runtime_1.jsx)("option", { value: "center", children: "Centre" }), (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.field, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.label, children: "Espacement (px)" }), (0, jsx_runtime_1.jsx)("input", { type: "number", value: galleryGap, onChange: (e) => setGalleryGap(Number(e.target.value)), min: 0, max: 50, style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur })] }), (0, jsx_runtime_1.jsx)("div", { style: styles.field, children: (0, jsx_runtime_1.jsxs)("label", { style: styles.checkbox, children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: showCaptions, onChange: (e) => setShowCaptions(e.target.checked) }), "Afficher les legendes"] }) }), showCaptions && ((0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.label, children: "Alignement des legendes" }), (0, jsx_runtime_1.jsxs)("select", { value: captionAlign, onChange: (e) => setCaptionAlign(e.target.value), style: styles.select, onFocus: handleInputFocus, onBlur: handleInputBlur, 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: styles.separator }), (0, jsx_runtime_1.jsxs)("div", { style: styles.section, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.sectionTitle, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px' }, children: "palette" }), "Apparence"] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.field, children: [(0, jsx_runtime_1.jsx)("label", { style: styles.label, children: "Couleur de fond" }), (0, jsx_runtime_1.jsxs)("div", { style: styles.colorRow, children: [(0, jsx_runtime_1.jsx)("input", { type: "color", value: backgroundColor || '#ffffff', onChange: (e) => setBackgroundColor(e.target.value), style: styles.colorInput }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: backgroundColor, onChange: (e) => setBackgroundColor(e.target.value), placeholder: "transparent", style: { ...styles.input, flex: 1 }, onFocus: handleInputFocus, onBlur: handleInputBlur }), (0, jsx_runtime_1.jsx)("button", { style: styles.resetButton, onClick: () => setBackgroundColor(''), children: "Reset" })] })] }), (0, jsx_runtime_1.jsx)(PaddingEditor_1.PaddingEditor, { value: padding, onChange: setPadding, label: "Padding" })] }), (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: "code" }), "Classe CSS"] }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: className, onChange: (e) => setClassName(e.target.value), placeholder: "ex: my-custom-class", style: styles.input, onFocus: handleInputFocus, onBlur: handleInputBlur })] })] }), (0, jsx_runtime_1.jsxs)("div", { style: styles.footer, children: [(0, jsx_runtime_1.jsx)("button", { style: { ...styles.button, ...styles.cancelButton }, onClick: onClose, children: "Annuler" }), (0, jsx_runtime_1.jsx)("button", { style: { ...styles.button, ...styles.saveButton }, onClick: handleSave, children: "Enregistrer" })] })] }) }));
|
|
276
|
+
}
|
|
277
|
+
exports.default = SectionOptionsModal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PageDocument, PageFormat, Section, LayoutType, PrintSize, VideoSize } from '../types/page';
|
|
2
|
+
import { PageDocument, PageFormat, Section, LayoutType, PrintSize, VideoSize, SectionSeparator, PaddingValues } from '../types/page';
|
|
3
3
|
interface PageContextValue {
|
|
4
4
|
document: PageDocument;
|
|
5
5
|
isEditing: boolean;
|
|
@@ -9,6 +9,10 @@ interface PageContextValue {
|
|
|
9
9
|
setPrintSize: (size: PrintSize) => void;
|
|
10
10
|
setVideoSize: (size: VideoSize) => void;
|
|
11
11
|
setTitle: (title: string) => void;
|
|
12
|
+
setSectionGap: (gap: number | undefined) => void;
|
|
13
|
+
setSeparator: (separator: Partial<SectionSeparator>) => void;
|
|
14
|
+
setPagePadding: (padding: PaddingValues | string | undefined) => void;
|
|
15
|
+
setBackgroundColor: (color: string | undefined) => void;
|
|
12
16
|
addSection: (layoutType: LayoutType, content: unknown, index?: number) => void;
|
|
13
17
|
updateSection: (id: string, content: unknown) => void;
|
|
14
18
|
updateSectionSettings: (id: string, settings: Partial<Section>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageContext.d.ts","sourceRoot":"","sources":["../../src/context/PageContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAC1F,OAAO,EACL,YAAY,EACZ,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,
|
|
1
|
+
{"version":3,"file":"PageContext.d.ts","sourceRoot":"","sources":["../../src/context/PageContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAC1F,OAAO,EACL,YAAY,EACZ,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,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C3D,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACxC,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAG1C,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAA;IACnD,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,kBAAkB,EAAE,MAAM,OAAO,GAAG,SAAS,CAAA;CAC9C;AAED,QAAA,MAAM,WAAW,wCAA+C,CAAA;AAMhE,wBAAgB,cAAc,qBAM7B;AAGD,wBAAgB,kBAAkB,4BAEjC;AAMD,UAAU,iBAAiB;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,eAAe,CAAC,EAAE,YAAY,CAAA;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAA;CAC5C;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,eAAe,EACf,SAAgB,EAChB,QAAQ,GACT,EAAE,iBAAiB,2CAgKnB;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -73,6 +73,33 @@ function pageReducer(state, action) {
|
|
|
73
73
|
title: action.payload,
|
|
74
74
|
updatedAt: now,
|
|
75
75
|
};
|
|
76
|
+
case 'SET_SECTION_GAP':
|
|
77
|
+
return {
|
|
78
|
+
...state,
|
|
79
|
+
sectionGap: action.payload,
|
|
80
|
+
updatedAt: now,
|
|
81
|
+
};
|
|
82
|
+
case 'SET_SEPARATOR':
|
|
83
|
+
return {
|
|
84
|
+
...state,
|
|
85
|
+
separator: {
|
|
86
|
+
...(state.separator || { enabled: false, thickness: 1, color: '#e5e7eb', style: 'solid', width: 'full' }),
|
|
87
|
+
...action.payload,
|
|
88
|
+
},
|
|
89
|
+
updatedAt: now,
|
|
90
|
+
};
|
|
91
|
+
case 'SET_PAGE_PADDING':
|
|
92
|
+
return {
|
|
93
|
+
...state,
|
|
94
|
+
padding: action.payload,
|
|
95
|
+
updatedAt: now,
|
|
96
|
+
};
|
|
97
|
+
case 'SET_BACKGROUND_COLOR':
|
|
98
|
+
return {
|
|
99
|
+
...state,
|
|
100
|
+
backgroundColor: action.payload,
|
|
101
|
+
updatedAt: now,
|
|
102
|
+
};
|
|
76
103
|
case 'ADD_SECTION': {
|
|
77
104
|
const newSection = (0, page_1.createSection)(action.payload.layoutType, action.payload.content);
|
|
78
105
|
const sections = [...state.sections];
|
|
@@ -204,6 +231,18 @@ function PageProvider({ children, initialDocument, isEditing = true, onChange, }
|
|
|
204
231
|
const setTitle = (0, react_1.useCallback)((title) => {
|
|
205
232
|
dispatch({ type: 'SET_TITLE', payload: title });
|
|
206
233
|
}, []);
|
|
234
|
+
const setSectionGap = (0, react_1.useCallback)((gap) => {
|
|
235
|
+
dispatch({ type: 'SET_SECTION_GAP', payload: gap });
|
|
236
|
+
}, []);
|
|
237
|
+
const setSeparator = (0, react_1.useCallback)((separator) => {
|
|
238
|
+
dispatch({ type: 'SET_SEPARATOR', payload: separator });
|
|
239
|
+
}, []);
|
|
240
|
+
const setPagePadding = (0, react_1.useCallback)((padding) => {
|
|
241
|
+
dispatch({ type: 'SET_PAGE_PADDING', payload: padding });
|
|
242
|
+
}, []);
|
|
243
|
+
const setBackgroundColor = (0, react_1.useCallback)((color) => {
|
|
244
|
+
dispatch({ type: 'SET_BACKGROUND_COLOR', payload: color });
|
|
245
|
+
}, []);
|
|
207
246
|
const addSection = (0, react_1.useCallback)((layoutType, content, index) => {
|
|
208
247
|
dispatch({ type: 'ADD_SECTION', payload: { layoutType, content, index } });
|
|
209
248
|
}, []);
|
|
@@ -241,6 +280,10 @@ function PageProvider({ children, initialDocument, isEditing = true, onChange, }
|
|
|
241
280
|
setPrintSize,
|
|
242
281
|
setVideoSize,
|
|
243
282
|
setTitle,
|
|
283
|
+
setSectionGap,
|
|
284
|
+
setSeparator,
|
|
285
|
+
setPagePadding,
|
|
286
|
+
setBackgroundColor,
|
|
244
287
|
addSection,
|
|
245
288
|
updateSection,
|
|
246
289
|
updateSectionSettings,
|
|
@@ -261,6 +304,10 @@ function PageProvider({ children, initialDocument, isEditing = true, onChange, }
|
|
|
261
304
|
setPrintSize,
|
|
262
305
|
setVideoSize,
|
|
263
306
|
setTitle,
|
|
307
|
+
setSectionGap,
|
|
308
|
+
setSeparator,
|
|
309
|
+
setPagePadding,
|
|
310
|
+
setBackgroundColor,
|
|
264
311
|
addSection,
|
|
265
312
|
updateSection,
|
|
266
313
|
updateSectionSettings,
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ export { SmartEditor, SmartViewer } from './components/SmartEditor';
|
|
|
24
24
|
export type { SmartEditorProps, SmartViewerProps } from './components/SmartEditor';
|
|
25
25
|
export { ImageMetadataDialog } from './components/ImageMetadataDialog';
|
|
26
26
|
export type { ImageMetadata, ImageMetadataDialogProps } from './components/ImageMetadataDialog';
|
|
27
|
+
export { SectionOptionsModal } from './components/SectionOptionsModal';
|
|
28
|
+
export type { SectionOptionsModalProps } from './components/SectionOptionsModal';
|
|
29
|
+
export { PaddingEditor } from './components/PaddingEditor';
|
|
30
|
+
export type { PaddingEditorProps } from './components/PaddingEditor';
|
|
27
31
|
export { registerLayout, getLayout, getAllLayouts, getLayoutsByCategory, getLayoutComponent, getLayoutDefaultContent, initializeLayouts, } from './layouts';
|
|
28
32
|
export type { LayoutComponentProps, LayoutRegistryEntry } from './layouts';
|
|
29
33
|
export { OgilvyLayout, createDefaultOgilvyContent } from './layouts/OgilvyLayout';
|
|
@@ -32,7 +36,7 @@ export type { RichTextContent } from './layouts/RichTextLayout';
|
|
|
32
36
|
export { GalleryLayout, createDefaultGalleryContent } from './layouts/GalleryLayout';
|
|
33
37
|
export { detectFormat, isPageDocument, isLexicalState, lexicalToPageDocument, pageDocumentToLexical, ensurePageDocument, isSimpleDocument, prepareForSave, } from './utils/format';
|
|
34
38
|
export type { ContentFormat, FormatDetectionResult, SaveOptions } from './utils/format';
|
|
35
|
-
export type { PageDocument, PageFormat, Section, LayoutType, PrintSize, VideoSize, SectionAnimation, AnimationType, DropCapConfig, ImageData, OgilvyContent, HeroContent, TwoColumnsContent, ThreeColumnsContent, TextOnlyContent, ImageOnlyContent, QuoteContent, GalleryContent, GalleryImage, LayoutDefinition, SectionProps, } from './types/page';
|
|
36
|
-
export { PRINT_PRESETS, VIDEO_PRESETS, DEFAULT_DROP_CAP, generateId, createSection, createEmptyPage, } from './types/page';
|
|
39
|
+
export type { PageDocument, PageFormat, Section, LayoutType, PrintSize, VideoSize, SectionAnimation, AnimationType, DropCapConfig, ImageData, OgilvyContent, HeroContent, TwoColumnsContent, ThreeColumnsContent, TextOnlyContent, ImageOnlyContent, QuoteContent, GalleryContent, GalleryImage, LayoutDefinition, SectionProps, SectionSeparator, PaddingValues, } from './types/page';
|
|
40
|
+
export { PRINT_PRESETS, VIDEO_PRESETS, DEFAULT_DROP_CAP, DEFAULT_SEPARATOR, generateId, createSection, createEmptyPage, } from './types/page';
|
|
37
41
|
export { RichTextEditor as AIEditor } from './components/RichTextEditor';
|
|
38
42
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAGtE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,YAAY,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ACd,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACf,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAGvF,YAAY,EACV,YAAY,EACZ,UAAU,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,SAAS,EACT,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACd,MAAM,cAAc,CAAA;AAGrB,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.AIEditor = exports.createEmptyPage = exports.createSection = exports.generateId = exports.DEFAULT_DROP_CAP = exports.VIDEO_PRESETS = exports.PRINT_PRESETS = exports.prepareForSave = exports.isSimpleDocument = void 0;
|
|
3
|
+
exports.lexicalToPageDocument = exports.isLexicalState = exports.isPageDocument = exports.detectFormat = exports.createDefaultGalleryContent = exports.GalleryLayout = exports.createDefaultRichTextContent = exports.RichTextLayout = exports.createDefaultOgilvyContent = exports.OgilvyLayout = exports.initializeLayouts = exports.getLayoutDefaultContent = exports.getLayoutComponent = exports.getLayoutsByCategory = exports.getAllLayouts = exports.getLayout = exports.registerLayout = exports.PaddingEditor = exports.SectionOptionsModal = exports.ImageMetadataDialog = exports.SmartViewer = exports.SmartEditor = exports.SectionComponent = exports.PageViewer = exports.PageEditor = exports.usePageContextSafe = exports.usePageContext = exports.PageProvider = exports.PageContext = exports.useEditorMode = exports.EditorModeProvider = exports.EditorModeContext = exports.SimpleLinkPlugin = exports.ImageLinkPlugin = exports.INSERT_OBJECT_COMMAND = exports.InsertObjectPlugin = exports.$wrapSelectionInSimpleLink = exports.$isSimpleLinkNode = exports.$createSimpleLinkNode = exports.SimpleLinkNode = exports.$wrapSelectionInImageLink = exports.$isImageLinkNode = exports.$createImageLinkNode = exports.ImageLinkNode = exports.$isImageNode = exports.$createImageNode = exports.ImageNode = exports.EditorToolbar = exports.RichTextViewer = exports.RichTextEditor = void 0;
|
|
4
|
+
exports.AIEditor = exports.createEmptyPage = exports.createSection = exports.generateId = exports.DEFAULT_SEPARATOR = exports.DEFAULT_DROP_CAP = exports.VIDEO_PRESETS = exports.PRINT_PRESETS = exports.prepareForSave = exports.isSimpleDocument = exports.ensurePageDocument = exports.pageDocumentToLexical = void 0;
|
|
5
5
|
// Main WYSIWYG editor component
|
|
6
6
|
var RichTextEditor_1 = require("./components/RichTextEditor");
|
|
7
7
|
Object.defineProperty(exports, "RichTextEditor", { enumerable: true, get: function () { return RichTextEditor_1.RichTextEditor; } });
|
|
@@ -61,6 +61,11 @@ Object.defineProperty(exports, "SmartViewer", { enumerable: true, get: function
|
|
|
61
61
|
// Reusable dialogs
|
|
62
62
|
var ImageMetadataDialog_1 = require("./components/ImageMetadataDialog");
|
|
63
63
|
Object.defineProperty(exports, "ImageMetadataDialog", { enumerable: true, get: function () { return ImageMetadataDialog_1.ImageMetadataDialog; } });
|
|
64
|
+
var SectionOptionsModal_1 = require("./components/SectionOptionsModal");
|
|
65
|
+
Object.defineProperty(exports, "SectionOptionsModal", { enumerable: true, get: function () { return SectionOptionsModal_1.SectionOptionsModal; } });
|
|
66
|
+
// Reusable editors
|
|
67
|
+
var PaddingEditor_1 = require("./components/PaddingEditor");
|
|
68
|
+
Object.defineProperty(exports, "PaddingEditor", { enumerable: true, get: function () { return PaddingEditor_1.PaddingEditor; } });
|
|
64
69
|
// Layouts
|
|
65
70
|
var layouts_1 = require("./layouts");
|
|
66
71
|
Object.defineProperty(exports, "registerLayout", { enumerable: true, get: function () { return layouts_1.registerLayout; } });
|
|
@@ -94,6 +99,7 @@ var page_1 = require("./types/page");
|
|
|
94
99
|
Object.defineProperty(exports, "PRINT_PRESETS", { enumerable: true, get: function () { return page_1.PRINT_PRESETS; } });
|
|
95
100
|
Object.defineProperty(exports, "VIDEO_PRESETS", { enumerable: true, get: function () { return page_1.VIDEO_PRESETS; } });
|
|
96
101
|
Object.defineProperty(exports, "DEFAULT_DROP_CAP", { enumerable: true, get: function () { return page_1.DEFAULT_DROP_CAP; } });
|
|
102
|
+
Object.defineProperty(exports, "DEFAULT_SEPARATOR", { enumerable: true, get: function () { return page_1.DEFAULT_SEPARATOR; } });
|
|
97
103
|
Object.defineProperty(exports, "generateId", { enumerable: true, get: function () { return page_1.generateId; } });
|
|
98
104
|
Object.defineProperty(exports, "createSection", { enumerable: true, get: function () { return page_1.createSection; } });
|
|
99
105
|
Object.defineProperty(exports, "createEmptyPage", { enumerable: true, get: function () { return page_1.createEmptyPage; } });
|
|
@@ -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;AAoG9D,wBAAgB,2BAA2B,IAAI,cAAc,CAU5D;AA0HD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,eAAe,GAChB,EAAE,oBAAoB,CAAC,cAAc,CAAC,
|
|
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;AAoG9D,wBAAgB,2BAA2B,IAAI,cAAc,CAU5D;AA0HD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,eAAe,GAChB,EAAE,oBAAoB,CAAC,cAAc,CAAC,2CAkMtC"}
|
|
@@ -139,7 +139,7 @@ function ImageItem({ image, index, isEditing, showCaption, captionAlign, imageHe
|
|
|
139
139
|
} }), hasCaption && ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
140
140
|
...styles.caption,
|
|
141
141
|
textAlign: captionAlign,
|
|
142
|
-
}, children: [image.title && (0, jsx_runtime_1.jsx)("span", { style: styles.captionTitle, children: image.title }), image.comment && (0, jsx_runtime_1.jsx)("span", { style: { display: 'block' }, children: image.comment }), (image.photographer || image.copyright) && ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.captionMeta, justifyContent: captionAlign === 'right' ? 'flex-end' : 'flex-start' }, children: [image.copyright && ((0, jsx_runtime_1.jsxs)("span", { style: { display: 'flex', alignItems: 'center', gap: '2px' }, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '10px' }, children: "copyright" }), image.copyright] })), image.photographer && ((0, jsx_runtime_1.jsxs)("span", { style: { display: 'flex', alignItems: 'center', gap: '2px', marginLeft: image.copyright ? '8px' : 0 }, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '10px' }, children: "photo_camera" }), image.photographer] }))] }))] })), 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: "
|
|
142
|
+
}, children: [image.title && (0, jsx_runtime_1.jsx)("span", { style: styles.captionTitle, children: image.title }), image.comment && (0, jsx_runtime_1.jsx)("span", { style: { display: 'block' }, children: image.comment }), (image.photographer || image.copyright) && ((0, jsx_runtime_1.jsxs)("div", { style: { ...styles.captionMeta, justifyContent: captionAlign === 'right' ? 'flex-end' : 'flex-start' }, children: [image.copyright && ((0, jsx_runtime_1.jsxs)("span", { style: { display: 'flex', alignItems: 'center', gap: '2px' }, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '10px' }, children: "copyright" }), image.copyright] })), image.photographer && ((0, jsx_runtime_1.jsxs)("span", { style: { display: 'flex', alignItems: 'center', gap: '2px', marginLeft: image.copyright ? '8px' : 0 }, children: [(0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '10px' }, children: "photo_camera" }), image.photographer] }))] }))] })), 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: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px' }, children: "edit" }) }), (0, jsx_runtime_1.jsx)("button", { style: styles.editButton, onClick: () => onDelete(index), title: "Supprimer", children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '18px' }, children: "delete" }) })] }))] }));
|
|
143
143
|
}
|
|
144
144
|
// ============================================
|
|
145
145
|
// Main Layout Component
|
|
@@ -207,12 +207,10 @@ function GalleryLayout({ section, isEditing, onContentChange, }) {
|
|
|
207
207
|
}, children: [(0, jsx_runtime_1.jsx)("button", { style: {
|
|
208
208
|
...styles.editButton,
|
|
209
209
|
padding: '0.25rem',
|
|
210
|
-
|
|
211
|
-
}, onClick: () => handleEditImage(index), title: "Modifier", children: "\u270F\uFE0F" }), (0, jsx_runtime_1.jsx)("button", { style: {
|
|
210
|
+
}, onClick: () => handleEditImage(index), title: "Modifier", children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '16px' }, children: "edit" }) }), (0, jsx_runtime_1.jsx)("button", { style: {
|
|
212
211
|
...styles.editButton,
|
|
213
212
|
padding: '0.25rem',
|
|
214
|
-
|
|
215
|
-
}, onClick: () => handleDeleteImage(index), title: "Supprimer", children: "\uD83D\uDDD1\uFE0F" })] }))] }) }, index))) }));
|
|
213
|
+
}, onClick: () => handleDeleteImage(index), title: "Supprimer", children: (0, jsx_runtime_1.jsx)("span", { className: "material-icons", style: { fontSize: '16px' }, children: "delete" }) })] }))] }) }, index))) }));
|
|
216
214
|
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: () => {
|
|
217
215
|
setEditingIndex(null);
|
|
218
216
|
setShowAddDialog(true);
|
package/dist/types/page.d.ts
CHANGED
|
@@ -119,6 +119,21 @@ export interface QuoteContent {
|
|
|
119
119
|
style: 'simple' | 'large' | 'with-image';
|
|
120
120
|
authorImage?: ImageData;
|
|
121
121
|
}
|
|
122
|
+
export interface PaddingValues {
|
|
123
|
+
top: number;
|
|
124
|
+
right: number;
|
|
125
|
+
bottom: number;
|
|
126
|
+
left: number;
|
|
127
|
+
}
|
|
128
|
+
export interface SectionSeparator {
|
|
129
|
+
enabled: boolean;
|
|
130
|
+
thickness: number;
|
|
131
|
+
color: string;
|
|
132
|
+
style: 'solid' | 'dashed' | 'dotted' | 'double';
|
|
133
|
+
width: 'full' | 'partial';
|
|
134
|
+
margin?: number;
|
|
135
|
+
}
|
|
136
|
+
export declare const DEFAULT_SEPARATOR: SectionSeparator;
|
|
122
137
|
export interface PageDocument {
|
|
123
138
|
id: string;
|
|
124
139
|
title?: string;
|
|
@@ -131,6 +146,9 @@ export interface PageDocument {
|
|
|
131
146
|
defaultFontFamily?: string;
|
|
132
147
|
defaultFontSize?: number;
|
|
133
148
|
backgroundColor?: string;
|
|
149
|
+
sectionGap?: number;
|
|
150
|
+
separator?: SectionSeparator;
|
|
151
|
+
padding?: PaddingValues | string;
|
|
134
152
|
}
|
|
135
153
|
export interface LayoutDefinition<T = unknown> {
|
|
136
154
|
type: LayoutType;
|
package/dist/types/page.d.ts.map
CHANGED
|
@@ -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,CAAC;AAMF,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,MAAM,GACN,YAAY,GACZ,aAAa,GACb,UAAU,GACV,YAAY,GACZ,SAAS,GACT,UAAU,CAAC;AAEf,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IAExB,QAAQ,CAAC,EAAE,MAAM,CAA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M,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,CAAC,CAAC;CAEnB;AAMD,MAAM,WAAW,eAAe;IAC9B,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,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/dist/types/page.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Extension de qwanyx-ai-editor
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.DEFAULT_DROP_CAP = exports.VIDEO_PRESETS = exports.PRINT_PRESETS = void 0;
|
|
7
|
+
exports.DEFAULT_SEPARATOR = exports.DEFAULT_DROP_CAP = exports.VIDEO_PRESETS = exports.PRINT_PRESETS = void 0;
|
|
8
8
|
exports.generateId = generateId;
|
|
9
9
|
exports.createSection = createSection;
|
|
10
10
|
exports.createEmptyPage = createEmptyPage;
|
|
@@ -29,6 +29,14 @@ exports.DEFAULT_DROP_CAP = {
|
|
|
29
29
|
fontSize: 3,
|
|
30
30
|
lineHeight: 3,
|
|
31
31
|
};
|
|
32
|
+
exports.DEFAULT_SEPARATOR = {
|
|
33
|
+
enabled: false,
|
|
34
|
+
thickness: 1,
|
|
35
|
+
color: '#e5e7eb',
|
|
36
|
+
style: 'solid',
|
|
37
|
+
width: 'full',
|
|
38
|
+
margin: 40,
|
|
39
|
+
};
|
|
32
40
|
// ============================================
|
|
33
41
|
// Helpers
|
|
34
42
|
// ============================================
|