@builder.io/sdk-qwik 0.0.15 → 0.0.16

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.
Binary file
@@ -440,13 +440,13 @@ const RenderComponent = (props) => {
440
440
  children: props.componentRef ? /* @__PURE__ */ jsxRuntime.jsxs(props.componentRef, {
441
441
  ...markPropsMutable(props.componentOptions),
442
442
  children: [
443
- (props.blockChildren || []).map(function(child) {
443
+ (props.blockChildren || []).map((child) => {
444
444
  return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock$1, {
445
445
  block: child,
446
446
  context: props.context
447
447
  }, "render-block-" + child.id);
448
448
  }),
449
- (props.blockChildren || []).map(function(child) {
449
+ (props.blockChildren || []).map((child) => {
450
450
  return /* @__PURE__ */ jsxRuntime.jsx(BlockStyles$1, {
451
451
  block: child,
452
452
  context: props.context
@@ -592,7 +592,7 @@ const RenderBlock = (props) => {
592
592
  children: shouldWrap(props) ? !isEmptyHtmlElement(tagName2(props)) ? /* @__PURE__ */ jsxRuntime.jsxs(state.tagName, {
593
593
  ...attributes(props),
594
594
  children: [
595
- repeatItemData(props) ? (repeatItemData(props) || []).map(function(data, index) {
595
+ repeatItemData(props) ? (repeatItemData(props) || []).map((data, index) => {
596
596
  return /* @__PURE__ */ jsxRuntime.jsx(RenderRepeatedBlock$1, {
597
597
  repeatContext: data.context,
598
598
  block: data.block
@@ -601,13 +601,13 @@ const RenderBlock = (props) => {
601
601
  !repeatItemData(props) ? /* @__PURE__ */ jsxRuntime.jsx(RenderComponent$1, {
602
602
  ...renderComponentProps(props)
603
603
  }) : null,
604
- (childrenWithoutParentComponent(props) || []).map(function(child) {
604
+ (childrenWithoutParentComponent(props) || []).map((child) => {
605
605
  return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock, {
606
606
  block: child,
607
607
  context: props.context
608
608
  }, "render-block-" + child.id);
609
609
  }),
610
- (childrenWithoutParentComponent(props) || []).map(function(child) {
610
+ (childrenWithoutParentComponent(props) || []).map((child) => {
611
611
  return /* @__PURE__ */ jsxRuntime.jsx(BlockStyles$1, {
612
612
  block: child,
613
613
  context: props.context
@@ -674,13 +674,13 @@ const RenderBlocks = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) =
674
674
  state
675
675
  ]),
676
676
  children: [
677
- props.blocks ? (props.blocks || []).map(function(block) {
677
+ props.blocks ? (props.blocks || []).map((block) => {
678
678
  return /* @__PURE__ */ jsxRuntime.jsx(RenderBlock$1, {
679
679
  block,
680
680
  context: builderContext
681
681
  }, "render-block-" + block.id);
682
682
  }) : null,
683
- props.blocks ? (props.blocks || []).map(function(block) {
683
+ props.blocks ? (props.blocks || []).map((block) => {
684
684
  return /* @__PURE__ */ jsxRuntime.jsx(BlockStyles$1, {
685
685
  block,
686
686
  context: builderContext
@@ -737,7 +737,7 @@ const Columns = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
737
737
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
738
738
  class: "builder-columns div-Columns",
739
739
  style: columnsCssVars(props, state),
740
- children: (props.columns || []).map(function(column, index) {
740
+ children: (props.columns || []).map((column, index) => {
741
741
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
742
742
  class: "builder-column div-Columns-2",
743
743
  style: {
@@ -1707,9 +1707,9 @@ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
1707
1707
  const Embed = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
1708
1708
  const elem = qwik.useRef();
1709
1709
  const state = qwik.useStore({
1710
- ranInitFn: false,
1711
1710
  scriptsInserted: [],
1712
- scriptsRun: []
1711
+ scriptsRun: [],
1712
+ ranInitFn: false
1713
1713
  });
1714
1714
  qwik.useWatchQrl(qwik.inlinedQrl(({ track: track2 }) => {
1715
1715
  const [elem2, props2, state2] = qwik.useLexicalScope();
@@ -1894,7 +1894,7 @@ function getGlobalThis() {
1894
1894
  return self;
1895
1895
  return null;
1896
1896
  }
1897
- var __async$1 = (__this, __arguments, generator) => {
1897
+ var __async$2 = (__this, __arguments, generator) => {
1898
1898
  return new Promise((resolve, reject) => {
1899
1899
  var fulfilled = (value) => {
1900
1900
  try {
@@ -1915,7 +1915,7 @@ var __async$1 = (__this, __arguments, generator) => {
1915
1915
  });
1916
1916
  };
1917
1917
  function getFetch() {
1918
- return __async$1(this, null, function* () {
1918
+ return __async$2(this, null, function* () {
1919
1919
  const globalFetch = getGlobalThis().fetch;
1920
1920
  if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
1921
1921
  const nodeFetch = Promise.resolve().then(() => require("./index.d8c1e37f.cjs")).then((d) => d.default);
@@ -1982,7 +1982,7 @@ var __spreadValues$2 = (a, b) => {
1982
1982
  return a;
1983
1983
  };
1984
1984
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1985
- var __async = (__this, __arguments, generator) => {
1985
+ var __async$1 = (__this, __arguments, generator) => {
1986
1986
  return new Promise((resolve, reject) => {
1987
1987
  var fulfilled = (value) => {
1988
1988
  try {
@@ -2004,14 +2004,14 @@ var __async = (__this, __arguments, generator) => {
2004
2004
  };
2005
2005
  const fetch$ = getFetch();
2006
2006
  function getContent(options) {
2007
- return __async(this, null, function* () {
2007
+ return __async$1(this, null, function* () {
2008
2008
  return (yield getAllContent(__spreadProps$2(__spreadValues$2({}, options), {
2009
2009
  limit: 1
2010
2010
  }))).results[0] || null;
2011
2011
  });
2012
2012
  }
2013
2013
  const generateContentUrl = (options) => {
2014
- const { limit = 1, userAttributes, query, noTraverse = false, model, apiKey } = options;
2014
+ const { limit = 30, userAttributes, query, noTraverse = false, model, apiKey } = options;
2015
2015
  const url = new URL(`https://cdn.builder.io/api/v2/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}`);
2016
2016
  const queryOptions = __spreadValues$2(__spreadValues$2({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
2017
2017
  const flattened = flatten(queryOptions);
@@ -2029,7 +2029,7 @@ const generateContentUrl = (options) => {
2029
2029
  return url;
2030
2030
  };
2031
2031
  function getAllContent(options) {
2032
- return __async(this, null, function* () {
2032
+ return __async$1(this, null, function* () {
2033
2033
  const url = generateContentUrl(options);
2034
2034
  const fetch2 = yield fetch$;
2035
2035
  const content = yield fetch2(url.href).then((res) => res.json());
@@ -2303,6 +2303,26 @@ var __objRest = (source, exclude) => {
2303
2303
  }
2304
2304
  return target;
2305
2305
  };
2306
+ var __async = (__this, __arguments, generator) => {
2307
+ return new Promise((resolve, reject) => {
2308
+ var fulfilled = (value) => {
2309
+ try {
2310
+ step(generator.next(value));
2311
+ } catch (e) {
2312
+ reject(e);
2313
+ }
2314
+ };
2315
+ var rejected = (value) => {
2316
+ try {
2317
+ step(generator.throw(value));
2318
+ } catch (e) {
2319
+ reject(e);
2320
+ }
2321
+ };
2322
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
2323
+ step((generator = generator.apply(__this, __arguments)).next());
2324
+ });
2325
+ };
2306
2326
  const getTrackingEventData = ({ canTrack }) => {
2307
2327
  if (!canTrack)
2308
2328
  return {
@@ -2338,23 +2358,27 @@ const createEvent = (_a) => {
2338
2358
  };
2339
2359
  };
2340
2360
  function track(eventProps) {
2341
- if (!eventProps.canTrack)
2342
- return;
2343
- if (isEditing())
2344
- return;
2345
- if (!(isBrowser() || TARGET === "reactNative"))
2346
- return;
2347
- return fetch(`https://builder.io/api/v1/track`, {
2348
- method: "POST",
2349
- body: JSON.stringify({
2350
- events: [
2351
- createEvent(eventProps)
2352
- ]
2353
- }),
2354
- headers: {
2355
- "content-type": "application/json"
2356
- },
2357
- mode: "cors"
2361
+ return __async(this, null, function* () {
2362
+ if (!eventProps.canTrack)
2363
+ return;
2364
+ if (isEditing())
2365
+ return;
2366
+ if (!(isBrowser() || TARGET === "reactNative"))
2367
+ return;
2368
+ return fetch(`https://builder.io/api/v1/track`, {
2369
+ method: "POST",
2370
+ body: JSON.stringify({
2371
+ events: [
2372
+ createEvent(eventProps)
2373
+ ]
2374
+ }),
2375
+ headers: {
2376
+ "content-type": "application/json"
2377
+ },
2378
+ mode: "cors"
2379
+ }).catch((err) => {
2380
+ console.error("Failed to track: ", err);
2381
+ });
2358
2382
  });
2359
2383
  }
2360
2384
  const getCssFromFont = function getCssFromFont2(props, state, font) {
@@ -2407,6 +2431,8 @@ const RenderContentStyles = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((p
2407
2431
  }, "RenderContentStyles_component_32XAr483K2o"));
2408
2432
  const RenderContentStyles$1 = RenderContentStyles;
2409
2433
  const useContent = function useContent2(props, state, elementRef) {
2434
+ if (!props.content && !state.overrideContent)
2435
+ return void 0;
2410
2436
  const mergedContent = {
2411
2437
  ...props.content,
2412
2438
  ...state.overrideContent,
@@ -2531,8 +2557,8 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props)
2531
2557
  const state = qwik.useStore({
2532
2558
  forceReRenderCount: 0,
2533
2559
  overrideContent: null,
2534
- overrideState: {},
2535
- update: 0
2560
+ update: 0,
2561
+ overrideState: {}
2536
2562
  });
2537
2563
  qwik.useContextProvider(stdin_default, qwik.useStore({
2538
2564
  content: (() => {
@@ -438,13 +438,13 @@ const RenderComponent = (props) => {
438
438
  children: props.componentRef ? /* @__PURE__ */ jsxs(props.componentRef, {
439
439
  ...markPropsMutable(props.componentOptions),
440
440
  children: [
441
- (props.blockChildren || []).map(function(child) {
441
+ (props.blockChildren || []).map((child) => {
442
442
  return /* @__PURE__ */ jsx(RenderBlock$1, {
443
443
  block: child,
444
444
  context: props.context
445
445
  }, "render-block-" + child.id);
446
446
  }),
447
- (props.blockChildren || []).map(function(child) {
447
+ (props.blockChildren || []).map((child) => {
448
448
  return /* @__PURE__ */ jsx(BlockStyles$1, {
449
449
  block: child,
450
450
  context: props.context
@@ -590,7 +590,7 @@ const RenderBlock = (props) => {
590
590
  children: shouldWrap(props) ? !isEmptyHtmlElement(tagName2(props)) ? /* @__PURE__ */ jsxs(state.tagName, {
591
591
  ...attributes(props),
592
592
  children: [
593
- repeatItemData(props) ? (repeatItemData(props) || []).map(function(data, index) {
593
+ repeatItemData(props) ? (repeatItemData(props) || []).map((data, index) => {
594
594
  return /* @__PURE__ */ jsx(RenderRepeatedBlock$1, {
595
595
  repeatContext: data.context,
596
596
  block: data.block
@@ -599,13 +599,13 @@ const RenderBlock = (props) => {
599
599
  !repeatItemData(props) ? /* @__PURE__ */ jsx(RenderComponent$1, {
600
600
  ...renderComponentProps(props)
601
601
  }) : null,
602
- (childrenWithoutParentComponent(props) || []).map(function(child) {
602
+ (childrenWithoutParentComponent(props) || []).map((child) => {
603
603
  return /* @__PURE__ */ jsx(RenderBlock, {
604
604
  block: child,
605
605
  context: props.context
606
606
  }, "render-block-" + child.id);
607
607
  }),
608
- (childrenWithoutParentComponent(props) || []).map(function(child) {
608
+ (childrenWithoutParentComponent(props) || []).map((child) => {
609
609
  return /* @__PURE__ */ jsx(BlockStyles$1, {
610
610
  block: child,
611
611
  context: props.context
@@ -672,13 +672,13 @@ const RenderBlocks = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
672
672
  state
673
673
  ]),
674
674
  children: [
675
- props.blocks ? (props.blocks || []).map(function(block) {
675
+ props.blocks ? (props.blocks || []).map((block) => {
676
676
  return /* @__PURE__ */ jsx(RenderBlock$1, {
677
677
  block,
678
678
  context: builderContext
679
679
  }, "render-block-" + block.id);
680
680
  }) : null,
681
- props.blocks ? (props.blocks || []).map(function(block) {
681
+ props.blocks ? (props.blocks || []).map((block) => {
682
682
  return /* @__PURE__ */ jsx(BlockStyles$1, {
683
683
  block,
684
684
  context: builderContext
@@ -735,7 +735,7 @@ const Columns = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
735
735
  return /* @__PURE__ */ jsx("div", {
736
736
  class: "builder-columns div-Columns",
737
737
  style: columnsCssVars(props, state),
738
- children: (props.columns || []).map(function(column, index) {
738
+ children: (props.columns || []).map((column, index) => {
739
739
  return /* @__PURE__ */ jsx("div", {
740
740
  class: "builder-column div-Columns-2",
741
741
  style: {
@@ -1705,9 +1705,9 @@ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
1705
1705
  const Embed = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1706
1706
  const elem = useRef();
1707
1707
  const state = useStore({
1708
- ranInitFn: false,
1709
1708
  scriptsInserted: [],
1710
- scriptsRun: []
1709
+ scriptsRun: [],
1710
+ ranInitFn: false
1711
1711
  });
1712
1712
  useWatchQrl(inlinedQrl(({ track: track2 }) => {
1713
1713
  const [elem2, props2, state2] = useLexicalScope();
@@ -1892,7 +1892,7 @@ function getGlobalThis() {
1892
1892
  return self;
1893
1893
  return null;
1894
1894
  }
1895
- var __async$1 = (__this, __arguments, generator) => {
1895
+ var __async$2 = (__this, __arguments, generator) => {
1896
1896
  return new Promise((resolve, reject) => {
1897
1897
  var fulfilled = (value) => {
1898
1898
  try {
@@ -1913,7 +1913,7 @@ var __async$1 = (__this, __arguments, generator) => {
1913
1913
  });
1914
1914
  };
1915
1915
  function getFetch() {
1916
- return __async$1(this, null, function* () {
1916
+ return __async$2(this, null, function* () {
1917
1917
  const globalFetch = getGlobalThis().fetch;
1918
1918
  if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
1919
1919
  const nodeFetch = import("./index.97024df8.js").then((d) => d.default);
@@ -1980,7 +1980,7 @@ var __spreadValues$2 = (a, b) => {
1980
1980
  return a;
1981
1981
  };
1982
1982
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1983
- var __async = (__this, __arguments, generator) => {
1983
+ var __async$1 = (__this, __arguments, generator) => {
1984
1984
  return new Promise((resolve, reject) => {
1985
1985
  var fulfilled = (value) => {
1986
1986
  try {
@@ -2002,14 +2002,14 @@ var __async = (__this, __arguments, generator) => {
2002
2002
  };
2003
2003
  const fetch$ = getFetch();
2004
2004
  function getContent(options) {
2005
- return __async(this, null, function* () {
2005
+ return __async$1(this, null, function* () {
2006
2006
  return (yield getAllContent(__spreadProps$2(__spreadValues$2({}, options), {
2007
2007
  limit: 1
2008
2008
  }))).results[0] || null;
2009
2009
  });
2010
2010
  }
2011
2011
  const generateContentUrl = (options) => {
2012
- const { limit = 1, userAttributes, query, noTraverse = false, model, apiKey } = options;
2012
+ const { limit = 30, userAttributes, query, noTraverse = false, model, apiKey } = options;
2013
2013
  const url = new URL(`https://cdn.builder.io/api/v2/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}`);
2014
2014
  const queryOptions = __spreadValues$2(__spreadValues$2({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
2015
2015
  const flattened = flatten(queryOptions);
@@ -2027,7 +2027,7 @@ const generateContentUrl = (options) => {
2027
2027
  return url;
2028
2028
  };
2029
2029
  function getAllContent(options) {
2030
- return __async(this, null, function* () {
2030
+ return __async$1(this, null, function* () {
2031
2031
  const url = generateContentUrl(options);
2032
2032
  const fetch2 = yield fetch$;
2033
2033
  const content = yield fetch2(url.href).then((res) => res.json());
@@ -2301,6 +2301,26 @@ var __objRest = (source, exclude) => {
2301
2301
  }
2302
2302
  return target;
2303
2303
  };
2304
+ var __async = (__this, __arguments, generator) => {
2305
+ return new Promise((resolve, reject) => {
2306
+ var fulfilled = (value) => {
2307
+ try {
2308
+ step(generator.next(value));
2309
+ } catch (e) {
2310
+ reject(e);
2311
+ }
2312
+ };
2313
+ var rejected = (value) => {
2314
+ try {
2315
+ step(generator.throw(value));
2316
+ } catch (e) {
2317
+ reject(e);
2318
+ }
2319
+ };
2320
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
2321
+ step((generator = generator.apply(__this, __arguments)).next());
2322
+ });
2323
+ };
2304
2324
  const getTrackingEventData = ({ canTrack }) => {
2305
2325
  if (!canTrack)
2306
2326
  return {
@@ -2336,23 +2356,27 @@ const createEvent = (_a) => {
2336
2356
  };
2337
2357
  };
2338
2358
  function track(eventProps) {
2339
- if (!eventProps.canTrack)
2340
- return;
2341
- if (isEditing())
2342
- return;
2343
- if (!(isBrowser() || TARGET === "reactNative"))
2344
- return;
2345
- return fetch(`https://builder.io/api/v1/track`, {
2346
- method: "POST",
2347
- body: JSON.stringify({
2348
- events: [
2349
- createEvent(eventProps)
2350
- ]
2351
- }),
2352
- headers: {
2353
- "content-type": "application/json"
2354
- },
2355
- mode: "cors"
2359
+ return __async(this, null, function* () {
2360
+ if (!eventProps.canTrack)
2361
+ return;
2362
+ if (isEditing())
2363
+ return;
2364
+ if (!(isBrowser() || TARGET === "reactNative"))
2365
+ return;
2366
+ return fetch(`https://builder.io/api/v1/track`, {
2367
+ method: "POST",
2368
+ body: JSON.stringify({
2369
+ events: [
2370
+ createEvent(eventProps)
2371
+ ]
2372
+ }),
2373
+ headers: {
2374
+ "content-type": "application/json"
2375
+ },
2376
+ mode: "cors"
2377
+ }).catch((err) => {
2378
+ console.error("Failed to track: ", err);
2379
+ });
2356
2380
  });
2357
2381
  }
2358
2382
  const getCssFromFont = function getCssFromFont2(props, state, font) {
@@ -2405,6 +2429,8 @@ const RenderContentStyles = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2405
2429
  }, "RenderContentStyles_component_32XAr483K2o"));
2406
2430
  const RenderContentStyles$1 = RenderContentStyles;
2407
2431
  const useContent = function useContent2(props, state, elementRef) {
2432
+ if (!props.content && !state.overrideContent)
2433
+ return void 0;
2408
2434
  const mergedContent = {
2409
2435
  ...props.content,
2410
2436
  ...state.overrideContent,
@@ -2529,8 +2555,8 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2529
2555
  const state = useStore({
2530
2556
  forceReRenderCount: 0,
2531
2557
  overrideContent: null,
2532
- overrideState: {},
2533
- update: 0
2558
+ update: 0,
2559
+ overrideState: {}
2534
2560
  });
2535
2561
  useContextProvider(stdin_default, useStore({
2536
2562
  content: (() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "Builder.io Qwik SDK",
5
5
  "type": "module",
6
6
  "main": "./lib/index.qwik.cjs",
@@ -66,7 +66,7 @@ export const Columns = component$((props) => {
66
66
  class="builder-columns div-Columns"
67
67
  style={columnsCssVars(props, state)}
68
68
  >
69
- {(props.columns || []).map(function (column, index) {
69
+ {(props.columns || []).map((column, index) => {
70
70
  return (
71
71
  <div
72
72
  class="builder-column div-Columns-2"
@@ -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,6 +1,6 @@
1
1
  // GENERATED BY MITOSIS
2
2
 
3
- import { isJsScript } from "./helpers";
3
+ import { isJsScript } from "./helpers.js";
4
4
  import {
5
5
  Fragment,
6
6
  component$,
@@ -41,9 +41,9 @@ export const findAndRunScripts = function findAndRunScripts(
41
41
  export const Embed = component$((props) => {
42
42
  const elem = useRef();
43
43
  const state = useStore({
44
- ranInitFn: false,
45
44
  scriptsInserted: [],
46
45
  scriptsRun: [],
46
+ ranInitFn: false,
47
47
  });
48
48
  useWatch$(({ track }) => {
49
49
  state && track(state, "ranInitFn");
@@ -1,8 +1,8 @@
1
1
  // GENERATED BY MITOSIS
2
2
 
3
3
  import RenderBlock from "../../components/render-block/render-block";
4
+ import BuilderBlocks from "../../components/render-blocks";
4
5
  import { isEditing } from "../../functions/is-editing.js";
5
- import BuilderBlocks from "./builder-blocks";
6
6
  import {
7
7
  Fragment,
8
8
  component$,
@@ -244,9 +244,9 @@ export const FormComponent = component$((props) => {
244
244
  const builderContext = useContext(BuilderContext);
245
245
  const formRef = useRef();
246
246
  const state = useStore({
247
- formErrorMessage: "",
248
247
  formState: "unsubmitted",
249
248
  responseData: null,
249
+ formErrorMessage: "",
250
250
  });
251
251
  return (
252
252
  <form
@@ -263,7 +263,7 @@ export const FormComponent = component$((props) => {
263
263
  {...props.attributes}
264
264
  >
265
265
  {props.builderBlock && props.builderBlock.children
266
- ? (props.builderBlock?.children || []).map(function (block) {
266
+ ? (props.builderBlock?.children || []).map((block) => {
267
267
  return (
268
268
  <RenderBlock block={block} context={builderContext}></RenderBlock>
269
269
  );
@@ -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
  // GENERATED BY MITOSIS
2
2
 
3
- import { getSrcSet } from "./image.helpers";
3
+ import { getSrcSet } from "./image.helpers.js";
4
4
  import {
5
5
  Fragment,
6
6
  Slot,
@@ -13,7 +13,7 @@ export const SelectComponent = component$((props) => {
13
13
  defaultValue={props.defaultValue}
14
14
  name={props.name}
15
15
  >
16
- {(props.options || []).map(function (option) {
16
+ {(props.options || []).map((option) => {
17
17
  return (
18
18
  <option value={option.value}>{option.name || option.value}</option>
19
19
  );
@@ -167,10 +167,7 @@ export const RenderBlock = (props) => {
167
167
  !isEmptyHtmlElement(tagName(props, state)) ? (
168
168
  <state.tagName {...attributes(props, state)}>
169
169
  {repeatItemData(props, state)
170
- ? (repeatItemData(props, state) || []).map(function (
171
- data,
172
- index
173
- ) {
170
+ ? (repeatItemData(props, state) || []).map((data, index) => {
174
171
  return (
175
172
  <RenderRepeatedBlock
176
173
  key={index}
@@ -185,28 +182,28 @@ export const RenderBlock = (props) => {
185
182
  {...renderComponentProps(props, state)}
186
183
  ></RenderComponent>
187
184
  ) : null}
188
- {(childrenWithoutParentComponent(props, state) || []).map(function (
189
- child
190
- ) {
191
- return (
192
- <RenderBlock
193
- key={"render-block-" + child.id}
194
- block={child}
195
- context={props.context}
196
- ></RenderBlock>
197
- );
198
- })}
199
- {(childrenWithoutParentComponent(props, state) || []).map(function (
200
- child
201
- ) {
202
- return (
203
- <BlockStyles
204
- key={"block-style-" + child.id}
205
- block={child}
206
- context={props.context}
207
- ></BlockStyles>
208
- );
209
- })}
185
+ {(childrenWithoutParentComponent(props, state) || []).map(
186
+ (child) => {
187
+ return (
188
+ <RenderBlock
189
+ key={"render-block-" + child.id}
190
+ block={child}
191
+ context={props.context}
192
+ ></RenderBlock>
193
+ );
194
+ }
195
+ )}
196
+ {(childrenWithoutParentComponent(props, state) || []).map(
197
+ (child) => {
198
+ return (
199
+ <BlockStyles
200
+ key={"block-style-" + child.id}
201
+ block={child}
202
+ context={props.context}
203
+ ></BlockStyles>
204
+ );
205
+ }
206
+ )}
210
207
  </state.tagName>
211
208
  ) : (
212
209
  <state.tagName {...attributes(props, state)}></state.tagName>
@@ -9,7 +9,7 @@ export const RenderComponent = (props) => {
9
9
  <>
10
10
  {props.componentRef ? (
11
11
  <props.componentRef {...markPropsMutable(props.componentOptions)}>
12
- {(props.blockChildren || []).map(function (child) {
12
+ {(props.blockChildren || []).map((child) => {
13
13
  return (
14
14
  <RenderBlock
15
15
  key={"render-block-" + child.id}
@@ -18,7 +18,7 @@ export const RenderComponent = (props) => {
18
18
  ></RenderBlock>
19
19
  );
20
20
  })}
21
- {(props.blockChildren || []).map(function (child) {
21
+ {(props.blockChildren || []).map((child) => {
22
22
  return (
23
23
  <BlockStyles
24
24
  key={"block-style-" + child.id}
@@ -62,7 +62,7 @@ export const RenderBlocks = component$((props) => {
62
62
  onMouseEnter$={(event) => onMouseEnter(props, state, builderContext)}
63
63
  >
64
64
  {props.blocks
65
- ? (props.blocks || []).map(function (block) {
65
+ ? (props.blocks || []).map((block) => {
66
66
  return (
67
67
  <RenderBlock
68
68
  key={"render-block-" + block.id}
@@ -73,7 +73,7 @@ export const RenderBlocks = component$((props) => {
73
73
  })
74
74
  : null}
75
75
  {props.blocks
76
- ? (props.blocks || []).map(function (block) {
76
+ ? (props.blocks || []).map((block) => {
77
77
  return (
78
78
  <BlockStyles
79
79
  key={"block-style-" + block.id}
@@ -34,6 +34,10 @@ import {
34
34
  useWatch$,
35
35
  } from "@builder.io/qwik";
36
36
  export const useContent = function useContent(props, state, elementRef) {
37
+ if (!props.content && !state.overrideContent) {
38
+ return undefined;
39
+ }
40
+
37
41
  const mergedContent = {
38
42
  ...props.content,
39
43
  ...state.overrideContent,
@@ -226,8 +230,8 @@ export const RenderContent = component$((props) => {
226
230
  const state = useStore({
227
231
  forceReRenderCount: 0,
228
232
  overrideContent: null,
229
- overrideState: {},
230
233
  update: 0,
234
+ overrideState: {},
231
235
  });
232
236
  useContextProvider(
233
237
  BuilderContext,
@@ -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) {
@@ -1,11 +0,0 @@
1
- // GENERATED BY MITOSIS
2
-
3
- import { Fragment, component$, h } from "@builder.io/qwik";
4
- export const BuilderBlocks = component$((props) => {
5
- return (
6
- <Fragment>
7
- NOT YET IMPLEMENTED: <code>BuilderBlocks {JSON.stringify(props)}</code>
8
- </Fragment>
9
- );
10
- });
11
- export default BuilderBlocks;