@builder.io/sdk-qwik 0.11.3 → 0.11.5

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.
@@ -3182,7 +3182,7 @@ const getInteractionPropertiesForEvent = (event) => {
3182
3182
  }
3183
3183
  };
3184
3184
  };
3185
- const SDK_VERSION = "0.11.3";
3185
+ const SDK_VERSION = "0.11.5";
3186
3186
  const registry = {};
3187
3187
  function register(type, info) {
3188
3188
  let typeList = registry[type];
@@ -3315,6 +3315,17 @@ const setupBrowserForEditing = (options = {}) => {
3315
3315
  });
3316
3316
  }
3317
3317
  };
3318
+ const mergeNewRootState = function mergeNewRootState2(props, state, elementRef, newData) {
3319
+ var _a, _b;
3320
+ const combinedState = {
3321
+ ...props.builderContextSignal.rootState,
3322
+ ...newData
3323
+ };
3324
+ if (props.builderContextSignal.rootSetState)
3325
+ (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
3326
+ else
3327
+ props.builderContextSignal.rootState = combinedState;
3328
+ };
3318
3329
  const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
3319
3330
  var _a, _b, _c, _d, _e;
3320
3331
  const newContentValue = {
@@ -3446,6 +3457,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
3446
3457
  const state = qwik.useStore({
3447
3458
  ContentWrapper: props.contentWrapper || "div",
3448
3459
  clicked: false,
3460
+ firstRender: true,
3449
3461
  forceReRenderCount: 0,
3450
3462
  httpReqsData: {},
3451
3463
  lastUpdated: 0,
@@ -3585,6 +3597,28 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
3585
3597
  props,
3586
3598
  state
3587
3599
  ]));
3600
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
3601
+ const [elementRef2, props2, state2] = qwik.useLexicalScope();
3602
+ track2(() => props2.data);
3603
+ if (props2.data)
3604
+ mergeNewRootState(props2, state2, elementRef2, props2.data);
3605
+ }, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
3606
+ elementRef,
3607
+ props,
3608
+ state
3609
+ ]));
3610
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
3611
+ const [elementRef2, props2, state2] = qwik.useLexicalScope();
3612
+ track2(() => props2.locale);
3613
+ if (props2.locale)
3614
+ mergeNewRootState(props2, state2, elementRef2, {
3615
+ locale: props2.locale
3616
+ });
3617
+ }, "EnableEditor_component_useTask_7_Zh51H45HHnM", [
3618
+ elementRef,
3619
+ props,
3620
+ state
3621
+ ]));
3588
3622
  return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
3589
3623
  children: props.builderContextSignal.content ? /* @__PURE__ */ qwik.createElement(state.ContentWrapper, {
3590
3624
  apiKey: props.apiKey,
@@ -3692,7 +3726,7 @@ ${getFontCss({
3692
3726
  }
3693
3727
  }, 3, "8O_0");
3694
3728
  }, "ContentStyles_component_Qbhu1myPWm0"));
3695
- const getContextStateInitialValue = ({ content, data, locale }) => {
3729
+ const getRootStateInitialValue = ({ content, data, locale }) => {
3696
3730
  var _a, _b, _c;
3697
3731
  const defaultValues = {};
3698
3732
  const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
@@ -3729,7 +3763,7 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
3729
3763
  data: props.data
3730
3764
  }),
3731
3765
  localState: void 0,
3732
- rootState: getContextStateInitialValue({
3766
+ rootState: getRootStateInitialValue({
3733
3767
  content: props.content,
3734
3768
  data: props.data,
3735
3769
  locale: props.locale
@@ -3787,6 +3821,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
3787
3821
  get content() {
3788
3822
  return props.content;
3789
3823
  },
3824
+ get data() {
3825
+ return props.data;
3826
+ },
3790
3827
  get model() {
3791
3828
  return props.model;
3792
3829
  },
@@ -3914,6 +3951,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
3914
3951
  context: qwik._fnSignal((p0) => p0.context, [
3915
3952
  props
3916
3953
  ], "p0.context"),
3954
+ data: qwik._fnSignal((p0) => p0.data, [
3955
+ props
3956
+ ], "p0.data"),
3917
3957
  enrich: qwik._fnSignal((p0) => p0.enrich, [
3918
3958
  props
3919
3959
  ], "p0.enrich"),
@@ -3180,7 +3180,7 @@ const getInteractionPropertiesForEvent = (event) => {
3180
3180
  }
3181
3181
  };
3182
3182
  };
3183
- const SDK_VERSION = "0.11.3";
3183
+ const SDK_VERSION = "0.11.5";
3184
3184
  const registry = {};
3185
3185
  function register(type, info) {
3186
3186
  let typeList = registry[type];
@@ -3313,6 +3313,17 @@ const setupBrowserForEditing = (options = {}) => {
3313
3313
  });
3314
3314
  }
3315
3315
  };
3316
+ const mergeNewRootState = function mergeNewRootState2(props, state, elementRef, newData) {
3317
+ var _a, _b;
3318
+ const combinedState = {
3319
+ ...props.builderContextSignal.rootState,
3320
+ ...newData
3321
+ };
3322
+ if (props.builderContextSignal.rootSetState)
3323
+ (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
3324
+ else
3325
+ props.builderContextSignal.rootState = combinedState;
3326
+ };
3316
3327
  const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
3317
3328
  var _a, _b, _c, _d, _e;
3318
3329
  const newContentValue = {
@@ -3444,6 +3455,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3444
3455
  const state = useStore({
3445
3456
  ContentWrapper: props.contentWrapper || "div",
3446
3457
  clicked: false,
3458
+ firstRender: true,
3447
3459
  forceReRenderCount: 0,
3448
3460
  httpReqsData: {},
3449
3461
  lastUpdated: 0,
@@ -3583,6 +3595,28 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3583
3595
  props,
3584
3596
  state
3585
3597
  ]));
3598
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
3599
+ const [elementRef2, props2, state2] = useLexicalScope();
3600
+ track2(() => props2.data);
3601
+ if (props2.data)
3602
+ mergeNewRootState(props2, state2, elementRef2, props2.data);
3603
+ }, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
3604
+ elementRef,
3605
+ props,
3606
+ state
3607
+ ]));
3608
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
3609
+ const [elementRef2, props2, state2] = useLexicalScope();
3610
+ track2(() => props2.locale);
3611
+ if (props2.locale)
3612
+ mergeNewRootState(props2, state2, elementRef2, {
3613
+ locale: props2.locale
3614
+ });
3615
+ }, "EnableEditor_component_useTask_7_Zh51H45HHnM", [
3616
+ elementRef,
3617
+ props,
3618
+ state
3619
+ ]));
3586
3620
  return /* @__PURE__ */ _jsxC(Fragment, {
3587
3621
  children: props.builderContextSignal.content ? /* @__PURE__ */ createElement(state.ContentWrapper, {
3588
3622
  apiKey: props.apiKey,
@@ -3690,7 +3724,7 @@ ${getFontCss({
3690
3724
  }
3691
3725
  }, 3, "8O_0");
3692
3726
  }, "ContentStyles_component_Qbhu1myPWm0"));
3693
- const getContextStateInitialValue = ({ content, data, locale }) => {
3727
+ const getRootStateInitialValue = ({ content, data, locale }) => {
3694
3728
  var _a, _b, _c;
3695
3729
  const defaultValues = {};
3696
3730
  const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
@@ -3727,7 +3761,7 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
3727
3761
  data: props.data
3728
3762
  }),
3729
3763
  localState: void 0,
3730
- rootState: getContextStateInitialValue({
3764
+ rootState: getRootStateInitialValue({
3731
3765
  content: props.content,
3732
3766
  data: props.data,
3733
3767
  locale: props.locale
@@ -3785,6 +3819,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
3785
3819
  get content() {
3786
3820
  return props.content;
3787
3821
  },
3822
+ get data() {
3823
+ return props.data;
3824
+ },
3788
3825
  get model() {
3789
3826
  return props.model;
3790
3827
  },
@@ -3912,6 +3949,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
3912
3949
  context: _fnSignal((p0) => p0.context, [
3913
3950
  props
3914
3951
  ], "p0.context"),
3952
+ data: _fnSignal((p0) => p0.data, [
3953
+ props
3954
+ ], "p0.data"),
3915
3955
  enrich: _fnSignal((p0) => p0.enrich, [
3916
3956
  props
3917
3957
  ], "p0.enrich"),
@@ -6413,7 +6413,7 @@ const getInteractionPropertiesForEvent = (event) => {
6413
6413
  }
6414
6414
  };
6415
6415
  };
6416
- const SDK_VERSION = "0.11.3";
6416
+ const SDK_VERSION = "0.11.5";
6417
6417
  const registry = {};
6418
6418
  function register(type, info) {
6419
6419
  let typeList = registry[type];
@@ -6546,6 +6546,17 @@ const setupBrowserForEditing = (options = {}) => {
6546
6546
  });
6547
6547
  }
6548
6548
  };
6549
+ const mergeNewRootState = function mergeNewRootState2(props, state, elementRef, newData) {
6550
+ var _a, _b;
6551
+ const combinedState = {
6552
+ ...props.builderContextSignal.rootState,
6553
+ ...newData
6554
+ };
6555
+ if (props.builderContextSignal.rootSetState)
6556
+ (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
6557
+ else
6558
+ props.builderContextSignal.rootState = combinedState;
6559
+ };
6549
6560
  const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
6550
6561
  var _a, _b, _c, _d, _e;
6551
6562
  const newContentValue = {
@@ -6677,6 +6688,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
6677
6688
  const state = qwik.useStore({
6678
6689
  ContentWrapper: props.contentWrapper || "div",
6679
6690
  clicked: false,
6691
+ firstRender: true,
6680
6692
  forceReRenderCount: 0,
6681
6693
  httpReqsData: {},
6682
6694
  lastUpdated: 0,
@@ -6816,6 +6828,28 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
6816
6828
  props,
6817
6829
  state
6818
6830
  ]));
6831
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
6832
+ const [elementRef2, props2, state2] = qwik.useLexicalScope();
6833
+ track2(() => props2.data);
6834
+ if (props2.data)
6835
+ mergeNewRootState(props2, state2, elementRef2, props2.data);
6836
+ }, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
6837
+ elementRef,
6838
+ props,
6839
+ state
6840
+ ]));
6841
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
6842
+ const [elementRef2, props2, state2] = qwik.useLexicalScope();
6843
+ track2(() => props2.locale);
6844
+ if (props2.locale)
6845
+ mergeNewRootState(props2, state2, elementRef2, {
6846
+ locale: props2.locale
6847
+ });
6848
+ }, "EnableEditor_component_useTask_7_Zh51H45HHnM", [
6849
+ elementRef,
6850
+ props,
6851
+ state
6852
+ ]));
6819
6853
  return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
6820
6854
  children: props.builderContextSignal.content ? /* @__PURE__ */ qwik.createElement(state.ContentWrapper, {
6821
6855
  apiKey: props.apiKey,
@@ -6923,7 +6957,7 @@ ${getFontCss({
6923
6957
  }
6924
6958
  }, 3, "8O_0");
6925
6959
  }, "ContentStyles_component_Qbhu1myPWm0"));
6926
- const getContextStateInitialValue = ({ content, data, locale }) => {
6960
+ const getRootStateInitialValue = ({ content, data, locale }) => {
6927
6961
  var _a, _b, _c;
6928
6962
  const defaultValues = {};
6929
6963
  const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
@@ -6960,7 +6994,7 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
6960
6994
  data: props.data
6961
6995
  }),
6962
6996
  localState: void 0,
6963
- rootState: getContextStateInitialValue({
6997
+ rootState: getRootStateInitialValue({
6964
6998
  content: props.content,
6965
6999
  data: props.data,
6966
7000
  locale: props.locale
@@ -7018,6 +7052,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
7018
7052
  get content() {
7019
7053
  return props.content;
7020
7054
  },
7055
+ get data() {
7056
+ return props.data;
7057
+ },
7021
7058
  get model() {
7022
7059
  return props.model;
7023
7060
  },
@@ -7145,6 +7182,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
7145
7182
  context: qwik._fnSignal((p0) => p0.context, [
7146
7183
  props
7147
7184
  ], "p0.context"),
7185
+ data: qwik._fnSignal((p0) => p0.data, [
7186
+ props
7187
+ ], "p0.data"),
7148
7188
  enrich: qwik._fnSignal((p0) => p0.enrich, [
7149
7189
  props
7150
7190
  ], "p0.enrich"),
@@ -6411,7 +6411,7 @@ const getInteractionPropertiesForEvent = (event) => {
6411
6411
  }
6412
6412
  };
6413
6413
  };
6414
- const SDK_VERSION = "0.11.3";
6414
+ const SDK_VERSION = "0.11.5";
6415
6415
  const registry = {};
6416
6416
  function register(type, info) {
6417
6417
  let typeList = registry[type];
@@ -6544,6 +6544,17 @@ const setupBrowserForEditing = (options = {}) => {
6544
6544
  });
6545
6545
  }
6546
6546
  };
6547
+ const mergeNewRootState = function mergeNewRootState2(props, state, elementRef, newData) {
6548
+ var _a, _b;
6549
+ const combinedState = {
6550
+ ...props.builderContextSignal.rootState,
6551
+ ...newData
6552
+ };
6553
+ if (props.builderContextSignal.rootSetState)
6554
+ (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
6555
+ else
6556
+ props.builderContextSignal.rootState = combinedState;
6557
+ };
6547
6558
  const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
6548
6559
  var _a, _b, _c, _d, _e;
6549
6560
  const newContentValue = {
@@ -6675,6 +6686,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
6675
6686
  const state = useStore({
6676
6687
  ContentWrapper: props.contentWrapper || "div",
6677
6688
  clicked: false,
6689
+ firstRender: true,
6678
6690
  forceReRenderCount: 0,
6679
6691
  httpReqsData: {},
6680
6692
  lastUpdated: 0,
@@ -6814,6 +6826,28 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
6814
6826
  props,
6815
6827
  state
6816
6828
  ]));
6829
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
6830
+ const [elementRef2, props2, state2] = useLexicalScope();
6831
+ track2(() => props2.data);
6832
+ if (props2.data)
6833
+ mergeNewRootState(props2, state2, elementRef2, props2.data);
6834
+ }, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
6835
+ elementRef,
6836
+ props,
6837
+ state
6838
+ ]));
6839
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
6840
+ const [elementRef2, props2, state2] = useLexicalScope();
6841
+ track2(() => props2.locale);
6842
+ if (props2.locale)
6843
+ mergeNewRootState(props2, state2, elementRef2, {
6844
+ locale: props2.locale
6845
+ });
6846
+ }, "EnableEditor_component_useTask_7_Zh51H45HHnM", [
6847
+ elementRef,
6848
+ props,
6849
+ state
6850
+ ]));
6817
6851
  return /* @__PURE__ */ _jsxC(Fragment, {
6818
6852
  children: props.builderContextSignal.content ? /* @__PURE__ */ createElement(state.ContentWrapper, {
6819
6853
  apiKey: props.apiKey,
@@ -6921,7 +6955,7 @@ ${getFontCss({
6921
6955
  }
6922
6956
  }, 3, "8O_0");
6923
6957
  }, "ContentStyles_component_Qbhu1myPWm0"));
6924
- const getContextStateInitialValue = ({ content, data, locale }) => {
6958
+ const getRootStateInitialValue = ({ content, data, locale }) => {
6925
6959
  var _a, _b, _c;
6926
6960
  const defaultValues = {};
6927
6961
  const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
@@ -6958,7 +6992,7 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
6958
6992
  data: props.data
6959
6993
  }),
6960
6994
  localState: void 0,
6961
- rootState: getContextStateInitialValue({
6995
+ rootState: getRootStateInitialValue({
6962
6996
  content: props.content,
6963
6997
  data: props.data,
6964
6998
  locale: props.locale
@@ -7016,6 +7050,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
7016
7050
  get content() {
7017
7051
  return props.content;
7018
7052
  },
7053
+ get data() {
7054
+ return props.data;
7055
+ },
7019
7056
  get model() {
7020
7057
  return props.model;
7021
7058
  },
@@ -7143,6 +7180,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
7143
7180
  context: _fnSignal((p0) => p0.context, [
7144
7181
  props
7145
7182
  ], "p0.context"),
7183
+ data: _fnSignal((p0) => p0.data, [
7184
+ props
7185
+ ], "p0.data"),
7146
7186
  enrich: _fnSignal((p0) => p0.enrich, [
7147
7187
  props
7148
7188
  ], "p0.enrich"),
@@ -3283,7 +3283,7 @@ const getInteractionPropertiesForEvent = (event) => {
3283
3283
  }
3284
3284
  };
3285
3285
  };
3286
- const SDK_VERSION = "0.11.3";
3286
+ const SDK_VERSION = "0.11.5";
3287
3287
  const registry = {};
3288
3288
  function register(type, info) {
3289
3289
  let typeList = registry[type];
@@ -3416,6 +3416,17 @@ const setupBrowserForEditing = (options = {}) => {
3416
3416
  });
3417
3417
  }
3418
3418
  };
3419
+ const mergeNewRootState = function mergeNewRootState2(props, state, elementRef, newData) {
3420
+ var _a, _b;
3421
+ const combinedState = {
3422
+ ...props.builderContextSignal.rootState,
3423
+ ...newData
3424
+ };
3425
+ if (props.builderContextSignal.rootSetState)
3426
+ (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
3427
+ else
3428
+ props.builderContextSignal.rootState = combinedState;
3429
+ };
3419
3430
  const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
3420
3431
  var _a, _b, _c, _d, _e;
3421
3432
  const newContentValue = {
@@ -3547,6 +3558,7 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
3547
3558
  const state = qwik.useStore({
3548
3559
  ContentWrapper: props.contentWrapper || "div",
3549
3560
  clicked: false,
3561
+ firstRender: true,
3550
3562
  forceReRenderCount: 0,
3551
3563
  httpReqsData: {},
3552
3564
  lastUpdated: 0,
@@ -3686,6 +3698,28 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
3686
3698
  props,
3687
3699
  state
3688
3700
  ]));
3701
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
3702
+ const [elementRef2, props2, state2] = qwik.useLexicalScope();
3703
+ track2(() => props2.data);
3704
+ if (props2.data)
3705
+ mergeNewRootState(props2, state2, elementRef2, props2.data);
3706
+ }, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
3707
+ elementRef,
3708
+ props,
3709
+ state
3710
+ ]));
3711
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
3712
+ const [elementRef2, props2, state2] = qwik.useLexicalScope();
3713
+ track2(() => props2.locale);
3714
+ if (props2.locale)
3715
+ mergeNewRootState(props2, state2, elementRef2, {
3716
+ locale: props2.locale
3717
+ });
3718
+ }, "EnableEditor_component_useTask_7_Zh51H45HHnM", [
3719
+ elementRef,
3720
+ props,
3721
+ state
3722
+ ]));
3689
3723
  return /* @__PURE__ */ qwik._jsxC(jsxRuntime.Fragment, {
3690
3724
  children: props.builderContextSignal.content ? /* @__PURE__ */ qwik.createElement(state.ContentWrapper, {
3691
3725
  apiKey: props.apiKey,
@@ -3793,7 +3827,7 @@ ${getFontCss({
3793
3827
  }
3794
3828
  }, 3, "8O_0");
3795
3829
  }, "ContentStyles_component_Qbhu1myPWm0"));
3796
- const getContextStateInitialValue = ({ content, data, locale }) => {
3830
+ const getRootStateInitialValue = ({ content, data, locale }) => {
3797
3831
  var _a, _b, _c;
3798
3832
  const defaultValues = {};
3799
3833
  const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
@@ -3830,7 +3864,7 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
3830
3864
  data: props.data
3831
3865
  }),
3832
3866
  localState: void 0,
3833
- rootState: getContextStateInitialValue({
3867
+ rootState: getRootStateInitialValue({
3834
3868
  content: props.content,
3835
3869
  data: props.data,
3836
3870
  locale: props.locale
@@ -3888,6 +3922,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
3888
3922
  get content() {
3889
3923
  return props.content;
3890
3924
  },
3925
+ get data() {
3926
+ return props.data;
3927
+ },
3891
3928
  get model() {
3892
3929
  return props.model;
3893
3930
  },
@@ -4015,6 +4052,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
4015
4052
  context: qwik._fnSignal((p0) => p0.context, [
4016
4053
  props
4017
4054
  ], "p0.context"),
4055
+ data: qwik._fnSignal((p0) => p0.data, [
4056
+ props
4057
+ ], "p0.data"),
4018
4058
  enrich: qwik._fnSignal((p0) => p0.enrich, [
4019
4059
  props
4020
4060
  ], "p0.enrich"),
@@ -3281,7 +3281,7 @@ const getInteractionPropertiesForEvent = (event) => {
3281
3281
  }
3282
3282
  };
3283
3283
  };
3284
- const SDK_VERSION = "0.11.3";
3284
+ const SDK_VERSION = "0.11.5";
3285
3285
  const registry = {};
3286
3286
  function register(type, info) {
3287
3287
  let typeList = registry[type];
@@ -3414,6 +3414,17 @@ const setupBrowserForEditing = (options = {}) => {
3414
3414
  });
3415
3415
  }
3416
3416
  };
3417
+ const mergeNewRootState = function mergeNewRootState2(props, state, elementRef, newData) {
3418
+ var _a, _b;
3419
+ const combinedState = {
3420
+ ...props.builderContextSignal.rootState,
3421
+ ...newData
3422
+ };
3423
+ if (props.builderContextSignal.rootSetState)
3424
+ (_b = (_a = props.builderContextSignal).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
3425
+ else
3426
+ props.builderContextSignal.rootState = combinedState;
3427
+ };
3417
3428
  const mergeNewContent = function mergeNewContent2(props, state, elementRef, newContent) {
3418
3429
  var _a, _b, _c, _d, _e;
3419
3430
  const newContentValue = {
@@ -3545,6 +3556,7 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3545
3556
  const state = useStore({
3546
3557
  ContentWrapper: props.contentWrapper || "div",
3547
3558
  clicked: false,
3559
+ firstRender: true,
3548
3560
  forceReRenderCount: 0,
3549
3561
  httpReqsData: {},
3550
3562
  lastUpdated: 0,
@@ -3684,6 +3696,28 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
3684
3696
  props,
3685
3697
  state
3686
3698
  ]));
3699
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
3700
+ const [elementRef2, props2, state2] = useLexicalScope();
3701
+ track2(() => props2.data);
3702
+ if (props2.data)
3703
+ mergeNewRootState(props2, state2, elementRef2, props2.data);
3704
+ }, "EnableEditor_component_useTask_6_0CaFTUOgv08", [
3705
+ elementRef,
3706
+ props,
3707
+ state
3708
+ ]));
3709
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
3710
+ const [elementRef2, props2, state2] = useLexicalScope();
3711
+ track2(() => props2.locale);
3712
+ if (props2.locale)
3713
+ mergeNewRootState(props2, state2, elementRef2, {
3714
+ locale: props2.locale
3715
+ });
3716
+ }, "EnableEditor_component_useTask_7_Zh51H45HHnM", [
3717
+ elementRef,
3718
+ props,
3719
+ state
3720
+ ]));
3687
3721
  return /* @__PURE__ */ _jsxC(Fragment, {
3688
3722
  children: props.builderContextSignal.content ? /* @__PURE__ */ createElement(state.ContentWrapper, {
3689
3723
  apiKey: props.apiKey,
@@ -3791,7 +3825,7 @@ ${getFontCss({
3791
3825
  }
3792
3826
  }, 3, "8O_0");
3793
3827
  }, "ContentStyles_component_Qbhu1myPWm0"));
3794
- const getContextStateInitialValue = ({ content, data, locale }) => {
3828
+ const getRootStateInitialValue = ({ content, data, locale }) => {
3795
3829
  var _a, _b, _c;
3796
3830
  const defaultValues = {};
3797
3831
  const initialState = ((_a = content == null ? void 0 : content.data) == null ? void 0 : _a.state) || {};
@@ -3828,7 +3862,7 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
3828
3862
  data: props.data
3829
3863
  }),
3830
3864
  localState: void 0,
3831
- rootState: getContextStateInitialValue({
3865
+ rootState: getRootStateInitialValue({
3832
3866
  content: props.content,
3833
3867
  data: props.data,
3834
3868
  locale: props.locale
@@ -3886,6 +3920,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
3886
3920
  get content() {
3887
3921
  return props.content;
3888
3922
  },
3923
+ get data() {
3924
+ return props.data;
3925
+ },
3889
3926
  get model() {
3890
3927
  return props.model;
3891
3928
  },
@@ -4013,6 +4050,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
4013
4050
  context: _fnSignal((p0) => p0.context, [
4014
4051
  props
4015
4052
  ], "p0.context"),
4053
+ data: _fnSignal((p0) => p0.data, [
4054
+ props
4055
+ ], "p0.data"),
4016
4056
  enrich: _fnSignal((p0) => p0.enrich, [
4017
4057
  props
4018
4058
  ], "p0.enrich"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.11.3",
3
+ "version": "0.11.5",
4
4
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/qwik",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,11 +1,13 @@
1
1
  import { BuilderContextInterface } from "../../../context/types.js";
2
2
  import { BuilderContent } from "../../../types/builder-content.js";
3
+ import { Dictionary } from "../../../types/typescript.js";
3
4
  import { ContentProps } from "../content.types.js";
4
- type BuilderEditorProps = Omit<ContentProps, "customComponents" | "data" | "apiVersion" | "isSsrAbTest" | "blocksWrapper" | "blocksWrapperProps"> & {
5
+ type BuilderEditorProps = Omit<ContentProps, "customComponents" | "apiVersion" | "isSsrAbTest" | "blocksWrapper" | "blocksWrapperProps"> & {
5
6
  builderContextSignal: BuilderContextInterface;
6
7
  setBuilderContextSignal?: (signal: any) => any;
7
8
  children?: any;
8
9
  };
10
+ export declare const mergeNewRootState: (props: any, state: any, elementRef: any, newData: Dictionary<any>) => void;
9
11
  export declare const mergeNewContent: (props: any, state: any, elementRef: any, newContent: BuilderContent) => void;
10
12
  export declare const processMessage: (props: any, state: any, elementRef: any, event: MessageEvent) => void;
11
13
  export declare const evaluateJsCode: (props: any, state: any, elementRef: any) => void;
@@ -1,7 +1,7 @@
1
1
  import type { BuilderContent } from '../../types/builder-content.js';
2
2
  import type { Nullable } from '../../types/typescript.js';
3
3
  import type { ContentProps } from './content.types.js';
4
- export declare const getContextStateInitialValue: ({ content, data, locale }: Pick<ContentProps, 'content' | 'data' | 'locale'>) => {
4
+ export declare const getRootStateInitialValue: ({ content, data, locale }: Pick<ContentProps, 'content' | 'data' | 'locale'>) => {
5
5
  locale?: string | undefined;
6
6
  };
7
7
  export declare const getContentInitialValue: ({ content, data }: Pick<ContentProps, 'content' | 'data'>) => Nullable<BuilderContent>;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.11.3";
1
+ export declare const SDK_VERSION = "0.11.5";