@builder.io/sdk-react-nextjs 0.14.28 → 0.14.30-0
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/lib/browser/blocks-exports.cjs +188 -0
- package/lib/browser/blocks-exports.mjs +2812 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +25 -26
- package/lib/browser/init.cjs +8 -0
- package/lib/browser/init.mjs +60 -0
- package/lib/browser/server-entry-5cac64f5.js +720 -0
- package/lib/browser/server-entry-c9d4cfc0.cjs +2 -0
- package/lib/browser/server-entry.cjs +1 -0
- package/lib/browser/server-entry.mjs +16 -0
- package/lib/edge/blocks-exports.cjs +208 -0
- package/lib/edge/{bundle-c67d25d8.js → blocks-exports.mjs} +2388 -2405
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +25 -26
- package/lib/edge/init.cjs +8 -0
- package/lib/edge/init.mjs +60 -0
- package/lib/edge/server-entry-5cac64f5.js +720 -0
- package/lib/edge/server-entry-c9d4cfc0.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -0
- package/lib/edge/server-entry.mjs +16 -0
- package/lib/node/blocks-exports.cjs +188 -0
- package/lib/node/blocks-exports.mjs +2788 -0
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +23 -23
- package/lib/node/init.cjs +1 -0
- package/lib/node/init.mjs +13 -0
- package/lib/node/node-runtime-591c4640.cjs +48 -0
- package/lib/node/node-runtime-8d503570.js +167 -0
- package/lib/node/server-entry-00baa89f.js +720 -0
- package/lib/node/server-entry-1c6e06e6.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -0
- package/lib/node/server-entry.mjs +16 -0
- package/package.json +14 -9
- package/types/cjs/blocks/BaseText.d.ts +6 -0
- package/types/cjs/blocks/form/component-info.d.ts +2 -0
- package/types/cjs/blocks/form/form.d.ts +33 -0
- package/types/cjs/blocks/input/component-info.d.ts +2 -0
- package/types/cjs/blocks/input/input.d.ts +15 -0
- package/types/cjs/blocks/raw-text/component-info.d.ts +2 -0
- package/types/cjs/blocks/raw-text/index.d.ts +1 -0
- package/types/cjs/blocks/raw-text/raw-text.d.ts +7 -0
- package/types/cjs/blocks/submit-button/component-info.d.ts +2 -0
- package/types/cjs/blocks/submit-button/submit-button.d.ts +10 -0
- package/types/cjs/blocks/textarea/component-info.d.ts +2 -0
- package/types/cjs/blocks/textarea/index.d.ts +1 -0
- package/types/cjs/blocks/textarea/textarea.d.ts +13 -0
- package/types/cjs/components/content/index.d.ts +1 -0
- package/types/cjs/components/error-boundary.d.ts +11 -0
- package/types/cjs/constants/sdk-name.d.ts +1 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/apply-patch-with-mutation.d.ts +10 -0
- package/types/cjs/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
- package/types/cjs/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
- package/types/cjs/functions/evaluate/edge-runtime/index.d.ts +1 -0
- package/types/cjs/functions/evaluate/node-runtime/index.d.ts +1 -0
- package/types/cjs/functions/evaluate/node-runtime/init.d.ts +13 -0
- package/types/cjs/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
- package/types/cjs/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
- package/types/cjs/functions/evaluate/placeholder-runtime.d.ts +2 -0
- package/types/cjs/functions/extract-css-var-default-value.d.ts +1 -0
- package/types/cjs/functions/get-react-native-block-styles.d.ts +15 -0
- package/types/cjs/functions/is-edge-runtime.d.ts +4 -0
- package/types/cjs/functions/on-change.d.ts +7 -0
- package/types/cjs/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/types/cjs/functions/sanitize-rn-allowed-css.d.ts +8 -0
- package/types/cjs/helpers/omit.d.ts +1 -0
- package/types/cjs/helpers/time.d.ts +1 -0
- package/types/esm/blocks/BaseText.d.ts +6 -0
- package/types/esm/blocks/form/component-info.d.ts +2 -0
- package/types/esm/blocks/form/form.d.ts +33 -0
- package/types/esm/blocks/input/component-info.d.ts +2 -0
- package/types/esm/blocks/input/input.d.ts +15 -0
- package/types/esm/blocks/raw-text/component-info.d.ts +2 -0
- package/types/esm/blocks/raw-text/index.d.ts +1 -0
- package/types/esm/blocks/raw-text/raw-text.d.ts +7 -0
- package/types/esm/blocks/submit-button/component-info.d.ts +2 -0
- package/types/esm/blocks/submit-button/submit-button.d.ts +10 -0
- package/types/esm/blocks/textarea/component-info.d.ts +2 -0
- package/types/esm/blocks/textarea/index.d.ts +1 -0
- package/types/esm/blocks/textarea/textarea.d.ts +13 -0
- package/types/esm/components/content/index.d.ts +1 -0
- package/types/esm/components/error-boundary.d.ts +11 -0
- package/types/esm/constants/sdk-name.d.ts +1 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/apply-patch-with-mutation.d.ts +10 -0
- package/types/esm/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
- package/types/esm/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
- package/types/esm/functions/evaluate/edge-runtime/index.d.ts +1 -0
- package/types/esm/functions/evaluate/node-runtime/index.d.ts +1 -0
- package/types/esm/functions/evaluate/node-runtime/init.d.ts +13 -0
- package/types/esm/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
- package/types/esm/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
- package/types/esm/functions/evaluate/placeholder-runtime.d.ts +2 -0
- package/types/esm/functions/extract-css-var-default-value.d.ts +1 -0
- package/types/esm/functions/get-react-native-block-styles.d.ts +15 -0
- package/types/esm/functions/is-edge-runtime.d.ts +4 -0
- package/types/esm/functions/on-change.d.ts +7 -0
- package/types/esm/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/types/esm/functions/sanitize-rn-allowed-css.d.ts +8 -0
- package/types/esm/helpers/omit.d.ts +1 -0
- package/types/esm/helpers/time.d.ts +1 -0
- package/lib/browser/USE_CLIENT_BUNDLE-1c35fc0a.js +0 -703
- package/lib/browser/USE_CLIENT_BUNDLE-65950ed4.cjs +0 -21
- package/lib/browser/USE_SERVER_BUNDLE-3ea7f606.cjs +0 -1
- package/lib/browser/USE_SERVER_BUNDLE-812dfc95.js +0 -11
- package/lib/browser/bundle-763c7cf6.js +0 -2829
- package/lib/browser/bundle-aff841a2.cjs +0 -169
- package/lib/edge/USE_CLIENT_BUNDLE-cf0350f7.js +0 -703
- package/lib/edge/USE_CLIENT_BUNDLE-fc025b97.cjs +0 -21
- package/lib/edge/USE_SERVER_BUNDLE-8e198f44.cjs +0 -1
- package/lib/edge/USE_SERVER_BUNDLE-ded4dbdc.js +0 -11
- package/lib/edge/bundle-05000fd3.cjs +0 -189
- package/lib/node/USE_CLIENT_BUNDLE-0fda6fd8.js +0 -703
- package/lib/node/USE_CLIENT_BUNDLE-c57c9376.cjs +0 -21
- package/lib/node/USE_SERVER_BUNDLE-15a235fc.js +0 -11
- package/lib/node/USE_SERVER_BUNDLE-5472e997.cjs +0 -1
- package/lib/node/bundle-40b09581.js +0 -2950
- package/lib/node/bundle-acffe20a.cjs +0 -216
package/lib/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-c9d4cfc0.cjs");require("react/jsx-runtime");require("react");require("next/navigation");require("lru-cache");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Blocks as n, BuilderContext as m, Button as c, Columns as g, Content as p, Fragment as a, Image as d, Section as l, Symbol as u, Text as f, Video as B } from "./blocks-exports.mjs";
|
|
2
|
+
import { _processContentResult as E, createRegisterComponentMessage as h, fetchBuilderProps as x, fetchEntries as S, fetchOneEntry as b, getBuilderSearchParams as P, isEditing as k, isPreviewing as y, register as R, setEditorSettings as T, subscribeToEditor as v, track as w } from "./server-entry-5cac64f5.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-812dfc95.js";
|
|
6
5
|
import "next/navigation";
|
|
7
6
|
import "lru-cache";
|
|
8
7
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
n as Blocks,
|
|
9
|
+
m as BuilderContext,
|
|
10
|
+
c as Button,
|
|
11
|
+
g as Columns,
|
|
12
|
+
p as Content,
|
|
13
|
+
a as Fragment,
|
|
14
|
+
d as Image,
|
|
15
|
+
l as Section,
|
|
16
|
+
u as Symbol,
|
|
17
|
+
f as Text,
|
|
18
|
+
B as Video,
|
|
19
|
+
E as _processContentResult,
|
|
20
|
+
h as createRegisterComponentMessage,
|
|
21
|
+
x as fetchBuilderProps,
|
|
22
|
+
S as fetchEntries,
|
|
23
|
+
b as fetchOneEntry,
|
|
24
|
+
P as getBuilderSearchParams,
|
|
25
|
+
k as isEditing,
|
|
26
|
+
y as isPreviewing,
|
|
27
|
+
R as register,
|
|
28
|
+
T as setEditorSettings,
|
|
29
|
+
v as subscribeToEditor,
|
|
30
|
+
w as track
|
|
32
31
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ivm=require("isolated-vm"),serverEntry=require("./server-entry-c9d4cfc0.cjs");require("lru-cache");const SDK_NAME_FOR_TARGET=(()=>{switch(serverEntry.TARGET){case"rsc":return"nextjs";case"reactNative":return"react-native";default:return serverEntry.TARGET}})(),SDK_NAME=`@builder.io/sdk-${SDK_NAME_FOR_TARGET}`,noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(t){}const INJECTED_IVM_GLOBAL="BUILDER_IVM";let IVM_INSTANCE=null;const setIvm=(t,e={})=>{IVM_INSTANCE=t,setIsolateContext(e)},getIvm=()=>{try{if(IVM_INSTANCE)return IVM_INSTANCE;const e=safeDynamicRequire("isolated-vm");if(e)return e}catch(e){serverEntry.logger.error("isolated-vm import error.",e)}const t=`${serverEntry.MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
2
|
+
|
|
3
|
+
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
4
|
+
|
|
5
|
+
- import and call \`initializeNodeRuntime()\` from "${SDK_NAME}/node/init".
|
|
6
|
+
- add the following import: \`await import('isolated-vm')\`.
|
|
7
|
+
|
|
8
|
+
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(t)};function setIsolateContext(t={memoryLimit:128}){const e=getIvm(),n=new e.Isolate(t).createContextSync(),o=n.global;return o.setSync("global",o.derefInto()),o.setSync("log",function(...r){console.log(...r)}),o.setSync(INJECTED_IVM_GLOBAL,e),n}const initializeNodeRuntime=t=>{const{ivmIsolateOptions:e}=t||{};setIvm(ivm,e)};exports.initializeNodeRuntime=initializeNodeRuntime;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import ivm from "isolated-vm";
|
|
2
|
+
import { TARGET, logger, MSG_PREFIX } from "./server-entry-5cac64f5.js";
|
|
3
|
+
import "lru-cache";
|
|
4
|
+
const SDK_NAME_FOR_TARGET = (() => {
|
|
5
|
+
switch (TARGET) {
|
|
6
|
+
case "rsc":
|
|
7
|
+
return "nextjs";
|
|
8
|
+
case "reactNative":
|
|
9
|
+
return "react-native";
|
|
10
|
+
default:
|
|
11
|
+
return TARGET;
|
|
12
|
+
}
|
|
13
|
+
})(), SDK_NAME = `@builder.io/sdk-${SDK_NAME_FOR_TARGET}`, noop = () => {
|
|
14
|
+
};
|
|
15
|
+
let safeDynamicRequire = noop;
|
|
16
|
+
try {
|
|
17
|
+
safeDynamicRequire = eval("require");
|
|
18
|
+
} catch (e) {
|
|
19
|
+
}
|
|
20
|
+
const INJECTED_IVM_GLOBAL = "BUILDER_IVM";
|
|
21
|
+
let IVM_INSTANCE = null;
|
|
22
|
+
const setIvm = (e, t = {}) => {
|
|
23
|
+
IVM_INSTANCE = e, setIsolateContext(t);
|
|
24
|
+
}, getIvm = () => {
|
|
25
|
+
try {
|
|
26
|
+
if (IVM_INSTANCE)
|
|
27
|
+
return IVM_INSTANCE;
|
|
28
|
+
const t = safeDynamicRequire("isolated-vm");
|
|
29
|
+
if (t)
|
|
30
|
+
return t;
|
|
31
|
+
} catch (t) {
|
|
32
|
+
logger.error("isolated-vm import error.", t);
|
|
33
|
+
}
|
|
34
|
+
const e = `${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
|
|
35
|
+
|
|
36
|
+
SOLUTION: In a server-only execution path within your application, do one of the following:
|
|
37
|
+
|
|
38
|
+
- import and call \`initializeNodeRuntime()\` from "${SDK_NAME}/node/init".
|
|
39
|
+
- add the following import: \`await import('isolated-vm')\`.
|
|
40
|
+
|
|
41
|
+
For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;
|
|
42
|
+
throw new Error(e);
|
|
43
|
+
};
|
|
44
|
+
function setIsolateContext(e = {
|
|
45
|
+
memoryLimit: 128
|
|
46
|
+
}) {
|
|
47
|
+
const t = getIvm(), i = new t.Isolate(e).createContextSync(), o = i.global;
|
|
48
|
+
return o.setSync("global", o.derefInto()), o.setSync("log", function(...n) {
|
|
49
|
+
console.log(...n);
|
|
50
|
+
}), o.setSync(INJECTED_IVM_GLOBAL, t), i;
|
|
51
|
+
}
|
|
52
|
+
const initializeNodeRuntime = (e) => {
|
|
53
|
+
const {
|
|
54
|
+
ivmIsolateOptions: t
|
|
55
|
+
} = e || {};
|
|
56
|
+
setIvm(ivm, t);
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
initializeNodeRuntime
|
|
60
|
+
};
|