Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 02 Dec 13:45
· 73 commits to develop since this release
d2e4ed9

Minor Changes

  • #26 298f915 Thanks @kriss145! - The plugin's exports drop the Cms prefix: CmsTableConfig is TableConfig, defineCmsOptionsHook is defineOptionsHook. Three take another name: CmsText is ConfigText, CmsDocument is DocumentRow, and CmsBlockPlace is BlockPlaceLevel. The workflows and steps keep their names. ConfigValue, DefaultsValue, RichTextTextFormat, ResolvedRichTextFeatureOf and CmsDocumentSource are no longer exported.

  • #26 24be38d Thanks @kriss145! - Rich text has an entry of its own, @mostrajs/cms/shared/rich-text, with shorter names, and @mostrajs/cms/shared keeps 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/shared Now, from @mostrajs/cms/shared/rich-text
      validateRichText validateDocument
      parseRichText parseDocument
      isRichTextEmpty isDocumentEmpty
      buildRichTextRenderTree buildRenderTree
      findRichTextFeature findFeature
      DEFAULT_RICH_TEXT_FEATURES DEFAULT_FEATURES
      RICH_TEXT_HEADINGS HEADINGS

      formatHtml, formatPlainText, the feature factories and the RichText* and Render* types keep their names and move to the new entry too. The package root exports findFeature in place of findRichTextFeature. RichText stays 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 e0268a2 Thanks @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_FEATURES and the features a richText.features function gets are typed as read-only lists. A config that pushes into DEFAULT_FEATURES, defaultFeatures or rootFeatures, or types them as ResolvedRichTextFeature[], 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 400 at the field, where a very deep one failed with a 500. 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 b675367 Thanks @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.features is a function of defaultFeatures. To keep the fields as they were, filter the five out in the config's richText.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(), and SuperscriptFeature(), from the package root and @mostrajs/cms/shared/rich-text.
    • The render keys underline, strikethrough, inlineCode, subscript, and superscript, for your own component of each.
    • A save refuses a text that is both subscript and superscript.
  • #24 67e8a94 Thanks @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 b1f2b03 Thanks @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.