@uniformdev/canvas-next 18.12.1-alpha.0 → 18.12.1-alpha.18

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.
@@ -3,7 +3,7 @@ import { ParsedUrlQuery } from 'querystring';
3
3
  import { c as UniformGetServerSideProps, b as UniformGetStaticProps, a as UniformPreviewData } from '../models-6ff72d91.js';
4
4
  import * as next from 'next';
5
5
  import { GetServerSideProps, GetStaticProps } from 'next';
6
- import * as _uniformdev_canvas_dist_createEventBus_60ff8dc4 from '@uniformdev/canvas/dist/createEventBus-60ff8dc4';
6
+ import * as _uniformdev_canvas_dist_createEventBus_db3535cb from '@uniformdev/canvas/dist/createEventBus-db3535cb';
7
7
  import { CanvasClient, DataResolutionOptionNegative } from '@uniformdev/canvas';
8
8
  import { ProjectMapNodeGetResponse, ProjectMapClient } from '@uniformdev/project-map';
9
9
  import '@uniformdev/canvas-react';
@@ -28,7 +28,7 @@ declare const withUniformGetServerSideProps: <TProps extends {
28
28
  withComponentIDs?: boolean | undefined;
29
29
  withTotalCount?: boolean | undefined;
30
30
  withUIStatus?: boolean | undefined;
31
- } & Required<Pick<_uniformdev_canvas_dist_createEventBus_60ff8dc4.C, "projectMapId" | "projectMapNodePath">> & DataResolutionOptionNegative> | undefined;
31
+ } & Required<Pick<_uniformdev_canvas_dist_createEventBus_db3535cb.C, "projectMapNodePath">> & _uniformdev_canvas_dist_createEventBus_db3535cb.ai & DataResolutionOptionNegative> | undefined;
32
32
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
33
33
  callback?: UniformGetServerSideProps<TProps, querystring.ParsedUrlQuery, next.PreviewData> | undefined;
34
34
  } | undefined) => GetServerSideProps<TProps, querystring.ParsedUrlQuery, next.PreviewData>;
@@ -43,7 +43,7 @@ declare const withUniformGetStaticPaths: (options?: {
43
43
  preview?: boolean | undefined;
44
44
  /** Way to override getNodes request params */
45
45
  requestOptions?: Partial<{
46
- projectMapId: string;
46
+ projectMapId?: string | undefined;
47
47
  projectId: string;
48
48
  id?: string | undefined;
49
49
  path?: string | undefined;
@@ -89,7 +89,7 @@ declare const withUniformGetStaticProps: <TProps extends {
89
89
  withComponentIDs?: boolean | undefined;
90
90
  withTotalCount?: boolean | undefined;
91
91
  withUIStatus?: boolean | undefined;
92
- } & Required<Pick<_uniformdev_canvas_dist_createEventBus_60ff8dc4.C, "projectMapId" | "projectMapNodePath">> & DataResolutionOptionNegative> | undefined;
92
+ } & Required<Pick<_uniformdev_canvas_dist_createEventBus_db3535cb.C, "projectMapNodePath">> & _uniformdev_canvas_dist_createEventBus_db3535cb.ai & DataResolutionOptionNegative> | undefined;
93
93
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
94
94
  callback?: UniformGetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData> | undefined;
95
95
  }) => GetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData>;
@@ -41,11 +41,6 @@ var withUniformGetServerSideProps = (options) => {
41
41
  throw new Error("UNIFORM_PROJECT_ID is not defined.");
42
42
  }
43
43
  const projectMapId = (_a = options == null ? void 0 : options.projectMapId) != null ? _a : process.env.UNIFORM_PROJECT_MAP_ID;
44
- if (!projectMapId) {
45
- throw new Error(
46
- "UNIFORM_PROJECT_MAP_ID is not defined or override not provided to withUniformGetServerSideProps."
47
- );
48
- }
49
44
  const canvasClient = (options == null ? void 0 : options.client) || new import_canvas.CanvasClient({
50
45
  apiKey: process.env.UNIFORM_API_KEY,
51
46
  projectId: process.env.UNIFORM_PROJECT_ID,
@@ -54,7 +49,7 @@ var withUniformGetServerSideProps = (options) => {
54
49
  const preview = context.preview || (options == null ? void 0 : options.preview);
55
50
  let composition = void 0;
56
51
  try {
57
- const response = await canvasClient.unstable_getCompositionByNodePath({
52
+ const response = await canvasClient.getCompositionByNodePath({
58
53
  ...options == null ? void 0 : options.requestOptions,
59
54
  projectMapId,
60
55
  projectMapNodePath: (options == null ? void 0 : options.prefix) ? context.resolvedUrl.replace(new RegExp(`^${options.prefix}`), "") : context.resolvedUrl,
@@ -142,11 +137,6 @@ var withUniformGetStaticProps = (options) => {
142
137
  throw new Error("UNIFORM_PROJECT_ID is not defined.");
143
138
  }
144
139
  const projectMapId = (_a = options == null ? void 0 : options.projectMapId) != null ? _a : process.env.UNIFORM_PROJECT_MAP_ID;
145
- if (!projectMapId) {
146
- throw new Error(
147
- "UNIFORM_PROJECT_MAP_ID is not defined or override not provided to withUniformGetStaticProps."
148
- );
149
- }
150
140
  const pathString = resolveSlugFromParams({
151
141
  param: options == null ? void 0 : options.param,
152
142
  params: context == null ? void 0 : context.params,
@@ -160,7 +150,7 @@ var withUniformGetStaticProps = (options) => {
160
150
  const { preview, previewData } = context;
161
151
  let composition = void 0;
162
152
  try {
163
- const response = await canvasClient.unstable_getCompositionByNodePath({
153
+ const response = await canvasClient.getCompositionByNodePath({
164
154
  ...options == null ? void 0 : options.requestOptions,
165
155
  projectMapId,
166
156
  projectMapNodePath: pathString,
@@ -18,11 +18,6 @@ var withUniformGetServerSideProps = (options) => {
18
18
  throw new Error("UNIFORM_PROJECT_ID is not defined.");
19
19
  }
20
20
  const projectMapId = (_a = options == null ? void 0 : options.projectMapId) != null ? _a : process.env.UNIFORM_PROJECT_MAP_ID;
21
- if (!projectMapId) {
22
- throw new Error(
23
- "UNIFORM_PROJECT_MAP_ID is not defined or override not provided to withUniformGetServerSideProps."
24
- );
25
- }
26
21
  const canvasClient = (options == null ? void 0 : options.client) || new CanvasClient({
27
22
  apiKey: process.env.UNIFORM_API_KEY,
28
23
  projectId: process.env.UNIFORM_PROJECT_ID,
@@ -31,7 +26,7 @@ var withUniformGetServerSideProps = (options) => {
31
26
  const preview = context.preview || (options == null ? void 0 : options.preview);
32
27
  let composition = void 0;
33
28
  try {
34
- const response = await canvasClient.unstable_getCompositionByNodePath({
29
+ const response = await canvasClient.getCompositionByNodePath({
35
30
  ...options == null ? void 0 : options.requestOptions,
36
31
  projectMapId,
37
32
  projectMapNodePath: (options == null ? void 0 : options.prefix) ? context.resolvedUrl.replace(new RegExp(`^${options.prefix}`), "") : context.resolvedUrl,
@@ -112,11 +107,6 @@ var withUniformGetStaticProps = (options) => {
112
107
  throw new Error("UNIFORM_PROJECT_ID is not defined.");
113
108
  }
114
109
  const projectMapId = (_a = options == null ? void 0 : options.projectMapId) != null ? _a : process.env.UNIFORM_PROJECT_MAP_ID;
115
- if (!projectMapId) {
116
- throw new Error(
117
- "UNIFORM_PROJECT_MAP_ID is not defined or override not provided to withUniformGetStaticProps."
118
- );
119
- }
120
110
  const pathString = resolveSlugFromParams({
121
111
  param: options == null ? void 0 : options.param,
122
112
  params: context == null ? void 0 : context.params,
@@ -130,7 +120,7 @@ var withUniformGetStaticProps = (options) => {
130
120
  const { preview, previewData } = context;
131
121
  let composition = void 0;
132
122
  try {
133
- const response = await canvasClient.unstable_getCompositionByNodePath({
123
+ const response = await canvasClient.getCompositionByNodePath({
134
124
  ...options == null ? void 0 : options.requestOptions,
135
125
  projectMapId,
136
126
  projectMapNodePath: pathString,
@@ -3,7 +3,7 @@ import { GetServerSideProps, GetStaticProps } from 'next';
3
3
  import * as querystring from 'querystring';
4
4
  import { ParsedUrlQuery } from 'querystring';
5
5
  import { c as UniformGetServerSideProps, a as UniformPreviewData, b as UniformGetStaticProps } from '../models-6ff72d91.js';
6
- import * as _uniformdev_canvas_dist_createEventBus_60ff8dc4 from '@uniformdev/canvas/dist/createEventBus-60ff8dc4';
6
+ import * as _uniformdev_canvas_dist_createEventBus_db3535cb from '@uniformdev/canvas/dist/createEventBus-db3535cb';
7
7
  import { CanvasClient, DataResolutionOptionNegative, CompositionGetParameters, CompositionGetResponse } from '@uniformdev/canvas';
8
8
  import '@uniformdev/canvas-react';
9
9
 
@@ -23,7 +23,7 @@ declare const withUniformGetServerSideProps: <TProps extends {
23
23
  withComponentIDs?: boolean | undefined;
24
24
  withTotalCount?: boolean | undefined;
25
25
  withUIStatus?: boolean | undefined;
26
- } & Required<Pick<_uniformdev_canvas_dist_createEventBus_60ff8dc4.C, "slug">> & DataResolutionOptionNegative> | undefined;
26
+ } & Required<Pick<_uniformdev_canvas_dist_createEventBus_db3535cb.C, "slug">> & DataResolutionOptionNegative> | undefined;
27
27
  callback?: UniformGetServerSideProps<TProps, ParsedUrlQuery, next.PreviewData> | undefined;
28
28
  } | undefined) => GetServerSideProps<TProps, ParsedUrlQuery, UniformPreviewData>;
29
29
 
@@ -65,7 +65,7 @@ declare const withUniformGetStaticProps: <TProps extends {
65
65
  withComponentIDs?: boolean | undefined;
66
66
  withTotalCount?: boolean | undefined;
67
67
  withUIStatus?: boolean | undefined;
68
- } & Required<Pick<_uniformdev_canvas_dist_createEventBus_60ff8dc4.C, "slug">> & DataResolutionOptionNegative> | undefined;
68
+ } & Required<Pick<_uniformdev_canvas_dist_createEventBus_db3535cb.C, "slug">> & DataResolutionOptionNegative> | undefined;
69
69
  /** Custom handler to specify return value and modify composition - e.g. enhance with CMS data */
70
70
  callback?: UniformGetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData> | undefined;
71
71
  }) => GetStaticProps<TProps, ParsedUrlQuery, UniformPreviewData>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next",
3
- "version": "18.12.1-alpha.0+3a6dfdc17",
3
+ "version": "18.12.1-alpha.18+19edda8b5",
4
4
  "description": "Next.js SDK for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -52,9 +52,9 @@
52
52
  "format": "prettier --write \"src/**/*.{js,ts,tsx}\""
53
53
  },
54
54
  "dependencies": {
55
- "@uniformdev/canvas": "18.12.1-alpha.0+3a6dfdc17",
56
- "@uniformdev/canvas-react": "18.12.1-alpha.0+3a6dfdc17",
57
- "@uniformdev/project-map": "18.12.1-alpha.0+3a6dfdc17"
55
+ "@uniformdev/canvas": "18.12.1-alpha.18+19edda8b5",
56
+ "@uniformdev/canvas-react": "18.12.1-alpha.18+19edda8b5",
57
+ "@uniformdev/project-map": "18.12.1-alpha.18+19edda8b5"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "next": ">= 12.0.0",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "3a6dfdc173e0a04e23441bf0dc3903d3420e271c"
76
+ "gitHead": "19edda8b549122f979543430d69de751df221ccf"
77
77
  }