@standardbeagle/edit-db 0.4.583 → 0.4.597
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/editor.d.ts +11 -1
- package/dist/editor.es.js +1805 -1790
- package/dist/editor.umd.cjs +17 -17
- package/dist/hooks/useEditorConfig.d.ts +11 -0
- package/dist/hooks/usePath.d.ts +1 -1
- package/dist/hooks/useSaveFile.d.ts +7 -0
- package/package.json +1 -1
- package/dist/editor.stories.d.ts +0 -7
|
@@ -38,6 +38,17 @@ export interface EditorConfig {
|
|
|
38
38
|
* what an action does; edit-db just invokes it with the schema table.
|
|
39
39
|
*/
|
|
40
40
|
tableActions?: TableAction[];
|
|
41
|
+
/**
|
|
42
|
+
* Host-provided file saver. When present, every editor download (grid and
|
|
43
|
+
* navigation exports) routes through it instead of the DOM anchor-download —
|
|
44
|
+
* a desktop shell can show a native save dialog; the browser default stays
|
|
45
|
+
* the anchor. Rejecting keeps the editor's own error reporting intact.
|
|
46
|
+
*/
|
|
47
|
+
saveFile?: (file: {
|
|
48
|
+
filename: string;
|
|
49
|
+
content: string;
|
|
50
|
+
mime: string;
|
|
51
|
+
}) => Promise<void>;
|
|
41
52
|
}
|
|
42
53
|
export declare function EditorConfigProvider({ config, children }: {
|
|
43
54
|
config: EditorConfig;
|
package/dist/hooks/usePath.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export declare function selectRoute(routePaths: string[], path: string): {
|
|
|
59
59
|
route: string;
|
|
60
60
|
match: PathMatch;
|
|
61
61
|
} | null;
|
|
62
|
-
export declare function Route(
|
|
62
|
+
export declare function Route(_props: {
|
|
63
63
|
path: string;
|
|
64
64
|
element: ReactElement;
|
|
65
65
|
}): ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one seam every editor download goes through: the host's
|
|
3
|
+
* <see>EditorConfig.saveFile</see> when provided (a desktop shell's native save
|
|
4
|
+
* dialog), the DOM anchor-download otherwise. Grid and navigation exports both
|
|
5
|
+
* call this, so a host that supplies a saver covers every download at once.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSaveFile(): (filename: string, content: string, mime: string) => Promise<void>;
|
package/package.json
CHANGED
package/dist/editor.stories.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/react';
|
|
2
|
-
import { Editor } from './editor';
|
|
3
|
-
declare const meta: Meta<typeof Editor>;
|
|
4
|
-
export default meta;
|
|
5
|
-
export declare const LocalConnection: any;
|
|
6
|
-
export declare const uriParameter: any;
|
|
7
|
-
export declare const editParticipant: any;
|