<?php

/**
 * Bookmarks module manifest.
 *
 * Owns bookmark routes, topbar/aside/dialog UI, runtime components,
 * and bookmark session/layout providers.
 */
return [
    'id' => 'bookmarks',
    'version' => '1.0.0',
    'enabled_by_default' => true,
    'load_order' => 20,
    'requires' => [],

    'routes' => [
        ['path' => 'bookmarks/save-data', 'target' => 'bookmarks/save-data'],
        ['path' => 'bookmarks/update-data', 'target' => 'bookmarks/update-data'],
        ['path' => 'bookmarks/delete-data', 'target' => 'bookmarks/delete-data'],
        ['path' => 'bookmarks/group-save-data', 'target' => 'bookmarks/group-save-data'],
        ['path' => 'bookmarks/group-delete-data', 'target' => 'bookmarks/group-delete-data'],
        ['path' => 'bookmarks/reorder-data', 'target' => 'bookmarks/reorder-data'],
    ],
    'public_paths' => [],

    'container_registrars' => [
        \MintyPHP\Module\Bookmarks\BookmarksContainerRegistrar::class,
    ],

    'ui_slots' => [
        'aside.tab_panel' => [
            [
                'key' => 'bookmarks',
                'label' => 'Bookmarks',
                'icon' => 'bi-bookmark-star',
                'href' => '',
                'permission' => 'bookmarks.use',
                'panel_template' => 'templates/aside-bookmarks-panel.phtml',
                'details_storage' => 'aside-bookmarks-groups-v1',
                'order' => 120,
            ],
        ],
        'topbar.right_item' => [
            [
                'key' => 'bookmarks-toggle',
                'template' => 'templates/topbar-bookmark-button.phtml',
                'permission' => 'bookmarks.use',
                'order' => 120,
            ],
        ],
        'layout.body_end_template' => [
            [
                'key' => 'bookmarks-dialogs',
                'template' => 'templates/bookmark-dialogs.phtml',
                'permission' => 'bookmarks.use',
                'order' => 120,
            ],
        ],
        'layout.head_style' => [
            [
                'key' => 'bookmarks-form-style',
                'path' => 'modules/bookmarks/css/components/app-bookmark-form.css',
                'permission' => 'bookmarks.use',
                'order' => 120,
            ],
            [
                'key' => 'bookmarks-aside-style',
                'path' => 'modules/bookmarks/css/layout/app-sidebar-bookmarks.css',
                'permission' => 'bookmarks.use',
                'order' => 121,
            ],
        ],
        'search.resource_item' => [
            [
                'key' => 'bookmarks',
                'label' => 'Bookmarks',
                'base_url' => '#',
                'permission' => 'bookmarks.use',
                'order' => 130,
            ],
        ],
        'runtime.component' => [
            [
                'key' => 'bookmark-save',
                'script' => 'modules/bookmarks/js/components/app-bookmark-save.js',
                'export' => 'initBookmarkSave',
                'scope' => 'global',
                'config_path' => 'components.bookmarkSave',
                'default_config' => [
                    'openButtonSelector' => '[data-bookmark-open-dialog]',
                    'dialogSelector' => '[data-app-bookmark-dialog]',
                    'groupDialogSelector' => '[data-app-bookmark-group-dialog]',
                ],
                'phase' => 'late',
                'permission' => 'bookmarks.use',
                'order' => 120,
            ],
            [
                'key' => 'bookmark-panel',
                'script' => 'modules/bookmarks/js/components/app-bookmark-panel.js',
                'export' => 'initBookmarkPanel',
                'selector' => '[data-app-bookmark-panel]',
                'config_path' => 'components.bookmarkPanel',
                'default_config' => [
                    'selector' => '[data-app-bookmark-panel]',
                ],
                'phase' => 'late',
                'permission' => 'bookmarks.use',
                'order' => 121,
            ],
        ],
    ],

    'authorization_policies' => [
        \MintyPHP\Module\Bookmarks\BookmarksAuthorizationPolicy::class,
    ],

    'search_resources' => [
        \MintyPHP\Module\Bookmarks\Providers\BookmarksSearchProvider::class,
    ],
    'asset_groups' => [],
    'scheduler_jobs' => [],

    'layout_context_providers' => [
        \MintyPHP\Module\Bookmarks\Providers\BookmarksLayoutProvider::class,
    ],
    'session_providers' => [
        \MintyPHP\Module\Bookmarks\Providers\BookmarksSessionProvider::class,
    ],

    'permissions' => [],
    'migrations_path' => null,
    'i18n_path' => 'i18n',
];
