apostrophe 4.5.0 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.5.2 (2024-07-11)
4
+
5
+ ### Fixes
6
+
7
+ * Ensure that `apos.doc.walk` never gets caught in an infinite loop even if circular references are present in the data. This is a hotfix for an issue that can arise when the new support for breadcrumbs in search results is combined with a more inclusive projection for page ancestors.
8
+ * Correct a longstanding bug in `apos.doc.walk` that led items to be listed twice in the `ancestors` array passed to the iterator.
9
+ * Correct a longstanding bug in `apos.doc.walk` that led ancestors that are themselves arrays to be misrepresented as a series of objects in the `ancestors` array passed to the iterator.
10
+ * For additional guarantees of reliability the `_dotPath` and `_ancestors` arguments to `apos.doc.walk`, which were always clearly documented as for internal use only, can no longer be passed in externally.
11
+
12
+ ## 4.5.1 (2024-07-11)
13
+
14
+ ### Changes
15
+
16
+ * Allow tiptap rich-text widget to open modals for images and links without closing the toolbar.
17
+
3
18
  ## 4.5.0 (2024-07-10)
4
19
 
5
20
  ### Adds
@@ -14,6 +29,7 @@
14
29
 
15
30
  ### Fixes
16
31
 
32
+ * Removes unnecessary, broadly applied line-height setting that may cause logged-in vs logged-out visual discrepencies.
17
33
  * Remove double GET request when saving image update.
18
34
  * Fix filter menu forgetting selecting filters and not instantiating them.
19
35
  * Remove blur emit for filter buttons and search bar to avoid re requesting when clicking outside…
@@ -89,6 +89,7 @@ export default {
89
89
  align-items: center;
90
90
  height: 35px;
91
91
  padding: 10px 20px;
92
+ line-height: var(--a-line-base);
92
93
  border-bottom: 1px solid var(--a-base-9);
93
94
  }
94
95
 
@@ -176,6 +176,7 @@ export default {
176
176
  .apos-admin-bar__items {
177
177
  display: flex;
178
178
  flex-grow: 1;
179
+ line-height: var(--a-line-base);
179
180
  margin: 0;
180
181
  padding: 0;
181
182
  }
@@ -786,39 +786,40 @@ module.exports = {
786
786
  // will be `b`, the value will be `5`, the dotPath
787
787
  // will be the string `a.b`, and ancestors will be
788
788
  // [ { a: { b: 5 } } ].
789
- //
790
- // You do not need to pass the `_dotPath` and `_ancestors` arguments.
791
- // They are used for recursive invocation.
792
- walk(doc, iterator, _dotPath, _ancestors) {
793
- // We do not use lodash here because of
794
- // performance issues.
795
- //
796
- // Pruning big nested objects is not something we
797
- // can afford to do slowly. -Tom
798
- if (_dotPath !== undefined) {
799
- _dotPath += '.';
800
- } else {
801
- _dotPath = '';
802
- }
803
- _ancestors = (_ancestors || []).concat(doc);
804
- const remove = [];
805
- for (const key in doc) {
806
- const __dotPath = _dotPath + key.toString();
807
- const ow = '_originalWidgets';
808
- if (__dotPath === ow || __dotPath.substring(0, ow.length) === ow + '.') {
809
- continue;
789
+ walk(doc, iterator) {
790
+ return walkBody(doc, iterator, undefined, []);
791
+ function walkBody(doc, iterator, _dotPath, _ancestors) {
792
+ if (_ancestors.includes(doc)) {
793
+ // No infinite loops on circular references
794
+ return;
810
795
  }
811
- if (iterator(doc, key, doc[key], __dotPath, _ancestors) === false) {
812
- remove.push(key);
796
+ // Don't use concat, doc can be an array in which case
797
+ // it is important to preserve the nesting
798
+ _ancestors = [ ..._ancestors, doc ];
799
+ if (_dotPath !== undefined) {
800
+ _dotPath += '.';
813
801
  } else {
814
- const val = doc[key];
815
- if (typeof val === 'object') {
816
- self.walk(val, iterator, __dotPath, _ancestors.concat([ doc ]));
802
+ _dotPath = '';
803
+ }
804
+ const remove = [];
805
+ for (const key in doc) {
806
+ const __dotPath = _dotPath + key.toString();
807
+ const ow = '_originalWidgets';
808
+ if (__dotPath === ow || __dotPath.substring(0, ow.length) === ow + '.') {
809
+ continue;
810
+ }
811
+ if (iterator(doc, key, doc[key], __dotPath, _ancestors) === false) {
812
+ remove.push(key);
813
+ } else {
814
+ const val = doc[key];
815
+ if (typeof val === 'object') {
816
+ walkBody(val, iterator, __dotPath, _ancestors);
817
+ }
817
818
  }
818
819
  }
819
- }
820
- for (const key of remove) {
821
- delete doc[key];
820
+ for (const key of remove) {
821
+ delete doc[key];
822
+ }
822
823
  }
823
824
  },
824
825
  // Retry the given "actor" async function until it
@@ -461,6 +461,7 @@ export default {
461
461
  .apos-media-editor__lip {
462
462
  display: flex;
463
463
  justify-content: flex-end;
464
+ line-height: var(--a-line-base);
464
465
 
465
466
  & > .apos-context-menu, & > .apos-button__wrapper {
466
467
  margin-left: 7.5px;
@@ -422,6 +422,7 @@ function close() {
422
422
  display: flex;
423
423
  align-items: center;
424
424
  padding: $spacing-double;
425
+ line-height: var(--a-line-base);
425
426
  }
426
427
 
427
428
  .apos-modal__header__main {
@@ -33,6 +33,7 @@ export default {
33
33
  .apos-toolbar {
34
34
  display: flex;
35
35
  justify-content: space-between;
36
+ line-height: var(--a-line-base);
36
37
  }
37
38
 
38
39
  .apos-toolbar__group {
@@ -13,7 +13,7 @@
13
13
  animation: 'fade',
14
14
  inertia: true,
15
15
  placement: 'bottom',
16
- hideOnClick: true
16
+ hideOnClick: false
17
17
  }"
18
18
  :editor="editor"
19
19
  >
@@ -89,6 +89,10 @@ export default {
89
89
  </script>
90
90
 
91
91
  <style lang="scss" scoped>
92
+ .apos-schema {
93
+ line-height: var(--a-line-base);
94
+ }
95
+
92
96
  .apos-schema :deep(.apos-field__wrapper) {
93
97
  max-width: $input-max-width;
94
98
  }
@@ -243,6 +243,7 @@ async function setDropdownPosition() {
243
243
  .apos-context-menu__dropdown-content {
244
244
  z-index: $z-index-notifications;
245
245
  position: absolute;
246
+ line-height: var(--a-line-base);
246
247
  width: max-content;
247
248
 
248
249
  &[aria-hidden='true'] {
@@ -1,4 +1,3 @@
1
1
  [class*='apos-'] {
2
- line-height: var(--a-line-base);
3
2
  box-sizing: content-box;
4
3
  }
@@ -1,6 +1,7 @@
1
1
  .apos-table {
2
2
  width: 100%;
3
3
  border-collapse: collapse;
4
+ line-height: var(--a-line-base);
4
5
  }
5
6
 
6
7
  .apos-table__header {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apostrophe",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "description": "The Apostrophe Content Management System.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -148,4 +148,4 @@
148
148
  "browserslist": [
149
149
  "ie >= 10"
150
150
  ]
151
- }
151
+ }