@umbraco/headless-backoffice-bridge
Version:
Native javascript bridge for the Umbraco Backoffice.
38 lines • 926 B
JavaScript
import { editorService } from '../../base/angular';
/**
* @example
*
* ```js
* import contentPicker from '@umbraco/headless-backoffice-bridge/pickers/content'
*
* contentPicker.show({
* multiple: true,
* submit(items) => {
* // do something with the selected items
* }
* })
* ```
*/
export default {
/**
* Shows the Content Picker.
*
* @param config - The Content Picker Configuration.
*/
show: (config) => {
editorService.contentPicker({
startNodeId: config.startContent,
multiPicker: config.multiple,
close: () => {
editorService.close();
},
submit: (model) => {
editorService.close();
config.submit(model.selection.map((item) => ({
udi: item.udi
})));
}
});
}
};
//# sourceMappingURL=index.js.map