diff --git a/.changeset/blue-pears-grab.md b/.changeset/blue-pears-grab.md new file mode 100644 index 00000000..adf405de --- /dev/null +++ b/.changeset/blue-pears-grab.md @@ -0,0 +1,5 @@ +--- +"@saleor/app-sdk": minor +--- + +Added "options" field to AppExtension types within manifest diff --git a/.changeset/eight-eagles-fry.md b/.changeset/eight-eagles-fry.md new file mode 100644 index 00000000..97b28ba1 --- /dev/null +++ b/.changeset/eight-eagles-fry.md @@ -0,0 +1,7 @@ +--- +"@saleor/app-sdk": minor +--- + +Added NEW_TAB target and WIDGET target for AppExtension. + +[todo see docs](todo) diff --git a/.changeset/some-snakes-begin.md b/.changeset/some-snakes-begin.md index 52f2694a..0784adc4 100644 --- a/.changeset/some-snakes-begin.md +++ b/.changeset/some-snakes-begin.md @@ -30,4 +30,11 @@ Add additional `AppExtensionMount` available in Saleor 3.22: - "PAGE_TYPE_DETAILS_MORE_ACTIONS" - "MENU_OVERVIEW_CREATE" - "MENU_OVERVIEW_MORE_ACTIONS" -- "MENU_DETAILS_MORE_ACTIONS"; +- "MENU_DETAILS_MORE_ACTIONS" +- "ORDER_DETAILS_WIDGETS" +- "DRAFT_ORDER_DETAILS_WIDGETS" +- "VOUCHER_DETAILS_WIDGETS" +- "PRODUCT_DETAILS_WIDGETS" +- "CUSTOMER_DETAILS_WIDGETS" +- "GIFT_CARD_DETAILS_WIDGETS" +- "COLLECTION_DETAILS_WIDGETS" diff --git a/src/types.ts b/src/types.ts index a7e070f2..49d0cf9f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -export type AppExtensionTarget = "POPUP" | "APP_PAGE"; +export type AppExtensionTarget = "POPUP" | "APP_PAGE" | "NEW_TAB" | "WIDGET"; // Available mounts in Saleor 3.22 and newer type AppExtensionMount3_22 = @@ -28,7 +28,14 @@ type AppExtensionMount3_22 = | "PAGE_TYPE_DETAILS_MORE_ACTIONS" | "MENU_OVERVIEW_CREATE" | "MENU_OVERVIEW_MORE_ACTIONS" - | "MENU_DETAILS_MORE_ACTIONS"; + | "MENU_DETAILS_MORE_ACTIONS" + | "COLLECTION_DETAILS_WIDGETS" + | "CUSTOMER_DETAILS_WIDGETS" + | "PRODUCT_DETAILS_WIDGETS" + | "ORDER_DETAILS_WIDGETS" + | "DRAFT_ORDER_DETAILS_WIDGETS" + | "VOUCHER_DETAILS_WIDGETS" + | "GIFT_CARD_DETAILS_WIDGETS"; export type AppExtensionMount = | AppExtensionMount3_22 @@ -229,26 +236,82 @@ export type SyncWebhookEventType = | "PAYMENT_METHOD_INITIALIZE_TOKENIZATION_SESSION" | "PAYMENT_METHOD_PROCESS_TOKENIZATION_SESSION"; -export interface AppExtension { +interface BaseAppExtension { /** Name which will be displayed in the dashboard */ label: string; /** the place where the extension will be mounted */ mount: AppExtensionMount; /** Method of presenting the interface - `POPUP` will present the interface in a modal overlay - `APP_PAGE` will navigate to the application page - @default `POPUP` - */ - target: AppExtensionTarget; + `POPUP` will present the interface in a modal overlay + `APP_PAGE` will navigate to the application page + @default `POPUP` + */ permissions: AppPermission[]; /** URL of the view to display; - you can skip the domain and protocol when target is set to `APP_PAGE`, or when your manifest defines an `appUrl`. + you can skip the domain and protocol when target is set to `APP_PAGE`, or when your manifest defines an `appUrl`. - When target is set to `POPUP`, the url will be used to render an `