@builder.io/react 5.0.8 → 5.0.10

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/react",
3
- "version": "5.0.8",
3
+ "version": "5.0.10",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/builder-react.cjs.js",
@@ -23,7 +23,8 @@
23
23
  "scripts": {
24
24
  "docs": "typedoc",
25
25
  "lint": "tslint -t codeFrame '../**/*.ts' 'test/**/*.ts'",
26
- "build": "rimraf dist && NODE_ENV=production tsc --module commonjs && rollup -c rollup.config.ts",
26
+ "set-sdk-version": "bash ./scripts/set-sdk-version.sh",
27
+ "build": "rimraf dist && NODE_ENV=production tsc --module commonjs && rollup -c rollup.config.ts && yarn set-sdk-version",
27
28
  "build:docs": "typedoc --out docs --target es6 --theme minimal --mode file src",
28
29
  "start": "rollup -c rollup.config.ts -w",
29
30
  "test": "jest",
@@ -92,8 +93,8 @@
92
93
  "prop-types": "^15.7.2"
93
94
  },
94
95
  "peerDependencies": {
95
- "react": ">=16.8.0",
96
- "react-dom": ">=16.8.0"
96
+ "react": ">=16.8.0 || ^19.0.0-rc",
97
+ "react-dom": ">=16.8.0 || ^19.0.0-rc"
97
98
  },
98
99
  "dependencies": {
99
100
  "@builder.io/sdk": "workspace:*",
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- var package_json_1 = require("../../package.json");
4
+ var sdk_version_1 = require("../sdk-version");
5
5
  if (typeof window !== 'undefined') {
6
6
  (_a = window.parent) === null || _a === void 0 ? void 0 : _a.postMessage({
7
7
  type: 'builder.isReactSdk',
@@ -11,7 +11,7 @@ if (typeof window !== 'undefined') {
11
11
  supportsCustomBreakpoints: true,
12
12
  supportsGlobalSymbols: true,
13
13
  blockLevelPersonalization: true,
14
- priorVersion: package_json_1.version,
14
+ version: sdk_version_1.SDK_VERSION,
15
15
  },
16
16
  }, '*');
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"init-editing.js","sourceRoot":"","sources":["../../../../src/scripts/init-editing.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAE7C,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAA,MAAM,CAAC,MAAM,0CAAE,WAAW,CACxB;QACE,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE;YACJ,KAAK,EAAE,IAAI;YACX,oBAAoB,EAAE,IAAI;YAC1B,yBAAyB,EAAE,IAAI;YAC/B,qBAAqB,EAAE,IAAI;YAC3B,yBAAyB,EAAE,IAAI;YAC/B,YAAY,EAAE,sBAAO;SACtB;KACF,EACD,GAAG,CACJ,CAAC;CACH"}
1
+ {"version":3,"file":"init-editing.js","sourceRoot":"","sources":["../../../../src/scripts/init-editing.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAE7C,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAA,MAAM,CAAC,MAAM,0CAAE,WAAW,CACxB;QACE,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE;YACJ,KAAK,EAAE,IAAI;YACX,oBAAoB,EAAE,IAAI;YAC1B,yBAAyB,EAAE,IAAI;YAC/B,qBAAqB,EAAE,IAAI;YAC3B,yBAAyB,EAAE,IAAI;YAC/B,OAAO,EAAE,yBAAW;SACrB;KACF,EACD,GAAG,CACJ,CAAC;CACH"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SDK_VERSION = void 0;
4
+ exports.SDK_VERSION = '5.0.10';
5
+ //# sourceMappingURL=sdk-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-version.js","sourceRoot":"","sources":["../../../src/sdk-version.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,4BAA4B,CAAC"}
@@ -81,7 +81,7 @@ export declare class BuilderContent<ContentType extends object = any> extends Re
81
81
  fields?: string | undefined;
82
82
  omit?: string | undefined;
83
83
  key?: string | undefined;
84
- format?: "react" | "email" | "html" | "solid" | "amp" | undefined;
84
+ format?: "email" | "html" | "react" | "solid" | "amp" | undefined;
85
85
  noWrap?: true | undefined;
86
86
  rev?: string | undefined;
87
87
  static?: boolean | undefined;
@@ -121,7 +121,7 @@ export declare class BuilderContent<ContentType extends object = any> extends Re
121
121
  fields?: string | undefined;
122
122
  omit?: string | undefined;
123
123
  key?: string | undefined;
124
- format?: "react" | "email" | "html" | "solid" | "amp" | undefined;
124
+ format?: "email" | "html" | "react" | "solid" | "amp" | undefined;
125
125
  noWrap?: true | undefined;
126
126
  rev?: string | undefined;
127
127
  static?: boolean | undefined;
@@ -161,7 +161,7 @@ export declare class BuilderContent<ContentType extends object = any> extends Re
161
161
  fields?: string | undefined;
162
162
  omit?: string | undefined;
163
163
  key?: string | undefined;
164
- format?: "react" | "email" | "html" | "solid" | "amp" | undefined;
164
+ format?: "email" | "html" | "react" | "solid" | "amp" | undefined;
165
165
  noWrap?: true | undefined;
166
166
  rev?: string | undefined;
167
167
  static?: boolean | undefined;
@@ -0,0 +1 @@
1
+ export declare const SDK_VERSION = "5.0.10";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/react",
3
- "version": "5.0.8",
3
+ "version": "5.0.10",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/builder-react.cjs.js",
@@ -23,7 +23,8 @@
23
23
  "scripts": {
24
24
  "docs": "typedoc",
25
25
  "lint": "tslint -t codeFrame '../**/*.ts' 'test/**/*.ts'",
26
- "build": "rimraf dist && NODE_ENV=production tsc --module commonjs && rollup -c rollup.config.ts",
26
+ "set-sdk-version": "bash ./scripts/set-sdk-version.sh",
27
+ "build": "rimraf dist && NODE_ENV=production tsc --module commonjs && rollup -c rollup.config.ts && yarn set-sdk-version",
27
28
  "build:docs": "typedoc --out docs --target es6 --theme minimal --mode file src",
28
29
  "start": "rollup -c rollup.config.ts -w",
29
30
  "test": "jest",
@@ -92,11 +93,11 @@
92
93
  "prop-types": "^15.7.2"
93
94
  },
94
95
  "peerDependencies": {
95
- "react": ">=16.8.0",
96
- "react-dom": ">=16.8.0"
96
+ "react": ">=16.8.0 || ^19.0.0-rc",
97
+ "react-dom": ">=16.8.0 || ^19.0.0-rc"
97
98
  },
98
99
  "dependencies": {
99
- "@builder.io/sdk": "3.0.5",
100
+ "@builder.io/sdk": "3.0.6",
100
101
  "@emotion/core": "^10.0.17",
101
102
  "hash-sum": "^2.0.0",
102
103
  "isolated-vm": "^5.0.0",
@@ -0,0 +1,25 @@
1
+ #!/bin/bash
2
+
3
+ # This file finds all instances of `UNKNOWN_VERSION_TO_REPLACE` within `dist` and replaces them with the real version.
4
+ # It stores the package version that is sent to the visual editor.
5
+ #
6
+ # This script must execute after `npm version` (which bumps the version number), but before `npm publish`.
7
+
8
+ set -o nounset
9
+
10
+ LOCAL_DIR=$(pwd)
11
+ if [[ "$LOCAL_DIR" =~ .*packages/react*$ ]]; then
12
+ echo "Setting SDK Version for React Gen1 SDK in '$LOCAL_DIR'."
13
+ else
14
+ echo "Must run this script from the root of the React Gen1 SDK directory, e.g. 'packages/react'."
15
+ echo "Instead, you ran it from '$LOCAL_DIR'."
16
+ echo "Exiting."
17
+ exit 1
18
+ fi
19
+
20
+ # get version from package.json
21
+ VERSION=$(grep -o '"version": *"[^"]*"' package.json | sed 's/"version": "\(.*\)"/\1/')
22
+ echo "Found version number: $VERSION"
23
+
24
+ # Find all instances of `UNKNOWN_VERSION_TO_REPLACE` within `dist` and replace with the real version
25
+ find dist -type f -exec sed -i.bak "s/UNKNOWN_VERSION_TO_REPLACE/$VERSION/g" {} + && find dist -name "*.bak" -type f -delete
@@ -1,4 +1,4 @@
1
- import { version } from '../../package.json';
1
+ import { SDK_VERSION } from '../sdk-version';
2
2
 
3
3
  if (typeof window !== 'undefined') {
4
4
  window.parent?.postMessage(
@@ -10,7 +10,7 @@ if (typeof window !== 'undefined') {
10
10
  supportsCustomBreakpoints: true,
11
11
  supportsGlobalSymbols: true,
12
12
  blockLevelPersonalization: true,
13
- priorVersion: version,
13
+ version: SDK_VERSION,
14
14
  },
15
15
  },
16
16
  '*'
@@ -0,0 +1 @@
1
+ export const SDK_VERSION = 'UNKNOWN_VERSION_TO_REPLACE';