@builder.io/sdk-qwik 0.13.1 → 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/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
|
@@ -1026,7 +1026,7 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1026
1026
|
repeatItem
|
|
1027
1027
|
]));
|
|
1028
1028
|
const componentRefProps = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1029
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1029
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1030
1030
|
const [blockComponent2, processedBlock2, props2, state2] = qwik.useLexicalScope();
|
|
1031
1031
|
return {
|
|
1032
1032
|
blockChildren: processedBlock2.value.children ?? [],
|
|
@@ -1034,10 +1034,10 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1034
1034
|
componentOptions: {
|
|
1035
1035
|
...getBlockComponentOptions(processedBlock2.value),
|
|
1036
1036
|
builderContext: props2.context,
|
|
1037
|
-
...((_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" ? {
|
|
1037
|
+
...((_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" ? {
|
|
1038
1038
|
builderLinkComponent: props2.linkComponent
|
|
1039
1039
|
} : {},
|
|
1040
|
-
...((
|
|
1040
|
+
...((_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" ? {
|
|
1041
1041
|
builderComponents: props2.registeredComponents
|
|
1042
1042
|
} : {}
|
|
1043
1043
|
},
|
|
@@ -1045,8 +1045,8 @@ const Block = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1045
1045
|
linkComponent: props2.linkComponent,
|
|
1046
1046
|
registeredComponents: props2.registeredComponents,
|
|
1047
1047
|
builderBlock: processedBlock2.value,
|
|
1048
|
-
includeBlockProps: ((
|
|
1049
|
-
isInteractive: !((
|
|
1048
|
+
includeBlockProps: ((_i = blockComponent2.value) == null ? void 0 : _i.noWrap) === true,
|
|
1049
|
+
isInteractive: !((_j = blockComponent2.value) == null ? void 0 : _j.isRSC)
|
|
1050
1050
|
};
|
|
1051
1051
|
}, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
|
|
1052
1052
|
blockComponent,
|
|
@@ -1307,7 +1307,7 @@ const onMouseEnter = function onMouseEnter2(props, state) {
|
|
|
1307
1307
|
}, "*");
|
|
1308
1308
|
};
|
|
1309
1309
|
const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1310
|
-
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$
|
|
1310
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$3, "BlocksWrapper_component_useStylesScoped_Kj0S9AOXQ0o"));
|
|
1311
1311
|
const className = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1312
1312
|
var _a;
|
|
1313
1313
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -1368,7 +1368,7 @@ const BlocksWrapper = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inl
|
|
|
1368
1368
|
}
|
|
1369
1369
|
}, 0, "3u_1");
|
|
1370
1370
|
}, "BlocksWrapper_component_45hR0o6abzg"));
|
|
1371
|
-
const STYLES$
|
|
1371
|
+
const STYLES$3 = `
|
|
1372
1372
|
.props-blocks-wrapper-BlocksWrapper {
|
|
1373
1373
|
display: flex;
|
|
1374
1374
|
flex-direction: column;
|
|
@@ -1518,7 +1518,7 @@ const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQr
|
|
|
1518
1518
|
gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
|
|
1519
1519
|
stackAt: props.stackColumnsAt || "tablet"
|
|
1520
1520
|
});
|
|
1521
|
-
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$
|
|
1521
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
|
|
1522
1522
|
const columnsCssVars = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1523
1523
|
const [props2, state2] = qwik.useLexicalScope();
|
|
1524
1524
|
return {
|
|
@@ -1635,7 +1635,7 @@ const Columns = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQr
|
|
|
1635
1635
|
})
|
|
1636
1636
|
], 1, "c0_2");
|
|
1637
1637
|
}, "Columns_component_7yLj4bxdI6c"));
|
|
1638
|
-
const STYLES$
|
|
1638
|
+
const STYLES$2 = `
|
|
1639
1639
|
.div-Columns {
|
|
1640
1640
|
display: flex;
|
|
1641
1641
|
line-height: normal;
|
|
@@ -1701,7 +1701,7 @@ function getSrcSet(url) {
|
|
|
1701
1701
|
const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1702
1702
|
var _a, _b, _c, _d;
|
|
1703
1703
|
qwik._jsxBranch();
|
|
1704
|
-
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES, "Image_component_useStylesScoped_fBMYiVf9fuU"));
|
|
1704
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES$1, "Image_component_useStylesScoped_fBMYiVf9fuU"));
|
|
1705
1705
|
const srcSetToUse = qwik.useComputedQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
1706
1706
|
var _a2;
|
|
1707
1707
|
const [props2] = qwik.useLexicalScope();
|
|
@@ -1801,7 +1801,7 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
1801
1801
|
]
|
|
1802
1802
|
}, 1, "0A_5");
|
|
1803
1803
|
}, "Image_component_LRxDkFa1EfU"));
|
|
1804
|
-
const STYLES = `
|
|
1804
|
+
const STYLES$1 = `
|
|
1805
1805
|
.img-Image {
|
|
1806
1806
|
opacity: 1;
|
|
1807
1807
|
transition: opacity 0.2s ease-in-out;
|
|
@@ -2014,7 +2014,7 @@ const handleABTesting = async ({ item, canTrack }) => {
|
|
|
2014
2014
|
};
|
|
2015
2015
|
};
|
|
2016
2016
|
const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
|
|
2017
|
-
const componentInfo$
|
|
2017
|
+
const componentInfo$f = {
|
|
2018
2018
|
name: "Core:Button",
|
|
2019
2019
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
2020
2020
|
defaultStyles: {
|
|
@@ -2052,7 +2052,7 @@ const componentInfo$b = {
|
|
|
2052
2052
|
static: true,
|
|
2053
2053
|
noWrap: true
|
|
2054
2054
|
};
|
|
2055
|
-
const componentInfo$
|
|
2055
|
+
const componentInfo$e = {
|
|
2056
2056
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
2057
2057
|
name: "Columns",
|
|
2058
2058
|
isRSC: true,
|
|
@@ -2294,186 +2294,14 @@ const componentInfo$a = {
|
|
|
2294
2294
|
}
|
|
2295
2295
|
]
|
|
2296
2296
|
};
|
|
2297
|
-
const componentInfo$
|
|
2298
|
-
name: "Custom Code",
|
|
2299
|
-
static: true,
|
|
2300
|
-
requiredPermissions: [
|
|
2301
|
-
"editCode"
|
|
2302
|
-
],
|
|
2303
|
-
inputs: [
|
|
2304
|
-
{
|
|
2305
|
-
name: "code",
|
|
2306
|
-
type: "html",
|
|
2307
|
-
required: true,
|
|
2308
|
-
defaultValue: "<p>Hello there, I am custom HTML code!</p>",
|
|
2309
|
-
code: true
|
|
2310
|
-
},
|
|
2311
|
-
{
|
|
2312
|
-
name: "replaceNodes",
|
|
2313
|
-
type: "boolean",
|
|
2314
|
-
helperText: "Preserve server rendered dom nodes",
|
|
2315
|
-
advanced: true
|
|
2316
|
-
},
|
|
2317
|
-
{
|
|
2318
|
-
name: "scriptsClientOnly",
|
|
2319
|
-
type: "boolean",
|
|
2320
|
-
defaultValue: false,
|
|
2321
|
-
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
2322
|
-
advanced: true
|
|
2323
|
-
}
|
|
2324
|
-
]
|
|
2325
|
-
};
|
|
2326
|
-
const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2327
|
-
const elementRef = qwik.useSignal();
|
|
2328
|
-
const state = qwik.useStore({
|
|
2329
|
-
scriptsInserted: [],
|
|
2330
|
-
scriptsRun: []
|
|
2331
|
-
});
|
|
2332
|
-
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
2333
|
-
const [state2] = qwik.useLexicalScope();
|
|
2334
|
-
if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
|
|
2335
|
-
return;
|
|
2336
|
-
const scripts = element.getElementsByTagName("script");
|
|
2337
|
-
for (let i = 0; i < scripts.length; i++) {
|
|
2338
|
-
const script = scripts[i];
|
|
2339
|
-
if (script.src) {
|
|
2340
|
-
if (state2.scriptsInserted.includes(script.src))
|
|
2341
|
-
continue;
|
|
2342
|
-
state2.scriptsInserted.push(script.src);
|
|
2343
|
-
const newScript = document.createElement("script");
|
|
2344
|
-
newScript.async = true;
|
|
2345
|
-
newScript.src = script.src;
|
|
2346
|
-
document.head.appendChild(newScript);
|
|
2347
|
-
} else if (!script.type || [
|
|
2348
|
-
"text/javascript",
|
|
2349
|
-
"application/javascript",
|
|
2350
|
-
"application/ecmascript"
|
|
2351
|
-
].includes(script.type)) {
|
|
2352
|
-
if (state2.scriptsRun.includes(script.innerText))
|
|
2353
|
-
continue;
|
|
2354
|
-
try {
|
|
2355
|
-
state2.scriptsRun.push(script.innerText);
|
|
2356
|
-
new Function(script.innerText)();
|
|
2357
|
-
} catch (error) {
|
|
2358
|
-
console.warn("`CustomCode`: Error running script:", error);
|
|
2359
|
-
}
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
}, "CustomCode_component_useOn_zjAgBhFOiCs", [
|
|
2363
|
-
state
|
|
2364
|
-
]));
|
|
2365
|
-
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
2366
|
-
ref: elementRef
|
|
2367
|
-
}, {
|
|
2368
|
-
class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
|
|
2369
|
-
props
|
|
2370
|
-
], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
|
|
2371
|
-
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.code, [
|
|
2372
|
-
props
|
|
2373
|
-
], "p0.code")
|
|
2374
|
-
}, null, 3, "bY_0");
|
|
2375
|
-
}, "CustomCode_component_uYOSy7w7Zqw"));
|
|
2376
|
-
const componentInfo$8 = {
|
|
2377
|
-
name: "Embed",
|
|
2378
|
-
static: true,
|
|
2379
|
-
inputs: [
|
|
2380
|
-
{
|
|
2381
|
-
name: "url",
|
|
2382
|
-
type: "url",
|
|
2383
|
-
required: true,
|
|
2384
|
-
defaultValue: "",
|
|
2385
|
-
helperText: "e.g. enter a youtube url, google map, etc",
|
|
2386
|
-
onChange: (options) => {
|
|
2387
|
-
const url = options.get("url");
|
|
2388
|
-
if (url) {
|
|
2389
|
-
options.set("content", "Loading...");
|
|
2390
|
-
const apiKey = "ae0e60e78201a3f2b0de4b";
|
|
2391
|
-
return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
|
|
2392
|
-
if (options.get("url") === url) {
|
|
2393
|
-
if (data.html)
|
|
2394
|
-
options.set("content", data.html);
|
|
2395
|
-
else
|
|
2396
|
-
options.set("content", "Invalid url, please try another");
|
|
2397
|
-
}
|
|
2398
|
-
}).catch((_err) => {
|
|
2399
|
-
options.set("content", "There was an error embedding this URL, please try again or another URL");
|
|
2400
|
-
});
|
|
2401
|
-
} else
|
|
2402
|
-
options.delete("content");
|
|
2403
|
-
}
|
|
2404
|
-
},
|
|
2405
|
-
{
|
|
2406
|
-
name: "content",
|
|
2407
|
-
type: "html",
|
|
2408
|
-
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
2409
|
-
hideFromUI: true
|
|
2410
|
-
}
|
|
2411
|
-
]
|
|
2412
|
-
};
|
|
2413
|
-
const SCRIPT_MIME_TYPES = [
|
|
2414
|
-
"text/javascript",
|
|
2415
|
-
"application/javascript",
|
|
2416
|
-
"application/ecmascript"
|
|
2417
|
-
];
|
|
2418
|
-
const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2419
|
-
const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
|
|
2420
|
-
if (!elem.value || !elem.value.getElementsByTagName)
|
|
2421
|
-
return;
|
|
2422
|
-
const scripts = elem.value.getElementsByTagName("script");
|
|
2423
|
-
for (let i = 0; i < scripts.length; i++) {
|
|
2424
|
-
const script = scripts[i];
|
|
2425
|
-
if (script.src && !state.scriptsInserted.includes(script.src)) {
|
|
2426
|
-
state.scriptsInserted.push(script.src);
|
|
2427
|
-
const newScript = document.createElement("script");
|
|
2428
|
-
newScript.async = true;
|
|
2429
|
-
newScript.src = script.src;
|
|
2430
|
-
document.head.appendChild(newScript);
|
|
2431
|
-
} else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
|
|
2432
|
-
try {
|
|
2433
|
-
state.scriptsRun.push(script.innerText);
|
|
2434
|
-
new Function(script.innerText)();
|
|
2435
|
-
} catch (error) {
|
|
2436
|
-
console.warn("`Embed`: Error running script:", error);
|
|
2437
|
-
}
|
|
2438
|
-
}
|
|
2439
|
-
};
|
|
2440
|
-
const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2441
|
-
const elem = qwik.useSignal();
|
|
2442
|
-
const state = qwik.useStore({
|
|
2443
|
-
ranInitFn: false,
|
|
2444
|
-
scriptsInserted: [],
|
|
2445
|
-
scriptsRun: []
|
|
2446
|
-
});
|
|
2447
|
-
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
2448
|
-
const [elem2, props2, state2] = qwik.useLexicalScope();
|
|
2449
|
-
track2(() => elem2.value);
|
|
2450
|
-
track2(() => state2.ranInitFn);
|
|
2451
|
-
if (elem2.value && !state2.ranInitFn) {
|
|
2452
|
-
state2.ranInitFn = true;
|
|
2453
|
-
findAndRunScripts(props2, state2, elem2);
|
|
2454
|
-
}
|
|
2455
|
-
}, "Embed_component_useTask_bg7ez0XUtiM", [
|
|
2456
|
-
elem,
|
|
2457
|
-
props,
|
|
2458
|
-
state
|
|
2459
|
-
]));
|
|
2460
|
-
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
2461
|
-
ref: elem
|
|
2462
|
-
}, {
|
|
2463
|
-
class: "builder-embed",
|
|
2464
|
-
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.content, [
|
|
2465
|
-
props
|
|
2466
|
-
], "p0.content")
|
|
2467
|
-
}, null, 3, "9r_0");
|
|
2468
|
-
}, "Embed_component_Uji08ORjXbE"));
|
|
2469
|
-
const componentInfo$7 = {
|
|
2297
|
+
const componentInfo$d = {
|
|
2470
2298
|
name: "Fragment",
|
|
2471
2299
|
static: true,
|
|
2472
2300
|
hidden: true,
|
|
2473
2301
|
canHaveChildren: true,
|
|
2474
2302
|
noWrap: true
|
|
2475
2303
|
};
|
|
2476
|
-
const componentInfo$
|
|
2304
|
+
const componentInfo$c = {
|
|
2477
2305
|
name: "Image",
|
|
2478
2306
|
static: true,
|
|
2479
2307
|
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",
|
|
@@ -2621,49 +2449,7 @@ const componentInfo$6 = {
|
|
|
2621
2449
|
}
|
|
2622
2450
|
]
|
|
2623
2451
|
};
|
|
2624
|
-
const componentInfo$
|
|
2625
|
-
// friendlyName?
|
|
2626
|
-
name: "Raw:Img",
|
|
2627
|
-
hideFromInsertMenu: true,
|
|
2628
|
-
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",
|
|
2629
|
-
inputs: [
|
|
2630
|
-
{
|
|
2631
|
-
name: "image",
|
|
2632
|
-
bubble: true,
|
|
2633
|
-
type: "file",
|
|
2634
|
-
allowedFileTypes: [
|
|
2635
|
-
"jpeg",
|
|
2636
|
-
"jpg",
|
|
2637
|
-
"png",
|
|
2638
|
-
"svg",
|
|
2639
|
-
"gif",
|
|
2640
|
-
"webp"
|
|
2641
|
-
],
|
|
2642
|
-
required: true
|
|
2643
|
-
}
|
|
2644
|
-
],
|
|
2645
|
-
noWrap: true,
|
|
2646
|
-
static: true
|
|
2647
|
-
};
|
|
2648
|
-
const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2649
|
-
return /* @__PURE__ */ qwik._jsxS("img", {
|
|
2650
|
-
...props.attributes
|
|
2651
|
-
}, {
|
|
2652
|
-
alt: qwik._fnSignal((p0) => p0.altText, [
|
|
2653
|
-
props
|
|
2654
|
-
], "p0.altText"),
|
|
2655
|
-
src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
|
|
2656
|
-
props
|
|
2657
|
-
], "p0.imgSrc||p0.image"),
|
|
2658
|
-
style: qwik._fnSignal((p0) => ({
|
|
2659
|
-
objectFit: p0.backgroundSize || "cover",
|
|
2660
|
-
objectPosition: p0.backgroundPosition || "center"
|
|
2661
|
-
}), [
|
|
2662
|
-
props
|
|
2663
|
-
], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
|
|
2664
|
-
}, 0, isEditing() && props.imgSrc || "default-key");
|
|
2665
|
-
}, "ImgComponent_component_FXvIDBSffO8"));
|
|
2666
|
-
const componentInfo$4 = {
|
|
2452
|
+
const componentInfo$b = {
|
|
2667
2453
|
name: "Core:Section",
|
|
2668
2454
|
static: true,
|
|
2669
2455
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -2708,7 +2494,7 @@ const componentInfo$4 = {
|
|
|
2708
2494
|
}
|
|
2709
2495
|
]
|
|
2710
2496
|
};
|
|
2711
|
-
const componentInfo$
|
|
2497
|
+
const componentInfo$a = {
|
|
2712
2498
|
name: "Slot",
|
|
2713
2499
|
isRSC: true,
|
|
2714
2500
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -2763,7 +2549,7 @@ const Slot = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2763
2549
|
}
|
|
2764
2550
|
}, 0, "B1_1");
|
|
2765
2551
|
}, "Slot_component_WWgWgfV0bb0"));
|
|
2766
|
-
const componentInfo$
|
|
2552
|
+
const componentInfo$9 = {
|
|
2767
2553
|
name: "Symbol",
|
|
2768
2554
|
noWrap: true,
|
|
2769
2555
|
static: true,
|
|
@@ -2803,7 +2589,7 @@ const componentInfo$2 = {
|
|
|
2803
2589
|
}
|
|
2804
2590
|
]
|
|
2805
2591
|
};
|
|
2806
|
-
const componentInfo$
|
|
2592
|
+
const componentInfo$8 = {
|
|
2807
2593
|
name: "Text",
|
|
2808
2594
|
static: true,
|
|
2809
2595
|
isRSC: true,
|
|
@@ -2838,27 +2624,1006 @@ const Text = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((
|
|
|
2838
2624
|
}
|
|
2839
2625
|
}, null, 3, "yO_0");
|
|
2840
2626
|
}, "Text_component_15p0cKUxgIE"));
|
|
2841
|
-
const componentInfo = {
|
|
2842
|
-
name: "
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
},
|
|
2848
|
-
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",
|
|
2627
|
+
const componentInfo$7 = {
|
|
2628
|
+
name: "Custom Code",
|
|
2629
|
+
static: true,
|
|
2630
|
+
requiredPermissions: [
|
|
2631
|
+
"editCode"
|
|
2632
|
+
],
|
|
2849
2633
|
inputs: [
|
|
2850
2634
|
{
|
|
2851
|
-
name: "
|
|
2852
|
-
type: "
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2635
|
+
name: "code",
|
|
2636
|
+
type: "html",
|
|
2637
|
+
required: true,
|
|
2638
|
+
defaultValue: "<p>Hello there, I am custom HTML code!</p>",
|
|
2639
|
+
code: true
|
|
2640
|
+
},
|
|
2641
|
+
{
|
|
2642
|
+
name: "replaceNodes",
|
|
2643
|
+
type: "boolean",
|
|
2644
|
+
helperText: "Preserve server rendered dom nodes",
|
|
2645
|
+
advanced: true
|
|
2646
|
+
},
|
|
2647
|
+
{
|
|
2648
|
+
name: "scriptsClientOnly",
|
|
2649
|
+
type: "boolean",
|
|
2650
|
+
defaultValue: false,
|
|
2651
|
+
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
2652
|
+
advanced: true
|
|
2653
|
+
}
|
|
2654
|
+
]
|
|
2655
|
+
};
|
|
2656
|
+
const CustomCode = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2657
|
+
const elementRef = qwik.useSignal();
|
|
2658
|
+
const state = qwik.useStore({
|
|
2659
|
+
scriptsInserted: [],
|
|
2660
|
+
scriptsRun: []
|
|
2661
|
+
});
|
|
2662
|
+
qwik.useOn("qvisible", /* @__PURE__ */ qwik.inlinedQrl((event, element) => {
|
|
2663
|
+
const [state2] = qwik.useLexicalScope();
|
|
2664
|
+
if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
|
|
2665
|
+
return;
|
|
2666
|
+
const scripts = element.getElementsByTagName("script");
|
|
2667
|
+
for (let i = 0; i < scripts.length; i++) {
|
|
2668
|
+
const script = scripts[i];
|
|
2669
|
+
if (script.src) {
|
|
2670
|
+
if (state2.scriptsInserted.includes(script.src))
|
|
2671
|
+
continue;
|
|
2672
|
+
state2.scriptsInserted.push(script.src);
|
|
2673
|
+
const newScript = document.createElement("script");
|
|
2674
|
+
newScript.async = true;
|
|
2675
|
+
newScript.src = script.src;
|
|
2676
|
+
document.head.appendChild(newScript);
|
|
2677
|
+
} else if (!script.type || [
|
|
2678
|
+
"text/javascript",
|
|
2679
|
+
"application/javascript",
|
|
2680
|
+
"application/ecmascript"
|
|
2681
|
+
].includes(script.type)) {
|
|
2682
|
+
if (state2.scriptsRun.includes(script.innerText))
|
|
2683
|
+
continue;
|
|
2684
|
+
try {
|
|
2685
|
+
state2.scriptsRun.push(script.innerText);
|
|
2686
|
+
new Function(script.innerText)();
|
|
2687
|
+
} catch (error) {
|
|
2688
|
+
console.warn("`CustomCode`: Error running script:", error);
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
}, "CustomCode_component_useOn_zjAgBhFOiCs", [
|
|
2693
|
+
state
|
|
2694
|
+
]));
|
|
2695
|
+
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
2696
|
+
ref: elementRef
|
|
2697
|
+
}, {
|
|
2698
|
+
class: qwik._fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
|
|
2699
|
+
props
|
|
2700
|
+
], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
|
|
2701
|
+
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.code, [
|
|
2702
|
+
props
|
|
2703
|
+
], "p0.code")
|
|
2704
|
+
}, null, 3, "bY_0");
|
|
2705
|
+
}, "CustomCode_component_uYOSy7w7Zqw"));
|
|
2706
|
+
const componentInfo$6 = {
|
|
2707
|
+
name: "Embed",
|
|
2708
|
+
static: true,
|
|
2709
|
+
inputs: [
|
|
2710
|
+
{
|
|
2711
|
+
name: "url",
|
|
2712
|
+
type: "url",
|
|
2713
|
+
required: true,
|
|
2714
|
+
defaultValue: "",
|
|
2715
|
+
helperText: "e.g. enter a youtube url, google map, etc",
|
|
2716
|
+
onChange: (options) => {
|
|
2717
|
+
const url = options.get("url");
|
|
2718
|
+
if (url) {
|
|
2719
|
+
options.set("content", "Loading...");
|
|
2720
|
+
const apiKey = "ae0e60e78201a3f2b0de4b";
|
|
2721
|
+
return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
|
|
2722
|
+
if (options.get("url") === url) {
|
|
2723
|
+
if (data.html)
|
|
2724
|
+
options.set("content", data.html);
|
|
2725
|
+
else
|
|
2726
|
+
options.set("content", "Invalid url, please try another");
|
|
2727
|
+
}
|
|
2728
|
+
}).catch((_err) => {
|
|
2729
|
+
options.set("content", "There was an error embedding this URL, please try again or another URL");
|
|
2730
|
+
});
|
|
2731
|
+
} else
|
|
2732
|
+
options.delete("content");
|
|
2733
|
+
}
|
|
2734
|
+
},
|
|
2735
|
+
{
|
|
2736
|
+
name: "content",
|
|
2737
|
+
type: "html",
|
|
2738
|
+
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
2739
|
+
hideFromUI: true
|
|
2740
|
+
}
|
|
2741
|
+
]
|
|
2742
|
+
};
|
|
2743
|
+
const SCRIPT_MIME_TYPES = [
|
|
2744
|
+
"text/javascript",
|
|
2745
|
+
"application/javascript",
|
|
2746
|
+
"application/ecmascript"
|
|
2747
|
+
];
|
|
2748
|
+
const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
2749
|
+
const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
|
|
2750
|
+
if (!elem.value || !elem.value.getElementsByTagName)
|
|
2751
|
+
return;
|
|
2752
|
+
const scripts = elem.value.getElementsByTagName("script");
|
|
2753
|
+
for (let i = 0; i < scripts.length; i++) {
|
|
2754
|
+
const script = scripts[i];
|
|
2755
|
+
if (script.src && !state.scriptsInserted.includes(script.src)) {
|
|
2756
|
+
state.scriptsInserted.push(script.src);
|
|
2757
|
+
const newScript = document.createElement("script");
|
|
2758
|
+
newScript.async = true;
|
|
2759
|
+
newScript.src = script.src;
|
|
2760
|
+
document.head.appendChild(newScript);
|
|
2761
|
+
} else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
|
|
2762
|
+
try {
|
|
2763
|
+
state.scriptsRun.push(script.innerText);
|
|
2764
|
+
new Function(script.innerText)();
|
|
2765
|
+
} catch (error) {
|
|
2766
|
+
console.warn("`Embed`: Error running script:", error);
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
};
|
|
2770
|
+
const Embed = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
2771
|
+
const elem = qwik.useSignal();
|
|
2772
|
+
const state = qwik.useStore({
|
|
2773
|
+
ranInitFn: false,
|
|
2774
|
+
scriptsInserted: [],
|
|
2775
|
+
scriptsRun: []
|
|
2776
|
+
});
|
|
2777
|
+
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
2778
|
+
const [elem2, props2, state2] = qwik.useLexicalScope();
|
|
2779
|
+
track2(() => elem2.value);
|
|
2780
|
+
track2(() => state2.ranInitFn);
|
|
2781
|
+
if (elem2.value && !state2.ranInitFn) {
|
|
2782
|
+
state2.ranInitFn = true;
|
|
2783
|
+
findAndRunScripts(props2, state2, elem2);
|
|
2784
|
+
}
|
|
2785
|
+
}, "Embed_component_useTask_bg7ez0XUtiM", [
|
|
2786
|
+
elem,
|
|
2787
|
+
props,
|
|
2788
|
+
state
|
|
2789
|
+
]));
|
|
2790
|
+
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
2791
|
+
ref: elem
|
|
2792
|
+
}, {
|
|
2793
|
+
class: "builder-embed",
|
|
2794
|
+
dangerouslySetInnerHTML: qwik._fnSignal((p0) => p0.content, [
|
|
2795
|
+
props
|
|
2796
|
+
], "p0.content")
|
|
2797
|
+
}, null, 3, "9r_0");
|
|
2798
|
+
}, "Embed_component_Uji08ORjXbE"));
|
|
2799
|
+
const componentInfo$5 = {
|
|
2800
|
+
name: "Form:Form",
|
|
2801
|
+
// editableTags: ['builder-form-error']
|
|
2802
|
+
defaults: {
|
|
2803
|
+
responsiveStyles: {
|
|
2804
|
+
large: {
|
|
2805
|
+
marginTop: "15px",
|
|
2806
|
+
paddingBottom: "15px"
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
},
|
|
2810
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",
|
|
2811
|
+
inputs: [
|
|
2812
|
+
{
|
|
2813
|
+
name: "sendSubmissionsTo",
|
|
2814
|
+
type: "string",
|
|
2815
|
+
// TODO: save to builder data and user can download as csv
|
|
2816
|
+
// TODO: easy for mode too or computed add/remove fields form mode
|
|
2817
|
+
// so you can edit details and high level mode at same time...
|
|
2818
|
+
// Later - more integrations like mailchimp
|
|
2819
|
+
// /api/v1/form-submit?to=mailchimp
|
|
2820
|
+
enum: [
|
|
2821
|
+
{
|
|
2822
|
+
label: "Send to email",
|
|
2823
|
+
value: "email",
|
|
2824
|
+
helperText: "Send form submissions to the email address of your choosing"
|
|
2825
|
+
},
|
|
2826
|
+
{
|
|
2827
|
+
label: "Custom",
|
|
2828
|
+
value: "custom",
|
|
2829
|
+
helperText: "Handle where the form requests go manually with a little code, e.g. to your own custom backend"
|
|
2830
|
+
}
|
|
2831
|
+
],
|
|
2832
|
+
defaultValue: "email"
|
|
2833
|
+
},
|
|
2834
|
+
{
|
|
2835
|
+
name: "sendSubmissionsToEmail",
|
|
2836
|
+
type: "string",
|
|
2837
|
+
required: true,
|
|
2838
|
+
// TODO: required: () => options.get("sendSubmissionsTo") === "email"
|
|
2839
|
+
defaultValue: "your@email.com",
|
|
2840
|
+
showIf: 'options.get("sendSubmissionsTo") === "email"'
|
|
2841
|
+
},
|
|
2842
|
+
{
|
|
2843
|
+
name: "sendWithJs",
|
|
2844
|
+
type: "boolean",
|
|
2845
|
+
helperText: "Set to false to use basic html form action",
|
|
2846
|
+
defaultValue: true,
|
|
2847
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
2848
|
+
},
|
|
2849
|
+
{
|
|
2850
|
+
name: "name",
|
|
2851
|
+
type: "string",
|
|
2852
|
+
defaultValue: "My form"
|
|
2853
|
+
},
|
|
2854
|
+
{
|
|
2855
|
+
name: "action",
|
|
2856
|
+
type: "string",
|
|
2857
|
+
helperText: "URL to send the form data to",
|
|
2858
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
2859
|
+
},
|
|
2860
|
+
{
|
|
2861
|
+
name: "contentType",
|
|
2862
|
+
type: "string",
|
|
2863
|
+
defaultValue: "application/json",
|
|
2864
|
+
advanced: true,
|
|
2865
|
+
// TODO: do automatically if file input
|
|
2866
|
+
enum: [
|
|
2867
|
+
"application/json",
|
|
2868
|
+
"multipart/form-data",
|
|
2869
|
+
"application/x-www-form-urlencoded"
|
|
2870
|
+
],
|
|
2871
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
2872
|
+
},
|
|
2873
|
+
{
|
|
2874
|
+
name: "method",
|
|
2875
|
+
type: "string",
|
|
2876
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"',
|
|
2877
|
+
defaultValue: "POST",
|
|
2878
|
+
advanced: true
|
|
2879
|
+
},
|
|
2880
|
+
{
|
|
2881
|
+
name: "previewState",
|
|
2882
|
+
type: "string",
|
|
2883
|
+
// TODO: persist: false flag
|
|
2884
|
+
enum: [
|
|
2885
|
+
"unsubmitted",
|
|
2886
|
+
"sending",
|
|
2887
|
+
"success",
|
|
2888
|
+
"error"
|
|
2889
|
+
],
|
|
2890
|
+
defaultValue: "unsubmitted",
|
|
2891
|
+
helperText: 'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',
|
|
2892
|
+
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
2893
|
+
},
|
|
2894
|
+
{
|
|
2895
|
+
name: "successUrl",
|
|
2896
|
+
type: "url",
|
|
2897
|
+
helperText: "Optional URL to redirect the user to on form submission success",
|
|
2898
|
+
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
2899
|
+
},
|
|
2900
|
+
{
|
|
2901
|
+
name: "resetFormOnSubmit",
|
|
2902
|
+
type: "boolean",
|
|
2903
|
+
showIf: "options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",
|
|
2904
|
+
advanced: true
|
|
2905
|
+
},
|
|
2906
|
+
{
|
|
2907
|
+
name: "successMessage",
|
|
2908
|
+
type: "uiBlocks",
|
|
2909
|
+
hideFromUI: true,
|
|
2910
|
+
defaultValue: [
|
|
2911
|
+
{
|
|
2912
|
+
"@type": "@builder.io/sdk:Element",
|
|
2913
|
+
responsiveStyles: {
|
|
2914
|
+
large: {
|
|
2915
|
+
marginTop: "10px"
|
|
2916
|
+
}
|
|
2917
|
+
},
|
|
2918
|
+
component: {
|
|
2919
|
+
name: "Text",
|
|
2920
|
+
options: {
|
|
2921
|
+
text: "<span>Thanks!</span>"
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
]
|
|
2926
|
+
},
|
|
2927
|
+
{
|
|
2928
|
+
name: "validate",
|
|
2929
|
+
type: "boolean",
|
|
2930
|
+
defaultValue: true,
|
|
2931
|
+
advanced: true
|
|
2932
|
+
},
|
|
2933
|
+
{
|
|
2934
|
+
name: "errorMessagePath",
|
|
2935
|
+
type: "text",
|
|
2936
|
+
advanced: true,
|
|
2937
|
+
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" }}'
|
|
2938
|
+
},
|
|
2939
|
+
{
|
|
2940
|
+
name: "errorMessage",
|
|
2941
|
+
type: "uiBlocks",
|
|
2942
|
+
hideFromUI: true,
|
|
2943
|
+
defaultValue: [
|
|
2944
|
+
{
|
|
2945
|
+
"@type": "@builder.io/sdk:Element",
|
|
2946
|
+
responsiveStyles: {
|
|
2947
|
+
large: {
|
|
2948
|
+
marginTop: "10px"
|
|
2949
|
+
}
|
|
2950
|
+
},
|
|
2951
|
+
bindings: {
|
|
2952
|
+
"component.options.text": "state.formErrorMessage || block.component.options.text"
|
|
2953
|
+
},
|
|
2954
|
+
component: {
|
|
2955
|
+
name: "Text",
|
|
2956
|
+
options: {
|
|
2957
|
+
text: "<span>Form submission error :( Please check your answers and try again</span>"
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
]
|
|
2962
|
+
},
|
|
2963
|
+
{
|
|
2964
|
+
name: "sendingMessage",
|
|
2965
|
+
type: "uiBlocks",
|
|
2966
|
+
hideFromUI: true,
|
|
2967
|
+
defaultValue: [
|
|
2968
|
+
{
|
|
2969
|
+
"@type": "@builder.io/sdk:Element",
|
|
2970
|
+
responsiveStyles: {
|
|
2971
|
+
large: {
|
|
2972
|
+
marginTop: "10px"
|
|
2973
|
+
}
|
|
2974
|
+
},
|
|
2975
|
+
component: {
|
|
2976
|
+
name: "Text",
|
|
2977
|
+
options: {
|
|
2978
|
+
text: "<span>Sending...</span>"
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
]
|
|
2983
|
+
},
|
|
2984
|
+
{
|
|
2985
|
+
name: "customHeaders",
|
|
2986
|
+
type: "map",
|
|
2987
|
+
valueType: {
|
|
2988
|
+
type: "string"
|
|
2989
|
+
},
|
|
2990
|
+
advanced: true,
|
|
2991
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
2992
|
+
}
|
|
2993
|
+
],
|
|
2994
|
+
noWrap: true,
|
|
2995
|
+
canHaveChildren: true,
|
|
2996
|
+
defaultChildren: [
|
|
2997
|
+
{
|
|
2998
|
+
"@type": "@builder.io/sdk:Element",
|
|
2999
|
+
responsiveStyles: {
|
|
3000
|
+
large: {
|
|
3001
|
+
marginTop: "10px"
|
|
3002
|
+
}
|
|
3003
|
+
},
|
|
3004
|
+
component: {
|
|
3005
|
+
name: "Text",
|
|
3006
|
+
options: {
|
|
3007
|
+
text: "<span>Enter your name</span>"
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
"@type": "@builder.io/sdk:Element",
|
|
3013
|
+
responsiveStyles: {
|
|
3014
|
+
large: {
|
|
3015
|
+
marginTop: "10px"
|
|
3016
|
+
}
|
|
3017
|
+
},
|
|
3018
|
+
component: {
|
|
3019
|
+
name: "Form:Input",
|
|
3020
|
+
options: {
|
|
3021
|
+
name: "name",
|
|
3022
|
+
placeholder: "Jane Doe"
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
},
|
|
3026
|
+
{
|
|
3027
|
+
"@type": "@builder.io/sdk:Element",
|
|
3028
|
+
responsiveStyles: {
|
|
3029
|
+
large: {
|
|
3030
|
+
marginTop: "10px"
|
|
3031
|
+
}
|
|
3032
|
+
},
|
|
3033
|
+
component: {
|
|
3034
|
+
name: "Text",
|
|
3035
|
+
options: {
|
|
3036
|
+
text: "<span>Enter your email</span>"
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
},
|
|
3040
|
+
{
|
|
3041
|
+
"@type": "@builder.io/sdk:Element",
|
|
3042
|
+
responsiveStyles: {
|
|
3043
|
+
large: {
|
|
3044
|
+
marginTop: "10px"
|
|
3045
|
+
}
|
|
3046
|
+
},
|
|
3047
|
+
component: {
|
|
3048
|
+
name: "Form:Input",
|
|
3049
|
+
options: {
|
|
3050
|
+
name: "email",
|
|
3051
|
+
placeholder: "jane@doe.com"
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
},
|
|
3055
|
+
{
|
|
3056
|
+
"@type": "@builder.io/sdk:Element",
|
|
3057
|
+
responsiveStyles: {
|
|
3058
|
+
large: {
|
|
3059
|
+
marginTop: "10px"
|
|
3060
|
+
}
|
|
3061
|
+
},
|
|
3062
|
+
component: {
|
|
3063
|
+
name: "Form:SubmitButton",
|
|
3064
|
+
options: {
|
|
3065
|
+
text: "Submit"
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
]
|
|
3070
|
+
};
|
|
3071
|
+
const validEnvList = [
|
|
3072
|
+
"production",
|
|
3073
|
+
"qa",
|
|
3074
|
+
"test",
|
|
3075
|
+
"development",
|
|
3076
|
+
"dev",
|
|
3077
|
+
"cdn-qa",
|
|
3078
|
+
"cloud",
|
|
3079
|
+
"fast",
|
|
3080
|
+
"cdn2",
|
|
3081
|
+
"cdn-prod"
|
|
3082
|
+
];
|
|
3083
|
+
const getEnv = () => {
|
|
3084
|
+
const env = process.env.NODE_ENV || "production";
|
|
3085
|
+
return validEnvList.includes(env) ? env : "production";
|
|
3086
|
+
};
|
|
3087
|
+
const get = (obj, path, defaultValue) => {
|
|
3088
|
+
const result = String.prototype.split.call(path, /[,[\].]+?/).filter(Boolean).reduce((res, key) => res !== null && res !== void 0 ? res[key] : res, obj);
|
|
3089
|
+
return result === void 0 || result === obj ? defaultValue : result;
|
|
3090
|
+
};
|
|
3091
|
+
const mergeNewRootState$1 = function mergeNewRootState2(props, state, formRef, newData) {
|
|
3092
|
+
var _a, _b;
|
|
3093
|
+
const combinedState = {
|
|
3094
|
+
...props.builderContext.rootState,
|
|
3095
|
+
...newData
|
|
3096
|
+
};
|
|
3097
|
+
if (props.builderContext.rootSetState)
|
|
3098
|
+
(_b = (_a = props.builderContext).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
|
|
3099
|
+
else
|
|
3100
|
+
props.builderContext.rootState = combinedState;
|
|
3101
|
+
};
|
|
3102
|
+
const submissionState = function submissionState2(props, state, formRef) {
|
|
3103
|
+
return isEditing() && props.previewState || state.formState;
|
|
3104
|
+
};
|
|
3105
|
+
const onSubmit = function onSubmit2(props, state, formRef, event) {
|
|
3106
|
+
var _a;
|
|
3107
|
+
const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
|
|
3108
|
+
if (props.sendSubmissionsTo === "zapier")
|
|
3109
|
+
event.preventDefault();
|
|
3110
|
+
else if (sendWithJsProp) {
|
|
3111
|
+
if (!(props.action || props.sendSubmissionsTo === "email")) {
|
|
3112
|
+
event.preventDefault();
|
|
3113
|
+
return;
|
|
3114
|
+
}
|
|
3115
|
+
event.preventDefault();
|
|
3116
|
+
const el = event.currentTarget;
|
|
3117
|
+
const headers = props.customHeaders || {};
|
|
3118
|
+
let body;
|
|
3119
|
+
const formData = new FormData(el);
|
|
3120
|
+
const formPairs = Array.from(event.currentTarget.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
|
|
3121
|
+
let value;
|
|
3122
|
+
const key = el2.name;
|
|
3123
|
+
if (el2 instanceof HTMLInputElement) {
|
|
3124
|
+
if (el2.type === "radio") {
|
|
3125
|
+
if (el2.checked) {
|
|
3126
|
+
value = el2.name;
|
|
3127
|
+
return {
|
|
3128
|
+
key,
|
|
3129
|
+
value
|
|
3130
|
+
};
|
|
3131
|
+
}
|
|
3132
|
+
} else if (el2.type === "checkbox")
|
|
3133
|
+
value = el2.checked;
|
|
3134
|
+
else if (el2.type === "number" || el2.type === "range") {
|
|
3135
|
+
const num = el2.valueAsNumber;
|
|
3136
|
+
if (!isNaN(num))
|
|
3137
|
+
value = num;
|
|
3138
|
+
} else if (el2.type === "file")
|
|
3139
|
+
value = el2.files;
|
|
3140
|
+
else
|
|
3141
|
+
value = el2.value;
|
|
3142
|
+
} else
|
|
3143
|
+
value = el2.value;
|
|
3144
|
+
return {
|
|
3145
|
+
key,
|
|
3146
|
+
value
|
|
3147
|
+
};
|
|
3148
|
+
});
|
|
3149
|
+
let formContentType = props.contentType;
|
|
3150
|
+
if (props.sendSubmissionsTo === "email")
|
|
3151
|
+
formContentType = "multipart/form-data";
|
|
3152
|
+
Array.from(formPairs).forEach(({ value }) => {
|
|
3153
|
+
if (value instanceof File || Array.isArray(value) && value[0] instanceof File || value instanceof FileList)
|
|
3154
|
+
formContentType = "multipart/form-data";
|
|
3155
|
+
});
|
|
3156
|
+
if (formContentType !== "application/json")
|
|
3157
|
+
body = formData;
|
|
3158
|
+
else {
|
|
3159
|
+
const json = {};
|
|
3160
|
+
Array.from(formPairs).forEach(({ value, key }) => {
|
|
3161
|
+
set(json, key, value);
|
|
3162
|
+
});
|
|
3163
|
+
body = JSON.stringify(json);
|
|
3164
|
+
}
|
|
3165
|
+
if (formContentType && formContentType !== "multipart/form-data") {
|
|
3166
|
+
if (
|
|
3167
|
+
/* Zapier doesn't allow content-type header to be sent from browsers */
|
|
3168
|
+
!(sendWithJsProp && ((_a = props.action) == null ? void 0 : _a.includes("zapier.com")))
|
|
3169
|
+
)
|
|
3170
|
+
headers["content-type"] = formContentType;
|
|
3171
|
+
}
|
|
3172
|
+
const presubmitEvent = new CustomEvent("presubmit", {
|
|
3173
|
+
detail: {
|
|
3174
|
+
body
|
|
3175
|
+
}
|
|
3176
|
+
});
|
|
3177
|
+
if (formRef.value) {
|
|
3178
|
+
formRef.value.dispatchEvent(presubmitEvent);
|
|
3179
|
+
if (presubmitEvent.defaultPrevented)
|
|
3180
|
+
return;
|
|
3181
|
+
}
|
|
3182
|
+
state.formState = "sending";
|
|
3183
|
+
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 || "")}`;
|
|
3184
|
+
fetch(props.sendSubmissionsTo === "email" ? formUrl : props.action, {
|
|
3185
|
+
body,
|
|
3186
|
+
headers,
|
|
3187
|
+
method: props.method || "post"
|
|
3188
|
+
}).then(async (res) => {
|
|
3189
|
+
let body2;
|
|
3190
|
+
const contentType = res.headers.get("content-type");
|
|
3191
|
+
if (contentType && contentType.indexOf("application/json") !== -1)
|
|
3192
|
+
body2 = await res.json();
|
|
3193
|
+
else
|
|
3194
|
+
body2 = await res.text();
|
|
3195
|
+
if (!res.ok && props.errorMessagePath) {
|
|
3196
|
+
let message = get(body2, props.errorMessagePath);
|
|
3197
|
+
if (message) {
|
|
3198
|
+
if (typeof message !== "string")
|
|
3199
|
+
message = JSON.stringify(message);
|
|
3200
|
+
state.formErrorMessage = message;
|
|
3201
|
+
mergeNewRootState$1(props, state, formRef, {
|
|
3202
|
+
formErrorMessage: message
|
|
3203
|
+
});
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
state.responseData = body2;
|
|
3207
|
+
state.formState = res.ok ? "success" : "error";
|
|
3208
|
+
if (res.ok) {
|
|
3209
|
+
const submitSuccessEvent = new CustomEvent("submit:success", {
|
|
3210
|
+
detail: {
|
|
3211
|
+
res,
|
|
3212
|
+
body: body2
|
|
3213
|
+
}
|
|
3214
|
+
});
|
|
3215
|
+
if (formRef.value) {
|
|
3216
|
+
formRef.value.dispatchEvent(submitSuccessEvent);
|
|
3217
|
+
if (submitSuccessEvent.defaultPrevented)
|
|
3218
|
+
return;
|
|
3219
|
+
if (props.resetFormOnSubmit !== false)
|
|
3220
|
+
formRef.value.reset();
|
|
3221
|
+
}
|
|
3222
|
+
if (props.successUrl) {
|
|
3223
|
+
if (formRef.value) {
|
|
3224
|
+
const event2 = new CustomEvent("route", {
|
|
3225
|
+
detail: {
|
|
3226
|
+
url: props.successUrl
|
|
3227
|
+
}
|
|
3228
|
+
});
|
|
3229
|
+
formRef.value.dispatchEvent(event2);
|
|
3230
|
+
if (!event2.defaultPrevented)
|
|
3231
|
+
location.href = props.successUrl;
|
|
3232
|
+
} else
|
|
3233
|
+
location.href = props.successUrl;
|
|
3234
|
+
}
|
|
3235
|
+
}
|
|
3236
|
+
}, (err) => {
|
|
3237
|
+
const submitErrorEvent = new CustomEvent("submit:error", {
|
|
3238
|
+
detail: {
|
|
3239
|
+
error: err
|
|
3240
|
+
}
|
|
3241
|
+
});
|
|
3242
|
+
if (formRef.value) {
|
|
3243
|
+
formRef.value.dispatchEvent(submitErrorEvent);
|
|
3244
|
+
if (submitErrorEvent.defaultPrevented)
|
|
3245
|
+
return;
|
|
3246
|
+
}
|
|
3247
|
+
state.responseData = err;
|
|
3248
|
+
state.formState = "error";
|
|
3249
|
+
});
|
|
3250
|
+
}
|
|
3251
|
+
};
|
|
3252
|
+
const FormComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3253
|
+
var _a;
|
|
3254
|
+
qwik._jsxBranch();
|
|
3255
|
+
qwik.useStylesScopedQrl(/* @__PURE__ */ qwik.inlinedQrl(STYLES, "FormComponent_component_useStylesScoped_SVdPvm0do3s"));
|
|
3256
|
+
const formRef = qwik.useSignal();
|
|
3257
|
+
const state = qwik.useStore({
|
|
3258
|
+
formErrorMessage: "",
|
|
3259
|
+
formState: "unsubmitted",
|
|
3260
|
+
responseData: null
|
|
3261
|
+
});
|
|
3262
|
+
return /* @__PURE__ */ qwik._jsxS("form", {
|
|
3263
|
+
action: (() => {
|
|
3264
|
+
!props.sendWithJs && props.action;
|
|
3265
|
+
})(),
|
|
3266
|
+
ref: formRef,
|
|
3267
|
+
...props.attributes,
|
|
3268
|
+
children: [
|
|
3269
|
+
props.builderBlock && props.builderBlock.children ? (((_a = props.builderBlock) == null ? void 0 : _a.children) || []).map((block, idx) => {
|
|
3270
|
+
return /* @__PURE__ */ qwik._jsxC(Block, {
|
|
3271
|
+
block,
|
|
3272
|
+
get context() {
|
|
3273
|
+
return props.builderContext;
|
|
3274
|
+
},
|
|
3275
|
+
get registeredComponents() {
|
|
3276
|
+
return props.builderComponents;
|
|
3277
|
+
},
|
|
3278
|
+
get linkComponent() {
|
|
3279
|
+
return props.builderLinkComponent;
|
|
3280
|
+
},
|
|
3281
|
+
[qwik._IMMUTABLE]: {
|
|
3282
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3283
|
+
props
|
|
3284
|
+
], "p0.builderContext"),
|
|
3285
|
+
linkComponent: qwik._fnSignal((p0) => p0.builderLinkComponent, [
|
|
3286
|
+
props
|
|
3287
|
+
], "p0.builderLinkComponent"),
|
|
3288
|
+
registeredComponents: qwik._fnSignal((p0) => p0.builderComponents, [
|
|
3289
|
+
props
|
|
3290
|
+
], "p0.builderComponents")
|
|
3291
|
+
}
|
|
3292
|
+
}, 3, `form-block-${idx}`);
|
|
3293
|
+
}) : null,
|
|
3294
|
+
submissionState(props, state) === "error" ? /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
3295
|
+
path: "errorMessage",
|
|
3296
|
+
get blocks() {
|
|
3297
|
+
return props.errorMessage;
|
|
3298
|
+
},
|
|
3299
|
+
get context() {
|
|
3300
|
+
return props.builderContext;
|
|
3301
|
+
},
|
|
3302
|
+
[qwik._IMMUTABLE]: {
|
|
3303
|
+
blocks: qwik._fnSignal((p0) => p0.errorMessage, [
|
|
3304
|
+
props
|
|
3305
|
+
], "p0.errorMessage"),
|
|
3306
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3307
|
+
props
|
|
3308
|
+
], "p0.builderContext"),
|
|
3309
|
+
path: qwik._IMMUTABLE
|
|
3310
|
+
}
|
|
3311
|
+
}, 3, "0n_0") : null,
|
|
3312
|
+
submissionState(props, state) === "sending" ? /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
3313
|
+
path: "sendingMessage",
|
|
3314
|
+
get blocks() {
|
|
3315
|
+
return props.sendingMessage;
|
|
3316
|
+
},
|
|
3317
|
+
get context() {
|
|
3318
|
+
return props.builderContext;
|
|
3319
|
+
},
|
|
3320
|
+
[qwik._IMMUTABLE]: {
|
|
3321
|
+
blocks: qwik._fnSignal((p0) => p0.sendingMessage, [
|
|
3322
|
+
props
|
|
3323
|
+
], "p0.sendingMessage"),
|
|
3324
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3325
|
+
props
|
|
3326
|
+
], "p0.builderContext"),
|
|
3327
|
+
path: qwik._IMMUTABLE
|
|
3328
|
+
}
|
|
3329
|
+
}, 3, "0n_1") : null,
|
|
3330
|
+
submissionState(props, state) === "error" && state.responseData ? /* @__PURE__ */ qwik._jsxQ("pre", null, {
|
|
3331
|
+
class: "builder-form-error-text pre-FormComponent"
|
|
3332
|
+
}, JSON.stringify(state.responseData, null, 2), 1, "0n_2") : null,
|
|
3333
|
+
submissionState(props, state) === "success" ? /* @__PURE__ */ qwik._jsxC(Blocks, {
|
|
3334
|
+
path: "successMessage",
|
|
3335
|
+
get blocks() {
|
|
3336
|
+
return props.successMessage;
|
|
3337
|
+
},
|
|
3338
|
+
get context() {
|
|
3339
|
+
return props.builderContext;
|
|
3340
|
+
},
|
|
3341
|
+
[qwik._IMMUTABLE]: {
|
|
3342
|
+
blocks: qwik._fnSignal((p0) => p0.successMessage, [
|
|
3343
|
+
props
|
|
3344
|
+
], "p0.successMessage"),
|
|
3345
|
+
context: qwik._fnSignal((p0) => p0.builderContext, [
|
|
3346
|
+
props
|
|
3347
|
+
], "p0.builderContext"),
|
|
3348
|
+
path: qwik._IMMUTABLE
|
|
3349
|
+
}
|
|
3350
|
+
}, 3, "0n_3") : null
|
|
3351
|
+
],
|
|
3352
|
+
onSubmit$: /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
3353
|
+
const [formRef2, props2, state2] = qwik.useLexicalScope();
|
|
3354
|
+
return onSubmit(props2, state2, formRef2, event);
|
|
3355
|
+
}, "FormComponent_component_form_onSubmit_F3ZFTlkNAQk", [
|
|
3356
|
+
formRef,
|
|
3357
|
+
props,
|
|
3358
|
+
state
|
|
3359
|
+
])
|
|
3360
|
+
}, {
|
|
3361
|
+
method: qwik._fnSignal((p0) => p0.method, [
|
|
3362
|
+
props
|
|
3363
|
+
], "p0.method"),
|
|
3364
|
+
name: qwik._fnSignal((p0) => p0.name, [
|
|
3365
|
+
props
|
|
3366
|
+
], "p0.name"),
|
|
3367
|
+
validate: qwik._fnSignal((p0) => p0.validate, [
|
|
3368
|
+
props
|
|
3369
|
+
], "p0.validate")
|
|
3370
|
+
}, 0, "0n_4");
|
|
3371
|
+
}, "FormComponent_component_dk5c15Rvsfg"));
|
|
3372
|
+
const STYLES = `
|
|
3373
|
+
.pre-FormComponent {
|
|
3374
|
+
padding: 10px;
|
|
3375
|
+
color: red;
|
|
3376
|
+
text-align: center;
|
|
3377
|
+
}
|
|
3378
|
+
`;
|
|
3379
|
+
const componentInfo$4 = {
|
|
3380
|
+
name: "Form:Input",
|
|
3381
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3382
|
+
inputs: [
|
|
3383
|
+
{
|
|
3384
|
+
name: "type",
|
|
3385
|
+
type: "text",
|
|
3386
|
+
enum: [
|
|
3387
|
+
"text",
|
|
3388
|
+
"number",
|
|
3389
|
+
"email",
|
|
3390
|
+
"url",
|
|
3391
|
+
"checkbox",
|
|
3392
|
+
"radio",
|
|
3393
|
+
"range",
|
|
3394
|
+
"date",
|
|
3395
|
+
"datetime-local",
|
|
3396
|
+
"search",
|
|
3397
|
+
"tel",
|
|
3398
|
+
"time",
|
|
3399
|
+
"file",
|
|
3400
|
+
"month",
|
|
3401
|
+
"week",
|
|
3402
|
+
"password",
|
|
3403
|
+
"color",
|
|
3404
|
+
"hidden"
|
|
3405
|
+
],
|
|
3406
|
+
defaultValue: "text"
|
|
3407
|
+
},
|
|
3408
|
+
{
|
|
3409
|
+
name: "name",
|
|
3410
|
+
type: "string",
|
|
3411
|
+
required: true,
|
|
3412
|
+
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
3413
|
+
},
|
|
3414
|
+
{
|
|
3415
|
+
name: "placeholder",
|
|
3416
|
+
type: "string",
|
|
3417
|
+
defaultValue: "Hello there",
|
|
3418
|
+
helperText: "Text to display when there is no value"
|
|
3419
|
+
},
|
|
3420
|
+
// TODO: handle value vs default value automatically like ng-model
|
|
3421
|
+
{
|
|
3422
|
+
name: "defaultValue",
|
|
3423
|
+
type: "string"
|
|
3424
|
+
},
|
|
3425
|
+
{
|
|
3426
|
+
name: "value",
|
|
3427
|
+
type: "string",
|
|
3428
|
+
advanced: true
|
|
3429
|
+
},
|
|
3430
|
+
{
|
|
3431
|
+
name: "required",
|
|
3432
|
+
type: "boolean",
|
|
3433
|
+
helperText: "Is this input required to be filled out to submit a form",
|
|
3434
|
+
defaultValue: false
|
|
3435
|
+
}
|
|
3436
|
+
],
|
|
3437
|
+
noWrap: true,
|
|
3438
|
+
static: true,
|
|
3439
|
+
defaultStyles: {
|
|
3440
|
+
paddingTop: "10px",
|
|
3441
|
+
paddingBottom: "10px",
|
|
3442
|
+
paddingLeft: "10px",
|
|
3443
|
+
paddingRight: "10px",
|
|
3444
|
+
borderRadius: "3px",
|
|
3445
|
+
borderWidth: "1px",
|
|
3446
|
+
borderStyle: "solid",
|
|
3447
|
+
borderColor: "#ccc"
|
|
3448
|
+
}
|
|
3449
|
+
};
|
|
3450
|
+
const FormInputComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3451
|
+
return /* @__PURE__ */ qwik.createElement("input", {
|
|
3452
|
+
...props.attributes,
|
|
3453
|
+
key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
|
|
3454
|
+
placeholder: props.placeholder,
|
|
3455
|
+
type: props.type,
|
|
3456
|
+
name: props.name,
|
|
3457
|
+
value: props.value,
|
|
3458
|
+
defaultValue: props.defaultValue,
|
|
3459
|
+
required: props.required
|
|
3460
|
+
});
|
|
3461
|
+
}, "FormInputComponent_component_AUUjdN0ueMs"));
|
|
3462
|
+
const componentInfo$3 = {
|
|
3463
|
+
name: "Form:Select",
|
|
3464
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3465
|
+
defaultStyles: {
|
|
3466
|
+
alignSelf: "flex-start"
|
|
3467
|
+
},
|
|
3468
|
+
inputs: [
|
|
3469
|
+
{
|
|
3470
|
+
name: "options",
|
|
3471
|
+
type: "list",
|
|
3472
|
+
required: true,
|
|
3473
|
+
subFields: [
|
|
3474
|
+
{
|
|
3475
|
+
name: "value",
|
|
3476
|
+
type: "text",
|
|
3477
|
+
required: true
|
|
3478
|
+
},
|
|
3479
|
+
{
|
|
3480
|
+
name: "name",
|
|
3481
|
+
type: "text"
|
|
3482
|
+
}
|
|
3483
|
+
],
|
|
3484
|
+
defaultValue: [
|
|
3485
|
+
{
|
|
3486
|
+
value: "option 1"
|
|
3487
|
+
},
|
|
3488
|
+
{
|
|
3489
|
+
value: "option 2"
|
|
3490
|
+
}
|
|
3491
|
+
]
|
|
3492
|
+
},
|
|
3493
|
+
{
|
|
3494
|
+
name: "name",
|
|
3495
|
+
type: "string",
|
|
3496
|
+
required: true,
|
|
3497
|
+
helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
|
|
3498
|
+
},
|
|
3499
|
+
{
|
|
3500
|
+
name: "defaultValue",
|
|
3501
|
+
type: "string"
|
|
3502
|
+
},
|
|
3503
|
+
{
|
|
3504
|
+
name: "value",
|
|
3505
|
+
type: "string",
|
|
3506
|
+
advanced: true
|
|
3507
|
+
},
|
|
3508
|
+
{
|
|
3509
|
+
name: "required",
|
|
3510
|
+
type: "boolean",
|
|
3511
|
+
defaultValue: false
|
|
3512
|
+
}
|
|
3513
|
+
],
|
|
3514
|
+
static: true,
|
|
3515
|
+
noWrap: true
|
|
3516
|
+
};
|
|
3517
|
+
const SelectComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3518
|
+
return /* @__PURE__ */ qwik.createElement("select", {
|
|
3519
|
+
...props.attributes,
|
|
3520
|
+
value: props.value,
|
|
3521
|
+
key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
|
|
3522
|
+
defaultValue: props.defaultValue,
|
|
3523
|
+
name: props.name
|
|
3524
|
+
}, (props.options || []).map((option) => {
|
|
3525
|
+
return /* @__PURE__ */ qwik._jsxQ("option", {
|
|
3526
|
+
value: qwik._wrapSignal(option, "value")
|
|
3527
|
+
}, null, option.name || option.value, 1, "tc_0");
|
|
3528
|
+
}));
|
|
3529
|
+
}, "SelectComponent_component_SPKbsFLikZU"));
|
|
3530
|
+
const componentInfo$2 = {
|
|
3531
|
+
name: "Form:SubmitButton",
|
|
3532
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3533
|
+
defaultStyles: {
|
|
3534
|
+
appearance: "none",
|
|
3535
|
+
paddingTop: "15px",
|
|
3536
|
+
paddingBottom: "15px",
|
|
3537
|
+
paddingLeft: "25px",
|
|
3538
|
+
paddingRight: "25px",
|
|
3539
|
+
backgroundColor: "#3898EC",
|
|
3540
|
+
color: "white",
|
|
3541
|
+
borderRadius: "4px",
|
|
3542
|
+
cursor: "pointer"
|
|
3543
|
+
},
|
|
3544
|
+
inputs: [
|
|
3545
|
+
{
|
|
3546
|
+
name: "text",
|
|
3547
|
+
type: "text",
|
|
3548
|
+
defaultValue: "Click me"
|
|
3549
|
+
}
|
|
3550
|
+
],
|
|
3551
|
+
static: true,
|
|
3552
|
+
noWrap: true
|
|
3553
|
+
};
|
|
3554
|
+
const SubmitButton = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3555
|
+
return /* @__PURE__ */ qwik._jsxS("button", {
|
|
3556
|
+
...props.attributes,
|
|
3557
|
+
children: qwik._fnSignal((p0) => p0.text, [
|
|
3558
|
+
props
|
|
3559
|
+
], "p0.text")
|
|
3560
|
+
}, {
|
|
3561
|
+
type: "submit"
|
|
3562
|
+
}, 0, "6z_0");
|
|
3563
|
+
}, "SubmitButton_component_NXvMBMCDhwc"));
|
|
3564
|
+
const componentInfo$1 = {
|
|
3565
|
+
// friendlyName?
|
|
3566
|
+
name: "Raw:Img",
|
|
3567
|
+
hideFromInsertMenu: true,
|
|
3568
|
+
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",
|
|
3569
|
+
inputs: [
|
|
3570
|
+
{
|
|
3571
|
+
name: "image",
|
|
3572
|
+
bubble: true,
|
|
3573
|
+
type: "file",
|
|
3574
|
+
allowedFileTypes: [
|
|
3575
|
+
"jpeg",
|
|
3576
|
+
"jpg",
|
|
3577
|
+
"png",
|
|
3578
|
+
"svg",
|
|
3579
|
+
"gif",
|
|
3580
|
+
"webp"
|
|
3581
|
+
],
|
|
3582
|
+
required: true
|
|
3583
|
+
}
|
|
3584
|
+
],
|
|
3585
|
+
noWrap: true,
|
|
3586
|
+
static: true
|
|
3587
|
+
};
|
|
3588
|
+
const ImgComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3589
|
+
return /* @__PURE__ */ qwik._jsxS("img", {
|
|
3590
|
+
...props.attributes
|
|
3591
|
+
}, {
|
|
3592
|
+
alt: qwik._fnSignal((p0) => p0.altText, [
|
|
3593
|
+
props
|
|
3594
|
+
], "p0.altText"),
|
|
3595
|
+
src: qwik._fnSignal((p0) => p0.imgSrc || p0.image, [
|
|
3596
|
+
props
|
|
3597
|
+
], "p0.imgSrc||p0.image"),
|
|
3598
|
+
style: qwik._fnSignal((p0) => ({
|
|
3599
|
+
objectFit: p0.backgroundSize || "cover",
|
|
3600
|
+
objectPosition: p0.backgroundPosition || "center"
|
|
3601
|
+
}), [
|
|
3602
|
+
props
|
|
3603
|
+
], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
|
|
3604
|
+
}, 0, isEditing() && props.imgSrc || "default-key");
|
|
3605
|
+
}, "ImgComponent_component_FXvIDBSffO8"));
|
|
3606
|
+
const componentInfo = {
|
|
3607
|
+
name: "Video",
|
|
3608
|
+
canHaveChildren: true,
|
|
3609
|
+
defaultStyles: {
|
|
3610
|
+
minHeight: "20px",
|
|
3611
|
+
minWidth: "20px"
|
|
3612
|
+
},
|
|
3613
|
+
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",
|
|
3614
|
+
inputs: [
|
|
3615
|
+
{
|
|
3616
|
+
name: "video",
|
|
3617
|
+
type: "file",
|
|
3618
|
+
allowedFileTypes: [
|
|
3619
|
+
"mp4"
|
|
3620
|
+
],
|
|
3621
|
+
bubble: true,
|
|
3622
|
+
defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
|
|
3623
|
+
required: true
|
|
3624
|
+
},
|
|
3625
|
+
{
|
|
3626
|
+
name: "posterImage",
|
|
2862
3627
|
type: "file",
|
|
2863
3628
|
allowedFileTypes: [
|
|
2864
3629
|
"jpeg",
|
|
@@ -3064,55 +3829,76 @@ const Video = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
|
|
|
3064
3829
|
}, /* @__PURE__ */ qwik._jsxC(qwik.Slot, null, 3, "j7_4"), 1, "j7_5") : null
|
|
3065
3830
|
], 1, "j7_6");
|
|
3066
3831
|
}, "Video_component_qdcTZflYyoQ"));
|
|
3067
|
-
const
|
|
3832
|
+
const getExtraComponents = () => [
|
|
3068
3833
|
{
|
|
3069
|
-
component:
|
|
3070
|
-
...componentInfo$
|
|
3834
|
+
component: CustomCode,
|
|
3835
|
+
...componentInfo$7
|
|
3071
3836
|
},
|
|
3072
3837
|
{
|
|
3073
|
-
component:
|
|
3074
|
-
...componentInfo$
|
|
3838
|
+
component: Embed,
|
|
3839
|
+
...componentInfo$6
|
|
3075
3840
|
},
|
|
3841
|
+
...[
|
|
3842
|
+
{
|
|
3843
|
+
component: FormComponent,
|
|
3844
|
+
...componentInfo$5
|
|
3845
|
+
},
|
|
3846
|
+
{
|
|
3847
|
+
component: FormInputComponent,
|
|
3848
|
+
...componentInfo$4
|
|
3849
|
+
},
|
|
3850
|
+
{
|
|
3851
|
+
component: SubmitButton,
|
|
3852
|
+
...componentInfo$2
|
|
3853
|
+
},
|
|
3854
|
+
{
|
|
3855
|
+
component: SelectComponent,
|
|
3856
|
+
...componentInfo$3
|
|
3857
|
+
}
|
|
3858
|
+
],
|
|
3076
3859
|
{
|
|
3077
|
-
component:
|
|
3078
|
-
...componentInfo$
|
|
3860
|
+
component: ImgComponent,
|
|
3861
|
+
...componentInfo$1
|
|
3079
3862
|
},
|
|
3080
3863
|
{
|
|
3081
|
-
component:
|
|
3082
|
-
...componentInfo
|
|
3864
|
+
component: Video,
|
|
3865
|
+
...componentInfo
|
|
3866
|
+
}
|
|
3867
|
+
];
|
|
3868
|
+
const getDefaultRegisteredComponents = () => [
|
|
3869
|
+
{
|
|
3870
|
+
component: Button,
|
|
3871
|
+
...componentInfo$f
|
|
3872
|
+
},
|
|
3873
|
+
{
|
|
3874
|
+
component: Columns,
|
|
3875
|
+
...componentInfo$e
|
|
3083
3876
|
},
|
|
3084
3877
|
{
|
|
3085
3878
|
component: FragmentComponent,
|
|
3086
|
-
...componentInfo$
|
|
3879
|
+
...componentInfo$d
|
|
3087
3880
|
},
|
|
3088
3881
|
{
|
|
3089
3882
|
component: Image,
|
|
3090
|
-
...componentInfo$
|
|
3883
|
+
...componentInfo$c
|
|
3091
3884
|
},
|
|
3092
3885
|
{
|
|
3093
|
-
component:
|
|
3094
|
-
...componentInfo$
|
|
3886
|
+
component: SectionComponent,
|
|
3887
|
+
...componentInfo$b
|
|
3095
3888
|
},
|
|
3096
3889
|
{
|
|
3097
|
-
component:
|
|
3098
|
-
...componentInfo$
|
|
3890
|
+
component: Slot,
|
|
3891
|
+
...componentInfo$a
|
|
3099
3892
|
},
|
|
3100
3893
|
{
|
|
3101
3894
|
component: Symbol$1,
|
|
3102
|
-
...componentInfo$
|
|
3895
|
+
...componentInfo$9
|
|
3103
3896
|
},
|
|
3104
3897
|
{
|
|
3105
3898
|
component: Text,
|
|
3106
|
-
...componentInfo$
|
|
3107
|
-
},
|
|
3108
|
-
{
|
|
3109
|
-
component: Video,
|
|
3110
|
-
...componentInfo
|
|
3899
|
+
...componentInfo$8
|
|
3111
3900
|
},
|
|
3112
|
-
|
|
3113
|
-
component: Slot,
|
|
3114
|
-
...componentInfo$3
|
|
3115
|
-
}
|
|
3901
|
+
...getExtraComponents()
|
|
3116
3902
|
];
|
|
3117
3903
|
const components = [];
|
|
3118
3904
|
const createRegisterComponentMessage = (info) => ({
|
|
@@ -3561,7 +4347,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
3561
4347
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
3562
4348
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
3563
4349
|
}
|
|
3564
|
-
const SDK_VERSION = "0.13.
|
|
4350
|
+
const SDK_VERSION = "0.13.2";
|
|
3565
4351
|
const registry = {};
|
|
3566
4352
|
function register(type, info) {
|
|
3567
4353
|
let typeList = registry[type];
|
|
@@ -3744,7 +4530,7 @@ const subscribeToEditor = (model, callback, options) => {
|
|
|
3744
4530
|
window.removeEventListener("message", listener);
|
|
3745
4531
|
};
|
|
3746
4532
|
};
|
|
3747
|
-
const mergeNewRootState = function
|
|
4533
|
+
const mergeNewRootState = function mergeNewRootState22(props, state, elementRef, newData) {
|
|
3748
4534
|
var _a, _b;
|
|
3749
4535
|
const combinedState = {
|
|
3750
4536
|
...props.builderContextSignal.rootState,
|