@builder.io/sdk-qwik 0.0.26 → 0.0.27
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/README.md +3 -4
- package/lib/index.qwik.cjs +205 -177
- package/lib/index.qwik.mjs +207 -179
- package/package.json +1 -1
- package/types/blocks/BaseText.d.ts +5 -0
- package/types/blocks/image/image.d.ts +1 -1
- package/types/blocks/symbol/symbol.d.ts +1 -0
- package/types/blocks/video/video.d.ts +1 -0
- package/types/components/render-block/render-block.d.ts +22 -5
- package/types/components/render-block/render-component-with-context.d.ts +3 -0
- package/types/components/render-blocks.d.ts +1 -1
- package/types/context/types.d.ts +1 -0
- package/types/functions/extract-text-styles.d.ts +4 -0
- package/types/functions/fast-clone.d.ts +4 -0
- package/types/functions/get-block-styles.d.ts +5 -1
- package/types/functions/get-react-native-block-styles.d.ts +6 -0
- package/types/functions/register-component.d.ts +1 -1
- package/types/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/types/functions/track.d.ts +35 -5
- package/types/helpers/css.d.ts +5 -1
- package/types/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -22,4 +22,4 @@ export declare const srcSetToUse: (props: any, state: any) => any;
|
|
|
22
22
|
export declare const webpSrcSet: (props: any, state: any) => any;
|
|
23
23
|
export declare const Image: import("@builder.io/qwik").Component<ImageProps>;
|
|
24
24
|
export default Image;
|
|
25
|
-
export declare const STYLES = ".
|
|
25
|
+
export declare const STYLES = ".img-Image { \nopacity: 1;\ntransition: opacity 0.2s ease-in-out;\nposition: absolute;\nheight: 100%;\nwidth: 100%;\ntop: 0px;\nleft: 0px; }.div-Image { \nwidth: 100%;\npointer-events: none;\nfont-size: 0; }.div-Image-2 { \ndisplay: flex;\nflex-direction: column;\nalign-items: stretch;\nposition: absolute;\ntop: 0;\nleft: 0;\nwidth: 100%;\nheight: 100%; }";
|
|
@@ -16,5 +16,6 @@ export interface SymbolProps {
|
|
|
16
16
|
attributes?: any;
|
|
17
17
|
inheritState?: boolean;
|
|
18
18
|
}
|
|
19
|
+
export declare const contentToUse: (props: any, state: any, builderContext: any) => any;
|
|
19
20
|
export declare const Symbol: import("@builder.io/qwik").Component<SymbolProps>;
|
|
20
21
|
export default Symbol;
|
|
@@ -21,5 +21,6 @@ export declare const videoProps: (props: any, state: any) => {
|
|
|
21
21
|
muted?: boolean | undefined;
|
|
22
22
|
autoPlay?: boolean | undefined;
|
|
23
23
|
};
|
|
24
|
+
export declare const spreadProps: (props: any, state: any) => any;
|
|
24
25
|
export declare const Video: import("@builder.io/qwik").Component<VideoProps>;
|
|
25
26
|
export default Video;
|
|
@@ -1,31 +1,48 @@
|
|
|
1
1
|
import type { BuilderContextInterface } from "../../context/types.js";
|
|
2
2
|
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
3
|
+
import type { RenderComponentProps } from "./render-component";
|
|
3
4
|
import type { RepeatData } from "./types.js";
|
|
4
5
|
export declare type RenderBlockProps = {
|
|
5
6
|
block: BuilderBlock;
|
|
6
7
|
context: BuilderContextInterface;
|
|
7
8
|
};
|
|
8
9
|
export declare const component: (props: any, state: any) => any;
|
|
9
|
-
export declare const componentInfo: (props: any, state: any) => any;
|
|
10
|
-
export declare const componentRef: (props: any, state: any) => any;
|
|
11
10
|
export declare const tagName: (props: any, state: any) => string;
|
|
12
11
|
export declare const useBlock: (props: any, state: any) => any;
|
|
13
12
|
export declare const attributes: (props: any, state: any) => {
|
|
14
|
-
style
|
|
13
|
+
style?: CSSStyleDeclaration | Record<string, string | undefined> | undefined;
|
|
15
14
|
'builder-id': string | undefined;
|
|
16
15
|
class: string;
|
|
17
16
|
};
|
|
18
17
|
export declare const shouldWrap: (props: any, state: any) => boolean;
|
|
19
|
-
export declare const componentOptions: (props: any, state: any) => any;
|
|
20
18
|
export declare const renderComponentProps: (props: any, state: any) => {
|
|
21
19
|
blockChildren: any;
|
|
22
20
|
componentRef: any;
|
|
23
21
|
componentOptions: any;
|
|
24
|
-
context:
|
|
22
|
+
context: {
|
|
23
|
+
apiKey: any;
|
|
24
|
+
state: any;
|
|
25
|
+
content: any;
|
|
26
|
+
context: any;
|
|
27
|
+
registeredComponents: any;
|
|
28
|
+
inheritedStyles: Partial<CSSStyleDeclaration>;
|
|
29
|
+
};
|
|
25
30
|
};
|
|
26
31
|
export declare const children: (props: any, state: any) => any;
|
|
27
32
|
export declare const childrenWithoutParentComponent: (props: any, state: any) => any;
|
|
28
33
|
export declare const repeatItemData: (props: any, state: any) => RepeatData[] | undefined;
|
|
34
|
+
export declare const inheritedTextStyles: (props: any, state: any) => Partial<CSSStyleDeclaration>;
|
|
35
|
+
export declare const childrenContext: (props: any, state: any) => {
|
|
36
|
+
apiKey: any;
|
|
37
|
+
state: any;
|
|
38
|
+
content: any;
|
|
39
|
+
context: any;
|
|
40
|
+
registeredComponents: any;
|
|
41
|
+
inheritedStyles: Partial<CSSStyleDeclaration>;
|
|
42
|
+
};
|
|
43
|
+
export declare const renderComponentTag: (props: any, state: any) => ((props: RenderComponentProps & {
|
|
44
|
+
key?: any;
|
|
45
|
+
}) => import("@builder.io/qwik/jsx-runtime").JSX.Element) | import("@builder.io/qwik").Component<RenderComponentProps> | "RenderComponent";
|
|
29
46
|
export declare const RenderBlock: (props: RenderBlockProps & {
|
|
30
47
|
key?: any;
|
|
31
48
|
}) => import("@builder.io/qwik/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ export declare type RenderBlockProps = {
|
|
|
3
3
|
blocks?: BuilderBlock[];
|
|
4
4
|
parent?: string;
|
|
5
5
|
path?: string;
|
|
6
|
-
|
|
6
|
+
styleProp?: Record<string, any>;
|
|
7
7
|
};
|
|
8
8
|
export declare const className: (props: any, state: any, builderContext: any) => string;
|
|
9
9
|
export declare const onClick: (props: any, state: any, builderContext: any) => void;
|
package/types/context/types.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types.js';
|
|
1
2
|
import type { BuilderBlock } from '../types/builder-block.js';
|
|
2
|
-
export declare function getBlockStyles(block
|
|
3
|
+
export declare function getBlockStyles({ block, context, }: {
|
|
4
|
+
block: BuilderBlock;
|
|
5
|
+
context: BuilderContextInterface;
|
|
6
|
+
}): Partial<CSSStyleDeclaration>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
|
+
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
+
export declare function getReactNativeBlockStyles({ block, context, }: {
|
|
4
|
+
block: BuilderBlock;
|
|
5
|
+
context: BuilderContextInterface;
|
|
6
|
+
}): CSSStyleDeclaration | Record<string, string | undefined>;
|
|
@@ -8,7 +8,7 @@ export declare const components: RegisteredComponent[];
|
|
|
8
8
|
* @deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.
|
|
9
9
|
*/
|
|
10
10
|
export declare function registerComponent(component: any, info: ComponentInfo): void;
|
|
11
|
-
export declare const createRegisterComponentMessage: ({ component, ...info }: RegisteredComponent) => {
|
|
11
|
+
export declare const createRegisterComponentMessage: ({ component: _, ...info }: RegisteredComponent) => {
|
|
12
12
|
type: string;
|
|
13
13
|
data: ComponentInfo;
|
|
14
14
|
};
|
|
@@ -2,20 +2,50 @@ import type { CanTrack } from '../types/can-track.js';
|
|
|
2
2
|
interface Event {
|
|
3
3
|
type: 'click' | 'impression';
|
|
4
4
|
data: {
|
|
5
|
+
/**
|
|
6
|
+
* (Optional) The content's ID. Useful if this event pertains to a specific piece of content.
|
|
7
|
+
*/
|
|
5
8
|
contentId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* This is the ID of the space that the content belongs to.
|
|
11
|
+
*/
|
|
6
12
|
ownerId: string;
|
|
13
|
+
/**
|
|
14
|
+
* Stringified JSON object containing any additional metadata you want to track.
|
|
15
|
+
*/
|
|
7
16
|
metadata?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Session ID of the user. This is provided by the SDK by checking session storage.
|
|
19
|
+
*/
|
|
8
20
|
sessionId: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Visitor ID of the user. This is provided by the SDK by checking cookies.
|
|
23
|
+
*/
|
|
9
24
|
visitorId: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* (Optional) If running an A/B test, the ID of the variation that the user is in.
|
|
27
|
+
*/
|
|
28
|
+
variationId?: string;
|
|
10
29
|
[index: string]: any;
|
|
11
30
|
};
|
|
12
31
|
}
|
|
13
|
-
declare type EventProperties = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
declare type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'contentId' | 'variationId'> & {
|
|
33
|
+
/**
|
|
34
|
+
* Your organization's API key.
|
|
35
|
+
*/
|
|
36
|
+
apiKey: Event['data']['ownerId'];
|
|
37
|
+
/**
|
|
38
|
+
* (Optional) metadata that you want to provide with your event.
|
|
39
|
+
*/
|
|
40
|
+
metadata?: {
|
|
41
|
+
[index: string]: any;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* (Optional) Any additional (non-metadata) properties to add to the event.
|
|
45
|
+
*/
|
|
17
46
|
[index: string]: any;
|
|
18
47
|
};
|
|
19
48
|
export declare type EventProps = EventProperties & CanTrack;
|
|
20
|
-
export declare function
|
|
49
|
+
export declare function _track(eventProps: EventProps): Promise<void | Response>;
|
|
50
|
+
export declare const track: (args: EventProperties) => Promise<void | Response>;
|
|
21
51
|
export {};
|
package/types/helpers/css.d.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const createCssClass: ({ mediaQuery, className, styles, }: {
|
|
2
|
+
mediaQuery?: string | undefined;
|
|
3
|
+
className: string;
|
|
4
|
+
styles: Partial<CSSStyleDeclaration>;
|
|
5
|
+
}) => string;
|
package/types/index.d.ts
CHANGED