CoreMedia CKEditor 5 Plugins
    Preparing search index...

    Proxy to manipulate text nodes. General contract is, that all modifications are temporary, until you decide to persist the changes. Note, that a persisted proxy should not be re-used as it may cause unexpected results or may even fail.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Constructor.

      Parameters

      • delegate: Text

        the original text node to wrap

      • editor: Editor

        CKEditor instance

      • mutable: boolean = true

        signals, if this proxy should be mutable; trying to modify an immutable proxy will raise an error.

      Returns TextProxy

    Properties

    editor: Editor

    Represents the editor instance. May be used to access configuration options for example.

    Mimics TextFilterParams, which helps to deal with rule processing.

    node: TextProxy = ...

    Represents the node instance. For TextProxy this is just the proxy class itself.

    Mimics TextFilterParams, which helps to deal with rule processing.

    parentRule: TextFilterRule = ...

    Represents the parent rule. No-Operation rule for TextProxy.

    Mimics TextFilterParams, which helps to deal with rule processing.

    Accessors

    • get delegate(): N

      Returns the wrapped delegate.

      This delegate should not be used for directly manipulating the DOM, as nested rules may not veto applied changes.

      If a manipulation is done, it must be ensured, that previously run rules on this node may be rerun. It is generally considered safe to do manipulation to child elements, as these are processed after this node, so that all applicable rules have a chance to modify these nodes again.

      Returns N

    • get empty(): boolean

      Signals, if this node is empty, thus, has no child nodes.

      Returns boolean

      isEmpty

    • get lastNode(): boolean

      Signals, if this is the last node in parent. Always false if no parent exists.

      Returns boolean

    • get mutable(): boolean

      Signals, if this element is mutable.

      Returns boolean

    • get name(): string

      Retrieves the name of the node (lower case).

      Returns string

    • get ownerDocument(): Document

      Access owner document.

      Returns Document

    • get parentElement(): NodeProxy<HTMLElement> | null

      Access to the parent element of this node.

      Returns NodeProxy<HTMLElement> | null

    • get parentNode(): NodeProxy<Node & ParentNode> | null

      Access to the parent node of this node.

      Returns NodeProxy<Node & ParentNode> | null

    • get realName(): string

      Retrieves the name of the node (lower case). If renaming is supported by this instance, it may differ from name, otherwise, it is the same.

      Returns string

    • get remove(): boolean

      Signals, if this node is meant to be removed. This includes recursive removal (including children) as well as just removing this node (replacing it by its children).

      Returns boolean

    • set remove(remove: boolean): void

      Signals, if this mutable element represents a state, where the element shall be removed, including all its children.

      It is important to note, that setting this modifies the NodeProxy#state, thus setting this overrides any other decisions upon the state of the node.

      Duplicate Spaces: If you apply this modification, it may end up having duplicate space characters in your DOM. For example if removing the `` element (and all its children) in this scenario:

      Lorem Ipsum Dolor
      
      you will end up having:
      Lorem  Dolor
      
      with two white space characters in the middle. You may want to detect such states, and remove the duplicate space. You shouldn't do this, though, if you are within a space preserving context such as `
      `.

      Parameters

      • remove: boolean

      Returns void

    • get removeChildren(): boolean

      Signals, if this node represents a state, where the children of the node should be removed.

      Returns boolean

    • set removeChildren(remove: boolean): void

      Sets, if this node represents a state, where the children of the node shall be removed.

      It is important to note, that setting this modifies the NodeProxy#state, thus setting this overrides any other decisions upon the state of the node.

      Parameters

      • remove: boolean

        true to mark as remove children; false otherwise.

      Returns void

    • get replaceByChildren(): boolean

      Signals, if this node represents a state, where the node shall be removed, while attaching the children to the parent node.

      Returns boolean

    • set replaceByChildren(replace: boolean): void

      Sets, if this node represents a state, where the node shall be removed, while attaching the children to the parent node.

      It is important to note, that setting this modifies the NodeProxy#state, thus setting this overrides any other decisions upon the state of the node.

      Parameters

      • replace: boolean

        true to mark as replace with children; false otherwise.

      Returns void

    • get singleton(): boolean

      Signals, if this is the only child node at parent node.

      Returns boolean

    • get textContent(): string

      Gets the text content, which may be overridden.

      Returns string

    • set textContent(value: string): void

      Sets the text content. Only allowed in mutable state.

      Parameters

      • value: string

        text content to set.

      Returns void

    Methods

    • Apply given rules. If any of the rules will invalidate this node either by deletion or by replacing it, no further rules will be applied.

      Parameters

      • ...rules: (TextFilterRule | undefined)[]

        rules to apply in given order

      Returns Node | null

      a node, if filtering should be restarted from this node; null otherwise.

    • Wraps the given node into a NodeProxy. If the node is falsy, null will be returned.

      Type Parameters

      • T extends Node

      Parameters

      • node: T | null | undefined

        node to wrap

      • mutable: boolean = true

        signals, if this representation is mutable or not

      Returns NodeProxy<T> | null

      NodeProxy for given node; null for falsy values