syntax = "proto3";

package com.wixpress.appservice.api;

import "google/protobuf/wrappers.proto";
import "wix/api/annotations.proto";
import "wix/api/validations.proto";
import "components_catalog_common.proto";
import "components_catalog_data/dts_definition_reference.proto";

// A modal in one of the back-office platforms
message BackOfficeModal {
  // Platform that hosts the modal.
  //
  // Must be `"BUSINESS_MANAGER"`.
  BackOfficeHostingPlatforms hosting_platform = 1;
  // Modal content.
  oneof content {
    // Iframe URL that hosts the modal's content.
    string iframe_url = 2 [(wix.api.format) = WEB_URL];
    BackOfficeScriptAsset script_asset = 3 [(wix.api.field_exposure) = INTERNAL];
  }
  // Modal title.
  string title = 4 [(.wix.api.minLength) = 1, (wix.api.translatable) = {
    type: SHORT_TEXT
    grouping: "title"
  }];
  // Permissions required to open the modal.
  string required_permission = 5 [(wix.api.field_exposure) = INTERNAL];
  // Sentry error reporting DSN
  ErrorReporting error_reporting = 6 [(wix.api.field_exposure) = INTERNAL];
  // Initial width of the modal while loading, in pixels.
  // Width may be adjusted dynamically based on the content of the modal or limited by the size of the modal's container.
  google.protobuf.Int32Value width = 7 [(wix.api.min) = 0, (wix.api.max) = 9999];
  // Initial height of the modal while loading, in pixels.
  // Height may be adjusted dynamically based on the content of the modal or limited by the size of the modal's container.
  google.protobuf.Int32Value height = 9 [(wix.api.min) = 0, (wix.api.max) = 9999];
  // general component data
  ComponentMetaData meta_data = 10;
  // [Wix Design System icon](https://www.wix-pages.com/wix-design-system-employees/?path=/story/foundations-icons--icons).
  // Use the full size key. The icon will be rendered in an appropriate size.
  google.protobuf.StringValue icon_key = 11 [(wix.api.minLength) = 3, (wix.api.maxLength) = 50];
  // The list of slot ids available
  repeated string slot_ids = 12 [(wix.api.field_exposure) = INTERNAL, (wix.api.format) = GUID, (.wix.api.maxSize) = 100, (.wix.api.referenced_entity) = "wix.devcenter.components.v1.component"];
  // Specifying the visibility level and maturity stage
  // flynt-disable renamed-field-breaking-change
  ExtensionExposure exposure_and_maturity = 13 [(.wix.api.field_exposure) = INTERNAL];
  // The parameters to pass to the modal
  // flynt-disable renamed-field-breaking-change
  ModalParams modal_params = 14 [(wix.api.field_exposure) = INTERNAL];
}

message ModalParams {
  // Reference to the .d.ts file for defining the modal's parameters.
  DtsDefinitionReference parameters_dts_definition = 1 [(wix.api.field_exposure) = INTERNAL];
  // Named export to use.
  google.protobuf.StringValue named_export = 2 [(.wix.api.maxLength) = 400];   
}