@zengenti/contensis-react-base 3.2.2-beta.8 → 3.2.2

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.
@@ -5,25 +5,85 @@ import { RouteComponent } from './RouteComponent';
5
5
  import { RouteComponentProps } from './RouteComponentProps';
6
6
  import { RequireLogin } from './RequireLogin';
7
7
  export type ContentTypeMapping = {
8
+ /** The unique identifier for the content type to map. */
8
9
  contentTypeID: string;
10
+ /**
11
+ * The React component that should be rendered for this content type.
12
+ */
9
13
  component: RouteComponent<RouteComponentProps>;
14
+ /**
15
+ * Optional entry mapper to transform entry data before passing it to the component.
16
+ */
10
17
  entryMapper?: EntryMapper;
18
+ /**
19
+ * An array of field IDs used to restrict the fields returned for an entry.
20
+ */
11
21
  fields?: string[];
22
+ /**
23
+ * Injects Redux dependencies or actions into the route if needed.
24
+ */
12
25
  injectRedux?: ReduxInjector;
26
+ /**
27
+ * The depth at which to resolve the full entry data for a linked entry or asset.
28
+ * Maximum depth is 10, with a recommended maximum of 4.
29
+ *
30
+ * A default depth of 2 is applied via `routeLoadOptions` in `onRouteLoad`.
31
+ */
13
32
  linkDepth?: number;
33
+ /**
34
+ * Custom link depths for specific field paths to resolve full entry data for a linked entry or asset.
35
+ * Maximum depth is 10, with a recommended maximum of 4.
36
+ *
37
+ * This option is available only in Contensis version 16+.
38
+ */
14
39
  fieldLinkDepths?: FieldLinkDepths;
40
+ /**
41
+ * Options for configuring how Site View Node data is handled, including children and siblings.
42
+ */
15
43
  nodeOptions?: {
16
44
  children?: {
45
+ /** The depth of descendants to include for the node. */
17
46
  depth: number;
47
+ /**
48
+ * An array of field IDs used to restrict the fields returned for each entry.
49
+ */
18
50
  fields?: string[];
51
+ /**
52
+ * The depth at which to resolve the full entry data for a linked entry or asset.
53
+ * Maximum depth is 10, with a recommended maximum of 4.
54
+ *
55
+ * A default depth of 2 is applied via `routeLoadOptions` in `onRouteLoad`.
56
+ */
19
57
  linkDepth?: number;
58
+ /**
59
+ * Custom link depths for specific field paths to resolve full entry data for a linked entry or asset.
60
+ * Maximum depth is 10, with a recommended maximum of 4.
61
+ *
62
+ * This option is available only in Contensis version 16+.
63
+ */
20
64
  fieldLinkDepths?: FieldLinkDepths;
21
65
  } | boolean;
22
66
  siblings?: {
67
+ /** The depth of descendants to include for the node. */
23
68
  fields?: string[];
69
+ /**
70
+ * The depth at which to resolve the full entry data for a linked entry or asset.
71
+ * Maximum depth is 10, with a recommended maximum of 4.
72
+ *
73
+ * A default depth of 2 is applied via `routeLoadOptions` in `onRouteLoad`.
74
+ */
24
75
  linkDepth?: number;
76
+ /**
77
+ * Custom link depths for specific field paths to resolve full entry data for a linked entry or asset.
78
+ * Maximum depth is 10, with a recommended maximum of 4.
79
+ *
80
+ * This option is available only in Contensis version 16+.
81
+ */
25
82
  fieldLinkDepths?: FieldLinkDepths;
26
83
  } | boolean;
27
84
  };
85
+ /**
86
+ * Specifies whether login is required to access the content for this type.
87
+ */
28
88
  requireLogin?: RequireLogin;
29
89
  };
@@ -6,7 +6,13 @@ import { ReduxInjector } from './ReduxInjector';
6
6
  import { RequireLogin } from './RequireLogin';
7
7
  import { RouteConfig } from 'react-router-config';
8
8
  export type StaticRoute = Omit<RouteConfig, 'component'> & {
9
+ /**
10
+ * The React component that should be rendered for this route.
11
+ */
9
12
  component: RouteComponent<RouteComponentProps>;
13
+ /**
14
+ * Options for configuring how Site View Node data is handled.
15
+ */
10
16
  fetchNode?: boolean | {
11
17
  /**
12
18
  * Params[] allows you pass parameters into the site view query on your static node fetch
@@ -15,13 +21,36 @@ export type StaticRoute = Omit<RouteConfig, 'component'> & {
15
21
  * e.g `{` author: 'jane-doe' }`, your path would become `/authors/jane-doe`
16
22
  */
17
23
  params?: string[];
24
+ /**
25
+ * The depth at which to resolve the full entry data for a linked entry or asset.
26
+ * Maximum depth is 10, with a recommended maximum of 4.
27
+ *
28
+ * A default depth of 2 is applied via `routeLoadOptions` in `onRouteLoad`.
29
+ */
18
30
  linkDepth?: number;
31
+ /**
32
+ * Custom link depths for specific field paths to resolve full entry data for a linked entry or asset.
33
+ * Maximum depth is 10, with a recommended maximum of 4.
34
+ *
35
+ * This option is available only in Contensis version 16+.
36
+ */
19
37
  fieldLinkDepths?: FieldLinkDepths;
38
+ /** The depth of descendants to include for the node. */
20
39
  fields?: string[];
40
+ /**
41
+ * Optional entry mapper to transform entry data before passing it to the component.
42
+ */
21
43
  entryMapper?: EntryMapper;
22
44
  };
45
+ /** The depth of descendants to include for the node. */
23
46
  fetchNodeLevel?: number;
47
+ /**
48
+ * Injects Redux dependencies or actions into the route if needed.
49
+ */
24
50
  injectRedux?: ReduxInjector;
51
+ /**
52
+ * Specifies whether login is required to access the content for this type.
53
+ */
25
54
  requireLogin?: RequireLogin;
26
55
  ssr?: boolean;
27
56
  ssrOnly?: boolean;
@@ -6,7 +6,15 @@ export type OnRouteLoadArgs = Omit<GetRouteActionArgs, 'withEvents'>;
6
6
  export type OnRouteLoadedArgs = OnRouteLoadArgs & {
7
7
  entry?: Entry | any;
8
8
  };
9
+ /**
10
+ * Configuration options to customize the app state during route changes.
11
+ * These options are evaluated on each route action, establishing the "default" behavior.
12
+ */
9
13
  export type RouteLoadOptions = {
14
+ /**
15
+ * Determines whether to query related Site View Nodes by default during routing.
16
+ * Allows specifying the depth of query for ancestors, children, siblings, and the entire tree structure.
17
+ */
10
18
  customNavigation?: boolean | {
11
19
  ancestors: boolean | number;
12
20
  children: boolean | number;
@@ -14,9 +22,30 @@ export type RouteLoadOptions = {
14
22
  tree: boolean | number;
15
23
  };
16
24
  customRouting?: boolean;
25
+ /**
26
+ * Sets the default language for the Site View during route changes.
27
+ *
28
+ * @default 'en-GB'
29
+ */
17
30
  defaultLang?: string;
31
+ /**
32
+ * Defines the default depth for resolving full entry data for a linked entry or asset during route changes.
33
+ * Maximum depth is 10, with a recommended maximum of 4.
34
+ *
35
+ * @default 2
36
+ */
18
37
  entryLinkDepth?: number;
38
+ /**
39
+ * Specifies custom depths for resolving full entry data for specific field paths in linked entries or assets during route changes.
40
+ * Maximum depth is 10, with a recommended maximum of 4.
41
+
42
+ *
43
+ * Available only in Contensis version 16+.
44
+ */
19
45
  entryFieldLinkDepths?: FieldLinkDepths;
46
+ /**
47
+ * Disables the automatic scroll-to-top behavior when navigating to a new route.
48
+ */
20
49
  preventScrollTop?: boolean;
21
50
  refetchNode?: true;
22
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zengenti/contensis-react-base",
3
- "version": "3.2.2-beta.8",
3
+ "version": "3.2.2",
4
4
  "repository": "https://github.com/zengenti/contensis-react-base",
5
5
  "license": "None",
6
6
  "description": "Turbocharge your React web apps with Contensis. This package handles all dependencies for creating full featured web apps in React with Contensis and Site View. Routing is driven by Site View, Redux is used for global state management and server-side rendering (SSR) is handled for you. Also taking care of intricate hosting issues such as cache invalidation and supporting authenticated content where required.",