@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.
@@ -1,33 +1,29 @@
1
1
  "use client";
2
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
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__ */ jsxs(Fragment, { children: [
9
- e.link ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
10
- "a",
11
- {
12
- ...e.attributes,
13
- href: e.link,
14
- target: e.openLinkInNewTab ? "_blank" : void 0,
15
- role: "button",
16
- children: e.text
17
- }
18
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
19
- "button",
20
- {
21
- ...e.attributes,
22
- style: e.attributes.style,
23
- className: e.attributes.className + " button-fdf49de0",
24
- children: e.text
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.2", registerInsertMenu = () => {
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, N;
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) || ((N = e.content) == null ? void 0 : N.id)}`
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react",
3
3
  "description": "Builder.io SDK for React",
4
- "version": "0.12.2",
4
+ "version": "0.12.3",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/react",
6
6
  "type": "module",
7
7
  "repository": {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.12.2";
1
+ export declare const SDK_VERSION = "0.12.3";