datocms-plugin-sdk 1.1.0 → 2.0.0
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/README.md +1 -1
- package/dist/cjs/connect.js +75 -208
- package/dist/cjs/connect.js.map +1 -1
- package/dist/cjs/{types.js → ctx/base.js} +1 -1
- package/dist/cjs/ctx/base.js.map +1 -0
- package/dist/cjs/ctx/commonExtras/field.js +3 -0
- package/dist/cjs/ctx/commonExtras/field.js.map +1 -0
- package/dist/cjs/ctx/commonExtras/itemForm.js +3 -0
- package/dist/cjs/ctx/commonExtras/itemForm.js.map +1 -0
- package/dist/cjs/ctx/commonExtras/sizing.js +3 -0
- package/dist/cjs/ctx/commonExtras/sizing.js.map +1 -0
- package/dist/cjs/ctx/pluginFrame.js +3 -0
- package/dist/cjs/ctx/pluginFrame.js.map +1 -0
- package/dist/cjs/hooks/assetSources.js +3 -0
- package/dist/cjs/hooks/assetSources.js.map +1 -0
- package/dist/cjs/hooks/buildItemPresentationInfo.js +3 -0
- package/dist/cjs/hooks/buildItemPresentationInfo.js.map +1 -0
- package/dist/cjs/hooks/contentAreaSidebarItems.js +3 -0
- package/dist/cjs/hooks/contentAreaSidebarItems.js.map +1 -0
- package/dist/cjs/hooks/customBlockStylesForStructuredTextField.js +3 -0
- package/dist/cjs/hooks/customBlockStylesForStructuredTextField.js.map +1 -0
- package/dist/cjs/hooks/customMarksForStructuredTextField.js +3 -0
- package/dist/cjs/hooks/customMarksForStructuredTextField.js.map +1 -0
- package/dist/cjs/hooks/executeFieldDropdownAction.js +3 -0
- package/dist/cjs/hooks/executeFieldDropdownAction.js.map +1 -0
- package/dist/cjs/hooks/executeItemFormDropdownAction.js +3 -0
- package/dist/cjs/hooks/executeItemFormDropdownAction.js.map +1 -0
- package/dist/cjs/hooks/executeItemsDropdownAction.js +3 -0
- package/dist/cjs/hooks/executeItemsDropdownAction.js.map +1 -0
- package/dist/cjs/hooks/executeUploadsDropdownAction.js +3 -0
- package/dist/cjs/hooks/executeUploadsDropdownAction.js.map +1 -0
- package/dist/cjs/hooks/fieldDropdownActions.js +3 -0
- package/dist/cjs/hooks/fieldDropdownActions.js.map +1 -0
- package/dist/cjs/hooks/initialLocationQueryForItemSelector.js +3 -0
- package/dist/cjs/hooks/initialLocationQueryForItemSelector.js.map +1 -0
- package/dist/cjs/hooks/itemCollectionOutlets.js +3 -0
- package/dist/cjs/hooks/itemCollectionOutlets.js.map +1 -0
- package/dist/cjs/hooks/itemFormDropdownActions.js +3 -0
- package/dist/cjs/hooks/itemFormDropdownActions.js.map +1 -0
- package/dist/cjs/hooks/itemFormOutlets.js +3 -0
- package/dist/cjs/hooks/itemFormOutlets.js.map +1 -0
- package/dist/cjs/hooks/itemFormSidebarPanels.js +3 -0
- package/dist/cjs/hooks/itemFormSidebarPanels.js.map +1 -0
- package/dist/cjs/hooks/itemFormSidebars.js +3 -0
- package/dist/cjs/hooks/itemFormSidebars.js.map +1 -0
- package/dist/cjs/hooks/itemsDropdownActions.js +3 -0
- package/dist/cjs/hooks/itemsDropdownActions.js.map +1 -0
- package/dist/cjs/hooks/mainNavigationTabs.js +3 -0
- package/dist/cjs/hooks/mainNavigationTabs.js.map +1 -0
- package/dist/cjs/hooks/manualFieldExtensions.js +3 -0
- package/dist/cjs/hooks/manualFieldExtensions.js.map +1 -0
- package/dist/cjs/hooks/onBeforeItemUpsert.js +3 -0
- package/dist/cjs/hooks/onBeforeItemUpsert.js.map +1 -0
- package/dist/cjs/hooks/onBeforeItemsDestroy.js +3 -0
- package/dist/cjs/hooks/onBeforeItemsDestroy.js.map +1 -0
- package/dist/cjs/hooks/onBeforeItemsPublish.js +3 -0
- package/dist/cjs/hooks/onBeforeItemsPublish.js.map +1 -0
- package/dist/cjs/hooks/onBeforeItemsUnpublish.js +3 -0
- package/dist/cjs/hooks/onBeforeItemsUnpublish.js.map +1 -0
- package/dist/cjs/hooks/onBoot.js +3 -0
- package/dist/cjs/hooks/onBoot.js.map +1 -0
- package/dist/cjs/hooks/overrideFieldExtensions.js +3 -0
- package/dist/cjs/hooks/overrideFieldExtensions.js.map +1 -0
- package/dist/cjs/hooks/renderAssetSource.js +11 -0
- package/dist/cjs/hooks/renderAssetSource.js.map +1 -0
- package/dist/cjs/hooks/renderConfigScreen.js +11 -0
- package/dist/cjs/hooks/renderConfigScreen.js.map +1 -0
- package/dist/cjs/hooks/renderFieldExtension.js +11 -0
- package/dist/cjs/hooks/renderFieldExtension.js.map +1 -0
- package/dist/cjs/hooks/renderItemCollectionOutlet.js +11 -0
- package/dist/cjs/hooks/renderItemCollectionOutlet.js.map +1 -0
- package/dist/cjs/hooks/renderItemFormOutlet.js +11 -0
- package/dist/cjs/hooks/renderItemFormOutlet.js.map +1 -0
- package/dist/cjs/hooks/renderItemFormSidebar.js +11 -0
- package/dist/cjs/hooks/renderItemFormSidebar.js.map +1 -0
- package/dist/cjs/hooks/renderItemFormSidebarPanel.js +11 -0
- package/dist/cjs/hooks/renderItemFormSidebarPanel.js.map +1 -0
- package/dist/cjs/hooks/renderManualFieldExtensionConfigScreen.js +11 -0
- package/dist/cjs/hooks/renderManualFieldExtensionConfigScreen.js.map +1 -0
- package/dist/cjs/hooks/renderModal.js +11 -0
- package/dist/cjs/hooks/renderModal.js.map +1 -0
- package/dist/cjs/hooks/renderPage.js +11 -0
- package/dist/cjs/hooks/renderPage.js.map +1 -0
- package/dist/cjs/hooks/renderUploadSidebar.js +11 -0
- package/dist/cjs/hooks/renderUploadSidebar.js.map +1 -0
- package/dist/cjs/hooks/renderUploadSidebarPanel.js +11 -0
- package/dist/cjs/hooks/renderUploadSidebarPanel.js.map +1 -0
- package/dist/cjs/hooks/settingsAreaSidebarItemGroups.js +3 -0
- package/dist/cjs/hooks/settingsAreaSidebarItemGroups.js.map +1 -0
- package/dist/cjs/hooks/uploadSidebarPanels.js +3 -0
- package/dist/cjs/hooks/uploadSidebarPanels.js.map +1 -0
- package/dist/cjs/hooks/uploadSidebars.js +3 -0
- package/dist/cjs/hooks/uploadSidebars.js.map +1 -0
- package/dist/cjs/hooks/uploadsDropdownActions.js +3 -0
- package/dist/cjs/hooks/uploadsDropdownActions.js.map +1 -0
- package/dist/cjs/hooks/validateManualFieldExtensionParameters.js +3 -0
- package/dist/cjs/hooks/validateManualFieldExtensionParameters.js.map +1 -0
- package/dist/cjs/icon.js +3 -0
- package/dist/cjs/icon.js.map +1 -0
- package/dist/cjs/index.js +46 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/manifest.js +2909 -0
- package/dist/cjs/manifest.js.map +1 -0
- package/dist/cjs/manifestTypes.js +3 -0
- package/dist/cjs/manifestTypes.js.map +1 -0
- package/dist/cjs/shared.js +3 -0
- package/dist/cjs/shared.js.map +1 -0
- package/dist/cjs/utils.js +136 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/esm/connect.d.ts +44 -242
- package/dist/esm/connect.js +74 -206
- package/dist/esm/connect.js.map +1 -1
- package/dist/esm/ctx/base.d.ts +670 -0
- package/dist/esm/ctx/base.js +2 -0
- package/dist/esm/ctx/base.js.map +1 -0
- package/dist/esm/ctx/commonExtras/field.d.ts +29 -0
- package/dist/esm/ctx/commonExtras/field.js +2 -0
- package/dist/esm/ctx/commonExtras/field.js.map +1 -0
- package/dist/esm/ctx/commonExtras/itemForm.d.ts +148 -0
- package/dist/esm/ctx/commonExtras/itemForm.js +2 -0
- package/dist/esm/ctx/commonExtras/itemForm.js.map +1 -0
- package/dist/esm/ctx/commonExtras/sizing.d.ts +23 -0
- package/dist/esm/ctx/commonExtras/sizing.js +2 -0
- package/dist/esm/ctx/commonExtras/sizing.js.map +1 -0
- package/dist/esm/ctx/pluginFrame.d.ts +12 -0
- package/dist/esm/ctx/pluginFrame.js +2 -0
- package/dist/esm/ctx/pluginFrame.js.map +1 -0
- package/dist/esm/hooks/assetSources.d.ts +41 -0
- package/dist/esm/hooks/assetSources.js +2 -0
- package/dist/esm/hooks/assetSources.js.map +1 -0
- package/dist/esm/hooks/buildItemPresentationInfo.d.ts +28 -0
- package/dist/esm/hooks/buildItemPresentationInfo.js +2 -0
- package/dist/esm/hooks/buildItemPresentationInfo.js.map +1 -0
- package/dist/esm/hooks/contentAreaSidebarItems.d.ts +39 -0
- package/dist/esm/hooks/contentAreaSidebarItems.js +2 -0
- package/dist/esm/hooks/contentAreaSidebarItems.js.map +1 -0
- package/dist/esm/hooks/customBlockStylesForStructuredTextField.d.ts +36 -0
- package/dist/esm/hooks/customBlockStylesForStructuredTextField.js +2 -0
- package/dist/esm/hooks/customBlockStylesForStructuredTextField.js.map +1 -0
- package/dist/esm/hooks/customMarksForStructuredTextField.d.ts +57 -0
- package/dist/esm/hooks/customMarksForStructuredTextField.js +2 -0
- package/dist/esm/hooks/customMarksForStructuredTextField.js.map +1 -0
- package/dist/esm/hooks/executeFieldDropdownAction.d.ts +9 -0
- package/dist/esm/hooks/executeFieldDropdownAction.js +2 -0
- package/dist/esm/hooks/executeFieldDropdownAction.js.map +1 -0
- package/dist/esm/hooks/executeItemFormDropdownAction.d.ts +8 -0
- package/dist/esm/hooks/executeItemFormDropdownAction.js +2 -0
- package/dist/esm/hooks/executeItemFormDropdownAction.js.map +1 -0
- package/dist/esm/hooks/executeItemsDropdownAction.d.ts +10 -0
- package/dist/esm/hooks/executeItemsDropdownAction.js +2 -0
- package/dist/esm/hooks/executeItemsDropdownAction.js.map +1 -0
- package/dist/esm/hooks/executeUploadsDropdownAction.d.ts +10 -0
- package/dist/esm/hooks/executeUploadsDropdownAction.js +2 -0
- package/dist/esm/hooks/executeUploadsDropdownAction.js.map +1 -0
- package/dist/esm/hooks/fieldDropdownActions.d.ts +11 -0
- package/dist/esm/hooks/fieldDropdownActions.js +2 -0
- package/dist/esm/hooks/fieldDropdownActions.js.map +1 -0
- package/dist/esm/hooks/initialLocationQueryForItemSelector.d.ts +26 -0
- package/dist/esm/hooks/initialLocationQueryForItemSelector.js +2 -0
- package/dist/esm/hooks/initialLocationQueryForItemSelector.js.map +1 -0
- package/dist/esm/hooks/itemCollectionOutlets.d.ts +24 -0
- package/dist/esm/hooks/itemCollectionOutlets.js +2 -0
- package/dist/esm/hooks/itemCollectionOutlets.js.map +1 -0
- package/dist/esm/hooks/itemFormDropdownActions.d.ts +11 -0
- package/dist/esm/hooks/itemFormDropdownActions.js +2 -0
- package/dist/esm/hooks/itemFormDropdownActions.js.map +1 -0
- package/dist/esm/hooks/itemFormOutlets.d.ts +29 -0
- package/dist/esm/hooks/itemFormOutlets.js +2 -0
- package/dist/esm/hooks/itemFormOutlets.js.map +1 -0
- package/dist/esm/hooks/itemFormSidebarPanels.d.ts +47 -0
- package/dist/esm/hooks/itemFormSidebarPanels.js +2 -0
- package/dist/esm/hooks/itemFormSidebarPanels.js.map +1 -0
- package/dist/esm/hooks/itemFormSidebars.d.ts +37 -0
- package/dist/esm/hooks/itemFormSidebars.js +2 -0
- package/dist/esm/hooks/itemFormSidebars.js.map +1 -0
- package/dist/esm/hooks/itemsDropdownActions.d.ts +11 -0
- package/dist/esm/hooks/itemsDropdownActions.js +2 -0
- package/dist/esm/hooks/itemsDropdownActions.js.map +1 -0
- package/dist/esm/hooks/mainNavigationTabs.d.ts +43 -0
- package/dist/esm/hooks/mainNavigationTabs.js +2 -0
- package/dist/esm/hooks/mainNavigationTabs.js.map +1 -0
- package/dist/esm/hooks/manualFieldExtensions.d.ts +58 -0
- package/dist/esm/hooks/manualFieldExtensions.js +2 -0
- package/dist/esm/hooks/manualFieldExtensions.js.map +1 -0
- package/dist/esm/hooks/onBeforeItemUpsert.d.ts +15 -0
- package/dist/esm/hooks/onBeforeItemUpsert.js +2 -0
- package/dist/esm/hooks/onBeforeItemUpsert.js.map +1 -0
- package/dist/esm/hooks/onBeforeItemsDestroy.d.ts +14 -0
- package/dist/esm/hooks/onBeforeItemsDestroy.js +2 -0
- package/dist/esm/hooks/onBeforeItemsDestroy.js.map +1 -0
- package/dist/esm/hooks/onBeforeItemsPublish.d.ts +14 -0
- package/dist/esm/hooks/onBeforeItemsPublish.js +2 -0
- package/dist/esm/hooks/onBeforeItemsPublish.js.map +1 -0
- package/dist/esm/hooks/onBeforeItemsUnpublish.d.ts +14 -0
- package/dist/esm/hooks/onBeforeItemsUnpublish.js +2 -0
- package/dist/esm/hooks/onBeforeItemsUnpublish.js.map +1 -0
- package/dist/esm/hooks/onBoot.d.ts +11 -0
- package/dist/esm/hooks/onBoot.js +2 -0
- package/dist/esm/hooks/onBoot.js.map +1 -0
- package/dist/esm/hooks/overrideFieldExtensions.d.ts +88 -0
- package/dist/esm/hooks/overrideFieldExtensions.js +2 -0
- package/dist/esm/hooks/overrideFieldExtensions.js.map +1 -0
- package/dist/esm/hooks/renderAssetSource.d.ts +98 -0
- package/dist/esm/hooks/renderAssetSource.js +8 -0
- package/dist/esm/hooks/renderAssetSource.js.map +1 -0
- package/dist/esm/hooks/renderConfigScreen.d.ts +12 -0
- package/dist/esm/hooks/renderConfigScreen.js +8 -0
- package/dist/esm/hooks/renderConfigScreen.js.map +1 -0
- package/dist/esm/hooks/renderFieldExtension.d.ts +20 -0
- package/dist/esm/hooks/renderFieldExtension.js +8 -0
- package/dist/esm/hooks/renderFieldExtension.js.map +1 -0
- package/dist/esm/hooks/renderItemCollectionOutlet.d.ts +9 -0
- package/dist/esm/hooks/renderItemCollectionOutlet.js +8 -0
- package/dist/esm/hooks/renderItemCollectionOutlet.js.map +1 -0
- package/dist/esm/hooks/renderItemFormOutlet.d.ts +16 -0
- package/dist/esm/hooks/renderItemFormOutlet.js +8 -0
- package/dist/esm/hooks/renderItemFormOutlet.js.map +1 -0
- package/dist/esm/hooks/renderItemFormSidebar.d.ts +21 -0
- package/dist/esm/hooks/renderItemFormSidebar.js +8 -0
- package/dist/esm/hooks/renderItemFormSidebar.js.map +1 -0
- package/dist/esm/hooks/renderItemFormSidebarPanel.d.ts +21 -0
- package/dist/esm/hooks/renderItemFormSidebarPanel.js +8 -0
- package/dist/esm/hooks/renderItemFormSidebarPanel.js.map +1 -0
- package/dist/esm/hooks/renderManualFieldExtensionConfigScreen.d.ts +55 -0
- package/dist/esm/hooks/renderManualFieldExtensionConfigScreen.js +8 -0
- package/dist/esm/hooks/renderManualFieldExtensionConfigScreen.js.map +1 -0
- package/dist/esm/hooks/renderModal.d.ts +37 -0
- package/dist/esm/hooks/renderModal.js +8 -0
- package/dist/esm/hooks/renderModal.js.map +1 -0
- package/dist/esm/hooks/renderPage.d.ts +16 -0
- package/dist/esm/hooks/renderPage.js +8 -0
- package/dist/esm/hooks/renderPage.js.map +1 -0
- package/dist/esm/hooks/renderUploadSidebar.d.ts +25 -0
- package/dist/esm/hooks/renderUploadSidebar.js +8 -0
- package/dist/esm/hooks/renderUploadSidebar.js.map +1 -0
- package/dist/esm/hooks/renderUploadSidebarPanel.d.ts +25 -0
- package/dist/esm/hooks/renderUploadSidebarPanel.js +8 -0
- package/dist/esm/hooks/renderUploadSidebarPanel.js.map +1 -0
- package/dist/esm/hooks/settingsAreaSidebarItemGroups.d.ts +52 -0
- package/dist/esm/hooks/settingsAreaSidebarItemGroups.js +2 -0
- package/dist/esm/hooks/settingsAreaSidebarItemGroups.js.map +1 -0
- package/dist/esm/hooks/uploadSidebarPanels.d.ts +47 -0
- package/dist/esm/hooks/uploadSidebarPanels.js +2 -0
- package/dist/esm/hooks/uploadSidebarPanels.js.map +1 -0
- package/dist/esm/hooks/uploadSidebars.d.ts +34 -0
- package/dist/esm/hooks/uploadSidebars.js +2 -0
- package/dist/esm/hooks/uploadSidebars.js.map +1 -0
- package/dist/esm/hooks/uploadsDropdownActions.d.ts +5 -0
- package/dist/esm/hooks/uploadsDropdownActions.js +2 -0
- package/dist/esm/hooks/uploadsDropdownActions.js.map +1 -0
- package/dist/esm/hooks/validateManualFieldExtensionParameters.d.ts +9 -0
- package/dist/esm/hooks/validateManualFieldExtensionParameters.js +2 -0
- package/dist/esm/hooks/validateManualFieldExtensionParameters.js.map +1 -0
- package/dist/esm/icon.d.ts +6 -0
- package/dist/esm/icon.js +2 -0
- package/dist/esm/icon.js.map +1 -0
- package/dist/esm/index.d.ts +57 -12
- package/dist/esm/index.js +46 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/manifest.d.ts +2 -0
- package/dist/esm/manifest.js +2906 -0
- package/dist/esm/manifest.js.map +1 -0
- package/dist/esm/manifestTypes.d.ts +51 -0
- package/dist/esm/manifestTypes.js +2 -0
- package/dist/esm/manifestTypes.js.map +1 -0
- package/dist/esm/shared.d.ts +56 -0
- package/dist/esm/shared.js +2 -0
- package/dist/esm/shared.js.map +1 -0
- package/dist/esm/utils.d.ts +31 -0
- package/dist/esm/utils.js +129 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/types/connect.d.ts +44 -242
- package/dist/types/ctx/base.d.ts +670 -0
- package/dist/types/ctx/commonExtras/field.d.ts +29 -0
- package/dist/types/ctx/commonExtras/itemForm.d.ts +148 -0
- package/dist/types/ctx/commonExtras/sizing.d.ts +23 -0
- package/dist/types/ctx/pluginFrame.d.ts +12 -0
- package/dist/types/hooks/assetSources.d.ts +41 -0
- package/dist/types/hooks/buildItemPresentationInfo.d.ts +28 -0
- package/dist/types/hooks/contentAreaSidebarItems.d.ts +39 -0
- package/dist/types/hooks/customBlockStylesForStructuredTextField.d.ts +36 -0
- package/dist/types/hooks/customMarksForStructuredTextField.d.ts +57 -0
- package/dist/types/hooks/executeFieldDropdownAction.d.ts +9 -0
- package/dist/types/hooks/executeItemFormDropdownAction.d.ts +8 -0
- package/dist/types/hooks/executeItemsDropdownAction.d.ts +10 -0
- package/dist/types/hooks/executeUploadsDropdownAction.d.ts +10 -0
- package/dist/types/hooks/fieldDropdownActions.d.ts +11 -0
- package/dist/types/hooks/initialLocationQueryForItemSelector.d.ts +26 -0
- package/dist/types/hooks/itemCollectionOutlets.d.ts +24 -0
- package/dist/types/hooks/itemFormDropdownActions.d.ts +11 -0
- package/dist/types/hooks/itemFormOutlets.d.ts +29 -0
- package/dist/types/hooks/itemFormSidebarPanels.d.ts +47 -0
- package/dist/types/hooks/itemFormSidebars.d.ts +37 -0
- package/dist/types/hooks/itemsDropdownActions.d.ts +11 -0
- package/dist/types/hooks/mainNavigationTabs.d.ts +43 -0
- package/dist/types/hooks/manualFieldExtensions.d.ts +58 -0
- package/dist/types/hooks/onBeforeItemUpsert.d.ts +15 -0
- package/dist/types/hooks/onBeforeItemsDestroy.d.ts +14 -0
- package/dist/types/hooks/onBeforeItemsPublish.d.ts +14 -0
- package/dist/types/hooks/onBeforeItemsUnpublish.d.ts +14 -0
- package/dist/types/hooks/onBoot.d.ts +11 -0
- package/dist/types/hooks/overrideFieldExtensions.d.ts +88 -0
- package/dist/types/hooks/renderAssetSource.d.ts +98 -0
- package/dist/types/hooks/renderConfigScreen.d.ts +12 -0
- package/dist/types/hooks/renderFieldExtension.d.ts +20 -0
- package/dist/types/hooks/renderItemCollectionOutlet.d.ts +9 -0
- package/dist/types/hooks/renderItemFormOutlet.d.ts +16 -0
- package/dist/types/hooks/renderItemFormSidebar.d.ts +21 -0
- package/dist/types/hooks/renderItemFormSidebarPanel.d.ts +21 -0
- package/dist/types/hooks/renderManualFieldExtensionConfigScreen.d.ts +55 -0
- package/dist/types/hooks/renderModal.d.ts +37 -0
- package/dist/types/hooks/renderPage.d.ts +16 -0
- package/dist/types/hooks/renderUploadSidebar.d.ts +25 -0
- package/dist/types/hooks/renderUploadSidebarPanel.d.ts +25 -0
- package/dist/types/hooks/settingsAreaSidebarItemGroups.d.ts +52 -0
- package/dist/types/hooks/uploadSidebarPanels.d.ts +47 -0
- package/dist/types/hooks/uploadSidebars.d.ts +34 -0
- package/dist/types/hooks/uploadsDropdownActions.d.ts +5 -0
- package/dist/types/hooks/validateManualFieldExtensionParameters.d.ts +9 -0
- package/dist/types/icon.d.ts +6 -0
- package/dist/types/index.d.ts +57 -12
- package/dist/types/manifest.d.ts +2 -0
- package/dist/types/manifestTypes.d.ts +51 -0
- package/dist/types/shared.d.ts +56 -0
- package/dist/types/utils.d.ts +31 -0
- package/manifest.json +2905 -0
- package/package.json +7 -6
- package/src/connect.ts +207 -698
- package/src/ctx/base.ts +714 -0
- package/src/ctx/commonExtras/field.ts +27 -0
- package/src/ctx/commonExtras/itemForm.ts +155 -0
- package/src/ctx/commonExtras/sizing.ts +27 -0
- package/src/ctx/pluginFrame.ts +39 -0
- package/src/hooks/assetSources.ts +43 -0
- package/src/hooks/buildItemPresentationInfo.ts +33 -0
- package/src/hooks/contentAreaSidebarItems.ts +41 -0
- package/src/hooks/customBlockStylesForStructuredTextField.ts +42 -0
- package/src/hooks/customMarksForStructuredTextField.ts +64 -0
- package/src/hooks/executeFieldDropdownAction.ts +21 -0
- package/src/hooks/executeItemFormDropdownAction.ts +19 -0
- package/src/hooks/executeItemsDropdownAction.ts +16 -0
- package/src/hooks/executeUploadsDropdownAction.ts +15 -0
- package/src/hooks/fieldDropdownActions.ts +18 -0
- package/src/hooks/initialLocationQueryForItemSelector.ts +33 -0
- package/src/hooks/itemCollectionOutlets.ts +29 -0
- package/src/hooks/itemFormDropdownActions.ts +18 -0
- package/src/hooks/itemFormOutlets.ts +31 -0
- package/src/hooks/itemFormSidebarPanels.ts +52 -0
- package/src/hooks/itemFormSidebars.ts +39 -0
- package/src/hooks/itemsDropdownActions.ts +16 -0
- package/src/hooks/mainNavigationTabs.ts +45 -0
- package/src/hooks/manualFieldExtensions.ts +78 -0
- package/src/hooks/onBeforeItemUpsert.ts +19 -0
- package/src/hooks/onBeforeItemsDestroy.ts +15 -0
- package/src/hooks/onBeforeItemsPublish.ts +15 -0
- package/src/hooks/onBeforeItemsUnpublish.ts +15 -0
- package/src/hooks/onBoot.ts +13 -0
- package/src/hooks/overrideFieldExtensions.ts +95 -0
- package/src/hooks/renderAssetSource.ts +119 -0
- package/src/hooks/renderConfigScreen.ts +27 -0
- package/src/hooks/renderFieldExtension.ts +46 -0
- package/src/hooks/renderItemCollectionOutlet.ts +29 -0
- package/src/hooks/renderItemFormOutlet.ts +40 -0
- package/src/hooks/renderItemFormSidebar.ts +45 -0
- package/src/hooks/renderItemFormSidebarPanel.ts +46 -0
- package/src/hooks/renderManualFieldExtensionConfigScreen.ts +83 -0
- package/src/hooks/renderModal.ts +54 -0
- package/src/hooks/renderPage.ts +33 -0
- package/src/hooks/renderUploadSidebar.ts +44 -0
- package/src/hooks/renderUploadSidebarPanel.ts +47 -0
- package/src/hooks/settingsAreaSidebarItemGroups.ts +55 -0
- package/src/hooks/uploadSidebarPanels.ts +57 -0
- package/src/hooks/uploadSidebars.ts +36 -0
- package/src/hooks/uploadsDropdownActions.ts +8 -0
- package/src/hooks/validateManualFieldExtensionParameters.ts +12 -0
- package/src/{types.ts → icon.ts} +0 -1739
- package/src/index.ts +49 -4
- package/src/manifest.ts +3062 -0
- package/src/manifestTypes.ts +56 -0
- package/src/shared.ts +67 -0
- package/src/utils.ts +253 -0
- package/dist/cjs/guards.js +0 -19
- package/dist/cjs/guards.js.map +0 -1
- package/dist/cjs/types.js.map +0 -1
- package/dist/esm/guards.d.ts +0 -37
- package/dist/esm/guards.js +0 -16
- package/dist/esm/guards.js.map +0 -1
- package/dist/esm/types.d.ts +0 -1569
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +0 -1
- package/dist/types/guards.d.ts +0 -37
- package/dist/types/types.d.ts +0 -1569
- package/src/guards.ts +0 -51
- package/types.json +0 -37395
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ItemFormAdditionalMethods,
|
|
3
|
+
ItemFormAdditionalProperties,
|
|
4
|
+
} from '../ctx/commonExtras/itemForm';
|
|
5
|
+
import { SelfResizingPluginFrameCtx } from '../ctx/pluginFrame';
|
|
6
|
+
import { containedRenderModeBootstrapper } from '../utils';
|
|
7
|
+
|
|
8
|
+
export type RenderItemFormOutletHook = {
|
|
9
|
+
/**
|
|
10
|
+
* This function will be called when the plugin needs to render an outlet (see
|
|
11
|
+
* the `itemFormOutlets` function)
|
|
12
|
+
*
|
|
13
|
+
* @tag itemFormOutlets
|
|
14
|
+
*/
|
|
15
|
+
renderItemFormOutlet: (
|
|
16
|
+
itemFormOutletId: string,
|
|
17
|
+
ctx: RenderItemFormOutletCtx,
|
|
18
|
+
) => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type RenderItemFormOutletCtx = SelfResizingPluginFrameCtx<
|
|
22
|
+
'renderItemFormOutlet',
|
|
23
|
+
ItemFormAdditionalProperties & {
|
|
24
|
+
/** The ID of the outlet that needs to be rendered */
|
|
25
|
+
itemFormOutletId: string;
|
|
26
|
+
},
|
|
27
|
+
ItemFormAdditionalMethods
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
export const renderItemFormOutletBootstrapper =
|
|
31
|
+
containedRenderModeBootstrapper<RenderItemFormOutletCtx>(
|
|
32
|
+
'renderItemFormOutlet',
|
|
33
|
+
(configuration, ctx) => {
|
|
34
|
+
if (!configuration.renderItemFormOutlet) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
configuration.renderItemFormOutlet(ctx.itemFormOutletId, ctx);
|
|
39
|
+
},
|
|
40
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ItemFormAdditionalMethods,
|
|
3
|
+
ItemFormAdditionalProperties,
|
|
4
|
+
} from '../ctx/commonExtras/itemForm';
|
|
5
|
+
import { ImposedSizePluginFrameCtx } from '../ctx/pluginFrame';
|
|
6
|
+
import { fullScreenRenderModeBootstrapper } from '../utils';
|
|
7
|
+
|
|
8
|
+
export type RenderItemFormSidebarHook = {
|
|
9
|
+
/**
|
|
10
|
+
* This function will be called when the plugin needs to render a sidebar (see
|
|
11
|
+
* the `itemFormSidebars` function)
|
|
12
|
+
*
|
|
13
|
+
* @tag sidebarPanels
|
|
14
|
+
*/
|
|
15
|
+
renderItemFormSidebar: (
|
|
16
|
+
sidebarId: string,
|
|
17
|
+
ctx: RenderItemFormSidebarCtx,
|
|
18
|
+
) => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type RenderItemFormSidebarCtx = ImposedSizePluginFrameCtx<
|
|
22
|
+
'renderItemFormSidebar',
|
|
23
|
+
ItemFormAdditionalProperties & {
|
|
24
|
+
/** The ID of the sidebar that needs to be rendered */
|
|
25
|
+
sidebarId: string;
|
|
26
|
+
/**
|
|
27
|
+
* The arbitrary `parameters` of the declared in the `itemFormSidebars`
|
|
28
|
+
* function
|
|
29
|
+
*/
|
|
30
|
+
parameters: Record<string, unknown>;
|
|
31
|
+
},
|
|
32
|
+
ItemFormAdditionalMethods
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
export const renderItemFormSidebarBootstrapper =
|
|
36
|
+
fullScreenRenderModeBootstrapper<RenderItemFormSidebarCtx>(
|
|
37
|
+
'renderItemFormSidebar',
|
|
38
|
+
(configuration, ctx) => {
|
|
39
|
+
if (!configuration.renderItemFormSidebar) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
configuration.renderItemFormSidebar(ctx.sidebarId, ctx);
|
|
44
|
+
},
|
|
45
|
+
);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ItemFormAdditionalMethods,
|
|
3
|
+
ItemFormAdditionalProperties,
|
|
4
|
+
} from '../ctx/commonExtras/itemForm';
|
|
5
|
+
import { SelfResizingPluginFrameCtx } from '../ctx/pluginFrame';
|
|
6
|
+
import { containedRenderModeBootstrapper } from '../utils';
|
|
7
|
+
|
|
8
|
+
export type RenderItemFormSidebarPanelHook = {
|
|
9
|
+
/**
|
|
10
|
+
* This function will be called when the plugin needs to render a sidebar panel
|
|
11
|
+
* (see the `itemFormSidebarPanels` function)
|
|
12
|
+
*
|
|
13
|
+
* @tag sidebarPanels
|
|
14
|
+
*/
|
|
15
|
+
renderItemFormSidebarPanel: (
|
|
16
|
+
sidebarPaneId: string,
|
|
17
|
+
ctx: RenderItemFormSidebarPanelCtx,
|
|
18
|
+
) => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type RenderItemFormSidebarPanelCtx = SelfResizingPluginFrameCtx<
|
|
22
|
+
'renderItemFormSidebarPanel',
|
|
23
|
+
ItemFormAdditionalProperties & {
|
|
24
|
+
/** The ID of the sidebar panel that needs to be rendered */
|
|
25
|
+
sidebarPaneId: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The arbitrary `parameters` of the panel declared in the
|
|
29
|
+
* `itemFormSidebarPanels` function
|
|
30
|
+
*/
|
|
31
|
+
parameters: Record<string, unknown>;
|
|
32
|
+
},
|
|
33
|
+
ItemFormAdditionalMethods
|
|
34
|
+
>;
|
|
35
|
+
|
|
36
|
+
export const renderItemFormSidebarPanelBootstrapper =
|
|
37
|
+
containedRenderModeBootstrapper<RenderItemFormSidebarPanelCtx>(
|
|
38
|
+
'renderItemFormSidebarPanel',
|
|
39
|
+
(configuration, ctx) => {
|
|
40
|
+
if (!configuration.renderItemFormSidebarPanel) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
configuration.renderItemFormSidebarPanel(ctx.sidebarPaneId, ctx);
|
|
45
|
+
},
|
|
46
|
+
);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { SchemaTypes } from '@datocms/cma-client';
|
|
2
|
+
import { SelfResizingPluginFrameCtx } from '../ctx/pluginFrame';
|
|
3
|
+
import { containedRenderModeBootstrapper } from '../utils';
|
|
4
|
+
|
|
5
|
+
type Field = SchemaTypes.Field;
|
|
6
|
+
type ItemType = SchemaTypes.ItemType;
|
|
7
|
+
|
|
8
|
+
export type RenderManualFieldExtensionConfigScreenHook = {
|
|
9
|
+
renderManualFieldExtensionConfigScreen: (
|
|
10
|
+
fieldExtensionId: string,
|
|
11
|
+
ctx: RenderManualFieldExtensionConfigScreenCtx,
|
|
12
|
+
) => void;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type RenderManualFieldExtensionConfigScreenCtx =
|
|
16
|
+
SelfResizingPluginFrameCtx<
|
|
17
|
+
'renderManualFieldExtensionConfigScreen',
|
|
18
|
+
{
|
|
19
|
+
/**
|
|
20
|
+
* The ID of the field extension for which we need to render the parameters
|
|
21
|
+
* form
|
|
22
|
+
*/
|
|
23
|
+
fieldExtensionId: string;
|
|
24
|
+
/**
|
|
25
|
+
* The current value of the parameters (you can change the value with the
|
|
26
|
+
* `setParameters` function)
|
|
27
|
+
*/
|
|
28
|
+
parameters: Record<string, unknown>;
|
|
29
|
+
/**
|
|
30
|
+
* The current validation errors for the parameters (you can set them
|
|
31
|
+
* implementing the `validateManualFieldExtensionParameters` function)
|
|
32
|
+
*/
|
|
33
|
+
errors: Record<string, unknown>;
|
|
34
|
+
|
|
35
|
+
/** The field entity that is being edited in the form */
|
|
36
|
+
pendingField: PendingField;
|
|
37
|
+
|
|
38
|
+
/** The model for the field being edited */
|
|
39
|
+
itemType: ItemType;
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
/**
|
|
43
|
+
* Sets a new value for the parameters
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
*
|
|
47
|
+
* ```js
|
|
48
|
+
* await ctx.setParameters({ color: '#ff0000' });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
setParameters: (params: Record<string, unknown>) => Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
>;
|
|
54
|
+
|
|
55
|
+
export type PendingField = {
|
|
56
|
+
id?: string;
|
|
57
|
+
type: 'field';
|
|
58
|
+
attributes: {
|
|
59
|
+
api_key: Field['attributes']['api_key'];
|
|
60
|
+
appearance: Field['attributes']['appearance'];
|
|
61
|
+
default_value: Field['attributes']['default_value'];
|
|
62
|
+
field_type: Field['attributes']['field_type'];
|
|
63
|
+
hint: Field['attributes']['hint'];
|
|
64
|
+
label: Field['attributes']['label'];
|
|
65
|
+
localized: Field['attributes']['localized'];
|
|
66
|
+
validators: Field['attributes']['validators'];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const renderManualFieldExtensionConfigScreenBootstrapper =
|
|
71
|
+
containedRenderModeBootstrapper<RenderManualFieldExtensionConfigScreenCtx>(
|
|
72
|
+
'renderManualFieldExtensionConfigScreen',
|
|
73
|
+
(configuration, ctx) => {
|
|
74
|
+
if (!configuration.renderManualFieldExtensionConfigScreen) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
configuration.renderManualFieldExtensionConfigScreen(
|
|
79
|
+
ctx.fieldExtensionId,
|
|
80
|
+
ctx,
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SelfResizingPluginFrameCtx } from '../ctx/pluginFrame';
|
|
2
|
+
import { containedRenderModeBootstrapper } from '../utils';
|
|
3
|
+
|
|
4
|
+
export type RenderModalHook = {
|
|
5
|
+
/**
|
|
6
|
+
* This function will be called when the plugin requested to open a modal (see
|
|
7
|
+
* the `openModal` function)
|
|
8
|
+
*
|
|
9
|
+
* @tag modals
|
|
10
|
+
*/
|
|
11
|
+
renderModal: (modalId: string, ctx: RenderModalCtx) => void;
|
|
12
|
+
};
|
|
13
|
+
export type RenderModalCtx = SelfResizingPluginFrameCtx<
|
|
14
|
+
'renderModal',
|
|
15
|
+
{
|
|
16
|
+
/** The ID of the modal that needs to be rendered */
|
|
17
|
+
modalId: string;
|
|
18
|
+
/**
|
|
19
|
+
* The arbitrary `parameters` of the modal declared in the `openModal`
|
|
20
|
+
* function
|
|
21
|
+
*/
|
|
22
|
+
parameters: Record<string, unknown>;
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
/**
|
|
26
|
+
* A function to be called by the plugin to close the modal. The `openModal`
|
|
27
|
+
* call will be resolved with the passed return value
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
*
|
|
31
|
+
* ```js
|
|
32
|
+
* const returnValue = prompt(
|
|
33
|
+
* 'Please specify the value to return to the caller:',
|
|
34
|
+
* 'success',
|
|
35
|
+
* );
|
|
36
|
+
*
|
|
37
|
+
* await ctx.resolve(returnValue);
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
resolve: (returnValue: unknown) => Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
>;
|
|
43
|
+
|
|
44
|
+
export const renderModalBootstrapper =
|
|
45
|
+
containedRenderModeBootstrapper<RenderModalCtx>(
|
|
46
|
+
'renderModal',
|
|
47
|
+
(configuration, ctx) => {
|
|
48
|
+
if (!configuration.renderModal) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
configuration.renderModal(ctx.modalId, ctx);
|
|
53
|
+
},
|
|
54
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ImposedSizePluginFrameCtx } from '../ctx/pluginFrame';
|
|
2
|
+
import { fullScreenRenderModeBootstrapper } from '../utils';
|
|
3
|
+
|
|
4
|
+
export type RenderPageHook = {
|
|
5
|
+
/**
|
|
6
|
+
* This function will be called when the plugin needs to render a specific
|
|
7
|
+
* page (see the `mainNavigationTabs`, `settingsAreaSidebarItemGroups` and
|
|
8
|
+
* `contentAreaSidebarItems` functions)
|
|
9
|
+
*
|
|
10
|
+
* @tag pages
|
|
11
|
+
*/
|
|
12
|
+
renderPage: (pageId: string, ctx: RenderPageCtx) => void;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type RenderPageCtx = ImposedSizePluginFrameCtx<
|
|
16
|
+
'renderPage',
|
|
17
|
+
{
|
|
18
|
+
/** The ID of the page that needs to be rendered */
|
|
19
|
+
pageId: string;
|
|
20
|
+
}
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
export const renderPageBootstrapper =
|
|
24
|
+
fullScreenRenderModeBootstrapper<RenderPageCtx>(
|
|
25
|
+
'renderPage',
|
|
26
|
+
(configuration, ctx) => {
|
|
27
|
+
if (!configuration.renderPage) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
configuration.renderPage(ctx.pageId, ctx);
|
|
32
|
+
},
|
|
33
|
+
);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { SchemaTypes } from '@datocms/cma-client';
|
|
2
|
+
import { ImposedSizePluginFrameCtx } from '../ctx/pluginFrame';
|
|
3
|
+
import { fullScreenRenderModeBootstrapper } from '../utils';
|
|
4
|
+
|
|
5
|
+
type Upload = SchemaTypes.Upload;
|
|
6
|
+
|
|
7
|
+
export type RenderUploadSidebarHook = {
|
|
8
|
+
/**
|
|
9
|
+
* This function will be called when the plugin needs to render a sidebar (see
|
|
10
|
+
* the `uploadSidebars` function)
|
|
11
|
+
*
|
|
12
|
+
* @tag sidebarPanels
|
|
13
|
+
*/
|
|
14
|
+
renderUploadSidebar: (sidebarId: string, ctx: RenderUploadSidebarCtx) => void;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type RenderUploadSidebarCtx = ImposedSizePluginFrameCtx<
|
|
18
|
+
'renderUploadSidebar',
|
|
19
|
+
{
|
|
20
|
+
/** The ID of the sidebar that needs to be rendered */
|
|
21
|
+
sidebarId: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The arbitrary `parameters` of the declared in the `uploadSidebars`
|
|
25
|
+
* function
|
|
26
|
+
*/
|
|
27
|
+
parameters: Record<string, unknown>;
|
|
28
|
+
|
|
29
|
+
/** The active asset */
|
|
30
|
+
upload: Upload;
|
|
31
|
+
}
|
|
32
|
+
>;
|
|
33
|
+
|
|
34
|
+
export const renderUploadSidebarBootstrapper =
|
|
35
|
+
fullScreenRenderModeBootstrapper<RenderUploadSidebarCtx>(
|
|
36
|
+
'renderUploadSidebar',
|
|
37
|
+
(configuration, ctx) => {
|
|
38
|
+
if (!configuration.renderUploadSidebar) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
configuration.renderUploadSidebar(ctx.sidebarId, ctx);
|
|
43
|
+
},
|
|
44
|
+
);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { SchemaTypes } from '@datocms/cma-client';
|
|
2
|
+
import { SelfResizingPluginFrameCtx } from '../ctx/pluginFrame';
|
|
3
|
+
import { containedRenderModeBootstrapper } from '../utils';
|
|
4
|
+
|
|
5
|
+
type Upload = SchemaTypes.Upload;
|
|
6
|
+
|
|
7
|
+
export type RenderUploadSidebarPanelHook = {
|
|
8
|
+
/**
|
|
9
|
+
* This function will be called when the plugin needs to render a sidebar panel
|
|
10
|
+
* (see the `uploadSidebarPanels` function)
|
|
11
|
+
*
|
|
12
|
+
* @tag sidebarPanels
|
|
13
|
+
*/
|
|
14
|
+
renderUploadSidebarPanel: (
|
|
15
|
+
sidebarPaneId: string,
|
|
16
|
+
ctx: RenderUploadSidebarPanelCtx,
|
|
17
|
+
) => void;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type RenderUploadSidebarPanelCtx = SelfResizingPluginFrameCtx<
|
|
21
|
+
'renderUploadSidebarPanel',
|
|
22
|
+
{
|
|
23
|
+
/** The ID of the sidebar panel that needs to be rendered */
|
|
24
|
+
sidebarPaneId: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The arbitrary `parameters` of the panel declared in the
|
|
28
|
+
* `uploadSidebarPanels` function
|
|
29
|
+
*/
|
|
30
|
+
parameters: Record<string, unknown>;
|
|
31
|
+
|
|
32
|
+
/** The active asset */
|
|
33
|
+
upload: Upload;
|
|
34
|
+
}
|
|
35
|
+
>;
|
|
36
|
+
|
|
37
|
+
export const renderUploadSidebarPanelBootstrapper =
|
|
38
|
+
containedRenderModeBootstrapper<RenderUploadSidebarPanelCtx>(
|
|
39
|
+
'renderUploadSidebarPanel',
|
|
40
|
+
(configuration, ctx) => {
|
|
41
|
+
if (!configuration.renderUploadSidebarPanel) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
configuration.renderUploadSidebarPanel(ctx.sidebarPaneId, ctx);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Ctx } from '../ctx/base';
|
|
2
|
+
import { Icon } from '../icon';
|
|
3
|
+
|
|
4
|
+
export type SettingsAreaSidebarItemGroupsHook = {
|
|
5
|
+
/**
|
|
6
|
+
* Use this function to declare new navigation sections in the Settings Area
|
|
7
|
+
* sidebar
|
|
8
|
+
*
|
|
9
|
+
* @tag pages
|
|
10
|
+
*/
|
|
11
|
+
settingsAreaSidebarItemGroups: (ctx: Ctx) => SettingsAreaSidebarItemGroup[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The sidebar in the Settings Area presents a number of pages grouped by topic.
|
|
16
|
+
* This object represents a new group to be added in the sideebar to the
|
|
17
|
+
* standard ones DatoCMS provides.
|
|
18
|
+
*/
|
|
19
|
+
export type SettingsAreaSidebarItemGroup = {
|
|
20
|
+
/** Label to be shown. Must be unique. */
|
|
21
|
+
label: string;
|
|
22
|
+
/** The list of items it contains * */
|
|
23
|
+
items: SettingsAreaSidebarItem[];
|
|
24
|
+
/**
|
|
25
|
+
* Expresses where you want the group to be placed inside the sidebar. If not
|
|
26
|
+
* specified, the item will be placed after the standard items provided by
|
|
27
|
+
* DatoCMS itself.
|
|
28
|
+
*/
|
|
29
|
+
placement?: ['before' | 'after', 'properties' | 'permissions'];
|
|
30
|
+
/**
|
|
31
|
+
* If different plugins specify the same `placement` for their sections, they
|
|
32
|
+
* will be displayed by ascending `rank`. If you want to specify an explicit
|
|
33
|
+
* value for `rank`, make sure to offer a way for final users to customize it
|
|
34
|
+
* inside the plugin's settings form, otherwise the hardcoded value you choose
|
|
35
|
+
* might clash with the one of another plugin!
|
|
36
|
+
*/
|
|
37
|
+
rank?: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** An item contained in a Settings Area group */
|
|
41
|
+
export type SettingsAreaSidebarItem = {
|
|
42
|
+
/** Label to be shown. Must be unique. */
|
|
43
|
+
label: string;
|
|
44
|
+
/**
|
|
45
|
+
* Icon to be shown alongside the label. Can be a FontAwesome icon name (ie.
|
|
46
|
+
* `"address-book"`) or a custom SVG definition. To maintain visual
|
|
47
|
+
* consistency with the rest of the interface, try to use FontAwesome icons
|
|
48
|
+
* whenever possible.
|
|
49
|
+
*/
|
|
50
|
+
icon: Icon;
|
|
51
|
+
/** ID of the page linked to the item */
|
|
52
|
+
pointsTo: {
|
|
53
|
+
pageId: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Ctx } from '../ctx/base';
|
|
2
|
+
|
|
3
|
+
export type UploadSidebarPanelsHook = {
|
|
4
|
+
/**
|
|
5
|
+
* Use this function to declare new sidebar panels to be shown when the user
|
|
6
|
+
* opens up an asset in the Media Area
|
|
7
|
+
*
|
|
8
|
+
* @tag sidebarPanels
|
|
9
|
+
*/
|
|
10
|
+
uploadSidebarPanels: (ctx: Ctx) => UploadSidebarPanel[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type UploadSidebarPanel = {
|
|
14
|
+
/**
|
|
15
|
+
* ID of the panel. Will be the first argument for the
|
|
16
|
+
* `renderUploadSidebarPanel` function
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/** Label to be shown on the collapsible sidebar panel handle */
|
|
20
|
+
label: string;
|
|
21
|
+
/**
|
|
22
|
+
* An arbitrary configuration object that will be passed as the `parameters`
|
|
23
|
+
* property of the second argument of the `renderUploadSidebarPanel`
|
|
24
|
+
* function
|
|
25
|
+
*/
|
|
26
|
+
parameters?: Record<string, unknown>;
|
|
27
|
+
/** Whether the sidebar panel will start open or collapsed */
|
|
28
|
+
startOpen?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Expresses where you want the item to be placed inside the sidebar. If not
|
|
31
|
+
* specified, the item will be placed after the standard panels provided by
|
|
32
|
+
* DatoCMS itself.
|
|
33
|
+
*/
|
|
34
|
+
placement?: UploadSidebarPanelPlacement;
|
|
35
|
+
/**
|
|
36
|
+
* If multiple sidebar panels specify the same `placement`, they will be
|
|
37
|
+
* sorted by ascending `rank`. If you want to specify an explicit value for
|
|
38
|
+
* `rank`, make sure to offer a way for final users to customize it inside the
|
|
39
|
+
* plugin's settings form, otherwise the hardcoded value you choose might
|
|
40
|
+
* clash with the one of another plugin!
|
|
41
|
+
*/
|
|
42
|
+
rank?: number;
|
|
43
|
+
/** The initial height to set for the iframe that will render the sidebar panel */
|
|
44
|
+
initialHeight?: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type UploadSidebarPanelPlacement = [
|
|
48
|
+
'before' | 'after',
|
|
49
|
+
(
|
|
50
|
+
| 'defaultMetadata'
|
|
51
|
+
| 'categorization'
|
|
52
|
+
| 'creator'
|
|
53
|
+
| 'videoTracks'
|
|
54
|
+
| 'links'
|
|
55
|
+
| 'replace'
|
|
56
|
+
),
|
|
57
|
+
];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Ctx } from '../ctx/base';
|
|
2
|
+
|
|
3
|
+
export type UploadSidebarsHook = {
|
|
4
|
+
/**
|
|
5
|
+
* Use this function to declare new sidebar to be shown when the user opens
|
|
6
|
+
* up an asset in the Media Area
|
|
7
|
+
*
|
|
8
|
+
* @tag sidebarPanels
|
|
9
|
+
*/
|
|
10
|
+
uploadSidebars: (ctx: Ctx) => UploadSidebar[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type UploadSidebar = {
|
|
14
|
+
/**
|
|
15
|
+
* ID of the sidebar. Will be the first argument for the
|
|
16
|
+
* `renderUploadSidebar` function
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/** Label to be shown on the collapsible sidebar handle */
|
|
20
|
+
label: string;
|
|
21
|
+
/**
|
|
22
|
+
* An arbitrary configuration object that will be passed as the `parameters`
|
|
23
|
+
* property of the second argument of the `renderUploadSidebar` function
|
|
24
|
+
*/
|
|
25
|
+
parameters?: Record<string, unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* If multiple sidebars specify the same `placement`, they will be sorted by
|
|
28
|
+
* ascending `rank`. If you want to specify an explicit value for `rank`, make
|
|
29
|
+
* sure to offer a way for final users to customize it inside the plugin's
|
|
30
|
+
* settings form, otherwise the hardcoded value you choose might clash with
|
|
31
|
+
* the one of another plugin!
|
|
32
|
+
*/
|
|
33
|
+
rank?: number;
|
|
34
|
+
/** The preferred width for the sidebar */
|
|
35
|
+
preferredWidth?: number;
|
|
36
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ValidateManualFieldExtensionParametersHook = {
|
|
2
|
+
/**
|
|
3
|
+
* This function will be called each time the configuration object changes. It
|
|
4
|
+
* must return an object containing possible validation errors
|
|
5
|
+
*
|
|
6
|
+
* @tag manualFieldExtensions
|
|
7
|
+
*/
|
|
8
|
+
validateManualFieldExtensionParameters: (
|
|
9
|
+
fieldExtensionId: string,
|
|
10
|
+
parameters: Record<string, unknown>,
|
|
11
|
+
) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
12
|
+
};
|