Repository navigation
v0.2.0
Minor Changes
-
#26
298f915Thanks @kriss145! - The plugin's exports drop theCmsprefix:CmsTableConfigisTableConfig,defineCmsOptionsHookisdefineOptionsHook. Three take another name:CmsTextisConfigText,CmsDocumentisDocumentRow, andCmsBlockPlaceisBlockPlaceLevel. The workflows and steps keep their names.ConfigValue,DefaultsValue,RichTextTextFormat,ResolvedRichTextFeatureOfandCmsDocumentSourceare no longer exported. -
#26
24be38dThanks @kriss145! - Rich text has an entry of its own,@mostrajs/cms/shared/rich-text, with shorter names, and@mostrajs/cms/sharedkeeps the sanitizers and the slug.Behaviour changes - read before upgrading
-
Import rich text from
@mostrajs/cms/shared/rich-text, and rename what you use:Before, from @mostrajs/cms/sharedNow, from @mostrajs/cms/shared/rich-textvalidateRichTextvalidateDocumentparseRichTextparseDocumentisRichTextEmptyisDocumentEmptybuildRichTextRenderTreebuildRenderTreefindRichTextFeaturefindFeatureDEFAULT_RICH_TEXT_FEATURESDEFAULT_FEATURESRICH_TEXT_HEADINGSHEADINGSformatHtml,formatPlainText, the feature factories and theRichText*andRender*types keep their names and move to the new entry too. The package root exportsfindFeaturein place offindRichTextFeature.RichTextstays in@mostrajs/cms/shared/rich-text/renderers/react.// before import { escapeHtml, formatHtml, parseRichText } from "@mostrajs/cms/shared" // now import { escapeHtml } from "@mostrajs/cms/shared" import { formatHtml, parseDocument } from "@mostrajs/cms/shared/rich-text"
-
Patch Changes
-
#26
e0268a2Thanks @kriss145! - The rich text editor shows lists and bold italic text as they are saved on a project that installs the plugin from npm, and it follows a field that is disabled or enabled after it shows.Behaviour changes - read before upgrading
-
DEFAULT_FEATURESand the features arichText.featuresfunction gets are typed as read-only lists. A config that pushes intoDEFAULT_FEATURES,defaultFeaturesorrootFeatures, or types them asResolvedRichTextFeature[], fails to compile. Build a new list instead:features: ({ defaultFeatures }) => [ ...defaultFeatures.filter(({ key }) => key !== "heading"), HeadingFeature({ enabledHeadingSizes: ["h2"] }), ]
Fixes
- A bulleted list shows its bullets and a numbered list its numbers, where both showed no marker.
- Text that is both bold and italic shows in italic too.
- The last paragraph leaves no empty space below it.
- A rich text field of the form toolkit that a form disables after it shows becomes read-only, and editable again once enabled, where only its toolbar changed.
- A save refuses a rich text document nested more than 64 levels deep with a
400at the field, where a very deep one failed with a500. The renderers already drop what sits below that level. - A save refuses a link whose title holds a control character, and a text format holding a bit Lexical gives no format.
- A rich text field whose editor fails, on a stored text it cannot read or a chunk that fails to load, shows a message in its place, and the rest of the form keeps its changes.
-
-
#26
b675367Thanks @kriss145! - A rich text field offers underline, strikethrough, inline code, subscript, and superscript, and the plugin's renderers draw them as<u>,<s>,<code>,<sub>, and<sup>.Behaviour changes - read before upgrading
-
A rich text field that uses the default features shows the five new format buttons after the upgrade. So does a config whose
richText.featuresis a function ofdefaultFeatures. To keep the fields as they were, filter the five out in the config'srichText.features:features: ({ defaultFeatures }) => defaultFeatures.filter( ({ key }) => ![ "underline", "strikethrough", "inlineCode", "subscript", "superscript", ].includes(key) )
-
A storefront that renders rich text by hand and ignores the new format bits shows such text unstyled. The rich text format lists every bit.
Features
UnderlineFeature(),StrikethroughFeature(),InlineCodeFeature(),SubscriptFeature(), andSuperscriptFeature(), from the package root and@mostrajs/cms/shared/rich-text.- The render keys
underline,strikethrough,inlineCode,subscript, andsuperscript, for your own component of each. - A save refuses a text that is both subscript and superscript.
-
-
#24
67e8a94Thanks @kriss145! - The last button of a rich text toolbar opens the editor over the whole Admin, and Escape closes it with the text and undo kept. -
#26
b1f2b03Thanks @kriss145! - The bold and italic buttons of a rich text toolbar show their letters in bold and in italic on a project that installs the plugin from npm.