Skip to content

Commit aa2fffc

Browse files
authored
Merge branch 'main' into feature-sections
2 parents 3baa430 + 0f7b06f commit aa2fffc

21 files changed

Lines changed: 857 additions & 158 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
* `AposDocEditor` now accepts a `values` prop, which can be used to pass an object of initial values for some or all fields. Use of this prop is optional. It is not supported when editing existing documents.
99
* `apos.doc.edit` now accepts an optional `values` object as the final parameter, containing initial values for some or all fields. This is supported only when editing existing documents.
1010
* When specifying a modal name to be executed, developers may now register "transformers" to be invoked first, using pipe syntax. For example, the modal name `aposSectionTemplateLibraryWidgetToDoc|AposDocEditor` will invoke the transformer `aposSectionTemplateLibraryWidgetToDoc` with the original props, and pass the returned result to `AposDocEditor`. Note that transformers are awaited. Transformers are registered in frontend admin UI code by passing a name and a function to `apos.ui.addTransformer`.
11+
* Adds quick image upload UI to `@apostrophecms/image-widget`.
12+
13+
## 4.20.0 (2025-08-06)
14+
15+
### Adds
16+
17+
* Adds any alt text found in an attribute to the media library attachment during import of rich text inline images by API
18+
* Adds `prependNodes` and `appendNodes` methods to every module. These methods allow you to inject HTML to every page using a `node` declaration.
1119

1220
### Changes
1321

modules/@apostrophecms/area/ui/apos/components/AposAreaEditor.vue

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -604,12 +604,14 @@ export default {
604604
widget: clipboard,
605605
index
606606
});
607-
} else if (widget) {
607+
}
608+
if (widget) {
608609
return this.insert({
609610
widget,
610611
index
611612
});
612-
} else if (this.widgetIsContextual(name)) {
613+
}
614+
if (this.widgetIsContextual(name)) {
613615
return this.insert({
614616
widget: {
615617
type: name,
@@ -618,7 +620,8 @@ export default {
618620
},
619621
index
620622
});
621-
} else if (!this.widgetHasInitialModal(name)) {
623+
}
624+
if (!this.widgetHasInitialModal(name)) {
622625
const widget = this.newWidget(name);
623626
return this.insert({
624627
widget: {
@@ -627,26 +630,26 @@ export default {
627630
},
628631
index
629632
});
630-
} else {
631-
const componentName = this.widgetEditorComponent(name);
632-
apos.area.activeEditor = this;
633-
const preview = this.widgetPreview(name, index, true);
634-
const widget = await apos.modal.execute(componentName, {
635-
modelValue: null,
636-
options: this.widgetOptionsByType(name),
637-
type: name,
638-
docId: this.docId,
639-
areaFieldId: this.fieldId,
640-
parentFollowingValues: this.followingValues,
641-
preview
633+
}
634+
635+
const componentName = this.widgetEditorComponent(name);
636+
apos.area.activeEditor = this;
637+
const preview = this.widgetPreview(name, index, true);
638+
const widget = await apos.modal.execute(componentName, {
639+
modelValue: null,
640+
options: this.widgetOptionsByType(name),
641+
type: name,
642+
docId: this.docId,
643+
areaFieldId: this.fieldId,
644+
parentFollowingValues: this.followingValues,
645+
preview
646+
});
647+
apos.area.activeEditor = null;
648+
if (widget) {
649+
return this.insert({
650+
widget,
651+
index
642652
});
643-
apos.area.activeEditor = null;
644-
if (widget) {
645-
return this.insert({
646-
widget,
647-
index
648-
});
649-
}
650653
}
651654
},
652655
widgetOptionsByType(name) {

modules/@apostrophecms/area/ui/apos/components/AposAreaWidget.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
:doc-id="docId"
159159
:rendering="rendering"
160160
@edit="$emit('edit', i);"
161+
@update="$emit('update', $event);"
161162
/>
162163
<div
163164
class="
@@ -330,12 +331,12 @@ export default {
330331
},
331332
widgetLabel() {
332333
const moduleName = `${this.widget.type}-widget`;
333-
const module = window.apos.modules[moduleName];
334-
if (!module) {
334+
const mod = window.apos.modules[moduleName];
335+
if (!mod) {
335336
// eslint-disable-next-line no-console
336337
console.warn(`No ${moduleName} module found for widget type ${this.widget.type}`);
337338
}
338-
return module.label;
339+
return mod.label;
339340
},
340341
widgetOptions() {
341342
return this.widgets[this.widget.type];

modules/@apostrophecms/asset/lib/globalIcons.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module.exports = {
7070
'help-circle-icon': 'HelpCircle',
7171
'image-edit-outline': 'ImageEditOutline',
7272
'image-icon': 'Image',
73+
'image-plus-icon': 'ImagePlus',
7374
'image-size-select-actual-icon': 'ImageSizeSelectActual',
7475
'information-icon': 'Information',
7576
'information-outline-icon': 'InformationOutline',

modules/@apostrophecms/attachment/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,8 @@ module.exports = {
11881188
// for bc
11891189
uploadsUrl: self.uploadfs.getUrl(),
11901190
croppable: self.croppable,
1191-
sized: self.sized
1191+
sized: self.sized,
1192+
maxSize: self.options.maxSize
11921193
};
11931194
},
11941195
// Middleware method used when only those with attachment privileges

modules/@apostrophecms/i18n/i18n/de.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@
247247
"imagePlaceholder": "Bild-Platzhalter",
248248
"imageTag": "Bild-Tag",
249249
"imageTags": "Bild-Tags",
250+
"imageUploadMsg": "Wählen Sie aus der {{ mediaLibrary }}, {{ yourDevice }} oder legen Sie eine Datei hier ab",
251+
"imageUploadSupport": "Unterstützt {{ formats }} oder {{ last }} Formate{{ upTo }}",
252+
"imageUploadUpTo": "bis zu {{ maxSize }}",
250253
"images": "Bilder",
251254
"inputFieldIsDisabled": "Dieses Feld ist deaktiviert",
252255
"insertAndNew": "{{ saveLabel }} {{ typeLabel }} und ein neues Erstellen.",
@@ -322,6 +325,7 @@
322325
"mediaDimensions": "Dimensionen: {{ width }} 𝗑 {{ height }}",
323326
"mediaFileSize": "Dateigrösse: {{ fileSize }}",
324327
"mediaKB": "{{ size }}KB",
328+
"mediaLibrary": "Mediathek",
325329
"mediaLibraryEndReached": "Sie haben das Ende der Mediathek erreicht.",
326330
"mediaMB": "{{ size }}MB",
327331
"mediaManagerErrorRestoring": "Fehler bei der Wiederherstellung",
@@ -331,6 +335,7 @@
331335
"mergeCells": "Zellen zusammenführen",
332336
"minLabel": "Min:",
333337
"minSize": "Minimale Grösse {{ width }}x{{ height }}",
338+
"minimumSize": "Mindestgröße von {{ width }} x {{ height }} px",
334339
"minUi": "Min: {{ number }}",
335340
"modalBreadcrumbsDefaultLabel": "Eine Bezeichnung festlegen",
336341
"modalTabsError": "Fehler",
@@ -627,5 +632,6 @@
627632
"willMoveImageToArchive": "Bild ins Archiv verschieben.",
628633
"yes": "Ja",
629634
"yesLocalizeAndSwitchLocales": "Ja, diese Seite übersetzen und zu der Sprache wechseln.",
630-
"youTookControl": "Du hast die Kontrolle über dieses Dokument in einer anderen Registerkarte oder einem anderen Fenster übernommen. Ein Dokument kann immer nur an einer Stelle bearbeitet werden."
635+
"youTookControl": "Du hast die Kontrolle über dieses Dokument in einer anderen Registerkarte oder einem anderen Fenster übernommen. Ein Dokument kann immer nur an einer Stelle bearbeitet werden.",
636+
"yourDevice": "Ihr Gerät"
631637
}

modules/@apostrophecms/i18n/i18n/en.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@
249249
"imagePlaceholder": "Image placeholder",
250250
"imageTag": "Image Tag",
251251
"imageTags": "Image Tags",
252+
"imageUploadMsg": "Choose from the {{ mediaLibrary }}, {{ yourDevice }}, or drop a file here",
253+
"imageUploadSupport": "Supports {{ formats }} or {{ last }} formats{{ upTo }}",
254+
"imageUploadUpTo": "up to {{ maxSize }}",
252255
"images": "Images",
253256
"inputFieldIsDisabled": "This field is disabled",
254257
"insertAndNew": "{{ saveLabel }} {{ typeLabel }} and create a new one.",
@@ -324,6 +327,7 @@
324327
"mediaDimensions": "Dimensions: {{ width }} 𝗑 {{ height }}",
325328
"mediaFileSize": "File Size: {{ fileSize }}",
326329
"mediaKB": "{{ size }}KB",
330+
"mediaLibrary": "media library",
327331
"mediaLibraryEndReached": "You've reached the end of the media library.",
328332
"mediaMB": "{{ size }}MB",
329333
"mediaManagerErrorRestoring": "Error Restoring",
@@ -333,6 +337,7 @@
333337
"mergeCells": "Merge Cells",
334338
"minLabel": "Min:",
335339
"minSize": "Min size of {{ width }}x{{ height }}",
340+
"minimumSize": "Minimum size of {{ width }} x {{ height }} px",
336341
"minUi": "Min: {{ number }}",
337342
"modalBreadcrumbsDefaultLabel": "Set a label",
338343
"modalTabsError": "Error",
@@ -631,5 +636,6 @@
631636
"willMoveImageToArchive": "This will move the image to the archive.",
632637
"yes": "Yes",
633638
"yesLocalizeAndSwitchLocales": "Yes, localize this page and switch locales",
634-
"youTookControl": "You took control of this document in another tab or window. A document can only be edited in one place at a time."
639+
"youTookControl": "You took control of this document in another tab or window. A document can only be edited in one place at a time.",
640+
"yourDevice": "your device"
635641
}

modules/@apostrophecms/i18n/i18n/es.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@
247247
"imagePlaceholder": "Marcador de posición de imagen",
248248
"imageTag": "Etiqueta de Imagen",
249249
"imageTags": "Etiquetas de Imágenes",
250+
"imageUploadMsg": "Elija entre {{ mediaLibrary }}, {{ yourDevice }} o suelte un archivo aquí",
251+
"imageUploadSupport": "Admite {{ formats }} o {{ last }} formatos{{ upTo }}",
252+
"imageUploadUpTo": "hasta {{ maxSize }}",
250253
"images": "Imágenes",
251254
"inputFieldIsDisabled": "Este campo está deshabilitado",
252255
"insertAndNew": "{{ saveLabel }} {{ typeLabel }} y crear uno nuevo.",
@@ -322,6 +325,7 @@
322325
"mediaDimensions": "Dimensiones: {{ width }} 𝗑 {{ height }}",
323326
"mediaFileSize": "Tamaño del Archivo: {{ fileSize }}",
324327
"mediaKB": "{{ size }}KB",
328+
"mediaLibrary": "biblioteca multimedia",
325329
"mediaLibraryEndReached": "Has alcanzado el final de la biblioteca de medios.",
326330
"mediaMB": "{{ size }}MB",
327331
"mediaManagerErrorRestoring": "Error al restaurar",
@@ -331,6 +335,7 @@
331335
"mergeCells": "Combinar celdas",
332336
"minLabel": "Mín:",
333337
"minSize": "Tamaño mínimo de {{ width }}x{{ height }}",
338+
"minimumSize": "Tamaño mínimo de {{ ancho }} x {{ alto }} px",
334339
"minUi": "Mín: {{ number }}",
335340
"modalBreadcrumbsDefaultLabel": "Establecer una etiqueta",
336341
"modalTabsError": "Error",
@@ -627,5 +632,6 @@
627632
"willMoveImageToArchive": "Esto moverá la imagen al archivo de documentos.",
628633
"yes": "",
629634
"yesLocalizeAndSwitchLocales": "Sí, traducir esta página y cambiar de configuración regional",
630-
"youTookControl": "Tomó el control de este documento en otra pestaña o ventana. Un documento sólo puede ser editado en un lugar a la vez."
635+
"youTookControl": "Tomó el control de este documento en otra pestaña o ventana. Un documento sólo puede ser editado en un lugar a la vez.",
636+
"yourDevice": "su dispositivo"
631637
}

modules/@apostrophecms/i18n/i18n/fr.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@
247247
"imagePlaceholder": "Espace réservé pour l'image",
248248
"imageTag": "Tag d'image",
249249
"imageTags": "Tags d'image",
250+
"imageUploadMsg": "Choisissez parmi la {{mediaLibrary}}, {{yourDevice}} ou déposez un fichier ici",
251+
"imageUploadSupport": "Prend en charge les formats {{ formats }} ou {{ last }} {{ upTo }}",
252+
"imageUploadUpTo": "jusqu'à {{ maxSize }}",
250253
"images": "Images",
251254
"inputFieldIsDisabled": "Ce champ est désactivé",
252255
"insertAndNew": "{{ saveLabel }} {{ typeLabel }} et en créer un/une autre.",
@@ -322,6 +325,7 @@
322325
"mediaDimensions": "Dimensions : {{ width }} 𝗑 {{ height }}",
323326
"mediaFileSize": "Taille du fichier : {{ fileSize }}",
324327
"mediaKB": "{{ size }} Ko",
328+
"mediaLibrary": "médiathèque",
325329
"mediaLibraryEndReached": "Vous avez atteint la fin de la bibliothèque multimédia.",
326330
"mediaMB": "{{ size }} Mo",
327331
"mediaManagerErrorRestoring": "Erreur de restauration",
@@ -331,6 +335,7 @@
331335
"mergeCells": "Fusionner les cellules",
332336
"minLabel": "Min :",
333337
"minSize": "Taille minimale de {{ width }}x{{ height }}",
338+
"minimumSize": "Taille minimale de {{ width }} x {{ height }} px",
334339
"minUi": "Min : {{ number }}",
335340
"modalBreadcrumbsDefaultLabel": "Définir une étiquette",
336341
"modalTabsError": "Erreur",
@@ -627,5 +632,6 @@
627632
"willMoveImageToArchive": "Cela déplacera l'image vers l'archive.",
628633
"yes": "Oui",
629634
"yesLocalizeAndSwitchLocales": "Oui, changer la langue de cette page et basculer de langue",
630-
"youTookControl": "Vous avez pris le contrôle de ce document dans un autre onglet ou une autre fenêtre. Un document ne peut être modifié qu'à un seul endroit à la fois."
635+
"youTookControl": "Vous avez pris le contrôle de ce document dans un autre onglet ou une autre fenêtre. Un document ne peut être modifié qu'à un seul endroit à la fois.",
636+
"yourDevice": "votre appareil"
631637
}

modules/@apostrophecms/i18n/i18n/it.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@
247247
"imagePlaceholder": "Immagine placeholder",
248248
"imageTag": "Tag dell'immagine",
249249
"imageTags": "Tag delle immagini",
250+
"imageUploadMsg": "Scegli tra {{ mediaLibrary }}, {{ yourDevice }} o trascina un file qui",
251+
"imageUploadSupport": "Supporta i formati {{ formats }} o {{ last }}{{ upTo }}",
252+
"imageUploadUpTo": "fino a {{ maxSize }}",
250253
"images": "Immagini",
251254
"inputFieldIsDisabled": "Questo campo è disabilitato",
252255
"insertAndNew": "{{ saveLabel }} {{ typeLabel }} e crea una nuova.",
@@ -322,6 +325,7 @@
322325
"mediaDimensions": "Dimensioni: {{ width }} 𝗑 {{ height }}",
323326
"mediaFileSize": "Dimensione del File: {{ fileSize }}",
324327
"mediaKB": "{{ size }}KB",
328+
"mediaLibrary": "biblioteca multimediale",
325329
"mediaLibraryEndReached": "Hai raggiunto la fine della libreria multimediale.",
326330
"mediaMB": "{{ size }}MB",
327331
"mediaManagerErrorRestoring": "Errore nel ripristino",
@@ -331,6 +335,7 @@
331335
"mergeCells": "Unisci celle",
332336
"minLabel": "Minimo:",
333337
"minSize": "Dimensione minima di {{ width }}x{{ height }}",
338+
"minimumSize": "Dimensione minima di {{ width }} x {{ height }} px",
334339
"minUi": "Minimo: {{ number }}",
335340
"modalBreadcrumbsDefaultLabel": "Imposta un'etichetta",
336341
"modalTabsError": "Errore",
@@ -627,5 +632,6 @@
627632
"willMoveImageToArchive": "Ciò sposterà l'immagine nell'archivio.",
628633
"yes": "",
629634
"yesLocalizeAndSwitchLocales": "Sì, localizza questa pagina e passa alle località",
630-
"youTookControl": "Hai preso il controllo di questo documento in un'altra scheda o finestra. Un documento può essere modificato in un solo luogo alla volta."
635+
"youTookControl": "Hai preso il controllo di questo documento in un'altra scheda o finestra. Un documento può essere modificato in un solo luogo alla volta.",
636+
"yourDevice": "il tuo dispositivo"
631637
}

0 commit comments

Comments
 (0)