@builder.io/sdk-qwik 0.0.8 → 0.0.9
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 +65 -2
- package/lib/index.qwik.cjs +104 -7
- package/lib/index.qwik.mjs +104 -7
- package/package.json +1 -1
- package/src/blocks/button/button.jsx +197 -0
- package/src/blocks/button/component-info.js +41 -0
- package/src/blocks/columns/columns.jsx +267 -0
- package/src/blocks/columns/component-info.js +242 -0
- package/src/blocks/custom-code/component-info.js +31 -0
- package/src/blocks/custom-code/custom-code.jsx +130 -0
- package/src/blocks/embed/component-info.js +44 -0
- package/src/blocks/embed/embed.jsx +130 -0
- package/src/blocks/embed/helpers.js +9 -0
- package/src/blocks/form/builder-blocks.jsx +86 -0
- package/src/blocks/form/component-info.js +262 -0
- package/src/blocks/form/form.jsx +782 -0
- package/src/blocks/fragment/component-info.js +11 -0
- package/src/blocks/fragment/fragment.jsx +59 -0
- package/src/blocks/image/component-info.js +151 -0
- package/src/blocks/image/image.helpers.js +48 -0
- package/src/blocks/image/image.jsx +554 -0
- package/src/blocks/img/component-info.js +20 -0
- package/src/blocks/img/img.jsx +76 -0
- package/src/blocks/input/component-info.js +74 -0
- package/src/blocks/input/input.jsx +87 -0
- package/src/blocks/raw-text/component-info.js +16 -0
- package/src/blocks/raw-text/raw-text.jsx +53 -0
- package/src/blocks/section/component-info.js +49 -0
- package/src/blocks/section/section.jsx +97 -0
- package/src/blocks/select/component-info.js +59 -0
- package/src/blocks/select/select.jsx +149 -0
- package/src/blocks/submit-button/component-info.js +28 -0
- package/src/blocks/submit-button/submit-button.jsx +87 -0
- package/src/blocks/symbol/component-info.js +43 -0
- package/src/blocks/symbol/symbol.jsx +211 -0
- package/src/blocks/text/component-info.js +24 -0
- package/src/blocks/text/text.jsx +46 -0
- package/src/blocks/textarea/component-info.js +47 -0
- package/src/blocks/textarea/textarea.jsx +65 -0
- package/src/blocks/util.js +7 -0
- package/src/blocks/video/component-info.js +106 -0
- package/src/blocks/video/video.jsx +103 -0
- package/src/components/render-block/block-styles.jsx +174 -0
- package/src/components/render-block/render-block.helpers.js +23 -0
- package/src/components/render-block/render-block.jsx +733 -0
- package/src/components/render-block/render-component.jsx +245 -0
- package/src/components/render-block/render-repeated-block.jsx +104 -0
- package/src/components/render-block/types.js +0 -0
- package/src/components/render-blocks.jsx +387 -0
- package/src/components/render-content/components/render-styles.jsx +126 -0
- package/src/components/render-content/index.js +4 -0
- package/src/components/render-content/render-content.jsx +650 -0
- package/src/components/render-inlined-styles.jsx +141 -0
- package/src/constants/builder-registered-components.js +48 -0
- package/src/constants/device-sizes.js +21 -0
- package/src/constants/target.js +4 -0
- package/src/context/builder.context.js +5 -0
- package/src/functions/camel-to-kebab-case.js +4 -0
- package/src/functions/convert-style-object.js +6 -0
- package/src/functions/evaluate.js +28 -0
- package/src/functions/event-handler-name.js +7 -0
- package/src/functions/get-block-actions.js +23 -0
- package/src/functions/get-block-component-options.js +28 -0
- package/src/functions/get-block-properties.js +29 -0
- package/src/functions/get-block-styles.js +34 -0
- package/src/functions/get-block-tag.js +6 -0
- package/src/functions/get-builder-search-params/fn.test.js +13 -0
- package/src/functions/get-builder-search-params/index.js +33 -0
- package/src/functions/get-content/ab-testing.js +38 -0
- package/src/functions/get-content/fn.test.js +31 -0
- package/src/functions/get-content/index.js +96 -0
- package/src/functions/get-content/types.js +0 -0
- package/src/functions/get-fetch.js +34 -0
- package/src/functions/get-global-this.js +18 -0
- package/src/functions/get-processed-block.js +53 -0
- package/src/functions/get-processed-block.test.js +32 -0
- package/src/functions/if-target.js +15 -0
- package/src/functions/is-browser.js +6 -0
- package/src/functions/is-editing.js +7 -0
- package/src/functions/is-iframe.js +7 -0
- package/src/functions/is-previewing.js +14 -0
- package/src/functions/on-change.js +27 -0
- package/src/functions/on-change.test.js +19 -0
- package/src/functions/register-component.js +72 -0
- package/src/functions/register.js +29 -0
- package/src/functions/sanitize-styles.js +5 -0
- package/src/functions/set-editor-settings.js +15 -0
- package/src/functions/set.js +11 -0
- package/src/functions/set.test.js +16 -0
- package/src/functions/track.js +22 -0
- package/src/functions/transform-block.js +6 -0
- package/src/helpers/css.js +12 -0
- package/src/helpers/flatten.js +34 -0
- package/src/index-helpers/blocks-exports.js +22 -0
- package/src/index-helpers/top-of-file.js +4 -0
- package/src/index.js +10 -0
- package/src/scripts/init-editing.js +79 -0
- 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/types.d.ts +7 -12
- package/root.json +0 -1176
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// GENERATED BY MITOSIS
|
|
2
|
+
|
|
3
|
+
import { getMaxWidthQueryForSize } from "../../constants/device-sizes.js";
|
|
4
|
+
import { TARGET } from "../../constants/target.js";
|
|
5
|
+
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
6
|
+
import { convertStyleMaptoCSS } from "../../helpers/css.js";
|
|
7
|
+
import RenderInlinedStyles from "../render-inlined-styles";
|
|
8
|
+
import { Fragment, h } from "@builder.io/qwik";
|
|
9
|
+
export const useBlock = function useBlock(props, state) {
|
|
10
|
+
return getProcessedBlock({
|
|
11
|
+
block: props.block,
|
|
12
|
+
state: props.context.state,
|
|
13
|
+
context: props.context.context,
|
|
14
|
+
evaluateBindings: true,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export const css = function css(props, state) {
|
|
18
|
+
const styles = useBlock(props, state).responsiveStyles;
|
|
19
|
+
const largeStyles = styles?.large;
|
|
20
|
+
const mediumStyles = styles?.medium;
|
|
21
|
+
const smallStyles = styles?.small;
|
|
22
|
+
return `
|
|
23
|
+
${
|
|
24
|
+
largeStyles
|
|
25
|
+
? `.${useBlock(props, state).id} {${convertStyleMaptoCSS(
|
|
26
|
+
largeStyles
|
|
27
|
+
)}}`
|
|
28
|
+
: ""
|
|
29
|
+
}
|
|
30
|
+
${
|
|
31
|
+
mediumStyles
|
|
32
|
+
? `${getMaxWidthQueryForSize("medium")} {
|
|
33
|
+
.${useBlock(props, state).id} {${convertStyleMaptoCSS(
|
|
34
|
+
mediumStyles
|
|
35
|
+
)}}
|
|
36
|
+
}`
|
|
37
|
+
: ""
|
|
38
|
+
}
|
|
39
|
+
${
|
|
40
|
+
smallStyles
|
|
41
|
+
? `${getMaxWidthQueryForSize("small")} {
|
|
42
|
+
.${useBlock(props, state).id} {${convertStyleMaptoCSS(
|
|
43
|
+
smallStyles
|
|
44
|
+
)}}
|
|
45
|
+
}`
|
|
46
|
+
: ""
|
|
47
|
+
}
|
|
48
|
+
}`;
|
|
49
|
+
};
|
|
50
|
+
export const BlockStyles = (props) => {
|
|
51
|
+
const state = {};
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
{TARGET === "vue2" || TARGET === "vue3" || TARGET === "svelte" ? (
|
|
55
|
+
<RenderInlinedStyles styles={css(props, state)}></RenderInlinedStyles>
|
|
56
|
+
) : null}
|
|
57
|
+
</>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
export default BlockStyles;
|
|
61
|
+
export const COMPONENT = {
|
|
62
|
+
"@type": "@builder.io/mitosis/component",
|
|
63
|
+
imports: [
|
|
64
|
+
{
|
|
65
|
+
imports: {
|
|
66
|
+
getMaxWidthQueryForSize: "getMaxWidthQueryForSize",
|
|
67
|
+
},
|
|
68
|
+
path: "../../constants/device-sizes.js",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
imports: {
|
|
72
|
+
TARGET: "TARGET",
|
|
73
|
+
},
|
|
74
|
+
path: "../../constants/target.js",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
imports: {
|
|
78
|
+
getProcessedBlock: "getProcessedBlock",
|
|
79
|
+
},
|
|
80
|
+
path: "../../functions/get-processed-block.js",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
imports: {
|
|
84
|
+
convertStyleMaptoCSS: "convertStyleMaptoCSS",
|
|
85
|
+
},
|
|
86
|
+
path: "../../helpers/css.js",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
imports: {
|
|
90
|
+
RenderInlinedStyles: "default",
|
|
91
|
+
},
|
|
92
|
+
path: "../render-inlined-styles.lite",
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
exports: {},
|
|
96
|
+
inputs: [],
|
|
97
|
+
meta: {
|
|
98
|
+
useMetadata: {
|
|
99
|
+
qwik: {
|
|
100
|
+
component: {
|
|
101
|
+
isLight: true,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
refs: {},
|
|
107
|
+
state: {
|
|
108
|
+
useBlock:
|
|
109
|
+
"@builder.io/mitosis/method:get useBlock() {\n return getProcessedBlock({\n block: props.block,\n state: props.context.state,\n context: props.context.context,\n evaluateBindings: true\n });\n}",
|
|
110
|
+
css: "@builder.io/mitosis/method:get css() {\n const styles = useBlock(props,state).responsiveStyles;\n const largeStyles = styles?.large;\n const mediumStyles = styles?.medium;\n const smallStyles = styles?.small;\n return `\n ${largeStyles ? `.${useBlock(props,state).id} {${convertStyleMaptoCSS(largeStyles)}}` : ''}\n ${mediumStyles ? `${getMaxWidthQueryForSize('medium')} {\n .${useBlock(props,state).id} {${convertStyleMaptoCSS(mediumStyles)}}\n }` : ''}\n ${smallStyles ? `${getMaxWidthQueryForSize('small')} {\n .${useBlock(props,state).id} {${convertStyleMaptoCSS(smallStyles)}}\n }` : ''}\n }`;\n}",
|
|
111
|
+
},
|
|
112
|
+
children: [
|
|
113
|
+
{
|
|
114
|
+
"@type": "@builder.io/mitosis/node",
|
|
115
|
+
name: "Show",
|
|
116
|
+
meta: {},
|
|
117
|
+
scope: {},
|
|
118
|
+
properties: {},
|
|
119
|
+
bindings: {
|
|
120
|
+
when: {
|
|
121
|
+
code: "TARGET === 'vue2' || TARGET === 'vue3' || TARGET === 'svelte'",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
children: [
|
|
125
|
+
{
|
|
126
|
+
"@type": "@builder.io/mitosis/node",
|
|
127
|
+
name: "div",
|
|
128
|
+
meta: {},
|
|
129
|
+
scope: {},
|
|
130
|
+
properties: {
|
|
131
|
+
_text: "\n ",
|
|
132
|
+
},
|
|
133
|
+
bindings: {},
|
|
134
|
+
children: [],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"@type": "@builder.io/mitosis/node",
|
|
138
|
+
name: "RenderInlinedStyles",
|
|
139
|
+
meta: {},
|
|
140
|
+
scope: {},
|
|
141
|
+
properties: {},
|
|
142
|
+
bindings: {
|
|
143
|
+
styles: {
|
|
144
|
+
code: "css(props,state)",
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
children: [],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"@type": "@builder.io/mitosis/node",
|
|
151
|
+
name: "div",
|
|
152
|
+
meta: {},
|
|
153
|
+
scope: {},
|
|
154
|
+
properties: {
|
|
155
|
+
_text: "\n ",
|
|
156
|
+
},
|
|
157
|
+
bindings: {},
|
|
158
|
+
children: [],
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
hooks: {},
|
|
164
|
+
context: {
|
|
165
|
+
get: {},
|
|
166
|
+
set: {},
|
|
167
|
+
},
|
|
168
|
+
name: "BlockStyles",
|
|
169
|
+
subComponents: [],
|
|
170
|
+
types: [
|
|
171
|
+
"export type BlockStylesProps = {\n block: BuilderBlock;\n context: BuilderContextInterface;\n};",
|
|
172
|
+
],
|
|
173
|
+
propsTypeRef: "BlockStylesProps",
|
|
174
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const EMPTY_HTML_ELEMENTS = [
|
|
2
|
+
"area",
|
|
3
|
+
"base",
|
|
4
|
+
"br",
|
|
5
|
+
"col",
|
|
6
|
+
"embed",
|
|
7
|
+
"hr",
|
|
8
|
+
"img",
|
|
9
|
+
"input",
|
|
10
|
+
"keygen",
|
|
11
|
+
"link",
|
|
12
|
+
"meta",
|
|
13
|
+
"param",
|
|
14
|
+
"source",
|
|
15
|
+
"track",
|
|
16
|
+
"wbr"
|
|
17
|
+
];
|
|
18
|
+
const isEmptyHtmlElement = (tagName) => {
|
|
19
|
+
return typeof tagName === "string" && EMPTY_HTML_ELEMENTS.includes(tagName.toLowerCase());
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
isEmptyHtmlElement
|
|
23
|
+
};
|