@builder.io/sdk-qwik 0.2.2 → 0.3.0

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.
@@ -455,7 +455,8 @@ const RenderRepeatedBlock = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qw
455
455
  context: props.repeatContext.context,
456
456
  apiKey: props.repeatContext.apiKey,
457
457
  registeredComponents: props.repeatContext.registeredComponents,
458
- inheritedStyles: props.repeatContext.inheritedStyles
458
+ inheritedStyles: props.repeatContext.inheritedStyles,
459
+ apiVersion: props.repeatContext.apiVersion
459
460
  }));
460
461
  return /* @__PURE__ */ qwik._jsxC(RenderBlock, {
461
462
  get block() {
@@ -1878,7 +1879,11 @@ async function getAllContent(options) {
1878
1879
  const res = await fetch$1(url.href);
1879
1880
  const content = await res.json();
1880
1881
  if ("status" in content && !("results" in content)) {
1881
- logger.error("Error fetching data. ", content, options);
1882
+ logger.error("Error fetching data. ", {
1883
+ url,
1884
+ content,
1885
+ options
1886
+ });
1882
1887
  return content;
1883
1888
  }
1884
1889
  const canTrack = options.canTrack !== false;
@@ -3113,7 +3118,8 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
3113
3118
  context: props.context || {},
3114
3119
  apiKey: props.apiKey,
3115
3120
  apiVersion: props.apiVersion,
3116
- registeredComponents: state.allRegisteredComponents
3121
+ registeredComponents: state.allRegisteredComponents,
3122
+ inheritedStyles: {}
3117
3123
  }));
3118
3124
  qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
3119
3125
  const [elementRef2, props2, state2] = qwik.useLexicalScope();
@@ -453,7 +453,8 @@ const RenderRepeatedBlock = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlined
453
453
  context: props.repeatContext.context,
454
454
  apiKey: props.repeatContext.apiKey,
455
455
  registeredComponents: props.repeatContext.registeredComponents,
456
- inheritedStyles: props.repeatContext.inheritedStyles
456
+ inheritedStyles: props.repeatContext.inheritedStyles,
457
+ apiVersion: props.repeatContext.apiVersion
457
458
  }));
458
459
  return /* @__PURE__ */ _jsxC(RenderBlock, {
459
460
  get block() {
@@ -1876,7 +1877,11 @@ async function getAllContent(options) {
1876
1877
  const res = await fetch$1(url.href);
1877
1878
  const content = await res.json();
1878
1879
  if ("status" in content && !("results" in content)) {
1879
- logger.error("Error fetching data. ", content, options);
1880
+ logger.error("Error fetching data. ", {
1881
+ url,
1882
+ content,
1883
+ options
1884
+ });
1880
1885
  return content;
1881
1886
  }
1882
1887
  const canTrack = options.canTrack !== false;
@@ -3111,7 +3116,8 @@ const RenderContent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
3111
3116
  context: props.context || {},
3112
3117
  apiKey: props.apiKey,
3113
3118
  apiVersion: props.apiVersion,
3114
- registeredComponents: state.allRegisteredComponents
3119
+ registeredComponents: state.allRegisteredComponents,
3120
+ inheritedStyles: {}
3115
3121
  }));
3116
3122
  useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
3117
3123
  const [elementRef2, props2, state2] = useLexicalScope();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Builder.io Qwik SDK",
5
5
  "type": "module",
6
6
  "main": "./lib/index.qwik.cjs",
@@ -34,6 +34,6 @@
34
34
  "vite": "^3.0.4"
35
35
  },
36
36
  "peerDependencies": {
37
- "@builder.io/qwik": ">=0.13.3"
37
+ "@builder.io/qwik": ">=1.0.0"
38
38
  }
39
39
  }
@@ -8,7 +8,7 @@ export interface ImageProps {
8
8
  height?: number;
9
9
  width?: number;
10
10
  altText?: string;
11
- backgroundSize?: string;
11
+ backgroundSize?: "cover" | "contain";
12
12
  backgroundPosition?: string;
13
13
  srcset?: string;
14
14
  aspectRatio?: number;
package/types/index.d.ts CHANGED
@@ -10,3 +10,4 @@ export * from './functions/get-builder-search-params/index.js';
10
10
  export { track } from './functions/track/index.js';
11
11
  export type { RegisteredComponent } from './context/types';
12
12
  export type { ComponentInfo } from './types/components';
13
+ export type { RenderContentProps } from './components/render-content/render-content.types.js';
@@ -1,3 +0,0 @@
1
- import type { RenderComponentProps } from "./render-component";
2
- export declare const RenderComponentWithContext: import("@builder.io/qwik").Component<RenderComponentProps>;
3
- export default RenderComponentWithContext;
@@ -1,6 +0,0 @@
1
- type VariantData = {
2
- id: string;
3
- testRatio?: number;
4
- };
5
- export declare const getVariantsScriptString: (variants: VariantData[], contentId: string) => string;
6
- export {};
@@ -1,3 +0,0 @@
1
- import { RenderContentProps } from "../render-content/render-content.types";
2
- export declare const RenderContentVariants: import("@builder.io/qwik").Component<RenderContentProps>;
3
- export default RenderContentVariants;
@@ -1 +0,0 @@
1
- export declare const convertStyleObject: (obj: Partial<CSSStyleDeclaration>) => Partial<CSSStyleDeclaration>;
@@ -1,6 +0,0 @@
1
- import type { BuilderContextInterface } from '../context/types.js';
2
- import type { BuilderBlock } from '../types/builder-block.js';
3
- export declare function getBlockStyles({ block, context, }: {
4
- block: BuilderBlock;
5
- context: BuilderContextInterface;
6
- }): Partial<CSSStyleDeclaration>;
@@ -1,3 +0,0 @@
1
- import type { BuilderBlock } from '../types/builder-block.js';
2
- export type TagName = string;
3
- export declare function getBlockTag(block: BuilderBlock): TagName;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export declare function markMutable<T>(value: T): T;
2
- export declare function markPropsMutable<T>(props: T): T;
@@ -1,4 +0,0 @@
1
- /**
2
- * No-op function, sanitize on a per-framework basis by overriding.
3
- */
4
- export declare const sanitizeBlockStyles: (styles: Partial<CSSStyleDeclaration>) => Partial<CSSStyleDeclaration>;
@@ -1,56 +0,0 @@
1
- import type { CanTrack } from '../types/can-track.js';
2
- interface Event {
3
- /**
4
- * The type of your event.
5
- *
6
- * Examples: `click`, `conversion`, `pageview`, `impression`
7
- */
8
- type: string;
9
- data: {
10
- /**
11
- * (Optional) The content's ID. Useful if this event pertains to a specific piece of content.
12
- */
13
- contentId?: string;
14
- /**
15
- * This is the ID of the space that the content belongs to.
16
- */
17
- ownerId: string;
18
- /**
19
- * Stringified JSON object containing any additional metadata you want to track.
20
- */
21
- metadata?: string;
22
- /**
23
- * Session ID of the user. This is provided by the SDK by checking session storage.
24
- */
25
- sessionId: string | undefined;
26
- /**
27
- * Visitor ID of the user. This is provided by the SDK by checking cookies.
28
- */
29
- visitorId: string | undefined;
30
- /**
31
- * (Optional) If running an A/B test, the ID of the variation that the user is in.
32
- */
33
- variationId?: string;
34
- [index: string]: any;
35
- };
36
- }
37
- declare type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'contentId' | 'variationId'> & {
38
- /**
39
- * Your organization's API key.
40
- */
41
- apiKey: Event['data']['ownerId'];
42
- /**
43
- * (Optional) metadata that you want to provide with your event.
44
- */
45
- metadata?: {
46
- [index: string]: any;
47
- };
48
- /**
49
- * (Optional) Any additional (non-metadata) properties to add to the event.
50
- */
51
- [index: string]: any;
52
- };
53
- export declare type EventProps = EventProperties & CanTrack;
54
- export declare function _track(eventProps: EventProps): Promise<void | Response>;
55
- export declare const track: (args: EventProperties) => Promise<void | Response>;
56
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- declare const ON_MOUNT_CODE: "\n Object.values(props.customComponents).forEach((registeredComponent) => {\n sendComponentToVisualEditor(registeredComponent);\n });\n";
2
- declare const REACT_CODE: string;
3
- declare const VUE_CODE: string;
4
- declare const SVELTE_CODE: string;
5
- declare const SOLIDJS_CODE: string;
6
- declare const QWIK_CODE: string;