@ws-ui/shared 0.1.20 → 0.1.21

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.
@@ -1,4 +1,4 @@
1
- import { FileFolderTypeWithContent, FolderRootType, IAddFolderRequest, IAddFolderResponse, IAppSettingsResponse, ICheckUpdatesRequest, ICheckUpdatesResponse, IDropFileRequest, IDropFolderRequest, IFileInfoResponse, IGetFileInfo, IGetFileRequest, IGetFolderRequest, IGetFolderResponse, IInstallUpdatesRequest, IMonacoThemeResponse, IRenameFileRequest, IRenameFileResponse, IRenameFolderRequest, IRenameFolderResponse, ISetFileContentRequest, ISharedCSSResponse, ISharedConditionsResponse, ISharedDatasourcesResponse, RemoteDebuggerMode } from '../types/api';
1
+ import { FileFolderTypeWithContent, FolderRootType, IAddFolderRequest, IAddFolderResponse, IAppSettingsResponse, ICheckUpdatesRequest, ICheckUpdatesResponse, IDropFileRequest, IDropFolderRequest, IFileInfoResponse, IGetFileInfo, IGetFileRequest, IGetFolderRequest, IGetFolderResponse, IInstallUpdatesRequest, IMonacoThemeResponse, IRenameFileRequest, IRenameFileResponse, IRenameFolderRequest, IRenameFolderResponse, ISetFileContentRequest, ISharedCSSResponse, ISavedConditionsResponse, ISharedDatasourcesResponse, RemoteDebuggerMode, IUserPrivilegesResponse } from '../types/api';
2
2
  import { IComponentTemplate } from '../types/webform-editor';
3
3
  /**
4
4
  * Check updates
@@ -104,7 +104,8 @@ export interface ISetFileContentResponse {
104
104
  }
105
105
  export declare function getSharedDatasources(): Promise<ISharedDatasourcesResponse>;
106
106
  export declare function getSharedCSS(): Promise<ISharedCSSResponse>;
107
- export declare function getSharedConditions(): Promise<ISharedConditionsResponse>;
107
+ export declare function getSavedConditions(): Promise<ISavedConditionsResponse>;
108
+ export declare function getUserPrivileges(): Promise<IUserPrivilegesResponse>;
108
109
  export declare function getMonacoTheme(): Promise<IMonacoThemeResponse>;
109
110
  export declare const setSharedSources: (datasources: {
110
111
  [key: string]: datasources.ICreateDataSource[];
@@ -539,7 +539,13 @@ export type ISharedDatasourcesResponse = {
539
539
  export type ISharedCSSResponse = {
540
540
  classes: IWebFormStyleClass[];
541
541
  };
542
- export type ISharedConditionsResponse = {
542
+ export type ISavedConditionsResponse = {
543
543
  conditions: WebformStateCondition[];
544
544
  };
545
+ export interface IUserPrivilege {
546
+ privilege: string;
547
+ }
548
+ export type IUserPrivilegesResponse = {
549
+ privileges: IUserPrivilege[];
550
+ };
545
551
  export type IMonacoThemeResponse = MonacoEditor.IStandaloneThemeData | null;
@@ -4,6 +4,7 @@ export type IWebFormMetadata = Partial<{
4
4
  v: string;
5
5
  datasources: datasources.ICreateDataSource[];
6
6
  states: WebformState[];
7
+ defaultStates: string[];
7
8
  styles: IWebFormStyleClass[];
8
9
  title: string;
9
10
  }>;
@@ -23,7 +23,6 @@ export type PrivilegeCondition = GenericCondition<{
23
23
  type: 'privilege';
24
24
  value: string;
25
25
  valueType?: ValueType;
26
- dataType?: DataType;
27
26
  op: CommonOp;
28
27
  }>;
29
28
  export type CombinationCondition = Omit<GenericCondition<{
@@ -33,6 +32,13 @@ export type CombinationCondition = Omit<GenericCondition<{
33
32
  }>, 'name'> & {
34
33
  name?: string;
35
34
  };
35
+ export type CurrentStateCondition = GenericCondition<{
36
+ type: 'currentState';
37
+ value: string;
38
+ valueType?: ValueType;
39
+ dataType?: DataType;
40
+ op: CommonOp;
41
+ }>;
36
42
  export type ParentStateCondition = GenericCondition<{
37
43
  type: 'parentState';
38
44
  value: string;
@@ -44,5 +50,5 @@ export type ReferenceCondition = Omit<GenericCondition<{
44
50
  type: 'reference';
45
51
  ref: string;
46
52
  }>, 'name'>;
47
- export type WebformStateCondition = DataSourceCondition | PrivilegeCondition | CombinationCondition | ParentStateCondition | ReferenceCondition;
53
+ export type WebformStateCondition = DataSourceCondition | PrivilegeCondition | CombinationCondition | CurrentStateCondition | ParentStateCondition | ReferenceCondition;
48
54
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ws-ui/shared",
3
3
  "private": false,
4
- "version": "0.1.20",
4
+ "version": "0.1.21",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
7
7
  "module": "./dist/index.es.js",
@@ -30,7 +30,7 @@
30
30
  "@popperjs/core": "^2.9.2",
31
31
  "@radix-ui/react-popover": "^0.1.6",
32
32
  "@ws-ui/craftjs-core": "^0.2.1-beta.3",
33
- "@ws-ui/icons": "^0.0.14",
33
+ "@ws-ui/icons": "^0.0.16",
34
34
  "classnames": "^2.3.1",
35
35
  "lodash": "^4.17.21",
36
36
  "markdown-to-jsx": "^7.1.3",