Hello,
I using the using rich-text bodied macros and I set in the manifest.yml
openOnInsert: false
. I looking for set a default text when user insert the macro on Confluence, for example “Please write here”.
How do that ?
This documentation explain I can set a text in the rich-text body but when I try it does not run when user insert the macro.
view.submit({
config: {},
body: {
type: "doc",
version: 1,
content: [
// ADF content
]
}
})
My code in App.jsx
import React, { useEffect, useState } from "react";
import { view } from "@forge/bridge";
export function CustomUIApp() {
const [context, setContext] = useState(null);
useEffect(async () => {
setContext(await view.getContext());
console.log("Context from App.jsx:", context);
view.submit({
config: {},
body: {
type: "doc",
version: 1,
content: [{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Hello world! Default text. Please write here."
}
]
}],
},
});
console.log("Context from App.jsx after view.submit():", context);
});
return (
<div>
<>
<h1>Text when document is view in Confluence (no edit mode)</h1>
</>
</div>
);
}
export default CustomUIApp;`