10.3.0
@dextinity/admin@10.3.0
Patch Changes
-
4d6408f: Fix
FormMutationthrowing when renderedFormMutationaccessed its children throughthis.propsalthough it is a function component. Modules are always in strict mode, sothiswasundefinedand rendering the component failed withTypeError: Cannot read properties of undefined (reading 'props').
@dextinity/cms-admin@10.3.0
Minor Changes
-
504c97f: Expose
setPageStatein theusePagehook returned bycreateUsePageUntil now, the page state could only be read, so features that modify a page's content had to be built into
createUsePageitself (liketranslateContent).
setPageStateallows applications to change the page's content programmatically, for instance, to apply changes suggested by an assistant.
The changes are applied locally only,handleSavePagepersists them.Additionally, the
PageStatetype is exported now.Example
const { pageState, setPageState } = usePage({ pageId: id }); const applySuggestedHtmlTitle = (htmlTitle: string) => { setPageState((pageState) => { if (!pageState?.document) { return pageState; } return { ...pageState, document: { ...pageState.document, seo: { ...pageState.document.seo, htmlTitle }, }, }; }); };
-
ddea65d: Remove the "Permissions" and "Scopes" columns from the user permissions users list
The users list now shows the name, the email and the row actions. The
permissionsCountandcontentScopesCountfields ofUserPermissionsUserare deprecated and now return0. They will be removed in the next major version. -
66cb98a: DAM: Allow replacing a file with a file of the same category instead of the same mimetype
Previously, "Replace File" only accepted a file with the exact same mimetype, so a JPEG couldn't be replaced by a WebP even though both are pixel images. Now a file can be replaced by any file of the same category:
Category Examples pixelImageJPEG, PNG, WebP svgImageSVG audioMP3, OGG, WAV videoMP4, WebM, QuickTime documentPDF, DOCX, VTT, ZIP SVG images and pixel images remain separate categories.
Files in the
documentcategory still require the exact same mimetype, since their purposes vary too much: a VTT file is a video's subtitles, whereas a PDF is a download, so replacing one with the other must not be possible.The file's usages stay unchanged. Only the extension of the file's name is adjusted to match the new file (for instance,
photo.jpgbecomesphoto.webp). If a file with that name already exists in the same folder, a counter is appended to keep the name unique (for instance,photo-2.webp), and the Admin shows a snackbar informing about the new name.The new
getDamFileCategoryhelper is exported from both packages:import { getDamFileCategory } from "@dextinity/cms-api"; // or "@dextinity/cms-admin" getDamFileCategory("image/webp"); // "pixelImage" getDamFileCategory("image/svg+xml"); // "svgImage"
Patch Changes
-
12be273: Fix the block list not marking the block that is hovered in a block preview
HoverPreviewComponentbuilt the block's route fromuseRouteMatch, which does not see the path of aSubRoute. Below aSaveBoundarythe route therefore missed that segment and never matched the route the preview reports, so hovering a block in the preview left its list entry unmarked, and hovering a list entry left the block in the preview unmarked. The route is now built fromuseSubRoutePrefix, the prefix the block routes inBlockPreviewContextalready use. -
876887b: Fix order of
linkand special character (nonBreakingSpace,softHyphen) buttons in the TipTap rich text block toolbarThey were swapped;
linknow appears before the special character buttons. -
0c211e9: Stop deduplicating content scopes in the user permissions API
UserPermissionsService.getAvailableContentScopes(),getContentScopes()andgetPermissionsAndContentScopes()no longer deduplicate their content scopes. Deduplication only mattered for how the scopes are displayed, so it now happens in the admin where the lists are rendered. This also removes thelodash.uniqwithdependency.Projects that consume
UserPermissionsPublicServiceor thecurrentUser/availableContentScopesGraphQL fields directly and rely on the scopes being unique should deduplicate them on their side.
@dextinity/cms-api@10.3.0
Minor Changes
-
0c211e9: Stop deduplicating content scopes in the user permissions API
UserPermissionsService.getAvailableContentScopes(),getContentScopes()andgetPermissionsAndContentScopes()no longer deduplicate their content scopes. Deduplication only mattered for how the scopes are displayed, so it now happens in the admin where the lists are rendered. This also removes thelodash.uniqwithdependency.Projects that consume
UserPermissionsPublicServiceor thecurrentUser/availableContentScopesGraphQL fields directly and rely on the scopes being unique should deduplicate them on their side. -
ddea65d: Remove the "Permissions" and "Scopes" columns from the user permissions users list
The users list now shows the name, the email and the row actions. The
permissionsCountandcontentScopesCountfields ofUserPermissionsUserare deprecated and now return0. They will be removed in the next major version. -
66cb98a: DAM: Allow replacing a file with a file of the same category instead of the same mimetype
Previously, "Replace File" only accepted a file with the exact same mimetype, so a JPEG couldn't be replaced by a WebP even though both are pixel images. Now a file can be replaced by any file of the same category:
Category Examples pixelImageJPEG, PNG, WebP svgImageSVG audioMP3, OGG, WAV videoMP4, WebM, QuickTime documentPDF, DOCX, VTT, ZIP SVG images and pixel images remain separate categories.
Files in the
documentcategory still require the exact same mimetype, since their purposes vary too much: a VTT file is a video's subtitles, whereas a PDF is a download, so replacing one with the other must not be possible.The file's usages stay unchanged. Only the extension of the file's name is adjusted to match the new file (for instance,
photo.jpgbecomesphoto.webp). If a file with that name already exists in the same folder, a counter is appended to keep the name unique (for instance,photo-2.webp), and the Admin shows a snackbar informing about the new name.The new
getDamFileCategoryhelper is exported from both packages:import { getDamFileCategory } from "@dextinity/cms-api"; // or "@dextinity/cms-admin" getDamFileCategory("image/webp"); // "pixelImage" getDamFileCategory("image/svg+xml"); // "svgImage"
Patch Changes
-
3ffe174: Throw a validation error for malformed UUID id args in
@AffectedEntityThe permission check loads affected entities before input validation (e.g.,
@IsUUID()) runs, because guards execute before pipes. A malformed UUID therefore reached PostgreSQL, which failed withinvalid input syntax for type uuidand surfaced as an internal server error.Now id args for entities with a UUID primary key (and
pageTreeNodeIdArgvalues) are validated upfront, and aDextinityValidationExceptionis thrown for malformed UUIDs.
@dextinity/cli@10.3.0
Minor Changes
-
7e3a30f: Add
TipTapNodetype togenerate-block-typesoutput and use it for TipTap rich text blocksTipTap rich text blocks were typed as
unknown, forcing consumers to cast the content before rendering it.
They are now typed asTipTapNode, which is generated intoblocks.generated.ts(together withTipTapMark) whenever a TipTap rich text block is used.Example
// Before const content = data.tipTapContent as TipTapNode; // After const content = data.tipTapContent;