@ws-ui/shared 1.13.0-rc2 → 1.13.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/Checkbox/index.d.ts +16 -0
- package/dist/components/ControlledSwitch.d.ts +10 -0
- package/dist/components/FloatingTooltip/index.d.ts +11 -0
- package/dist/components/Modal/Button.d.ts +10 -0
- package/dist/components/Tooltip.d.ts +3 -7
- package/dist/components/index.d.ts +3 -4
- package/dist/hooks/index.d.ts +0 -8
- package/dist/index.cjs.js +116 -167
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +13925 -25067
- package/dist/index.es.js.map +1 -1
- package/dist/shared.css +1 -1
- package/dist/types/explorer.d.ts +0 -31
- package/dist/types/index.d.ts +0 -3
- package/dist/types/modal.d.ts +4 -11
- package/dist/types/webform-editor.d.ts +1 -132
- package/dist/types/welcome-tour.d.ts +0 -3
- package/dist/utils/common.d.ts +0 -1
- package/dist/utils/explorer.d.ts +1 -4
- package/dist/utils/index.d.ts +0 -4
- package/package.json +6 -6
- package/dist/components/Grid.d.ts +0 -26
- package/dist/components/Image.d.ts +0 -5
- package/dist/components/SearchInput.d.ts +0 -12
- package/dist/components/ToolbarIcon/index.d.ts +0 -2
- package/dist/components/ToolbarIcon/interfaces.d.ts +0 -21
- package/dist/hooks/use-boolean.d.ts +0 -5
- package/dist/hooks/use-callback-ref.d.ts +0 -1
- package/dist/hooks/use-controllable-state.d.ts +0 -7
- package/dist/hooks/use-ds-change-renderer.d.ts +0 -10
- package/dist/hooks/use-ds-renderer.d.ts +0 -7
- package/dist/hooks/use-form-control-props.d.ts +0 -15
- package/dist/hooks/use-safe-layout-effect.d.ts +0 -2
- package/dist/hooks/use-update-effect.d.ts +0 -2
- package/dist/providers/index.d.ts +0 -2
- package/dist/providers/studio-context.d.ts +0 -7
- package/dist/providers/toast-provider.d.ts +0 -18
- package/dist/types/adapter.d.ts +0 -12
- package/dist/types/roles.d.ts +0 -111
- package/dist/types/settings.d.ts +0 -28
- package/dist/utils/catalog.d.ts +0 -1
- package/dist/utils/chakra-utils.d.ts +0 -21
- package/dist/utils/roles.d.ts +0 -54
- package/dist/utils/webform-editor.d.ts +0 -91
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type FormControlLikeProps = {
|
|
2
|
-
disabled?: boolean;
|
|
3
|
-
isDisabled?: boolean;
|
|
4
|
-
readOnly?: boolean;
|
|
5
|
-
isReadOnly?: boolean;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
isRequired?: boolean;
|
|
8
|
-
isInvalid?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare function useFormControlProps<T extends FormControlLikeProps>(props: T): T & {
|
|
11
|
-
isDisabled: boolean | undefined;
|
|
12
|
-
isReadOnly: boolean | undefined;
|
|
13
|
-
isRequired: boolean | undefined;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
type ToastPosition = 'top' | 'bottom';
|
|
3
|
-
type ToastRenderProps = {
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
};
|
|
6
|
-
export type ToastOptions = {
|
|
7
|
-
duration?: number | null;
|
|
8
|
-
position?: ToastPosition;
|
|
9
|
-
render: (props: ToastRenderProps) => ReactNode;
|
|
10
|
-
};
|
|
11
|
-
export type UseToastOptions = {
|
|
12
|
-
containerStyle?: CSSProperties;
|
|
13
|
-
};
|
|
14
|
-
export declare function ToastProvider({ children, }: {
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare function useToast(options?: UseToastOptions): (toastOptions: ToastOptions) => number;
|
|
18
|
-
export {};
|
package/dist/types/adapter.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type TEditorAdapter<TGetters extends object = {}, TActions extends object = {}> = TGetters & {
|
|
3
|
-
actions: TActions;
|
|
4
|
-
};
|
|
5
|
-
export interface IAdapterProviderProps<TAdapter> {
|
|
6
|
-
adapter: TAdapter;
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export type TUseAdapter<TAdapter> = () => TAdapter;
|
|
10
|
-
export type TUseOptionalAdapter<TAdapter> = (options?: {
|
|
11
|
-
permissive?: boolean;
|
|
12
|
-
}) => TAdapter | null;
|
package/dist/types/roles.d.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { ITabFlags } from './shared';
|
|
2
|
-
/**
|
|
3
|
-
* Raw API response typing
|
|
4
|
-
*/
|
|
5
|
-
export type TRawData = Partial<{
|
|
6
|
-
privileges: IPrivilege[];
|
|
7
|
-
roles: IRole[];
|
|
8
|
-
permissions: Partial<{
|
|
9
|
-
allowed: IPermission[];
|
|
10
|
-
}>;
|
|
11
|
-
forceLogin: boolean;
|
|
12
|
-
restrictedByDefault: boolean;
|
|
13
|
-
}>;
|
|
14
|
-
export type TPermissionOption = Pick<IPermission, 'applyTo' | 'type' | 'subType'>;
|
|
15
|
-
export type TAction = 'read' | 'create' | 'update' | 'drop' | 'execute' | 'promote';
|
|
16
|
-
export type IRolesState = ISanitized & {
|
|
17
|
-
flags: ITabFlags;
|
|
18
|
-
date?: string;
|
|
19
|
-
selectedTab: 'privileges' | 'roles';
|
|
20
|
-
initialState?: {
|
|
21
|
-
roles: TRolesDict;
|
|
22
|
-
privileges: TById;
|
|
23
|
-
forceLogin?: boolean;
|
|
24
|
-
restrictedByDefault?: boolean;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export interface IPrivilege {
|
|
28
|
-
id?: string;
|
|
29
|
-
privilege: string;
|
|
30
|
-
includes?: string[];
|
|
31
|
-
}
|
|
32
|
-
export interface IRole {
|
|
33
|
-
id?: string;
|
|
34
|
-
role: string;
|
|
35
|
-
privileges?: string[];
|
|
36
|
-
}
|
|
37
|
-
export type TRole = Required<IRole>;
|
|
38
|
-
export declare enum EPermissionType {
|
|
39
|
-
DATACLASS = "dataclass",
|
|
40
|
-
METHOD = "method",
|
|
41
|
-
ATTRIBUTE = "attribute",
|
|
42
|
-
DATASTORE = "datastore",
|
|
43
|
-
SINGLETON = "singleton",
|
|
44
|
-
SINGLETON_METHOD = "singletonMethod"
|
|
45
|
-
}
|
|
46
|
-
export declare enum ESubPermissionType {
|
|
47
|
-
DS_METHOD = "dsMethod",
|
|
48
|
-
DATACLASS_METHOD = "dataclassMethod",
|
|
49
|
-
ENTITY_METHOD = "entityMethod",
|
|
50
|
-
ENTITY_SEL_METHOD = "entityselMethod"
|
|
51
|
-
}
|
|
52
|
-
export interface IPermission {
|
|
53
|
-
applyTo: string;
|
|
54
|
-
type: EPermissionType | ESubPermissionType;
|
|
55
|
-
subType?: ESubPermissionType;
|
|
56
|
-
read?: string | string[];
|
|
57
|
-
create?: string | string[];
|
|
58
|
-
update?: string | string[];
|
|
59
|
-
drop?: string | string[];
|
|
60
|
-
execute?: string | string[];
|
|
61
|
-
promote?: string | string[];
|
|
62
|
-
}
|
|
63
|
-
export interface IResourcesByPermission {
|
|
64
|
-
[id: string]: {
|
|
65
|
-
applyTo: IPermission['applyTo'];
|
|
66
|
-
type: IPermission['type'];
|
|
67
|
-
subType?: IPermission['subType'];
|
|
68
|
-
}[];
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Sanitized data
|
|
72
|
-
*/
|
|
73
|
-
export interface ISanitized {
|
|
74
|
-
privileges: TById;
|
|
75
|
-
roles: TRolesDict;
|
|
76
|
-
forceLogin?: boolean;
|
|
77
|
-
restrictedByDefault?: boolean;
|
|
78
|
-
}
|
|
79
|
-
export interface IResourcePermission {
|
|
80
|
-
name: TAction;
|
|
81
|
-
from: string[];
|
|
82
|
-
checked?: boolean;
|
|
83
|
-
info?: string;
|
|
84
|
-
}
|
|
85
|
-
export interface IResource {
|
|
86
|
-
resource: string;
|
|
87
|
-
type: EPermissionType | ESubPermissionType;
|
|
88
|
-
subType?: ESubPermissionType;
|
|
89
|
-
permissions: IResourcePermission[];
|
|
90
|
-
exists?: boolean;
|
|
91
|
-
}
|
|
92
|
-
export type TSanitizedPrivilege = Required<IPrivilege> & {
|
|
93
|
-
parents: string[];
|
|
94
|
-
resources: IResource[];
|
|
95
|
-
};
|
|
96
|
-
export type TById = {
|
|
97
|
-
[id: string]: TSanitizedPrivilege;
|
|
98
|
-
};
|
|
99
|
-
export type TRolesDict = {
|
|
100
|
-
[id: string]: TRole;
|
|
101
|
-
};
|
|
102
|
-
export interface ILink {
|
|
103
|
-
source: string;
|
|
104
|
-
target: string;
|
|
105
|
-
}
|
|
106
|
-
export interface IGraphData {
|
|
107
|
-
selected: string;
|
|
108
|
-
parents: string[][];
|
|
109
|
-
children: string[][];
|
|
110
|
-
links: ILink[];
|
|
111
|
-
}
|
package/dist/types/settings.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { FileFolderType, IAppSettingsResponse } from './api';
|
|
2
|
-
import { ITreeItem } from './explorer';
|
|
3
|
-
export type TSettingPath = 'session' | 'project' | 'welcometour';
|
|
4
|
-
export interface ISettingsState {
|
|
5
|
-
session: {
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
};
|
|
8
|
-
project: {
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
};
|
|
11
|
-
server: IAppSettingsResponse;
|
|
12
|
-
welcometour: {
|
|
13
|
-
[key: string]: unknown;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export interface ISetSettingPayload {
|
|
17
|
-
path: TSettingPath;
|
|
18
|
-
settingsKey: string;
|
|
19
|
-
value: unknown;
|
|
20
|
-
}
|
|
21
|
-
export interface ICreateNewFilePayload {
|
|
22
|
-
fileName: string;
|
|
23
|
-
type: FileFolderType;
|
|
24
|
-
path: string;
|
|
25
|
-
parentNode: ITreeItem;
|
|
26
|
-
content?: string;
|
|
27
|
-
qodly?: boolean;
|
|
28
|
-
}
|
package/dist/utils/catalog.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function parseCatalog(catalog: datasources.ICatalog): datasources.IEnhancedCatalog;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ChangeEvent, CSSProperties, FocusOptions, Ref, SyntheticEvent } from 'react';
|
|
2
|
-
export type Dict<T = any> = Record<string, T>;
|
|
3
|
-
export type StringOrNumber = string | number;
|
|
4
|
-
export type PropGetter = (props?: Dict, forwardedRef?: any) => Dict;
|
|
5
|
-
type PossibleRef<T> = Ref<T> | undefined;
|
|
6
|
-
export declare function callAll<T extends (...args: any[]) => any>(...fns: Array<T | undefined | null>): (...args: Parameters<T>) => void;
|
|
7
|
-
export declare const callAllHandlers: typeof callAll;
|
|
8
|
-
export declare function dataAttr(condition: boolean | undefined): "" | undefined;
|
|
9
|
-
export declare function focus(element: HTMLElement | null | undefined, options?: FocusOptions & {
|
|
10
|
-
nextTick?: boolean;
|
|
11
|
-
}): void;
|
|
12
|
-
export declare function mergeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
13
|
-
export declare function warn({ condition, message, }: {
|
|
14
|
-
condition: boolean;
|
|
15
|
-
message: string;
|
|
16
|
-
}): void;
|
|
17
|
-
export declare const visuallyHiddenStyle: CSSProperties;
|
|
18
|
-
export declare function addItem<T>(values: T[], item: T): T[];
|
|
19
|
-
export declare function isInputEvent(value: unknown): value is ChangeEvent<HTMLInputElement>;
|
|
20
|
-
export declare function stopEvent(event: SyntheticEvent): void;
|
|
21
|
-
export {};
|
package/dist/utils/roles.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { EPermissionType, ESubPermissionType, IGraphData, IPermission, IPrivilege, IResource, IResourcePermission, IResourcesByPermission, ISanitized, TAction, TById, TRawData, TRole, TRolesDict, TSanitizedPrivilege } from '../types/roles';
|
|
2
|
-
export declare const PERMISSIONS: {
|
|
3
|
-
key: TAction;
|
|
4
|
-
label: string;
|
|
5
|
-
canApplyTo: (EPermissionType | ESubPermissionType)[];
|
|
6
|
-
}[];
|
|
7
|
-
/**
|
|
8
|
-
* pushes uniquely list of items
|
|
9
|
-
* @param array input array
|
|
10
|
-
* @param args list of elements to add to the array
|
|
11
|
-
* @returns an array containing unique fields
|
|
12
|
-
*/
|
|
13
|
-
export declare function uniquePush<T = string>(array: T[], ...args: T[]): T[];
|
|
14
|
-
/**
|
|
15
|
-
* Sanitize a privileges array
|
|
16
|
-
* @param data unsanitized data
|
|
17
|
-
* @returns sanitized data
|
|
18
|
-
*/
|
|
19
|
-
export declare function sanitizePrivileges(data: IPrivilege[]): TById;
|
|
20
|
-
/**
|
|
21
|
-
* sort list of sanitized pivileges
|
|
22
|
-
* @param dict sanitized data
|
|
23
|
-
* @returns sorted privileges
|
|
24
|
-
*/
|
|
25
|
-
export declare function sortPrivileges(dict: TById): TSanitizedPrivilege[];
|
|
26
|
-
export declare function parents(id: string, dict: TById): string[];
|
|
27
|
-
export declare function children(id: string, dict: TById): string[];
|
|
28
|
-
export declare function allowed(id: string, dict: TById): string[];
|
|
29
|
-
export declare function removePrivilege(id: string, dict: TById): TById;
|
|
30
|
-
export declare function addPrivilegeIn(parentId: string, childId: string, dict: TById): TById;
|
|
31
|
-
export declare function removePrivilegeFrom(parentId: string, childId: string, dict: TById): TById;
|
|
32
|
-
export declare function createPrivilege(name: string, dict: TById): TById;
|
|
33
|
-
export declare function renamePrivilege(name: string, id: string, dict: TById): TById;
|
|
34
|
-
export declare function populateShallow(ids: string[], dict: TById): (IPrivilege | null)[];
|
|
35
|
-
export declare function getPrivilegeById(id: string, dict: TById): TSanitizedPrivilege | null;
|
|
36
|
-
export declare function actionsToPrivs({ applyTo: _, type, ...actions }: IPermission): {
|
|
37
|
-
[privName: string]: string[];
|
|
38
|
-
};
|
|
39
|
-
export declare function getResourceFromType(item: IPermission): IResource;
|
|
40
|
-
export declare function sanitizePermissions(data: IPermission[], byKey: TById): TById;
|
|
41
|
-
export declare function getDictByName(dict: TById): TById;
|
|
42
|
-
export declare function sanitizeRoles(data: TRawData): ISanitized;
|
|
43
|
-
export declare function rolesToAPI(data: ISanitized): TRawData;
|
|
44
|
-
export declare function getGraphData(id: string, dict: TById): IGraphData;
|
|
45
|
-
export declare function addPermission(id: string, permission: IPermission, dict: TById): TById;
|
|
46
|
-
export declare function removePermission(id: string, permission: IPermission, dict: TById): TById;
|
|
47
|
-
export declare function removeMultiplePermissions(resourcesByPermission: IResourcesByPermission, dict: TById): TById;
|
|
48
|
-
export declare function resetResources(id: string, dict: TById): TById;
|
|
49
|
-
export declare function togglePermission(id: string, resource: IResource, permission: IResourcePermission, dict: TById): TById;
|
|
50
|
-
export declare function getPromotions(id: string, dict: TById): Record<string, string[]>;
|
|
51
|
-
export declare function getInheritedResources(id: string, dict: TById): IResource[];
|
|
52
|
-
export declare const createRole: (id: string, name: string, roles: TRolesDict) => TRolesDict;
|
|
53
|
-
export declare const removeRole: (id: string, roles: TRolesDict) => TRolesDict;
|
|
54
|
-
export declare const saveRole: (role: TRole, roles: TRolesDict) => TRolesDict;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { FileFolderType, ISaveFileResponse, ITab, WebformState, WebformStateCondition } from '../types';
|
|
2
|
-
export declare const ROOT_WEBFORM_STATE: {
|
|
3
|
-
label: string;
|
|
4
|
-
id: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const THEME_CLASSES: string[];
|
|
7
|
-
export declare const isBaseState: (state: WebformState) => boolean;
|
|
8
|
-
export declare const refactorConditions: (condition: WebformStateCondition, stateLabel: string | undefined, newValue?: string) => WebformStateCondition;
|
|
9
|
-
export declare function refactorWebform(content: ITab['content'], state: WebformState): any;
|
|
10
|
-
export declare const updateDsCondition: (condition: WebformStateCondition, oldRef: string, newRef: string) => WebformStateCondition;
|
|
11
|
-
export declare const deepDeleteCondition: (condition: WebformStateCondition, targetId: string) => WebformStateCondition | null;
|
|
12
|
-
export declare const deepSanitizeCondition: (condition: WebformStateCondition) => WebformStateCondition;
|
|
13
|
-
export declare function getDefaultContent(root: FileFolderType, projectSettings?: Record<string, any>): "" | never[] | {
|
|
14
|
-
metadata: {
|
|
15
|
-
v: string;
|
|
16
|
-
datasources: never[];
|
|
17
|
-
styles: never[];
|
|
18
|
-
};
|
|
19
|
-
components: {
|
|
20
|
-
ROOT: {
|
|
21
|
-
parent: string;
|
|
22
|
-
type: {
|
|
23
|
-
resolvedName: string;
|
|
24
|
-
};
|
|
25
|
-
isCanvas: boolean;
|
|
26
|
-
props: {
|
|
27
|
-
airyMode: boolean;
|
|
28
|
-
className: string;
|
|
29
|
-
classNames: never[];
|
|
30
|
-
events: never[];
|
|
31
|
-
};
|
|
32
|
-
displayName: string;
|
|
33
|
-
custom: {};
|
|
34
|
-
hidden: boolean;
|
|
35
|
-
nodes: never[];
|
|
36
|
-
linkedNodes: {};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
} | "//%attributes = {}\n" | {
|
|
40
|
-
metadata: {
|
|
41
|
-
v: string;
|
|
42
|
-
datasources: never[];
|
|
43
|
-
styles: never[];
|
|
44
|
-
};
|
|
45
|
-
pages: {
|
|
46
|
-
name: string;
|
|
47
|
-
id: string;
|
|
48
|
-
components: {
|
|
49
|
-
ROOT: {
|
|
50
|
-
type: {
|
|
51
|
-
resolvedName: string;
|
|
52
|
-
};
|
|
53
|
-
isCanvas: boolean;
|
|
54
|
-
props: {
|
|
55
|
-
classNames: never[];
|
|
56
|
-
events: never[];
|
|
57
|
-
airyMode: boolean;
|
|
58
|
-
className: string;
|
|
59
|
-
};
|
|
60
|
-
displayName: string;
|
|
61
|
-
custom: {};
|
|
62
|
-
parent: string;
|
|
63
|
-
hidden: boolean;
|
|
64
|
-
nodes: never[];
|
|
65
|
-
linkedNodes: {};
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
}[];
|
|
69
|
-
permissions?: undefined;
|
|
70
|
-
privileges?: undefined;
|
|
71
|
-
roles?: undefined;
|
|
72
|
-
} | {
|
|
73
|
-
metadata?: undefined;
|
|
74
|
-
pages?: undefined;
|
|
75
|
-
permissions?: undefined;
|
|
76
|
-
privileges?: undefined;
|
|
77
|
-
roles?: undefined;
|
|
78
|
-
} | {
|
|
79
|
-
permissions: {
|
|
80
|
-
allowed: never[];
|
|
81
|
-
};
|
|
82
|
-
privileges: never[];
|
|
83
|
-
roles: never[];
|
|
84
|
-
metadata?: undefined;
|
|
85
|
-
pages?: undefined;
|
|
86
|
-
};
|
|
87
|
-
export declare function selectorEqualityFn(left: unknown, right: unknown): boolean;
|
|
88
|
-
export declare function getFilePath(file: Pick<ISaveFileResponse, 'name' | 'type'>, options?: Partial<{
|
|
89
|
-
withExtension: boolean;
|
|
90
|
-
qodly: boolean;
|
|
91
|
-
}>): string;
|