@builder.io/sdk-solid 0.0.8-24 → 0.0.8-25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-solid",
3
- "version": "0.0.8-24",
3
+ "version": "0.0.8-25",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./src/solid-index.jsx",
@@ -1,4 +1,4 @@
1
- import { markSerializable } from "../util";
1
+ import { markSerializable } from "../util.js";
2
2
  const componentInfo = {
3
3
  name: "Columns",
4
4
  builtIn: true,
@@ -1,4 +1,4 @@
1
- import { markSerializable } from "../util";
1
+ import { markSerializable } from "../util.js";
2
2
  const componentInfo = {
3
3
  name: "Embed",
4
4
  static: true,
@@ -1,5 +1,5 @@
1
1
  import { on, createEffect, createSignal } from "solid-js";
2
- import { isJsScript } from "./helpers";
2
+ import { isJsScript } from "./helpers.js";
3
3
 
4
4
  function Embed(props) {
5
5
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
@@ -1,4 +1,4 @@
1
- import { markSerializable } from "../util";
1
+ import { markSerializable } from "../util.js";
2
2
  const componentInfo = {
3
3
  name: "Image",
4
4
  static: true,
@@ -1,6 +1,6 @@
1
1
  import { Show } from "solid-js";
2
2
  import { css } from "solid-styled-components";
3
- import { getSrcSet } from "./image.helpers";
3
+ import { getSrcSet } from "./image.helpers.js";
4
4
 
5
5
  function Image(props) {
6
6
  function srcSetToUse() {
@@ -1,6 +1,6 @@
1
1
  import { useContext, onMount, on, createEffect, createSignal } from "solid-js";
2
2
  import RenderContent from "../../components/render-content/render-content.jsx";
3
- import BuilderContext from "../../context/builder.context";
3
+ import BuilderContext from "../../context/builder.context.js";
4
4
  import { getContent } from "../../functions/get-content/index.js";
5
5
 
6
6
  function Symbol(props) {
@@ -1,5 +1,5 @@
1
1
  import { Dynamic } from "solid-js/web";
2
- import BuilderContext from "../../context/builder.context";
2
+ import BuilderContext from "../../context/builder.context.js";
3
3
  import RenderBlock from "./render-block.jsx";
4
4
 
5
5
  function RenderRepeatedBlock(props) {
@@ -1,6 +1,6 @@
1
1
  import { useContext, Show, For } from "solid-js";
2
2
  import { css } from "solid-styled-components";
3
- import BuilderContext from "../context/builder.context";
3
+ import BuilderContext from "../context/builder.context.js";
4
4
  import { isEditing } from "../functions/is-editing.js";
5
5
  import BlockStyles from "./render-block/block-styles.jsx";
6
6
  import RenderBlock from "./render-block/render-block.jsx";
@@ -2,7 +2,7 @@ import { Show, onMount, on, createEffect, createSignal } from "solid-js";
2
2
  import { Dynamic } from "solid-js/web";
3
3
  import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
4
4
  import { TARGET } from "../../constants/target.js";
5
- import BuilderContext from "../../context/builder.context";
5
+ import BuilderContext from "../../context/builder.context.js";
6
6
  import { evaluate } from "../../functions/evaluate.js";
7
7
  import { getContent } from "../../functions/get-content/index.js";
8
8
  import { getFetch } from "../../functions/get-fetch.js";
@@ -15,25 +15,25 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  import { default as Button } from "../blocks/button/button.jsx";
18
- import { componentInfo as buttonComponentInfo } from "../blocks/button/component-info";
18
+ import { componentInfo as buttonComponentInfo } from "../blocks/button/component-info.js";
19
19
  import { default as Columns } from "../blocks/columns/columns.jsx";
20
- import { componentInfo as columnsComponentInfo } from "../blocks/columns/component-info";
21
- import { componentInfo as fragmentComponentInfo } from "../blocks/fragment/component-info";
20
+ import { componentInfo as columnsComponentInfo } from "../blocks/columns/component-info.js";
21
+ import { componentInfo as fragmentComponentInfo } from "../blocks/fragment/component-info.js";
22
22
  import { default as Fragment } from "../blocks/fragment/fragment.jsx";
23
- import { componentInfo as imageComponentInfo } from "../blocks/image/component-info";
23
+ import { componentInfo as imageComponentInfo } from "../blocks/image/component-info.js";
24
24
  import { default as Image } from "../blocks/image/image.jsx";
25
- import { componentInfo as sectionComponentInfo } from "../blocks/section/component-info";
25
+ import { componentInfo as sectionComponentInfo } from "../blocks/section/component-info.js";
26
26
  import { default as Section } from "../blocks/section/section.jsx";
27
- import { componentInfo as symbolComponentInfo } from "../blocks/symbol/component-info";
27
+ import { componentInfo as symbolComponentInfo } from "../blocks/symbol/component-info.js";
28
28
  import { default as Symbol } from "../blocks/symbol/symbol.jsx";
29
- import { componentInfo as textComponentInfo } from "../blocks/text/component-info";
29
+ import { componentInfo as textComponentInfo } from "../blocks/text/component-info.js";
30
30
  import { default as Text } from "../blocks/text/text.jsx";
31
- import { componentInfo as videoComponentInfo } from "../blocks/video/component-info";
31
+ import { componentInfo as videoComponentInfo } from "../blocks/video/component-info.js";
32
32
  import { default as Video } from "../blocks/video/video.jsx";
33
- import { componentInfo as embedComponentInfo } from "../blocks/embed/component-info";
33
+ import { componentInfo as embedComponentInfo } from "../blocks/embed/component-info.js";
34
34
  import { default as embed } from "../blocks/embed/embed.jsx";
35
35
  import { default as Img } from "../blocks/img/img.jsx";
36
- import { componentInfo as imgComponentInfo } from "../blocks/img/component-info";
36
+ import { componentInfo as imgComponentInfo } from "../blocks/img/component-info.js";
37
37
  const getDefaultRegisteredComponents = () => [
38
38
  __spreadValues({ component: Columns }, columnsComponentInfo),
39
39
  __spreadValues({ component: Image }, imageComponentInfo),
@@ -1,4 +1,4 @@
1
- import { isBrowser } from "../is-browser";
1
+ import { isBrowser } from "../is-browser.js";
2
2
  const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
3
3
  const convertSearchParamsToQueryObject = (searchParams) => {
4
4
  const options = {};
@@ -52,7 +52,7 @@ function getContent(options) {
52
52
  }
53
53
  const generateContentUrl = (options) => {
54
54
  const {
55
- limit = 1,
55
+ limit = 30,
56
56
  userAttributes,
57
57
  query,
58
58
  noTraverse = false,
@@ -29,6 +29,26 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
+ var __async = (__this, __arguments, generator) => {
33
+ return new Promise((resolve, reject) => {
34
+ var fulfilled = (value) => {
35
+ try {
36
+ step(generator.next(value));
37
+ } catch (e) {
38
+ reject(e);
39
+ }
40
+ };
41
+ var rejected = (value) => {
42
+ try {
43
+ step(generator.throw(value));
44
+ } catch (e) {
45
+ reject(e);
46
+ }
47
+ };
48
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
49
+ step((generator = generator.apply(__this, __arguments)).next());
50
+ });
51
+ };
32
52
  import { TARGET } from "../constants/target.js";
33
53
  import { getSessionId } from "../helpers/sessionId.js";
34
54
  import { getVisitorId } from "../helpers/visitorId.js";
@@ -66,24 +86,28 @@ const createEvent = (_a) => {
66
86
  };
67
87
  };
68
88
  function track(eventProps) {
69
- if (!eventProps.canTrack) {
70
- return;
71
- }
72
- if (isEditing()) {
73
- return;
74
- }
75
- if (!(isBrowser() || TARGET === "reactNative")) {
76
- return;
77
- }
78
- return fetch(`https://builder.io/api/v1/track`, {
79
- method: "POST",
80
- body: JSON.stringify({
81
- events: [createEvent(eventProps)]
82
- }),
83
- headers: {
84
- "content-type": "application/json"
85
- },
86
- mode: "cors"
89
+ return __async(this, null, function* () {
90
+ if (!eventProps.canTrack) {
91
+ return;
92
+ }
93
+ if (isEditing()) {
94
+ return;
95
+ }
96
+ if (!(isBrowser() || TARGET === "reactNative")) {
97
+ return;
98
+ }
99
+ return fetch(`https://builder.io/api/v1/track`, {
100
+ method: "POST",
101
+ body: JSON.stringify({
102
+ events: [createEvent(eventProps)]
103
+ }),
104
+ headers: {
105
+ "content-type": "application/json"
106
+ },
107
+ mode: "cors"
108
+ }).catch((err) => {
109
+ console.error("Failed to track: ", err);
110
+ });
87
111
  });
88
112
  }
89
113
  export {
@@ -1,5 +1,5 @@
1
- import { isBrowser } from "../functions/is-browser";
2
- import { getTopLevelDomain } from "./url";
1
+ import { isBrowser } from "../functions/is-browser.js";
2
+ import { getTopLevelDomain } from "./url.js";
3
3
  const getCookie = ({
4
4
  name,
5
5
  canTrack
@@ -1,4 +1,4 @@
1
- import { camelToKebabCase } from "../functions/camel-to-kebab-case";
1
+ import { camelToKebabCase } from "../functions/camel-to-kebab-case.js";
2
2
  const convertStyleMaptoCSS = (style) => {
3
3
  const cssProps = Object.entries(style).map(([key, value]) => {
4
4
  if (typeof value === "string") {
@@ -1,4 +1,4 @@
1
- import { isBrowser } from "../functions/is-browser";
1
+ import { isBrowser } from "../functions/is-browser.js";
2
2
  const getLocalStorage = () => isBrowser() && typeof localStorage !== "undefined" ? localStorage : void 0;
3
3
  const getLocalStorageItem = ({
4
4
  key,
@@ -1,6 +1,6 @@
1
- import { getCookie, setCookie } from "./cookie";
2
- import { checkIsDefined } from "./nullable";
3
- import { uuid } from "./uuid";
1
+ import { getCookie, setCookie } from "./cookie.js";
2
+ import { checkIsDefined } from "./nullable.js";
3
+ import { uuid } from "./uuid.js";
4
4
  const SESSION_LOCAL_STORAGE_KEY = "builderSessionId";
5
5
  const getSessionId = ({ canTrack }) => {
6
6
  if (!canTrack) {
@@ -1,6 +1,6 @@
1
- import { getLocalStorageItem, setLocalStorageItem } from "./localStorage";
2
- import { checkIsDefined } from "./nullable";
3
- import { uuid } from "./uuid";
1
+ import { getLocalStorageItem, setLocalStorageItem } from "./localStorage.js";
2
+ import { checkIsDefined } from "./nullable.js";
3
+ import { uuid } from "./uuid.js";
4
4
  const VISITOR_LOCAL_STORAGE_KEY = "builderVisitorId";
5
5
  const getVisitorId = ({ canTrack }) => {
6
6
  if (!canTrack) {