github payloadcms/payload v3.0.0-beta.21

pre-release6 months ago

3.0.0-beta.21 (2024-05-01)

Features

  • richtext-lexical: various validation improvements (#6163) (d8f91cc)
  • richtext-lexical: add validation to link and upload nodes (8829fba)
  • richtext-lexical: link node: disable client-side link validation. This allows overriding validation behavior by providing your own url field to the Link feature. (01f38c4)
  • richtext-lexical: change link fields handling (#6162) (5a82f34)
  • richtext-lexical: initialize lexical during sanitization (#6119) (d9bb51f)
  • richtext-lexical: implement relationship node click and delete/backspace handling (#6147) (181f82f)
  • implement resend rest email adapter (#5916) (3d50caf)

Bug Fixes

  • templates: updates payload app files (#6172) (04f1df8)
  • deps: move file-type to deps (#6171) (1c490ae)
  • various loader issues (#6090) (568b074)
  • add missing error logger to buildFormState error catch (10b99ce)
  • richtext-slate: do not add empty fields group if no custom fields are added (5420d88)
  • richtext-lexical: floating toolbar caret positioned incorrectly for some line heights (#6149) (9a636a3)
  • richtext-lexical: drag and add block handles disappear too quickly for smaller screen sizes. (#6144) (6a9cde2)
  • blocks non-admin users from admin access (#6127) (4d7ef58)
  • importWithoutClientFiles not working due to incorrect import path used (cd5e8d7)
  • loader: typescript module resolver not resolving to source path of symlinked module (fa2083f)

BREAKING CHANGES

  • richtext-lexical: various validation improvement (#6163) (d8f91cc)

This will now display errors if you're previously had invalid link or upload fields data - for example if you have a required field added to an uploads node and did not provide a value to it every time you've added an upload node

  • richtext-lexical: change link fields handling (#6162) (5a82f34)
  • Drawer fields are no longer wrapped in a fields group. This might be breaking if you depend on them being in a field group in any way - potentially if you use custom link fields. This does not change how the data is saved
  • If you pass in an array of custom fields to the link feature, those were previously added to the base fields. Now, they completely replace the base fields for consistency. If you want to ADD fields to the base fields now, you will have to pass in a function and spread defaultFields - similar to how adding your own features to lexical works

Example Migration for ADDING fields to the link base fields:

Previous:

 LinkFeature({
    fields: [
      {
        name: 'rel',
        label: 'Rel Attribute',
        type: 'select',
        hasMany: true,
        options: ['noopener', 'noreferrer', 'nofollow'],
        admin: {
          description:
            'The rel attribute defines the relationship between a linked resource and the current document. This is a custom link field.',
        },
      },
    ],
  }),

Now:

 LinkFeature({
    fields: ({ defaultFields }) => [
      ...defaultFields,
      {
        name: 'rel',
        label: 'Rel Attribute',
        type: 'select',
        hasMany: true,
        options: ['noopener', 'noreferrer', 'nofollow'],
        admin: {
          description:
            'The rel attribute defines the relationship between a linked resource and the current document. This is a custom link field.',
        },
      },
    ],
  }),
"
  • richtext-lexical: initialize lexical during sanitization (#6119) (d9bb51f)
  • sanitizeFields is now an async function
  • the richText adapters now return a function instead of returning the adapter directly"

Don't miss a new payload release

NewReleases is sending notifications on new releases.