feat(SW-2541): Changed asset types to only add the data needed
This commit is contained in:
12
rte/main.tsx
12
rte/main.tsx
@@ -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: "" }],
|
||||
|
||||
Reference in New Issue
Block a user