Skip to content

Commit

Permalink
changelog merging
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartromanek committed Jan 6, 2025
2 parents 98bca2b + 5e978e6 commit 0b0d0a7
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 35 deletions.
38 changes: 31 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,48 @@

### Fixes

* Focus properly Widget Editor modals when opened. Keep the previous active focus on the modal when closing the widget editor.
* a11y improvements for context menus.
* Fixes broken widget preview URL when the image is overridden (module improve) and external build module is registered.
* Fixes ability to change color hue by clicking the color hue bar rather than dragging the indicator
* Prevents the rich text control bar from closing while using certain UI within the color picker
* Inject dynamic custom bundle CSS when using external build module with no CSS entry point.

### Adds

* When validating an `area` field, warn the developer if `widgets` is not nested in `options`.
* Ability to disable the color spectrum UI of a color picker

### Changes

* The `pickerOptions` sub property of a color field's configuration has been merged with it's parent `options` object.

## 4.11.2 (2024-12-29)

### Fixes

* Fixes a bug where images in Media manager are not selectable (click on an image does nothing) in both default and relationship mode.

## 4.11.1 (2024-12-18)

### Fixes

* Corrected a unit test that relies on the sitemap module, as it now makes explicit that the project level `baseUrl` must be set for a successful experience, and the module level `baseUrl` was set earlier. No other changes.

## 4.11.0 (2024-12-18)

### Adds

* When validating an `area` field, warn the developer if `widgets` is not nested in `options`.
* Adds support for supplying CSS variable names to a color field's `presetColors` array as selectable values.
* Adds support for dynamic focus trap in Context menus (prop `dynamicFocus`). When set to `true`, the focusable elements are recalculated on each cycle step.
* Adds option to disable `tabindex` on `AposToggle` component. A new prop `disableFocus` can be set to `false` to disable the focus on the toggle button. It's enabled by default.
* Adds support for event on `addContextOperation`, an option `type` can now be passed and can be `modal` (default) or `event`, in this case it does not try to open a modal but emit a bus event using the action as name.

### Changes

* The `pickerOptions` sub property of a color field's configuration has been merged with it's parent `options` object.
### Fixes

* Focus properly Widget Editor modals when opened. Keep the previous active focus on the modal when closing the widget editor.
* a11y improvements for context menus.
* Fixes broken widget preview URL when the image is overridden (module improve) and external build module is registered.
* Inject dynamic custom bundle CSS when using external build module with no CSS entry point.
* Range field now correctly takes 0 into account.
* Apos style does not go through `postcss-viewport-to-container-toggle` plugin anymore to avoid UI bugs.

## 4.10.0 (2024-11-20)

Expand Down
9 changes: 0 additions & 9 deletions modules/@apostrophecms/asset/lib/webpack/apos/webpack.scss.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
const postcssViewportToContainerToggle = require('postcss-viewport-to-container-toggle');

module.exports = (options, apos) => {
const postcssPlugins = [
...apos.asset.options.breakpointPreviewMode?.enable === true ? [
postcssViewportToContainerToggle({
modifierAttr: 'data-breakpoint-preview-mode',
debug: apos.asset.options.breakpointPreviewMode?.debug === true,
transform: apos.asset.options.breakpointPreviewMode?.transform || null
})
] : [],
'autoprefixer',
{}
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import AposDocContextMenuLogic from 'Modules/@apostrophecms/doc-type/logic/AposD
export default {
name: 'AposDocContextMenu',
mixins: [ AposDocContextMenuLogic ],
// Satisfy linting.
emits: [ 'menu-open', 'menu-close', 'close' ]
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export default {
}
] : [])
];

return menu;
},
customMenusByContext() {
Expand Down Expand Up @@ -394,6 +395,7 @@ export default {
this.customAction(this.context, operation);
return;
}

this[action](this.context);
},
async edit(doc) {
Expand Down Expand Up @@ -449,6 +451,10 @@ export default {
...docProps(doc),
...operation.props
};
if (operation.type === 'event') {
apos.bus.$emit(operation.action, props);
return;
}
await apos.modal.execute(operation.modal, props);
function docProps(doc) {
return Object.fromEntries(Object.entries(operation.docProps || {}).map(([ key, value ]) => {
Expand Down
10 changes: 7 additions & 3 deletions modules/@apostrophecms/doc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ module.exports = {
];

function validate ({
action, context, label, modal, conditions, if: ifProps
action, context, type = 'modal', label, modal, conditions, if: ifProps
}) {
const allowedConditions = [
'canPublish',
Expand All @@ -1503,8 +1503,12 @@ module.exports = {
'canShareDraft'
];

if (!action || !context || !label || !modal) {
throw self.apos.error('invalid', 'addContextOperation requires action, context, label and modal properties.');
if (![ 'event', 'modal' ].includes(type)) {
throw self.apos.error('invalid', '`type` option must be `modal` (default) or `event`');
}

if (!action || !context || !label || (type === 'modal' && !modal)) {
throw self.apos.error('invalid', 'addContextOperation requires action, context, label and modal (if type is set to `modal` or unset) properties.');
}

if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
@create-placeholder="$emit('create-placeholder', $event)"
/>
<div
v-for="item in items"
:key="idFor(item)"
v-for="item in itemsWithKeys"
:key="item.__key"
class="apos-media-manager-display__cell"
:class="{'apos-is-selected': checked.includes(item._id)}"
:style="getCellStyles(item)"
Expand Down Expand Up @@ -162,6 +162,12 @@ export default {
: val
);
}
},
itemsWithKeys() {
return this.items.map((item) => ({
...item,
__key: this.idFor(item)
}));
}
},
watch: {
Expand Down
4 changes: 2 additions & 2 deletions modules/@apostrophecms/schema/ui/apos/logic/AposInputRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
// The range spec defaults to a value of midway between the min and max
// Example: a range with an unset value and a min of 0 and max of 100 will become 50
// This does not allow ranges to go unset :(
if (!this.next) {
if (!this.next && this.next !== 0) {
this.unset();
}
},
Expand All @@ -47,7 +47,7 @@ export default {
},
validate(value) {
if (this.field.required) {
if (!value) {
if (!value && value !== 0) {
return 'required';
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apostrophe",
"version": "4.10.0",
"version": "4.11.2",
"description": "The Apostrophe Content Management System.",
"main": "index.js",
"scripts": {
Expand Down
7 changes: 2 additions & 5 deletions test/esm-project/app.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
export default {
root: import.meta,
shortName: 'esm-project',
baseUrl: 'http://localhost:3000',
modules: {
'@apostrophecms/express': {
options: {
address: '127.0.0.1'
}
},
'@apostrophecms/sitemap': {
options: {
baseUrl: 'http://localhost:3000'
}
}
'@apostrophecms/sitemap': {}
}
};
7 changes: 2 additions & 5 deletions test/workspaces-project/app.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
module.exports = {
root: module,
shortName: 'workspaces-project',
baseUrl: 'http://localhost:3000',
modules: {
'@apostrophecms/express': {
options: {
address: '127.0.0.1'
}
},
'@apostrophecms/sitemap': {
options: {
baseUrl: 'http://localhost:3000'
}
}
'@apostrophecms/sitemap': {}
}
};

0 comments on commit 0b0d0a7

Please sign in to comment.