diff --git a/media/dashboard-sdk-close-modal.gif b/media/dashboard-sdk-close-modal.gif new file mode 100644 index 0000000000..7d4830a4fc Binary files /dev/null and b/media/dashboard-sdk-close-modal.gif differ diff --git a/media/dashboard-sdk-navigate-1.gif b/media/dashboard-sdk-navigate-1.gif new file mode 100644 index 0000000000..5884f797a4 Binary files /dev/null and b/media/dashboard-sdk-navigate-1.gif differ diff --git a/media/dashboard-sdk-open-modal-name.gif b/media/dashboard-sdk-open-modal-name.gif new file mode 100644 index 0000000000..b135534568 Binary files /dev/null and b/media/dashboard-sdk-open-modal-name.gif differ diff --git a/media/dashboard-sdk-open-modal.gif b/media/dashboard-sdk-open-modal.gif new file mode 100644 index 0000000000..dde8976a94 Binary files /dev/null and b/media/dashboard-sdk-open-modal.gif differ diff --git a/media/dashboard-show-media-manager.gif b/media/dashboard-show-media-manager.gif new file mode 100644 index 0000000000..b17f80eb29 Binary files /dev/null and b/media/dashboard-show-media-manager.gif differ diff --git a/media/dashboard-toast-failure-1.png b/media/dashboard-toast-failure-1.png new file mode 100644 index 0000000000..f558b88992 Binary files /dev/null and b/media/dashboard-toast-failure-1.png differ diff --git a/media/dashboard-toast-failure.png b/media/dashboard-toast-failure.png new file mode 100644 index 0000000000..f558b88992 Binary files /dev/null and b/media/dashboard-toast-failure.png differ diff --git a/media/dashboard-toast-small.png b/media/dashboard-toast-small.png new file mode 100644 index 0000000000..49bc846fac Binary files /dev/null and b/media/dashboard-toast-small.png differ diff --git a/media/dashboard-toast-success.gif b/media/dashboard-toast-success.gif new file mode 100644 index 0000000000..d45691e843 Binary files /dev/null and b/media/dashboard-toast-success.gif differ diff --git a/media/dashboard-toast-success.png b/media/dashboard-toast-success.png new file mode 100644 index 0000000000..31532f90d9 Binary files /dev/null and b/media/dashboard-toast-success.png differ diff --git a/media/dashboard-toast.png b/media/dashboard-toast.png new file mode 100644 index 0000000000..49bc846fac Binary files /dev/null and b/media/dashboard-toast.png differ diff --git a/media/install-app.png b/media/install-app.png new file mode 100644 index 0000000000..4aeb58438f Binary files /dev/null and b/media/install-app.png differ diff --git a/sdk-dashboard/@wix/dashboard.service.json b/sdk-dashboard/@wix/dashboard.service.json new file mode 100644 index 0000000000..f5d927b002 --- /dev/null +++ b/sdk-dashboard/@wix/dashboard.service.json @@ -0,0 +1,1583 @@ +{ "name": "@wix/dashboard", + "mixes": [], + "labels": + [ "new" ], + "location": + { "lineno": 1, + "filename": "index.js" }, + "docs": + { "summary": "The Dashboard API allows you to write code in custom dashboard extensions to interact with other parts of the Wix dashboard.", + "description": + [ "The [dashboard](https://support.wix.com/en/article/about-your-wix-dashboard) is the control center for Wix sites. It allows Wix users to manage their sites' settings and business features. The dashboard also includes tools for analytics, eCommerce, and marketing. You can create custom dashboard integrations, including pages and widgets, that are displayed in the dashboards of Wix users.", + "", + "
", + " This API is not intended for use with Wix Headless sites and apps.", + "
", + "", + "The Dashboard API allows you to write code in custom dashboard extensions to interact with other parts of the Wix dashboard. Using the API, you can navigate Wix users to pages in the dashboard, display modals, and send alerts and updates using toasts.", + "", + "## Setup", + "", + "To use the Dashboard API, install the `@wix/dashboard` package. ", + "", + "### Install the package", + "", + "Follow the installation instructions for your development environment. ", + "", + "| Development environment | Installation method |", + "| -------------------------- | ------------------- |", + "| Wix sites (editor or IDE) | Use the [package manager](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-in-the-editor). |", + "| Wix sites (local IDE) | Run `wix install @wix/dashboard` using the [Wix CLI](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-with-the-wix-cli). |", + "| Blocks apps | Use the same installation method as Wix sites. |", + "| CLI and self-hosted apps | Run `npm install @wix/dashboard` or `yarn add @wix/dashboard`. |", + "| Headless sites and apps | Run `npm install @wix/dashboard` or `yarn add @wix/dashboard`. |", + "", + "### Import the package", + "", + "To import the package in your code:", + "", + "```js", + "import { dashboard } from \"@wix/dashboard\";", + "```", + "", + "### Usage", + "", + "To use the package, follow the instructions below based on your development environment.", + "", + "#### Wix sites and Wix-hosted apps", + "", + "To use the Dashboard API when [developing sites](https://dev.wix.com/docs/develop-websites) or in [Wix-hosted apps](https://dev.wix.com/docs/sdk/articles/get-started/about-the-wix-java-script-sdk#wix-hosted-apps), import the `dashboard` module in your code and call it's methods directly.", + "", + "```javascript", + "import { dashboard } from '@wix/dashboard';", + "", + "dashboard.showToast({ message: 'Hello World' })", + "", + "```", + "", + "#### Self-hosted apps", + "", + "To use the Dashboard API in [self-hosted apps](https://dev.wix.com/docs/sdk/articles/get-started/about-self-hosted-apps), first create a [client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client) using the `dashboard` module:", + "", + "```typescript", + "import { dashboard } from '@wix/dashboard';", + "import { createClient } from '@wix/sdk';", + "", + "const client = createClient({", + " host: dashboard.host(),", + " auth: dashboard.auth(),", + " modules: {", + " dashboard,", + " },", + "});", + "```", + "", + "Then, use the client to call `dashboard` module's methods.", + "", + "For example:", + "", + "```typescript", + "client.dashboard.showToast({ message: 'Hello World' });", + "```", + "", + "## Dashboard permissions", + "", + "When you make API calls from your dashboard extension code in Wix apps, you need to keep in mind which permissions are available. Your code can access APIs with the permissions of the currently logged-in Wix user, but only if the app your code is running on has also been granted those permissions.", + "", + "![Dashboard Permissions](../assets/images/dashboard-permissions.png)", + "", + "For example, if your app has permissions to add products to a store, but the current Wix user does not, your app will not be able to use the [`stores` API](https://dev.wix.com/docs/sdk/backend-modules/stores/products/introduction) to add products to the store. Conversely, if the current Wix user has permissions to add products to a store, but your app does not, your app will not be able to add products to the store. The only way your app can add products to a store is if both your app and the current Wix user have permissions to do so.", + "", + "## Before you begin", + "Before you start writing your code, keep in mind that the heights of any dashboard components rendered within iframes are automatically adjusted. Because of this, do not use relative CSS height units such as `vh` in your iframe component code.", + "", + "## Contact us", + "", + "If you are using one of the legacy Wix APIs and require a method that is not available in the Dashboard API, or alternatively if you would like to suggest a use case that fits the Dashboard API, reach out to [Dashboard API Support](https://www.wix.com/support-chatbot?nodeId=25a57397-ccf7-4376-8b74-48d51edf7159&referral=devRels) for assistance." ], + "links": [], + "examples": [], + "extra": + { } }, + "properties": [], + "operations": + [ { "name": "addSitePlugin", + "labels": [], + "nameParams": [], + "params": + [ { "name": "pluginId", + "type": "string", + "doc": "ID of your site plugin, which you can find in your app's dashboard, in the site plugin extension's settings." }, + { "name": "options", + "type": "@wix/dashboard.addSitePluginOptions", + "doc": "Options to use when adding a site plugin." } ], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "void" ] }, + "doc": "" }, + "locations": + [ { "lineno": 1, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "Adds a site plugin to one of the slots supported in an app created by Wix.", + "description": + [ "> **Developer Preview** ", + "> This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.", + "", + "Adds a site plugin to one of the slots supported in an [app created by Wix](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix). You can optionally specify a single slot in which you want to add the plugin. If you don't specify a slot, your plugin is placed in the first available slot according to the order you defined in the plugin's installation settings in your [app's dashboard](https://manage.wix.com/account/custom-apps). If that slot is occupied, it's added in the next available slot, and so on. If there are no available slots, it isn't added.", + "", + "> **Notes:**", + ">", + "> - This method isn't supported for [developing sites](https://dev.wix.com/docs/develop-websites).", + "> - Before using this method, you need a site plugin extension. Learn more about [site plugins](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/site-plugins/about-site-plugin-extensions)." ], + "links": [], + "examples": + [ { "title": "Add a site plugin to a specific slot", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const pluginId = '975bffb7-3c04-42cc-9840-3d48c24e73d5';", + "const slotId = 'a91a0543-d4bd-4e6b-b315-9410aa27bcde';", + "", + "dashboard.addSitePlugin(pluginId, { slotId })", + " .then(() => {", + " console.log('Plugin added successfully');", + " })", + " .catch(error => {", + " console.error('Error adding plugin:', error);", + " });" ], + "extra": + { } }, + { "title": "Add a site plugin without specifying a slot", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const pluginId = '975bffb7-3c04-42cc-9840-3d48c24e73d5';", + "", + "dashboard.addSitePlugin(pluginId, {})", + " .then(() => {", + " console.log('Plugin added successfully');", + " })", + " .catch(error => {", + " console.error('Error adding plugin:', error);", + " });" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "closeModal", + "labels": [], + "nameParams": [], + "params": + [ { "name": "{@wix/dashboard.Serializable}", + "type": "void", + "doc": "[closeData] - Data to pass to the modal's opener. This data is returned by [openModal](https://dev.wix.com/docs/sdk/host-modules/dashboard/open-modal) once the modal is closed. It must be Serializable data, which means it can be cloned using the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm). For example, you cannot pass function callbacks in this parameter." } ], + "ret": + { "type": "void" }, + "locations": + [ { "lineno": 27, + "filename": "modal.js" } ], + "docs": + { "summary": "Closes the currently open modal.", + "description": + [ "Closes the currently open modal.", + "", + "> **Note:** This method can only be used in the code for a [dashboard modal extension](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/dashboard-modals/about-dashboard-modals) and therefore can't be used when when [developing sites](https://dev.wix.com/docs/develop-websites) or [building apps with Blocks](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/about-wix-blocks).", + "", + "![Close Modal](../assets/images/dashboard-sdk-close-modal.gif)" ], + "links": [], + "examples": + [ { "title": "Close a modal", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "dashboard.closeModal({ message: 'The modal is closed!' });" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "getDashboardMenuPlugins", + "labels": [], + "nameParams": [], + "params": + [ { "name": "slotId", + "type": "string", + "doc": "Unique ID of the slot, as defined in the Wix Developer Center." }, + { "name": "options", + "type": "@wix/dashboard.GetDashboardMenuPluginsOptions", + "doc": "Optional parameters.", + "optional": true } ], + "ret": + { "type": + { "name": "Array", + "typeParams": + [ "@wix/dashboard.DashboardMenuPlugin" ] } }, + "locations": + [ { "lineno": 49, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "Returns a list of dashboard menu plugins that have extended the given `slotId`.", + "description": + [ "> **Note:** This is an internal method. Use with caution.", + "", + "This method returns a list of dashboard menu plugins that have extended the given `slotId` in the Wix Developer", + "Center. Only plugins that are part of applications installed on the user's site will be received." ], + "links": [], + "examples": + [ { "title": "Render a list of menu items as buttons", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const DashboardExtension = () => {", + " const menuItems = dashboard.getDashboardMenuPlugins('slot-ID');", + " return (", + " ", + " );", + "};" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "getDashboardPlugins", + "labels": [], + "nameParams": [], + "params": + [ { "name": "slotId", + "type": "string", + "doc": "Unique ID of the slot, as defined in the Wix Developer Center." }, + { "name": "options", + "type": "@wix/dashboard.GetDashboardPluginsOptions", + "doc": "Optional parameters.", + "optional": true } ], + "ret": + { "type": + { "name": "Array", + "typeParams": + [ "@wix/dashboard.DashboardPlugin" ] } }, + "locations": + [ { "lineno": 27, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "Returns a list of slot plugins that have extended the given `slotId`.", + "description": + [ "> **Note:** This is an internal method. Use with caution.", + "", + "This method returns a list of slot plugins that have extended the given `slotId` in the Wix Developer Center. ", + "Only plugins that are part of applications installed on the user's site will be received." ], + "links": [], + "examples": + [ { "title": "Render a list of widgets", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const DashboardExtension = () => {", + " const plugins = dashboard.getDashboardPlugins('slot-ID');", + " return (", + "
", + " {plugins.map(({id, Component}) => (", + "
", + " ", + "
", + " ))}", + "
", + " );", + "};" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "getPageUrl", + "labels": [], + "nameParams": [], + "params": + [ { "name": "destination", + "type": "@wix/dashboard.Destination", + "doc": "URL destination details." } ], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "string" ] }, + "doc": "Fulfilled - The URL of a dashboard page with the provided `relativeUrl` value appended." }, + "locations": + [ { "lineno": 42, + "filename": "navigation.js" } ], + "docs": + { "summary": "Gets the full URL for a dashboard page.", + "description": + [ "Gets the full URL for a dashboard page." ], + "links": [], + "examples": + [ { "title": "Get the URL of the dashboard home page", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const pageUrl = await dashboard.getPageUrl({pageId: '2e96bad1-df32-47b6-942f-e3ecabd74e57', relativeUrl: '?referal=page-3'});" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "getSiteInfo", + "labels": [], + "nameParams": [], + "params": [], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "@wix/dashboard.SiteInfo" ] }, + "doc": "Fulfilled - Information about the site's editor." }, + "locations": + [ { "lineno": 1, + "filename": "utilities.js" } ], + "docs": + { "summary": "Returns information about the site's editor.", + "description": + [ "Returns information about the site's editor, including whether it's available, currently active, and its publishing status." ], + "links": [], + "examples": + [ { "title": "Verify whether Wix Editor or Wix Studio is available and active", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const siteInfo = await dashboard.getSiteInfo();", + "", + "if (siteInfo.wixEditorAvailable) {", + "", + " if (siteInfo.wixEditorActive && siteInfo.editorUrl) {", + " console.log('Editor is active and can be accessed at:', siteInfo.editorUrl);", + " } else {", + " console.log('Editor is available but not currently active');", + " }", + "} else {", + " console.log('Wix Editor and Wix Studio are not available (possibly using Wix Vibe)');", + "}" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "getWidget", + "labels": [], + "nameParams": [], + "params": + [ { "name": "widgetId", + "type": "string", + "doc": "Unique ID of the \"Embeddable Component\", as defined in the Wix Developer Center." }, + { "name": "options", + "type": "@wix/dashboard.GetWidgetOptions", + "doc": "Optional parameters.", + "optional": true } ], + "ret": + { "type": "Object", + "doc": "React.ComponentType" }, + "locations": + [ { "lineno": 71, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "Retrieves an embeddable component by providing its extension ID.", + "description": + [ "> **Note:** This is an internal method. Use with caution.", + "", + "This method retrieves an embeddable component by providing its extension ID defined in the Wix Developer Center." ], + "links": [], + "examples": + [ { "title": "Rendering a Widget", + "body": + [ "import { dashboard } from '@wix/dashboard-react';", + "", + "// ...", + "", + "const DashboardExtension = () => {", + " const Widget = dashboard.getWidget('component-ID');", + "", + " return (", + "
", + " ", + "
", + " );", + "};" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "installApp", + "labels": [], + "nameParams": [], + "params": + [ { "name": "options", + "type": "@wix/dashboard.InstallationOptions", + "doc": "Installation options." } ], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "@wix/dashboard.InstallAppResponse" ] }, + "doc": "" }, + "locations": + [ { "lineno": 38, + "filename": "utilities.js" } ], + "docs": + { "summary": "Opens a modal for a Wix user to install a Wix App on their site.", + "description": + [ "Opens a modal for a Wix user to install a [Wix App](https://www.wix.com/app-market/) on their site.", + "", + "![Install App](../assets/images/install-app.png)" ], + "links": [], + "examples": + [ { "title": "Install Wix Bookings", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const bookingsId = '13d21c63-b5ec-5912-8397-c3a5ddb27a97'", + "", + "dashboard.installApp({", + " appId: bookingsId,", + "});" ], + "extra": + { } }, + { "title": "Install an app with a specified version", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const myAppId = 'e8f2a6d5-3c7b-5f91-b204-8d6c9e3a5b72'", + "const myAppVersion = '1.5.2'", + "", + "dashboard.installApp({", + " appId: myAppId,", + " version: myAppVersion", + "});" ], + "extra": + { } }, + { "title": "Install Wix Blog with a custom post installation flow", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "import { myPostInstallationFlow } from '../utils/postInstallationFlow'", + "", + "// ...", + "", + "const installAppWithCustomFlow = async (appId) => {", + "", + " try {", + " const response = await dashboard.installApp({", + " appId: appId,", + " avoidPostInstallation: true", + " });", + "", + " if (response.status === \"SUCCESS\") {", + " myPostInstallationFlow(response.installedApps[0]);", + " } else {", + " // Handle flows for non-success statuses", + " }", + " } catch (error) {", + " console.error(error);", + " }", + "}", + "", + "const blogId = '14bcded7-0066-7c35-14d7-466cb3f09103';", + "installAppWithCustomFlow(blogId);" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "navigate", + "labels": [], + "nameParams": [], + "params": + [ { "name": "destination", + "type": "@wix/dashboard.Destination", + "doc": "Destination page to navigate to." }, + { "name": "options", + "type": "@wix/dashboard.NavigationOptions", + "doc": "Optional. Options for the navigation.", + "optional": true } ], + "ret": + { "type": "void" }, + "locations": + [ { "lineno": 1, + "filename": "navigation.js" } ], + "docs": + { "summary": "Navigates the user to another page in the dashboard.", + "description": + [ "Navigates the user to another page in the dashboard.", + "", + "![Navigate to Dashboard Setup Page](../assets/images/dashboard-sdk-navigate-1.gif)", + "", + "To identify a page to navigate to you can:", + "- Look up it's [page ID](https://dev.wix.com/docs/sdk/host-modules/dashboard/page-ids).", + "- Use a builder method to generate the destination object for a particular page. Several SDK modules include builder methods for the pages relevant to each module. For example, [`bookings`](https://dev.wix.com/docs/sdk/backend-modules/bookings/extensions/dashboard-pages/export-booking-data), [`blog`](https://dev.wix.com/docs/sdk/backend-modules/blog/extensions/dashboard-pages/blog-analytics), and [`ecom`](https://dev.wix.com/docs/sdk/backend-modules/ecom/extensions/dashboard-pages/delivery-profile) all provide builder methods.", + "", + "If you specify an invalid page ID when you call this function, the Wix user will see \"Page Not Found\" in their dashboard.", + "", + ">**Note:** Currently, you can't call `navigate()` to navigate to pages built when [developing sites](https://dev.wix.com/docs/develop-websites) or [building apps with Blocks](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/about-wix-blocks).", + "", + "You can specify how to display the page you're navigating to using the `displayMode` option.", + "", + "There are two display modes available:", + "- **Main display mode**: The browser replaces the current main page content with the new page.", + "- **Overlay display mode**: The new page is displayed in a modal overlay on top of the main page.", + "", + "Learn more about [dashboard page navigation](https://dev.wix.com/docs/sdk/host-modules/dashboard/about-dashboard-page-navigation)." ], + "links": [], + "examples": + [ { "title": "Navigate to the dashboard home page", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "dashboard.navigate({pageId: '2e96bad1-df32-47b6-942f-e3ecabd74e57'});" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "navigateBack", + "labels": [], + "nameParams": [], + "params": [], + "ret": + { "type": "void" }, + "locations": + [ { "lineno": 32, + "filename": "navigation.js" } ], + "docs": + { "summary": "Navigates the user back to previous dashboard page.", + "description": + [ "Navigates the user back to previous dashboard page. It's equivalent to the user clicking the browser's back button." ], + "links": [], + "examples": + [ { "title": "Navigate back to the previous page", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "dashboard.navigateBack();" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "observeState", + "labels": [], + "nameParams": [], + "params": + [ { "name": "observer", + "type": "Observer", + "doc": "Callback function for receiving state data that takes two parameters:\n`componentParams`: The data that is sent to your component by your host, who is responsible for rendering it.\n`environmentState`: General information about the user's present environment." } ], + "ret": + { "type": "void" }, + "locations": + [ { "lineno": 1, + "filename": "observeState.js" } ], + "docs": + { "summary": "Allows you to receive the contextual state and environmental information of the dashboard.", + "description": + [ "Allows you to receive the contextual state and environmental information of the dashboard.", + "The callback function provided to `observeState` receives the state data. The function is triggered when the dashboard page or component initializes and whenever the state data is updated.", + "", + "## Common use cases for this method", + "1. A dashboard page in an app receiving environment data from the host, such as the user's locale.", + "2. A widget rendered within the dashboard, receiving contextual data from the page that's hosting it.", + "3. A modal opened from a dashboard page or from a widget, receiving data from the page that opened it.", + "4. A dashboard component adjusting its behavior when rendered inside an iframe." ], + "links": [], + "examples": + [ { "title": "Receive state passed by your host", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "dashboard.observeState((componentParams, environmentState) => {", + " // This value is logged on initialization and whenever either `componentParams` or `environmentState` changes. ", + " console.log(componentParams.customPageParameter);", + "});" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "onBeforeUnload", + "labels": [], + "nameParams": [], + "params": + [ { "name": "callback", + "type": "Function", + "doc": "Callback function to call when the `beforeunload` event fires. The function receives an `event` object as an argument." } ], + "ret": + { "type": "void", + "doc": "{@wix/dashboard.EventRemover}" }, + "locations": + [ { "lineno": 23, + "filename": "observeState.js" } ], + "docs": + { "summary": "Registers a `beforeunload` event handler for a dashboard page, modal, or plugin extension.", + "description": + [ "Registers a [`beforeunload` event](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event) handler for a dashboard page, modal, or plugin [extension](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/about-dashboard-extensions).", + "", + "`onBeforeUnload()` accepts a callback that's triggered when a Wix users is about to navigate away from a dashboard page or when the browsing context of an app is being unloaded. For example, this can happen when the Wix user selects another page from the dashboard's sidebar, or closes the browser tab. If you call `onBeforeUnload` in the code for a [modal extension](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/dashboard-modals/about-dashboard-modals), the callback triggers when the Wix user is about to close the modal.", + "", + "The event object passed to the callback function contains a function called `preventDefault()`. If the callback calls `preventDefault()`, navigation away from the page or other context unloading is paused. A dialog is displayed in the dashboard warning the Wix user that there may be unsaved data. The Wix user can then choose to cancel and stay in the current context or proceed.", + "", + "> **Note:** You should not assume that the `beforeunload` event will always fire or that the confirmation dialog will always be presented. These behaviors vary depending on the Wix user's browser." ], + "links": [], + "examples": + [ { "title": "Prompt for confirmation before unloading unsaved data", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const { remove } = dashboard.onBeforeUnload((event) => {", + " // Check if there's unsaved data on the page", + " if (unsavedPageData) {", + " event.preventDefault();", + " }", + "});" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "onLayerStateChange", + "labels": [], + "nameParams": [], + "params": + [ { "name": "callback", + "type": "Function", + "doc": "Called when the `layerStateChange` event fires. The function receives the extension's new layer state, `\"foreground\"` or `\"background\"`, as an argument." } ], + "ret": + { "type": "void", + "doc": "{@wix/dashboard.EventRemover}" }, + "locations": + [ { "lineno": 44, + "filename": "observeState.js" } ], + "docs": + { "summary": "Registers a `layerStateChange` event handler for a dashboard page, modal, or plugin extension.", + "description": + [ "Registers a `layerStateChange` event handler for a dashboard page, modal, or plugin [extension](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/about-dashboard-extensions). This allows you to refresh a component's data when it becomes active, or pause resource intensive operations when the component is running in the background.", + "", + "`onLayerStateChange()` accepts a callback that's triggered whenever the extension moves from the foreground to the background, or vice versa. For example, this can happen when a Wix user opens or closes a [modal](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/dashboard-modals/about-dashboard-modals)." ], + "links": [], + "examples": + [ { "title": "Refresh data when component comes to the foreground", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "import { refreshData } from './data-retrieval.js'", + "", + "// ...", + "", + "const { remove } = dashboard.onLayerStateChange((state) => {", + " if (state === 'foreground') {", + " refreshData();", + " }", + "});", + "", + "// Remove the onLayerStateChange handler when the `beforeUnload` event is triggered.", + "dashboard.onBeforeUnload(() => {", + " remove();", + "})" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "openMediaManager", + "labels": [], + "nameParams": [], + "params": + [ { "name": "options", + "type": "@wix/dashboard.OpenMediaManagerOptions", + "doc": "Optional for the Media Manager.", + "optional": true } ], + "ret": + { "type": + { "name": "Promise", + "typeParams": + [ "@wix/dashboard.MediaManagerResult" ] }, + "doc": "Fulfilled - An object with a single key called `items`. The value of that key is an array of [file descriptor](https://dev.wix.com/docs/sdk/backend-modules/media/files/get-file-descriptor) objects for the selected media files." }, + "locations": + [ { "lineno": 15, + "filename": "utilities.js" } ], + "docs": + { "summary": "Opens the Wix Media Manager in a modal.", + "description": + [ "> **Developer Preview** ", + "> This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.", + "", + "Opens the Wix Media Manager in a modal.", + "", + "![Show Media Manager](../assets/images/dashboard-show-media-manager.gif)", + "", + "The Media Manager allows Wix users to select one or more of the site's media files." ], + "links": [], + "examples": + [ { "title": "Open a media manager modal", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const chosenMediaItems = await dashboard.openMediaManager({multiSelect: true});", + "console.log('You have chosen: ', chosenMediaItems.items)" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "openModal", + "labels": [], + "nameParams": [], + "params": + [ { "name": "modalInfo", + "type": "@wix/dashboard.ModalInfo", + "doc": "Information about the dashboard modal to open." } ], + "ret": + { "type": "void", + "doc": "{@wix/dashboard.OpenModalReturn}" }, + "locations": + [ { "lineno": 1, + "filename": "modal.js" } ], + "docs": + { "summary": "Opens a [dashboard modal extension](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/dashboard-modals/about-dashboard-modals).", + "description": + [ "Opens a [dashboard modal extension](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/dashboard-modals/about-dashboard-modals) on your app's dashboard page.", + "", + "![Open modal](../assets/images/dashboard-sdk-open-modal.gif)", + "", + "> **Notes:** ", + "> - This method does not yet work when [developing sites](https://dev.wix.com/docs/develop-websites) or [building apps with Blocks](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/about-wix-blocks).", + "> - Before you call this method, you need a dashboard modal extension. Learn more about implementing dashboard modal extensions with the [Wix CLI](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/dashboard-extensions/dashboard-modals/add-dashboard-modal-extensions-with-the-cli) and in [self-hosted apps](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/dashboard-extensions/add-self-hosted-dashboard-modal-extensions).", + "", + "The `openModal()` function returns an object with a property called `modalClosed`. This property is a promise that resolves to the data passed to [`closeModal()`](https://dev.wix.com/docs/sdk/host-modules/dashboard/close-modal) when the modal is closed.", + "", + "> **Note:** Do not use relative CSS height units such as `vh` in the extensions opened by this method. Extension heights are adjusted automatically. If your extension uses relative height units by default, make sure to turn them off." ], + "links": [], + "examples": + [ { "title": "Open a modal and log the data returned when it's closed", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "const { modalClosed } = dashboard.openModal({ modalId: '1d52d058-0392-44fa-bd64-ed09275a6fcc' });", + "", + "modalClosed.then(result => {", + " if(result) {", + " console.log('The modal was closed and returned the value:', result);", + " } else {", + " console.log('The modal was closed without any data.'); ", + " }", + "})" ], + "extra": + { } }, + { "title": "Pass data to a modal extension", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "dashboard.openModal({ ", + " modalId: '1d52d058-0392-44fa-bd64-ed09275a6fcc', ", + " params: { firstName: 'Name' } ", + "});" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "setPageTitle", + "labels": [], + "nameParams": [], + "params": + [ { "name": "pageTitle", + "type": "string", + "doc": "Page title to set." } ], + "ret": + { "type": "void" }, + "locations": + [ { "lineno": 34, + "filename": "toast.js" } ], + "docs": + { "summary": "Sets the title of the current dashboard page in the browser tab.", + "description": + [ "Sets the title of the current dashboard page in the browser tab.", + "", + "The `setPageTitle()` method can only be called from dashboard pages. You can't call it from [dashboard plugin extensions](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/dashboard-extensions/dashboard-plugins/about-dashboard-plugin-extensions).", + "", + "Call the `setPageTitle()` method whenever the page reloads, or to apply a new title when updating a page's content dynamically, without reloading. ", + "", + "Set the page title to `null` to reset the title to the default dashboard page title." ], + "links": [], + "examples": + [ { "title": "Set a page title", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "dashboard.setPageTitle('Product: Green apples');" ], + "extra": + { } }, + { "title": "Set page title to a product ID", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "dashboard.observeState((_, environmentState) => {", + " // Use a regular expression to capture the productId value.", + " const queryParams = environmentState.pageLocation.search; ", + " const productIdMatch = queryParams.match(/[?&]productId=([^&]+)/); ", + " let productId; ", + " if (productIdMatch) {", + " productId = productIdMatch[1]; ", + " }", + "", + " // If a product ID was found, set the page title to the ID.", + " if (productId) { ", + " dashboard.setPageTitle(`Product: ${productId}`);", + " // If no product ID was found, reset the page title to default.", + " } else { ", + " dashboard.setPageTitle(null); ", + " }", + "});" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } }, + { "name": "showToast", + "labels": [], + "nameParams": [], + "params": + [ { "name": "config", + "type": "@wix/dashboard.ToastConfig", + "doc": "Toast configuration options." } ], + "ret": + { "type": "@wix/dashboard.ToastReturn" }, + "locations": + [ { "lineno": 1, + "filename": "toast.js" } ], + "docs": + { "summary": "Displays a toast notification when invoked from a dashboard page or widget within a page.\n\n![Dashboard Toast Success](../assets/images/dashboard-toast-success.gif)", + "description": + [ "Displays a toast notification when invoked from a dashboard page or widget within a page.", + "", + "Use the `config` parameter to:", + "", + "- Control the toast's appearance.", + "- Set callback functions to run when the user sees or clicks on the toast.", + "- Display a clickable call-to-action that is displayed inside the toast.", + "", + "Up to 3 toasts can be shown at a time. If other toasts are currently shown, requests to display toasts may be queued and the toast may not be displayed immediately.", + "", + "> **Note:** Toasts won't show when previewing in the editor, but they will show on the published version of the dashboard page.", + "", + "The `showToast()` function returns an object containing a key called `remove`. ", + "The value of `remove` is a function that removes the toast from the page." ], + "links": [], + "examples": + [ { "title": "Display a success toast when a product is updated", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "dashboard.showToast({", + " message: 'Product updated successfully!',", + " type: 'success',", + "});" ], + "extra": + { } }, + { "title": "Display an error toast with a 'Learn more' link", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "dashboard.showToast({", + " message: 'Product update failed.',", + " timeout: 'none',", + " type: 'error',", + " priority: 'low',", + " action: {", + " uiType: 'link',", + " text: 'Learn more',", + " removeToastOnClick: true,", + " onClick: () => {", + " // Logic to run when the user clicks the 'Learn more' link.", + " console.log('Learn more clicked!');", + " }", + " }", + " }", + ");" ], + "extra": + { } }, + { "title": "Remove a displayed toast", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "// Display a toast and save the remove method.", + "const { remove } = dashboard.showToast({", + " message: 'Product updated successfully!',", + " type: 'success',", + " timeout: 'none',", + "});", + "", + "// Remove the toast.", + "remove();" ], + "extra": + { } }, + { "title": "Remove a displayed toast when a button on the page is clicked", + "body": + [ "import { dashboard } from '@wix/dashboard';", + "", + "// ...", + "", + "// Display a toast and save the remove method.", + "const { remove } = dashboard.showToast({", + " message: 'Product updated successfully!',", + " type: 'success',", + " timeout: 'none',", + "});", + "", + "// Set up a button click handler to remove the toast", + "$w('#removeToastButton').onClick(() => {", + " remove();", + "});" ], + "extra": + { } } ], + "extra": + { } }, + "extra": + { } } ], + "callbacks": [], + "messages": + [ { "name": "DashboardMenuPlugin", + "locations": + [ { "lineno": 137, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "DashboardMenuPlugin Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "The plugin extension ID." }, + { "name": "title", + "type": "string", + "doc": "The defined title." }, + { "name": "subtitle", + "type": "string", + "doc": "The defined subtitle.", + "optional": true }, + { "name": "isPermitted", + "type": "boolean", + "doc": "Whether this item is permitted in the current context." }, + { "name": "IconComponent", + "type": "Object", + "doc": "React component rendering the defined icon.", + "optional": true }, + { "name": "IconSmallComponent", + "type": "Object", + "doc": "React component rendering the defined small icon.", + "optional": true }, + { "name": "action", + "type": "Function", + "doc": "Function that once invoked triggers the configured action of the menu plugin." } ], + "extra": + { }, + "labels": [] }, + { "name": "DashboardPlugin", + "locations": + [ { "lineno": 119, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "DashboardPlugin Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "id", + "type": "string", + "doc": "Plugin ID." }, + { "name": "title", + "type": "string", + "doc": "Plugin title." }, + { "name": "Component", + "type": "Object", + "doc": "React.ComponentType" } ], + "extra": + { }, + "labels": [] }, + { "name": "Destination", + "locations": + [ { "lineno": 56, + "filename": "navigation.js" } ], + "docs": + { "summary": "Destination Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "pageId", + "type": "string", + "doc": "ID of the page to navigate to. See [Dashboard Page IDs](https://dev.wix.com/docs/sdk/host-modules/dashboard/page-ids) to find the appropriate ID." }, + { "name": "relativeUrl", + "type": "string", + "doc": "URL segment to append to the base URL of the selected page. Can include path segments, a query string, and a fragment identifier.", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "EnvironmentState", + "locations": + [ { "lineno": 76, + "filename": "observeState.js" } ], + "docs": + { "summary": "EnvironmentState Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "locale", + "type": "string", + "doc": "User's locale in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) format." }, + { "name": "embedded", + "type": "boolean", + "doc": "Whether the dashboard is being rendered inside an iframe." }, + { "name": "pageLocation", + "type": "@wix/dashboard.PageLocation", + "doc": "Deprecated. Information about the currently rendered page location." } ], + "extra": + { }, + "labels": [] }, + { "name": "EventRemover", + "locations": + [ { "lineno": 93, + "filename": "observeState.js" } ], + "docs": + { "summary": "Event Remover Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "remove", + "type": "Function", + "doc": "Removes the event handler." } ], + "extra": + { }, + "labels": [] }, + { "name": "GetDashboardMenuPluginsOptions", + "locations": + [ { "lineno": 127, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "GetDashboardMenuPluginsOptions Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "permissionStrategy", + "type": "string", + "doc": "Permission strategy. Supported values: \n- `\"filter\"`: Excludes plugins without permission from the getDashboardMenuPlugins return value.\n- `\"ignore\"`: Returns all items regardless of permissions.\n\nOptions: `\"filter\"`, `\"ignore\"`", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "GetDashboardPluginsOptions", + "locations": + [ { "lineno": 107, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "GetDashboardPluginsOptions Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "skeletonClassName", + "type": "string", + "doc": "Class name for the skeleton loader component.", + "optional": true }, + { "name": "permissionStrategy", + "type": "string", + "doc": "Permission strategy. Supported value: \n- `\"filter\"`: Excludes plugins without permission from the `getDashboardPlugins` return value.\n- `\"ignore\"`: Returns all plugins regardless of permissions.\n- `\"no-permitted-widget\"`: Returns all plugins and renders a \"No permission\" widget for plugins lacking permissions.\n\nOptions: `\"filter\"`, `\"ignore\"`, `\"no-permitted-widget\"`", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "GetWidgetOptions", + "locations": + [ { "lineno": 149, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "GetWidgetOptions Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "skeletonClassName", + "type": "string", + "doc": "Class name for the skeleton loader component.", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "InstallAppResponse", + "locations": + [ { "lineno": 96, + "filename": "utilities.js" } ], + "docs": + { "summary": "InstallAppResponse Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "status", + "type": "string", + "doc": "Supported values: \n- `\"SUCCESS\"`: Installation completed successfully. \n- `\"UPGRADE_TO_PREMIUM\"`: Installation didn't complete because the site is not a premium site. \n- `\"CONNECT_DOMAIN\"`: Installation didn't complete because the site doesn't have a domain. \n- `\"CANCELED\"`: Wix user canceled the installation flow. For example, by clicking the **Cancel** button." }, + { "name": "installedApps", + "type": + { "name": "Array", + "typeParams": + [ "@wix/dashboard.InstalledApp" ] }, + "doc": "Array of `InstalledApp` objects. The first value in the array represents the specified app. Subsequent values are the specified app's dependencies." } ], + "extra": + { }, + "labels": [] }, + { "name": "InstallationOptions", + "locations": + [ { "lineno": 86, + "filename": "utilities.js" } ], + "docs": + { "summary": "InstallationOptions Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "appId", + "type": "string", + "doc": "**Required.** ID of the app to install." }, + { "name": "version", + "type": "string", + "doc": "The version of the app to install. If no version is specified, the latest published version is installed.", + "optional": true }, + { "name": "avoidPostInstallation", + "type": "boolean", + "doc": "Whether to execute post installation logic.\n\nDefault: `false`", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "InstalledApp", + "locations": + [ { "lineno": 107, + "filename": "utilities.js" } ], + "docs": + { "summary": "InstalledApp Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "appId", + "type": "string", + "doc": "App ID." }, + { "name": "version", + "type": "string", + "doc": "App version." } ], + "extra": + { }, + "labels": [] }, + { "name": "MediaManagerResult", + "locations": + [ { "lineno": 80, + "filename": "utilities.js" } ], + "docs": + { "summary": "MediaManagerResult Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "items", + "type": + { "name": "Array", + "typeParams": + [ "Object" ] }, + "doc": "Array of [file descriptor](https://dev.wix.com/docs/sdk/backend-modules/media/files/get-file-descriptor) objects for the selected media files." } ], + "extra": + { }, + "labels": [] }, + { "name": "ModalInfo", + "locations": + [ { "lineno": 44, + "filename": "modal.js" } ], + "docs": + { "summary": "ModalInfo Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "modalId", + "type": "string", + "doc": "ID of the dashboard modal extension to open, as defined in the Wix Dev Center." }, + { "name": "params", + "type": "Object", + "doc": "Custom data to pass into the dashboard modal extension. The extension can access this data using [`observeState()`](https://dev.wix.com/docs/sdk/host-modules/dashboard/observe-state).", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "NavigationOptions", + "locations": + [ { "lineno": 63, + "filename": "navigation.js" } ], + "docs": + { "summary": "NavigationOptions Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "displayMode", + "type": "string", + "doc": "When using `\"main\"`, the browser replaces the current main page content with the new page. When using `\"overlay\"`, the new page is displayed in a modal overlaid on top of the main page.`\"auto\"` (default) causes the page to be loaded in the current context. This means if `navigate()` is called from the main page, the main page changes. If it's called from an overlay page, the overlay content changes to the new page.\n\nOptions: `\"main\"`, `\"overlay\"`, `\"auto\"`\n\nDefault: `\"auto\"`", + "optional": true }, + { "name": "history", + "type": "string", + "doc": "Determines whether the URL of the page being navigated to is added to the browser's [session history](https://developer.mozilla.org/en-US/docs/Web/API/History_API), or replaces the URL in the current entry.\n\nOptions: `\"push\"`, `\"replace\"`", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "OpenMediaManagerOptions", + "locations": + [ { "lineno": 67, + "filename": "utilities.js" } ], + "docs": + { "summary": "OpenMediaManagerOptions Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "category", + "type": "string", + "doc": "The type of media files to display in the modal. If this value is empty, all media types are displayed.\n\nSupported values: `\"IMAGE\"`, `\"VIDEO\"`, `\"MUSIC\"`, `\"DOCUMENT\"`, `\"VECTOR_ART\"`, `\"3D_IMAGE\"`.\n\nBy default, all the categories except `\"3D_IMAGE\"` are displayed.", + "optional": true }, + { "name": "multiSelect", + "type": "boolean", + "doc": "Whether multiple files can be selected.\n\nDefault: `false`", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "OpenModalReturn", + "locations": + [ { "lineno": 51, + "filename": "modal.js" } ], + "docs": + { "summary": "Open Modal Return Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "modalClosed", + "type": + { "name": "Promise", + "typeParams": + [ "@wix/dashboard.Serializable" ] }, + "doc": "Resolves to the data passed to [`closeModal()`](https://dev.wix.com/docs/sdk/host-modules/dashboard/close-modal) when the modal is closed." } ], + "extra": + { }, + "labels": [] }, + { "name": "PageLocation", + "locations": + [ { "lineno": 84, + "filename": "observeState.js" } ], + "docs": + { "summary": "PageLocation Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "pageId", + "type": "string", + "doc": "ID of the current page." }, + { "name": "pathname", + "type": "string", + "doc": "Any parts of the current URL path appended to the page's full URL path." }, + { "name": "search", + "type": "string", + "doc": "The current URL's query string.", + "optional": true }, + { "name": "hash", + "type": "string", + "doc": "The current URL's fragment identifier.", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "PageParams", + "locations": + [ { "lineno": 70, + "filename": "observeState.js" } ], + "docs": + { "summary": "PageParams Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "location", + "type": "@wix/dashboard.PageLocation", + "doc": "Information about the location of the rendered page." } ], + "extra": + { }, + "labels": [] }, + { "name": "PluginPlacement", + "locations": + [ { "lineno": 99, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "PluginPlacement Object (deprecated)", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "appDefinitionId", + "type": "string", + "doc": "ID of the app created by Wix whos widget you want to add your plugin to. You can find the IDs of these apps in [this list of apps created by Wix](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix)." }, + { "name": "widgetId", + "type": "string", + "doc": "ID of the host widget in which the slot is located. A host widget is a widget provided by an app created by Wix. Check the [slots documentation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/site-plugins/supported-wix-app-pages/about-slots) to find the IDs of site widgets provided by apps created by Wix." }, + { "name": "slotId", + "type": "string", + "doc": "ID of the slot in the host widget using the legacy slot notation method." } ], + "extra": + { }, + "labels": [] }, + { "name": "Serializable", + "locations": + [ { "lineno": 57, + "filename": "modal.js" } ], + "docs": + { "summary": "Serializable Type", + "links": [], + "examples": [], + "extra": + { } }, + "members": [], + "extra": + { }, + "labels": [] }, + { "name": "SiteInfo", + "locations": + [ { "lineno": 58, + "filename": "utilities.js" } ], + "docs": + { "summary": "SiteInfo Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "wixEditorAvailable", + "type": "boolean", + "doc": "Whether Wix Editor or Wix Studio is connected to this site. Returns `false` for sites that use Wix Vibe." }, + { "name": "wixEditorActive", + "type": "boolean", + "doc": "Whether Wix Editor or Wix Studio is currently active and accessible. Requires both availability and a valid editor URL." }, + { "name": "editorUrl", + "type": "string", + "doc": "The URL to access the editor for this site, if available.", + "optional": true }, + { "name": "published", + "type": "boolean", + "doc": "Whether the site is published. Only available for sites using Wix Vibe.", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "ToastAction", + "locations": + [ { "lineno": 82, + "filename": "toast.js" } ], + "docs": + { "summary": "ToastAction Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "text", + "type": "string", + "doc": "Text that appears in the call-to-action." }, + { "name": "uiType", + "type": "string", + "doc": "The type of call-to-action. \n\nOptions: `\"button\"`, `\"link\"`\n\nDefault: `\"button\"`", + "optional": true }, + { "name": "removeToastOnClick", + "type": "boolean", + "doc": "Whether to remove the toast after the call-to-action is clicked.\n\nDefault: `true`", + "optional": true }, + { "name": "onClick", + "type": "Function", + "doc": "Callback function to run after the call-to-action is clicked." } ], + "extra": + { }, + "labels": [] }, + { "name": "ToastConfig", + "locations": + [ { "lineno": 54, + "filename": "toast.js" } ], + "docs": + { "summary": "ToastConfig Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "message", + "type": "string", + "doc": "Text that appears in the toast." }, + { "name": "timeout", + "type": "string", + "doc": "Whether the toast should disappear after a predefined timeout (6 seconds). \n\nOptions: `\"none\"`, `\"normal\"`\n\nDefault: `\"normal\"`", + "optional": true }, + { "name": "type", + "type": "string", + "doc": "Toast icon and message type. \n\nOptions: \n- `\"standard\"`: Information icon. \n- `\"success\"`: Green checkmark icon. \n- `\"warning\"`: Yellow warning icon.\n- `\"error\"`: Red error icon.\n\nDefault: `\"standard\"`", + "optional": true }, + { "name": "priority", + "type": "string", + "doc": "Priority of the toast. If several toasts are triggered at the same time, they're displayed in the order of their priority levels. \n\nOptions: `\"low\"`, `\"normal\"`, `\"high\"`\n\nDefault: `\"normal\"`", + "optional": true }, + { "name": "action", + "type": "@wix/dashboard.ToastAction", + "doc": "Object representing a call-to-action that's displayed in the toast.", + "optional": true }, + { "name": "onCloseClick", + "type": "Function", + "doc": "Callback function to run when the toast is closed by clicking its close button.", + "optional": true }, + { "name": "onToastSeen", + "type": "Function", + "doc": "Callback function to run when the toast is seen by the user.", + "optional": true } ], + "extra": + { }, + "labels": [] }, + { "name": "ToastReturn", + "locations": + [ { "lineno": 97, + "filename": "toast.js" } ], + "docs": + { "summary": "ShowToast Return Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "remove", + "type": "Function", + "doc": "Removes the displayed toast." } ], + "extra": + { }, + "labels": [] }, + { "name": "addSitePluginOptions", + "locations": + [ { "lineno": 92, + "filename": "sitePlugins.js" } ], + "docs": + { "summary": "addSitePluginOptions Object", + "links": [], + "examples": [], + "extra": + { } }, + "members": + [ { "name": "slotId", + "type": "string", + "doc": "The ID of the slot in which you want to add the plugin. Learn more about the [slots available on Wix app pages](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/site-extensions/site-plugins/supported-wix-app-pages/about-slots).", + "optional": true }, + { "name": "placement", + "type": "@wix/dashboard.PluginPlacement", + "doc": "**(Deprecated)** Optional. Details of the slot in which you want to add the plugin using the legacy slot notation method. Use the `slotId` property instead.", + "optional": true } ], + "extra": + { }, + "labels": [] } ], + "extra": + { "scopes": + [ "frontend" ] } } \ No newline at end of file