11import Popover from "./utils/popover" ;
22import * as $ from "./utils/dom" ;
33import { IconMenuSmall } from "@codexteam/icons" ;
4+
5+ /**
6+ * @typedef {object } PopoverItem
7+ * @property {string } label - button text
8+ * @property {string } icon - button icon
9+ * @property {boolean } confirmationRequired - if true, a confirmation state will be applied on the first click
10+ * @property {function } hideIf - if provided, item will be hid, if this method returns true
11+ * @property {function } onClick - click callback
12+ */
13+
414/**
515 * Toolbox is a menu for manipulation of rows/cols
616 *
@@ -14,11 +24,12 @@ export default class Toolbox {
1424 /**
1525 * Creates toolbox buttons and toolbox menus
1626 *
17- * @param {object } api - Editor.js api
18- * @param {PopoverItem[] } items - Editor.js api
19- * @param {function } onOpen - callback fired when the Popover is opening
20- * @param {function } onClose - callback fired when the Popover is closing
21- * @param {string } [cssModifier] - the modifier for the Toolbox. Allows to add some specific styles.
27+ * @param {Object } config
28+ * @param {any } config.api - Editor.js api
29+ * @param {PopoverItem[] } config.items - Editor.js api
30+ * @param {function } config.onOpen - callback fired when the Popover is opening
31+ * @param {function } config.onClose - callback fired when the Popover is closing
32+ * @param {string } config.cssModifier - the modifier for the Toolbox. Allows to add some specific styles.
2233 */
2334 constructor ( { api, items, onOpen, onClose, cssModifier = "" } ) {
2435 this . api = api ;
0 commit comments