SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function saveNamedDraft

    • Applies a draft: defines a new name, or writes the changed fields of an existing one.

      Parameters

      • workbook: IWorkbook
      • draft: NamedDraft
      • target: INamed<any> | null

        The name being edited, or null when adding.

      Returns void

      Error if the name is invalid or already taken — the panel surfaces it and keeps the editor open.

      Every edit is ONE undo entry. Each setter opens its own commit, so a rename plus a redefinition would otherwise unwind a field at a time — and setName re-keys the item in the collection, so a half-undone edit leaves the map keyed on something the item no longer carries.

      Changing the SCOPE is not a field write at all but a delete plus a define, for the reason given at that branch; it is wrapped in its own commit to keep the same one-entry guarantee.