@builder.io/sdk-qwik 0.5.0 → 0.5.1

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.
@@ -38,6 +38,8 @@ const STYLES$3 = `
38
38
  all: unset;
39
39
  }
40
40
  `;
41
+ const builderContext = qwik.createContextId("Builder");
42
+ const ComponentsContext = qwik.createContextId("Components");
41
43
  function getBlockComponentOptions(block) {
42
44
  return {
43
45
  ...block.component?.options,
@@ -8667,7 +8669,6 @@ const ComponentRef = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
8667
8669
  }, 0, "z6_0") : null
8668
8670
  }, 1, "z6_1");
8669
8671
  }, "ComponentRef_component_tFQoBV6UFdc"));
8670
- const builderContext = qwik.createContextId("Builder");
8671
8672
  const RepeatedBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
8672
8673
  const state = qwik.useStore({
8673
8674
  store: props.repeatContext
@@ -8971,6 +8972,8 @@ const STYLES$2 = `
8971
8972
  }
8972
8973
  `;
8973
8974
  const Blocks = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
8975
+ const builderContext$1 = qwik.useContext(builderContext);
8976
+ const componentsContext = qwik.useContext(ComponentsContext);
8974
8977
  return /* @__PURE__ */ qwik._jsxC(BlocksWrapper, {
8975
8978
  get blocks() {
8976
8979
  return props.blocks;
@@ -8989,18 +8992,20 @@ const Blocks = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl
8989
8992
  return /* @__PURE__ */ qwik._jsxC(Block, {
8990
8993
  block,
8991
8994
  get context() {
8992
- return props.context;
8995
+ return props.context || builderContext$1;
8993
8996
  },
8994
8997
  get registeredComponents() {
8995
- return props.registeredComponents;
8998
+ return props.registeredComponents || componentsContext.registeredComponents;
8996
8999
  },
8997
9000
  [qwik._IMMUTABLE]: {
8998
- context: qwik._fnSignal((p0) => p0.context, [
9001
+ context: qwik._fnSignal((p0, p1) => p1.context || p0, [
9002
+ builderContext$1,
8999
9003
  props
9000
- ], "p0.context"),
9001
- registeredComponents: qwik._fnSignal((p0) => p0.registeredComponents, [
9004
+ ], "p1.context||p0"),
9005
+ registeredComponents: qwik._fnSignal((p0, p1) => p1.registeredComponents || p0.registeredComponents, [
9006
+ componentsContext,
9002
9007
  props
9003
- ], "p0.registeredComponents")
9008
+ ], "p1.registeredComponents||p0.registeredComponents")
9004
9009
  }
9005
9010
  }, 3, "render-block-" + block.id);
9006
9011
  }) : null,
@@ -9008,12 +9013,13 @@ const Blocks = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl
9008
9013
  return /* @__PURE__ */ qwik._jsxC(BlockStyles, {
9009
9014
  block,
9010
9015
  get context() {
9011
- return props.context;
9016
+ return props.context || builderContext$1;
9012
9017
  },
9013
9018
  [qwik._IMMUTABLE]: {
9014
- context: qwik._fnSignal((p0) => p0.context, [
9019
+ context: qwik._fnSignal((p0, p1) => p1.context || p0, [
9020
+ builderContext$1,
9015
9021
  props
9016
- ], "p0.context")
9022
+ ], "p1.context||p0")
9017
9023
  }
9018
9024
  }, 3, "block-style-" + block.id);
9019
9025
  }) : null
@@ -11109,7 +11115,7 @@ const getInteractionPropertiesForEvent = (event) => {
11109
11115
  }
11110
11116
  };
11111
11117
  };
11112
- const SDK_VERSION = "0.5.0";
11118
+ const SDK_VERSION = "0.5.1";
11113
11119
  const registry = {};
11114
11120
  function register(type, info) {
11115
11121
  let typeList = registry[type];
@@ -11655,6 +11661,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
11655
11661
  }, {
11656
11662
  deep: true
11657
11663
  });
11664
+ qwik.useContextProvider(ComponentsContext, qwik.useStore({
11665
+ registeredComponents: state.registeredComponents
11666
+ }));
11658
11667
  return /* @__PURE__ */ qwik._jsxC(EnableEditor, {
11659
11668
  get content() {
11660
11669
  return props.content;
@@ -1,4 +1,4 @@
1
- import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, _jsxQ, _jsxBranch, useStore, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, createContextId, useContextProvider, _wrapProp, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useStore, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4
4
  useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
@@ -36,6 +36,8 @@ const STYLES$3 = `
36
36
  all: unset;
37
37
  }
38
38
  `;
39
+ const builderContext = createContextId("Builder");
40
+ const ComponentsContext = createContextId("Components");
39
41
  function getBlockComponentOptions(block) {
40
42
  return {
41
43
  ...block.component?.options,
@@ -8665,7 +8667,6 @@ const ComponentRef = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
8665
8667
  }, 0, "z6_0") : null
8666
8668
  }, 1, "z6_1");
8667
8669
  }, "ComponentRef_component_tFQoBV6UFdc"));
8668
- const builderContext = createContextId("Builder");
8669
8670
  const RepeatedBlock = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
8670
8671
  const state = useStore({
8671
8672
  store: props.repeatContext
@@ -8969,6 +8970,8 @@ const STYLES$2 = `
8969
8970
  }
8970
8971
  `;
8971
8972
  const Blocks = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
8973
+ const builderContext$1 = useContext(builderContext);
8974
+ const componentsContext = useContext(ComponentsContext);
8972
8975
  return /* @__PURE__ */ _jsxC(BlocksWrapper, {
8973
8976
  get blocks() {
8974
8977
  return props.blocks;
@@ -8987,18 +8990,20 @@ const Blocks = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =
8987
8990
  return /* @__PURE__ */ _jsxC(Block, {
8988
8991
  block,
8989
8992
  get context() {
8990
- return props.context;
8993
+ return props.context || builderContext$1;
8991
8994
  },
8992
8995
  get registeredComponents() {
8993
- return props.registeredComponents;
8996
+ return props.registeredComponents || componentsContext.registeredComponents;
8994
8997
  },
8995
8998
  [_IMMUTABLE]: {
8996
- context: _fnSignal((p0) => p0.context, [
8999
+ context: _fnSignal((p0, p1) => p1.context || p0, [
9000
+ builderContext$1,
8997
9001
  props
8998
- ], "p0.context"),
8999
- registeredComponents: _fnSignal((p0) => p0.registeredComponents, [
9002
+ ], "p1.context||p0"),
9003
+ registeredComponents: _fnSignal((p0, p1) => p1.registeredComponents || p0.registeredComponents, [
9004
+ componentsContext,
9000
9005
  props
9001
- ], "p0.registeredComponents")
9006
+ ], "p1.registeredComponents||p0.registeredComponents")
9002
9007
  }
9003
9008
  }, 3, "render-block-" + block.id);
9004
9009
  }) : null,
@@ -9006,12 +9011,13 @@ const Blocks = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =
9006
9011
  return /* @__PURE__ */ _jsxC(BlockStyles, {
9007
9012
  block,
9008
9013
  get context() {
9009
- return props.context;
9014
+ return props.context || builderContext$1;
9010
9015
  },
9011
9016
  [_IMMUTABLE]: {
9012
- context: _fnSignal((p0) => p0.context, [
9017
+ context: _fnSignal((p0, p1) => p1.context || p0, [
9018
+ builderContext$1,
9013
9019
  props
9014
- ], "p0.context")
9020
+ ], "p1.context||p0")
9015
9021
  }
9016
9022
  }, 3, "block-style-" + block.id);
9017
9023
  }) : null
@@ -11107,7 +11113,7 @@ const getInteractionPropertiesForEvent = (event) => {
11107
11113
  }
11108
11114
  };
11109
11115
  };
11110
- const SDK_VERSION = "0.5.0";
11116
+ const SDK_VERSION = "0.5.1";
11111
11117
  const registry = {};
11112
11118
  function register(type, info) {
11113
11119
  let typeList = registry[type];
@@ -11653,6 +11659,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
11653
11659
  }, {
11654
11660
  deep: true
11655
11661
  });
11662
+ useContextProvider(ComponentsContext, useStore({
11663
+ registeredComponents: state.registeredComponents
11664
+ }));
11656
11665
  return /* @__PURE__ */ _jsxC(EnableEditor, {
11657
11666
  get content() {
11658
11667
  return props.content;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Builder.io Qwik SDK",
5
5
  "type": "module",
6
6
  "main": "./lib/index.qwik.cjs",
@@ -1,8 +1,8 @@
1
1
  import { BuilderContextInterface, RegisteredComponents } from "../../context/types.js";
2
2
  import { BlocksWrapperProps } from "./blocks-wrapper";
3
3
  export type BlocksProps = Partial<BlocksWrapperProps> & {
4
- context: BuilderContextInterface;
5
- registeredComponents: RegisteredComponents;
4
+ context?: BuilderContextInterface;
5
+ registeredComponents?: RegisteredComponents;
6
6
  };
7
7
  export declare const Blocks: import("@builder.io/qwik").Component<BlocksProps>;
8
8
  export default Blocks;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.5.0";
1
+ export declare const SDK_VERSION = "0.5.1";
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@builder.io/qwik").ContextId<any>;
2
+ export default _default;