syntax = "proto3";

package com.wixpress.appservice.api;

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

message BaseInfo {
    // The name of the component
    string name = 1 [(wix.api.minLength) = 1, (wix.api.maxLength) = 30, (wix.api.translatable) = {
        type: SHORT_TEXT
        name: "Name"
        grouping: "name"
    }];
    // The internal id of the component by the own app
    string id = 3;
    // The description of the component by the own app
    string description = 4 [(wix.api.maxLength) = 130, (wix.api.translatable) = {
        type: LONG_TEXT
        name: "Description"
        grouping: "description"
    }];
    // Reference to help articles about the widget
    HelpResources help_resources = 5;
    reserved 2;
}

message HelpResources {
    // The Wix Answers' article related to the component (chosen by own app)
    string article_id = 1 [(wix.api.format) = GUID];
}

message BaseInstallation {
    // Auto add component to stage
    bool auto_add = 1;

    // Mark component as essential for the existence of the app (force to delete the whole app)
    bool essential = 2;

    // Max instances of the component that can be on site
    //flynt-disable field-type-breaking-change
    google.protobuf.Int32Value max_instances = 3 [(wix.api.min) = 0];
}

message PageEditorSettings {
    // Add the page to the site menu
    google.protobuf.BoolValue add_to_site_menu = 1;
    // Can a page be linked through the link panel
    google.protobuf.BoolValue linkable = 2;
    // Can a page be duplicated in the editor (if no essential widget is added in the container)
    google.protobuf.BoolValue duplicatable = 3;
}

message PageWidgetAsContent {
    // GUID of widget to use as content of page
    string widget_guid = 1 [(.wix.api.format) = GUID];
    // The preset should be used
    MainPresets preset = 2;
     // Mark widget as essential for the existence of the app (force to delete the whole app)
    bool essential = 3;
}

enum StaticContainer {
    UNKNOWN_CONTAINER = 0;
    HOMEPAGE = 1; // Widget should be installed in the homepage
}

message DefaultPresets {
    // Default preset ID in small (mobile) breakpoint
    google.protobuf.StringValue small = 1 [(wix.api.minLength) = 1, (wix.api.maxLength) = 50];
    // Deprecated, use default - Default preset ID in large (desktop) breakpoint
    google.protobuf.StringValue large = 3 [(wix.api.minLength) = 1, (wix.api.maxLength) = 50, deprecated = true, (.wix.api.field_deprecated) = {
        replaced_by: "default"
        target_removal_date: "2025-12-02"
    }];
    // Default preset ID
    google.protobuf.StringValue default = 4 [(wix.api.minLength) = 1, (wix.api.maxLength) = 50];

    reserved 2; // Future support for medium (tablet) breakpoint
}
