codevdesign 1.0.18 → 1.0.20

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.
@@ -61,20 +61,22 @@
61
61
  props: {
62
62
  modelValue: { type: String, default: '' },
63
63
  langue: { type: String, default: 'fr_FR' },
64
- interdireRedimension: { type: Boolean, default: false },
64
+ redimension: { type: Boolean, default: false },
65
65
  desactiver: { type: Boolean, default: false },
66
+ hauteur: { type: [String, Number], default: '400' },
67
+ hauteurMinimale: { type: [String, Number], default: '200' },
66
68
  plugins: {
67
69
  type: [String, Array],
68
70
  default: 'autoresize table image link fullscreen advlist lists autolink code',
69
71
  },
70
- interdireImage: { type: Boolean, default: false },
72
+ autoriserImage: { type: Boolean, default: false },
71
73
  imageTailleMaximale: { type: Number, default: 5 }, // Mo
72
74
  cacherBarreMenu: { type: Boolean, default: false },
73
75
  cacherBarreOutils: { type: Boolean, default: false },
74
76
  toolbar: {
75
77
  type: [String, Array],
76
78
  default:
77
- 'bold italic underline strikethrough | fontsizeselect | forecolor backcolor | ' +
79
+ 'bold italic underline strikethrough | print | fontsizeselect | forecolor backcolor | ' +
78
80
  'alignleft aligncenter alignright alignjustify | emoticons | bullist numlist | ' +
79
81
  'image | link | outdent indent blockquote | undo redo | fullscreen | removeformat | table | code',
80
82
  },
@@ -102,7 +104,7 @@
102
104
  toolbarEffective() {
103
105
  if (this.cacherBarreOutils) return false
104
106
  const raw = Array.isArray(this.toolbar) ? this.toolbar.join(' | ') : this.toolbar
105
- if (!this.interdireImage) return this._normalizeToolbar(raw)
107
+ if (this.autoriserImage) return this._normalizeToolbar(raw)
106
108
 
107
109
  const sansImage = raw
108
110
  .replace(/\bimage\b/g, '')
@@ -119,7 +121,7 @@
119
121
  const list = (Array.isArray(this.plugins) ? this.plugins : this.plugins.split(/\s+/))
120
122
  .map(p => p.trim())
121
123
  .filter(Boolean)
122
- const filtered = this.interdireImage ? list.filter(p => p !== 'image') : list
124
+ const filtered = !this.autoriserImage ? list.filter(p => p !== 'image') : list
123
125
  return filtered.join(' ')
124
126
  },
125
127
 
@@ -127,32 +129,66 @@
127
129
  const opts = {
128
130
  autolink: !this.desactiver,
129
131
  autoresize: true,
130
- automatic_uploads: !this.interdireImage,
132
+ automatic_uploads: this.autoriserImage,
131
133
  branding: false,
132
134
  browser_spellcheck: true,
133
135
  content_css: 'default',
134
136
  deprecation_warnings: false,
135
137
  emoticons_database: 'emojis',
136
138
  highlight_on_focus: false,
137
- image_dimensions: !this.interdireImage,
139
+ image_dimensions: this.autoriserImage,
138
140
  language: this.langue === 'en' ? 'en_US' : 'fr_FR',
139
141
  license_key: 'gpl',
142
+ height: Number(this.hauteur) || 200,
143
+ min_height: Number(this.hauteurMinimale) || 200,
144
+ max_height: Number(this.hauteur) || 1000,
140
145
  menubar: !this.cacherBarreMenu,
141
- object_resizing: !this.interdireImage,
142
- paste_data_images: !this.interdireImage,
146
+ object_resizing: this.autoriserImage,
147
+ paste_data_images: this.autoriserImage,
143
148
  plugins: this.pluginsEffective,
144
149
  promotion: false,
145
150
  readonly: this.desactiver,
146
- resize: !this.interdireRedimension,
147
- resize_img_proportional: !this.interdireImage,
151
+ resize: this.redimension,
152
+ resize_img_proportional: this.autoriserImage,
148
153
  skin_url: 'default',
149
154
  statusbar: this.cacherBarreOutils === false,
150
155
  theme_advanced_resizing: true,
151
156
  theme_advanced_resizing_use_cookie: false,
152
157
  toolbar: this.toolbarEffective,
158
+ content_style: `
159
+ @page {
160
+ size: 8.5in 11in;
161
+ margin: 0.5in;
162
+ }
163
+
164
+ @media print {
165
+ html, body {
166
+ margin: 0;
167
+ padding: 0;
168
+ }
169
+
170
+ body {
171
+ width: 8.5in;
172
+ min-height: 11in;
173
+ box-sizing: border-box;
174
+ }
175
+
176
+ .mce-content-body {
177
+ max-width: 7.5in; /* un peu plus large si tu veux */
178
+ margin: 0 auto;
179
+ font-size: 11pt;
180
+ line-height: 1.3;
181
+ }
182
+
183
+ img, table {
184
+ max-width: 100%;
185
+ height: auto;
186
+ }
187
+ }
188
+ `,
153
189
 
154
190
  // --- File picker seulement si images permises ---
155
- ...(this.interdireImage ? {} : { file_picker_types: 'image' }),
191
+ ...(this.autoriserImage ? {} : { file_picker_types: 'image' }),
156
192
 
157
193
  setup: editor => {
158
194
  this._editor = editor
@@ -186,7 +222,7 @@
186
222
  },
187
223
  }
188
224
 
189
- if (!this.interdireImage) {
225
+ if (this.autoriserImage) {
190
226
  opts.file_picker_callback = cb => {
191
227
  const input = document.createElement('input')
192
228
  input.type = 'file'
@@ -234,10 +270,16 @@
234
270
  },
235
271
 
236
272
  // Re-montage propre sur changements des props
237
- interdireImage() {
273
+ autoriserImage() {
274
+ this._scheduleReinit()
275
+ },
276
+ hauteur() {
277
+ this._scheduleReinit()
278
+ },
279
+ hauteurMinimale() {
238
280
  this._scheduleReinit()
239
281
  },
240
- interdireRedimension() {
282
+ redimension() {
241
283
  this._scheduleReinit()
242
284
  },
243
285
  toolbar() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codevdesign",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "Composants Vuetify 3 pour les projets Codev",
5
5
  "files": [
6
6
  "./**/*.vue",