Bot releases are visible (Hide)
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
alinea
export (import {alinea} from 'alinea'
) this shouldcreateNextCMS
function is now deprecated and it is recommended to{createCMS} from 'alinea/next'
instead.alinea
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
Add a preview widget which enables editors to easily switch from previewing
to editing. Enable by setting widget to true:
<cms.previews widget />
Add a function to retrieve the current logged in user:
console.log(await cms.user())
Published by github-actions[bot] 9 months ago
.css
files used for custom fields and views.Published by github-actions[bot] 9 months ago
.css
and .module.css
in custom fields and views.isContainer
optional if contains
is used on Types.Published by github-actions[bot] 9 months ago
Field validation (#369)
Introduces two new Field options available for every Field: required
and
validate
. The required
option will make sure the field value is not empty
when saving. The validate
option can be used to validate the field value
using a custom function. The function should return true
if the value is
valid, false
if it is not valid and a string if it is not valid and a
message should be shown to the user.
alinea.text('Hello field', {
help: 'This field only accepts "hello" as a value',
validate(value) {
if (value !== 'hello') return 'Only "hello" is allowed!'
}
})
Published by github-actions[bot] 9 months ago
condition
option are now constrained with their localePublished by github-actions[bot] 9 months ago
Fix storing extra fields
on the Link field correctly for multiple links.
In conditional configuration functions it's now possible to access fields from
parent contexts. For example field options of a nested field inside a List
field can depend on the value of a field in the entry root.
const innerField = alinea.text('Read-only if status is published')
const Type = alinea.type('Conditional example', {
status: alinea.select('Status', {
draft: 'Draft',
published: 'Published'
}),
list: alinea.list('List', {
schema: {ListRow: alinea.type({innerField})}
})
})
alinea.track.options(innerField, get => {
return {readOnly: get(Type.status) === 'published'}
})
Published by github-actions[bot] 9 months ago
Entry
fields showing up as type unkown
in TypeScript.readOnly
option that is included in all fields will now show a lock itemList
and Rich text
fields.Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
The interval at which Alinea polls the backend for content updates is
now configurable. It can be set in config.syncInterval and overwritten
per query.
// Poll for updates every 60 seconds
const results = await cms.syncInterval(60).find(Entry())
// Disable syncing all for this query in case you want results fast,
// but not necessarily up to date
const matches = await cms.disableSync().find(Entry().search('fast'))
Published by github-actions[bot] 9 months ago
Pages can be queried with search terms.
Any (rich) text field with the searchable
option set to true
is indexed.
const results = await cms.find(Page().search('search', 'terms'))
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
Introduce the shared option for Fields. Fields can be persisted over all
locales if your content is localised by setting the shared
option to true
.
When the entry is published the field data is copied to other locales.
This is currently only supported on the root level, not on nested fields.
const Type = alinea.type('Persist', {
// Persist field data over all locales
sharedField: alinea.text('Shared text', {shared: true})
})
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 9 months ago
Published by github-actions[bot] 10 months ago
Conditional configuration (#364)
All field configuration can be adjusted based on the value of other fields.
After defining fields in a Type a tracker function can be set up.
The tracker function takes a reference to a field and a subscription function.
In the subscription function field values can be retrieved and new options
returned.
const Example = alinea.type('Conditional example', {
textField: alinea.text('Text field'),
readOnly: alinea.check('Make read-only'),
hidden: alinea.check('Hide field')
})
alinea.track.options(Example.textField, get => {
const textField = get(Example.textField)
const readOnly = get(Example.readOnly)
const hidden = get(Example.hidden)
return {
readOnly,
hidden,
help: `Text has ${textField.length} characters`
}
})