// flynt-disable enum-value-upper-case
// flynt-disable package-matches-structure
syntax = "proto3";

package com.wixpress.appservice.api;

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

message ComponentInitialSize {
  // The component initial width setting
  InitialSizeSetting width = 1;
  // The component initial height setting
  InitialSizeSetting height = 2;
  // The component will always keep the relationship between width and height when rendered
  // Only usable if width and height were set as 'pixels'
  google.protobuf.BoolValue preserve_aspect_ratio = 3;
}

message SizingTypeEnum {
  enum SizingType {
    UNKNOWN_SizingType = 0;
    content = 1; // Initial size should fit to the [content size](https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content)
    stretched = 2; // Initial size should stretch to the parent size and will keep tracking it unless a user changes it
    pixels = 3; // Initial size should be set in pixels
  }
}


message InitialSizeSetting {
  // The initial size type
  SizingTypeEnum.SizingType sizing_type = 1;

  oneof SelectedSizingType {
    option (.wix.api.aligned_with_enum) = {
      field: "sizing_type";
      suffix: "";
    };
    // The value we should set as initial size in pixels
    int32 pixels = 2 [(wix.api.min) = 1];
  }
}
