@uniformdev/canvas-next-rsc 19.186.1 → 19.186.4-alpha.3

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/config.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // src/config.ts
@@ -33,12 +23,11 @@ __export(config_exports, {
33
23
  withUniformConfig: () => withUniformConfig
34
24
  });
35
25
  module.exports = __toCommonJS(config_exports);
36
- var import_path = __toESM(require("path"));
37
- var { existsSync } = require("fs");
38
- var { join } = require("path");
26
+ var import_fs = require("fs");
27
+ var import_path = require("path");
39
28
  var getConfigPath = () => {
40
- const configFilePath = join(process.cwd(), `uniform.server.config.js`);
41
- if (!existsSync(configFilePath)) {
29
+ const configFilePath = (0, import_path.join)(process.cwd(), `uniform.server.config`);
30
+ if (!(0, import_fs.existsSync)(configFilePath)) {
42
31
  return void 0;
43
32
  }
44
33
  return configFilePath;
@@ -53,7 +42,7 @@ var withUniformConfig = (nextConfig) => ({
53
42
  const uniformConfigPath = getConfigPath();
54
43
  if (uniformConfigPath) {
55
44
  console.log("Using Uniform config from", uniformConfigPath);
56
- config.resolve.alias["uniform.server.config.js"] = import_path.default.resolve(config.context, uniformConfigPath);
45
+ config.resolve.alias["uniform.server.config"] = (0, import_path.resolve)(config.context, uniformConfigPath);
57
46
  }
58
47
  }
59
48
  return config;
package/dist/config.mjs CHANGED
@@ -1,16 +1,8 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error('Dynamic require of "' + x + '" is not supported');
6
- });
7
-
8
1
  // src/config.ts
9
- import path from "path";
10
- var { existsSync } = __require("fs");
11
- var { join } = __require("path");
2
+ import { existsSync } from "fs";
3
+ import { join, resolve } from "path";
12
4
  var getConfigPath = () => {
13
- const configFilePath = join(process.cwd(), `uniform.server.config.js`);
5
+ const configFilePath = join(process.cwd(), `uniform.server.config`);
14
6
  if (!existsSync(configFilePath)) {
15
7
  return void 0;
16
8
  }
@@ -26,7 +18,7 @@ var withUniformConfig = (nextConfig) => ({
26
18
  const uniformConfigPath = getConfigPath();
27
19
  if (uniformConfigPath) {
28
20
  console.log("Using Uniform config from", uniformConfigPath);
29
- config.resolve.alias["uniform.server.config.js"] = path.resolve(config.context, uniformConfigPath);
21
+ config.resolve.alias["uniform.server.config"] = resolve(config.context, uniformConfigPath);
30
22
  }
31
23
  }
32
24
  return config;
package/dist/handler.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/handler.ts
@@ -168,16 +178,9 @@ var import_svix = require("svix");
168
178
  var import_canvas2 = require("@uniformdev/canvas");
169
179
 
170
180
  // src/config/helpers.ts
181
+ var import_uniform_server = __toESM(require("uniform.server.config"));
171
182
  var getServerConfig = () => {
172
- let serverConfig;
173
- try {
174
- serverConfig = require("uniform.server.config.js");
175
- } catch (e) {
176
- serverConfig = {
177
- defaultConsent: false
178
- };
179
- }
180
- return serverConfig;
183
+ return import_uniform_server.default;
181
184
  };
182
185
 
183
186
  // src/env/index.ts
package/dist/handler.mjs CHANGED
@@ -1,10 +1,3 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error('Dynamic require of "' + x + '" is not supported');
6
- });
7
-
8
1
  // src/handler/createPreviewGETRouteHandler.ts
9
2
  import {
10
3
  IN_CONTEXT_EDITOR_PLAYGROUND_QUERY_STRING_PARAM,
@@ -152,15 +145,8 @@ import { Webhook } from "svix";
152
145
  import { CanvasClient } from "@uniformdev/canvas";
153
146
 
154
147
  // src/config/helpers.ts
148
+ import serverConfig from "uniform.server.config";
155
149
  var getServerConfig = () => {
156
- let serverConfig;
157
- try {
158
- serverConfig = __require("uniform.server.config.js");
159
- } catch (e) {
160
- serverConfig = {
161
- defaultConsent: false
162
- };
163
- }
164
150
  return serverConfig;
165
151
  };
166
152
 
package/dist/index.esm.js CHANGED
@@ -1,16 +1,12 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error('Dynamic require of "' + x + '" is not supported');
6
- });
7
-
8
1
  // src/index.ts
9
2
  import "server-only";
10
3
 
11
4
  // src/clients/canvasClient.ts
12
5
  import { CanvasClient } from "@uniformdev/canvas";
13
6
 
7
+ // src/config/helpers.ts
8
+ import serverConfig from "uniform.server.config";
9
+
14
10
  // src/utils/draft.ts
15
11
  import { IN_CONTEXT_EDITOR_QUERY_STRING_PARAM } from "@uniformdev/canvas";
16
12
  import { draftMode } from "next/headers";
@@ -42,14 +38,6 @@ var isDevelopmentEnvironment = () => {
42
38
 
43
39
  // src/config/helpers.ts
44
40
  var getServerConfig = () => {
45
- let serverConfig;
46
- try {
47
- serverConfig = __require("uniform.server.config.js");
48
- } catch (e) {
49
- serverConfig = {
50
- defaultConsent: false
51
- };
52
- }
53
41
  return serverConfig;
54
42
  };
55
43
  var shouldCacheBeDisabled = (options) => {
@@ -1045,9 +1033,9 @@ var UniformContext = async ({
1045
1033
  searchParams: {}
1046
1034
  });
1047
1035
  const ContextComponent = clientContextComponent || DefaultUniformClientContext;
1048
- const serverConfig = getServerConfig();
1049
- const disableDevTools = ((_a = serverConfig.context) == null ? void 0 : _a.disableDevTools) || false;
1050
- const defaultConsent = serverConfig.defaultConsent || false;
1036
+ const serverConfig2 = getServerConfig();
1037
+ const disableDevTools = ((_a = serverConfig2.context) == null ? void 0 : _a.disableDevTools) || false;
1038
+ const defaultConsent = serverConfig2.defaultConsent || false;
1051
1039
  return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children, /* @__PURE__ */ React7.createElement(
1052
1040
  ContextComponent,
1053
1041
  {
package/dist/index.js CHANGED
@@ -60,6 +60,9 @@ var import_server_only = require("server-only");
60
60
  // src/clients/canvasClient.ts
61
61
  var import_canvas2 = require("@uniformdev/canvas");
62
62
 
63
+ // src/config/helpers.ts
64
+ var import_uniform_server = __toESM(require("uniform.server.config"));
65
+
63
66
  // src/utils/draft.ts
64
67
  var import_canvas = require("@uniformdev/canvas");
65
68
  var import_headers = require("next/headers");
@@ -91,15 +94,7 @@ var isDevelopmentEnvironment = () => {
91
94
 
92
95
  // src/config/helpers.ts
93
96
  var getServerConfig = () => {
94
- let serverConfig;
95
- try {
96
- serverConfig = require("uniform.server.config.js");
97
- } catch (e) {
98
- serverConfig = {
99
- defaultConsent: false
100
- };
101
- }
102
- return serverConfig;
97
+ return import_uniform_server.default;
103
98
  };
104
99
  var shouldCacheBeDisabled = (options) => {
105
100
  if (isDraftModeEnabled(options)) {
@@ -1069,9 +1064,9 @@ var UniformContext = async ({
1069
1064
  searchParams: {}
1070
1065
  });
1071
1066
  const ContextComponent = clientContextComponent || import_canvas_next_rsc_client8.DefaultUniformClientContext;
1072
- const serverConfig = getServerConfig();
1073
- const disableDevTools = ((_a = serverConfig.context) == null ? void 0 : _a.disableDevTools) || false;
1074
- const defaultConsent = serverConfig.defaultConsent || false;
1067
+ const serverConfig2 = getServerConfig();
1068
+ const disableDevTools = ((_a = serverConfig2.context) == null ? void 0 : _a.disableDevTools) || false;
1069
+ const defaultConsent = serverConfig2.defaultConsent || false;
1075
1070
  return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, children, /* @__PURE__ */ import_react11.default.createElement(
1076
1071
  ContextComponent,
1077
1072
  {
package/dist/index.mjs CHANGED
@@ -1,16 +1,12 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error('Dynamic require of "' + x + '" is not supported');
6
- });
7
-
8
1
  // src/index.ts
9
2
  import "server-only";
10
3
 
11
4
  // src/clients/canvasClient.ts
12
5
  import { CanvasClient } from "@uniformdev/canvas";
13
6
 
7
+ // src/config/helpers.ts
8
+ import serverConfig from "uniform.server.config";
9
+
14
10
  // src/utils/draft.ts
15
11
  import { IN_CONTEXT_EDITOR_QUERY_STRING_PARAM } from "@uniformdev/canvas";
16
12
  import { draftMode } from "next/headers";
@@ -42,14 +38,6 @@ var isDevelopmentEnvironment = () => {
42
38
 
43
39
  // src/config/helpers.ts
44
40
  var getServerConfig = () => {
45
- let serverConfig;
46
- try {
47
- serverConfig = __require("uniform.server.config.js");
48
- } catch (e) {
49
- serverConfig = {
50
- defaultConsent: false
51
- };
52
- }
53
41
  return serverConfig;
54
42
  };
55
43
  var shouldCacheBeDisabled = (options) => {
@@ -1045,9 +1033,9 @@ var UniformContext = async ({
1045
1033
  searchParams: {}
1046
1034
  });
1047
1035
  const ContextComponent = clientContextComponent || DefaultUniformClientContext;
1048
- const serverConfig = getServerConfig();
1049
- const disableDevTools = ((_a = serverConfig.context) == null ? void 0 : _a.disableDevTools) || false;
1050
- const defaultConsent = serverConfig.defaultConsent || false;
1036
+ const serverConfig2 = getServerConfig();
1037
+ const disableDevTools = ((_a = serverConfig2.context) == null ? void 0 : _a.disableDevTools) || false;
1038
+ const defaultConsent = serverConfig2.defaultConsent || false;
1051
1039
  return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children, /* @__PURE__ */ React7.createElement(
1052
1040
  ContextComponent,
1053
1041
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc",
3
- "version": "19.186.1",
3
+ "version": "19.186.4-alpha.3+59de2f77b6",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -61,15 +61,15 @@
61
61
  "react-dom": "18.3.1"
62
62
  },
63
63
  "dependencies": {
64
- "@uniformdev/canvas": "19.186.1",
65
- "@uniformdev/canvas-next-rsc-client": "^19.186.1",
66
- "@uniformdev/canvas-next-rsc-shared": "^19.186.1",
67
- "@uniformdev/canvas-react": "19.186.1",
68
- "@uniformdev/context": "19.186.1",
69
- "@uniformdev/project-map": "19.186.1",
70
- "@uniformdev/redirect": "19.186.1",
71
- "@uniformdev/richtext": "19.186.1",
72
- "@uniformdev/webhooks": "19.186.1",
64
+ "@uniformdev/canvas": "19.186.4-alpha.3+59de2f77b6",
65
+ "@uniformdev/canvas-next-rsc-client": "^19.186.4-alpha.3+59de2f77b6",
66
+ "@uniformdev/canvas-next-rsc-shared": "^19.186.4-alpha.3+59de2f77b6",
67
+ "@uniformdev/canvas-react": "19.186.4-alpha.3+59de2f77b6",
68
+ "@uniformdev/context": "19.186.4-alpha.3+59de2f77b6",
69
+ "@uniformdev/project-map": "19.186.4-alpha.3+59de2f77b6",
70
+ "@uniformdev/redirect": "19.186.4-alpha.3+59de2f77b6",
71
+ "@uniformdev/richtext": "19.186.4-alpha.3+59de2f77b6",
72
+ "@uniformdev/webhooks": "19.186.4-alpha.3+59de2f77b6",
73
73
  "@vercel/edge-config": "^0.4.0",
74
74
  "encoding": "^0.1.13",
75
75
  "server-only": "^0.0.1",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "12ca61d140d99b4f2de67428425076cecbc6577b"
89
+ "gitHead": "59de2f77b6270e36c6a5e95b0bd6b1756c4dcdf0"
90
90
  }