@project-sunbird/collection-editor-react 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/hierarchy.d.ts +1 -1
- package/dist/collection-editor.umd.js +68 -68
- package/dist/hooks/useToolbarActions.d.ts +15 -0
- package/dist/index.cjs +26 -26
- package/dist/index.js +4649 -4560
- package/package.json +3 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ToolbarAction } from '../types/editor';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Centralises the review / publish / reject toolbar flows — mirroring how the
|
|
5
|
+
* Angular editor.component handles them internally (save → API → toast).
|
|
6
|
+
*
|
|
7
|
+
* The modals (publish checklist, reject comment, send-for-review confirm) only
|
|
8
|
+
* collect input and emit the action; this hook performs the actual API work so
|
|
9
|
+
* the buttons function out-of-the-box without the host app implementing them.
|
|
10
|
+
*
|
|
11
|
+
* Returns runAction(action, data) -> Promise<boolean> (true on success).
|
|
12
|
+
*/
|
|
13
|
+
export declare function useToolbarActions(save: () => Promise<void>): {
|
|
14
|
+
runAction: (action: ToolbarAction, data?: unknown) => Promise<boolean>;
|
|
15
|
+
};
|