li-system-target-length

History
VersionChange
release-2025-05Table dashboard support was added in the 2025-05 release.
release-2025-07Add unit and showExactCountCheckbox config support.
release-2025-09Support an array in the unit config to enable both selectors in the UI.

Supported Features

Document
Media
Include
Document Creation Flow
Push Message
Table Dashboard
Display Filter
Search Indexing
System Metadata
Webhook Conditions

Description

This plugin is used to provide a suggested total character count for the text in the document.

Added in: release-2025-09 When the unit config is set to an array containing both characters and lines, the plugin displays automatic unit conversion next to the input field (e.g., “~ 125 lines” or “~ 10,000 characters”). The steps value must always be in characters when using this feature.

Default UI

Input: Number input, or slider if steps are defined.

Editor: Difference, Total Characters, Target Range, Characters in Focussed Component

Target Length Indicator

Storage Format

{
  characters: <Integer>
}

Content Type Config

{
  handle: 'myContentType',
  // ...
  metadata: [
    {
      handle: 'myHandle'
      type: 'li-system-target-length',
      ui: {
        config: {
          acceptedCharacterDifference: 20, // Range above and below `value` considered accepted
          // optional, allows picking a step instead of entering an exact number
          steps: [
            {
              label: 'S', // use a short one, e.g. "S" "M" "L"
              value: 100 // number of characters
            },
            {
              label: 'M',
              value: 200
            }
          ],
          // optional, allows the input of an exact number besides picking a step
          allowAnyNumber: true,
          // Define whether the target size is measured in `characters` or `lines`.
          // In case of `lines` the lineCountFraction needs to be defined because internally everything is stored in characters.
          // Use a string with either 'characters' or 'lines' (Added in: release-2025-07)
          //   unit: 'characters' (this is the default)
          // Or or use an array for unit conversion display: (Added in: release-2025-09)
          //   unit: ['characters', 'lines']
          unit: 'lines',
          // optional, Added in: release-2025-07
          showExactCountCheckbox: true
        }
      }
    }
    // ...
  ]
}