jamespot-front-business 1.1.7 → 1.1.8
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/cjs.js +340 -6
- package/dist/cjs.js.map +1 -1
- package/dist/esm.js +337 -7
- package/dist/esm.js.map +1 -1
- package/dist/types.d.ts +138 -5
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
2
|
-
import { EntityState, Action, Dispatch as Dispatch$1
|
|
2
|
+
import { EntityState, Action, PayloadAction, Dispatch as Dispatch$1 } from '@reduxjs/toolkit';
|
|
3
3
|
import * as _reduxjs_toolkit_dist_tsHelpers from '@reduxjs/toolkit/dist/tsHelpers';
|
|
4
4
|
import * as jamespot_user_api from 'jamespot-user-api';
|
|
5
|
-
import { Application as Application$1, JamespotUserApi, AudienceAutocomplete, ReservationList, BookableAssetList, AssetReservationConfiguration, Model as Model$1, JLandMap, JLicenseAvailable, jUserList } from 'jamespot-user-api';
|
|
5
|
+
import { Application as Application$1, JamespotUserApi, AudienceAutocomplete, ReservationList, BookableAssetList, AssetReservationConfiguration, widgetRefNames, WidgetWrapperProps, WidgetDefinitionProps, WidgetStateProps, CombinedWidgetContent, WidgetVector, Model as Model$1, JLandMap, JLicenseAvailable, jUserList } from 'jamespot-user-api';
|
|
6
6
|
import * as redux from 'redux';
|
|
7
7
|
import { Dispatch } from 'redux';
|
|
8
|
+
import * as immer_dist_internal from 'immer/dist/internal';
|
|
8
9
|
import { MapCreationFront as MapCreationFront$1 } from 'src/types';
|
|
9
10
|
import { Loading as Loading$1 } from 'src/types/utils';
|
|
10
|
-
import * as immer_dist_internal from 'immer/dist/internal';
|
|
11
11
|
|
|
12
12
|
type ApplicationRootState = {
|
|
13
13
|
entities: {
|
|
@@ -46,7 +46,7 @@ declare const Application: {
|
|
|
46
46
|
selectors: _reduxjs_toolkit.EntitySelectors<Application$1, ApplicationRootState>;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
type RootState = Partial<AssetReservationRootState | ApplicationRootState | ModelRootState | ToastRootState | JLandRootState>;
|
|
49
|
+
type RootState = Partial<AssetReservationRootState | ApplicationRootState | ModelRootState | ToastRootState | JLandRootState | WidgetsRootState | EditorsRootState>;
|
|
50
50
|
type RootDispatch = Dispatch<Action>;
|
|
51
51
|
type ThunkApiConfig<T> = {
|
|
52
52
|
dispatch: any;
|
|
@@ -163,6 +163,139 @@ declare const AssetReservation: {
|
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
+
declare function widgetFactory<T>(name: typeof widgetRefNames[number], widgetWrapperExtraParams: T): WidgetWrapperProps;
|
|
167
|
+
|
|
168
|
+
declare function uniqid(): string;
|
|
169
|
+
|
|
170
|
+
declare const WIDGET_ARTICLE_TITLE = "widget-article-title";
|
|
171
|
+
declare const WIDGET_ARTICLE_TEXT = "widget-article-text";
|
|
172
|
+
declare const WIDGET_ARTICLE_IMAGE = "widget-article-image";
|
|
173
|
+
declare const WIDGET_ARTICLE_BUTTON = "widget-article-button";
|
|
174
|
+
declare const WIDGET_ARTICLE_GALLERY = "widget-article-gallery";
|
|
175
|
+
declare const WIDGET_ARTICLE_ATTACHMENT = "widget-article-attachment";
|
|
176
|
+
|
|
177
|
+
declare const WIDGETS_WIDGET_ARTICLE_TITLE: typeof WIDGET_ARTICLE_TITLE;
|
|
178
|
+
declare const WIDGETS_WIDGET_ARTICLE_TEXT: typeof WIDGET_ARTICLE_TEXT;
|
|
179
|
+
declare const WIDGETS_WIDGET_ARTICLE_IMAGE: typeof WIDGET_ARTICLE_IMAGE;
|
|
180
|
+
declare const WIDGETS_WIDGET_ARTICLE_BUTTON: typeof WIDGET_ARTICLE_BUTTON;
|
|
181
|
+
declare const WIDGETS_WIDGET_ARTICLE_GALLERY: typeof WIDGET_ARTICLE_GALLERY;
|
|
182
|
+
declare const WIDGETS_WIDGET_ARTICLE_ATTACHMENT: typeof WIDGET_ARTICLE_ATTACHMENT;
|
|
183
|
+
declare namespace WIDGETS {
|
|
184
|
+
export {
|
|
185
|
+
WIDGETS_WIDGET_ARTICLE_TITLE as WIDGET_ARTICLE_TITLE,
|
|
186
|
+
WIDGETS_WIDGET_ARTICLE_TEXT as WIDGET_ARTICLE_TEXT,
|
|
187
|
+
WIDGETS_WIDGET_ARTICLE_IMAGE as WIDGET_ARTICLE_IMAGE,
|
|
188
|
+
WIDGETS_WIDGET_ARTICLE_BUTTON as WIDGET_ARTICLE_BUTTON,
|
|
189
|
+
WIDGETS_WIDGET_ARTICLE_GALLERY as WIDGET_ARTICLE_GALLERY,
|
|
190
|
+
WIDGETS_WIDGET_ARTICLE_ATTACHMENT as WIDGET_ARTICLE_ATTACHMENT,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
declare function widgetDefinition(name: typeof widgetRefNames[number] | undefined): WidgetDefinitionProps;
|
|
195
|
+
|
|
196
|
+
declare const MODE_EDIT = "edit";
|
|
197
|
+
declare const MODE_VIEW = "view";
|
|
198
|
+
type WidgetModalProps = {
|
|
199
|
+
title?: string;
|
|
200
|
+
view?: any;
|
|
201
|
+
};
|
|
202
|
+
type WidgetsRootState = {
|
|
203
|
+
widgets: WidgetsState;
|
|
204
|
+
};
|
|
205
|
+
type WidgetsState = {
|
|
206
|
+
token?: string | undefined;
|
|
207
|
+
ids: Record<string, WidgetWrapperProps>;
|
|
208
|
+
states: Record<string, WidgetStateProps>;
|
|
209
|
+
modal: WidgetModalProps | undefined;
|
|
210
|
+
};
|
|
211
|
+
declare const Widget: {
|
|
212
|
+
const: typeof WIDGETS;
|
|
213
|
+
factory: typeof widgetFactory;
|
|
214
|
+
definition: typeof widgetDefinition;
|
|
215
|
+
utils: {
|
|
216
|
+
uniqid: typeof uniqid;
|
|
217
|
+
};
|
|
218
|
+
slice: _reduxjs_toolkit.Slice<WidgetsState, {
|
|
219
|
+
registerWidget: (state: immer_dist_internal.WritableDraft<WidgetsState>, action: PayloadAction<{
|
|
220
|
+
uniqid: string;
|
|
221
|
+
widget: WidgetWrapperProps;
|
|
222
|
+
}>) => void;
|
|
223
|
+
updateWidget: (state: immer_dist_internal.WritableDraft<WidgetsState>, action: PayloadAction<{
|
|
224
|
+
uniqid: string;
|
|
225
|
+
content: CombinedWidgetContent;
|
|
226
|
+
}>) => void;
|
|
227
|
+
flushWidget: (state: immer_dist_internal.WritableDraft<WidgetsState>, action: PayloadAction<{
|
|
228
|
+
uniqid: string;
|
|
229
|
+
}>) => void;
|
|
230
|
+
updateWidgetWrapper: (state: immer_dist_internal.WritableDraft<WidgetsState>, action: PayloadAction<{
|
|
231
|
+
uniqid: string;
|
|
232
|
+
title: string;
|
|
233
|
+
position?: WidgetVector;
|
|
234
|
+
}>) => void;
|
|
235
|
+
setToken: (state: immer_dist_internal.WritableDraft<WidgetsState>, action: PayloadAction<{
|
|
236
|
+
token: string;
|
|
237
|
+
}>) => void;
|
|
238
|
+
setState: (state: immer_dist_internal.WritableDraft<WidgetsState>, action: PayloadAction<{
|
|
239
|
+
uniqid: string;
|
|
240
|
+
} & WidgetStateProps>) => void;
|
|
241
|
+
setAllStates: (state: immer_dist_internal.WritableDraft<WidgetsState>, action: PayloadAction<WidgetStateProps>) => void;
|
|
242
|
+
registerModal: (state: immer_dist_internal.WritableDraft<WidgetsState>, action: PayloadAction<WidgetModalProps>) => void;
|
|
243
|
+
flushModal: (state: immer_dist_internal.WritableDraft<WidgetsState>) => void;
|
|
244
|
+
}, "widgets">;
|
|
245
|
+
selectors: {
|
|
246
|
+
selectToken: (state: WidgetsRootState) => string | undefined;
|
|
247
|
+
selectWidgets: (state: WidgetsRootState) => Record<string, WidgetWrapperProps<jamespot_user_api.WidgetTypes>>;
|
|
248
|
+
selectWidget: (state: WidgetsRootState, uniqid: string) => WidgetWrapperProps<jamespot_user_api.WidgetTypes> | undefined;
|
|
249
|
+
selectWidgetState: (state: WidgetsRootState, uniqid: string) => WidgetStateProps | undefined;
|
|
250
|
+
selectWidgetContent: (state: WidgetsRootState, uniqid: string) => CombinedWidgetContent | undefined;
|
|
251
|
+
selectModal: (state: WidgetsRootState) => WidgetModalProps | undefined;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
type EditorProps = {
|
|
256
|
+
uniqid: string;
|
|
257
|
+
name: typeof widgetRefNames[number];
|
|
258
|
+
position: 'left' | 'right';
|
|
259
|
+
popup?: boolean;
|
|
260
|
+
view?: any;
|
|
261
|
+
};
|
|
262
|
+
type EditorsState = {
|
|
263
|
+
editors: EditorProps[];
|
|
264
|
+
};
|
|
265
|
+
type EditorsRootState = {
|
|
266
|
+
editors: EditorsState;
|
|
267
|
+
};
|
|
268
|
+
declare const WidgetEditor: {
|
|
269
|
+
slice: _reduxjs_toolkit.Slice<EditorsState, {
|
|
270
|
+
registerEditor: (state: immer_dist_internal.WritableDraft<EditorsState>, action: PayloadAction<{
|
|
271
|
+
uniqid: string;
|
|
272
|
+
name: (typeof widgetRefNames)[number];
|
|
273
|
+
}>) => void;
|
|
274
|
+
registerEditorPopup: (state: immer_dist_internal.WritableDraft<EditorsState>, action: PayloadAction<{
|
|
275
|
+
uniqid: string;
|
|
276
|
+
view: any;
|
|
277
|
+
}>) => void;
|
|
278
|
+
flushEditorPopup: (state: immer_dist_internal.WritableDraft<EditorsState>, action: PayloadAction<{
|
|
279
|
+
uniqid: string;
|
|
280
|
+
}>) => void;
|
|
281
|
+
setEditorPosition: (state: immer_dist_internal.WritableDraft<EditorsState>, action: PayloadAction<{
|
|
282
|
+
uniqid: string;
|
|
283
|
+
position: 'left' | 'right';
|
|
284
|
+
}>) => void;
|
|
285
|
+
updateEditor: (state: immer_dist_internal.WritableDraft<EditorsState>, action: PayloadAction<{
|
|
286
|
+
uniqid: string;
|
|
287
|
+
content: Record<string, unknown>;
|
|
288
|
+
}>) => void;
|
|
289
|
+
flushEditor: (state: immer_dist_internal.WritableDraft<EditorsState>, action: PayloadAction<{
|
|
290
|
+
uniqid: string;
|
|
291
|
+
}>) => void;
|
|
292
|
+
}, "editors">;
|
|
293
|
+
selectors: {
|
|
294
|
+
selectEditors: (state: EditorsRootState) => EditorProps[];
|
|
295
|
+
selectEditor: (state: EditorsRootState, uniqid: string) => EditorProps | undefined;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
|
|
166
299
|
type ModelRootState = {
|
|
167
300
|
entities: {
|
|
168
301
|
models: EntityState<Model$1>;
|
|
@@ -431,4 +564,4 @@ declare const UserCurrent: {
|
|
|
431
564
|
};
|
|
432
565
|
};
|
|
433
566
|
|
|
434
|
-
export { Application, ApplicationRootState, AssetReservation, AssetReservationRootState, JLandMapFront, JLandRootState, JLandState, MapCreationFront, Model, ModelRootState, ReservationForm, RootDispatch, RootState, ThunkApiConfig, Toast, ToastRootState, UserCurrent, UserCurrentRootState, actions, jland, slice };
|
|
567
|
+
export { Application, ApplicationRootState, AssetReservation, AssetReservationRootState, EditorProps, EditorsRootState, EditorsState, JLandMapFront, JLandRootState, JLandState, MODE_EDIT, MODE_VIEW, MapCreationFront, Model, ModelRootState, ReservationForm, RootDispatch, RootState, ThunkApiConfig, Toast, ToastRootState, UserCurrent, UserCurrentRootState, Widget, WidgetEditor, WidgetModalProps, WidgetsRootState, WidgetsState, actions, jland, slice };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-front-business",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "typescript utils",
|
|
5
5
|
"main": "dist/cjs.js",
|
|
6
6
|
"module": "dist/esm.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@reduxjs/toolkit": "1.9.0",
|
|
48
|
-
"jamespot-user-api": "^1.0.
|
|
48
|
+
"jamespot-user-api": "^1.0.97",
|
|
49
49
|
"react-redux": "7.2.9",
|
|
50
50
|
"redux": "4.2.0"
|
|
51
51
|
}
|