@ws-ui/store 0.1.28 → 0.1.29

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.
@@ -2,6 +2,12 @@ import { PayloadAction } from '@reduxjs/toolkit';
2
2
  import { ITreeItem } from './types';
3
3
  export declare const findNodeByPath: (tree: ITreeItem[], path: string) => ITreeItem | null;
4
4
  declare const stateSlice: import("@reduxjs/toolkit").Slice<import("immer/dist/internal.js").WritableDraft<ITreeItem>[], {
5
+ renameClassesFolder: (state: ITreeItem[], action: PayloadAction<{
6
+ newName: string;
7
+ prevName: string;
8
+ }[]>) => ITreeItem[];
9
+ removeClassesFolder: (state: import("immer/dist/internal.js").WritableDraft<ITreeItem>[], action: PayloadAction<string[]>) => import("immer/dist/internal.js").WritableDraft<ITreeItem>[];
10
+ addClassesFolder: (state: import("immer/dist/internal.js").WritableDraft<ITreeItem>[], action: PayloadAction<ITreeItem[]>) => import("immer/dist/internal.js").WritableDraft<ITreeItem>[];
5
11
  toggleExpandFolder: (state: import("immer/dist/internal.js").WritableDraft<ITreeItem>[], action: PayloadAction<ITreeItem>) => import("immer/dist/internal.js").WritableDraft<ITreeItem>[];
6
12
  expandFolder: (state: import("immer/dist/internal.js").WritableDraft<ITreeItem>[], action: PayloadAction<ITreeItem>) => import("immer/dist/internal.js").WritableDraft<ITreeItem>[];
7
13
  openAddFileInput: (state: import("immer/dist/internal.js").WritableDraft<ITreeItem>[], action: PayloadAction<ITreeItem>) => ITreeItem[];
@@ -34,5 +40,8 @@ export declare const toggleExpandFolder: import("@reduxjs/toolkit").ActionCreato
34
40
  }, string>, setFolderChildren: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
35
41
  parentPath: string;
36
42
  children: ITreeItem[];
37
- }, string>;
43
+ }, string>, addClassesFolder: import("@reduxjs/toolkit").ActionCreatorWithPayload<ITreeItem[], string>, removeClassesFolder: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], string>, renameClassesFolder: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
44
+ newName: string;
45
+ prevName: string;
46
+ }[], string>;
38
47
  export default stateSlice;
@@ -1,12 +1,11 @@
1
1
  /// <reference types="@ws-ui/shared/dist/declarations/datasources/interfaces/catalog" />
2
2
  /// <reference types="@ws-ui/shared/dist/declarations/datasources/interfaces/dataclass-attribute" />
3
- import { Action, ThunkDispatch } from '@reduxjs/toolkit';
4
3
  import { FileFolderType, IFileInfo, ISaveFileResponse, ISetFileContentResponse, ITextEditorSelection } from '@ws-ui/shared';
5
4
  import { ITab } from '@ws-ui/shared';
6
5
  import { ClassFileTypes } from '../../modules/root/types';
7
6
  import { AppState } from '..';
8
7
  import { ISettingsState } from '../settings';
9
- import { ITreeItem } from './types';
8
+ import { IOpenFilePayload, ITreeItem } from './types';
10
9
  interface ICreateNewFilePayload {
11
10
  fileName: string;
12
11
  type: FileFolderType;
@@ -65,17 +64,20 @@ export declare const tryEditMethod: import("@reduxjs/toolkit").AsyncThunk<ITab<a
65
64
  }, {
66
65
  state: AppState;
67
66
  }>;
68
- export declare const createModelFiles: import("@reduxjs/toolkit").AsyncThunk<void, {
67
+ export type TCreateModelFilesPayload = {
69
68
  type: 'dataclass';
70
69
  className: string;
71
70
  collectionName: string;
72
- toCreate?: ClassFileTypes | undefined;
71
+ toCreate?: ClassFileTypes;
73
72
  } | {
74
73
  type: 'model';
75
- }, {
74
+ };
75
+ export declare const createModelFiles: import("@reduxjs/toolkit").AsyncThunk<void, TCreateModelFilesPayload, {
76
+ state: AppState;
77
+ }>;
78
+ export declare const fetchFolderContent: import("@reduxjs/toolkit").AsyncThunk<ITreeItem[], string, {
76
79
  state: AppState;
77
80
  }>;
78
- export declare const fetchFolderContent: import("@reduxjs/toolkit").AsyncThunk<ITreeItem[], string, {}>;
79
81
  export declare const fetchFolderContentWithoutExpanding: import("@reduxjs/toolkit").AsyncThunk<ITreeItem[], string, {}>;
80
82
  export declare const uploadFileAndGetResponse: import("@reduxjs/toolkit").AsyncThunk<{
81
83
  status: number;
@@ -88,7 +90,9 @@ export declare const uploadFile: import("@reduxjs/toolkit").AsyncThunk<{
88
90
  file: File;
89
91
  path: string;
90
92
  parentNode: ITreeItem;
91
- }, {}>;
93
+ }, {
94
+ state: AppState;
95
+ }>;
92
96
  export declare const createNewFile: import("@reduxjs/toolkit").AsyncThunk<{
93
97
  qodly: boolean;
94
98
  file: ISetFileContentResponse;
@@ -111,7 +115,7 @@ export declare function getFilePath(file: ISaveFileResponse, options?: Partial<{
111
115
  qodly: boolean;
112
116
  }>): string;
113
117
  export declare const createNewFileAndOpen: import("@reduxjs/toolkit").AsyncThunk<void, ICreateNewFilePayload, {
114
- dispatch: ThunkDispatch<any, void, Action>;
118
+ state: AppState;
115
119
  }>;
116
120
  export declare const createNewNode: import("@reduxjs/toolkit").AsyncThunk<{
117
121
  file: import("@ws-ui/shared").IAddFolderResponse;
@@ -137,20 +141,7 @@ export declare const openFile: import("@reduxjs/toolkit").AsyncThunk<ITab<any, P
137
141
  source: import("@ws-ui/shared").ISource;
138
142
  editor: import("@ws-ui/shared").IEditor;
139
143
  ext: import("@ws-ui/shared").DebuggerFileExtension;
140
- }>> | null, {
141
- file: IFileInfo;
142
- inactive?: boolean | undefined;
143
- isNew?: boolean | undefined;
144
- flags?: Pick<Partial<{
145
- touched: boolean;
146
- removed: boolean;
147
- pinned: boolean;
148
- loading: boolean;
149
- old: boolean;
150
- enabled: boolean;
151
- confirmed: boolean;
152
- }>, "pinned" | "loading" | "enabled" | "confirmed"> | undefined;
153
- }, {
144
+ }>> | null, IOpenFilePayload, {
154
145
  state: AppState;
155
146
  }>;
156
147
  export declare const openFileAtLine: import("@reduxjs/toolkit").AsyncThunk<ITab<any, Partial<{
@@ -1,4 +1,4 @@
1
- import { FileFolderType, IEditor } from '@ws-ui/shared';
1
+ import { FileFolderType, IEditor, IFileInfo, ITabFlags } from '@ws-ui/shared';
2
2
  export interface ITreeItem {
3
3
  name: string;
4
4
  path: string;
@@ -19,6 +19,9 @@ export interface ITreeItem {
19
19
  supportedEditors?: IEditor[];
20
20
  };
21
21
  isRoot?: boolean;
22
+ info?: {
23
+ [key: string]: any;
24
+ };
22
25
  }
23
26
  export interface INodePermissions {
24
27
  canRemove: boolean;
@@ -49,6 +52,15 @@ export interface IEditors {
49
52
  editor: IEditor;
50
53
  supportedEditors?: IEditor[];
51
54
  }
55
+ export interface IOpenFilePayload {
56
+ file: IFileInfo;
57
+ inactive?: boolean;
58
+ isNew?: boolean;
59
+ flags?: Pick<ITabFlags, 'enabled' | 'loading' | 'pinned' | 'confirmed'>;
60
+ info?: {
61
+ [key: string]: string;
62
+ };
63
+ }
52
64
  export declare const editors: IEditors[];
53
65
  export declare const extensions: {
54
66
  pattern: string;
@@ -2,3 +2,15 @@ import { IEditors } from './types';
2
2
  export declare function getNodeRelativePath(nodePath: string): string;
3
3
  export declare function getEditors(path: string): IEditors;
4
4
  export declare function getExtension(path: string): "json" | "text";
5
+ type TGetContentParams = {
6
+ name: string;
7
+ qodly: boolean;
8
+ };
9
+ type TGetContentReturnValue = {
10
+ [key: string]: (params: TGetContentParams) => {
11
+ name: string;
12
+ content: string;
13
+ };
14
+ };
15
+ export declare const getContent: () => TGetContentReturnValue;
16
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ws-ui/store",
3
3
  "private": false,
4
- "version": "0.1.28",
4
+ "version": "0.1.29",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
7
7
  "module": "./dist/index.es.js",
@@ -24,11 +24,11 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@reduxjs/toolkit": "^1.7.1",
27
- "@ws-ui/shared": "^0.1.22",
28
27
  "react-redux": "^7.2.6"
29
28
  },
30
29
  "peerDependencies": {
31
30
  "@ws-ui/icons": "^0.0.17",
31
+ "@ws-ui/shared": "^0.1.24",
32
32
  "lodash": "^4.17.21",
33
33
  "minimatch": "^5.1.0",
34
34
  "react": "^17.0.2",
@@ -38,6 +38,7 @@
38
38
  "vscode-debugprotocol": "^1.51.0"
39
39
  },
40
40
  "devDependencies": {
41
+ "@esbuild/darwin-arm64": "^0.21.4",
41
42
  "@jest/globals": "^29.7.0",
42
43
  "@types/jest": "^29.5.5",
43
44
  "@types/lodash": "^4.14.199",