@contentstack/app-sdk
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.0 • Public • Published

    App Framework SDK

    JSON Rich text editor plugin

    The JSON Rich Text Editor Plugins lets you add/create custom plugins to extend the functionality of your JSON Rich Text Editor as per your needs. You can use the prebuilt JSON RTE plugins by modifying the code to suit your requirement.

    Some of the examples of the prebuilt JSON Rich Text Editor plugins are:

    • Highlight: Allows you to highlight certain parts of your content, such as a whole line of text or a paragraph.

    • Info Panel: Allows you to place important content inside a colored panel to make it stand out.

    • Word Count: Allows you to track the word count for your JSON Rich Text Editor content.

    You can create JSON Rich Text Editor Plugins using the Contentstack App SDK. For more information, read our documentation.

    Asset Sidebar Extension

    Asset Sidebar Extensions enable you to customize and enhance your asset editing experience. Using customized extensions, you can tailor your images on Contentstack according to your branding requirements..

    You can create Asset Sidebar Extensions using the Contentstack App SDK. For more information, read our documentation.

    AssetSidebarWidget Reference

    It is an object representing the current Asset Sidebar Widget reference in the Contentstack UI.

    getData()

    This method returns the object representing the current asset.

    setData(asset: Partial)

    This method modifies the properties of the current asset.

    syncAsset()

    If your asset has been modified externally, you can use this method to load the new asset and sync its settings with the current asset.

    updateWidth(width: number)

    This method is used to modify the width of the asset sidebar panel. Using this method, you can resize the panel depending on the resolution of your content.

    replaceAsset(file: File)

    This method is used to replace the current asset with a new file. Unlike setData(), where you can only modify the properties, you can use this method to replace the actual file.

    onSave(callback: anyFunction)

    This is a callback function that runs after you save the asset settings.

    onChange(callback: anyFunction)

    This is a callback function that runs every time the user modifies the asset data.

    onPublish(callback: anyFunction)

    This is a callback function that is executed after a user publishes an asset.

    onUnPublish(callback: anyFunction)

    This is a callback function that is executed after you unpublish an asset.

    AssetData

    It is the property that you can modify using the setData() method.

    Metadata SDK Reference

    IMetadata This object represents the structure of the metadata.

    {
        uid: string;
        type: "asset" | "entry";
        _content_type_uid?: string;
        locale?: string;
        [key: string]: any;
    }

    createMetaData(metadataConfig: IMetadata) This method adds new metadata for an asset or entry. It accepts metadata configuration as required arguments. This config contains basic details that you need to identify the metadata object and other data you need for your app.

    retrieveMetaData(metadataConfig: IMetadata) This method retrieves metadata for an asset or entry. It accepts metadata configuration as required arguments. This config contains basic details that you need to identify the metadata object you want to retrieve.

    updateMetaData(metadataConfig: IMetadata) This method updates existing metadata for an asset or entry. It accepts metadata configuration as required arguments. This config contains basic details that you need to identify the metadata object and other data you want to update.

    deleteMetaData(metadataConfig: IMetadata) This method deletes existing metadata for an asset or entry. It accepts metadata configuration as required arguments. This config contains basic details that you need to identify the metadata object you want to delete.

    Keywords

    none

    Install

    npm i @contentstack/app-sdk

    DownloadsWeekly Downloads

    57

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    471 kB

    Total Files

    62

    Last publish

    Collaborators

    • erpranavjoshi
    • shafeeqd959
    • mynk
    • kego1992
    • roshangade
    • iyerrama29
    • uukkoji
    • cloudaccounts
    • hiteshshetty