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_data/unified_components/shared.proto";
import "components_catalog_data/page_replace/page_replace.proto";
import "components_catalog_common.proto";

message UnifiedPage {
    // Base info of component by shared logic of unified components
    BaseInfo base = 1;
    // Page installation settings
    PageInstallationSettings installation = 2 [deprecated = true, (.wix.api.field_deprecated) = {
        replaced_by: "editor_settings"
        target_removal_date: "2026-02-26"
    }];
    // Page replacing options (replacer \ replacing \ none)
    PageReplaceOptions page_replace = 3;
    // Content of page
    PageContent content = 4;
    // Settings for how the page integrates with the editor
    UnifiedPageEditorSettings editor_settings = 5;
}

message UnifiedPageEditorSettings {
    // Basic editor settings that are relevant to all page types
    PageEditorSettings base = 1;
    // slug of the page (last part of url that point to the page)
    google.protobuf.StringValue slug = 2 [(.wix.api.minLength) = 1, (wix.api.maxLength) = 200];
}

message PageInstallationSettings {
    // Shared installation settings for unified components
    BaseInstallation base = 1;
    // Page installation settings for unified components
    PageInstallation page = 2;
}

message PageInstallation {
    // slug of the page (last part of url that point to the page)
    string slug = 1 [(.wix.api.minLength) = 1, (wix.api.maxLength) = 200];
    // Should add page to site menu
    bool add_to_site_menu = 2;
    // Can page be linked through link panel
    bool linkable = 3;
}

message PageContent {
    // Widgets to add as content in page
    repeated WidgetAsContent widgets = 1;
}

message WidgetAsContent {
    // 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)
    google.protobuf.BoolValue essential = 3;
}

