@builder.io/sdk-solid 0.5.9 → 0.6.1
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 +0 -4
- package/dist/index.d.ts +51 -0
- package/lib/browser/dev.js +4790 -0
- package/lib/browser/dev.jsx +4392 -0
- package/lib/browser/index.js +4767 -0
- package/lib/browser/index.jsx +4374 -0
- package/lib/edge/dev.js +7921 -0
- package/lib/edge/dev.jsx +7525 -0
- package/lib/edge/index.js +7898 -0
- package/lib/edge/index.jsx +7507 -0
- package/lib/node/dev.js +4790 -0
- package/lib/node/dev.jsx +4392 -0
- package/lib/node/index.js +4767 -0
- package/lib/node/index.jsx +4374 -0
- package/package.json +86 -14
- package/CHANGELOG.md +0 -102
- package/solid-index.jsx +0 -5
- package/src/blocks/BaseText.jsx +0 -11
- package/src/blocks/button/button.jsx +0 -41
- package/src/blocks/button/component-info.js +0 -34
- package/src/blocks/columns/columns.jsx +0 -174
- package/src/blocks/columns/component-info.js +0 -218
- package/src/blocks/custom-code/component-info.js +0 -24
- package/src/blocks/custom-code/custom-code.jsx +0 -62
- package/src/blocks/embed/component-info.js +0 -37
- package/src/blocks/embed/embed.jsx +0 -50
- package/src/blocks/embed/helpers.js +0 -3
- package/src/blocks/form/component-info.js +0 -223
- package/src/blocks/form/form.jsx +0 -5
- package/src/blocks/fragment/component-info.js +0 -8
- package/src/blocks/fragment/fragment.jsx +0 -5
- package/src/blocks/helpers.js +0 -27
- package/src/blocks/image/component-info.js +0 -122
- package/src/blocks/image/image.helpers.js +0 -46
- package/src/blocks/image/image.jsx +0 -122
- package/src/blocks/img/component-info.js +0 -15
- package/src/blocks/img/img.jsx +0 -20
- package/src/blocks/input/component-info.js +0 -45
- package/src/blocks/input/input.jsx +0 -22
- package/src/blocks/raw-text/component-info.js +0 -11
- package/src/blocks/raw-text/raw-text.jsx +0 -10
- package/src/blocks/section/component-info.js +0 -41
- package/src/blocks/section/section.jsx +0 -26
- package/src/blocks/select/component-info.js +0 -44
- package/src/blocks/select/select.jsx +0 -30
- package/src/blocks/submit-button/component-info.js +0 -23
- package/src/blocks/submit-button/submit-button.jsx +0 -11
- package/src/blocks/symbol/component-info.js +0 -35
- package/src/blocks/symbol/symbol.helpers.js +0 -60
- package/src/blocks/symbol/symbol.jsx +0 -64
- package/src/blocks/text/component-info.js +0 -20
- package/src/blocks/text/text.jsx +0 -14
- package/src/blocks/textarea/component-info.js +0 -38
- package/src/blocks/textarea/textarea.jsx +0 -16
- package/src/blocks/video/component-info.js +0 -83
- package/src/blocks/video/video.jsx +0 -61
- package/src/components/block/block.helpers.js +0 -99
- package/src/components/block/block.jsx +0 -167
- package/src/components/block/components/block-styles.jsx +0 -85
- package/src/components/block/components/block-wrapper.jsx +0 -50
- package/src/components/block/components/component-ref/component-ref.helpers.js +0 -41
- package/src/components/block/components/component-ref/component-ref.jsx +0 -59
- package/src/components/block/components/interactive-element.jsx +0 -30
- package/src/components/block/components/repeated-block.jsx +0 -20
- package/src/components/block/types.js +0 -0
- package/src/components/blocks/blocks-wrapper.jsx +0 -66
- package/src/components/blocks/blocks.jsx +0 -57
- package/src/components/content/components/enable-editor.jsx +0 -347
- package/src/components/content/components/styles.helpers.js +0 -56
- package/src/components/content/components/styles.jsx +0 -36
- package/src/components/content/content.helpers.js +0 -48
- package/src/components/content/content.jsx +0 -136
- package/src/components/content/content.types.js +0 -0
- package/src/components/content/index.js +0 -2
- package/src/components/content/wrap-component-ref.js +0 -2
- package/src/components/content-variants/content-variants.jsx +0 -115
- package/src/components/content-variants/content-variants.types.js +0 -0
- package/src/components/content-variants/helpers.js +0 -158
- package/src/components/inlined-script.jsx +0 -5
- package/src/components/inlined-styles.jsx +0 -5
- package/src/constants/builder-registered-components.js +0 -63
- package/src/constants/device-sizes.js +0 -48
- package/src/constants/sdk-version.js +0 -1
- package/src/constants/target.js +0 -4
- package/src/context/builder.context.js +0 -16
- package/src/context/components.context.js +0 -5
- package/src/context/types.js +0 -0
- package/src/functions/apply-patch-with-mutation.js +0 -66
- package/src/functions/camel-to-kebab-case.js +0 -2
- package/src/functions/evaluate/browser-runtime/browser.js +0 -40
- package/src/functions/evaluate/browser-runtime/index.js +0 -2
- package/src/functions/evaluate/evaluate.js +0 -49
- package/src/functions/evaluate/helpers.js +0 -15
- package/src/functions/evaluate/index.js +0 -2
- package/src/functions/evaluate/node-runtime/index.js +0 -2
- package/src/functions/evaluate/non-node-runtime/acorn-interpreter.js +0 -2876
- package/src/functions/evaluate/non-node-runtime/index.js +0 -18
- package/src/functions/evaluate/non-node-runtime/non-node-runtime.js +0 -91
- package/src/functions/event-handler-name.js +0 -5
- package/src/functions/extract-text-styles.js +0 -14
- package/src/functions/fast-clone.js +0 -2
- package/src/functions/fetch-builder-props.js +0 -60
- package/src/functions/get-block-actions-handler.js +0 -11
- package/src/functions/get-block-actions.js +0 -29
- package/src/functions/get-block-component-options.js +0 -27
- package/src/functions/get-block-properties.js +0 -63
- package/src/functions/get-builder-search-params/index.js +0 -33
- package/src/functions/get-content/generate-content-url.js +0 -59
- package/src/functions/get-content/index.js +0 -116
- package/src/functions/get-content/types.js +0 -0
- package/src/functions/get-fetch.js +0 -12
- package/src/functions/get-global-this.js +0 -16
- package/src/functions/get-processed-block.js +0 -74
- package/src/functions/get-react-native-block-styles.js +0 -32
- package/src/functions/is-browser.js +0 -4
- package/src/functions/is-editing.js +0 -6
- package/src/functions/is-iframe.js +0 -5
- package/src/functions/is-non-node-server.js +0 -9
- package/src/functions/is-previewing.js +0 -12
- package/src/functions/on-change.js +0 -24
- package/src/functions/register-component.js +0 -60
- package/src/functions/register.js +0 -27
- package/src/functions/sanitize-react-native-block-styles.js +0 -71
- package/src/functions/set-editor-settings.js +0 -13
- package/src/functions/set.js +0 -9
- package/src/functions/track/helpers.js +0 -48
- package/src/functions/track/index.js +0 -131
- package/src/functions/track/interaction.js +0 -57
- package/src/functions/transform-block-properties.js +0 -4
- package/src/functions/transform-block.js +0 -4
- package/src/helpers/ab-tests.js +0 -158
- package/src/helpers/canTrack.js +0 -3
- package/src/helpers/cookie.js +0 -77
- package/src/helpers/css.js +0 -30
- package/src/helpers/flatten.js +0 -31
- package/src/helpers/localStorage.js +0 -32
- package/src/helpers/logger.js +0 -8
- package/src/helpers/nullable.js +0 -2
- package/src/helpers/preview-lru-cache/get.js +0 -4
- package/src/helpers/preview-lru-cache/helpers.js +0 -0
- package/src/helpers/preview-lru-cache/init.js +0 -2
- package/src/helpers/preview-lru-cache/set.js +0 -31
- package/src/helpers/preview-lru-cache/types.js +0 -0
- package/src/helpers/sessionId.js +0 -55
- package/src/helpers/time.js +0 -3
- package/src/helpers/url.js +0 -11
- package/src/helpers/uuid.js +0 -11
- package/src/helpers/visitorId.js +0 -35
- package/src/index-helpers/blocks-exports.js +0 -13
- package/src/index-helpers/top-of-file.js +0 -2
- package/src/index.js +0 -3
- package/src/scripts/init-editing.js +0 -109
- package/src/server-index.js +0 -11
- package/src/types/api-version.js +0 -2
- package/src/types/builder-block.js +0 -0
- package/src/types/builder-content.js +0 -0
- package/src/types/builder-props.js +0 -0
- package/src/types/can-track.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/enforced-partials.js +0 -0
- package/src/types/input.js +0 -0
- package/src/types/targets.js +0 -0
- package/src/types/typescript.js +0 -0
- package/vite.config.ts +0 -18
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Image",
|
|
3
|
-
static: true,
|
|
4
|
-
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
5
|
-
defaultStyles: {
|
|
6
|
-
position: "relative",
|
|
7
|
-
minHeight: "20px",
|
|
8
|
-
minWidth: "20px",
|
|
9
|
-
overflow: "hidden"
|
|
10
|
-
},
|
|
11
|
-
canHaveChildren: true,
|
|
12
|
-
inputs: [{
|
|
13
|
-
name: "image",
|
|
14
|
-
type: "file",
|
|
15
|
-
bubble: true,
|
|
16
|
-
allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
|
|
17
|
-
required: true,
|
|
18
|
-
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
19
|
-
onChange: options => {
|
|
20
|
-
const DEFAULT_ASPECT_RATIO = 0.7041;
|
|
21
|
-
options.delete("srcset");
|
|
22
|
-
options.delete("noWebp");
|
|
23
|
-
function loadImage(url, timeout = 6e4) {
|
|
24
|
-
return new Promise((resolve, reject) => {
|
|
25
|
-
const img = document.createElement("img");
|
|
26
|
-
let loaded = false;
|
|
27
|
-
img.onload = () => {
|
|
28
|
-
loaded = true;
|
|
29
|
-
resolve(img);
|
|
30
|
-
};
|
|
31
|
-
img.addEventListener("error", event => {
|
|
32
|
-
console.warn("Image load failed", event.error);
|
|
33
|
-
reject(event.error);
|
|
34
|
-
});
|
|
35
|
-
img.src = url;
|
|
36
|
-
setTimeout(() => {
|
|
37
|
-
if (!loaded) {
|
|
38
|
-
reject(new Error("Image load timed out"));
|
|
39
|
-
}
|
|
40
|
-
}, timeout);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
function round(num) {
|
|
44
|
-
return Math.round(num * 1e3) / 1e3;
|
|
45
|
-
}
|
|
46
|
-
const value = options.get("image");
|
|
47
|
-
const aspectRatio = options.get("aspectRatio");
|
|
48
|
-
fetch(value).then(res => res.blob()).then(blob => {
|
|
49
|
-
if (blob.type.includes("svg")) {
|
|
50
|
-
options.set("noWebp", true);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
if (value && (!aspectRatio || aspectRatio === DEFAULT_ASPECT_RATIO)) {
|
|
54
|
-
return loadImage(value).then(img => {
|
|
55
|
-
const possiblyUpdatedAspectRatio = options.get("aspectRatio");
|
|
56
|
-
if (options.get("image") === value && (!possiblyUpdatedAspectRatio || possiblyUpdatedAspectRatio === DEFAULT_ASPECT_RATIO)) {
|
|
57
|
-
if (img.width && img.height) {
|
|
58
|
-
options.set("aspectRatio", round(img.height / img.width));
|
|
59
|
-
options.set("height", img.height);
|
|
60
|
-
options.set("width", img.width);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}, {
|
|
67
|
-
name: "backgroundSize",
|
|
68
|
-
type: "text",
|
|
69
|
-
defaultValue: "cover",
|
|
70
|
-
enum: [{
|
|
71
|
-
label: "contain",
|
|
72
|
-
value: "contain",
|
|
73
|
-
helperText: "The image should never get cropped"
|
|
74
|
-
}, {
|
|
75
|
-
label: "cover",
|
|
76
|
-
value: "cover",
|
|
77
|
-
helperText: "The image should fill it's box, cropping when needed"
|
|
78
|
-
}]
|
|
79
|
-
}, {
|
|
80
|
-
name: "backgroundPosition",
|
|
81
|
-
type: "text",
|
|
82
|
-
defaultValue: "center",
|
|
83
|
-
enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
|
|
84
|
-
}, {
|
|
85
|
-
name: "altText",
|
|
86
|
-
type: "string",
|
|
87
|
-
helperText: "Text to display when the user has images off"
|
|
88
|
-
}, {
|
|
89
|
-
name: "height",
|
|
90
|
-
type: "number",
|
|
91
|
-
hideFromUI: true
|
|
92
|
-
}, {
|
|
93
|
-
name: "width",
|
|
94
|
-
type: "number",
|
|
95
|
-
hideFromUI: true
|
|
96
|
-
}, {
|
|
97
|
-
name: "sizes",
|
|
98
|
-
type: "string",
|
|
99
|
-
hideFromUI: true
|
|
100
|
-
}, {
|
|
101
|
-
name: "srcset",
|
|
102
|
-
type: "string",
|
|
103
|
-
hideFromUI: true
|
|
104
|
-
}, {
|
|
105
|
-
name: "lazy",
|
|
106
|
-
type: "boolean",
|
|
107
|
-
defaultValue: true,
|
|
108
|
-
hideFromUI: true
|
|
109
|
-
}, {
|
|
110
|
-
name: "fitContent",
|
|
111
|
-
type: "boolean",
|
|
112
|
-
helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
|
|
113
|
-
defaultValue: true
|
|
114
|
-
}, {
|
|
115
|
-
name: "aspectRatio",
|
|
116
|
-
type: "number",
|
|
117
|
-
helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
|
|
118
|
-
advanced: true,
|
|
119
|
-
defaultValue: 0.7041
|
|
120
|
-
}]
|
|
121
|
-
};
|
|
122
|
-
export { componentInfo }
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
function removeProtocol(path) {
|
|
2
|
-
return path.replace(/http(s)?:/, "");
|
|
3
|
-
}
|
|
4
|
-
function updateQueryParam(uri = "", key, value) {
|
|
5
|
-
const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
|
|
6
|
-
const separator = uri.indexOf("?") !== -1 ? "&" : "?";
|
|
7
|
-
if (uri.match(re)) {
|
|
8
|
-
return uri.replace(re, "$1" + key + "=" + encodeURIComponent(value) + "$2");
|
|
9
|
-
}
|
|
10
|
-
return uri + separator + key + "=" + encodeURIComponent(value);
|
|
11
|
-
}
|
|
12
|
-
function getShopifyImageUrl(src, size) {
|
|
13
|
-
if (!src || !(src == null ? void 0 : src.match(/cdn\.shopify\.com/)) || !size) {
|
|
14
|
-
return src;
|
|
15
|
-
}
|
|
16
|
-
if (size === "master") {
|
|
17
|
-
return removeProtocol(src);
|
|
18
|
-
}
|
|
19
|
-
const match = src.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
20
|
-
if (match) {
|
|
21
|
-
const prefix = src.split(match[0]);
|
|
22
|
-
const suffix = match[3];
|
|
23
|
-
const useSize = size.match("x") ? size : `${size}x`;
|
|
24
|
-
return removeProtocol(`${prefix[0]}_${useSize}${suffix}`);
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
function getSrcSet(url) {
|
|
29
|
-
if (!url) {
|
|
30
|
-
return url;
|
|
31
|
-
}
|
|
32
|
-
const sizes = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
33
|
-
if (url.match(/builder\.io/)) {
|
|
34
|
-
let srcUrl = url;
|
|
35
|
-
const widthInSrc = Number(url.split("?width=")[1]);
|
|
36
|
-
if (!isNaN(widthInSrc)) {
|
|
37
|
-
srcUrl = `${srcUrl} ${widthInSrc}w`;
|
|
38
|
-
}
|
|
39
|
-
return sizes.filter(size => size !== widthInSrc).map(size => `${updateQueryParam(url, "width", size)} ${size}w`).concat([srcUrl]).join(", ");
|
|
40
|
-
}
|
|
41
|
-
if (url.match(/cdn\.shopify\.com/)) {
|
|
42
|
-
return sizes.map(size => [getShopifyImageUrl(url, `${size}x${size}`), size]).filter(([sizeUrl]) => !!sizeUrl).map(([sizeUrl, size]) => `${sizeUrl} ${size}w`).concat([url]).join(", ");
|
|
43
|
-
}
|
|
44
|
-
return url;
|
|
45
|
-
}
|
|
46
|
-
export { getSrcSet }
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { Show, createSignal } from "solid-js";
|
|
2
|
-
|
|
3
|
-
import { css } from "solid-styled-components";
|
|
4
|
-
|
|
5
|
-
import { getSrcSet } from "./image.helpers.js";
|
|
6
|
-
|
|
7
|
-
function Image(props) {
|
|
8
|
-
function srcSetToUse() {
|
|
9
|
-
const imageToUse = props.image || props.src;
|
|
10
|
-
const url = imageToUse;
|
|
11
|
-
if (
|
|
12
|
-
!url ||
|
|
13
|
-
// We can auto add srcset for cdn.builder.io and shopify
|
|
14
|
-
// images, otherwise you can supply this prop manually
|
|
15
|
-
!(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/))
|
|
16
|
-
) {
|
|
17
|
-
return props.srcset;
|
|
18
|
-
}
|
|
19
|
-
if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
|
|
20
|
-
if (!props.srcset.includes(props.image.split("?")[0])) {
|
|
21
|
-
console.debug("Removed given srcset");
|
|
22
|
-
return getSrcSet(url);
|
|
23
|
-
}
|
|
24
|
-
} else if (props.image && !props.srcset) {
|
|
25
|
-
return getSrcSet(url);
|
|
26
|
-
}
|
|
27
|
-
return getSrcSet(url);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function webpSrcSet() {
|
|
31
|
-
if (srcSetToUse()?.match(/builder\.io/) && !props.noWebp) {
|
|
32
|
-
return srcSetToUse().replace(/\?/g, "?format=webp&");
|
|
33
|
-
} else {
|
|
34
|
-
return "";
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function aspectRatioCss() {
|
|
39
|
-
const aspectRatioStyles = {
|
|
40
|
-
position: "absolute",
|
|
41
|
-
height: "100%",
|
|
42
|
-
width: "100%",
|
|
43
|
-
left: "0px",
|
|
44
|
-
top: "0px",
|
|
45
|
-
};
|
|
46
|
-
const out = props.aspectRatio ? aspectRatioStyles : undefined;
|
|
47
|
-
return out;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<>
|
|
52
|
-
<picture>
|
|
53
|
-
<Show when={webpSrcSet()}>
|
|
54
|
-
<source type="image/webp" srcset={webpSrcSet()} />
|
|
55
|
-
</Show>
|
|
56
|
-
<img
|
|
57
|
-
class={
|
|
58
|
-
"builder-image" +
|
|
59
|
-
(props.className ? " " + props.className : "") +
|
|
60
|
-
" " +
|
|
61
|
-
css({
|
|
62
|
-
opacity: "1",
|
|
63
|
-
transition: "opacity 0.2s ease-in-out",
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
loading="lazy"
|
|
67
|
-
alt={props.altText}
|
|
68
|
-
role={props.altText ? "presentation" : undefined}
|
|
69
|
-
style={{
|
|
70
|
-
"object-position": props.backgroundPosition || "center",
|
|
71
|
-
"object-fit": props.backgroundSize || "cover",
|
|
72
|
-
...aspectRatioCss(),
|
|
73
|
-
}}
|
|
74
|
-
src={props.image}
|
|
75
|
-
srcset={srcSetToUse()}
|
|
76
|
-
sizes={props.sizes}
|
|
77
|
-
/>
|
|
78
|
-
</picture>
|
|
79
|
-
<Show
|
|
80
|
-
when={
|
|
81
|
-
props.aspectRatio &&
|
|
82
|
-
!(props.builderBlock?.children?.length && props.fitContent)
|
|
83
|
-
}
|
|
84
|
-
>
|
|
85
|
-
<div
|
|
86
|
-
class={
|
|
87
|
-
"builder-image-sizer " +
|
|
88
|
-
css({
|
|
89
|
-
width: "100%",
|
|
90
|
-
pointerEvents: "none",
|
|
91
|
-
fontSize: "0",
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
style={{
|
|
95
|
-
"padding-top": props.aspectRatio * 100 + "%",
|
|
96
|
-
}}
|
|
97
|
-
></div>
|
|
98
|
-
</Show>
|
|
99
|
-
<Show when={props.builderBlock?.children?.length && props.fitContent}>
|
|
100
|
-
{props.children}
|
|
101
|
-
</Show>
|
|
102
|
-
<Show when={!props.fitContent && props.children}>
|
|
103
|
-
<div
|
|
104
|
-
class={css({
|
|
105
|
-
display: "flex",
|
|
106
|
-
flexDirection: "column",
|
|
107
|
-
alignItems: "stretch",
|
|
108
|
-
position: "absolute",
|
|
109
|
-
top: "0",
|
|
110
|
-
left: "0",
|
|
111
|
-
width: "100%",
|
|
112
|
-
height: "100%",
|
|
113
|
-
})}
|
|
114
|
-
>
|
|
115
|
-
{props.children}
|
|
116
|
-
</div>
|
|
117
|
-
</Show>
|
|
118
|
-
</>
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export default Image;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Raw:Img",
|
|
3
|
-
hideFromInsertMenu: true,
|
|
4
|
-
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
5
|
-
inputs: [{
|
|
6
|
-
name: "image",
|
|
7
|
-
bubble: true,
|
|
8
|
-
type: "file",
|
|
9
|
-
allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
|
|
10
|
-
required: true
|
|
11
|
-
}],
|
|
12
|
-
noWrap: true,
|
|
13
|
-
static: true
|
|
14
|
-
};
|
|
15
|
-
export { componentInfo }
|
package/src/blocks/img/img.jsx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
2
|
-
import { filterAttrs } from "../helpers.js";
|
|
3
|
-
|
|
4
|
-
function ImgComponent(props) {
|
|
5
|
-
return (
|
|
6
|
-
<img
|
|
7
|
-
style={{
|
|
8
|
-
"object-fit": props.backgroundSize || "cover",
|
|
9
|
-
"object-position": props.backgroundPosition || "center",
|
|
10
|
-
}}
|
|
11
|
-
key={(isEditing() && props.imgSrc) || "default-key"}
|
|
12
|
-
alt={props.altText}
|
|
13
|
-
src={props.imgSrc || props.image}
|
|
14
|
-
{...{}}
|
|
15
|
-
{...props.attributes}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default ImgComponent;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Form:Input",
|
|
3
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
4
|
-
inputs: [{
|
|
5
|
-
name: "type",
|
|
6
|
-
type: "text",
|
|
7
|
-
enum: ["text", "number", "email", "url", "checkbox", "radio", "range", "date", "datetime-local", "search", "tel", "time", "file", "month", "week", "password", "color", "hidden"],
|
|
8
|
-
defaultValue: "text"
|
|
9
|
-
}, {
|
|
10
|
-
name: "name",
|
|
11
|
-
type: "string",
|
|
12
|
-
required: true,
|
|
13
|
-
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
14
|
-
}, {
|
|
15
|
-
name: "placeholder",
|
|
16
|
-
type: "string",
|
|
17
|
-
defaultValue: "Hello there",
|
|
18
|
-
helperText: "Text to display when there is no value"
|
|
19
|
-
}, {
|
|
20
|
-
name: "defaultValue",
|
|
21
|
-
type: "string"
|
|
22
|
-
}, {
|
|
23
|
-
name: "value",
|
|
24
|
-
type: "string",
|
|
25
|
-
advanced: true
|
|
26
|
-
}, {
|
|
27
|
-
name: "required",
|
|
28
|
-
type: "boolean",
|
|
29
|
-
helperText: "Is this input required to be filled out to submit a form",
|
|
30
|
-
defaultValue: false
|
|
31
|
-
}],
|
|
32
|
-
noWrap: true,
|
|
33
|
-
static: true,
|
|
34
|
-
defaultStyles: {
|
|
35
|
-
paddingTop: "10px",
|
|
36
|
-
paddingBottom: "10px",
|
|
37
|
-
paddingLeft: "10px",
|
|
38
|
-
paddingRight: "10px",
|
|
39
|
-
borderRadius: "3px",
|
|
40
|
-
borderWidth: "1px",
|
|
41
|
-
borderStyle: "solid",
|
|
42
|
-
borderColor: "#ccc"
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
export { componentInfo }
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
2
|
-
import { filterAttrs } from "../helpers.js";
|
|
3
|
-
|
|
4
|
-
function FormInputComponent(props) {
|
|
5
|
-
return (
|
|
6
|
-
<input
|
|
7
|
-
{...{}}
|
|
8
|
-
{...props.attributes}
|
|
9
|
-
key={
|
|
10
|
-
isEditing() && props.defaultValue ? props.defaultValue : "default-key"
|
|
11
|
-
}
|
|
12
|
-
placeholder={props.placeholder}
|
|
13
|
-
type={props.type}
|
|
14
|
-
name={props.name}
|
|
15
|
-
value={props.value}
|
|
16
|
-
defaultValue={props.defaultValue}
|
|
17
|
-
required={props.required}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default FormInputComponent;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Core:Section",
|
|
3
|
-
static: true,
|
|
4
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
5
|
-
inputs: [{
|
|
6
|
-
name: "maxWidth",
|
|
7
|
-
type: "number",
|
|
8
|
-
defaultValue: 1200
|
|
9
|
-
}, {
|
|
10
|
-
name: "lazyLoad",
|
|
11
|
-
type: "boolean",
|
|
12
|
-
defaultValue: false,
|
|
13
|
-
advanced: true,
|
|
14
|
-
description: "Only render this section when in view"
|
|
15
|
-
}],
|
|
16
|
-
defaultStyles: {
|
|
17
|
-
paddingLeft: "20px",
|
|
18
|
-
paddingRight: "20px",
|
|
19
|
-
paddingTop: "50px",
|
|
20
|
-
paddingBottom: "50px",
|
|
21
|
-
marginTop: "0px",
|
|
22
|
-
width: "100vw",
|
|
23
|
-
marginLeft: "calc(50% - 50vw)"
|
|
24
|
-
},
|
|
25
|
-
canHaveChildren: true,
|
|
26
|
-
defaultChildren: [{
|
|
27
|
-
"@type": "@builder.io/sdk:Element",
|
|
28
|
-
responsiveStyles: {
|
|
29
|
-
large: {
|
|
30
|
-
textAlign: "center"
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
component: {
|
|
34
|
-
name: "Text",
|
|
35
|
-
options: {
|
|
36
|
-
text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}]
|
|
40
|
-
};
|
|
41
|
-
export { componentInfo }
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { filterAttrs } from "../helpers.js";
|
|
2
|
-
|
|
3
|
-
function SectionComponent(props) {
|
|
4
|
-
return (
|
|
5
|
-
<section
|
|
6
|
-
{...{}}
|
|
7
|
-
{...props.attributes}
|
|
8
|
-
style={{
|
|
9
|
-
width: "100%",
|
|
10
|
-
"align-self": "stretch",
|
|
11
|
-
"flex-grow": 1,
|
|
12
|
-
"box-sizing": "border-box",
|
|
13
|
-
"max-width": props.maxWidth || 1200,
|
|
14
|
-
display: "flex",
|
|
15
|
-
"flex-direction": "column",
|
|
16
|
-
"align-items": "stretch",
|
|
17
|
-
"margin-left": "auto",
|
|
18
|
-
"margin-right": "auto",
|
|
19
|
-
}}
|
|
20
|
-
>
|
|
21
|
-
{props.children}
|
|
22
|
-
</section>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default SectionComponent;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Form:Select",
|
|
3
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
4
|
-
defaultStyles: {
|
|
5
|
-
alignSelf: "flex-start"
|
|
6
|
-
},
|
|
7
|
-
inputs: [{
|
|
8
|
-
name: "options",
|
|
9
|
-
type: "list",
|
|
10
|
-
required: true,
|
|
11
|
-
subFields: [{
|
|
12
|
-
name: "value",
|
|
13
|
-
type: "text",
|
|
14
|
-
required: true
|
|
15
|
-
}, {
|
|
16
|
-
name: "name",
|
|
17
|
-
type: "text"
|
|
18
|
-
}],
|
|
19
|
-
defaultValue: [{
|
|
20
|
-
value: "option 1"
|
|
21
|
-
}, {
|
|
22
|
-
value: "option 2"
|
|
23
|
-
}]
|
|
24
|
-
}, {
|
|
25
|
-
name: "name",
|
|
26
|
-
type: "string",
|
|
27
|
-
required: true,
|
|
28
|
-
helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
|
|
29
|
-
}, {
|
|
30
|
-
name: "defaultValue",
|
|
31
|
-
type: "string"
|
|
32
|
-
}, {
|
|
33
|
-
name: "value",
|
|
34
|
-
type: "string",
|
|
35
|
-
advanced: true
|
|
36
|
-
}, {
|
|
37
|
-
name: "required",
|
|
38
|
-
type: "boolean",
|
|
39
|
-
defaultValue: false
|
|
40
|
-
}],
|
|
41
|
-
static: true,
|
|
42
|
-
noWrap: true
|
|
43
|
-
};
|
|
44
|
-
export { componentInfo }
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { For } from "solid-js";
|
|
2
|
-
|
|
3
|
-
import { isEditing } from "../../functions/is-editing.js";
|
|
4
|
-
import { filterAttrs } from "../helpers.js";
|
|
5
|
-
|
|
6
|
-
function SelectComponent(props) {
|
|
7
|
-
return (
|
|
8
|
-
<select
|
|
9
|
-
{...{}}
|
|
10
|
-
{...props.attributes}
|
|
11
|
-
value={props.value}
|
|
12
|
-
key={
|
|
13
|
-
isEditing() && props.defaultValue ? props.defaultValue : "default-key"
|
|
14
|
-
}
|
|
15
|
-
defaultValue={props.defaultValue}
|
|
16
|
-
name={props.name}
|
|
17
|
-
>
|
|
18
|
-
<For each={props.options}>
|
|
19
|
-
{(option, _index) => {
|
|
20
|
-
const index = _index();
|
|
21
|
-
return (
|
|
22
|
-
<option value={option.value}>{option.name || option.value}</option>
|
|
23
|
-
);
|
|
24
|
-
}}
|
|
25
|
-
</For>
|
|
26
|
-
</select>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default SelectComponent;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Form:SubmitButton",
|
|
3
|
-
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
4
|
-
defaultStyles: {
|
|
5
|
-
appearance: "none",
|
|
6
|
-
paddingTop: "15px",
|
|
7
|
-
paddingBottom: "15px",
|
|
8
|
-
paddingLeft: "25px",
|
|
9
|
-
paddingRight: "25px",
|
|
10
|
-
backgroundColor: "#3898EC",
|
|
11
|
-
color: "white",
|
|
12
|
-
borderRadius: "4px",
|
|
13
|
-
cursor: "pointer"
|
|
14
|
-
},
|
|
15
|
-
inputs: [{
|
|
16
|
-
name: "text",
|
|
17
|
-
type: "text",
|
|
18
|
-
defaultValue: "Click me"
|
|
19
|
-
}],
|
|
20
|
-
static: true,
|
|
21
|
-
noWrap: true
|
|
22
|
-
};
|
|
23
|
-
export { componentInfo }
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const componentInfo = {
|
|
2
|
-
name: "Symbol",
|
|
3
|
-
noWrap: true,
|
|
4
|
-
static: true,
|
|
5
|
-
isRSC: true,
|
|
6
|
-
inputs: [{
|
|
7
|
-
name: "symbol",
|
|
8
|
-
type: "uiSymbol"
|
|
9
|
-
}, {
|
|
10
|
-
name: "dataOnly",
|
|
11
|
-
helperText: "Make this a data symbol that doesn't display any UI",
|
|
12
|
-
type: "boolean",
|
|
13
|
-
defaultValue: false,
|
|
14
|
-
advanced: true,
|
|
15
|
-
hideFromUI: true
|
|
16
|
-
}, {
|
|
17
|
-
name: "inheritState",
|
|
18
|
-
helperText: "Inherit the parent component state and data",
|
|
19
|
-
type: "boolean",
|
|
20
|
-
defaultValue: false,
|
|
21
|
-
advanced: true
|
|
22
|
-
}, {
|
|
23
|
-
name: "renderToLiquid",
|
|
24
|
-
helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
|
|
25
|
-
type: "boolean",
|
|
26
|
-
defaultValue: false,
|
|
27
|
-
advanced: true,
|
|
28
|
-
hideFromUI: true
|
|
29
|
-
}, {
|
|
30
|
-
name: "useChildren",
|
|
31
|
-
hideFromUI: true,
|
|
32
|
-
type: "boolean"
|
|
33
|
-
}]
|
|
34
|
-
};
|
|
35
|
-
export { componentInfo }
|