jamespot-react-core 1.1.182 → 1.1.184
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/build/{201.bundle.js → 201.566cb5eca92385626a48.chunk.js} +1 -1
- package/build/201.566cb5eca92385626a48.chunk.js.map +1 -0
- package/build/724.4aadbecc6e0740c58434.chunk.js +561 -0
- package/build/724.4aadbecc6e0740c58434.chunk.js.map +1 -0
- package/build/app.bundle.js +456 -442
- package/build/app.bundle.js.map +1 -1
- package/build/socket.sharedworker.36b2317446c7c433029e.js.map +1 -1
- package/build/src/ReactCore.d.ts +10 -4
- package/build/src/components/widgets/wrapper/utils.d.ts +1 -1
- package/build/src/displayer/DisplayForm.component.d.ts +1 -2
- package/build/src/displayer/types.d.ts +1 -0
- package/build/src/displayer/useDisplay.d.ts +1 -2
- package/build/src/registry/CommonRegistry.d.ts +2 -0
- package/build/src/registry/CoreRegistry.d.ts +2 -0
- package/build/src/registry/GlobalRegistry.d.ts +13 -0
- package/build/src/registry/ReactCommonRegistry.d.ts +13 -0
- package/build/src/registry/ReactCoreRegistry.d.ts +13 -0
- package/build/src/registry/index.d.ts +1 -0
- package/build/src/registry/types.common.d.ts +14 -0
- package/build/src/registry/types.core.d.ts +14 -0
- package/build/src/types.d.ts +2 -1
- package/build/src/utils/socket.d.ts +1 -1
- package/build/src/utils/types.d.ts +4 -50
- package/build/src/utils/types.socket.d.ts +48 -0
- package/package.json +3 -3
- package/build/201.bundle.js.map +0 -1
- package/build/724.bundle.js +0 -559
- package/build/724.bundle.js.map +0 -1
- package/build/src/registry/ReactRegistry.d.ts +0 -13
- package/build/src/registry/Registry.d.ts +0 -2
- package/build/src/registry/types.d.ts +0 -31
package/build/src/ReactCore.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { ReactCore, ReactExtensions,
|
|
1
|
+
import { ReactCore, ReactExtensions, Gabarit, ReactLoadedExtensions } from './utils/types';
|
|
2
2
|
import { ReactTranslation, SupportedLanguages } from './utils/translation';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useDisplay, useDisplayList } from './displayer/useDisplay';
|
|
5
5
|
import { ReactRouter } from './utils/router';
|
|
6
6
|
import { JInjectStore } from './redux/store';
|
|
7
7
|
import { TinyMCECommonOptions } from 'jamespot-user-api';
|
|
8
|
-
import {
|
|
8
|
+
import { ReactCommonRegistry } from './registry/ReactCommonRegistry';
|
|
9
|
+
import { ReactCoreRegistry } from './registry/ReactCoreRegistry';
|
|
10
|
+
import { ReactSocket } from './utils/types.socket';
|
|
11
|
+
import { GlobalRegistry } from './registry/GlobalRegistry';
|
|
9
12
|
declare class App implements ReactCore {
|
|
10
13
|
extensions: ReactExtensions;
|
|
11
14
|
loadedExtensions: ReactLoadedExtensions;
|
|
12
15
|
store: JInjectStore;
|
|
13
16
|
actions: object;
|
|
14
|
-
registry:
|
|
17
|
+
registry: GlobalRegistry;
|
|
15
18
|
useDisplay: typeof useDisplay;
|
|
16
19
|
useDisplayList: typeof useDisplayList;
|
|
17
20
|
locale: SupportedLanguages;
|
|
@@ -20,7 +23,10 @@ declare class App implements ReactCore {
|
|
|
20
23
|
socket: ReactSocket;
|
|
21
24
|
router: ReactRouter;
|
|
22
25
|
tinymceCommonOptions?: TinyMCECommonOptions;
|
|
23
|
-
constructor(store: JInjectStore, ActionCreators: object, registry:
|
|
26
|
+
constructor(store: JInjectStore, ActionCreators: object, registry: {
|
|
27
|
+
commonComponentsRegistry: ReactCommonRegistry;
|
|
28
|
+
coreComponentsRegistry: ReactCoreRegistry;
|
|
29
|
+
}, locale: SupportedLanguages, translation: ReactTranslation, socket: ReactSocket);
|
|
24
30
|
require: (extensionName: string, args?: any) => void;
|
|
25
31
|
unmountExtension: (extensionName: string, args?: any) => void;
|
|
26
32
|
extensionAdd(extensionName: string, load: () => void): void;
|
|
@@ -7,7 +7,7 @@ export declare const getVisibleColumns: (tableColumnsData: {
|
|
|
7
7
|
dateFormat?: "time" | "date" | "date-time" | "date-time-sec" | "time-sec" | undefined;
|
|
8
8
|
numberFormat?: "fr-FR" | "en-EN" | "filesize" | undefined;
|
|
9
9
|
}[], columns: WidgetTableColumn[]) => {
|
|
10
|
-
type: "number" | "uri" | "title" | "select" | "text" | "
|
|
10
|
+
type: "number" | "uri" | "title" | "select" | "text" | "date" | "email" | "file" | "url" | "datetime" | "transient";
|
|
11
11
|
name: string;
|
|
12
12
|
label: string;
|
|
13
13
|
widget: {} | {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DisplayFormFieldsConfig, DisplayFormRef } from './types';
|
|
3
3
|
import { Control, FieldValues } from 'react-hook-form';
|
|
4
|
-
export type DisplayFormFieldsConfig<TFieldValues extends FieldValues> = 'all' | FieldsWith<'input', TFieldValues>;
|
|
5
4
|
export type DisplayFormProps<TFieldValues extends FieldValues> = {
|
|
6
5
|
type: string;
|
|
7
6
|
fields: DisplayFormFieldsConfig<TFieldValues>;
|
|
@@ -74,3 +74,4 @@ export type DisplayFormRef = UseFormReturn<any> & {
|
|
|
74
74
|
getFormattedValues: () => any;
|
|
75
75
|
};
|
|
76
76
|
export type Displayer<TFieldValues extends FieldValues = FieldValues> = Array<DisplayerElement<TFieldValues>>;
|
|
77
|
+
export type DisplayFormFieldsConfig<TFieldValues extends FieldValues> = 'all' | FieldsWith<'input', TFieldValues>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Widget } from 'jamespot-user-api';
|
|
3
|
-
import { Displayer, Fields, FieldsWith } from './types';
|
|
3
|
+
import { Displayer, Fields, FieldsWith, DisplayFormFieldsConfig } from './types';
|
|
4
4
|
import type { FieldValues, FieldPath } from 'react-hook-form';
|
|
5
|
-
import { DisplayFormFieldsConfig } from './DisplayForm.component';
|
|
6
5
|
/**
|
|
7
6
|
*
|
|
8
7
|
* @param fields - fields that we want to display (firstname, name, age...)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CoreComponentListKey, CoreComponentListType, CoreComponentTypes } from './types.core';
|
|
2
|
+
import { ReactCommonRegistry } from './ReactCommonRegistry';
|
|
3
|
+
import { ReactCoreRegistry } from './ReactCoreRegistry';
|
|
4
|
+
import { JrComponentListKey, JrComponentListType, JrComponentTypes } from './types.common';
|
|
5
|
+
export interface RegistryComponents {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export declare class GlobalRegistry {
|
|
9
|
+
commonRegistry: ReactCommonRegistry;
|
|
10
|
+
coreRegistry: ReactCoreRegistry;
|
|
11
|
+
constructor(commonRegistry: ReactCommonRegistry, coreRegistry: ReactCoreRegistry);
|
|
12
|
+
getLazyComponent<T extends CoreComponentListKey | JrComponentListKey>(name: T): (CoreComponentTypes & JrComponentTypes)[(CoreComponentListType & JrComponentListType)[T]];
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { JrComponentListKey, JrComponentListType, JrComponentTypes } from './types.common';
|
|
3
|
+
export interface RegistryComponents {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export declare class ReactCommonRegistry {
|
|
7
|
+
list: RegistryComponents;
|
|
8
|
+
listLazy: RegistryComponents;
|
|
9
|
+
getComponent(name: string): any;
|
|
10
|
+
registerLazyComponent(name: string, promise: React.LazyExoticComponent<React.ComponentType<any>>): void;
|
|
11
|
+
registerLib(componentList: Partial<JrComponentListType>, importPromise: any): void;
|
|
12
|
+
getLazyComponent<T extends JrComponentListKey>(name: T): JrComponentTypes[JrComponentListType[T]];
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CoreComponentListKey, CoreComponentListType, CoreComponentTypes } from './types.core';
|
|
3
|
+
export interface RegistryComponents {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export declare class ReactCoreRegistry {
|
|
7
|
+
list: RegistryComponents;
|
|
8
|
+
listLazy: RegistryComponents;
|
|
9
|
+
getComponent(name: string): any;
|
|
10
|
+
registerLazyComponent(name: string, promise: React.LazyExoticComponent<React.ComponentType<any>>): void;
|
|
11
|
+
registerLib(componentList: Partial<CoreComponentListType>, importPromise: any): void;
|
|
12
|
+
getLazyComponent<T extends CoreComponentListKey>(name: T): CoreComponentTypes[CoreComponentListType[T]];
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import jComponentList from './ext-component-list';
|
|
2
|
+
import jrComponent from 'jamespot-react-components';
|
|
3
|
+
/**
|
|
4
|
+
* j-react-components { JRCButton: () => <JRCButton/>, ... }
|
|
5
|
+
*/
|
|
6
|
+
export type JrComponentTypes = typeof jrComponent;
|
|
7
|
+
/**
|
|
8
|
+
* jrc component list { Button: "JRCButton", ... }
|
|
9
|
+
*/
|
|
10
|
+
export type JrComponentListType = typeof jComponentList;
|
|
11
|
+
/**
|
|
12
|
+
* jrc component keys { "Button" | ... }
|
|
13
|
+
*/
|
|
14
|
+
export type JrComponentListKey = keyof JrComponentListType;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as coreComponents from './coreComponents';
|
|
2
|
+
import { coreComponentsMapping } from './core-component-list';
|
|
3
|
+
/**
|
|
4
|
+
* j-core-components { Empty: () => <Empty/>, ... }
|
|
5
|
+
*/
|
|
6
|
+
export type CoreComponentTypes = typeof coreComponents;
|
|
7
|
+
/**
|
|
8
|
+
* jrc component list { Empty: "Empty", ... }
|
|
9
|
+
*/
|
|
10
|
+
export type CoreComponentListType = typeof coreComponentsMapping;
|
|
11
|
+
/**
|
|
12
|
+
* core component keys { "Empty" | ... }
|
|
13
|
+
*/
|
|
14
|
+
export type CoreComponentListKey = keyof CoreComponentListType;
|
package/build/src/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './utils/types';
|
|
2
2
|
export * from './components/types';
|
|
3
3
|
export * from './displayer/types';
|
|
4
|
-
export * from './registry/types';
|
|
4
|
+
export * from './registry/types.common';
|
|
5
|
+
export * from './registry/types.core';
|
|
5
6
|
export * from './hooks/types';
|
|
6
7
|
export type { RootState } from './redux/store';
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApplicationType, jUserList, Model, Readable, TinyMCECommonOptions, TinyMCEDynamicOptions, TinyMCEExtendedOptions } from 'jamespot-user-api';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { RouteObject } from 'react-router-dom';
|
|
4
4
|
import { TwoColLayoutRoute, TwoColLayoutRoutes } from '../components/types';
|
|
5
5
|
import { useDisplay, useDisplayList } from '../displayer/useDisplay';
|
|
6
6
|
import { ReactRouter } from './router';
|
|
7
7
|
import { ReactTranslation, SupportedLanguages, TranslationKeys } from './translation';
|
|
8
|
-
import {
|
|
8
|
+
import { ReactSocket } from './types.socket';
|
|
9
|
+
import { GlobalRegistry } from '../registry/GlobalRegistry';
|
|
9
10
|
export type Gabarit = 'core-1-cols' | 'core-2-cols' | 'core-3-cols' | 'content-1-cols' | 'content-2-cols' | 'content-3-cols' | 'app-1-cols' | 'app-2-cols' | 'empty';
|
|
10
11
|
export interface ReactCore {
|
|
11
12
|
extensions: ReactExtensions;
|
|
12
13
|
store: any;
|
|
13
14
|
actions: object;
|
|
14
|
-
registry:
|
|
15
|
+
registry: GlobalRegistry;
|
|
15
16
|
locale?: SupportedLanguages;
|
|
16
17
|
translation: ReactTranslation;
|
|
17
18
|
theme: any;
|
|
@@ -49,53 +50,6 @@ export interface ReactExtension {
|
|
|
49
50
|
export interface ReactExtensionContainer {
|
|
50
51
|
default: ReactExtension;
|
|
51
52
|
}
|
|
52
|
-
export type ReactSocketEventHandler = AnyRTHandlerFunction;
|
|
53
|
-
export interface ReactSocket {
|
|
54
|
-
io: any;
|
|
55
|
-
worker: any | undefined;
|
|
56
|
-
supportSharedWorker?: Boolean;
|
|
57
|
-
events: ReactSocketEvents;
|
|
58
|
-
init: (idUser: number) => void;
|
|
59
|
-
onMessage: <T extends keyof Namespaces>(namespace: T, functionName: Namespaces[T], callback: ReactSocketEventHandler) => void;
|
|
60
|
-
offMessage: <T extends keyof Namespaces>(namespace: T, functionName: Namespaces[T], callback: ReactSocketEventHandler) => void;
|
|
61
|
-
removeMessageListener: <T extends keyof Namespaces>(namespace: T, functionName: Namespaces[T], callback: ReactSocketEventHandler) => void;
|
|
62
|
-
callEvent: (type: string, data: any) => void;
|
|
63
|
-
}
|
|
64
|
-
export type SocketSharedWorker = {
|
|
65
|
-
user?: {
|
|
66
|
-
idUser: number;
|
|
67
|
-
} | undefined;
|
|
68
|
-
cache: {
|
|
69
|
-
presence?: RTMessageWsPresence;
|
|
70
|
-
};
|
|
71
|
-
ports: any[];
|
|
72
|
-
call: (type: string, event: string, data?: any) => void;
|
|
73
|
-
};
|
|
74
|
-
export type SocketOptions = {
|
|
75
|
-
path: string;
|
|
76
|
-
transports?: string[];
|
|
77
|
-
upgrade?: boolean;
|
|
78
|
-
};
|
|
79
|
-
export type SocketError = {
|
|
80
|
-
message: string;
|
|
81
|
-
};
|
|
82
|
-
export type ReactSocketNamespaceEvents = {
|
|
83
|
-
[key: string]: ReactSocketEventHandler[];
|
|
84
|
-
};
|
|
85
|
-
export type ReactSocketEvents = {
|
|
86
|
-
[key: string]: {
|
|
87
|
-
[key: string]: ReactSocketNamespaceEvents | ReactSocketEventHandler[];
|
|
88
|
-
all: ReactSocketEventHandler[];
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
export interface SharedWorkerEvent {
|
|
92
|
-
data: SharedWorkerEventData;
|
|
93
|
-
}
|
|
94
|
-
export interface SharedWorkerEventData {
|
|
95
|
-
type: string;
|
|
96
|
-
event?: string;
|
|
97
|
-
data: any;
|
|
98
|
-
}
|
|
99
53
|
export interface JConfig {
|
|
100
54
|
resourceShowKey?: boolean;
|
|
101
55
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AnyRTHandlerFunction, Namespaces, RTMessageWsPresence } from 'jamespot-user-api';
|
|
2
|
+
export type ReactSocketEventHandler = AnyRTHandlerFunction;
|
|
3
|
+
export interface ReactSocket {
|
|
4
|
+
io: any;
|
|
5
|
+
worker: any | undefined;
|
|
6
|
+
supportSharedWorker?: Boolean;
|
|
7
|
+
events: ReactSocketEvents;
|
|
8
|
+
init: (idUser: number) => void;
|
|
9
|
+
onMessage: <T extends keyof Namespaces>(namespace: T, functionName: Namespaces[T], callback: ReactSocketEventHandler) => void;
|
|
10
|
+
offMessage: <T extends keyof Namespaces>(namespace: T, functionName: Namespaces[T], callback: ReactSocketEventHandler) => void;
|
|
11
|
+
removeMessageListener: <T extends keyof Namespaces>(namespace: T, functionName: Namespaces[T], callback: ReactSocketEventHandler) => void;
|
|
12
|
+
callEvent: (type: string, data: any) => void;
|
|
13
|
+
}
|
|
14
|
+
export type SocketSharedWorker = {
|
|
15
|
+
user?: {
|
|
16
|
+
idUser: number;
|
|
17
|
+
} | undefined;
|
|
18
|
+
cache: {
|
|
19
|
+
presence?: RTMessageWsPresence;
|
|
20
|
+
};
|
|
21
|
+
ports: any[];
|
|
22
|
+
call: (type: string, event: string, data?: any) => void;
|
|
23
|
+
};
|
|
24
|
+
export type SocketOptions = {
|
|
25
|
+
path: string;
|
|
26
|
+
transports?: string[];
|
|
27
|
+
upgrade?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type SocketError = {
|
|
30
|
+
message: string;
|
|
31
|
+
};
|
|
32
|
+
export type ReactSocketNamespaceEvents = {
|
|
33
|
+
[key: string]: ReactSocketEventHandler[];
|
|
34
|
+
};
|
|
35
|
+
export type ReactSocketEvents = {
|
|
36
|
+
[key: string]: {
|
|
37
|
+
[key: string]: ReactSocketNamespaceEvents | ReactSocketEventHandler[];
|
|
38
|
+
all: ReactSocketEventHandler[];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export interface SharedWorkerEvent {
|
|
42
|
+
data: SharedWorkerEventData;
|
|
43
|
+
}
|
|
44
|
+
export interface SharedWorkerEventData {
|
|
45
|
+
type: string;
|
|
46
|
+
event?: string;
|
|
47
|
+
data: any;
|
|
48
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-react-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.184",
|
|
4
4
|
"description": "Jamespot React Core",
|
|
5
5
|
"main": "./build/app.bundle.js",
|
|
6
6
|
"types": "./build/src/App.d.ts",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
57
57
|
"eslint-plugin-import": "^2.31.0",
|
|
58
58
|
"history": "^5.3.0",
|
|
59
|
-
"jamespot-front-business": "^1.1.
|
|
60
|
-
"jamespot-react-components": "^1.0.
|
|
59
|
+
"jamespot-front-business": "^1.1.83",
|
|
60
|
+
"jamespot-react-components": "^1.0.233",
|
|
61
61
|
"jamespot-user-api": "^1.0.209",
|
|
62
62
|
"marked": "^15.0.3",
|
|
63
63
|
"react": "^17.0.2",
|