{#
    This is the root node of the document.

    Expect sdoc_entity = document.
#}

{% set is_not_standalone = view_object.project_config.is_running_on_server and not view_object.standalone %}

<turbo-frame
{%- if is_not_standalone %}
  id="article-{{ sdoc_entity.reserved_mid }}"
{% endif -%}
>

  <sdoc-node
    {%- if is_not_standalone %}
      data-editable_node="on"
    {%- endif %}
    node-role="root"
    data-testid="node-root"
  >

    {#
      copy_to_clipboard must be defined befor sdoc_entity block,
      and define them in node components that have editing options:
      node & root
    #}
    {%- set copy_to_clipboard = True -%}

    {# sdoc_entity #}
    {% block sdoc_entity %}
    {% endblock sdoc_entity %}

    {%- if not sdoc_entity.section_contents and view_object.document_type.is_document() -%}
      <sdoc-main-placeholder data-testid="document-root-placeholder">
        The document is empty.
        <br/>Start adding text, sections, and requirements.
      </sdoc-main-placeholder>
    {%- endif -%}

    {# node_controls #}
    {%- if is_not_standalone -%}
    {% include "components/node/node_controls/index.jinja" %}
    {%- endif -%}

  </sdoc-node>
</turbo-frame>
