@builder.io/sdk-qwik 0.13.0 → 0.13.2
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/browser/index.qwik.cjs +1065 -279
- package/lib/browser/index.qwik.mjs +1066 -280
- package/lib/edge/index.qwik.cjs +1065 -279
- package/lib/edge/index.qwik.mjs +1066 -280
- package/lib/node/index.qwik.cjs +1065 -279
- package/lib/node/index.qwik.mjs +1066 -280
- package/package.json +1 -1
- package/types/src/blocks/form/form/component-info.d.ts +2 -0
- package/types/src/blocks/form/form/form.d.ts +37 -0
- package/types/src/blocks/form/input/component-info.d.ts +2 -0
- package/types/src/blocks/form/select/component-info.d.ts +2 -0
- package/types/src/blocks/form/submit-button/component-info.d.ts +2 -0
- package/types/src/blocks/slot/slot.d.ts +3 -6
- package/types/src/constants/extra-components.d.ts +7 -0
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/functions/get-env.d.ts +2 -0
- package/types/src/functions/get.d.ts +1 -0
- package/types/src/helpers/preview-lru-cache/helpers.d.ts +1 -0
- package/types/src/helpers/preview-lru-cache/types.d.ts +1 -0
- package/types/src/blocks/form/component-info.d.ts +0 -2
- package/types/src/blocks/input/component-info.d.ts +0 -2
- package/types/src/blocks/select/component-info.d.ts +0 -2
- package/types/src/blocks/submit-button/component-info.d.ts +0 -2
- /package/types/src/blocks/{input → form/input}/input.d.ts +0 -0
- /package/types/src/blocks/{select → form/select}/select.d.ts +0 -0
- /package/types/src/blocks/{submit-button → form/submit-button}/submit-button.d.ts +0 -0
package/lib/node/index.qwik.cjs
CHANGED
|
@@ -1127,7 +1127,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1127
1127
|
repeatItem
|
|
1128
1128
|
]));
|
|
1129
1129
|
const componentRefProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1130
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1130
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1131
1131
|
const [blockComponent2, processedBlock2, props2, state2] = qwik.useLexicalScope();
|
|
1132
1132
|
return {
|
|
1133
1133
|
blockChildren: processedBlock2.value.children ?? [],
|
|
@@ -1135,10 +1135,10 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1135
1135
|
componentOptions: {
|
|
1136
1136
|
...getBlockComponentOptions(processedBlock2.value),
|
|
1137
1137
|
builderContext: props2.context,
|
|
1138
|
-
...((_b = blockComponent2.value) == null ? void 0 : _b.name) === "Core:Button" || ((_c = blockComponent2.value) == null ? void 0 : _c.name) === "Symbol" || ((_d = blockComponent2.value) == null ? void 0 : _d.name) === "Columns" ? {
|
|
1138
|
+
...((_b = blockComponent2.value) == null ? void 0 : _b.name) === "Core:Button" || ((_c = blockComponent2.value) == null ? void 0 : _c.name) === "Symbol" || ((_d = blockComponent2.value) == null ? void 0 : _d.name) === "Columns" || ((_e = blockComponent2.value) == null ? void 0 : _e.name) === "Form:Form" ? {
|
|
1139
1139
|
builderLinkComponent: props2.linkComponent
|
|
1140
1140
|
} : {},
|
|
1141
|
-
...((
|
|
1141
|
+
...((_f = blockComponent2.value) == null ? void 0 : _f.name) === "Symbol" || ((_g = blockComponent2.value) == null ? void 0 : _g.name) === "Columns" || ((_h = blockComponent2.value) == null ? void 0 : _h.name) === "Form:Form" ? {
|
|
1142
1142
|
builderComponents: props2.registeredComponents
|
|
1143
1143
|
} : {}
|
|
1144
1144
|
},
|
|
@@ -1146,8 +1146,8 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1146
1146
|
linkComponent: props2.linkComponent,
|
|
1147
1147
|
registeredComponents: props2.registeredComponents,
|
|
1148
1148
|
builderBlock: processedBlock2.value,
|
|
1149
|
-
includeBlockProps: ((
|
|
1150
|
-
isInteractive: !((
|
|
1149
|
+
includeBlockProps: ((_i = blockComponent2.value) == null ? void 0 : _i.noWrap) === true,
|
|
1150
|
+
isInteractive: !((_j = blockComponent2.value) == null ? void 0 : _j.isRSC)
|
|
1151
1151
|
};
|
|
1152
1152
|
}, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
|
|
1153
1153
|
blockComponent,
|
|
@@ -1408,7 +1408,7 @@ const onMouseEnter = function onMouseEnter2(props, state) {
|
|
|
1408
1408
|
}, "*");
|
|
1409
1409
|
};
|
|
1410
1410
|
const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1411
|
-
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$
|
|
1411
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$3, "BlocksWrapper_component_useStylesScoped_Kj0S9AOXQ0o"));
|
|
1412
1412
|
const className = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1413
1413
|
var _a;
|
|
1414
1414
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -1469,7 +1469,7 @@ const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
1469
1469
|
}
|
|
1470
1470
|
}, 0, "3u_1");
|
|
1471
1471
|
}, "BlocksWrapper_component_45hR0o6abzg"));
|
|
1472
|
-
const STYLES$
|
|
1472
|
+
const STYLES$3 = `
|
|
1473
1473
|
.props-blocks-wrapper-BlocksWrapper {
|
|
1474
1474
|
display: flex;
|
|
1475
1475
|
flex-direction: column;
|
|
@@ -1619,7 +1619,7 @@ const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQr
|
|
|
1619
1619
|
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
1620
1620
|
stackAt: props.stackColumnsAt || "tablet"
|
|
1621
1621
|
});
|
|
1622
|
-
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$
|
|
1622
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
|
|
1623
1623
|
const columnsCssVars = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1624
1624
|
const [props2, state2] = qwik.useLexicalScope();
|
|
1625
1625
|
return {
|
|
@@ -1736,7 +1736,7 @@ const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQr
|
|
|
1736
1736
|
})
|
|
1737
1737
|
], 1, "c0_2");
|
|
1738
1738
|
}, "Columns_component_7yLj4bxdI6c"));
|
|
1739
|
-
const STYLES$
|
|
1739
|
+
const STYLES$2 = `
|
|
1740
1740
|
.div-Columns {
|
|
1741
1741
|
display: flex;
|
|
1742
1742
|
line-height: normal;
|
|
@@ -1802,7 +1802,7 @@ function getSrcSet(url) {
|
|
|
1802
1802
|
const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1803
1803
|
var _a, _b, _c, _d;
|
|
1804
1804
|
qwik._jsxBranch();
|
|
1805
|
-
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES, "Image_component_useStylesScoped_fBMYiVf9fuU"));
|
|
1805
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$1, "Image_component_useStylesScoped_fBMYiVf9fuU"));
|
|
1806
1806
|
const srcSetToUse = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1807
1807
|
var _a2;
|
|
1808
1808
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -1902,7 +1902,7 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1902
1902
|
]
|
|
1903
1903
|
}, 1, "0A_5");
|
|
1904
1904
|
}, "Image_component_LRxDkFa1EfU"));
|
|
1905
|
-
const STYLES = `
|
|
1905
|
+
const STYLES$1 = `
|
|
1906
1906
|
.img-Image {
|
|
1907
1907
|
opacity: 1;
|
|
1908
1908
|
transition: opacity 0.2s ease-in-out;
|
|
@@ -2115,7 +2115,7 @@ const handleABTesting = async ({ item, canTrack }) => {
|
|
|
2115
2115
|
};
|
|
2116
2116
|
};
|
|
2117
2117
|
const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2118
|
-
const componentInfo$
|
|
2118
|
+
const componentInfo$f = {
|
|
2119
2119
|
name: "Core:Button",
|
|
2120
2120
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
2121
2121
|
defaultStyles: {
|
|
@@ -2153,7 +2153,7 @@ const componentInfo$b = {
|
|
|
2153
2153
|
static: true,
|
|
2154
2154
|
noWrap: true
|
|
2155
2155
|
};
|
|
2156
|
-
const componentInfo$
|
|
2156
|
+
const componentInfo$e = {
|
|
2157
2157
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
2158
2158
|
name: "Columns",
|
|
2159
2159
|
isRSC: true,
|
|
@@ -2395,186 +2395,14 @@ const componentInfo$a = {
|
|
|
2395
2395
|
}
|
|
2396
2396
|
]
|
|
2397
2397
|
};
|
|
2398
|
-
const componentInfo$
|
|
2399
|
-
name: "Custom Code",
|
|
2400
|
-
static: true,
|
|
2401
|
-
requiredPermissions: [
|
|
2402
|
-
"editCode"
|
|
2403
|
-
],
|
|
2404
|
-
inputs: [
|
|
2405
|
-
{
|
|
2406
|
-
name: "code",
|
|
2407
|
-
type: "html",
|
|
2408
|
-
required: true,
|
|
2409
|
-
defaultValue: "<p>Hello there, I am custom HTML code!</p>",
|
|
2410
|
-
code: true
|
|
2411
|
-
},
|
|
2412
|
-
{
|
|
2413
|
-
name: "replaceNodes",
|
|
2414
|
-
type: "boolean",
|
|
2415
|
-
helperText: "Preserve server rendered dom nodes",
|
|
2416
|
-
advanced: true
|
|
2417
|
-
},
|
|
2418
|
-
{
|
|
2419
|
-
name: "scriptsClientOnly",
|
|
2420
|
-
type: "boolean",
|
|
2421
|
-
defaultValue: false,
|
|
2422
|
-
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
2423
|
-
advanced: true
|
|
2424
|
-
}
|
|
2425
|
-
]
|
|
2426
|
-
};
|
|
2427
|
-
const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2428
|
-
const elementRef = qwik.useSignal();
|
|
2429
|
-
const state = qwik.useStore({
|
|
2430
|
-
scriptsInserted: [],
|
|
2431
|
-
scriptsRun: []
|
|
2432
|
-
});
|
|
2433
|
-
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
2434
|
-
const [state2] = qwik.useLexicalScope();
|
|
2435
|
-
if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
|
|
2436
|
-
return;
|
|
2437
|
-
const scripts = element.getElementsByTagName("script");
|
|
2438
|
-
for (let i = 0; i < scripts.length; i++) {
|
|
2439
|
-
const script = scripts[i];
|
|
2440
|
-
if (script.src) {
|
|
2441
|
-
if (state2.scriptsInserted.includes(script.src))
|
|
2442
|
-
continue;
|
|
2443
|
-
state2.scriptsInserted.push(script.src);
|
|
2444
|
-
const newScript = document.createElement("script");
|
|
2445
|
-
newScript.async = true;
|
|
2446
|
-
newScript.src = script.src;
|
|
2447
|
-
document.head.appendChild(newScript);
|
|
2448
|
-
} else if (!script.type || [
|
|
2449
|
-
"text/javascript",
|
|
2450
|
-
"application/javascript",
|
|
2451
|
-
"application/ecmascript"
|
|
2452
|
-
].includes(script.type)) {
|
|
2453
|
-
if (state2.scriptsRun.includes(script.innerText))
|
|
2454
|
-
continue;
|
|
2455
|
-
try {
|
|
2456
|
-
state2.scriptsRun.push(script.innerText);
|
|
2457
|
-
new Function(script.innerText)();
|
|
2458
|
-
} catch (error) {
|
|
2459
|
-
console.warn("`CustomCode`: Error running script:", error);
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
}
|
|
2463
|
-
}, "CustomCode_component_useOn_zjAgBhFOiCs", [
|
|
2464
|
-
state
|
|
2465
|
-
]));
|
|
2466
|
-
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
2467
|
-
ref: elementRef
|
|
2468
|
-
}, {
|
|
2469
|
-
class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
|
|
2470
|
-
props
|
|
2471
|
-
], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
|
|
2472
|
-
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.code, [
|
|
2473
|
-
props
|
|
2474
|
-
], "p0.code")
|
|
2475
|
-
}, null, 3, "bY_0");
|
|
2476
|
-
}, "CustomCode_component_uYOSy7w7Zqw"));
|
|
2477
|
-
const componentInfo$8 = {
|
|
2478
|
-
name: "Embed",
|
|
2479
|
-
static: true,
|
|
2480
|
-
inputs: [
|
|
2481
|
-
{
|
|
2482
|
-
name: "url",
|
|
2483
|
-
type: "url",
|
|
2484
|
-
required: true,
|
|
2485
|
-
defaultValue: "",
|
|
2486
|
-
helperText: "e.g. enter a youtube url, google map, etc",
|
|
2487
|
-
onChange: (options) => {
|
|
2488
|
-
const url = options.get("url");
|
|
2489
|
-
if (url) {
|
|
2490
|
-
options.set("content", "Loading...");
|
|
2491
|
-
const apiKey = "ae0e60e78201a3f2b0de4b";
|
|
2492
|
-
return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
|
|
2493
|
-
if (options.get("url") === url) {
|
|
2494
|
-
if (data.html)
|
|
2495
|
-
options.set("content", data.html);
|
|
2496
|
-
else
|
|
2497
|
-
options.set("content", "Invalid url, please try another");
|
|
2498
|
-
}
|
|
2499
|
-
}).catch((_err) => {
|
|
2500
|
-
options.set("content", "There was an error embedding this URL, please try again or another URL");
|
|
2501
|
-
});
|
|
2502
|
-
} else
|
|
2503
|
-
options.delete("content");
|
|
2504
|
-
}
|
|
2505
|
-
},
|
|
2506
|
-
{
|
|
2507
|
-
name: "content",
|
|
2508
|
-
type: "html",
|
|
2509
|
-
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
2510
|
-
hideFromUI: true
|
|
2511
|
-
}
|
|
2512
|
-
]
|
|
2513
|
-
};
|
|
2514
|
-
const SCRIPT_MIME_TYPES = [
|
|
2515
|
-
"text/javascript",
|
|
2516
|
-
"application/javascript",
|
|
2517
|
-
"application/ecmascript"
|
|
2518
|
-
];
|
|
2519
|
-
const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2520
|
-
const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
|
|
2521
|
-
if (!elem.value || !elem.value.getElementsByTagName)
|
|
2522
|
-
return;
|
|
2523
|
-
const scripts = elem.value.getElementsByTagName("script");
|
|
2524
|
-
for (let i = 0; i < scripts.length; i++) {
|
|
2525
|
-
const script = scripts[i];
|
|
2526
|
-
if (script.src && !state.scriptsInserted.includes(script.src)) {
|
|
2527
|
-
state.scriptsInserted.push(script.src);
|
|
2528
|
-
const newScript = document.createElement("script");
|
|
2529
|
-
newScript.async = true;
|
|
2530
|
-
newScript.src = script.src;
|
|
2531
|
-
document.head.appendChild(newScript);
|
|
2532
|
-
} else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
|
|
2533
|
-
try {
|
|
2534
|
-
state.scriptsRun.push(script.innerText);
|
|
2535
|
-
new Function(script.innerText)();
|
|
2536
|
-
} catch (error) {
|
|
2537
|
-
console.warn("`Embed`: Error running script:", error);
|
|
2538
|
-
}
|
|
2539
|
-
}
|
|
2540
|
-
};
|
|
2541
|
-
const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2542
|
-
const elem = qwik.useSignal();
|
|
2543
|
-
const state = qwik.useStore({
|
|
2544
|
-
ranInitFn: false,
|
|
2545
|
-
scriptsInserted: [],
|
|
2546
|
-
scriptsRun: []
|
|
2547
|
-
});
|
|
2548
|
-
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
2549
|
-
const [elem2, props2, state2] = qwik.useLexicalScope();
|
|
2550
|
-
track2(() => elem2.value);
|
|
2551
|
-
track2(() => state2.ranInitFn);
|
|
2552
|
-
if (elem2.value && !state2.ranInitFn) {
|
|
2553
|
-
state2.ranInitFn = true;
|
|
2554
|
-
findAndRunScripts(props2, state2, elem2);
|
|
2555
|
-
}
|
|
2556
|
-
}, "Embed_component_useTask_bg7ez0XUtiM", [
|
|
2557
|
-
elem,
|
|
2558
|
-
props,
|
|
2559
|
-
state
|
|
2560
|
-
]));
|
|
2561
|
-
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
2562
|
-
ref: elem
|
|
2563
|
-
}, {
|
|
2564
|
-
class: "builder-embed",
|
|
2565
|
-
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.content, [
|
|
2566
|
-
props
|
|
2567
|
-
], "p0.content")
|
|
2568
|
-
}, null, 3, "9r_0");
|
|
2569
|
-
}, "Embed_component_Uji08ORjXbE"));
|
|
2570
|
-
const componentInfo$7 = {
|
|
2398
|
+
const componentInfo$d = {
|
|
2571
2399
|
name: "Fragment",
|
|
2572
2400
|
static: true,
|
|
2573
2401
|
hidden: true,
|
|
2574
2402
|
canHaveChildren: true,
|
|
2575
2403
|
noWrap: true
|
|
2576
2404
|
};
|
|
2577
|
-
const componentInfo$
|
|
2405
|
+
const componentInfo$c = {
|
|
2578
2406
|
name: "Image",
|
|
2579
2407
|
static: true,
|
|
2580
2408
|
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",
|
|
@@ -2722,49 +2550,7 @@ const componentInfo$6 = {
|
|
|
2722
2550
|
}
|
|
2723
2551
|
]
|
|
2724
2552
|
};
|
|
2725
|
-
const componentInfo$
|
|
2726
|
-
// friendlyName?
|
|
2727
|
-
name: "Raw:Img",
|
|
2728
|
-
hideFromInsertMenu: true,
|
|
2729
|
-
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",
|
|
2730
|
-
inputs: [
|
|
2731
|
-
{
|
|
2732
|
-
name: "image",
|
|
2733
|
-
bubble: true,
|
|
2734
|
-
type: "file",
|
|
2735
|
-
allowedFileTypes: [
|
|
2736
|
-
"jpeg",
|
|
2737
|
-
"jpg",
|
|
2738
|
-
"png",
|
|
2739
|
-
"svg",
|
|
2740
|
-
"gif",
|
|
2741
|
-
"webp"
|
|
2742
|
-
],
|
|
2743
|
-
required: true
|
|
2744
|
-
}
|
|
2745
|
-
],
|
|
2746
|
-
noWrap: true,
|
|
2747
|
-
static: true
|
|
2748
|
-
};
|
|
2749
|
-
const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2750
|
-
return /* @__PURE__ */ qwik._jsxS("img", {
|
|
2751
|
-
...props.attributes
|
|
2752
|
-
}, {
|
|
2753
|
-
alt: qwik._fnSignal((p0) => p0.altText, [
|
|
2754
|
-
props
|
|
2755
|
-
], "p0.altText"),
|
|
2756
|
-
src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
|
|
2757
|
-
props
|
|
2758
|
-
], "p0.imgSrc||p0.image"),
|
|
2759
|
-
style: qwik._fnSignal((p0) => ({
|
|
2760
|
-
objectFit: p0.backgroundSize || "cover",
|
|
2761
|
-
objectPosition: p0.backgroundPosition || "center"
|
|
2762
|
-
}), [
|
|
2763
|
-
props
|
|
2764
|
-
], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
|
|
2765
|
-
}, 0, isEditing() && props.imgSrc || "default-key");
|
|
2766
|
-
}, "ImgComponent_component_FXvIDBSffO8"));
|
|
2767
|
-
const componentInfo$4 = {
|
|
2553
|
+
const componentInfo$b = {
|
|
2768
2554
|
name: "Core:Section",
|
|
2769
2555
|
static: true,
|
|
2770
2556
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2809,7 +2595,7 @@ const componentInfo$4 = {
|
|
|
2809
2595
|
}
|
|
2810
2596
|
]
|
|
2811
2597
|
};
|
|
2812
|
-
const componentInfo$
|
|
2598
|
+
const componentInfo$a = {
|
|
2813
2599
|
name: "Slot",
|
|
2814
2600
|
isRSC: true,
|
|
2815
2601
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -2864,7 +2650,7 @@ const Slot = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2864
2650
|
}
|
|
2865
2651
|
}, 0, "B1_1");
|
|
2866
2652
|
}, "Slot_component_WWgWgfV0bb0"));
|
|
2867
|
-
const componentInfo$
|
|
2653
|
+
const componentInfo$9 = {
|
|
2868
2654
|
name: "Symbol",
|
|
2869
2655
|
noWrap: true,
|
|
2870
2656
|
static: true,
|
|
@@ -2904,7 +2690,7 @@ const componentInfo$2 = {
|
|
|
2904
2690
|
}
|
|
2905
2691
|
]
|
|
2906
2692
|
};
|
|
2907
|
-
const componentInfo$
|
|
2693
|
+
const componentInfo$8 = {
|
|
2908
2694
|
name: "Text",
|
|
2909
2695
|
static: true,
|
|
2910
2696
|
isRSC: true,
|
|
@@ -2939,27 +2725,1006 @@ const Text = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2939
2725
|
}
|
|
2940
2726
|
}, null, 3, "yO_0");
|
|
2941
2727
|
}, "Text_component_15p0cKUxgIE"));
|
|
2942
|
-
const componentInfo = {
|
|
2943
|
-
name: "
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
},
|
|
2949
|
-
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
|
|
2728
|
+
const componentInfo$7 = {
|
|
2729
|
+
name: "Custom Code",
|
|
2730
|
+
static: true,
|
|
2731
|
+
requiredPermissions: [
|
|
2732
|
+
"editCode"
|
|
2733
|
+
],
|
|
2950
2734
|
inputs: [
|
|
2951
2735
|
{
|
|
2952
|
-
name: "
|
|
2953
|
-
type: "
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2736
|
+
name: "code",
|
|
2737
|
+
type: "html",
|
|
2738
|
+
required: true,
|
|
2739
|
+
defaultValue: "<p>Hello there, I am custom HTML code!</p>",
|
|
2740
|
+
code: true
|
|
2741
|
+
},
|
|
2742
|
+
{
|
|
2743
|
+
name: "replaceNodes",
|
|
2744
|
+
type: "boolean",
|
|
2745
|
+
helperText: "Preserve server rendered dom nodes",
|
|
2746
|
+
advanced: true
|
|
2747
|
+
},
|
|
2748
|
+
{
|
|
2749
|
+
name: "scriptsClientOnly",
|
|
2750
|
+
type: "boolean",
|
|
2751
|
+
defaultValue: false,
|
|
2752
|
+
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
2753
|
+
advanced: true
|
|
2754
|
+
}
|
|
2755
|
+
]
|
|
2756
|
+
};
|
|
2757
|
+
const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2758
|
+
const elementRef = qwik.useSignal();
|
|
2759
|
+
const state = qwik.useStore({
|
|
2760
|
+
scriptsInserted: [],
|
|
2761
|
+
scriptsRun: []
|
|
2762
|
+
});
|
|
2763
|
+
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
2764
|
+
const [state2] = qwik.useLexicalScope();
|
|
2765
|
+
if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
|
|
2766
|
+
return;
|
|
2767
|
+
const scripts = element.getElementsByTagName("script");
|
|
2768
|
+
for (let i = 0; i < scripts.length; i++) {
|
|
2769
|
+
const script = scripts[i];
|
|
2770
|
+
if (script.src) {
|
|
2771
|
+
if (state2.scriptsInserted.includes(script.src))
|
|
2772
|
+
continue;
|
|
2773
|
+
state2.scriptsInserted.push(script.src);
|
|
2774
|
+
const newScript = document.createElement("script");
|
|
2775
|
+
newScript.async = true;
|
|
2776
|
+
newScript.src = script.src;
|
|
2777
|
+
document.head.appendChild(newScript);
|
|
2778
|
+
} else if (!script.type || [
|
|
2779
|
+
"text/javascript",
|
|
2780
|
+
"application/javascript",
|
|
2781
|
+
"application/ecmascript"
|
|
2782
|
+
].includes(script.type)) {
|
|
2783
|
+
if (state2.scriptsRun.includes(script.innerText))
|
|
2784
|
+
continue;
|
|
2785
|
+
try {
|
|
2786
|
+
state2.scriptsRun.push(script.innerText);
|
|
2787
|
+
new Function(script.innerText)();
|
|
2788
|
+
} catch (error) {
|
|
2789
|
+
console.warn("`CustomCode`: Error running script:", error);
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
}, "CustomCode_component_useOn_zjAgBhFOiCs", [
|
|
2794
|
+
state
|
|
2795
|
+
]));
|
|
2796
|
+
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
2797
|
+
ref: elementRef
|
|
2798
|
+
}, {
|
|
2799
|
+
class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
|
|
2800
|
+
props
|
|
2801
|
+
], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
|
|
2802
|
+
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.code, [
|
|
2803
|
+
props
|
|
2804
|
+
], "p0.code")
|
|
2805
|
+
}, null, 3, "bY_0");
|
|
2806
|
+
}, "CustomCode_component_uYOSy7w7Zqw"));
|
|
2807
|
+
const componentInfo$6 = {
|
|
2808
|
+
name: "Embed",
|
|
2809
|
+
static: true,
|
|
2810
|
+
inputs: [
|
|
2811
|
+
{
|
|
2812
|
+
name: "url",
|
|
2813
|
+
type: "url",
|
|
2814
|
+
required: true,
|
|
2815
|
+
defaultValue: "",
|
|
2816
|
+
helperText: "e.g. enter a youtube url, google map, etc",
|
|
2817
|
+
onChange: (options) => {
|
|
2818
|
+
const url = options.get("url");
|
|
2819
|
+
if (url) {
|
|
2820
|
+
options.set("content", "Loading...");
|
|
2821
|
+
const apiKey = "ae0e60e78201a3f2b0de4b";
|
|
2822
|
+
return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
|
|
2823
|
+
if (options.get("url") === url) {
|
|
2824
|
+
if (data.html)
|
|
2825
|
+
options.set("content", data.html);
|
|
2826
|
+
else
|
|
2827
|
+
options.set("content", "Invalid url, please try another");
|
|
2828
|
+
}
|
|
2829
|
+
}).catch((_err) => {
|
|
2830
|
+
options.set("content", "There was an error embedding this URL, please try again or another URL");
|
|
2831
|
+
});
|
|
2832
|
+
} else
|
|
2833
|
+
options.delete("content");
|
|
2834
|
+
}
|
|
2835
|
+
},
|
|
2836
|
+
{
|
|
2837
|
+
name: "content",
|
|
2838
|
+
type: "html",
|
|
2839
|
+
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
2840
|
+
hideFromUI: true
|
|
2841
|
+
}
|
|
2842
|
+
]
|
|
2843
|
+
};
|
|
2844
|
+
const SCRIPT_MIME_TYPES = [
|
|
2845
|
+
"text/javascript",
|
|
2846
|
+
"application/javascript",
|
|
2847
|
+
"application/ecmascript"
|
|
2848
|
+
];
|
|
2849
|
+
const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2850
|
+
const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
|
|
2851
|
+
if (!elem.value || !elem.value.getElementsByTagName)
|
|
2852
|
+
return;
|
|
2853
|
+
const scripts = elem.value.getElementsByTagName("script");
|
|
2854
|
+
for (let i = 0; i < scripts.length; i++) {
|
|
2855
|
+
const script = scripts[i];
|
|
2856
|
+
if (script.src && !state.scriptsInserted.includes(script.src)) {
|
|
2857
|
+
state.scriptsInserted.push(script.src);
|
|
2858
|
+
const newScript = document.createElement("script");
|
|
2859
|
+
newScript.async = true;
|
|
2860
|
+
newScript.src = script.src;
|
|
2861
|
+
document.head.appendChild(newScript);
|
|
2862
|
+
} else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
|
|
2863
|
+
try {
|
|
2864
|
+
state.scriptsRun.push(script.innerText);
|
|
2865
|
+
new Function(script.innerText)();
|
|
2866
|
+
} catch (error) {
|
|
2867
|
+
console.warn("`Embed`: Error running script:", error);
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
};
|
|
2871
|
+
const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2872
|
+
const elem = qwik.useSignal();
|
|
2873
|
+
const state = qwik.useStore({
|
|
2874
|
+
ranInitFn: false,
|
|
2875
|
+
scriptsInserted: [],
|
|
2876
|
+
scriptsRun: []
|
|
2877
|
+
});
|
|
2878
|
+
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
2879
|
+
const [elem2, props2, state2] = qwik.useLexicalScope();
|
|
2880
|
+
track2(() => elem2.value);
|
|
2881
|
+
track2(() => state2.ranInitFn);
|
|
2882
|
+
if (elem2.value && !state2.ranInitFn) {
|
|
2883
|
+
state2.ranInitFn = true;
|
|
2884
|
+
findAndRunScripts(props2, state2, elem2);
|
|
2885
|
+
}
|
|
2886
|
+
}, "Embed_component_useTask_bg7ez0XUtiM", [
|
|
2887
|
+
elem,
|
|
2888
|
+
props,
|
|
2889
|
+
state
|
|
2890
|
+
]));
|
|
2891
|
+
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
2892
|
+
ref: elem
|
|
2893
|
+
}, {
|
|
2894
|
+
class: "builder-embed",
|
|
2895
|
+
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.content, [
|
|
2896
|
+
props
|
|
2897
|
+
], "p0.content")
|
|
2898
|
+
}, null, 3, "9r_0");
|
|
2899
|
+
}, "Embed_component_Uji08ORjXbE"));
|
|
2900
|
+
const componentInfo$5 = {
|
|
2901
|
+
name: "Form:Form",
|
|
2902
|
+
// editableTags: ['builder-form-error']
|
|
2903
|
+
defaults: {
|
|
2904
|
+
responsiveStyles: {
|
|
2905
|
+
large: {
|
|
2906
|
+
marginTop: "15px",
|
|
2907
|
+
paddingBottom: "15px"
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
},
|
|
2911
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",
|
|
2912
|
+
inputs: [
|
|
2913
|
+
{
|
|
2914
|
+
name: "sendSubmissionsTo",
|
|
2915
|
+
type: "string",
|
|
2916
|
+
// TODO: save to builder data and user can download as csv
|
|
2917
|
+
// TODO: easy for mode too or computed add/remove fields form mode
|
|
2918
|
+
// so you can edit details and high level mode at same time...
|
|
2919
|
+
// Later - more integrations like mailchimp
|
|
2920
|
+
// /api/v1/form-submit?to=mailchimp
|
|
2921
|
+
enum: [
|
|
2922
|
+
{
|
|
2923
|
+
label: "Send to email",
|
|
2924
|
+
value: "email",
|
|
2925
|
+
helperText: "Send form submissions to the email address of your choosing"
|
|
2926
|
+
},
|
|
2927
|
+
{
|
|
2928
|
+
label: "Custom",
|
|
2929
|
+
value: "custom",
|
|
2930
|
+
helperText: "Handle where the form requests go manually with a little code, e.g. to your own custom backend"
|
|
2931
|
+
}
|
|
2932
|
+
],
|
|
2933
|
+
defaultValue: "email"
|
|
2934
|
+
},
|
|
2935
|
+
{
|
|
2936
|
+
name: "sendSubmissionsToEmail",
|
|
2937
|
+
type: "string",
|
|
2938
|
+
required: true,
|
|
2939
|
+
// TODO: required: () => options.get("sendSubmissionsTo") === "email"
|
|
2940
|
+
defaultValue: "your@email.com",
|
|
2941
|
+
showIf: 'options.get("sendSubmissionsTo") === "email"'
|
|
2942
|
+
},
|
|
2943
|
+
{
|
|
2944
|
+
name: "sendWithJs",
|
|
2945
|
+
type: "boolean",
|
|
2946
|
+
helperText: "Set to false to use basic html form action",
|
|
2947
|
+
defaultValue: true,
|
|
2948
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
2949
|
+
},
|
|
2950
|
+
{
|
|
2951
|
+
name: "name",
|
|
2952
|
+
type: "string",
|
|
2953
|
+
defaultValue: "My form"
|
|
2954
|
+
},
|
|
2955
|
+
{
|
|
2956
|
+
name: "action",
|
|
2957
|
+
type: "string",
|
|
2958
|
+
helperText: "URL to send the form data to",
|
|
2959
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
2960
|
+
},
|
|
2961
|
+
{
|
|
2962
|
+
name: "contentType",
|
|
2963
|
+
type: "string",
|
|
2964
|
+
defaultValue: "application/json",
|
|
2965
|
+
advanced: true,
|
|
2966
|
+
// TODO: do automatically if file input
|
|
2967
|
+
enum: [
|
|
2968
|
+
"application/json",
|
|
2969
|
+
"multipart/form-data",
|
|
2970
|
+
"application/x-www-form-urlencoded"
|
|
2971
|
+
],
|
|
2972
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
2973
|
+
},
|
|
2974
|
+
{
|
|
2975
|
+
name: "method",
|
|
2976
|
+
type: "string",
|
|
2977
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"',
|
|
2978
|
+
defaultValue: "POST",
|
|
2979
|
+
advanced: true
|
|
2980
|
+
},
|
|
2981
|
+
{
|
|
2982
|
+
name: "previewState",
|
|
2983
|
+
type: "string",
|
|
2984
|
+
// TODO: persist: false flag
|
|
2985
|
+
enum: [
|
|
2986
|
+
"unsubmitted",
|
|
2987
|
+
"sending",
|
|
2988
|
+
"success",
|
|
2989
|
+
"error"
|
|
2990
|
+
],
|
|
2991
|
+
defaultValue: "unsubmitted",
|
|
2992
|
+
helperText: 'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',
|
|
2993
|
+
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
2994
|
+
},
|
|
2995
|
+
{
|
|
2996
|
+
name: "successUrl",
|
|
2997
|
+
type: "url",
|
|
2998
|
+
helperText: "Optional URL to redirect the user to on form submission success",
|
|
2999
|
+
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
3000
|
+
},
|
|
3001
|
+
{
|
|
3002
|
+
name: "resetFormOnSubmit",
|
|
3003
|
+
type: "boolean",
|
|
3004
|
+
showIf: "options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",
|
|
3005
|
+
advanced: true
|
|
3006
|
+
},
|
|
3007
|
+
{
|
|
3008
|
+
name: "successMessage",
|
|
3009
|
+
type: "uiBlocks",
|
|
3010
|
+
hideFromUI: true,
|
|
3011
|
+
defaultValue: [
|
|
3012
|
+
{
|
|
3013
|
+
"@type": "@builder.io/sdk:Element",
|
|
3014
|
+
responsiveStyles: {
|
|
3015
|
+
large: {
|
|
3016
|
+
marginTop: "10px"
|
|
3017
|
+
}
|
|
3018
|
+
},
|
|
3019
|
+
component: {
|
|
3020
|
+
name: "Text",
|
|
3021
|
+
options: {
|
|
3022
|
+
text: "<span>Thanks!</span>"
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
]
|
|
3027
|
+
},
|
|
3028
|
+
{
|
|
3029
|
+
name: "validate",
|
|
3030
|
+
type: "boolean",
|
|
3031
|
+
defaultValue: true,
|
|
3032
|
+
advanced: true
|
|
3033
|
+
},
|
|
3034
|
+
{
|
|
3035
|
+
name: "errorMessagePath",
|
|
3036
|
+
type: "text",
|
|
3037
|
+
advanced: true,
|
|
3038
|
+
helperText: 'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'
|
|
3039
|
+
},
|
|
3040
|
+
{
|
|
3041
|
+
name: "errorMessage",
|
|
3042
|
+
type: "uiBlocks",
|
|
3043
|
+
hideFromUI: true,
|
|
3044
|
+
defaultValue: [
|
|
3045
|
+
{
|
|
3046
|
+
"@type": "@builder.io/sdk:Element",
|
|
3047
|
+
responsiveStyles: {
|
|
3048
|
+
large: {
|
|
3049
|
+
marginTop: "10px"
|
|
3050
|
+
}
|
|
3051
|
+
},
|
|
3052
|
+
bindings: {
|
|
3053
|
+
"component.options.text": "state.formErrorMessage || block.component.options.text"
|
|
3054
|
+
},
|
|
3055
|
+
component: {
|
|
3056
|
+
name: "Text",
|
|
3057
|
+
options: {
|
|
3058
|
+
text: "<span>Form submission error :( Please check your answers and try again</span>"
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
]
|
|
3063
|
+
},
|
|
3064
|
+
{
|
|
3065
|
+
name: "sendingMessage",
|
|
3066
|
+
type: "uiBlocks",
|
|
3067
|
+
hideFromUI: true,
|
|
3068
|
+
defaultValue: [
|
|
3069
|
+
{
|
|
3070
|
+
"@type": "@builder.io/sdk:Element",
|
|
3071
|
+
responsiveStyles: {
|
|
3072
|
+
large: {
|
|
3073
|
+
marginTop: "10px"
|
|
3074
|
+
}
|
|
3075
|
+
},
|
|
3076
|
+
component: {
|
|
3077
|
+
name: "Text",
|
|
3078
|
+
options: {
|
|
3079
|
+
text: "<span>Sending...</span>"
|
|
3080
|
+
}
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
]
|
|
3084
|
+
},
|
|
3085
|
+
{
|
|
3086
|
+
name: "customHeaders",
|
|
3087
|
+
type: "map",
|
|
3088
|
+
valueType: {
|
|
3089
|
+
type: "string"
|
|
3090
|
+
},
|
|
3091
|
+
advanced: true,
|
|
3092
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
3093
|
+
}
|
|
3094
|
+
],
|
|
3095
|
+
noWrap: true,
|
|
3096
|
+
canHaveChildren: true,
|
|
3097
|
+
defaultChildren: [
|
|
3098
|
+
{
|
|
3099
|
+
"@type": "@builder.io/sdk:Element",
|
|
3100
|
+
responsiveStyles: {
|
|
3101
|
+
large: {
|
|
3102
|
+
marginTop: "10px"
|
|
3103
|
+
}
|
|
3104
|
+
},
|
|
3105
|
+
component: {
|
|
3106
|
+
name: "Text",
|
|
3107
|
+
options: {
|
|
3108
|
+
text: "<span>Enter your name</span>"
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
},
|
|
3112
|
+
{
|
|
3113
|
+
"@type": "@builder.io/sdk:Element",
|
|
3114
|
+
responsiveStyles: {
|
|
3115
|
+
large: {
|
|
3116
|
+
marginTop: "10px"
|
|
3117
|
+
}
|
|
3118
|
+
},
|
|
3119
|
+
component: {
|
|
3120
|
+
name: "Form:Input",
|
|
3121
|
+
options: {
|
|
3122
|
+
name: "name",
|
|
3123
|
+
placeholder: "Jane Doe"
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
},
|
|
3127
|
+
{
|
|
3128
|
+
"@type": "@builder.io/sdk:Element",
|
|
3129
|
+
responsiveStyles: {
|
|
3130
|
+
large: {
|
|
3131
|
+
marginTop: "10px"
|
|
3132
|
+
}
|
|
3133
|
+
},
|
|
3134
|
+
component: {
|
|
3135
|
+
name: "Text",
|
|
3136
|
+
options: {
|
|
3137
|
+
text: "<span>Enter your email</span>"
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
},
|
|
3141
|
+
{
|
|
3142
|
+
"@type": "@builder.io/sdk:Element",
|
|
3143
|
+
responsiveStyles: {
|
|
3144
|
+
large: {
|
|
3145
|
+
marginTop: "10px"
|
|
3146
|
+
}
|
|
3147
|
+
},
|
|
3148
|
+
component: {
|
|
3149
|
+
name: "Form:Input",
|
|
3150
|
+
options: {
|
|
3151
|
+
name: "email",
|
|
3152
|
+
placeholder: "jane@doe.com"
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
},
|
|
3156
|
+
{
|
|
3157
|
+
"@type": "@builder.io/sdk:Element",
|
|
3158
|
+
responsiveStyles: {
|
|
3159
|
+
large: {
|
|
3160
|
+
marginTop: "10px"
|
|
3161
|
+
}
|
|
3162
|
+
},
|
|
3163
|
+
component: {
|
|
3164
|
+
name: "Form:SubmitButton",
|
|
3165
|
+
options: {
|
|
3166
|
+
text: "Submit"
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
]
|
|
3171
|
+
};
|
|
3172
|
+
const validEnvList = [
|
|
3173
|
+
"production",
|
|
3174
|
+
"qa",
|
|
3175
|
+
"test",
|
|
3176
|
+
"development",
|
|
3177
|
+
"dev",
|
|
3178
|
+
"cdn-qa",
|
|
3179
|
+
"cloud",
|
|
3180
|
+
"fast",
|
|
3181
|
+
"cdn2",
|
|
3182
|
+
"cdn-prod"
|
|
3183
|
+
];
|
|
3184
|
+
const getEnv = () => {
|
|
3185
|
+
const env = process.env.NODE_ENV || "production";
|
|
3186
|
+
return validEnvList.includes(env) ? env : "production";
|
|
3187
|
+
};
|
|
3188
|
+
const get = (obj, path, defaultValue) => {
|
|
3189
|
+
const result = String.prototype.split.call(path, /[,[\].]+?/).filter(Boolean).reduce((res, key) => res !== null && res !== void 0 ? res[key] : res, obj);
|
|
3190
|
+
return result === void 0 || result === obj ? defaultValue : result;
|
|
3191
|
+
};
|
|
3192
|
+
const mergeNewRootState$1 = function mergeNewRootState2(props, state, formRef, newData) {
|
|
3193
|
+
var _a, _b;
|
|
3194
|
+
const combinedState = {
|
|
3195
|
+
...props.builderContext.rootState,
|
|
3196
|
+
...newData
|
|
3197
|
+
};
|
|
3198
|
+
if (props.builderContext.rootSetState)
|
|
3199
|
+
(_b = (_a = props.builderContext).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
|
|
3200
|
+
else
|
|
3201
|
+
props.builderContext.rootState = combinedState;
|
|
3202
|
+
};
|
|
3203
|
+
const submissionState = function submissionState2(props, state, formRef) {
|
|
3204
|
+
return isEditing() && props.previewState || state.formState;
|
|
3205
|
+
};
|
|
3206
|
+
const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
3207
|
+
var _a;
|
|
3208
|
+
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
3209
|
+
if (props.sendSubmissionsTo === "zapier")
|
|
3210
|
+
event.preventDefault();
|
|
3211
|
+
else if (sendWithJsProp) {
|
|
3212
|
+
if (!(props.action || props.sendSubmissionsTo === "email")) {
|
|
3213
|
+
event.preventDefault();
|
|
3214
|
+
return;
|
|
3215
|
+
}
|
|
3216
|
+
event.preventDefault();
|
|
3217
|
+
const el = event.currentTarget;
|
|
3218
|
+
const headers = props.customHeaders || {};
|
|
3219
|
+
let body;
|
|
3220
|
+
const formData = new FormData(el);
|
|
3221
|
+
const formPairs = Array.from(event.currentTarget.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
3222
|
+
let value;
|
|
3223
|
+
const key = el2.name;
|
|
3224
|
+
if (el2 instanceof HTMLInputElement) {
|
|
3225
|
+
if (el2.type === "radio") {
|
|
3226
|
+
if (el2.checked) {
|
|
3227
|
+
value = el2.name;
|
|
3228
|
+
return {
|
|
3229
|
+
key,
|
|
3230
|
+
value
|
|
3231
|
+
};
|
|
3232
|
+
}
|
|
3233
|
+
} else if (el2.type === "checkbox")
|
|
3234
|
+
value = el2.checked;
|
|
3235
|
+
else if (el2.type === "number" || el2.type === "range") {
|
|
3236
|
+
const num = el2.valueAsNumber;
|
|
3237
|
+
if (!isNaN(num))
|
|
3238
|
+
value = num;
|
|
3239
|
+
} else if (el2.type === "file")
|
|
3240
|
+
value = el2.files;
|
|
3241
|
+
else
|
|
3242
|
+
value = el2.value;
|
|
3243
|
+
} else
|
|
3244
|
+
value = el2.value;
|
|
3245
|
+
return {
|
|
3246
|
+
key,
|
|
3247
|
+
value
|
|
3248
|
+
};
|
|
3249
|
+
});
|
|
3250
|
+
let formContentType = props.contentType;
|
|
3251
|
+
if (props.sendSubmissionsTo === "email")
|
|
3252
|
+
formContentType = "multipart/form-data";
|
|
3253
|
+
Array.from(formPairs).forEach(({ value }) => {
|
|
3254
|
+
if (value instanceof File || Array.isArray(value) && value[0] instanceof File || value instanceof FileList)
|
|
3255
|
+
formContentType = "multipart/form-data";
|
|
3256
|
+
});
|
|
3257
|
+
if (formContentType !== "application/json")
|
|
3258
|
+
body = formData;
|
|
3259
|
+
else {
|
|
3260
|
+
const json = {};
|
|
3261
|
+
Array.from(formPairs).forEach(({ value, key }) => {
|
|
3262
|
+
set(json, key, value);
|
|
3263
|
+
});
|
|
3264
|
+
body = JSON.stringify(json);
|
|
3265
|
+
}
|
|
3266
|
+
if (formContentType && formContentType !== "multipart/form-data") {
|
|
3267
|
+
if (
|
|
3268
|
+
/* Zapier doesn't allow content-type header to be sent from browsers */
|
|
3269
|
+
!(sendWithJsProp && ((_a = props.action) == null ? void 0 : _a.includes("zapier.com")))
|
|
3270
|
+
)
|
|
3271
|
+
headers["content-type"] = formContentType;
|
|
3272
|
+
}
|
|
3273
|
+
const presubmitEvent = new CustomEvent("presubmit", {
|
|
3274
|
+
detail: {
|
|
3275
|
+
body
|
|
3276
|
+
}
|
|
3277
|
+
});
|
|
3278
|
+
if (formRef.value) {
|
|
3279
|
+
formRef.value.dispatchEvent(presubmitEvent);
|
|
3280
|
+
if (presubmitEvent.defaultPrevented)
|
|
3281
|
+
return;
|
|
3282
|
+
}
|
|
3283
|
+
state.formState = "sending";
|
|
3284
|
+
const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
|
|
3285
|
+
fetch(props.sendSubmissionsTo === "email" ? formUrl : props.action, {
|
|
3286
|
+
body,
|
|
3287
|
+
headers,
|
|
3288
|
+
method: props.method || "post"
|
|
3289
|
+
}).then(async (res) => {
|
|
3290
|
+
let body2;
|
|
3291
|
+
const contentType = res.headers.get("content-type");
|
|
3292
|
+
if (contentType && contentType.indexOf("application/json") !== -1)
|
|
3293
|
+
body2 = await res.json();
|
|
3294
|
+
else
|
|
3295
|
+
body2 = await res.text();
|
|
3296
|
+
if (!res.ok && props.errorMessagePath) {
|
|
3297
|
+
let message = get(body2, props.errorMessagePath);
|
|
3298
|
+
if (message) {
|
|
3299
|
+
if (typeof message !== "string")
|
|
3300
|
+
message = JSON.stringify(message);
|
|
3301
|
+
state.formErrorMessage = message;
|
|
3302
|
+
mergeNewRootState$1(props, state, formRef, {
|
|
3303
|
+
formErrorMessage: message
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
state.responseData = body2;
|
|
3308
|
+
state.formState = res.ok ? "success" : "error";
|
|
3309
|
+
if (res.ok) {
|
|
3310
|
+
const submitSuccessEvent = new CustomEvent("submit:success", {
|
|
3311
|
+
detail: {
|
|
3312
|
+
res,
|
|
3313
|
+
body: body2
|
|
3314
|
+
}
|
|
3315
|
+
});
|
|
3316
|
+
if (formRef.value) {
|
|
3317
|
+
formRef.value.dispatchEvent(submitSuccessEvent);
|
|
3318
|
+
if (submitSuccessEvent.defaultPrevented)
|
|
3319
|
+
return;
|
|
3320
|
+
if (props.resetFormOnSubmit !== false)
|
|
3321
|
+
formRef.value.reset();
|
|
3322
|
+
}
|
|
3323
|
+
if (props.successUrl) {
|
|
3324
|
+
if (formRef.value) {
|
|
3325
|
+
const event2 = new CustomEvent("route", {
|
|
3326
|
+
detail: {
|
|
3327
|
+
url: props.successUrl
|
|
3328
|
+
}
|
|
3329
|
+
});
|
|
3330
|
+
formRef.value.dispatchEvent(event2);
|
|
3331
|
+
if (!event2.defaultPrevented)
|
|
3332
|
+
location.href = props.successUrl;
|
|
3333
|
+
} else
|
|
3334
|
+
location.href = props.successUrl;
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
}, (err) => {
|
|
3338
|
+
const submitErrorEvent = new CustomEvent("submit:error", {
|
|
3339
|
+
detail: {
|
|
3340
|
+
error: err
|
|
3341
|
+
}
|
|
3342
|
+
});
|
|
3343
|
+
if (formRef.value) {
|
|
3344
|
+
formRef.value.dispatchEvent(submitErrorEvent);
|
|
3345
|
+
if (submitErrorEvent.defaultPrevented)
|
|
3346
|
+
return;
|
|
3347
|
+
}
|
|
3348
|
+
state.responseData = err;
|
|
3349
|
+
state.formState = "error";
|
|
3350
|
+
});
|
|
3351
|
+
}
|
|
3352
|
+
};
|
|
3353
|
+
const FormComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3354
|
+
var _a;
|
|
3355
|
+
qwik._jsxBranch();
|
|
3356
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES, "FormComponent_component_useStylesScoped_SVdPvm0do3s"));
|
|
3357
|
+
const formRef = qwik.useSignal();
|
|
3358
|
+
const state = qwik.useStore({
|
|
3359
|
+
formErrorMessage: "",
|
|
3360
|
+
formState: "unsubmitted",
|
|
3361
|
+
responseData: null
|
|
3362
|
+
});
|
|
3363
|
+
return /* @__PURE__ */ qwik._jsxS("form", {
|
|
3364
|
+
action: (() => {
|
|
3365
|
+
!props.sendWithJs && props.action;
|
|
3366
|
+
})(),
|
|
3367
|
+
ref: formRef,
|
|
3368
|
+
...props.attributes,
|
|
3369
|
+
children: [
|
|
3370
|
+
props.builderBlock && props.builderBlock.children ? (((_a = props.builderBlock) == null ? void 0 : _a.children) || []).map((block, idx) => {
|
|
3371
|
+
return /* @__PURE__ */ qwik._jsxC(Block, {
|
|
3372
|
+
block,
|
|
3373
|
+
get context() {
|
|
3374
|
+
return props.builderContext;
|
|
3375
|
+
},
|
|
3376
|
+
get registeredComponents() {
|
|
3377
|
+
return props.builderComponents;
|
|
3378
|
+
},
|
|
3379
|
+
get linkComponent() {
|
|
3380
|
+
return props.builderLinkComponent;
|
|
3381
|
+
},
|
|
3382
|
+
[qwik._IMMUTABLE]: {
|
|
3383
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3384
|
+
props
|
|
3385
|
+
], "p0.builderContext"),
|
|
3386
|
+
linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
|
|
3387
|
+
props
|
|
3388
|
+
], "p0.builderLinkComponent"),
|
|
3389
|
+
registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
|
|
3390
|
+
props
|
|
3391
|
+
], "p0.builderComponents")
|
|
3392
|
+
}
|
|
3393
|
+
}, 3, `form-block-${idx}`);
|
|
3394
|
+
}) : null,
|
|
3395
|
+
submissionState(props, state) === "error" ? /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
3396
|
+
path: "errorMessage",
|
|
3397
|
+
get blocks() {
|
|
3398
|
+
return props.errorMessage;
|
|
3399
|
+
},
|
|
3400
|
+
get context() {
|
|
3401
|
+
return props.builderContext;
|
|
3402
|
+
},
|
|
3403
|
+
[qwik._IMMUTABLE]: {
|
|
3404
|
+
blocks: qwik._fnSignal((p0) => p0.errorMessage, [
|
|
3405
|
+
props
|
|
3406
|
+
], "p0.errorMessage"),
|
|
3407
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3408
|
+
props
|
|
3409
|
+
], "p0.builderContext"),
|
|
3410
|
+
path: qwik._IMMUTABLE
|
|
3411
|
+
}
|
|
3412
|
+
}, 3, "0n_0") : null,
|
|
3413
|
+
submissionState(props, state) === "sending" ? /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
3414
|
+
path: "sendingMessage",
|
|
3415
|
+
get blocks() {
|
|
3416
|
+
return props.sendingMessage;
|
|
3417
|
+
},
|
|
3418
|
+
get context() {
|
|
3419
|
+
return props.builderContext;
|
|
3420
|
+
},
|
|
3421
|
+
[qwik._IMMUTABLE]: {
|
|
3422
|
+
blocks: qwik._fnSignal((p0) => p0.sendingMessage, [
|
|
3423
|
+
props
|
|
3424
|
+
], "p0.sendingMessage"),
|
|
3425
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3426
|
+
props
|
|
3427
|
+
], "p0.builderContext"),
|
|
3428
|
+
path: qwik._IMMUTABLE
|
|
3429
|
+
}
|
|
3430
|
+
}, 3, "0n_1") : null,
|
|
3431
|
+
submissionState(props, state) === "error" && state.responseData ? /* @__PURE__ */ qwik._jsxQ("pre", null, {
|
|
3432
|
+
class: "builder-form-error-text pre-FormComponent"
|
|
3433
|
+
}, JSON.stringify(state.responseData, null, 2), 1, "0n_2") : null,
|
|
3434
|
+
submissionState(props, state) === "success" ? /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
3435
|
+
path: "successMessage",
|
|
3436
|
+
get blocks() {
|
|
3437
|
+
return props.successMessage;
|
|
3438
|
+
},
|
|
3439
|
+
get context() {
|
|
3440
|
+
return props.builderContext;
|
|
3441
|
+
},
|
|
3442
|
+
[qwik._IMMUTABLE]: {
|
|
3443
|
+
blocks: qwik._fnSignal((p0) => p0.successMessage, [
|
|
3444
|
+
props
|
|
3445
|
+
], "p0.successMessage"),
|
|
3446
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3447
|
+
props
|
|
3448
|
+
], "p0.builderContext"),
|
|
3449
|
+
path: qwik._IMMUTABLE
|
|
3450
|
+
}
|
|
3451
|
+
}, 3, "0n_3") : null
|
|
3452
|
+
],
|
|
3453
|
+
onSubmit$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
3454
|
+
const [formRef2, props2, state2] = qwik.useLexicalScope();
|
|
3455
|
+
return onSubmit(props2, state2, formRef2, event);
|
|
3456
|
+
}, "FormComponent_component_form_onSubmit_F3ZFTlkNAQk", [
|
|
3457
|
+
formRef,
|
|
3458
|
+
props,
|
|
3459
|
+
state
|
|
3460
|
+
])
|
|
3461
|
+
}, {
|
|
3462
|
+
method: qwik._fnSignal((p0) => p0.method, [
|
|
3463
|
+
props
|
|
3464
|
+
], "p0.method"),
|
|
3465
|
+
name: qwik._fnSignal((p0) => p0.name, [
|
|
3466
|
+
props
|
|
3467
|
+
], "p0.name"),
|
|
3468
|
+
validate: qwik._fnSignal((p0) => p0.validate, [
|
|
3469
|
+
props
|
|
3470
|
+
], "p0.validate")
|
|
3471
|
+
}, 0, "0n_4");
|
|
3472
|
+
}, "FormComponent_component_dk5c15Rvsfg"));
|
|
3473
|
+
const STYLES = `
|
|
3474
|
+
.pre-FormComponent {
|
|
3475
|
+
padding: 10px;
|
|
3476
|
+
color: red;
|
|
3477
|
+
text-align: center;
|
|
3478
|
+
}
|
|
3479
|
+
`;
|
|
3480
|
+
const componentInfo$4 = {
|
|
3481
|
+
name: "Form:Input",
|
|
3482
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3483
|
+
inputs: [
|
|
3484
|
+
{
|
|
3485
|
+
name: "type",
|
|
3486
|
+
type: "text",
|
|
3487
|
+
enum: [
|
|
3488
|
+
"text",
|
|
3489
|
+
"number",
|
|
3490
|
+
"email",
|
|
3491
|
+
"url",
|
|
3492
|
+
"checkbox",
|
|
3493
|
+
"radio",
|
|
3494
|
+
"range",
|
|
3495
|
+
"date",
|
|
3496
|
+
"datetime-local",
|
|
3497
|
+
"search",
|
|
3498
|
+
"tel",
|
|
3499
|
+
"time",
|
|
3500
|
+
"file",
|
|
3501
|
+
"month",
|
|
3502
|
+
"week",
|
|
3503
|
+
"password",
|
|
3504
|
+
"color",
|
|
3505
|
+
"hidden"
|
|
3506
|
+
],
|
|
3507
|
+
defaultValue: "text"
|
|
3508
|
+
},
|
|
3509
|
+
{
|
|
3510
|
+
name: "name",
|
|
3511
|
+
type: "string",
|
|
3512
|
+
required: true,
|
|
3513
|
+
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
3514
|
+
},
|
|
3515
|
+
{
|
|
3516
|
+
name: "placeholder",
|
|
3517
|
+
type: "string",
|
|
3518
|
+
defaultValue: "Hello there",
|
|
3519
|
+
helperText: "Text to display when there is no value"
|
|
3520
|
+
},
|
|
3521
|
+
// TODO: handle value vs default value automatically like ng-model
|
|
3522
|
+
{
|
|
3523
|
+
name: "defaultValue",
|
|
3524
|
+
type: "string"
|
|
3525
|
+
},
|
|
3526
|
+
{
|
|
3527
|
+
name: "value",
|
|
3528
|
+
type: "string",
|
|
3529
|
+
advanced: true
|
|
3530
|
+
},
|
|
3531
|
+
{
|
|
3532
|
+
name: "required",
|
|
3533
|
+
type: "boolean",
|
|
3534
|
+
helperText: "Is this input required to be filled out to submit a form",
|
|
3535
|
+
defaultValue: false
|
|
3536
|
+
}
|
|
3537
|
+
],
|
|
3538
|
+
noWrap: true,
|
|
3539
|
+
static: true,
|
|
3540
|
+
defaultStyles: {
|
|
3541
|
+
paddingTop: "10px",
|
|
3542
|
+
paddingBottom: "10px",
|
|
3543
|
+
paddingLeft: "10px",
|
|
3544
|
+
paddingRight: "10px",
|
|
3545
|
+
borderRadius: "3px",
|
|
3546
|
+
borderWidth: "1px",
|
|
3547
|
+
borderStyle: "solid",
|
|
3548
|
+
borderColor: "#ccc"
|
|
3549
|
+
}
|
|
3550
|
+
};
|
|
3551
|
+
const FormInputComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3552
|
+
return /* @__PURE__ */ qwik.createElement("input", {
|
|
3553
|
+
...props.attributes,
|
|
3554
|
+
key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
|
|
3555
|
+
placeholder: props.placeholder,
|
|
3556
|
+
type: props.type,
|
|
3557
|
+
name: props.name,
|
|
3558
|
+
value: props.value,
|
|
3559
|
+
defaultValue: props.defaultValue,
|
|
3560
|
+
required: props.required
|
|
3561
|
+
});
|
|
3562
|
+
}, "FormInputComponent_component_AUUjdN0ueMs"));
|
|
3563
|
+
const componentInfo$3 = {
|
|
3564
|
+
name: "Form:Select",
|
|
3565
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3566
|
+
defaultStyles: {
|
|
3567
|
+
alignSelf: "flex-start"
|
|
3568
|
+
},
|
|
3569
|
+
inputs: [
|
|
3570
|
+
{
|
|
3571
|
+
name: "options",
|
|
3572
|
+
type: "list",
|
|
3573
|
+
required: true,
|
|
3574
|
+
subFields: [
|
|
3575
|
+
{
|
|
3576
|
+
name: "value",
|
|
3577
|
+
type: "text",
|
|
3578
|
+
required: true
|
|
3579
|
+
},
|
|
3580
|
+
{
|
|
3581
|
+
name: "name",
|
|
3582
|
+
type: "text"
|
|
3583
|
+
}
|
|
3584
|
+
],
|
|
3585
|
+
defaultValue: [
|
|
3586
|
+
{
|
|
3587
|
+
value: "option 1"
|
|
3588
|
+
},
|
|
3589
|
+
{
|
|
3590
|
+
value: "option 2"
|
|
3591
|
+
}
|
|
3592
|
+
]
|
|
3593
|
+
},
|
|
3594
|
+
{
|
|
3595
|
+
name: "name",
|
|
3596
|
+
type: "string",
|
|
3597
|
+
required: true,
|
|
3598
|
+
helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
|
|
3599
|
+
},
|
|
3600
|
+
{
|
|
3601
|
+
name: "defaultValue",
|
|
3602
|
+
type: "string"
|
|
3603
|
+
},
|
|
3604
|
+
{
|
|
3605
|
+
name: "value",
|
|
3606
|
+
type: "string",
|
|
3607
|
+
advanced: true
|
|
3608
|
+
},
|
|
3609
|
+
{
|
|
3610
|
+
name: "required",
|
|
3611
|
+
type: "boolean",
|
|
3612
|
+
defaultValue: false
|
|
3613
|
+
}
|
|
3614
|
+
],
|
|
3615
|
+
static: true,
|
|
3616
|
+
noWrap: true
|
|
3617
|
+
};
|
|
3618
|
+
const SelectComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3619
|
+
return /* @__PURE__ */ qwik.createElement("select", {
|
|
3620
|
+
...props.attributes,
|
|
3621
|
+
value: props.value,
|
|
3622
|
+
key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
|
|
3623
|
+
defaultValue: props.defaultValue,
|
|
3624
|
+
name: props.name
|
|
3625
|
+
}, (props.options || []).map((option) => {
|
|
3626
|
+
return /* @__PURE__ */ qwik._jsxQ("option", {
|
|
3627
|
+
value: qwik._wrapSignal(option, "value")
|
|
3628
|
+
}, null, option.name || option.value, 1, "tc_0");
|
|
3629
|
+
}));
|
|
3630
|
+
}, "SelectComponent_component_SPKbsFLikZU"));
|
|
3631
|
+
const componentInfo$2 = {
|
|
3632
|
+
name: "Form:SubmitButton",
|
|
3633
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3634
|
+
defaultStyles: {
|
|
3635
|
+
appearance: "none",
|
|
3636
|
+
paddingTop: "15px",
|
|
3637
|
+
paddingBottom: "15px",
|
|
3638
|
+
paddingLeft: "25px",
|
|
3639
|
+
paddingRight: "25px",
|
|
3640
|
+
backgroundColor: "#3898EC",
|
|
3641
|
+
color: "white",
|
|
3642
|
+
borderRadius: "4px",
|
|
3643
|
+
cursor: "pointer"
|
|
3644
|
+
},
|
|
3645
|
+
inputs: [
|
|
3646
|
+
{
|
|
3647
|
+
name: "text",
|
|
3648
|
+
type: "text",
|
|
3649
|
+
defaultValue: "Click me"
|
|
3650
|
+
}
|
|
3651
|
+
],
|
|
3652
|
+
static: true,
|
|
3653
|
+
noWrap: true
|
|
3654
|
+
};
|
|
3655
|
+
const SubmitButton = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3656
|
+
return /* @__PURE__ */ qwik._jsxS("button", {
|
|
3657
|
+
...props.attributes,
|
|
3658
|
+
children: qwik._fnSignal((p0) => p0.text, [
|
|
3659
|
+
props
|
|
3660
|
+
], "p0.text")
|
|
3661
|
+
}, {
|
|
3662
|
+
type: "submit"
|
|
3663
|
+
}, 0, "6z_0");
|
|
3664
|
+
}, "SubmitButton_component_NXvMBMCDhwc"));
|
|
3665
|
+
const componentInfo$1 = {
|
|
3666
|
+
// friendlyName?
|
|
3667
|
+
name: "Raw:Img",
|
|
3668
|
+
hideFromInsertMenu: true,
|
|
3669
|
+
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",
|
|
3670
|
+
inputs: [
|
|
3671
|
+
{
|
|
3672
|
+
name: "image",
|
|
3673
|
+
bubble: true,
|
|
3674
|
+
type: "file",
|
|
3675
|
+
allowedFileTypes: [
|
|
3676
|
+
"jpeg",
|
|
3677
|
+
"jpg",
|
|
3678
|
+
"png",
|
|
3679
|
+
"svg",
|
|
3680
|
+
"gif",
|
|
3681
|
+
"webp"
|
|
3682
|
+
],
|
|
3683
|
+
required: true
|
|
3684
|
+
}
|
|
3685
|
+
],
|
|
3686
|
+
noWrap: true,
|
|
3687
|
+
static: true
|
|
3688
|
+
};
|
|
3689
|
+
const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3690
|
+
return /* @__PURE__ */ qwik._jsxS("img", {
|
|
3691
|
+
...props.attributes
|
|
3692
|
+
}, {
|
|
3693
|
+
alt: qwik._fnSignal((p0) => p0.altText, [
|
|
3694
|
+
props
|
|
3695
|
+
], "p0.altText"),
|
|
3696
|
+
src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
|
|
3697
|
+
props
|
|
3698
|
+
], "p0.imgSrc||p0.image"),
|
|
3699
|
+
style: qwik._fnSignal((p0) => ({
|
|
3700
|
+
objectFit: p0.backgroundSize || "cover",
|
|
3701
|
+
objectPosition: p0.backgroundPosition || "center"
|
|
3702
|
+
}), [
|
|
3703
|
+
props
|
|
3704
|
+
], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
|
|
3705
|
+
}, 0, isEditing() && props.imgSrc || "default-key");
|
|
3706
|
+
}, "ImgComponent_component_FXvIDBSffO8"));
|
|
3707
|
+
const componentInfo = {
|
|
3708
|
+
name: "Video",
|
|
3709
|
+
canHaveChildren: true,
|
|
3710
|
+
defaultStyles: {
|
|
3711
|
+
minHeight: "20px",
|
|
3712
|
+
minWidth: "20px"
|
|
3713
|
+
},
|
|
3714
|
+
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
|
|
3715
|
+
inputs: [
|
|
3716
|
+
{
|
|
3717
|
+
name: "video",
|
|
3718
|
+
type: "file",
|
|
3719
|
+
allowedFileTypes: [
|
|
3720
|
+
"mp4"
|
|
3721
|
+
],
|
|
3722
|
+
bubble: true,
|
|
3723
|
+
defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
|
|
3724
|
+
required: true
|
|
3725
|
+
},
|
|
3726
|
+
{
|
|
3727
|
+
name: "posterImage",
|
|
2963
3728
|
type: "file",
|
|
2964
3729
|
allowedFileTypes: [
|
|
2965
3730
|
"jpeg",
|
|
@@ -3165,55 +3930,76 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
3165
3930
|
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_4"), 1, "j7_5") : null
|
|
3166
3931
|
], 1, "j7_6");
|
|
3167
3932
|
}, "Video_component_qdcTZflYyoQ"));
|
|
3168
|
-
const
|
|
3933
|
+
const getExtraComponents = () => [
|
|
3169
3934
|
{
|
|
3170
|
-
component:
|
|
3171
|
-
...componentInfo$
|
|
3935
|
+
component: CustomCode,
|
|
3936
|
+
...componentInfo$7
|
|
3172
3937
|
},
|
|
3173
3938
|
{
|
|
3174
|
-
component:
|
|
3175
|
-
...componentInfo$
|
|
3939
|
+
component: Embed,
|
|
3940
|
+
...componentInfo$6
|
|
3176
3941
|
},
|
|
3942
|
+
...[
|
|
3943
|
+
{
|
|
3944
|
+
component: FormComponent,
|
|
3945
|
+
...componentInfo$5
|
|
3946
|
+
},
|
|
3947
|
+
{
|
|
3948
|
+
component: FormInputComponent,
|
|
3949
|
+
...componentInfo$4
|
|
3950
|
+
},
|
|
3951
|
+
{
|
|
3952
|
+
component: SubmitButton,
|
|
3953
|
+
...componentInfo$2
|
|
3954
|
+
},
|
|
3955
|
+
{
|
|
3956
|
+
component: SelectComponent,
|
|
3957
|
+
...componentInfo$3
|
|
3958
|
+
}
|
|
3959
|
+
],
|
|
3177
3960
|
{
|
|
3178
|
-
component:
|
|
3179
|
-
...componentInfo$
|
|
3961
|
+
component: ImgComponent,
|
|
3962
|
+
...componentInfo$1
|
|
3180
3963
|
},
|
|
3181
3964
|
{
|
|
3182
|
-
component:
|
|
3183
|
-
...componentInfo
|
|
3965
|
+
component: Video,
|
|
3966
|
+
...componentInfo
|
|
3967
|
+
}
|
|
3968
|
+
];
|
|
3969
|
+
const getDefaultRegisteredComponents = () => [
|
|
3970
|
+
{
|
|
3971
|
+
component: Button,
|
|
3972
|
+
...componentInfo$f
|
|
3973
|
+
},
|
|
3974
|
+
{
|
|
3975
|
+
component: Columns,
|
|
3976
|
+
...componentInfo$e
|
|
3184
3977
|
},
|
|
3185
3978
|
{
|
|
3186
3979
|
component: FragmentComponent,
|
|
3187
|
-
...componentInfo$
|
|
3980
|
+
...componentInfo$d
|
|
3188
3981
|
},
|
|
3189
3982
|
{
|
|
3190
3983
|
component: Image,
|
|
3191
|
-
...componentInfo$
|
|
3984
|
+
...componentInfo$c
|
|
3192
3985
|
},
|
|
3193
3986
|
{
|
|
3194
|
-
component:
|
|
3195
|
-
...componentInfo$
|
|
3987
|
+
component: SectionComponent,
|
|
3988
|
+
...componentInfo$b
|
|
3196
3989
|
},
|
|
3197
3990
|
{
|
|
3198
|
-
component:
|
|
3199
|
-
...componentInfo$
|
|
3991
|
+
component: Slot,
|
|
3992
|
+
...componentInfo$a
|
|
3200
3993
|
},
|
|
3201
3994
|
{
|
|
3202
3995
|
component: Symbol$1,
|
|
3203
|
-
...componentInfo$
|
|
3996
|
+
...componentInfo$9
|
|
3204
3997
|
},
|
|
3205
3998
|
{
|
|
3206
3999
|
component: Text,
|
|
3207
|
-
...componentInfo$
|
|
3208
|
-
},
|
|
3209
|
-
{
|
|
3210
|
-
component: Video,
|
|
3211
|
-
...componentInfo
|
|
4000
|
+
...componentInfo$8
|
|
3212
4001
|
},
|
|
3213
|
-
|
|
3214
|
-
component: Slot,
|
|
3215
|
-
...componentInfo$3
|
|
3216
|
-
}
|
|
4002
|
+
...getExtraComponents()
|
|
3217
4003
|
];
|
|
3218
4004
|
const components = [];
|
|
3219
4005
|
const createRegisterComponentMessage = (info) => ({
|
|
@@ -3662,7 +4448,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
3662
4448
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
3663
4449
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
3664
4450
|
}
|
|
3665
|
-
const SDK_VERSION = "0.13.
|
|
4451
|
+
const SDK_VERSION = "0.13.2";
|
|
3666
4452
|
const registry = {};
|
|
3667
4453
|
function register(type, info) {
|
|
3668
4454
|
let typeList = registry[type];
|
|
@@ -3845,7 +4631,7 @@ const subscribeToEditor = (model, callback, options) => {
|
|
|
3845
4631
|
window.removeEventListener("message", listener);
|
|
3846
4632
|
};
|
|
3847
4633
|
};
|
|
3848
|
-
const mergeNewRootState = function
|
|
4634
|
+
const mergeNewRootState = function mergeNewRootState22(props, state, elementRef, newData) {
|
|
3849
4635
|
var _a, _b;
|
|
3850
4636
|
const combinedState = {
|
|
3851
4637
|
...props.builderContextSignal.rootState,
|