DocumentionmobileConfigurationDocument Configuration

Document Configuration

Used to configure the document identifier, title, content, editing behavior, and auto-save strategy in Umo Editor Mobile.

Compared with Umo Editor and Umo Editor Next, the mobile document configuration puts more emphasis on switching between reading and editing, touch input, and lightweight integration. It keeps only the document.id field required for basic collaboration.

Default Configuration

{
  document: {
    id: '',
    title: '',
    content: '',
    placeholder: {
      en_US: 'Please enter the document content...',
      zh_CN: '่ฏท่พ“ๅ…ฅๆ–‡ๆกฃๅ†…ๅฎน...',
    },
    structure: 'block+',
    enableSpellcheck: true,
    enableMarkdown: true,
    enableBubbleMenu: true,
    enableNodeId: false,
    readOnly: false,
    characterLimit: 0,
    typographyRules: {},
    editorProps: {},
    parseOptions: {
      preserveWhitespace: 'full',
    },
    autoSave: {
      enabled: true,
      interval: 300000,
    },
  },
}

Configuration Items

document.id

Description: unique document identifier. In online collaboration mode, this field is used to uniquely locate the current collaborative document.

Type: String

Default: ''

document.title

Description: document title. It can be updated dynamically through setDocument. The mobile top navigation and the rename capability in the โ€œMoreโ€ panel both revolve around this field.

Type: String

Default: ''

document.content

Description: initial document content. It can be an HTML string or a Tiptap-supported data structure. The content is transformed before being passed into Tiptap when the editor instance is created.

In online collaboration mode, this field no longer acts as the content source. The actual content comes from the collaboration service and is synchronized through the Yjs document. Different in Collaboration Mode

Type: String | Object

Default: ''

document.placeholder

Description: placeholder shown when the document content is empty.

Type: String | Object

Supported locale keys:

  • zh_CN
  • en_US

document.structure

Description: forces document structure constraints. Its semantics follow the content structure rules of Tiptap / ProseMirror.

Type: String

Default: block+

document.enableSpellcheck

Description: whether to enable browser spellcheck.

Type: Boolean

Default: true

document.enableMarkdown

Description: whether to enable Markdown input rules.

Type: Boolean

Default: true

document.enableBubbleMenu

Description: whether to enable the bubble menu.

Type: Boolean

Default: true

document.enableNodeId

Description: whether to generate unique identifiers for document nodes.

Type: Boolean

Default: false

document.readOnly

Description: whether to open the document in read-only mode. Setting it to true makes it better suited for mobile reading, approval, and review scenarios.

Type: Boolean

Default: false

document.characterLimit

Description: document character limit. A value of 0 means no limit.

Type: Number

Default: 0

document.typographyRules

Description: typography replacement rule configuration, passed to the Tiptap Typography extension.

Type: Object

Default: {}

document.editorProps

Description: passes low-level ProseMirror EditorProps, such as custom DOM attributes or event handling.

Type: Object

Default: {}

document.parseOptions

Description: configures ProseMirror document parsing behavior.

Type: Object

Default: { preserveWhitespace: 'full' }

document.autoSave

Description: auto-save configuration. When enabled, the save flow is triggered after content changes based on the configured interval.

In online collaboration mode, mobile does not use the local auto-save state machine, so this configuration no longer drives automatic saving. Different in Collaboration Mode

Type: Object

Default: { enabled: true, interval: 300000 }

Configuration:

  • enabled: Boolean, whether auto-save is enabled
  • interval: Number, auto-save interval in milliseconds

Key Differences from Desktop

  • id is used by the basic collaboration workflow on mobile to identify the collaboration document. Collaboration-Related
  • autofocus is not supported on mobile because auto focus in mobile browsers and WebViews is often limited by soft keyboard strategy, host container behavior, and user gesture requirements, which can cause autofocus to fail. Not Supported
  • enableBlockMenu is not supported on mobile because mobile does not provide the desktop-style block menu capability. Not Supported
  • readOnly has greater importance on mobile, because many interactions are built directly around switching between reading mode and editing mode. Mobile-Only