@uniformdev/canvas-next 20.47.0 → 20.47.1-alpha.9

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.
@@ -216,6 +216,7 @@ function createRouteFetcher(options) {
216
216
  var _a, _b;
217
217
  const {
218
218
  contextualEditingCompositionId,
219
+ contextualEditingPath,
219
220
  resolvedUrl,
220
221
  defaultFetchState: defaultPreviewState
221
222
  } = parseContext(context);
@@ -262,7 +263,8 @@ function createRouteFetcher(options) {
262
263
  ),
263
264
  duration
264
265
  );
265
- if (contextualEditingCompositionId) {
266
+ const shouldUseContextualEditing = contextualEditingCompositionId && (contextualEditingPath === void 0 || contextualEditingPath === nodePath);
267
+ if (shouldUseContextualEditing) {
266
268
  const previewEmptyComposition = await invokeCompositionResult(
267
269
  {
268
270
  type: "composition",
@@ -359,9 +361,10 @@ var withUniformGetServerSideProps = (options) => {
359
361
  defaultHandleNotFound,
360
362
  defaultHandleRedirect,
361
363
  parseContext(context) {
362
- var _a, _b;
364
+ var _a, _b, _c, _d;
363
365
  return {
364
366
  contextualEditingCompositionId: ((_a = context.previewData) == null ? void 0 : _a.isUniformContextualEditing) ? (_b = context.previewData) == null ? void 0 : _b.compositionId : void 0,
367
+ contextualEditingPath: ((_c = context.previewData) == null ? void 0 : _c.isUniformContextualEditing) ? (_d = context.previewData) == null ? void 0 : _d.compositionPath : void 0,
365
368
  resolvedUrl: context.resolvedUrl,
366
369
  // auto engage draft content when in next preview mode
367
370
  // (can override with explicit setting of request options)'
@@ -468,12 +471,13 @@ var withUniformGetStaticProps = (options) => {
468
471
  defaultHandleNotFound,
469
472
  defaultHandleRedirect,
470
473
  parseContext(context) {
471
- var _a, _b, _c;
474
+ var _a, _b, _c, _d, _e;
472
475
  return {
473
476
  contextualEditingCompositionId: ((_a = context.previewData) == null ? void 0 : _a.isUniformContextualEditing) ? (_b = context.previewData) == null ? void 0 : _b.compositionId : void 0,
477
+ contextualEditingPath: ((_c = context.previewData) == null ? void 0 : _c.isUniformContextualEditing) ? (_d = context.previewData) == null ? void 0 : _d.compositionPath : void 0,
474
478
  resolvedUrl: resolveSlugFromParams({
475
479
  params: context.params,
476
- param: (_c = options == null ? void 0 : options.param) != null ? _c : "route"
480
+ param: (_e = options == null ? void 0 : options.param) != null ? _e : "route"
477
481
  }),
478
482
  // auto engage draft content when in next preview mode
479
483
  // (can override with explicit setting of request options)
@@ -94,6 +94,7 @@ function createRouteFetcher(options) {
94
94
  var _a, _b;
95
95
  const {
96
96
  contextualEditingCompositionId,
97
+ contextualEditingPath,
97
98
  resolvedUrl,
98
99
  defaultFetchState: defaultPreviewState
99
100
  } = parseContext(context);
@@ -140,7 +141,8 @@ function createRouteFetcher(options) {
140
141
  ),
141
142
  duration
142
143
  );
143
- if (contextualEditingCompositionId) {
144
+ const shouldUseContextualEditing = contextualEditingCompositionId && (contextualEditingPath === void 0 || contextualEditingPath === nodePath);
145
+ if (shouldUseContextualEditing) {
144
146
  const previewEmptyComposition = await invokeCompositionResult(
145
147
  {
146
148
  type: "composition",
@@ -237,9 +239,10 @@ var withUniformGetServerSideProps = (options) => {
237
239
  defaultHandleNotFound,
238
240
  defaultHandleRedirect,
239
241
  parseContext(context) {
240
- var _a, _b;
242
+ var _a, _b, _c, _d;
241
243
  return {
242
244
  contextualEditingCompositionId: ((_a = context.previewData) == null ? void 0 : _a.isUniformContextualEditing) ? (_b = context.previewData) == null ? void 0 : _b.compositionId : void 0,
245
+ contextualEditingPath: ((_c = context.previewData) == null ? void 0 : _c.isUniformContextualEditing) ? (_d = context.previewData) == null ? void 0 : _d.compositionPath : void 0,
243
246
  resolvedUrl: context.resolvedUrl,
244
247
  // auto engage draft content when in next preview mode
245
248
  // (can override with explicit setting of request options)'
@@ -336,12 +339,13 @@ var withUniformGetStaticProps = (options) => {
336
339
  defaultHandleNotFound,
337
340
  defaultHandleRedirect,
338
341
  parseContext(context) {
339
- var _a, _b, _c;
342
+ var _a, _b, _c, _d, _e;
340
343
  return {
341
344
  contextualEditingCompositionId: ((_a = context.previewData) == null ? void 0 : _a.isUniformContextualEditing) ? (_b = context.previewData) == null ? void 0 : _b.compositionId : void 0,
345
+ contextualEditingPath: ((_c = context.previewData) == null ? void 0 : _c.isUniformContextualEditing) ? (_d = context.previewData) == null ? void 0 : _d.compositionPath : void 0,
342
346
  resolvedUrl: resolveSlugFromParams({
343
347
  params: context.params,
344
- param: (_c = options == null ? void 0 : options.param) != null ? _c : "route"
348
+ param: (_e = options == null ? void 0 : options.param) != null ? _e : "route"
345
349
  }),
346
350
  // auto engage draft content when in next preview mode
347
351
  // (can override with explicit setting of request options)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next",
3
- "version": "20.47.0",
3
+ "version": "20.47.1-alpha.9+38d1d052b6",
4
4
  "description": "Next.js SDK for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -67,12 +67,12 @@
67
67
  "document:prebuild": "api-extractor run --local"
68
68
  },
69
69
  "dependencies": {
70
- "@uniformdev/canvas": "20.47.0",
71
- "@uniformdev/canvas-react": "20.47.0",
72
- "@uniformdev/context": "20.47.0",
73
- "@uniformdev/project-map": "20.47.0",
74
- "@uniformdev/redirect": "20.47.0",
75
- "@uniformdev/richtext": "20.47.0",
70
+ "@uniformdev/canvas": "20.47.1-alpha.9+38d1d052b6",
71
+ "@uniformdev/canvas-react": "20.47.1-alpha.9+38d1d052b6",
72
+ "@uniformdev/context": "20.47.1-alpha.9+38d1d052b6",
73
+ "@uniformdev/project-map": "20.47.1-alpha.9+38d1d052b6",
74
+ "@uniformdev/redirect": "20.47.1-alpha.9+38d1d052b6",
75
+ "@uniformdev/richtext": "20.47.1-alpha.9+38d1d052b6",
76
76
  "colorette": "2.0.20"
77
77
  },
78
78
  "peerDependencies": {
@@ -81,10 +81,10 @@
81
81
  "react-dom": ">=16"
82
82
  },
83
83
  "devDependencies": {
84
- "@types/react": "18.3.24",
85
- "next": "14.2.32",
86
- "react": "18.3.1",
87
- "react-dom": "18.3.1"
84
+ "@types/react": "19.2.2",
85
+ "next": "16.0.10",
86
+ "react": "19.2.1",
87
+ "react-dom": "19.2.1"
88
88
  },
89
89
  "files": [
90
90
  "/dist"
@@ -92,5 +92,5 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "gitHead": "446f701d32eee97220ab693e69b0952ed95cc1c5"
95
+ "gitHead": "38d1d052b632b873208982e8aefa300e871ba5b7"
96
96
  }