@builder.io/sdk-react 0.12.2 → 0.12.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/lib/browser/index.cjs +6 -4
- package/lib/browser/index.mjs +157 -157
- package/lib/edge/index.cjs +6 -4
- package/lib/edge/index.mjs +59 -59
- package/lib/node/index.cjs +6 -4
- package/lib/node/index.mjs +29 -29
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
package/lib/node/index.mjs
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useState, useContext, createElement, useRef, useEffect } from "react";
|
|
4
4
|
import { i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined, T as TARGET, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-46908b1b.js";
|
|
5
5
|
import { _ as H, h as K, f as z, g as q, e as Y, d as G, s as J, t as Q } from "./server-entry-46908b1b.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
function Button(e) {
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/* @__PURE__ */ jsx("style", { children: `.button-fdf49de0 {
|
|
28
|
-
all: unset;
|
|
29
|
-
}` })
|
|
30
|
-
] });
|
|
8
|
+
return /* @__PURE__ */ jsx(Fragment, { children: e.link ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
9
|
+
"a",
|
|
10
|
+
{
|
|
11
|
+
...e.attributes,
|
|
12
|
+
href: e.link,
|
|
13
|
+
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
14
|
+
role: "button",
|
|
15
|
+
children: e.text
|
|
16
|
+
}
|
|
17
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
role: "button",
|
|
21
|
+
...e.attributes,
|
|
22
|
+
className: `builder-button ${e.attributes.className}`,
|
|
23
|
+
style: e.attributes.style,
|
|
24
|
+
children: e.text
|
|
25
|
+
}
|
|
26
|
+
) }) });
|
|
31
27
|
}
|
|
32
28
|
const builderContext = createContext({
|
|
33
29
|
content: null,
|
|
@@ -2124,7 +2120,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2124
2120
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2125
2121
|
}
|
|
2126
2122
|
};
|
|
2127
|
-
}, SDK_VERSION = "0.12.
|
|
2123
|
+
}, SDK_VERSION = "0.12.3", registerInsertMenu = () => {
|
|
2128
2124
|
register("insertMenu", {
|
|
2129
2125
|
name: "_default",
|
|
2130
2126
|
default: !0,
|
|
@@ -2211,7 +2207,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2211
2207
|
})));
|
|
2212
2208
|
};
|
|
2213
2209
|
function EnableEditor(e) {
|
|
2214
|
-
var j, P, A, F, _, V,
|
|
2210
|
+
var j, P, A, F, _, V, $;
|
|
2215
2211
|
const t = useRef(null), [n, i] = useState(() => 0);
|
|
2216
2212
|
useState(() => !0);
|
|
2217
2213
|
function o(u) {
|
|
@@ -2240,8 +2236,8 @@ function EnableEditor(e) {
|
|
|
2240
2236
|
breakpoints: ((p = u == null ? void 0 : u.meta) == null ? void 0 : p.breakpoints) || ((B = (k = e.builderContextSignal.content) == null ? void 0 : k.meta) == null ? void 0 : B.breakpoints)
|
|
2241
2237
|
}
|
|
2242
2238
|
};
|
|
2243
|
-
e.setBuilderContextSignal((
|
|
2244
|
-
|
|
2239
|
+
e.setBuilderContextSignal((N) => ({
|
|
2240
|
+
...N,
|
|
2245
2241
|
content: m
|
|
2246
2242
|
}));
|
|
2247
2243
|
}
|
|
@@ -2472,7 +2468,7 @@ function EnableEditor(e) {
|
|
|
2472
2468
|
"aria-hidden": !0
|
|
2473
2469
|
},
|
|
2474
2470
|
...e.contentWrapperProps,
|
|
2475
|
-
className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || ((
|
|
2471
|
+
className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || (($ = e.content) == null ? void 0 : $.id)}`
|
|
2476
2472
|
},
|
|
2477
2473
|
e.children
|
|
2478
2474
|
) }) : null });
|
|
@@ -2523,6 +2519,10 @@ ${getFontCss({
|
|
|
2523
2519
|
customFonts: e.customFonts
|
|
2524
2520
|
})}
|
|
2525
2521
|
|
|
2522
|
+
.builder-button {
|
|
2523
|
+
all: unset;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
2526
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
2527
2527
|
margin: 0;
|
|
2528
2528
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.12.
|
|
1
|
+
export declare const SDK_VERSION = "0.12.3";
|