feat(SW-2541): Changed asset types to only add the data needed

This commit is contained in:
Erik Tiekstra
2025-09-05 11:25:16 +02:00
parent 64556d4b9c
commit 1337e8293f
7 changed files with 243 additions and 310 deletions

View File

@@ -1,11 +1,10 @@
import ContentstackSDK from "@contentstack/app-sdk"
import React from "react"
import { ImageElement } from "~/components/ImageElement"
import { Icon } from "@contentstack/venus-components"
import { openImageVault } from "~/utils/imagevault"
import { ImageElement } from "~/components/ImageElement"
import type {
ContentstackEmbeddedData,
ContentstackPluginDefinition,
@@ -121,10 +120,10 @@ function loadIV(plugin: ContentstackPluginDefinition) {
}
}
export default ContentstackSDK.init().then(async (sdk) => {
export default ContentstackSDK.init().then((sdk) => {
try {
const extensionObj = await sdk["location"]
const RTE = await extensionObj["RTEPlugin"]
const extensionObj = sdk["location"]
const RTE = extensionObj["RTEPlugin"]
if (!RTE) {
return
@@ -178,7 +177,7 @@ export default ContentstackSDK.init().then(async (sdk) => {
ImageVault.on("exec", async (rte) => {
if (rte) {
const savedSelection = rte?.selection?.get() ?? undefined
const savedSelection = rte.selection.get() ?? undefined
const appConfig = await rte.getConfig()
@@ -214,7 +213,6 @@ export default ContentstackSDK.init().then(async (sdk) => {
type: "ImageVault",
attrs: {
...result,
FocalPoint: result.FocalPoint || { x: 50, y: 50 },
},
uid: crypto.randomUUID(),
children: [{ text: "" }],