apostrophe 4.1.0 → 4.1.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.1.1 (2024-03-21)
4
+
5
+ ### Fixes
6
+
7
+ * Hotfix for a bug that broke the rich text editor when the rich text widget has
8
+ a `styles` property. The bug was introduced in 4.0.0 as an indirect side effect of deeper
9
+ watching behavior by Vue 3.
10
+
3
11
  ## 4.1.0 (2024-03-20)
4
12
 
5
13
  ### Fixes
@@ -140,6 +140,8 @@ import TableHeader from '@tiptap/extension-table-header';
140
140
  import TableRow from '@tiptap/extension-table-row';
141
141
  import Placeholder from '@tiptap/extension-placeholder';
142
142
 
143
+ import { klona } from 'klona';
144
+
143
145
  export default {
144
146
  name: 'AposRichTextWidgetEditor',
145
147
  components: {
@@ -209,7 +211,10 @@ export default {
209
211
  return this.moduleOptions.defaultOptions;
210
212
  },
211
213
  editorOptions() {
212
- const activeOptions = Object.assign({}, this.options);
214
+ // Deep clone to prevent runaway recursive rendering
215
+ // as the subproperties are mutated in several places
216
+ // by this code and its dependencies (TODO: find them all)
217
+ const activeOptions = klona(this.options);
213
218
 
214
219
  activeOptions.styles = this.enhanceStyles(
215
220
  activeOptions.styles?.length
@@ -491,6 +496,7 @@ export default {
491
496
  },
492
497
  // Enhances the dev-defined styles list with tiptap
493
498
  // commands and parameters used internally.
499
+ // WARNING: mutates its argument
494
500
  enhanceStyles(styles) {
495
501
  const self = this;
496
502
  (styles || []).forEach(style => {
@@ -544,8 +550,6 @@ export default {
544
550
  return styles;
545
551
  },
546
552
  localizeStyle(style) {
547
- style.label = this.$t(style.label);
548
-
549
553
  return {
550
554
  ...style,
551
555
  label: this.$t(style.label)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apostrophe",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "The Apostrophe Content Management System.",
5
5
  "main": "index.js",
6
6
  "scripts": {