@builder.io/react 6.0.5-8 → 7.0.0-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/dist/builder-react-lite.cjs.js +1 -1
- package/dist/builder-react-lite.cjs.js.map +1 -1
- package/dist/builder-react-lite.esm.js +1 -1
- package/dist/builder-react-lite.esm.js.map +1 -1
- package/dist/builder-react.browser.js +2 -2
- package/dist/builder-react.browser.js.map +1 -1
- package/dist/builder-react.cjs.js +1 -1
- package/dist/builder-react.cjs.js.map +1 -1
- package/dist/builder-react.es5.js +1 -1
- package/dist/builder-react.es5.js.map +1 -1
- package/dist/builder-react.unpkg.js +2 -2
- package/dist/builder-react.unpkg.js.map +1 -1
- package/dist/lib/package.json +2 -2
- package/dist/lib/src/blocks/Symbol.js +2 -18
- package/dist/lib/src/blocks/Symbol.js.map +1 -1
- package/dist/lib/src/sdk-version.js +1 -1
- package/dist/types/src/components/builder-content.component.d.ts +3 -0
- package/dist/types/src/sdk-version.d.ts +1 -1
- package/package.json +3 -4
- package/src/blocks/Symbol.tsx +3 -25
- package/src/components/core-react.code-workspace +14 -0
package/dist/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/builder-react.cjs.js",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"react-dom": ">=16.8.0 || ^19.0.0-rc"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@builder.io/sdk": "
|
|
100
|
+
"@builder.io/sdk": "5.0.0-0",
|
|
101
101
|
"@emotion/core": "^10.0.17",
|
|
102
102
|
"hash-sum": "^2.0.0",
|
|
103
103
|
"isolated-vm": "^5.0.0",
|
|
@@ -62,7 +62,6 @@ var SymbolComponent = /** @class */ (function (_super) {
|
|
|
62
62
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
63
63
|
_this.ref = null;
|
|
64
64
|
_this.staticRef = null;
|
|
65
|
-
_this.isEditingThisSymbol = false;
|
|
66
65
|
return _this;
|
|
67
66
|
}
|
|
68
67
|
Object.defineProperty(SymbolComponent.prototype, "placeholder", {
|
|
@@ -73,19 +72,10 @@ var SymbolComponent = /** @class */ (function (_super) {
|
|
|
73
72
|
configurable: true
|
|
74
73
|
});
|
|
75
74
|
SymbolComponent.prototype.componentDidMount = function () {
|
|
76
|
-
var _this = this;
|
|
77
75
|
var _a, _b, _c;
|
|
78
76
|
if (this.useStatic && this.staticRef && refs[(_a = this.props.builderBlock) === null || _a === void 0 ? void 0 : _a.id]) {
|
|
79
77
|
(_b = this.staticRef.parentNode) === null || _b === void 0 ? void 0 : _b.replaceChild(refs[(_c = this.props.builderBlock) === null || _c === void 0 ? void 0 : _c.id], this.staticRef);
|
|
80
78
|
}
|
|
81
|
-
sdk_1.Builder.nextTick(function () {
|
|
82
|
-
var _a = _this.props.symbol || {}, model = _a.model, entry = _a.entry;
|
|
83
|
-
// allows editing of symbols in the context of a parent page
|
|
84
|
-
_this.isEditingThisSymbol = Boolean(sdk_1.Builder.isEditing &&
|
|
85
|
-
model === sdk_1.builder.editingModel &&
|
|
86
|
-
entry &&
|
|
87
|
-
location.search.includes("overrides.".concat(entry)));
|
|
88
|
-
});
|
|
89
79
|
};
|
|
90
80
|
Object.defineProperty(SymbolComponent.prototype, "useStatic", {
|
|
91
81
|
get: function () {
|
|
@@ -116,25 +106,19 @@ var SymbolComponent = /** @class */ (function (_super) {
|
|
|
116
106
|
if (!(model && (entry || dynamic)) && !((_a = content === null || content === void 0 ? void 0 : content.data) === null || _a === void 0 ? void 0 : _a.blocksJs) && !inline) {
|
|
117
107
|
showPlaceholder = true;
|
|
118
108
|
}
|
|
119
|
-
if (this.isEditingThisSymbol) {
|
|
120
|
-
showPlaceholder = false;
|
|
121
|
-
}
|
|
122
109
|
var key = dynamic ? undefined : [model, entry].join(':');
|
|
123
110
|
var dataString = sdk_1.Builder.isEditing ? null : data && size(data) && (0, hash_sum_1.default)(data);
|
|
124
111
|
if (key && dataString && dataString.length < 300) {
|
|
125
112
|
key += ':' + dataString;
|
|
126
113
|
}
|
|
127
114
|
var attributes = this.props.attributes || {};
|
|
128
|
-
return ((0, core_1.jsx)(builder_store_1.BuilderStoreContext.Consumer, { key: (model || 'no model') + ':' + (entry || 'no entry'
|
|
115
|
+
return ((0, core_1.jsx)(builder_store_1.BuilderStoreContext.Consumer, { key: (model || 'no model') + ':' + (entry || 'no entry') }, function (state) {
|
|
129
116
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
130
117
|
var builderComponentKey = "".concat(key, "_").concat(((_a = state === null || state === void 0 ? void 0 : state.state) === null || _a === void 0 ? void 0 : _a.locale) || 'Default');
|
|
131
118
|
return ((0, core_1.jsx)(TagName, __assign({ "data-model": model }, attributes, { className: (attributes.class || attributes.className || '') +
|
|
132
119
|
' builder-symbol' +
|
|
133
120
|
((symbol === null || symbol === void 0 ? void 0 : symbol.inline) ? ' builder-inline-symbol' : '') +
|
|
134
|
-
((symbol === null || symbol === void 0 ? void 0 : symbol.dynamic) || _this.props.dynamic ? ' builder-dynamic-symbol' : '') }), showPlaceholder ? (_this.placeholder) : ((0, core_1.jsx)(builder_component_component_1.BuilderComponent, __assign({}, (ownerId && { apiKey: ownerId }), (((_b = state.state) === null || _b === void 0 ? void 0 : _b.locale) && { locale: state.state.locale }), { isChild: true, ref: function (ref) { return (_this.ref = ref); }, context: __assign(__assign({}, state.context), { symbolId: (_c = _this.props.builderBlock) === null || _c === void 0 ? void 0 : _c.id }), model: model, entry: entry, data: __assign(__assign(__assign({}, data), (!!_this.props.inheritState && (0, utils_1.omit)(state.state, 'children'))), (_j = (_h = (_g = (_f = (_e = (_d = _this.props.builderBlock) === null || _d === void 0 ? void 0 : _d.component) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.symbol) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.state), renderLink: state.renderLink, inlineContent: symbol === null || symbol === void 0 ? void 0 : symbol.inline }, (content && { content: content }), { key: builderComponentKey, options:
|
|
135
|
-
key: builderComponentKey,
|
|
136
|
-
noEditorUpdates: true,
|
|
137
|
-
})), codegen: !!((_k = content === null || content === void 0 ? void 0 : content.data) === null || _k === void 0 ? void 0 : _k.blocksJs), hydrate: (_l = state.state) === null || _l === void 0 ? void 0 : _l._hydrate, builderBlock: _this.props.builderBlock, dataOnly: _this.props.dataOnly }), _this.props.children))));
|
|
121
|
+
((symbol === null || symbol === void 0 ? void 0 : symbol.dynamic) || _this.props.dynamic ? ' builder-dynamic-symbol' : '') }), showPlaceholder ? (_this.placeholder) : ((0, core_1.jsx)(builder_component_component_1.BuilderComponent, __assign({}, (ownerId && { apiKey: ownerId }), (((_b = state.state) === null || _b === void 0 ? void 0 : _b.locale) && { locale: state.state.locale }), { isChild: true, ref: function (ref) { return (_this.ref = ref); }, context: __assign(__assign({}, state.context), { symbolId: (_c = _this.props.builderBlock) === null || _c === void 0 ? void 0 : _c.id }), model: model, entry: entry, data: __assign(__assign(__assign({}, data), (!!_this.props.inheritState && (0, utils_1.omit)(state.state, 'children'))), (_j = (_h = (_g = (_f = (_e = (_d = _this.props.builderBlock) === null || _d === void 0 ? void 0 : _d.component) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.symbol) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.state), renderLink: state.renderLink, inlineContent: symbol === null || symbol === void 0 ? void 0 : symbol.inline }, (content && { content: content }), { key: builderComponentKey, options: { key: builderComponentKey, noEditorUpdates: true }, codegen: !!((_k = content === null || content === void 0 ? void 0 : content.data) === null || _k === void 0 ? void 0 : _k.blocksJs), hydrate: (_l = state.state) === null || _l === void 0 ? void 0 : _l._hydrate, builderBlock: _this.props.builderBlock, dataOnly: _this.props.dataOnly }), _this.props.children))));
|
|
138
122
|
}));
|
|
139
123
|
};
|
|
140
124
|
return SymbolComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Symbol.js","sourceRoot":"","sources":["../../../../src/blocks/Symbol.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,eAAe;AACf,sCAAoC;AACpC,gDAAiD;AACjD,yFAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"Symbol.js","sourceRoot":"","sources":["../../../../src/blocks/Symbol.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,eAAe;AACf,sCAAoC;AACpC,gDAAiD;AACjD,yFAA6E;AAC7E,uCAA0D;AAC1D,sDAA4B;AAC5B,iDAA+C;AAC/C,wDAA6D;AAC7D,0DAAwD;AACxD,4CAA0C;AAE1C,IAAM,IAAI,GAAG,UAAC,KAAa,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAzB,CAAyB,CAAC;AAE1D,IAAM,SAAS,GAAG,aAAO,CAAC,SAAS,IAAI,SAAS,IAAI,MAAM,CAAC;AAE3D,IAAM,IAAI,GAA4B,EAAE,CAAC;AAEzC,IAAI,aAAO,CAAC,SAAS,EAAE;IACrB,IAAI;QACF,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,CAAC,CAAC,OAAO,CAAC,UAAA,EAAE;YACzE,IAAM,EAAE,GAAI,EAAqB,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;YACxE,IAAI,EAAE,EAAE;gBACN,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;aACf;QACH,CAAC,CAAC,CAAC;KACJ;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CA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;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,UAAU;SACjB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,UAAU,EAAE,qDAAqD;YACjE,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;SACjB;QACD;YACE,IAAI,EAAE,cAAc;YACpB,UAAU,EAAE,6CAA6C;YACzD,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,SAAS;YACvB,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,UAAU,EACR,oGAAoG;YACtG,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,SAAS;YACvB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;SACjB;QACD;YACE,IAAI,EAAE,aAAa;YACnB,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,SAAS;SAChB;KACF;CACF,CAAC,CAAC"}
|
|
@@ -57,6 +57,7 @@ export declare class BuilderContent<ContentType extends object = any> extends Re
|
|
|
57
57
|
get renderedVariantId(): any;
|
|
58
58
|
get options(): {
|
|
59
59
|
apiVersion?: "v1" | undefined;
|
|
60
|
+
apiEndpoint?: "content" | "query" | undefined;
|
|
60
61
|
fetchOptions?: object | undefined;
|
|
61
62
|
userAttributes?: import("@builder.io/sdk/dist/src/builder.class").UserAttributes | undefined;
|
|
62
63
|
url?: string | undefined;
|
|
@@ -96,6 +97,7 @@ export declare class BuilderContent<ContentType extends object = any> extends Re
|
|
|
96
97
|
} | {
|
|
97
98
|
apiVersion?: "v3" | undefined;
|
|
98
99
|
enrich?: boolean | undefined;
|
|
100
|
+
apiEndpoint?: "content" | "query" | undefined;
|
|
99
101
|
fetchOptions?: object | undefined;
|
|
100
102
|
userAttributes?: import("@builder.io/sdk/dist/src/builder.class").UserAttributes | undefined;
|
|
101
103
|
url?: string | undefined;
|
|
@@ -135,6 +137,7 @@ export declare class BuilderContent<ContentType extends object = any> extends Re
|
|
|
135
137
|
} | {
|
|
136
138
|
apiVersion?: undefined;
|
|
137
139
|
enrich?: boolean | undefined;
|
|
140
|
+
apiEndpoint?: "content" | "query" | undefined;
|
|
138
141
|
fetchOptions?: object | undefined;
|
|
139
142
|
userAttributes?: import("@builder.io/sdk/dist/src/builder.class").UserAttributes | undefined;
|
|
140
143
|
url?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "7.0.0-0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/builder-react.cjs.js",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"react-dom": ">=16.8.0 || ^19.0.0-rc"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@builder.io/sdk": "
|
|
100
|
+
"@builder.io/sdk": "5.0.0-0",
|
|
101
101
|
"@emotion/core": "^10.0.17",
|
|
102
102
|
"hash-sum": "^2.0.0",
|
|
103
103
|
"isolated-vm": "^5.0.0",
|
|
@@ -105,6 +105,5 @@
|
|
|
105
105
|
},
|
|
106
106
|
"installConfig": {
|
|
107
107
|
"hoistingLimits": "workspaces"
|
|
108
|
-
}
|
|
109
|
-
"stableVersion": "6.0.5-7"
|
|
108
|
+
}
|
|
110
109
|
}
|
package/src/blocks/Symbol.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from '@emotion/core';
|
|
3
3
|
import React, { PropsWithChildren } from 'react';
|
|
4
4
|
import { BuilderComponent } from '../components/builder-component.component';
|
|
5
|
-
import { Builder, BuilderElement
|
|
5
|
+
import { Builder, BuilderElement } from '@builder.io/sdk';
|
|
6
6
|
import hash from 'hash-sum';
|
|
7
7
|
import { NoWrap } from '../components/no-wrap';
|
|
8
8
|
import { BuilderStoreContext } from '../store/builder-store';
|
|
@@ -50,7 +50,6 @@ export interface SymbolProps {
|
|
|
50
50
|
class SymbolComponent extends React.Component<PropsWithChildren<SymbolProps>> {
|
|
51
51
|
ref: BuilderComponent | null = null;
|
|
52
52
|
staticRef: HTMLDivElement | null = null;
|
|
53
|
-
isEditingThisSymbol = false;
|
|
54
53
|
|
|
55
54
|
get placeholder() {
|
|
56
55
|
return (
|
|
@@ -65,16 +64,6 @@ class SymbolComponent extends React.Component<PropsWithChildren<SymbolProps>> {
|
|
|
65
64
|
if (this.useStatic && this.staticRef && refs[this.props.builderBlock?.id!]) {
|
|
66
65
|
this.staticRef.parentNode?.replaceChild(refs[this.props.builderBlock?.id!], this.staticRef);
|
|
67
66
|
}
|
|
68
|
-
Builder.nextTick(() => {
|
|
69
|
-
const { model, entry } = this.props.symbol || {};
|
|
70
|
-
// allows editing of symbols in the context of a parent page
|
|
71
|
-
this.isEditingThisSymbol = Boolean(
|
|
72
|
-
Builder.isEditing &&
|
|
73
|
-
model === builder.editingModel &&
|
|
74
|
-
entry &&
|
|
75
|
-
location.search.includes(`overrides.${entry}`)
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
67
|
}
|
|
79
68
|
|
|
80
69
|
get useStatic() {
|
|
@@ -108,10 +97,6 @@ class SymbolComponent extends React.Component<PropsWithChildren<SymbolProps>> {
|
|
|
108
97
|
showPlaceholder = true;
|
|
109
98
|
}
|
|
110
99
|
|
|
111
|
-
if (this.isEditingThisSymbol) {
|
|
112
|
-
showPlaceholder = false;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
100
|
let key = dynamic ? undefined : [model, entry].join(':');
|
|
116
101
|
const dataString = Builder.isEditing ? null : data && size(data) && hash(data);
|
|
117
102
|
|
|
@@ -120,9 +105,7 @@ class SymbolComponent extends React.Component<PropsWithChildren<SymbolProps>> {
|
|
|
120
105
|
}
|
|
121
106
|
const attributes = this.props.attributes || {};
|
|
122
107
|
return (
|
|
123
|
-
<BuilderStoreContext.Consumer
|
|
124
|
-
key={(model || 'no model') + ':' + (entry || 'no entry' + this.isEditingThisSymbol)}
|
|
125
|
-
>
|
|
108
|
+
<BuilderStoreContext.Consumer key={(model || 'no model') + ':' + (entry || 'no entry')}>
|
|
126
109
|
{state => {
|
|
127
110
|
const builderComponentKey = `${key}_${state?.state?.locale || 'Default'}`;
|
|
128
111
|
return (
|
|
@@ -156,12 +139,7 @@ class SymbolComponent extends React.Component<PropsWithChildren<SymbolProps>> {
|
|
|
156
139
|
inlineContent={symbol?.inline}
|
|
157
140
|
{...(content && { content })}
|
|
158
141
|
key={builderComponentKey}
|
|
159
|
-
options={{
|
|
160
|
-
...(!this.isEditingThisSymbol && {
|
|
161
|
-
key: builderComponentKey,
|
|
162
|
-
noEditorUpdates: true,
|
|
163
|
-
}),
|
|
164
|
-
}}
|
|
142
|
+
options={{ key: builderComponentKey, noEditorUpdates: true }}
|
|
165
143
|
codegen={!!content?.data?.blocksJs}
|
|
166
144
|
hydrate={state.state?._hydrate}
|
|
167
145
|
builderBlock={this.props.builderBlock}
|