datocms-plugin-sdk 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/hooks/renderItemCollectionOutlet.js.map +1 -1
- package/dist/cjs/manifest.js +2446 -2111
- package/dist/cjs/manifest.js.map +1 -1
- package/dist/esm/ctx/base.d.ts +43 -29
- package/dist/esm/ctx/commonExtras/field.d.ts +4 -0
- package/dist/esm/ctx/commonExtras/itemForm.d.ts +14 -12
- package/dist/esm/ctx/commonExtras/sizing.d.ts +1 -0
- package/dist/esm/hooks/assetSources.d.ts +2 -1
- package/dist/esm/hooks/buildItemPresentationInfo.d.ts +2 -1
- package/dist/esm/hooks/contentAreaSidebarItems.d.ts +2 -1
- package/dist/esm/hooks/customBlockStylesForStructuredTextField.d.ts +2 -2
- package/dist/esm/hooks/customMarksForStructuredTextField.d.ts +2 -2
- package/dist/esm/hooks/executeFieldDropdownAction.d.ts +9 -1
- package/dist/esm/hooks/executeItemFormDropdownAction.d.ts +9 -1
- package/dist/esm/hooks/executeItemsDropdownAction.d.ts +11 -1
- package/dist/esm/hooks/executeUploadsDropdownAction.d.ts +11 -1
- package/dist/esm/hooks/fieldDropdownActions.d.ts +9 -0
- package/dist/esm/hooks/initialLocationQueryForItemSelector.d.ts +2 -1
- package/dist/esm/hooks/itemCollectionOutlets.d.ts +8 -1
- package/dist/esm/hooks/itemFormDropdownActions.d.ts +9 -0
- package/dist/esm/hooks/itemFormOutlets.d.ts +3 -2
- package/dist/esm/hooks/itemFormSidebarPanels.d.ts +2 -1
- package/dist/esm/hooks/itemFormSidebars.d.ts +2 -1
- package/dist/esm/hooks/itemsDropdownActions.d.ts +12 -0
- package/dist/esm/hooks/mainNavigationTabs.d.ts +2 -1
- package/dist/esm/hooks/manualFieldExtensions.d.ts +2 -1
- package/dist/esm/hooks/onBeforeItemUpsert.d.ts +2 -1
- package/dist/esm/hooks/onBeforeItemsDestroy.d.ts +2 -1
- package/dist/esm/hooks/onBeforeItemsPublish.d.ts +2 -1
- package/dist/esm/hooks/onBeforeItemsUnpublish.d.ts +2 -1
- package/dist/esm/hooks/overrideFieldExtensions.d.ts +2 -2
- package/dist/esm/hooks/renderItemCollectionOutlet.d.ts +6 -0
- package/dist/esm/hooks/renderItemCollectionOutlet.js.map +1 -1
- package/dist/esm/hooks/renderItemFormOutlet.d.ts +3 -3
- package/dist/esm/hooks/settingsAreaSidebarItemGroups.d.ts +2 -1
- package/dist/esm/hooks/uploadSidebarPanels.d.ts +2 -1
- package/dist/esm/hooks/uploadSidebars.d.ts +2 -1
- package/dist/esm/hooks/uploadsDropdownActions.d.ts +15 -1
- package/dist/esm/manifest.js +2446 -2111
- package/dist/esm/manifest.js.map +1 -1
- package/dist/esm/manifestTypes.d.ts +117 -22
- package/dist/types/ctx/base.d.ts +43 -29
- package/dist/types/ctx/commonExtras/field.d.ts +4 -0
- package/dist/types/ctx/commonExtras/itemForm.d.ts +14 -12
- package/dist/types/ctx/commonExtras/sizing.d.ts +1 -0
- package/dist/types/hooks/assetSources.d.ts +2 -1
- package/dist/types/hooks/buildItemPresentationInfo.d.ts +2 -1
- package/dist/types/hooks/contentAreaSidebarItems.d.ts +2 -1
- package/dist/types/hooks/customBlockStylesForStructuredTextField.d.ts +2 -2
- package/dist/types/hooks/customMarksForStructuredTextField.d.ts +2 -2
- package/dist/types/hooks/executeFieldDropdownAction.d.ts +9 -1
- package/dist/types/hooks/executeItemFormDropdownAction.d.ts +9 -1
- package/dist/types/hooks/executeItemsDropdownAction.d.ts +11 -1
- package/dist/types/hooks/executeUploadsDropdownAction.d.ts +11 -1
- package/dist/types/hooks/fieldDropdownActions.d.ts +9 -0
- package/dist/types/hooks/initialLocationQueryForItemSelector.d.ts +2 -1
- package/dist/types/hooks/itemCollectionOutlets.d.ts +8 -1
- package/dist/types/hooks/itemFormDropdownActions.d.ts +9 -0
- package/dist/types/hooks/itemFormOutlets.d.ts +3 -2
- package/dist/types/hooks/itemFormSidebarPanels.d.ts +2 -1
- package/dist/types/hooks/itemFormSidebars.d.ts +2 -1
- package/dist/types/hooks/itemsDropdownActions.d.ts +12 -0
- package/dist/types/hooks/mainNavigationTabs.d.ts +2 -1
- package/dist/types/hooks/manualFieldExtensions.d.ts +2 -1
- package/dist/types/hooks/onBeforeItemUpsert.d.ts +2 -1
- package/dist/types/hooks/onBeforeItemsDestroy.d.ts +2 -1
- package/dist/types/hooks/onBeforeItemsPublish.d.ts +2 -1
- package/dist/types/hooks/onBeforeItemsUnpublish.d.ts +2 -1
- package/dist/types/hooks/overrideFieldExtensions.d.ts +2 -2
- package/dist/types/hooks/renderItemCollectionOutlet.d.ts +6 -0
- package/dist/types/hooks/renderItemFormOutlet.d.ts +3 -3
- package/dist/types/hooks/settingsAreaSidebarItemGroups.d.ts +2 -1
- package/dist/types/hooks/uploadSidebarPanels.d.ts +2 -1
- package/dist/types/hooks/uploadSidebars.d.ts +2 -1
- package/dist/types/hooks/uploadsDropdownActions.d.ts +15 -1
- package/dist/types/manifestTypes.d.ts +117 -22
- package/manifest.json +2354 -2019
- package/package.json +4 -4
- package/src/ctx/base.ts +62 -30
- package/src/ctx/commonExtras/field.ts +4 -0
- package/src/ctx/commonExtras/itemForm.ts +15 -12
- package/src/ctx/commonExtras/sizing.ts +1 -0
- package/src/hooks/assetSources.ts +3 -1
- package/src/hooks/buildItemPresentationInfo.ts +3 -1
- package/src/hooks/contentAreaSidebarItems.ts +5 -1
- package/src/hooks/customBlockStylesForStructuredTextField.ts +2 -2
- package/src/hooks/customMarksForStructuredTextField.ts +2 -2
- package/src/hooks/executeFieldDropdownAction.ts +7 -0
- package/src/hooks/executeItemFormDropdownAction.ts +7 -0
- package/src/hooks/executeItemsDropdownAction.ts +8 -0
- package/src/hooks/executeUploadsDropdownAction.ts +9 -0
- package/src/hooks/fieldDropdownActions.ts +9 -0
- package/src/hooks/initialLocationQueryForItemSelector.ts +3 -1
- package/src/hooks/itemCollectionOutlets.ts +9 -1
- package/src/hooks/itemFormDropdownActions.ts +9 -0
- package/src/hooks/itemFormOutlets.ts +7 -2
- package/src/hooks/itemFormSidebarPanels.ts +3 -1
- package/src/hooks/itemFormSidebars.ts +6 -1
- package/src/hooks/itemsDropdownActions.ts +12 -0
- package/src/hooks/mainNavigationTabs.ts +3 -1
- package/src/hooks/manualFieldExtensions.ts +5 -1
- package/src/hooks/onBeforeItemUpsert.ts +3 -1
- package/src/hooks/onBeforeItemsDestroy.ts +6 -1
- package/src/hooks/onBeforeItemsPublish.ts +6 -1
- package/src/hooks/onBeforeItemsUnpublish.ts +6 -1
- package/src/hooks/overrideFieldExtensions.ts +2 -2
- package/src/hooks/renderItemCollectionOutlet.ts +6 -0
- package/src/hooks/renderItemFormOutlet.ts +3 -3
- package/src/hooks/settingsAreaSidebarItemGroups.ts +5 -1
- package/src/hooks/uploadSidebarPanels.ts +3 -1
- package/src/hooks/uploadSidebars.ts +3 -1
- package/src/hooks/uploadsDropdownActions.ts +15 -1
- package/src/manifest.ts +2562 -2151
- package/src/manifestTypes.ts +125 -28
|
@@ -2,7 +2,15 @@ import { Ctx } from '../ctx/base';
|
|
|
2
2
|
import type { FieldAdditionalProperties } from '../ctx/commonExtras/field';
|
|
3
3
|
import type { ItemFormAdditionalMethods, ItemFormAdditionalProperties } from '../ctx/commonExtras/itemForm';
|
|
4
4
|
export type ExecuteFieldDropdownActionHook = {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Use this function to execute a particular dropdown action defined via
|
|
7
|
+
* the `fieldDropdownActions()` hook.
|
|
8
|
+
*
|
|
9
|
+
* @tag dropdownActions
|
|
10
|
+
*/
|
|
11
|
+
executeFieldDropdownAction: (
|
|
12
|
+
/** The ID of the action that was requested by the user */
|
|
13
|
+
actionId: string, ctx: ExecuteFieldDropdownActionCtx) => Promise<void>;
|
|
6
14
|
};
|
|
7
15
|
export type ExecuteFieldDropdownActionCtx = Ctx<ItemFormAdditionalProperties & FieldAdditionalProperties & {
|
|
8
16
|
parameters: Record<string, unknown> | undefined;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { Ctx } from '../ctx/base';
|
|
2
2
|
import type { ItemFormAdditionalMethods, ItemFormAdditionalProperties } from '../ctx/commonExtras/itemForm';
|
|
3
3
|
export type ExecuteItemFormDropdownActionHook = {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Use this function to execute a particular dropdown action defined via
|
|
6
|
+
* the `itemFormDropdownActions()` hook.
|
|
7
|
+
*
|
|
8
|
+
* @tag dropdownActions
|
|
9
|
+
*/
|
|
10
|
+
executeItemFormDropdownAction: (
|
|
11
|
+
/** The ID of the action that was requested by the user */
|
|
12
|
+
actionId: string, ctx: ExecuteItemFormDropdownActionCtx) => Promise<void>;
|
|
5
13
|
};
|
|
6
14
|
export type ExecuteItemFormDropdownActionCtx = Ctx<ItemFormAdditionalProperties & {
|
|
7
15
|
parameters: Record<string, unknown> | undefined;
|
|
@@ -2,7 +2,17 @@ import type { SchemaTypes } from '@datocms/cma-client';
|
|
|
2
2
|
import { Ctx } from '../ctx/base';
|
|
3
3
|
type Item = SchemaTypes.Item;
|
|
4
4
|
export type ExecuteItemsDropdownActionHook = {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Use this function to execute a particular dropdown action defined via
|
|
7
|
+
* the `itemsDropdownActions()` hook.
|
|
8
|
+
*
|
|
9
|
+
* @tag dropdownActions
|
|
10
|
+
*/
|
|
11
|
+
executeItemsDropdownAction: (
|
|
12
|
+
/** The ID of the action that was requested by the user */
|
|
13
|
+
actionId: string,
|
|
14
|
+
/** The records on which the action should be executed */
|
|
15
|
+
items: Item[], ctx: ExecuteItemsDropdownActionCtx) => Promise<void>;
|
|
6
16
|
};
|
|
7
17
|
export type ExecuteItemsDropdownActionCtx = Ctx<{
|
|
8
18
|
parameters: Record<string, unknown> | undefined;
|
|
@@ -2,7 +2,17 @@ import type { SchemaTypes } from '@datocms/cma-client';
|
|
|
2
2
|
import { Ctx } from '../ctx/base';
|
|
3
3
|
type Upload = SchemaTypes.Upload;
|
|
4
4
|
export type ExecuteUploadsDropdownActionHook = {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Use this function to execute a particular dropdown action defined via
|
|
7
|
+
* the `uploadsDropdownActions()` hook.
|
|
8
|
+
*
|
|
9
|
+
* @tag dropdownActions
|
|
10
|
+
*/
|
|
11
|
+
executeUploadsDropdownAction: (
|
|
12
|
+
/** The ID of the action that was requested by the user */
|
|
13
|
+
actionId: string,
|
|
14
|
+
/** The assets on which the action should be executed */
|
|
15
|
+
uploads: Upload[], ctx: ExecuteUploadsDropdownActionCtx) => Promise<void>;
|
|
6
16
|
};
|
|
7
17
|
export type ExecuteUploadsDropdownActionCtx = Ctx<{
|
|
8
18
|
parameters: Record<string, unknown> | undefined;
|
|
@@ -5,6 +5,15 @@ import { ItemFormAdditionalProperties } from '../ctx/commonExtras/itemForm';
|
|
|
5
5
|
import { DropdownAction, DropdownActionGroup } from '../shared';
|
|
6
6
|
type Field = SchemaTypes.Field;
|
|
7
7
|
export type FieldDropdownActionsHook = {
|
|
8
|
+
/**
|
|
9
|
+
* Use this function to define custom actions (or groups of actions) to be
|
|
10
|
+
* displayed at the individual field level in the record editing form.
|
|
11
|
+
*
|
|
12
|
+
* The `executeFieldDropdownAction()` hook will be triggered once the user
|
|
13
|
+
* clicks on one of the defined actions.
|
|
14
|
+
*
|
|
15
|
+
* @tag dropdownActions
|
|
16
|
+
*/
|
|
8
17
|
fieldDropdownActions: (field: Field, ctx: FieldDropdownActionsCtx) => Array<DropdownAction | DropdownActionGroup>;
|
|
9
18
|
};
|
|
10
19
|
export type FieldDropdownActionsCtx = Ctx<ItemFormAdditionalProperties & FieldAdditionalProperties>;
|
|
@@ -10,8 +10,9 @@ export type InitialLocationQueryForItemSelectorHook = {
|
|
|
10
10
|
*
|
|
11
11
|
* @tag locationQuery
|
|
12
12
|
*/
|
|
13
|
-
initialLocationQueryForItemSelector: (openerField: Field, itemType: ItemType, ctx:
|
|
13
|
+
initialLocationQueryForItemSelector: (openerField: Field, itemType: ItemType, ctx: InitialLocationQueryForItemSelectorCtx) => MaybePromise<InitialLocationQueryForItemSelector | undefined>;
|
|
14
14
|
};
|
|
15
|
+
export type InitialLocationQueryForItemSelectorCtx = Ctx;
|
|
15
16
|
export type InitialLocationQueryForItemSelector = {
|
|
16
17
|
locationQuery: ItemListLocationQuery;
|
|
17
18
|
/**
|
|
@@ -2,8 +2,15 @@ import type { SchemaTypes } from '@datocms/cma-client';
|
|
|
2
2
|
import { Ctx } from '../ctx/base';
|
|
3
3
|
type ItemType = SchemaTypes.ItemType;
|
|
4
4
|
export type ItemCollectionOutletsHook = {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Use this function to declare custom outlets to be shown at the top of a
|
|
7
|
+
* collection of records of a particular model
|
|
8
|
+
*
|
|
9
|
+
* @tag outlets
|
|
10
|
+
*/
|
|
11
|
+
itemCollectionOutlets: (itemType: ItemType, ctx: ItemCollectionOutletsCtx) => ItemCollectionOutlet[];
|
|
6
12
|
};
|
|
13
|
+
export type ItemCollectionOutletsCtx = Ctx;
|
|
7
14
|
/** An outlet to be shown at the top of a record's collection page */
|
|
8
15
|
export type ItemCollectionOutlet = {
|
|
9
16
|
/**
|
|
@@ -4,6 +4,15 @@ import { ItemFormAdditionalProperties } from '../ctx/commonExtras/itemForm';
|
|
|
4
4
|
import { DropdownAction, DropdownActionGroup } from '../shared';
|
|
5
5
|
type ItemType = SchemaTypes.ItemType;
|
|
6
6
|
export type ItemFormDropdownActionsHook = {
|
|
7
|
+
/**
|
|
8
|
+
* Use this function to define custom actions (or groups of actions) to be
|
|
9
|
+
* displayed at when editing a particular record.
|
|
10
|
+
*
|
|
11
|
+
* The `executeItemFormDropdownAction()` hook will be triggered once the user
|
|
12
|
+
* clicks on one of the defined actions.
|
|
13
|
+
*
|
|
14
|
+
* @tag dropdownActions
|
|
15
|
+
*/
|
|
7
16
|
itemFormDropdownActions: (itemType: ItemType, ctx: ItemFormDropdownActionsCtx) => Array<DropdownAction | DropdownActionGroup>;
|
|
8
17
|
};
|
|
9
18
|
export type ItemFormDropdownActionsCtx = ItemFormDropdownActionsProperties;
|
|
@@ -6,10 +6,11 @@ export type ItemFormOutletsHook = {
|
|
|
6
6
|
* Use this function to declare custom outlets to be shown at the top of the
|
|
7
7
|
* record's editing page
|
|
8
8
|
*
|
|
9
|
-
* @tag
|
|
9
|
+
* @tag outlets
|
|
10
10
|
*/
|
|
11
|
-
itemFormOutlets: (itemType: ItemType, ctx:
|
|
11
|
+
itemFormOutlets: (itemType: ItemType, ctx: ItemFormOutletsCtx) => ItemFormOutlet[];
|
|
12
12
|
};
|
|
13
|
+
export type ItemFormOutletsCtx = Ctx;
|
|
13
14
|
export type ItemFormOutlet = {
|
|
14
15
|
/**
|
|
15
16
|
* ID of the outlet. Will be the first argument for the `renderItemFormOutlet`
|
|
@@ -9,8 +9,9 @@ export type ItemFormSidebarPanelsHook = {
|
|
|
9
9
|
*
|
|
10
10
|
* @tag sidebarPanels
|
|
11
11
|
*/
|
|
12
|
-
itemFormSidebarPanels: (itemType: ItemType, ctx:
|
|
12
|
+
itemFormSidebarPanels: (itemType: ItemType, ctx: ItemFormSidebarPanelsCtx) => ItemFormSidebarPanel[];
|
|
13
13
|
};
|
|
14
|
+
export type ItemFormSidebarPanelsCtx = Ctx;
|
|
14
15
|
export type ItemFormSidebarPanel = {
|
|
15
16
|
/**
|
|
16
17
|
* ID of the panel. Will be the first argument for the
|
|
@@ -8,8 +8,9 @@ export type ItemFormSidebarsHook = {
|
|
|
8
8
|
*
|
|
9
9
|
* @tag sidebarPanels
|
|
10
10
|
*/
|
|
11
|
-
itemFormSidebars: (itemType: ItemType, ctx:
|
|
11
|
+
itemFormSidebars: (itemType: ItemType, ctx: ItemFormSidebarsCtx) => ItemFormSidebar[];
|
|
12
12
|
};
|
|
13
|
+
export type ItemFormSidebarsCtx = Ctx;
|
|
13
14
|
export type ItemFormSidebar = {
|
|
14
15
|
/**
|
|
15
16
|
* ID of the sidebar. Will be the first argument for the
|
|
@@ -3,6 +3,18 @@ import { Ctx } from '../ctx/base';
|
|
|
3
3
|
import { DropdownAction, DropdownActionGroup } from '../shared';
|
|
4
4
|
type ItemType = SchemaTypes.ItemType;
|
|
5
5
|
export type ItemsDropdownActionsHook = {
|
|
6
|
+
/**
|
|
7
|
+
* This function lets you set up custom actions (or groups of actions) that
|
|
8
|
+
* show up when the user:
|
|
9
|
+
*
|
|
10
|
+
* * selects multiple records in the collection view for batch operations, or
|
|
11
|
+
* * starts editing a specific record.
|
|
12
|
+
*
|
|
13
|
+
* The `executeItemsDropdownAction()` hook will be triggered once the user
|
|
14
|
+
* clicks on one of the defined actions.
|
|
15
|
+
*
|
|
16
|
+
* @tag dropdownActions
|
|
17
|
+
*/
|
|
6
18
|
itemsDropdownActions: (itemType: ItemType, ctx: ItemDropdownActionsCtx) => Array<DropdownAction | DropdownActionGroup>;
|
|
7
19
|
};
|
|
8
20
|
export type ItemDropdownActionsCtx = Ctx<{
|
|
@@ -7,8 +7,9 @@ export type MainNavigationTabsHook = {
|
|
|
7
7
|
*
|
|
8
8
|
* @tag pages
|
|
9
9
|
*/
|
|
10
|
-
mainNavigationTabs: (ctx:
|
|
10
|
+
mainNavigationTabs: (ctx: MainNavigationTabsCtx) => MainNavigationTab[];
|
|
11
11
|
};
|
|
12
|
+
export type MainNavigationTabsCtx = Ctx;
|
|
12
13
|
/** A tab to be displayed in the top-bar of the UI */
|
|
13
14
|
export type MainNavigationTab = {
|
|
14
15
|
/** Label to be shown. Must be unique. */
|
|
@@ -6,8 +6,9 @@ export type ManualFieldExtensionsHook = {
|
|
|
6
6
|
*
|
|
7
7
|
* @tag manualFieldExtensions
|
|
8
8
|
*/
|
|
9
|
-
manualFieldExtensions: (ctx:
|
|
9
|
+
manualFieldExtensions: (ctx: ManualFieldExtensionsCtx) => ManualFieldExtension[];
|
|
10
10
|
};
|
|
11
|
+
export type ManualFieldExtensionsCtx = Ctx;
|
|
11
12
|
export type ManualFieldExtension = {
|
|
12
13
|
/**
|
|
13
14
|
* ID of field extension. Will be the first argument for the
|
|
@@ -10,6 +10,7 @@ export type OnBeforeItemUpsertHook = {
|
|
|
10
10
|
*
|
|
11
11
|
* @tag beforeHooks
|
|
12
12
|
*/
|
|
13
|
-
onBeforeItemUpsert: (createOrUpdateItemPayload: ItemUpdateSchema | ItemCreateSchema, ctx:
|
|
13
|
+
onBeforeItemUpsert: (createOrUpdateItemPayload: ItemUpdateSchema | ItemCreateSchema, ctx: OnBeforeItemUpsertCtx) => MaybePromise<boolean>;
|
|
14
14
|
};
|
|
15
|
+
export type OnBeforeItemUpsertCtx = Ctx;
|
|
15
16
|
export {};
|
|
@@ -9,6 +9,7 @@ export type OnBeforeItemsDestroyHook = {
|
|
|
9
9
|
*
|
|
10
10
|
* @tag beforeHooks
|
|
11
11
|
*/
|
|
12
|
-
onBeforeItemsDestroy: (items: Item[], ctx:
|
|
12
|
+
onBeforeItemsDestroy: (items: Item[], ctx: OnBeforeItemsDestroyCtx) => MaybePromise<boolean>;
|
|
13
13
|
};
|
|
14
|
+
export type OnBeforeItemsDestroyCtx = Ctx;
|
|
14
15
|
export {};
|
|
@@ -9,6 +9,7 @@ export type OnBeforeItemsPublishHook = {
|
|
|
9
9
|
*
|
|
10
10
|
* @tag beforeHooks
|
|
11
11
|
*/
|
|
12
|
-
onBeforeItemsPublish: (items: Item[], ctx:
|
|
12
|
+
onBeforeItemsPublish: (items: Item[], ctx: OnBeforeItemsPublishCtx) => MaybePromise<boolean>;
|
|
13
13
|
};
|
|
14
|
+
export type OnBeforeItemsPublishCtx = Ctx;
|
|
14
15
|
export {};
|
|
@@ -9,6 +9,7 @@ export type OnBeforeItemsUnpublishHook = {
|
|
|
9
9
|
*
|
|
10
10
|
* @tag beforeHooks
|
|
11
11
|
*/
|
|
12
|
-
onBeforeItemsUnpublish: (items: Item[], ctx:
|
|
12
|
+
onBeforeItemsUnpublish: (items: Item[], ctx: OnBeforeItemsUnpublishCtx) => MaybePromise<boolean>;
|
|
13
13
|
};
|
|
14
|
+
export type OnBeforeItemsUnpublishCtx = Ctx;
|
|
14
15
|
export {};
|
|
@@ -10,9 +10,9 @@ export type OverrideFieldExtensionsHook = {
|
|
|
10
10
|
*
|
|
11
11
|
* @tag forcedFieldExtensions
|
|
12
12
|
*/
|
|
13
|
-
overrideFieldExtensions: (field: Field, ctx:
|
|
13
|
+
overrideFieldExtensions: (field: Field, ctx: OverrideFieldExtensionsCtx) => FieldExtensionOverride | undefined;
|
|
14
14
|
};
|
|
15
|
-
export type
|
|
15
|
+
export type OverrideFieldExtensionsCtx = Ctx<{
|
|
16
16
|
itemType: ItemType;
|
|
17
17
|
}>;
|
|
18
18
|
/**
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { SelfResizingPluginFrameCtx } from '../ctx/pluginFrame';
|
|
2
2
|
export type RenderItemCollectionOutletHook = {
|
|
3
|
+
/**
|
|
4
|
+
* This function will be called when the plugin needs to render an outlet
|
|
5
|
+
* defined by the `itemFormOutlets()` hook.
|
|
6
|
+
*
|
|
7
|
+
* @tag outlets
|
|
8
|
+
*/
|
|
3
9
|
renderItemCollectionOutlet: (itemCollectionOutletId: string, ctx: RenderItemCollectionOutletCtx) => void;
|
|
4
10
|
};
|
|
5
11
|
export type RenderItemCollectionOutletCtx = SelfResizingPluginFrameCtx<'renderItemCollectionOutlet', {
|
|
@@ -2,10 +2,10 @@ import { ItemFormAdditionalMethods, ItemFormAdditionalProperties } from '../ctx/
|
|
|
2
2
|
import { SelfResizingPluginFrameCtx } from '../ctx/pluginFrame';
|
|
3
3
|
export type RenderItemFormOutletHook = {
|
|
4
4
|
/**
|
|
5
|
-
* This function will be called when the plugin needs to render an outlet
|
|
6
|
-
* the `itemFormOutlets`
|
|
5
|
+
* This function will be called when the plugin needs to render an outlet
|
|
6
|
+
* defined by the `itemFormOutlets()` hook.
|
|
7
7
|
*
|
|
8
|
-
* @tag
|
|
8
|
+
* @tag outlets
|
|
9
9
|
*/
|
|
10
10
|
renderItemFormOutlet: (itemFormOutletId: string, ctx: RenderItemFormOutletCtx) => void;
|
|
11
11
|
};
|
|
@@ -7,8 +7,9 @@ export type SettingsAreaSidebarItemGroupsHook = {
|
|
|
7
7
|
*
|
|
8
8
|
* @tag pages
|
|
9
9
|
*/
|
|
10
|
-
settingsAreaSidebarItemGroups: (ctx:
|
|
10
|
+
settingsAreaSidebarItemGroups: (ctx: SettingsAreaSidebarItemGroupsCtx) => SettingsAreaSidebarItemGroup[];
|
|
11
11
|
};
|
|
12
|
+
export type SettingsAreaSidebarItemGroupsCtx = Ctx;
|
|
12
13
|
/**
|
|
13
14
|
* The sidebar in the Settings Area presents a number of pages grouped by topic.
|
|
14
15
|
* This object represents a new group to be added in the sideebar to the
|
|
@@ -6,8 +6,9 @@ export type UploadSidebarPanelsHook = {
|
|
|
6
6
|
*
|
|
7
7
|
* @tag sidebarPanels
|
|
8
8
|
*/
|
|
9
|
-
uploadSidebarPanels: (ctx:
|
|
9
|
+
uploadSidebarPanels: (ctx: UploadSidebarPanelsCtx) => UploadSidebarPanel[];
|
|
10
10
|
};
|
|
11
|
+
export type UploadSidebarPanelsCtx = Ctx;
|
|
11
12
|
export type UploadSidebarPanel = {
|
|
12
13
|
/**
|
|
13
14
|
* ID of the panel. Will be the first argument for the
|
|
@@ -6,8 +6,9 @@ export type UploadSidebarsHook = {
|
|
|
6
6
|
*
|
|
7
7
|
* @tag sidebarPanels
|
|
8
8
|
*/
|
|
9
|
-
uploadSidebars: (ctx:
|
|
9
|
+
uploadSidebars: (ctx: UploadSidebarsCtx) => UploadSidebar[];
|
|
10
10
|
};
|
|
11
|
+
export type UploadSidebarsCtx = Ctx;
|
|
11
12
|
export type UploadSidebar = {
|
|
12
13
|
/**
|
|
13
14
|
* ID of the sidebar. Will be the first argument for the
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { Ctx } from '../ctx/base';
|
|
2
2
|
import { DropdownAction, DropdownActionGroup } from '../shared';
|
|
3
3
|
export type UploadsDropdownActionsHook = {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* This function lets you set up custom actions (or groups of actions) that
|
|
6
|
+
* show up when the user:
|
|
7
|
+
*
|
|
8
|
+
* * selects multiple assets in the Media Area for batch operations, or
|
|
9
|
+
* * opens up a specific asset from the Media Area.
|
|
10
|
+
*
|
|
11
|
+
* The `executeUploadsDropdownAction()` hook will be triggered once the user
|
|
12
|
+
* clicks on one of the defined actions.
|
|
13
|
+
*
|
|
14
|
+
* @tag dropdownActions
|
|
15
|
+
*/
|
|
16
|
+
uploadsDropdownActions: (ctx: UploadsDropdownActionsCtx) => Array<DropdownAction | DropdownActionGroup>;
|
|
5
17
|
};
|
|
18
|
+
type UploadsDropdownActionsCtx = Ctx;
|
|
19
|
+
export {};
|
|
@@ -1,51 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type representing a manifest.
|
|
3
|
+
*/
|
|
1
4
|
export type Manifest = {
|
|
5
|
+
/**
|
|
6
|
+
* Hooks and their respective information.
|
|
7
|
+
*/
|
|
2
8
|
hooks: Record<string, HookInfo>;
|
|
9
|
+
/**
|
|
10
|
+
* Base properties and methods available on every context argument.
|
|
11
|
+
*/
|
|
3
12
|
baseCtx: {
|
|
4
|
-
|
|
5
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Properties in the base context.
|
|
15
|
+
*/
|
|
16
|
+
properties: AdditionalPropertiesOrMethodsGroup[];
|
|
17
|
+
/**
|
|
18
|
+
* Methods in the base context.
|
|
19
|
+
*/
|
|
20
|
+
methods: AdditionalPropertiesOrMethodsGroup[];
|
|
6
21
|
};
|
|
7
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Extra properties and methods available on every SelfResizingPluginFrameCtx context argument
|
|
24
|
+
*/
|
|
25
|
+
selfResizingPluginFrameCtxSizingUtilities: AdditionalPropertiesOrMethodsGroup;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Type representing hook information.
|
|
29
|
+
*/
|
|
30
|
+
export type HookInfo = {
|
|
31
|
+
/**
|
|
32
|
+
* Name of the hook.
|
|
33
|
+
*/
|
|
34
|
+
name: string;
|
|
35
|
+
/**
|
|
36
|
+
* JSDoc comment and tag for the hook.
|
|
37
|
+
*/
|
|
38
|
+
comment?: Comment;
|
|
39
|
+
/**
|
|
40
|
+
* Non-context arguments for the hook.
|
|
41
|
+
*/
|
|
42
|
+
nonCtxArguments: NonCtxArgument[];
|
|
43
|
+
/**
|
|
44
|
+
* Context argument for the hook, if any.
|
|
45
|
+
*/
|
|
46
|
+
ctxArgument?: CtxArgument;
|
|
47
|
+
/**
|
|
48
|
+
* Return type of the hook function.
|
|
49
|
+
*/
|
|
50
|
+
returnType: string;
|
|
51
|
+
/**
|
|
52
|
+
* Code location where the hook is defined.
|
|
53
|
+
*/
|
|
54
|
+
location: CodeLocation;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Type representing a code location.
|
|
58
|
+
*/
|
|
59
|
+
export type CodeLocation = {
|
|
60
|
+
/**
|
|
61
|
+
* File path where the code is defined.
|
|
62
|
+
*/
|
|
63
|
+
filePath: string;
|
|
64
|
+
/**
|
|
65
|
+
* Line number in the file where the hook is defined.
|
|
66
|
+
*/
|
|
67
|
+
lineNumber: number;
|
|
8
68
|
};
|
|
9
69
|
/**
|
|
10
70
|
* Type alias for additional parameters or methods in context.
|
|
11
71
|
*/
|
|
12
72
|
export type AdditionalPropertyOrMethod = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Description of the parameter or method.
|
|
75
|
+
*/
|
|
76
|
+
comment?: Comment;
|
|
77
|
+
/**
|
|
78
|
+
* Code location where the parameter or method is defined.
|
|
79
|
+
*/
|
|
80
|
+
location: CodeLocation;
|
|
81
|
+
/**
|
|
82
|
+
* Type of the parameter or method.
|
|
83
|
+
*/
|
|
18
84
|
type: string;
|
|
19
85
|
};
|
|
20
|
-
export type
|
|
86
|
+
export type AdditionalPropertiesOrMethodsGroup = {
|
|
87
|
+
/**
|
|
88
|
+
* Name of the group
|
|
89
|
+
*/
|
|
90
|
+
name?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Description of the group
|
|
93
|
+
*/
|
|
94
|
+
comment?: Comment;
|
|
95
|
+
/**
|
|
96
|
+
* Type of the parameter or method.
|
|
97
|
+
*/
|
|
98
|
+
items: Record<string, AdditionalPropertyOrMethod>;
|
|
99
|
+
};
|
|
21
100
|
/**
|
|
22
101
|
* Type alias for the context argument extracted from hook type.
|
|
23
102
|
*/
|
|
24
103
|
export type CtxArgument = {
|
|
104
|
+
/**
|
|
105
|
+
* Type of the context argument.
|
|
106
|
+
*/
|
|
25
107
|
type: string;
|
|
26
|
-
|
|
27
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Additional properties in the context argument, if any.
|
|
110
|
+
*/
|
|
111
|
+
additionalProperties?: AdditionalPropertiesOrMethodsGroup[];
|
|
112
|
+
/**
|
|
113
|
+
* Additional methods in the context argument, if any.
|
|
114
|
+
*/
|
|
115
|
+
additionalMethods?: AdditionalPropertiesOrMethodsGroup[];
|
|
28
116
|
};
|
|
29
117
|
/**
|
|
30
118
|
* Type alias for non-context arguments.
|
|
31
119
|
*/
|
|
32
120
|
export type NonCtxArgument = {
|
|
121
|
+
/**
|
|
122
|
+
* Name of the non-context argument.
|
|
123
|
+
*/
|
|
33
124
|
name: string;
|
|
125
|
+
/**
|
|
126
|
+
* Type name of the non-context argument.
|
|
127
|
+
*/
|
|
34
128
|
typeName: string;
|
|
35
129
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
nonCtxArguments: NonCtxArgument[];
|
|
40
|
-
ctxArgument: CtxArgument | null;
|
|
41
|
-
returnType: string;
|
|
42
|
-
location: {
|
|
43
|
-
filePath: string;
|
|
44
|
-
lineNumber: number;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
130
|
+
/**
|
|
131
|
+
* Type representing a comment.
|
|
132
|
+
*/
|
|
47
133
|
export type Comment = {
|
|
134
|
+
/**
|
|
135
|
+
* The comment itself.
|
|
136
|
+
*/
|
|
48
137
|
comment: string;
|
|
138
|
+
/**
|
|
139
|
+
* JSDoc tag for the comment, if any.
|
|
140
|
+
*/
|
|
49
141
|
tag?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Example or example code for the comment, if any.
|
|
144
|
+
*/
|
|
50
145
|
example?: string;
|
|
51
146
|
};
|