|
1 | 1 | # App Framework SDK |
2 | 2 |
|
| 3 | +## JSON Rich text editor plugin |
3 | 4 |
|
4 | | -For more information on styling your extension, refer to our [style guide](https://www.contentstack.com/docs/extensions/style-guide/). |
| 5 | +The **JSON Rich Text Editor Plugins** lets you add/create custom plugins to extend the functionality of your [JSON Rich Text Editor](https://www.contentstack.com/docs/developers/json-rich-text-editor/about-json-rich-text-editor/) as per your needs. You can use the prebuilt JSON RTE plugins by modifying the code to suit your requirement. |
5 | 6 |
|
6 | | -## More information |
7 | | -- [SDK API reference](./docs/api.md) |
| 7 | +Some of the examples of the prebuilt JSON Rich Text Editor plugins are: |
| 8 | + |
| 9 | +- Highlight: Allows you to highlight certain parts of your content, such as a whole line of text or a paragraph. |
| 10 | + |
| 11 | +- Info Panel: Allows you to place important content inside a colored panel to make it stand out. |
| 12 | + |
| 13 | +- Word Count: Allows you to track the word count for your JSON Rich Text Editor content. |
| 14 | + |
| 15 | +You can create JSON Rich Text Editor Plugins using the Contentstack App SDK. For more information, read our [documentation](https://www.contentstack.com/docs/developers/json-rich-text-editor-plugins/about-json-rte-plugins/). |
| 16 | + |
| 17 | +## Asset Sidebar Extension |
| 18 | + |
| 19 | +**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.. |
| 20 | + |
| 21 | +You can create Asset Sidebar Extensions using the Contentstack App SDK. For more information, read our documentation. |
| 22 | + |
| 23 | +### AssetSidebarWidget Reference |
| 24 | + |
| 25 | +It is an object representing the current Asset Sidebar Widget reference in the Contentstack UI. |
| 26 | + |
| 27 | +**getData()** |
| 28 | + |
| 29 | +This method returns the object representing the current asset. |
| 30 | + |
| 31 | +**setData(asset: Partial<AssetData>)** |
| 32 | + |
| 33 | +This method modifies the properties of the current asset. |
| 34 | + |
| 35 | +**syncAsset()** |
| 36 | + |
| 37 | +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. |
| 38 | + |
| 39 | +**updateWidth(width: number)** |
| 40 | + |
| 41 | +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. |
| 42 | + |
| 43 | +**replaceAsset(file: File)** |
| 44 | + |
| 45 | +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. |
| 46 | + |
| 47 | +**onSave(callback: anyFunction)** |
| 48 | + |
| 49 | +This is a callback function that runs after you save the asset settings. |
| 50 | + |
| 51 | +**onChange(callback: anyFunction)** |
| 52 | + |
| 53 | +This is a callback function that runs every time the user modifies the asset data. |
| 54 | + |
| 55 | +**onPublish(callback: anyFunction)** |
| 56 | + |
| 57 | +This is a callback function that is executed after a user publishes an asset. |
| 58 | + |
| 59 | +**onUnPublish(callback: anyFunction)** |
| 60 | + |
| 61 | +This is a callback function that is executed after you unpublish an asset. |
| 62 | + |
| 63 | +**AssetData** |
| 64 | + |
| 65 | +It is the property that you can modify using the setData() method. |
| 66 | + |
| 67 | +## Metadata SDK Reference |
| 68 | + |
| 69 | +**IMetadata** |
| 70 | +This object represents the structure of the metadata. |
| 71 | + |
| 72 | +```ts |
| 73 | +{ |
| 74 | + uid: string; |
| 75 | + type: "asset" | "entry"; |
| 76 | + _content_type_uid?: string; |
| 77 | + locale?: string; |
| 78 | + [key: string]: any; |
| 79 | +} |
| 80 | +``` |
| 81 | + |
| 82 | +**createMetaData(metadataConfig: IMetadata)** |
| 83 | +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. |
| 84 | + |
| 85 | +**retrieveMetaData(metadataConfig: IMetadata)** |
| 86 | +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. |
| 87 | + |
| 88 | +**updateMetaData(metadataConfig: IMetadata)** |
| 89 | +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. |
| 90 | + |
| 91 | +**deleteMetaData(metadataConfig: IMetadata)** |
| 92 | +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. |
0 commit comments