@uniformdev/canvas-next 18.12.1-alpha.2 → 18.13.1-alpha.1
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/project-map/index.d.ts +4 -4
- package/dist/project-map/index.js +2 -35
- package/dist/project-map/index.mjs +2 -35
- package/dist/slug/index.d.ts +3 -3
- package/dist/slug/index.js +0 -18
- package/dist/slug/index.mjs +0 -18
- package/package.json +5 -5
|
@@ -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
|
|
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<
|
|
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
|
|
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<
|
|
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>;
|
|
@@ -34,18 +34,7 @@ var import_canvas = require("@uniformdev/canvas");
|
|
|
34
34
|
var withUniformGetServerSideProps = (options) => {
|
|
35
35
|
return async function wrappedGetServerSideProps(context) {
|
|
36
36
|
var _a;
|
|
37
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
38
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
39
|
-
}
|
|
40
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
41
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
42
|
-
}
|
|
43
37
|
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
38
|
const canvasClient = (options == null ? void 0 : options.client) || new import_canvas.CanvasClient({
|
|
50
39
|
apiKey: process.env.UNIFORM_API_KEY,
|
|
51
40
|
projectId: process.env.UNIFORM_PROJECT_ID,
|
|
@@ -54,7 +43,7 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
54
43
|
const preview = context.preview || (options == null ? void 0 : options.preview);
|
|
55
44
|
let composition = void 0;
|
|
56
45
|
try {
|
|
57
|
-
const response = await canvasClient.
|
|
46
|
+
const response = await canvasClient.getCompositionByNodePath({
|
|
58
47
|
...options == null ? void 0 : options.requestOptions,
|
|
59
48
|
projectMapId,
|
|
60
49
|
projectMapNodePath: (options == null ? void 0 : options.prefix) ? context.resolvedUrl.replace(new RegExp(`^${options.prefix}`), "") : context.resolvedUrl,
|
|
@@ -82,18 +71,7 @@ var import_project_map = require("@uniformdev/project-map");
|
|
|
82
71
|
var withUniformGetStaticPaths = (options) => {
|
|
83
72
|
return async function wrappedGetStaticPaths() {
|
|
84
73
|
var _a, _b;
|
|
85
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
86
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
87
|
-
}
|
|
88
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
89
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
90
|
-
}
|
|
91
74
|
const projectMapId = (_a = options == null ? void 0 : options.projectMapId) != null ? _a : process.env.UNIFORM_PROJECT_MAP_ID;
|
|
92
|
-
if (!projectMapId) {
|
|
93
|
-
throw new Error(
|
|
94
|
-
"UNIFORM_PROJECT_MAP_ID is not defined or override not provided to withUniformGetStaticPaths."
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
75
|
const projectMapClient = (_b = options == null ? void 0 : options.client) != null ? _b : new import_project_map.ProjectMapClient({
|
|
98
76
|
apiKey: process.env.UNIFORM_API_KEY,
|
|
99
77
|
projectId: process.env.UNIFORM_PROJECT_ID,
|
|
@@ -135,18 +113,7 @@ var resolveSlugFromParams = ({
|
|
|
135
113
|
var withUniformGetStaticProps = (options) => {
|
|
136
114
|
return async function wrappedGetStaticProps(context) {
|
|
137
115
|
var _a, _b;
|
|
138
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
139
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
140
|
-
}
|
|
141
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
142
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
143
|
-
}
|
|
144
116
|
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
117
|
const pathString = resolveSlugFromParams({
|
|
151
118
|
param: options == null ? void 0 : options.param,
|
|
152
119
|
params: context == null ? void 0 : context.params,
|
|
@@ -160,7 +127,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
160
127
|
const { preview, previewData } = context;
|
|
161
128
|
let composition = void 0;
|
|
162
129
|
try {
|
|
163
|
-
const response = await canvasClient.
|
|
130
|
+
const response = await canvasClient.getCompositionByNodePath({
|
|
164
131
|
...options == null ? void 0 : options.requestOptions,
|
|
165
132
|
projectMapId,
|
|
166
133
|
projectMapNodePath: pathString,
|
|
@@ -11,18 +11,7 @@ import {
|
|
|
11
11
|
var withUniformGetServerSideProps = (options) => {
|
|
12
12
|
return async function wrappedGetServerSideProps(context) {
|
|
13
13
|
var _a;
|
|
14
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
15
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
16
|
-
}
|
|
17
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
18
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
19
|
-
}
|
|
20
14
|
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
15
|
const canvasClient = (options == null ? void 0 : options.client) || new CanvasClient({
|
|
27
16
|
apiKey: process.env.UNIFORM_API_KEY,
|
|
28
17
|
projectId: process.env.UNIFORM_PROJECT_ID,
|
|
@@ -31,7 +20,7 @@ var withUniformGetServerSideProps = (options) => {
|
|
|
31
20
|
const preview = context.preview || (options == null ? void 0 : options.preview);
|
|
32
21
|
let composition = void 0;
|
|
33
22
|
try {
|
|
34
|
-
const response = await canvasClient.
|
|
23
|
+
const response = await canvasClient.getCompositionByNodePath({
|
|
35
24
|
...options == null ? void 0 : options.requestOptions,
|
|
36
25
|
projectMapId,
|
|
37
26
|
projectMapNodePath: (options == null ? void 0 : options.prefix) ? context.resolvedUrl.replace(new RegExp(`^${options.prefix}`), "") : context.resolvedUrl,
|
|
@@ -61,18 +50,7 @@ import {
|
|
|
61
50
|
var withUniformGetStaticPaths = (options) => {
|
|
62
51
|
return async function wrappedGetStaticPaths() {
|
|
63
52
|
var _a, _b;
|
|
64
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
65
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
66
|
-
}
|
|
67
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
68
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
69
|
-
}
|
|
70
53
|
const projectMapId = (_a = options == null ? void 0 : options.projectMapId) != null ? _a : process.env.UNIFORM_PROJECT_MAP_ID;
|
|
71
|
-
if (!projectMapId) {
|
|
72
|
-
throw new Error(
|
|
73
|
-
"UNIFORM_PROJECT_MAP_ID is not defined or override not provided to withUniformGetStaticPaths."
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
54
|
const projectMapClient = (_b = options == null ? void 0 : options.client) != null ? _b : new ProjectMapClient({
|
|
77
55
|
apiKey: process.env.UNIFORM_API_KEY,
|
|
78
56
|
projectId: process.env.UNIFORM_PROJECT_ID,
|
|
@@ -105,18 +83,7 @@ import {
|
|
|
105
83
|
var withUniformGetStaticProps = (options) => {
|
|
106
84
|
return async function wrappedGetStaticProps(context) {
|
|
107
85
|
var _a, _b;
|
|
108
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
109
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
110
|
-
}
|
|
111
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
112
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
113
|
-
}
|
|
114
86
|
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
87
|
const pathString = resolveSlugFromParams({
|
|
121
88
|
param: options == null ? void 0 : options.param,
|
|
122
89
|
params: context == null ? void 0 : context.params,
|
|
@@ -130,7 +97,7 @@ var withUniformGetStaticProps = (options) => {
|
|
|
130
97
|
const { preview, previewData } = context;
|
|
131
98
|
let composition = void 0;
|
|
132
99
|
try {
|
|
133
|
-
const response = await canvasClient.
|
|
100
|
+
const response = await canvasClient.getCompositionByNodePath({
|
|
134
101
|
...options == null ? void 0 : options.requestOptions,
|
|
135
102
|
projectMapId,
|
|
136
103
|
projectMapNodePath: pathString,
|
package/dist/slug/index.d.ts
CHANGED
|
@@ -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
|
|
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<
|
|
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<
|
|
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/dist/slug/index.js
CHANGED
|
@@ -46,12 +46,6 @@ var resolveSlugFromParams = ({
|
|
|
46
46
|
// src/slug/withUniformGetServerSideProps.ts
|
|
47
47
|
var withUniformGetServerSideProps = (options) => {
|
|
48
48
|
return async function wrappedGetServerSideProps(context) {
|
|
49
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
50
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
51
|
-
}
|
|
52
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
53
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
54
|
-
}
|
|
55
49
|
const slugString = resolveSlugFromParams({
|
|
56
50
|
param: options == null ? void 0 : options.param,
|
|
57
51
|
params: context == null ? void 0 : context.params,
|
|
@@ -93,12 +87,6 @@ var import_canvas2 = require("@uniformdev/canvas");
|
|
|
93
87
|
var withUniformGetStaticPaths = (options) => {
|
|
94
88
|
return async function wrappedGetStaticPaths() {
|
|
95
89
|
var _a;
|
|
96
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
97
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
98
|
-
}
|
|
99
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
100
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
101
|
-
}
|
|
102
90
|
const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new import_canvas2.CanvasClient({
|
|
103
91
|
apiKey: process.env.UNIFORM_API_KEY,
|
|
104
92
|
projectId: process.env.UNIFORM_PROJECT_ID,
|
|
@@ -125,12 +113,6 @@ var import_canvas3 = require("@uniformdev/canvas");
|
|
|
125
113
|
var withUniformGetStaticProps = (options) => {
|
|
126
114
|
return async function wrappedGetStaticProps(context) {
|
|
127
115
|
var _a;
|
|
128
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
129
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
130
|
-
}
|
|
131
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
132
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
133
|
-
}
|
|
134
116
|
const slugString = resolveSlugFromParams({
|
|
135
117
|
param: options == null ? void 0 : options.param,
|
|
136
118
|
params: context == null ? void 0 : context.params,
|
package/dist/slug/index.mjs
CHANGED
|
@@ -10,12 +10,6 @@ import {
|
|
|
10
10
|
} from "@uniformdev/canvas";
|
|
11
11
|
var withUniformGetServerSideProps = (options) => {
|
|
12
12
|
return async function wrappedGetServerSideProps(context) {
|
|
13
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
14
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
15
|
-
}
|
|
16
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
17
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
18
|
-
}
|
|
19
13
|
const slugString = resolveSlugFromParams({
|
|
20
14
|
param: options == null ? void 0 : options.param,
|
|
21
15
|
params: context == null ? void 0 : context.params,
|
|
@@ -61,12 +55,6 @@ import {
|
|
|
61
55
|
var withUniformGetStaticPaths = (options) => {
|
|
62
56
|
return async function wrappedGetStaticPaths() {
|
|
63
57
|
var _a;
|
|
64
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
65
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
66
|
-
}
|
|
67
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
68
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
69
|
-
}
|
|
70
58
|
const canvasClient = (_a = options == null ? void 0 : options.client) != null ? _a : new CanvasClient2({
|
|
71
59
|
apiKey: process.env.UNIFORM_API_KEY,
|
|
72
60
|
projectId: process.env.UNIFORM_PROJECT_ID,
|
|
@@ -97,12 +85,6 @@ import {
|
|
|
97
85
|
var withUniformGetStaticProps = (options) => {
|
|
98
86
|
return async function wrappedGetStaticProps(context) {
|
|
99
87
|
var _a;
|
|
100
|
-
if (!process.env.UNIFORM_API_KEY) {
|
|
101
|
-
throw new Error("UNIFORM_API_KEY is not defined.");
|
|
102
|
-
}
|
|
103
|
-
if (!process.env.UNIFORM_PROJECT_ID) {
|
|
104
|
-
throw new Error("UNIFORM_PROJECT_ID is not defined.");
|
|
105
|
-
}
|
|
106
88
|
const slugString = resolveSlugFromParams({
|
|
107
89
|
param: options == null ? void 0 : options.param,
|
|
108
90
|
params: context == null ? void 0 : context.params,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.13.1-alpha.1+7d1f189b2",
|
|
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.
|
|
56
|
-
"@uniformdev/canvas-react": "18.
|
|
57
|
-
"@uniformdev/project-map": "18.
|
|
55
|
+
"@uniformdev/canvas": "18.13.1-alpha.1+7d1f189b2",
|
|
56
|
+
"@uniformdev/canvas-react": "18.13.1-alpha.1+7d1f189b2",
|
|
57
|
+
"@uniformdev/project-map": "18.13.1-alpha.1+7d1f189b2"
|
|
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": "
|
|
76
|
+
"gitHead": "7d1f189b2affdfb7ba27640dd8d6df5620ce4fac"
|
|
77
77
|
}
|