@create-figma-plugin/utilities
Version:
An extensive library of utility functions for common Figma/FigJam plugin/widget operations
11 lines • 620 B
JavaScript
export function showUI(options, data) {
if (typeof __html__ === 'undefined') {
throw new Error('No UI defined');
}
const html = `<div id="create-figma-plugin"></div><script>document.body.classList.add('theme-${figma.editorType}');const __FIGMA_COMMAND__='${typeof figma.command === 'undefined' ? '' : figma.command}';const __SHOW_UI_DATA__=${JSON.stringify(typeof data === 'undefined' ? {} : data)};${__html__}</script>`;
figma.showUI(html, {
...options,
themeColors: typeof options.themeColors === 'undefined' ? true : options.themeColors
});
}
//# sourceMappingURL=ui.js.map