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_data/plugin-interface.proto";
import "components_catalog_data/unified_components/plugin_installation_settings.proto";

// A component to be rendered within Widget Slots
message WidgetPluginComponentData {
    // ID of the widget used for the plugin component.
    string reference_component_id = 1 [(wix.api.format) = GUID];

    // APIs implemented by the Plugin's widget.
    repeated PluginInterface plugin_interfaces = 2;

    // Marketing information about the plugin.
    PluginMarketData market_data = 3;

    // List of placements where the plugin is allowed to be installed.
    repeated PluginPlacement placements = 4;

    // Widget plugin installation settings.
    //flynt-disable field-type-breaking-change
    PluginInstallationSettings installation = 5;

    // List of placements where the plugin is allowed to be installed.
    repeated string placements_slot_ids = 6 [(wix.api.field_exposure) = INTERNAL, (wix.api.format) = GUID, (.wix.api.maxSize) = 100, (.wix.api.referenced_entity) = "wix.devcenter.components.v1.component"];

    // Marketing information about the plugin.
    message PluginMarketData {
        // Plugin name.
        string name = 1 [(wix.api.minLength) = 1, (wix.api.maxLength) = 50, (wix.api.translatable) = {
            type: SHORT_TEXT
            name: "Name"
            grouping: "name"
        }];

        // Plugin description.
        string description = 2 [(wix.api.maxLength) = 130, (wix.api.translatable) = {
            type: LONG_TEXT
            name: "Description"
            grouping: "description"
        }];

        // Plugin logo. 35x35px in JPG or PNG format.
        google.protobuf.StringValue logo_url = 3 [(wix.api.format) = WEB_URL];

        reserved 4;
    }

    // Combination of IDs that uniquely identify a slot in the app component.
    message PluginPlacement {
        // Slot app definition ID.
        string app_definition_id = 1 [(wix.api.format) = GUID];

        // Slot app component ID.
        string widget_id = 2 [(wix.api.format) = GUID];

        // Slot ID.
        string slot_id = 3 [(wix.api.minLength) = 1];
    }
}

