@ws-ui/shared 1.12.4 → 1.13.0-rc2
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/Grid.d.ts +26 -0
- package/dist/components/Image.d.ts +5 -0
- package/dist/components/Panel.d.ts +3 -2
- package/dist/components/SearchInput.d.ts +12 -0
- package/dist/components/ToolbarIcon/index.d.ts +2 -0
- package/dist/components/ToolbarIcon/interfaces.d.ts +21 -0
- package/dist/components/Tooltip.d.ts +7 -3
- package/dist/components/index.d.ts +4 -3
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/use-boolean.d.ts +5 -0
- package/dist/hooks/use-callback-ref.d.ts +1 -0
- package/dist/hooks/use-controllable-state.d.ts +7 -0
- package/dist/hooks/use-ds-change-renderer.d.ts +10 -0
- package/dist/hooks/use-ds-renderer.d.ts +7 -0
- package/dist/hooks/use-form-control-props.d.ts +15 -0
- package/dist/hooks/use-safe-layout-effect.d.ts +2 -0
- package/dist/hooks/use-update-effect.d.ts +2 -0
- package/dist/index.cjs.js +166 -115
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +26379 -15223
- package/dist/index.es.js.map +1 -1
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/studio-context.d.ts +7 -0
- package/dist/providers/toast-provider.d.ts +18 -0
- package/dist/shared.css +1 -1
- package/dist/types/adapter.d.ts +12 -0
- package/dist/types/explorer.d.ts +31 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/modal.d.ts +11 -4
- package/dist/types/roles.d.ts +111 -0
- package/dist/types/settings.d.ts +28 -0
- package/dist/types/webform-editor.d.ts +132 -1
- package/dist/types/welcome-tour.d.ts +3 -0
- package/dist/utils/catalog.d.ts +1 -0
- package/dist/utils/chakra-utils.d.ts +21 -0
- package/dist/utils/common.d.ts +1 -0
- package/dist/utils/explorer.d.ts +4 -1
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/roles.d.ts +54 -0
- package/dist/utils/webform-editor.d.ts +91 -0
- package/package.json +6 -6
- package/dist/components/Checkbox/index.d.ts +0 -16
- package/dist/components/ControlledSwitch.d.ts +0 -10
- package/dist/components/FloatingTooltip/index.d.ts +0 -11
- package/dist/components/Modal/Button.d.ts +0 -10
package/dist/utils/explorer.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { FileFolderType, FileFolderTypeWithContent } from '../types/api';
|
|
2
|
+
import { IEditors } from '../types';
|
|
2
3
|
export declare const ROLES_TAB_PATH = "roles.json";
|
|
3
4
|
export declare const SETTINGS_TAB_PATH = "qodlyApp.json";
|
|
4
5
|
export declare const MODEL_TAB_PATH = "model.4DModel";
|
|
5
6
|
export declare const HTTP_HANDLERS_TAB_PATH = "HTTPHandlers.json";
|
|
6
7
|
export declare const LOCALIZATION_TAB_PATH = "Shared/i18n.json";
|
|
8
|
+
export declare const editors: IEditors[];
|
|
7
9
|
export declare function getFilenameAndTypeFromPath(path: string): {
|
|
8
10
|
filename: string;
|
|
9
11
|
type: FileFolderType.SETTINGS;
|
|
@@ -23,7 +25,8 @@ export declare function getFilenameAndTypeFromPath(path: string): {
|
|
|
23
25
|
filename: string;
|
|
24
26
|
type: FileFolderType.WEBFORM | FileFolderType.METHOD | FileFolderType.CLASS | FileFolderType.DEBUGGER | FileFolderType.WELCOME | FileFolderType.DATA_EXPLORER | FileFolderType.FILE | FileFolderType.TEXT;
|
|
25
27
|
};
|
|
28
|
+
export declare function getEditors(path: string): IEditors;
|
|
26
29
|
export declare function getTypeFromExtension(path: string): FileFolderTypeWithContent;
|
|
27
|
-
export declare function getFileExtentionFromType(type: string, qodly?: boolean): "" | "
|
|
30
|
+
export declare function getFileExtentionFromType(type: string, qodly?: boolean): "" | "4dm" | "4qs" | "WebForm" | "QoDoc" | "MForm";
|
|
28
31
|
export declare function extractWebformName(path: string, fallbackName?: string): string;
|
|
29
32
|
export declare function getFilenameFromType(fileName: string, type: FileFolderType, qodly?: boolean): string;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -8,5 +8,9 @@ export * from './datasources';
|
|
|
8
8
|
export * from './shared-datasources';
|
|
9
9
|
export * from './code';
|
|
10
10
|
export * from './model';
|
|
11
|
+
export * from './catalog';
|
|
11
12
|
export * from './tests';
|
|
13
|
+
export * from './roles';
|
|
12
14
|
export * from './feedbackErrors';
|
|
15
|
+
export * from './webform-editor';
|
|
16
|
+
export * from './chakra-utils';
|
|
@@ -0,0 +1,54 @@
|
|
|
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;
|
|
@@ -0,0 +1,91 @@
|
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ws-ui/shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0-rc2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"@radix-ui/react-popover": "^0.1.6",
|
|
28
28
|
"@radix-ui/react-tooltip": "^0.1.7",
|
|
29
29
|
"@ws-ui/craftjs-core": "0.2.26",
|
|
30
|
-
"@ws-ui/icons": "1.
|
|
30
|
+
"@ws-ui/icons": "1.13.0",
|
|
31
|
+
"@ws-ui/ui-components": "^1.0.29",
|
|
31
32
|
"classnames": "^2.3.1",
|
|
32
33
|
"hotkeys-js": "^3.8.7",
|
|
33
34
|
"jsonschema": "^1.5.0",
|
|
@@ -35,7 +36,6 @@
|
|
|
35
36
|
"markdown-to-jsx": "^7.1.3",
|
|
36
37
|
"marked-react": "^3.0.0",
|
|
37
38
|
"minimatch": "^10.0.1",
|
|
38
|
-
"re-resizable": "^6.9.0",
|
|
39
39
|
"react": "^17.0.2",
|
|
40
40
|
"react-dom": "^17.0.2",
|
|
41
41
|
"react-popper": "^2.2.5",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@jest/globals": "^29.7.0",
|
|
50
|
-
"@tailwindcss/
|
|
50
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
51
|
+
"@tailwindcss/typography": "^0.5.16",
|
|
51
52
|
"@testing-library/jest-dom": "^6.4.2",
|
|
52
53
|
"@testing-library/react": "^12.1.5",
|
|
53
54
|
"@types/classnames": "^2.3.0",
|
|
@@ -58,10 +59,9 @@
|
|
|
58
59
|
"@types/react": "^17.0.24",
|
|
59
60
|
"@types/react-dom": "^17.0.5",
|
|
60
61
|
"@vitejs/plugin-react": "^4.3.4",
|
|
61
|
-
"autoprefixer": "^10.4.2",
|
|
62
62
|
"jest": "^29.7.0",
|
|
63
63
|
"postcss": "^8.4.31",
|
|
64
|
-
"tailwindcss": "^
|
|
64
|
+
"tailwindcss": "^4.1.18",
|
|
65
65
|
"ts-jest": "^29.4.9",
|
|
66
66
|
"typescript": "^5.8.3",
|
|
67
67
|
"vite": "^6.2.1",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { InputHTMLAttributes, ReactNode, ReactElement, SVGProps } from 'react';
|
|
2
|
-
export interface BaseCheckboxIconProps extends SVGProps<SVGSVGElement> {
|
|
3
|
-
isIndeterminate?: boolean;
|
|
4
|
-
isChecked?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function BaseCheckboxIcon({ children, viewBox, ...rest }: BaseCheckboxIconProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare function DefaultCheckboxIcon(props: BaseCheckboxIconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
9
|
-
isChecked?: boolean;
|
|
10
|
-
isIndeterminate?: boolean;
|
|
11
|
-
isInvalid?: boolean;
|
|
12
|
-
icon?: ReactElement<BaseCheckboxIconProps>;
|
|
13
|
-
label?: ReactNode;
|
|
14
|
-
indeterminate?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function Checkbox({ isChecked: controlledIsChecked, isIndeterminate, isInvalid, icon, label, className, style, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SwitchProps } from '@headlessui/react';
|
|
2
|
-
export type SwitchSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
3
|
-
interface IControlledSwitchProps extends Omit<SwitchProps<'button'>, 'value' | 'size'> {
|
|
4
|
-
onChange: (val: boolean) => void;
|
|
5
|
-
value: boolean;
|
|
6
|
-
size?: SwitchSize;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const ControlledSwitch: import('react').ForwardRefExoticComponent<IControlledSwitchProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
export default ControlledSwitch;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
type TooltipProps = {
|
|
3
|
-
message?: string | JSX.Element;
|
|
4
|
-
delayDuration?: number;
|
|
5
|
-
open?: boolean;
|
|
6
|
-
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
-
sideOffset?: number;
|
|
8
|
-
alignOffset?: number;
|
|
9
|
-
};
|
|
10
|
-
export declare function FloatingTooltip(props: PropsWithChildren<TooltipProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ModalColor } from '../../types/modal';
|
|
3
|
-
interface IButtonProps {
|
|
4
|
-
color?: ModalColor;
|
|
5
|
-
variant?: 'solid' | 'outlined';
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
autoFocus?: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare const Button: FC<IButtonProps>;
|
|
10
|
-
export default Button;
|