@vis3/kit 1.2.4-alpha.3 → 1.3.1
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/components/CodeViewer/context.d.ts +13 -0
- package/dist/components/CodeViewer/json-key-plugin.d.ts +6 -8
- package/dist/components/Renderer/Card.d.ts +2 -2
- package/dist/components/Renderer/Json/index.d.ts +3 -1
- package/dist/index.mjs +9415 -9386
- package/dist/index.umd.js +141 -132
- package/dist/utils.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
import type { KeyPath } from './json-key-plugin';
|
|
1
2
|
export declare const CodeViewerContext: import("react").Context<{
|
|
2
3
|
wrap: boolean;
|
|
3
4
|
value?: string | null;
|
|
4
5
|
onChange: (value: string) => void;
|
|
6
|
+
onJsonKeyClick?: (detail: {
|
|
7
|
+
field: string;
|
|
8
|
+
pathArray: KeyPath;
|
|
9
|
+
}) => void;
|
|
10
|
+
openJsonPreview?: (absolutePathArray: KeyPath) => void;
|
|
11
|
+
jsonBasePath?: KeyPath;
|
|
5
12
|
}>;
|
|
6
13
|
export declare function useCodeViewerContext(): {
|
|
7
14
|
wrap: boolean;
|
|
8
15
|
value?: string | null;
|
|
9
16
|
onChange: (value: string) => void;
|
|
17
|
+
onJsonKeyClick?: (detail: {
|
|
18
|
+
field: string;
|
|
19
|
+
pathArray: KeyPath;
|
|
20
|
+
}) => void;
|
|
21
|
+
openJsonPreview?: (absolutePathArray: KeyPath) => void;
|
|
22
|
+
jsonBasePath?: KeyPath;
|
|
10
23
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Extension } from '@codemirror/state';
|
|
2
2
|
export type KeyPath = (string | number)[];
|
|
3
|
-
export interface
|
|
3
|
+
export interface JsonKeyClickDetail {
|
|
4
4
|
field: string;
|
|
5
|
-
|
|
6
|
-
blockId?: string;
|
|
7
|
-
value: any;
|
|
8
|
-
parentField: string;
|
|
5
|
+
pathArray: KeyPath;
|
|
9
6
|
}
|
|
10
7
|
export interface JsonNode {
|
|
11
8
|
key: string;
|
|
@@ -15,5 +12,6 @@ export interface JsonNode {
|
|
|
15
12
|
pathArray: KeyPath;
|
|
16
13
|
path: string;
|
|
17
14
|
}
|
|
18
|
-
export declare
|
|
19
|
-
export declare const
|
|
15
|
+
export declare function keyPathToString(path: KeyPath): string;
|
|
16
|
+
export declare const keyStyle: Extension;
|
|
17
|
+
export declare function jsonKeyLink(onJsonKeyClick?: (detail: JsonKeyClickDetail) => void): Extension;
|
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
export type RenderCardProps = React.PropsWithChildren<{
|
|
3
3
|
className?: string;
|
|
4
4
|
name: React.ReactNode;
|
|
5
|
-
title?:
|
|
5
|
+
title?: React.ReactNode;
|
|
6
6
|
titleExtra?: React.ReactNode;
|
|
7
7
|
extra?: React.ReactNode;
|
|
8
8
|
bodyStyle?: React.CSSProperties;
|
|
@@ -17,7 +17,7 @@ export interface RendererProps {
|
|
|
17
17
|
declare const RenderCard: React.ForwardRefExoticComponent<{
|
|
18
18
|
className?: string;
|
|
19
19
|
name: React.ReactNode;
|
|
20
|
-
title?:
|
|
20
|
+
title?: React.ReactNode;
|
|
21
21
|
titleExtra?: React.ReactNode;
|
|
22
22
|
extra?: React.ReactNode;
|
|
23
23
|
bodyStyle?: React.CSSProperties;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import 'react-grid-layout/css/styles.css';
|
|
2
2
|
import 'react-resizable/css/styles.css';
|
|
3
3
|
import './index.css';
|
|
4
|
+
import { type KeyPath } from '../../CodeViewer/json-key-plugin';
|
|
4
5
|
import type { RendererProps } from '../Card';
|
|
5
6
|
import type { RenderType } from '../stateHooks/useRenderType';
|
|
6
7
|
export interface FieldBlock {
|
|
7
8
|
id: string;
|
|
8
9
|
field: string;
|
|
9
10
|
renderAs: RenderType;
|
|
11
|
+
pathArray?: KeyPath;
|
|
10
12
|
}
|
|
11
|
-
export declare function inferDefaultRenderAs(field: string, value: any): "markdown" | "html" | "raw" | "content_list" | "img_list";
|
|
13
|
+
export declare function inferDefaultRenderAs(field: string, value: any): "markdown" | "json" | "html" | "raw" | "content_list" | "img_list";
|
|
12
14
|
export declare function useContainerSize(wrapper: HTMLDivElement | null): {
|
|
13
15
|
width: number;
|
|
14
16
|
height: number;
|