jamespot-react-core 1.1.193 → 1.1.194

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,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { TwoColLayoutProps } from './types';
3
- export declare function TwoColLayout({ extensionRoute, routes, description, mode }: TwoColLayoutProps): React.JSX.Element;
3
+ export declare function TwoColLayout({ extensionRoute, routes, description, mode, mainColumnProps }: TwoColLayoutProps): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  export type { ExtensionProviderProps } from './ExtensionProvider.component';
2
2
  export type { IfAppIsActivatedProps } from './IfAppIsActivated.component';
3
3
  export type { RTProviderProps } from './RTProvider.component';
4
- import type { JRCAppColumnProps, LayoutMode } from 'jamespot-react-components';
4
+ import type { JRCAppColumnProps, JRCMainColumnProps, LayoutMode } from 'jamespot-react-components';
5
5
  export type TwoColLayoutRoute = {
6
6
  path: string;
7
7
  paths?: string[];
@@ -17,4 +17,5 @@ export type TwoColLayoutProps = {
17
17
  routes: TwoColLayoutRoutes;
18
18
  mode?: LayoutMode;
19
19
  description: JRCAppColumnProps['description'];
20
+ mainColumnProps?: Partial<Omit<JRCMainColumnProps, 'children'>>;
20
21
  };
@@ -1,6 +1,7 @@
1
1
  import { DisplayFormFieldsConfig, DisplayFormRef } from './types';
2
- import { Control, FieldValues } from 'react-hook-form';
2
+ import { useForm, Control, FieldValues } from 'react-hook-form';
3
3
  import React, { ForwardedRef, ReactNode } from 'react';
4
+ type FormFn<TFieldValues extends FieldValues> = Omit<ReturnType<typeof useForm<TFieldValues>>, 'handleSubmit' | 'control' | 'reset'>;
4
5
  export type DisplayFormProps<TFieldValues extends FieldValues> = {
5
6
  type: string;
6
7
  fields: DisplayFormFieldsConfig<TFieldValues>;
@@ -13,6 +14,7 @@ export type DisplayFormProps<TFieldValues extends FieldValues> = {
13
14
  stretch?: boolean;
14
15
  children?: ReactNode;
15
16
  forceMandatory?: boolean;
17
+ onInit?: (formFn: FormFn<TFieldValues>) => void;
16
18
  };
17
19
  /****
18
20
  * The jamespot model depend on the platform
@@ -21,7 +23,7 @@ export type DisplayFormProps<TFieldValues extends FieldValues> = {
21
23
  *
22
24
  * This component display an array of attributes only if this attribute is activated on the platform
23
25
  */
24
- declare const _DisplayForm: <TFieldValues extends FieldValues>(props: DisplayFormProps<TFieldValues>, ref: ForwardedRef<DisplayFormRef>) => React.JSX.Element;
26
+ declare const _DisplayForm: <TFieldValues extends FieldValues>({ onInit, ...props }: DisplayFormProps<TFieldValues>, ref: ForwardedRef<DisplayFormRef>) => React.JSX.Element;
25
27
  export declare const DisplayForm: <TFieldValues extends FieldValues>(props: DisplayFormProps<TFieldValues> & {
26
28
  ref?: React.ForwardedRef<DisplayFormRef> | undefined;
27
29
  }) => ReturnType<typeof _DisplayForm>;
@@ -4,6 +4,8 @@ import { WidgetOption } from '../displayer.utils';
4
4
  export declare function DisplayDate({ object, attribute }: RenderAttributeProps): React.JSX.Element | null;
5
5
  export declare function DisplayDefault({ object, attribute }: RenderAttributeProps): React.JSX.Element | null;
6
6
  export declare function DisplayEmail({ object, attribute }: RenderAttributeProps): React.JSX.Element | null;
7
+ export declare function DisplayFile({ object, attribute }: RenderAttributeProps): React.JSX.Element | null;
8
+ export declare function DisplayImage({ object, attribute }: RenderAttributeProps): React.JSX.Element | null;
7
9
  export declare const DisplayRadio: (options: WidgetOption[]) => ({ object, attribute }: RenderAttributeProps) => React.JSX.Element | null;
8
10
  export declare function DisplayRichText({ object, attribute }: RenderAttributeProps): React.JSX.Element | null;
9
11
  export declare function DisplayTag({ object, attribute }: RenderAttributeProps): React.JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import { DisplayInputComponentProps } from '../../types';
3
+ import type { FieldValues } from 'react-hook-form';
4
+ export declare const InputFile: <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DisplayInputComponentProps } from '../../types';
3
+ import type { FieldValues } from 'react-hook-form';
4
+ export declare const InputImage: <TFieldValues extends FieldValues>(props: DisplayInputComponentProps<TFieldValues>) => React.JSX.Element;
@@ -96,6 +96,11 @@ export declare const InputTaxonomy: <TFieldValues extends FieldValues>(widget: W
96
96
  type: "link";
97
97
  } | {
98
98
  type: "file";
99
+ } | {
100
+ type: "image";
101
+ params?: {
102
+ avatar?: boolean | undefined;
103
+ } | undefined;
99
104
  } | {
100
105
  type: "audience";
101
106
  options?: {
@@ -6,6 +6,8 @@ export declare function formatCheckbox<TFieldValues extends FieldValues, Propert
6
6
  export declare function formatDate<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
7
7
  export declare function formatDefault<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
8
8
  export declare function formatEmail<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
9
+ export declare function formatFile<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
10
+ export declare function formatImage<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
9
11
  export declare function formatNumber<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
10
12
  export declare function formatOrientedlinks<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
11
13
  export declare function formatRadio<TFieldValues extends FieldValues, Properties extends FieldPath<TFieldValues>>(configuration: FieldConfiguration<Properties>): DisplayerElement<TFieldValues>;
@@ -4,11 +4,12 @@ import type { NameControl } from 'jamespot-react-components';
4
4
  import { UseFormReturn } from 'react-hook-form';
5
5
  import { FunctionComponent, ReactNode } from 'react';
6
6
  export type IncludeCustom = {
7
- includes: 'tags';
7
+ includes: 'tags' | '_attachedFiles';
8
8
  };
9
9
  export type FieldConfig = {
10
10
  disableSortBy?: boolean;
11
11
  };
12
+ export type FieldConfigExtra = Omit<DisplayerElementAttributes, 'name'>;
12
13
  export declare const CONFIGURABLE_FIELDS_NAMES: string[];
13
14
  export type ConfigurableFieldName = (typeof CONFIGURABLE_FIELDS_NAMES)[number];
14
15
  export type ConfigurableField<N extends ConfigurableFieldName, T extends object> = {
@@ -20,7 +21,11 @@ export type ConfigurableAudience = ConfigurableField<'publishTo', {
20
21
  }>;
21
22
  export type ConfigurableFields = ConfigurableAudience;
22
23
  export declare const ensureConfigurableField: (field: unknown) => field is ConfigurableAudience;
23
- export type Field<TFieldValues extends FieldValues = FieldValues> = string | {
24
+ export type FieldExtra = {
25
+ name: string;
26
+ extra: FieldConfigExtra;
27
+ };
28
+ export type Field<TFieldValues extends FieldValues = FieldValues> = string | FieldExtra | {
24
29
  name: string;
25
30
  componentsOverride: Partial<DisplayElementComponent<TFieldValues>>;
26
31
  config?: FieldConfig;
@@ -31,7 +36,7 @@ export type FieldWith<With extends 'input' | 'render', TFieldValues extends Fiel
31
36
  } & {
32
37
  name: string;
33
38
  config?: FieldConfig;
34
- }) | IncludeCustom | ConfigurableFields;
39
+ }) | FieldExtra | IncludeCustom | ConfigurableFields;
35
40
  export type FieldsWith<With extends 'input' | 'render', TFieldValues extends FieldValues = FieldValues> = Array<FieldWith<With, TFieldValues>>;
36
41
  export type RenderAttributeProps = {
37
42
  object: any;
@@ -52,6 +57,7 @@ export type DisplayElementComponent<TFieldValues extends FieldValues = FieldValu
52
57
  render: FunctionComponent<RenderAttributeProps>;
53
58
  input: FunctionComponent<DisplayInputComponentProps<TFieldValues>>;
54
59
  search: FunctionComponent<DisplayInputComponentProps<TFieldValues>>;
60
+ extra?: FieldConfigExtra;
55
61
  };
56
62
  export type DisplayerElementAttributes = {
57
63
  name: string;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Reducer } from '@reduxjs/toolkit';
3
- import { Application, Comment, Hook, Model, Share, studio, TVDisplay, UserCurrent, WedocApp, Bookmark, MediaLibrary, MagicPad, jland, Faq, AssetReservation, Animations, AdminLogs, Widget, WidgetEditor, ContentReport } from 'jamespot-front-business';
3
+ import { Application, Comment, ExtraBot, Hook, Model, Share, studio, TVDisplay, UserCurrent, WedocApp, Bookmark, MediaLibrary, MagicPad, jland, Faq, AssetReservation, Animations, AdminLogs, Widget, WidgetEditor, ContentReport } from 'jamespot-front-business';
4
4
  import { ApplicationType, HookListType, jUserList, Model as ModelType, NetworkType, TinyMCECommonOptions, TinyMCEExtendedOptions } from 'jamespot-user-api';
5
5
  import { ArticleActionsType, ArticleSelectorType } from './slice/Article.slice';
6
6
  import { GenericActionsType } from './slice/Generic.actions';
@@ -33,6 +33,7 @@ export type AsyncReducers = {
33
33
  [AssetReservation.slice.name]: typeof AssetReservation.slice.reducer;
34
34
  [Bookmark.slice.name]: typeof Bookmark.slice.reducer;
35
35
  [Comment.slice.name]: typeof Comment.slice.reducer;
36
+ [ExtraBot.slice.name]: typeof ExtraBot.slice.reducer;
36
37
  [ContentReport.slice.name]: typeof ContentReport.slice.reducer;
37
38
  [Faq.slice.name]: typeof Faq.slice.reducer;
38
39
  [MagicPad.slice.name]: typeof MagicPad.slice.reducer;
@@ -378,6 +379,7 @@ declare function createStore(initialAsyncReducers: AsyncReducers): import("@redu
378
379
  bookmarkList: import("jamespot-front-business").bookmarkListState;
379
380
  bookmarkEdit: import("jamespot-front-business").bookmarkEditState;
380
381
  }>;
382
+ extraBot: import("jamespot-front-business").ExtraBotState;
381
383
  contentReport: import("jamespot-front-business").ContentReportSliceRootState;
382
384
  faq: import("redux").CombinedState<{
383
385
  config: {
@@ -441,11 +443,11 @@ declare function createStore(initialAsyncReducers: AsyncReducers): import("@redu
441
443
  dateModified?: string | null | undefined;
442
444
  folderColor?: string | undefined;
443
445
  })[];
444
- description?: string | null | undefined;
445
446
  image?: {
446
447
  width: number;
447
448
  height: number;
448
449
  } | undefined;
450
+ description?: string | null | undefined;
449
451
  articleWidgets?: import("jamespot-user-api").WidgetWrapperGeneric<({
450
452
  layers?: string[] | undefined;
451
453
  } & import("jamespot-user-api").WidgetArticleAttachmentType) | ({
@@ -1297,6 +1299,7 @@ declare function createStore(initialAsyncReducers: AsyncReducers): import("@redu
1297
1299
  bookmarkList: import("jamespot-front-business").bookmarkListState;
1298
1300
  bookmarkEdit: import("jamespot-front-business").bookmarkEditState;
1299
1301
  }>;
1302
+ extraBot: import("jamespot-front-business").ExtraBotState;
1300
1303
  contentReport: import("jamespot-front-business").ContentReportSliceRootState;
1301
1304
  faq: import("redux").CombinedState<{
1302
1305
  config: {
@@ -1360,11 +1363,11 @@ declare function createStore(initialAsyncReducers: AsyncReducers): import("@redu
1360
1363
  dateModified?: string | null | undefined;
1361
1364
  folderColor?: string | undefined;
1362
1365
  })[];
1363
- description?: string | null | undefined;
1364
1366
  image?: {
1365
1367
  width: number;
1366
1368
  height: number;
1367
1369
  } | undefined;
1370
+ description?: string | null | undefined;
1368
1371
  articleWidgets?: import("jamespot-user-api").WidgetWrapperGeneric<({
1369
1372
  layers?: string[] | undefined;
1370
1373
  } & import("jamespot-user-api").WidgetArticleAttachmentType) | ({
@@ -2221,6 +2224,7 @@ export declare const useAppDispatch: () => import("@reduxjs/toolkit").ThunkDispa
2221
2224
  bookmarkList: import("jamespot-front-business").bookmarkListState;
2222
2225
  bookmarkEdit: import("jamespot-front-business").bookmarkEditState;
2223
2226
  }>;
2227
+ extraBot: import("jamespot-front-business").ExtraBotState;
2224
2228
  contentReport: import("jamespot-front-business").ContentReportSliceRootState;
2225
2229
  faq: import("redux").CombinedState<{
2226
2230
  config: {
@@ -2284,11 +2288,11 @@ export declare const useAppDispatch: () => import("@reduxjs/toolkit").ThunkDispa
2284
2288
  dateModified?: string | null | undefined;
2285
2289
  folderColor?: string | undefined;
2286
2290
  })[];
2287
- description?: string | null | undefined;
2288
2291
  image?: {
2289
2292
  width: number;
2290
2293
  height: number;
2291
2294
  } | undefined;
2295
+ description?: string | null | undefined;
2292
2296
  articleWidgets?: import("jamespot-user-api").WidgetWrapperGeneric<({
2293
2297
  layers?: string[] | undefined;
2294
2298
  } & import("jamespot-user-api").WidgetArticleAttachmentType) | ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-core",
3
- "version": "1.1.193",
3
+ "version": "1.1.194",
4
4
  "description": "Jamespot React Core",
5
5
  "main": "./build/app.bundle.js",
6
6
  "types": "./build/src/App.d.ts",
@@ -56,9 +56,9 @@
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.89",
60
- "jamespot-react-components": "^1.0.243",
61
- "jamespot-user-api": "^1.0.217",
59
+ "jamespot-front-business": "^1.1.90",
60
+ "jamespot-react-components": "^1.0.244",
61
+ "jamespot-user-api": "^1.0.218",
62
62
  "marked": "^15.0.3",
63
63
  "react": "^17.0.2",
64
64
  "react-dom": "17.0.2",