@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.
Files changed (118) hide show
  1. package/lib/browser/blocks-exports.cjs +188 -0
  2. package/lib/browser/blocks-exports.mjs +2812 -0
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +25 -26
  5. package/lib/browser/init.cjs +8 -0
  6. package/lib/browser/init.mjs +60 -0
  7. package/lib/browser/server-entry-5cac64f5.js +720 -0
  8. package/lib/browser/server-entry-c9d4cfc0.cjs +2 -0
  9. package/lib/browser/server-entry.cjs +1 -0
  10. package/lib/browser/server-entry.mjs +16 -0
  11. package/lib/edge/blocks-exports.cjs +208 -0
  12. package/lib/edge/{bundle-c67d25d8.js → blocks-exports.mjs} +2388 -2405
  13. package/lib/edge/index.cjs +1 -1
  14. package/lib/edge/index.mjs +25 -26
  15. package/lib/edge/init.cjs +8 -0
  16. package/lib/edge/init.mjs +60 -0
  17. package/lib/edge/server-entry-5cac64f5.js +720 -0
  18. package/lib/edge/server-entry-c9d4cfc0.cjs +2 -0
  19. package/lib/edge/server-entry.cjs +1 -0
  20. package/lib/edge/server-entry.mjs +16 -0
  21. package/lib/node/blocks-exports.cjs +188 -0
  22. package/lib/node/blocks-exports.mjs +2788 -0
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +23 -23
  25. package/lib/node/init.cjs +1 -0
  26. package/lib/node/init.mjs +13 -0
  27. package/lib/node/node-runtime-591c4640.cjs +48 -0
  28. package/lib/node/node-runtime-8d503570.js +167 -0
  29. package/lib/node/server-entry-00baa89f.js +720 -0
  30. package/lib/node/server-entry-1c6e06e6.cjs +2 -0
  31. package/lib/node/server-entry.cjs +1 -0
  32. package/lib/node/server-entry.mjs +16 -0
  33. package/package.json +14 -9
  34. package/types/cjs/blocks/BaseText.d.ts +6 -0
  35. package/types/cjs/blocks/form/component-info.d.ts +2 -0
  36. package/types/cjs/blocks/form/form.d.ts +33 -0
  37. package/types/cjs/blocks/input/component-info.d.ts +2 -0
  38. package/types/cjs/blocks/input/input.d.ts +15 -0
  39. package/types/cjs/blocks/raw-text/component-info.d.ts +2 -0
  40. package/types/cjs/blocks/raw-text/index.d.ts +1 -0
  41. package/types/cjs/blocks/raw-text/raw-text.d.ts +7 -0
  42. package/types/cjs/blocks/submit-button/component-info.d.ts +2 -0
  43. package/types/cjs/blocks/submit-button/submit-button.d.ts +10 -0
  44. package/types/cjs/blocks/textarea/component-info.d.ts +2 -0
  45. package/types/cjs/blocks/textarea/index.d.ts +1 -0
  46. package/types/cjs/blocks/textarea/textarea.d.ts +13 -0
  47. package/types/cjs/components/content/index.d.ts +1 -0
  48. package/types/cjs/components/error-boundary.d.ts +11 -0
  49. package/types/cjs/constants/sdk-name.d.ts +1 -0
  50. package/types/cjs/constants/sdk-version.d.ts +1 -1
  51. package/types/cjs/functions/apply-patch-with-mutation.d.ts +10 -0
  52. package/types/cjs/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
  53. package/types/cjs/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
  54. package/types/cjs/functions/evaluate/edge-runtime/index.d.ts +1 -0
  55. package/types/cjs/functions/evaluate/node-runtime/index.d.ts +1 -0
  56. package/types/cjs/functions/evaluate/node-runtime/init.d.ts +13 -0
  57. package/types/cjs/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
  58. package/types/cjs/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
  59. package/types/cjs/functions/evaluate/placeholder-runtime.d.ts +2 -0
  60. package/types/cjs/functions/extract-css-var-default-value.d.ts +1 -0
  61. package/types/cjs/functions/get-react-native-block-styles.d.ts +15 -0
  62. package/types/cjs/functions/is-edge-runtime.d.ts +4 -0
  63. package/types/cjs/functions/on-change.d.ts +7 -0
  64. package/types/cjs/functions/sanitize-react-native-block-styles.d.ts +3 -0
  65. package/types/cjs/functions/sanitize-rn-allowed-css.d.ts +8 -0
  66. package/types/cjs/helpers/omit.d.ts +1 -0
  67. package/types/cjs/helpers/time.d.ts +1 -0
  68. package/types/esm/blocks/BaseText.d.ts +6 -0
  69. package/types/esm/blocks/form/component-info.d.ts +2 -0
  70. package/types/esm/blocks/form/form.d.ts +33 -0
  71. package/types/esm/blocks/input/component-info.d.ts +2 -0
  72. package/types/esm/blocks/input/input.d.ts +15 -0
  73. package/types/esm/blocks/raw-text/component-info.d.ts +2 -0
  74. package/types/esm/blocks/raw-text/index.d.ts +1 -0
  75. package/types/esm/blocks/raw-text/raw-text.d.ts +7 -0
  76. package/types/esm/blocks/submit-button/component-info.d.ts +2 -0
  77. package/types/esm/blocks/submit-button/submit-button.d.ts +10 -0
  78. package/types/esm/blocks/textarea/component-info.d.ts +2 -0
  79. package/types/esm/blocks/textarea/index.d.ts +1 -0
  80. package/types/esm/blocks/textarea/textarea.d.ts +13 -0
  81. package/types/esm/components/content/index.d.ts +1 -0
  82. package/types/esm/components/error-boundary.d.ts +11 -0
  83. package/types/esm/constants/sdk-name.d.ts +1 -0
  84. package/types/esm/constants/sdk-version.d.ts +1 -1
  85. package/types/esm/functions/apply-patch-with-mutation.d.ts +10 -0
  86. package/types/esm/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
  87. package/types/esm/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
  88. package/types/esm/functions/evaluate/edge-runtime/index.d.ts +1 -0
  89. package/types/esm/functions/evaluate/node-runtime/index.d.ts +1 -0
  90. package/types/esm/functions/evaluate/node-runtime/init.d.ts +13 -0
  91. package/types/esm/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
  92. package/types/esm/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
  93. package/types/esm/functions/evaluate/placeholder-runtime.d.ts +2 -0
  94. package/types/esm/functions/extract-css-var-default-value.d.ts +1 -0
  95. package/types/esm/functions/get-react-native-block-styles.d.ts +15 -0
  96. package/types/esm/functions/is-edge-runtime.d.ts +4 -0
  97. package/types/esm/functions/on-change.d.ts +7 -0
  98. package/types/esm/functions/sanitize-react-native-block-styles.d.ts +3 -0
  99. package/types/esm/functions/sanitize-rn-allowed-css.d.ts +8 -0
  100. package/types/esm/helpers/omit.d.ts +1 -0
  101. package/types/esm/helpers/time.d.ts +1 -0
  102. package/lib/browser/USE_CLIENT_BUNDLE-1c35fc0a.js +0 -703
  103. package/lib/browser/USE_CLIENT_BUNDLE-65950ed4.cjs +0 -21
  104. package/lib/browser/USE_SERVER_BUNDLE-3ea7f606.cjs +0 -1
  105. package/lib/browser/USE_SERVER_BUNDLE-812dfc95.js +0 -11
  106. package/lib/browser/bundle-763c7cf6.js +0 -2829
  107. package/lib/browser/bundle-aff841a2.cjs +0 -169
  108. package/lib/edge/USE_CLIENT_BUNDLE-cf0350f7.js +0 -703
  109. package/lib/edge/USE_CLIENT_BUNDLE-fc025b97.cjs +0 -21
  110. package/lib/edge/USE_SERVER_BUNDLE-8e198f44.cjs +0 -1
  111. package/lib/edge/USE_SERVER_BUNDLE-ded4dbdc.js +0 -11
  112. package/lib/edge/bundle-05000fd3.cjs +0 -189
  113. package/lib/node/USE_CLIENT_BUNDLE-0fda6fd8.js +0 -703
  114. package/lib/node/USE_CLIENT_BUNDLE-c57c9376.cjs +0 -21
  115. package/lib/node/USE_SERVER_BUNDLE-15a235fc.js +0 -11
  116. package/lib/node/USE_SERVER_BUNDLE-5472e997.cjs +0 -1
  117. package/lib/node/bundle-40b09581.js +0 -2950
  118. package/lib/node/bundle-acffe20a.cjs +0 -216
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-65950ed4.cjs"),e=require("./bundle-aff841a2.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-3ea7f606.cjs");require("next/navigation");require("lru-cache");exports.BuilderContext=t.builderContext;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;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;
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;
@@ -1,32 +1,31 @@
1
- import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-1c35fc0a.js";
2
- import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-763c7cf6.js";
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
- l as Blocks,
10
- n as BuilderContext,
11
- m as Button,
12
- f as Columns,
13
- B as Content,
14
- c as Fragment,
15
- p as Image,
16
- g as Section,
17
- C as Symbol,
18
- E as Text,
19
- d as Video,
20
- S as _processContentResult,
21
- x as createRegisterComponentMessage,
22
- h as fetchBuilderProps,
23
- b as fetchEntries,
24
- y as fetchOneEntry,
25
- F as getBuilderSearchParams,
26
- P as isEditing,
27
- T as isPreviewing,
28
- k as register,
29
- v as setEditorSettings,
30
- R as subscribeToEditor,
31
- V as track
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
+ };