@builder.io/sdk-qwik 0.0.5 → 0.0.8
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 +2 -65
- package/lib/index.97024df8.js +80165 -0
- package/lib/index.d8c1e37f.cjs +80165 -0
- package/lib/index.qwik.cjs +2424 -0
- package/lib/index.qwik.mjs +2424 -0
- package/package.json +3 -4
- package/tsconfig.json +1 -1
- package/types.d.ts +12 -7
- package/src/blocks/button/button.jsx +0 -211
- package/src/blocks/button/component-info.js +0 -41
- package/src/blocks/columns/columns.jsx +0 -267
- package/src/blocks/columns/component-info.js +0 -242
- package/src/blocks/custom-code/component-info.js +0 -31
- package/src/blocks/custom-code/custom-code.jsx +0 -130
- package/src/blocks/embed/component-info.js +0 -44
- package/src/blocks/embed/embed.jsx +0 -130
- package/src/blocks/embed/helpers.js +0 -9
- package/src/blocks/form/builder-blocks.jsx +0 -100
- package/src/blocks/form/component-info.js +0 -262
- package/src/blocks/form/form.jsx +0 -789
- package/src/blocks/fragment/component-info.js +0 -11
- package/src/blocks/fragment/fragment.jsx +0 -59
- package/src/blocks/image/component-info.js +0 -151
- package/src/blocks/image/image.helpers.js +0 -48
- package/src/blocks/image/image.jsx +0 -554
- package/src/blocks/img/component-info.js +0 -20
- package/src/blocks/img/img.jsx +0 -76
- package/src/blocks/input/component-info.js +0 -74
- package/src/blocks/input/input.jsx +0 -87
- package/src/blocks/raw-text/component-info.js +0 -16
- package/src/blocks/raw-text/raw-text.jsx +0 -53
- package/src/blocks/section/component-info.js +0 -49
- package/src/blocks/section/section.jsx +0 -97
- package/src/blocks/select/component-info.js +0 -59
- package/src/blocks/select/select.jsx +0 -149
- package/src/blocks/submit-button/component-info.js +0 -28
- package/src/blocks/submit-button/submit-button.jsx +0 -87
- package/src/blocks/symbol/component-info.js +0 -43
- package/src/blocks/symbol/symbol.jsx +0 -230
- package/src/blocks/text/component-info.js +0 -24
- package/src/blocks/text/text.jsx +0 -46
- package/src/blocks/textarea/component-info.js +0 -47
- package/src/blocks/textarea/textarea.jsx +0 -65
- package/src/blocks/util.js +0 -12
- package/src/blocks/video/component-info.js +0 -106
- package/src/blocks/video/video.jsx +0 -103
- package/src/components/render-block/block-styles.jsx +0 -186
- package/src/components/render-block/render-block.helpers.js +0 -23
- package/src/components/render-block/render-block.jsx +0 -749
- package/src/components/render-block/render-component.jsx +0 -257
- package/src/components/render-block/render-repeated-block.jsx +0 -119
- package/src/components/render-block/types.js +0 -0
- package/src/components/render-blocks.jsx +0 -387
- package/src/components/render-content/components/render-styles.jsx +0 -140
- package/src/components/render-content/index.js +0 -4
- package/src/components/render-content/render-content.jsx +0 -636
- package/src/components/render-inlined-styles.jsx +0 -153
- package/src/constants/builder-registered-components.js +0 -48
- package/src/constants/device-sizes.js +0 -21
- package/src/constants/target.js +0 -4
- package/src/context/builder.context.js +0 -5
- package/src/functions/camel-to-kebab-case.js +0 -4
- package/src/functions/convert-style-object.js +0 -6
- package/src/functions/evaluate.js +0 -28
- package/src/functions/event-handler-name.js +0 -7
- package/src/functions/get-block-actions.js +0 -23
- package/src/functions/get-block-component-options.js +0 -28
- package/src/functions/get-block-properties.js +0 -29
- package/src/functions/get-block-styles.js +0 -34
- package/src/functions/get-block-tag.js +0 -6
- package/src/functions/get-builder-search-params/fn.test.js +0 -13
- package/src/functions/get-builder-search-params/index.js +0 -33
- package/src/functions/get-content/ab-testing.js +0 -38
- package/src/functions/get-content/fn.test.js +0 -31
- package/src/functions/get-content/index.js +0 -99
- package/src/functions/get-content/types.js +0 -0
- package/src/functions/get-fetch.js +0 -33
- package/src/functions/get-global-this.js +0 -18
- package/src/functions/get-processed-block.js +0 -53
- package/src/functions/get-processed-block.test.js +0 -32
- package/src/functions/if-target.js +0 -15
- package/src/functions/is-browser.js +0 -6
- package/src/functions/is-editing.js +0 -7
- package/src/functions/is-iframe.js +0 -7
- package/src/functions/is-previewing.js +0 -14
- package/src/functions/on-change.js +0 -27
- package/src/functions/on-change.test.js +0 -19
- package/src/functions/register-component.js +0 -72
- package/src/functions/register.js +0 -29
- package/src/functions/sanitize-styles.js +0 -5
- package/src/functions/set-editor-settings.js +0 -15
- package/src/functions/set.js +0 -11
- package/src/functions/set.test.js +0 -16
- package/src/functions/track.js +0 -22
- package/src/functions/transform-block.js +0 -6
- package/src/helpers/css.js +0 -12
- package/src/helpers/flatten.js +0 -34
- package/src/index-helpers/blocks-exports.js +0 -22
- package/src/index-helpers/top-of-file.js +0 -4
- package/src/index.js +0 -10
- package/src/scripts/init-editing.js +0 -79
- package/src/types/builder-block.js +0 -0
- package/src/types/builder-content.js +0 -0
- package/src/types/components.js +0 -0
- package/src/types/deep-partial.js +0 -0
- package/src/types/element.js +0 -0
- package/src/types/targets.js +0 -0
- package/src/types/typescript.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-qwik",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Builder.io Qwik SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.qwik.cjs",
|
|
@@ -12,13 +12,12 @@
|
|
|
12
12
|
"require": "./lib/index.qwik.cjs"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"types": "./types.d.ts",
|
|
16
15
|
"scripts": {
|
|
17
16
|
"build.lib": "vite build --mode lib",
|
|
18
|
-
"release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag
|
|
17
|
+
"release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag dev --access public"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
|
-
"@builder.io/qwik": "0.0.
|
|
20
|
+
"@builder.io/qwik": "0.0.40-0-dev20220808233008",
|
|
22
21
|
"@types/node": "latest",
|
|
23
22
|
"typescript": "4.7.4",
|
|
24
23
|
"vite": "3.0.2"
|
package/tsconfig.json
CHANGED
|
@@ -105,6 +105,6 @@
|
|
|
105
105
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
106
106
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
107
107
|
},
|
|
108
|
-
"include": ["types
|
|
108
|
+
"include": ["types.d.ts", "src"],
|
|
109
109
|
"exclude": ["src/blocks/form/form.tsx"]
|
|
110
110
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
type Dictionary<T> = Record<string, T>;
|
|
2
|
+
type BuilderContent = any;
|
|
3
|
+
type BuilderBlock = any;
|
|
4
|
+
type RegisteredComponent = any;
|
|
5
|
+
type RegisteredComponents = any;
|
|
6
|
+
declare const builder: { env: 'dev'; apiKey: string };
|
|
7
|
+
// TODO(misko): HACKS to be removed
|
|
8
|
+
declare const get: (obj: any, key: string) => any;
|
|
9
|
+
declare const set: (obj: any, key: string, value: any) => void;
|
|
10
|
+
interface CSSProperties {
|
|
11
|
+
flexDirection: any;
|
|
8
12
|
}
|
|
13
|
+
declare const BuilderBlocks: (props: any) => any;
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
// GENERATED BY MITOSIS
|
|
2
|
-
|
|
3
|
-
import { Fragment, Host, component$, h } from "@builder.io/qwik";
|
|
4
|
-
export const Button = component$((props) => {
|
|
5
|
-
return (
|
|
6
|
-
<Host q:host-pseudo="">
|
|
7
|
-
<Fragment>
|
|
8
|
-
{props.link ? (
|
|
9
|
-
<a
|
|
10
|
-
role="button"
|
|
11
|
-
{...props.attributes}
|
|
12
|
-
href={props.link}
|
|
13
|
-
target={props.openLinkInNewTab ? "_blank" : undefined}
|
|
14
|
-
>
|
|
15
|
-
{props.text}
|
|
16
|
-
</a>
|
|
17
|
-
) : (
|
|
18
|
-
<span {...props.attributes}>{props.text}</span>
|
|
19
|
-
)}
|
|
20
|
-
</Fragment>
|
|
21
|
-
</Host>
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
export default Button;
|
|
25
|
-
export const COMPONENT = {
|
|
26
|
-
"@type": "@builder.io/mitosis/component",
|
|
27
|
-
imports: [],
|
|
28
|
-
exports: {},
|
|
29
|
-
inputs: [],
|
|
30
|
-
meta: {},
|
|
31
|
-
refs: {},
|
|
32
|
-
state: {},
|
|
33
|
-
children: [
|
|
34
|
-
{
|
|
35
|
-
"@type": "@builder.io/mitosis/node",
|
|
36
|
-
name: "Host",
|
|
37
|
-
meta: {},
|
|
38
|
-
scope: {},
|
|
39
|
-
properties: {
|
|
40
|
-
"q:host-pseudo": "",
|
|
41
|
-
},
|
|
42
|
-
bindings: {},
|
|
43
|
-
children: [
|
|
44
|
-
{
|
|
45
|
-
"@type": "@builder.io/mitosis/node",
|
|
46
|
-
name: "Fragment",
|
|
47
|
-
meta: {},
|
|
48
|
-
scope: {},
|
|
49
|
-
properties: {},
|
|
50
|
-
bindings: {},
|
|
51
|
-
children: [
|
|
52
|
-
{
|
|
53
|
-
"@type": "@builder.io/mitosis/node",
|
|
54
|
-
name: "div",
|
|
55
|
-
meta: {},
|
|
56
|
-
scope: {},
|
|
57
|
-
properties: {
|
|
58
|
-
_text: "\n ",
|
|
59
|
-
},
|
|
60
|
-
bindings: {},
|
|
61
|
-
children: [],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"@type": "@builder.io/mitosis/node",
|
|
65
|
-
name: "Show",
|
|
66
|
-
meta: {
|
|
67
|
-
else: {
|
|
68
|
-
"@type": "@builder.io/mitosis/node",
|
|
69
|
-
name: "span",
|
|
70
|
-
meta: {},
|
|
71
|
-
scope: {},
|
|
72
|
-
properties: {},
|
|
73
|
-
bindings: {
|
|
74
|
-
_spread: {
|
|
75
|
-
code: "props.attributes",
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
children: [
|
|
79
|
-
{
|
|
80
|
-
"@type": "@builder.io/mitosis/node",
|
|
81
|
-
name: "div",
|
|
82
|
-
meta: {},
|
|
83
|
-
scope: {},
|
|
84
|
-
properties: {},
|
|
85
|
-
bindings: {
|
|
86
|
-
_text: {
|
|
87
|
-
code: "props.text",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
children: [],
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
scope: {},
|
|
96
|
-
properties: {},
|
|
97
|
-
bindings: {
|
|
98
|
-
when: {
|
|
99
|
-
code: "props.link",
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
children: [
|
|
103
|
-
{
|
|
104
|
-
"@type": "@builder.io/mitosis/node",
|
|
105
|
-
name: "div",
|
|
106
|
-
meta: {},
|
|
107
|
-
scope: {},
|
|
108
|
-
properties: {
|
|
109
|
-
_text: "\n ",
|
|
110
|
-
},
|
|
111
|
-
bindings: {},
|
|
112
|
-
children: [],
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"@type": "@builder.io/mitosis/node",
|
|
116
|
-
name: "a",
|
|
117
|
-
meta: {},
|
|
118
|
-
scope: {},
|
|
119
|
-
properties: {
|
|
120
|
-
role: "button",
|
|
121
|
-
},
|
|
122
|
-
bindings: {
|
|
123
|
-
_spread: {
|
|
124
|
-
code: "props.attributes",
|
|
125
|
-
},
|
|
126
|
-
href: {
|
|
127
|
-
code: "props.link",
|
|
128
|
-
},
|
|
129
|
-
target: {
|
|
130
|
-
code: "props.openLinkInNewTab ? '_blank' : undefined",
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
children: [
|
|
134
|
-
{
|
|
135
|
-
"@type": "@builder.io/mitosis/node",
|
|
136
|
-
name: "div",
|
|
137
|
-
meta: {},
|
|
138
|
-
scope: {},
|
|
139
|
-
properties: {
|
|
140
|
-
_text: "\n ",
|
|
141
|
-
},
|
|
142
|
-
bindings: {},
|
|
143
|
-
children: [],
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"@type": "@builder.io/mitosis/node",
|
|
147
|
-
name: "div",
|
|
148
|
-
meta: {},
|
|
149
|
-
scope: {},
|
|
150
|
-
properties: {},
|
|
151
|
-
bindings: {
|
|
152
|
-
_text: {
|
|
153
|
-
code: "props.text",
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
children: [],
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"@type": "@builder.io/mitosis/node",
|
|
160
|
-
name: "div",
|
|
161
|
-
meta: {},
|
|
162
|
-
scope: {},
|
|
163
|
-
properties: {
|
|
164
|
-
_text: "\n ",
|
|
165
|
-
},
|
|
166
|
-
bindings: {},
|
|
167
|
-
children: [],
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"@type": "@builder.io/mitosis/node",
|
|
173
|
-
name: "div",
|
|
174
|
-
meta: {},
|
|
175
|
-
scope: {},
|
|
176
|
-
properties: {
|
|
177
|
-
_text: "\n ",
|
|
178
|
-
},
|
|
179
|
-
bindings: {},
|
|
180
|
-
children: [],
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
"@type": "@builder.io/mitosis/node",
|
|
186
|
-
name: "div",
|
|
187
|
-
meta: {},
|
|
188
|
-
scope: {},
|
|
189
|
-
properties: {
|
|
190
|
-
_text: "\n ",
|
|
191
|
-
},
|
|
192
|
-
bindings: {},
|
|
193
|
-
children: [],
|
|
194
|
-
},
|
|
195
|
-
],
|
|
196
|
-
},
|
|
197
|
-
],
|
|
198
|
-
},
|
|
199
|
-
],
|
|
200
|
-
hooks: {},
|
|
201
|
-
context: {
|
|
202
|
-
get: {},
|
|
203
|
-
set: {},
|
|
204
|
-
},
|
|
205
|
-
name: "Button",
|
|
206
|
-
subComponents: [],
|
|
207
|
-
interfaces: [
|
|
208
|
-
"export interface ButtonProps {\n attributes?: any;\n text?: string;\n link?: string;\n openLinkInNewTab?: boolean;\n}",
|
|
209
|
-
],
|
|
210
|
-
propsTypeRef: "ButtonProps",
|
|
211
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Core:Button",
|
|
3
|
-
builtIn: true,
|
|
4
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
5
|
-
defaultStyles: {
|
|
6
|
-
appearance: "none",
|
|
7
|
-
paddingTop: "15px",
|
|
8
|
-
paddingBottom: "15px",
|
|
9
|
-
paddingLeft: "25px",
|
|
10
|
-
paddingRight: "25px",
|
|
11
|
-
backgroundColor: "#000000",
|
|
12
|
-
color: "white",
|
|
13
|
-
borderRadius: "4px",
|
|
14
|
-
textAlign: "center",
|
|
15
|
-
cursor: "pointer"
|
|
16
|
-
},
|
|
17
|
-
inputs: [
|
|
18
|
-
{
|
|
19
|
-
name: "text",
|
|
20
|
-
type: "text",
|
|
21
|
-
defaultValue: "Click me!",
|
|
22
|
-
bubble: true
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "link",
|
|
26
|
-
type: "url",
|
|
27
|
-
bubble: true
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "openLinkInNewTab",
|
|
31
|
-
type: "boolean",
|
|
32
|
-
defaultValue: false,
|
|
33
|
-
friendlyName: "Open link in new tab"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
static: true,
|
|
37
|
-
noWrap: true
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
componentInfo
|
|
41
|
-
};
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
// GENERATED BY MITOSIS
|
|
2
|
-
|
|
3
|
-
import RenderBlocks from "../../components/render-blocks";
|
|
4
|
-
import {
|
|
5
|
-
Fragment,
|
|
6
|
-
Host,
|
|
7
|
-
component$,
|
|
8
|
-
h,
|
|
9
|
-
useStylesScoped$,
|
|
10
|
-
} from "@builder.io/qwik";
|
|
11
|
-
export const getGutterSize = function getGutterSize(props, state) {
|
|
12
|
-
return typeof props.space === "number" ? props.space || 0 : 20;
|
|
13
|
-
};
|
|
14
|
-
export const getColumns = function getColumns(props, state) {
|
|
15
|
-
return props.columns || [];
|
|
16
|
-
};
|
|
17
|
-
export const getWidth = function getWidth(props, state, index) {
|
|
18
|
-
const columns = getColumns(props, state);
|
|
19
|
-
return columns[index]?.width || 100 / columns.length;
|
|
20
|
-
};
|
|
21
|
-
export const getColumnCssWidth = function getColumnCssWidth(
|
|
22
|
-
props,
|
|
23
|
-
state,
|
|
24
|
-
index
|
|
25
|
-
) {
|
|
26
|
-
const columns = getColumns(props, state);
|
|
27
|
-
const gutterSize = getGutterSize(props, state);
|
|
28
|
-
const subtractWidth = (gutterSize * (columns.length - 1)) / columns.length;
|
|
29
|
-
return `calc(${getWidth(props, state, index)}% - ${subtractWidth}px)`;
|
|
30
|
-
};
|
|
31
|
-
export const maybeApplyForTablet = function maybeApplyForTablet(
|
|
32
|
-
props,
|
|
33
|
-
state,
|
|
34
|
-
prop
|
|
35
|
-
) {
|
|
36
|
-
const _stackColumnsAt = props.stackColumnsAt || "tablet";
|
|
37
|
-
|
|
38
|
-
return _stackColumnsAt === "tablet" ? prop : "inherit";
|
|
39
|
-
};
|
|
40
|
-
export const columnsCssVars = function columnsCssVars(props, state) {
|
|
41
|
-
const flexDir =
|
|
42
|
-
props.stackColumnsAt === "never"
|
|
43
|
-
? "inherit"
|
|
44
|
-
: props.reverseColumnsWhenStacked
|
|
45
|
-
? "column-reverse"
|
|
46
|
-
: "column";
|
|
47
|
-
return {
|
|
48
|
-
"--flex-dir": flexDir,
|
|
49
|
-
"--flex-dir-tablet": maybeApplyForTablet(props, state, flexDir),
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
export const columnCssVars = function columnCssVars(props, state) {
|
|
53
|
-
const width = "100%";
|
|
54
|
-
const marginLeft = "0";
|
|
55
|
-
return {
|
|
56
|
-
"--column-width": width,
|
|
57
|
-
"--column-margin-left": marginLeft,
|
|
58
|
-
"--column-width-tablet": maybeApplyForTablet(props, state, width),
|
|
59
|
-
"--column-margin-left-tablet": maybeApplyForTablet(
|
|
60
|
-
props,
|
|
61
|
-
state,
|
|
62
|
-
marginLeft
|
|
63
|
-
),
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export const Columns = component$(
|
|
67
|
-
(props) => {
|
|
68
|
-
useStylesScoped$(STYLES);
|
|
69
|
-
const state = {};
|
|
70
|
-
return (
|
|
71
|
-
<Host
|
|
72
|
-
class="builder-columns div-Columns"
|
|
73
|
-
style={columnsCssVars(props, state)}
|
|
74
|
-
>
|
|
75
|
-
{(props.columns || []).map((column, index) => {
|
|
76
|
-
return (
|
|
77
|
-
<div
|
|
78
|
-
class="builder-column div-Columns-2"
|
|
79
|
-
style={{
|
|
80
|
-
width: getColumnCssWidth(props, state, index),
|
|
81
|
-
marginLeft: `${
|
|
82
|
-
index === 0 ? 0 : getGutterSize(props, state)
|
|
83
|
-
}px`,
|
|
84
|
-
...columnCssVars(props, state),
|
|
85
|
-
}}
|
|
86
|
-
key={index}
|
|
87
|
-
>
|
|
88
|
-
<RenderBlocks blocks={column.blocks}></RenderBlocks>
|
|
89
|
-
</div>
|
|
90
|
-
);
|
|
91
|
-
})}
|
|
92
|
-
</Host>
|
|
93
|
-
);
|
|
94
|
-
},
|
|
95
|
-
{ tagName: "div" }
|
|
96
|
-
);
|
|
97
|
-
export default Columns;
|
|
98
|
-
export const STYLES = `.div-Columns {
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: stretch;
|
|
101
|
-
line-height: normal; }@media (max-width: 999px) { .div-Columns {
|
|
102
|
-
flex-direction: var(--flex-dir-tablet); } }@media (max-width: 639px) { .div-Columns {
|
|
103
|
-
flex-direction: var(--flex-dir); } }.div-Columns-2 {
|
|
104
|
-
flex-grow: 1; }@media (max-width: 999px) { .div-Columns-2 {
|
|
105
|
-
width: var(--column-width-tablet) !important;
|
|
106
|
-
margin-left: var(--column-margin-left-tablet) !important; } }@media (max-width: 639px) { .div-Columns-2 {
|
|
107
|
-
width: var(--column-width) !important;
|
|
108
|
-
margin-left: var(--column-margin-left) !important; } }`;
|
|
109
|
-
export const COMPONENT = {
|
|
110
|
-
"@type": "@builder.io/mitosis/component",
|
|
111
|
-
imports: [
|
|
112
|
-
{
|
|
113
|
-
imports: {
|
|
114
|
-
RenderBlocks: "default",
|
|
115
|
-
},
|
|
116
|
-
path: "../../components/render-blocks.lite",
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
exports: {},
|
|
120
|
-
inputs: [],
|
|
121
|
-
meta: {},
|
|
122
|
-
refs: {},
|
|
123
|
-
state: {
|
|
124
|
-
getGutterSize:
|
|
125
|
-
"@builder.io/mitosis/method:getGutterSize() {\n return typeof props.space === 'number' ? props.space || 0 : 20;\n}",
|
|
126
|
-
getColumns:
|
|
127
|
-
"@builder.io/mitosis/method:getColumns() {\n return props.columns || [];\n}",
|
|
128
|
-
getWidth:
|
|
129
|
-
"@builder.io/mitosis/method:getWidth(index: number) {\n const columns = getColumns(props,state,);\n return columns[index]?.width || 100 / columns.length;\n}",
|
|
130
|
-
getColumnCssWidth:
|
|
131
|
-
"@builder.io/mitosis/method:getColumnCssWidth(index: number) {\n const columns = getColumns(props,state,);\n const gutterSize = getGutterSize(props,state,);\n const subtractWidth = gutterSize * (columns.length - 1) / columns.length;\n return `calc(${getWidth(props,state,index)}% - ${subtractWidth}px)`;\n}",
|
|
132
|
-
maybeApplyForTablet:
|
|
133
|
-
"@builder.io/mitosis/method:maybeApplyForTablet(prop: JSX.CSS['flexDirection']) {\n const _stackColumnsAt = props.stackColumnsAt || 'tablet';\n\n return _stackColumnsAt === 'tablet' ? prop : 'inherit';\n}",
|
|
134
|
-
columnsCssVars:
|
|
135
|
-
"@builder.io/mitosis/method:get columnsCssVars() {\n const flexDir = props.stackColumnsAt === 'never' ? 'inherit' : props.reverseColumnsWhenStacked ? 'column-reverse' : 'column';\n return {\n '--flex-dir': flexDir,\n '--flex-dir-tablet': maybeApplyForTablet(props,state,flexDir)\n };\n}",
|
|
136
|
-
columnCssVars:
|
|
137
|
-
"@builder.io/mitosis/method:get columnCssVars() {\n const width = '100%';\n const marginLeft = '0';\n return {\n '--column-width': width,\n '--column-margin-left': marginLeft,\n '--column-width-tablet': maybeApplyForTablet(props,state,width),\n '--column-margin-left-tablet': maybeApplyForTablet(props,state,marginLeft)\n };\n}",
|
|
138
|
-
},
|
|
139
|
-
children: [
|
|
140
|
-
{
|
|
141
|
-
"@type": "@builder.io/mitosis/node",
|
|
142
|
-
name: "Host",
|
|
143
|
-
meta: {},
|
|
144
|
-
scope: {},
|
|
145
|
-
properties: {
|
|
146
|
-
class: "builder-columns div-Columns",
|
|
147
|
-
},
|
|
148
|
-
bindings: {
|
|
149
|
-
style: {
|
|
150
|
-
code: "columnsCssVars(props,state)",
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
children: [
|
|
154
|
-
{
|
|
155
|
-
"@type": "@builder.io/mitosis/node",
|
|
156
|
-
name: "div",
|
|
157
|
-
meta: {},
|
|
158
|
-
scope: {},
|
|
159
|
-
properties: {
|
|
160
|
-
_text: "\n ",
|
|
161
|
-
},
|
|
162
|
-
bindings: {},
|
|
163
|
-
children: [],
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"@type": "@builder.io/mitosis/node",
|
|
167
|
-
name: "For",
|
|
168
|
-
meta: {},
|
|
169
|
-
scope: {
|
|
170
|
-
For: ["column", "index"],
|
|
171
|
-
},
|
|
172
|
-
properties: {
|
|
173
|
-
_forName: "column",
|
|
174
|
-
_indexName: "index",
|
|
175
|
-
},
|
|
176
|
-
bindings: {
|
|
177
|
-
each: {
|
|
178
|
-
code: "props.columns",
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
children: [
|
|
182
|
-
{
|
|
183
|
-
"@type": "@builder.io/mitosis/node",
|
|
184
|
-
name: "div",
|
|
185
|
-
meta: {},
|
|
186
|
-
scope: {},
|
|
187
|
-
properties: {
|
|
188
|
-
class: "builder-column div-Columns-2",
|
|
189
|
-
},
|
|
190
|
-
bindings: {
|
|
191
|
-
style: {
|
|
192
|
-
code: "{\n width: getColumnCssWidth(props,state,index),\n marginLeft: `${index === 0 ? 0 : getGutterSize(props,state,)}px`,\n ...columnCssVars(props,state)\n}",
|
|
193
|
-
},
|
|
194
|
-
key: {
|
|
195
|
-
code: "index",
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
children: [
|
|
199
|
-
{
|
|
200
|
-
"@type": "@builder.io/mitosis/node",
|
|
201
|
-
name: "div",
|
|
202
|
-
meta: {},
|
|
203
|
-
scope: {},
|
|
204
|
-
properties: {
|
|
205
|
-
_text: "\n ",
|
|
206
|
-
},
|
|
207
|
-
bindings: {},
|
|
208
|
-
children: [],
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"@type": "@builder.io/mitosis/node",
|
|
212
|
-
name: "RenderBlocks",
|
|
213
|
-
meta: {},
|
|
214
|
-
scope: {},
|
|
215
|
-
properties: {},
|
|
216
|
-
bindings: {
|
|
217
|
-
blocks: {
|
|
218
|
-
code: "column.blocks",
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
children: [],
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"@type": "@builder.io/mitosis/node",
|
|
225
|
-
name: "div",
|
|
226
|
-
meta: {},
|
|
227
|
-
scope: {},
|
|
228
|
-
properties: {
|
|
229
|
-
_text: "\n ",
|
|
230
|
-
},
|
|
231
|
-
bindings: {},
|
|
232
|
-
children: [],
|
|
233
|
-
},
|
|
234
|
-
],
|
|
235
|
-
},
|
|
236
|
-
],
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
"@type": "@builder.io/mitosis/node",
|
|
240
|
-
name: "div",
|
|
241
|
-
meta: {},
|
|
242
|
-
scope: {},
|
|
243
|
-
properties: {
|
|
244
|
-
_text: "\n ",
|
|
245
|
-
},
|
|
246
|
-
bindings: {},
|
|
247
|
-
children: [],
|
|
248
|
-
},
|
|
249
|
-
],
|
|
250
|
-
},
|
|
251
|
-
],
|
|
252
|
-
hooks: {},
|
|
253
|
-
context: {
|
|
254
|
-
get: {},
|
|
255
|
-
set: {},
|
|
256
|
-
},
|
|
257
|
-
name: "Columns",
|
|
258
|
-
subComponents: [],
|
|
259
|
-
types: [
|
|
260
|
-
"type Column = {\n blocks: any; // TODO: Implement this when support for dynamic CSS lands\n\n width?: number;\n};",
|
|
261
|
-
"type StackColumnsAt = 'tablet' | 'mobile' | 'never';",
|
|
262
|
-
],
|
|
263
|
-
interfaces: [
|
|
264
|
-
"export interface ColumnProps {\n columns?: Column[]; // TODO: Implement this when support for dynamic CSS lands\n\n space?: number; // TODO: Implement this when support for dynamic CSS lands\n\n stackColumnsAt?: StackColumnsAt; // TODO: Implement this when support for dynamic CSS lands\n\n reverseColumnsWhenStacked?: boolean;\n}",
|
|
265
|
-
],
|
|
266
|
-
propsTypeRef: "ColumnProps",
|
|
267
|
-
};
|