@builder.io/sdk-qwik 0.1.2 → 0.1.3
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/lib/index.qwik.cjs +2771 -2804
- package/lib/index.qwik.mjs +2795 -2801
- package/package.json +2 -1
- package/types/blocks/button/button.d.ts +1 -1
- package/types/blocks/columns/columns.d.ts +1 -1
- package/types/blocks/image/image.d.ts +1 -1
- package/types/components/render-block/render-block.d.ts +2 -8
- package/types/components/render-block/render-block.helpers.d.ts +11 -0
- package/types/components/render-blocks.d.ts +1 -1
- package/types/components/render-content/render-content.d.ts +2 -6
- package/types/functions/track/helpers.d.ts +5 -0
- package/types/functions/track/index.d.ts +51 -0
- package/types/functions/track/interaction.d.ts +13 -0
- package/types/index.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-qwik",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Builder.io Qwik SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.qwik.cjs",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"release:dev": "yarn run build && npm version prerelease && npm publish --tag dev"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
+
"@builder.io/qwik": ">=0.13.3",
|
|
31
32
|
"@types/node": "latest",
|
|
32
33
|
"typescript": "^4",
|
|
33
34
|
"vite": "^3.0.4"
|
|
@@ -6,4 +6,4 @@ export interface ButtonProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const Button: import("@builder.io/qwik").Component<ButtonProps>;
|
|
8
8
|
export default Button;
|
|
9
|
-
export declare const STYLES = ".button-Button {
|
|
9
|
+
export declare const STYLES = "\n.button-Button {\n all: unset;\n}";
|
|
@@ -63,4 +63,4 @@ export declare const reactNativeColumnStyles: (props: any, state: any) => {
|
|
|
63
63
|
};
|
|
64
64
|
export declare const Columns: import("@builder.io/qwik").Component<ColumnProps>;
|
|
65
65
|
export default Columns;
|
|
66
|
-
export declare const STYLES = ".div-Columns {
|
|
66
|
+
export declare const STYLES = "\n.div-Columns {\n display: flex;\n line-height: normal;\n}.div-Columns-2 {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}";
|
|
@@ -29,4 +29,4 @@ export declare const aspectRatioCss: (props: any, state: any) => {
|
|
|
29
29
|
} | undefined;
|
|
30
30
|
export declare const Image: import("@builder.io/qwik").Component<ImageProps>;
|
|
31
31
|
export default Image;
|
|
32
|
-
export declare const STYLES = ".img-Image {
|
|
32
|
+
export declare const STYLES = "\n.img-Image {\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n}.div-Image {\n width: 100%;\n pointer-events: none;\n font-size: 0;\n}.div-Image-2 {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}";
|
|
@@ -1,12 +1,10 @@
|
|
|
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";
|
|
4
|
-
import type { RepeatData } from "./types.js";
|
|
5
3
|
export declare type RenderBlockProps = {
|
|
6
4
|
block: BuilderBlock;
|
|
7
5
|
context: BuilderContextInterface;
|
|
8
6
|
};
|
|
9
|
-
export declare const component: (props: any, state: any) =>
|
|
7
|
+
export declare const component: (props: any, state: any) => import("../../context/types.js").RegisteredComponent | null | undefined;
|
|
10
8
|
export declare const tag: (props: any, state: any) => string;
|
|
11
9
|
export declare const useBlock: (props: any, state: any) => any;
|
|
12
10
|
export declare const actions: (props: any, state: any) => {
|
|
@@ -17,7 +15,6 @@ export declare const attributes: (props: any, state: any) => {
|
|
|
17
15
|
'builder-id': string | undefined;
|
|
18
16
|
class: string;
|
|
19
17
|
};
|
|
20
|
-
export declare const shouldWrap: (props: any, state: any) => boolean;
|
|
21
18
|
export declare const renderComponentProps: (props: any, state: any) => {
|
|
22
19
|
blockChildren: any;
|
|
23
20
|
componentRef: any;
|
|
@@ -31,10 +28,8 @@ export declare const renderComponentProps: (props: any, state: any) => {
|
|
|
31
28
|
inheritedStyles: Partial<CSSStyleDeclaration>;
|
|
32
29
|
};
|
|
33
30
|
};
|
|
34
|
-
export declare const useChildren: (props: any, state: any) => any;
|
|
35
31
|
export declare const childrenWithoutParentComponent: (props: any, state: any) => any;
|
|
36
|
-
export declare const repeatItemData: (props: any, state: any) => RepeatData[] | undefined;
|
|
37
|
-
export declare const inheritedTextStyles: (props: any, state: any) => Partial<CSSStyleDeclaration>;
|
|
32
|
+
export declare const repeatItemData: (props: any, state: any) => import("./types.js").RepeatData[] | undefined;
|
|
38
33
|
export declare const childrenContext: (props: any, state: any) => {
|
|
39
34
|
apiKey: any;
|
|
40
35
|
state: any;
|
|
@@ -43,7 +38,6 @@ export declare const childrenContext: (props: any, state: any) => {
|
|
|
43
38
|
registeredComponents: any;
|
|
44
39
|
inheritedStyles: Partial<CSSStyleDeclaration>;
|
|
45
40
|
};
|
|
46
|
-
export declare const renderComponentTag: (props: any, state: any) => import("@builder.io/qwik").Component<RenderComponentProps> | "RenderComponent";
|
|
47
41
|
export declare const RenderBlock: (props: RenderBlockProps & {
|
|
48
42
|
key?: any;
|
|
49
43
|
}) => import("@builder.io/qwik/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../../context/types';
|
|
2
|
+
import type { BuilderBlock } from '../../types/builder-block';
|
|
3
|
+
import type { RepeatData } from './types';
|
|
1
4
|
export declare const isEmptyHtmlElement: (tagName: unknown) => boolean;
|
|
5
|
+
export declare const getComponent: ({ block, context, }: {
|
|
6
|
+
block: BuilderBlock;
|
|
7
|
+
context: BuilderContextInterface;
|
|
8
|
+
}) => import("../../context/types").RegisteredComponent | null | undefined;
|
|
9
|
+
export declare const getRepeatItemData: ({ block, context, }: {
|
|
10
|
+
block: BuilderBlock;
|
|
11
|
+
context: BuilderContextInterface;
|
|
12
|
+
}) => RepeatData[] | undefined;
|
|
@@ -10,4 +10,4 @@ export declare const onClick: (props: any, state: any, builderContext: any) => v
|
|
|
10
10
|
export declare const onMouseEnter: (props: any, state: any, builderContext: any) => void;
|
|
11
11
|
export declare const RenderBlocks: import("@builder.io/qwik").Component<RenderBlockProps>;
|
|
12
12
|
export default RenderBlocks;
|
|
13
|
-
export declare const STYLES = ".div-RenderBlocks {
|
|
13
|
+
export declare const STYLES = "\n.div-RenderBlocks {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}";
|
|
@@ -14,15 +14,11 @@ export declare type RenderContentProps = {
|
|
|
14
14
|
locale?: string;
|
|
15
15
|
includeRefs?: boolean;
|
|
16
16
|
};
|
|
17
|
-
export declare const useContent: (props: any, state: any, elementRef: any) =>
|
|
18
|
-
export declare const canTrackToUse: (props: any, state: any, elementRef: any) => any;
|
|
17
|
+
export declare const useContent: (props: any, state: any, elementRef: any) => any;
|
|
19
18
|
export declare const contentState: (props: any, state: any, elementRef: any) => any;
|
|
20
|
-
export declare const contextContext: (props: any, state: any, elementRef: any) => any;
|
|
21
|
-
export declare const allRegisteredComponents: (props: any, state: any, elementRef: any) => any;
|
|
22
19
|
export declare const processMessage: (props: any, state: any, elementRef: any, event: MessageEvent) => void;
|
|
23
20
|
export declare const evaluateJsCode: (props: any, state: any, elementRef: any) => void;
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const onClick: (props: any, state: any, elementRef: any, _event: MouseEvent) => void;
|
|
21
|
+
export declare const onClick: (props: any, state: any, elementRef: any, event: any) => void;
|
|
26
22
|
export declare const evalExpression: (props: any, state: any, elementRef: any, expression: string) => string;
|
|
27
23
|
export declare const handleRequest: (props: any, state: any, elementRef: any, { url, key, }: {
|
|
28
24
|
key: string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { CanTrack } from '../../types/can-track.js';
|
|
2
|
+
import type { Dictionary } from '../../types/typescript.js';
|
|
3
|
+
interface Event {
|
|
4
|
+
/**
|
|
5
|
+
* The type of your event.
|
|
6
|
+
*
|
|
7
|
+
* Examples: `click`, `conversion`, `pageview`, `impression`
|
|
8
|
+
*/
|
|
9
|
+
type: string;
|
|
10
|
+
data: {
|
|
11
|
+
/**
|
|
12
|
+
* (Optional) The content's ID. Useful if this event pertains to a specific piece of content.
|
|
13
|
+
*/
|
|
14
|
+
contentId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* This is the ID of the space that the content belongs to.
|
|
17
|
+
*/
|
|
18
|
+
ownerId: string;
|
|
19
|
+
/**
|
|
20
|
+
* (Optional) metadata that you want to provide with your event.
|
|
21
|
+
*/
|
|
22
|
+
metadata?: Dictionary<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Session ID of the user. This is provided by the SDK by checking session storage.
|
|
25
|
+
*/
|
|
26
|
+
sessionId: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Visitor ID of the user. This is provided by the SDK by checking cookies.
|
|
29
|
+
*/
|
|
30
|
+
visitorId: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* (Optional) If running an A/B test, the ID of the variation that the user is in.
|
|
33
|
+
*/
|
|
34
|
+
variationId?: string;
|
|
35
|
+
[index: string]: any;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
declare type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'contentId' | 'variationId' | 'metadata'> & {
|
|
39
|
+
/**
|
|
40
|
+
* Your organization's API key.
|
|
41
|
+
*/
|
|
42
|
+
apiKey: Event['data']['ownerId'];
|
|
43
|
+
/**
|
|
44
|
+
* (Optional) Any additional (non-metadata) properties to add to the event.
|
|
45
|
+
*/
|
|
46
|
+
[index: string]: any;
|
|
47
|
+
};
|
|
48
|
+
export declare type EventProps = EventProperties & CanTrack;
|
|
49
|
+
export declare function _track(eventProps: EventProps): Promise<void | Response>;
|
|
50
|
+
export declare const track: (args: EventProperties) => Promise<void | Response>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare type Offset = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const getInteractionPropertiesForEvent: (event: MouseEvent) => {
|
|
6
|
+
targetBuilderElement: string | undefined;
|
|
7
|
+
metadata: {
|
|
8
|
+
targetOffset: Offset | undefined;
|
|
9
|
+
builderTargetOffset: Offset | undefined;
|
|
10
|
+
builderElementIndex: number | undefined;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export * from './functions/register.js';
|
|
|
8
8
|
export * from './functions/set-editor-settings.js';
|
|
9
9
|
export * from './functions/get-content/index.js';
|
|
10
10
|
export * from './functions/get-builder-search-params/index.js';
|
|
11
|
-
export { track } from './functions/track';
|
|
11
|
+
export { track } from './functions/track/index.js';
|
|
12
12
|
export type { RegisteredComponent } from './context/types';
|
|
13
13
|
export type { ComponentInfo } from './types/components';
|