syntax = "proto3";

package com.wixpress.appservice.api.upstream.wix.forms.templates.v2;
option java_package = "com.wixpress.appservice.api.upstream.wix.forms.templates.v2";


import "google/protobuf/wrappers.proto";
import "wix/api/validations.proto";
import "wix/api/annotations.proto";
import "wix/rich_content/v1/rich_content.proto";

message DisplayField {
    option (.wix.api.decomposite_of) = "wix.forms.v4.fields.DisplayField";
  enum DisplayFieldType {
    UNKNOWN_FIELD_TYPE = 0;
    RICH_CONTENT = 1;
    PAGE_NAVIGATION = 2;
    LOGIN_BAR = 3;
  }

  // Type of the display field
  DisplayFieldType display_field_type = 1;

  oneof display_field_type_options {
    option (.wix.api.aligned_with_enum).field = "display_field_type";
    // Component displaying rich content
    RichContentOptions rich_content_options = 2;
    // Page navigation component resolving as navigation or submit buttons
    PageNavigationOptions page_navigation_options = 3;
  }
}

message RichContentOptions{
    option (.wix.api.decomposite_of) = "wix.forms.v4.fields.RichContentOptions";
  // Content of the header
  .wix.rich_content.v1.RichContent rich_content = 1 [(.wix.api.translatable) = {
    name: "Content"
    hidden: false
    grouping: "formFields"
    type: RICH_CONTENT_EDITOR
  }];

  // Number of paragraphs visible. Other part is hidden under expandable section. If not provided all text visible.
  google.protobuf.Int32Value max_shown_paragraphs = 2;
}

message PageNavigationOptions {
    option (.wix.api.decomposite_of) = "wix.forms.v4.fields.PageNavigationOptions";
  // When button is not on last page it behaves as switch between pages page, text of label to go to next page.
  google.protobuf.StringValue next_page_text = 1 [(.wix.api.maxLength) = 65, (.wix.api.translatable) = {
    name: "Next Page Button Text"
    hidden: false
    grouping: "formFields_submitBtn"
    type: SHORT_TEXT
  }];

  // When button is not on last page it behaves as switch between pages page, text of label to go to previous page.
  google.protobuf.StringValue previous_page_text = 2 [(.wix.api.maxLength) = 65, (.wix.api.translatable) = {
    name: "Previous Page Button Text"
    hidden: false
    grouping: "formFields_submitBtn"
    type: SHORT_TEXT
  }];

  // Text on the button when button is submitting a form
  google.protobuf.StringValue submit_text = 3 [(.wix.api.maxLength) = 65, (.wix.api.translatable) = {
    name: "Submit Button Text"
    hidden: false
    grouping: "formFields_submitBtn"
    type: SHORT_TEXT
  }];
}
