@builder.io/sdk-solid 1.0.26 → 1.0.28
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/dist/index.d.ts +1 -1
- package/lib/browser/dev.js +392 -66
- package/lib/browser/dev.jsx +406 -116
- package/lib/browser/index.js +392 -66
- package/lib/browser/index.jsx +406 -116
- package/lib/edge/dev.js +392 -66
- package/lib/edge/dev.jsx +406 -116
- package/lib/edge/index.js +392 -66
- package/lib/edge/index.jsx +406 -116
- package/lib/node/dev.js +392 -66
- package/lib/node/dev.jsx +406 -116
- package/lib/node/index.js +392 -66
- package/lib/node/index.jsx +406 -116
- package/package.json +1 -1
package/lib/edge/dev.js
CHANGED
|
@@ -3636,6 +3636,9 @@ function getProcessedBlock({
|
|
|
3636
3636
|
}
|
|
3637
3637
|
}
|
|
3638
3638
|
|
|
3639
|
+
// src/functions/camel-to-kebab-case.ts
|
|
3640
|
+
var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
3641
|
+
|
|
3639
3642
|
// src/components/block/animator.ts
|
|
3640
3643
|
function throttle(func, wait, options = {}) {
|
|
3641
3644
|
let context;
|
|
@@ -3686,7 +3689,6 @@ function assign(target, ..._args) {
|
|
|
3686
3689
|
}
|
|
3687
3690
|
return to;
|
|
3688
3691
|
}
|
|
3689
|
-
var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
3690
3692
|
function bindAnimations(animations) {
|
|
3691
3693
|
for (const animation of animations) {
|
|
3692
3694
|
switch (animation.trigger) {
|
|
@@ -3739,7 +3741,7 @@ function triggerAnimation(animation) {
|
|
|
3739
3741
|
element.style.transitionDelay = "0";
|
|
3740
3742
|
assign(element.style, animation.steps[0].styles);
|
|
3741
3743
|
setTimeout(() => {
|
|
3742
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
3744
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
3743
3745
|
if (animation.delay) {
|
|
3744
3746
|
element.style.transitionDelay = animation.delay + "s";
|
|
3745
3747
|
}
|
|
@@ -3799,7 +3801,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
3799
3801
|
}
|
|
3800
3802
|
attachDefaultState();
|
|
3801
3803
|
setTimeout(() => {
|
|
3802
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
3804
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
3803
3805
|
if (animation.delay) {
|
|
3804
3806
|
element.style.transitionDelay = animation.delay + "s";
|
|
3805
3807
|
}
|
|
@@ -3812,9 +3814,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
3812
3814
|
});
|
|
3813
3815
|
}
|
|
3814
3816
|
|
|
3815
|
-
// src/functions/camel-to-kebab-case.ts
|
|
3816
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
3817
|
-
|
|
3818
3817
|
// src/helpers/css.ts
|
|
3819
3818
|
var convertStyleMapToCSSArray = (style) => {
|
|
3820
3819
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -3944,10 +3943,10 @@ var getRepeatItemData = ({
|
|
|
3944
3943
|
return repeatArray;
|
|
3945
3944
|
};
|
|
3946
3945
|
var shouldPassLinkComponent = (block) => {
|
|
3947
|
-
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3946
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
3948
3947
|
};
|
|
3949
3948
|
var shouldPassRegisteredComponents = (block) => {
|
|
3950
|
-
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3949
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
3951
3950
|
};
|
|
3952
3951
|
|
|
3953
3952
|
// src/constants/device-sizes.ts
|
|
@@ -4076,7 +4075,7 @@ function BlockStyles(props) {
|
|
|
4076
4075
|
className: `${className}:hover`,
|
|
4077
4076
|
styles: {
|
|
4078
4077
|
...hoverStyles,
|
|
4079
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
4078
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(hoverAnimation.easing)}`,
|
|
4080
4079
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
4081
4080
|
}
|
|
4082
4081
|
}) || "";
|
|
@@ -5938,8 +5937,12 @@ function Tabs(props) {
|
|
|
5938
5937
|
function activeTabContent(active) {
|
|
5939
5938
|
return props.tabs && props.tabs[active].content;
|
|
5940
5939
|
}
|
|
5941
|
-
function
|
|
5942
|
-
|
|
5940
|
+
function onClick(index) {
|
|
5941
|
+
if (index === activeTab() && props.collapsible) {
|
|
5942
|
+
setActiveTab(-1);
|
|
5943
|
+
} else {
|
|
5944
|
+
setActiveTab(index);
|
|
5945
|
+
}
|
|
5943
5946
|
}
|
|
5944
5947
|
return (() => {
|
|
5945
5948
|
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
@@ -5954,13 +5957,7 @@ function Tabs(props) {
|
|
|
5954
5957
|
const index = _index();
|
|
5955
5958
|
return (() => {
|
|
5956
5959
|
const _el$4 = _tmpl$33();
|
|
5957
|
-
_el$4.$$click = (event) =>
|
|
5958
|
-
if (index === activeTab() && props.collapsible) {
|
|
5959
|
-
setActiveTab(-1);
|
|
5960
|
-
} else {
|
|
5961
|
-
setActiveTab(index);
|
|
5962
|
-
}
|
|
5963
|
-
};
|
|
5960
|
+
_el$4.$$click = (event) => onClick(index);
|
|
5964
5961
|
setAttribute(_el$4, "key", index);
|
|
5965
5962
|
insert(_el$4, createComponent(blocks_default, {
|
|
5966
5963
|
get parent() {
|
|
@@ -5981,7 +5978,9 @@ function Tabs(props) {
|
|
|
5981
5978
|
}
|
|
5982
5979
|
}));
|
|
5983
5980
|
effect((_p$) => {
|
|
5984
|
-
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 =
|
|
5981
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = {
|
|
5982
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
5983
|
+
};
|
|
5985
5984
|
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
5986
5985
|
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
5987
5986
|
return _p$;
|
|
@@ -6060,8 +6059,320 @@ function Text(props) {
|
|
|
6060
6059
|
}
|
|
6061
6060
|
var text_default = Text;
|
|
6062
6061
|
|
|
6063
|
-
// src/blocks/
|
|
6062
|
+
// src/blocks/accordion/helpers.ts
|
|
6063
|
+
var convertOrderNumberToString = (order) => {
|
|
6064
|
+
return order.toString();
|
|
6065
|
+
};
|
|
6066
|
+
|
|
6067
|
+
// src/blocks/accordion/accordion.tsx
|
|
6068
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div class=builder-accordion>`);
|
|
6069
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<div>`);
|
|
6070
|
+
function Accordion(props) {
|
|
6071
|
+
const [open, setOpen] = createSignal([]);
|
|
6072
|
+
const onlyOneAtATime = createMemo(() => {
|
|
6073
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
6074
|
+
});
|
|
6075
|
+
const accordionStyles = createMemo(() => {
|
|
6076
|
+
const styles = {
|
|
6077
|
+
display: "flex",
|
|
6078
|
+
alignItems: "stretch",
|
|
6079
|
+
flexDirection: "column",
|
|
6080
|
+
...props.grid && {
|
|
6081
|
+
flexDirection: "row",
|
|
6082
|
+
alignItems: "flex-start",
|
|
6083
|
+
flexWrap: "wrap"
|
|
6084
|
+
}
|
|
6085
|
+
};
|
|
6086
|
+
return Object.fromEntries(Object.entries(styles).map(([key, value]) => [camelToKebabCase(key), value]));
|
|
6087
|
+
});
|
|
6088
|
+
const accordionTitleStyles = createMemo(() => {
|
|
6089
|
+
const shared = {
|
|
6090
|
+
display: "flex",
|
|
6091
|
+
flexDirection: "column"
|
|
6092
|
+
};
|
|
6093
|
+
const styles = Object.fromEntries(Object.entries({
|
|
6094
|
+
...shared,
|
|
6095
|
+
alignItems: "stretch",
|
|
6096
|
+
cursor: "pointer"
|
|
6097
|
+
}).map(([key, value]) => [camelToKebabCase(key), value]));
|
|
6098
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
6099
|
+
});
|
|
6100
|
+
function getAccordionTitleClassName(index) {
|
|
6101
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
6102
|
+
}
|
|
6103
|
+
function getAccordionDetailClassName(index) {
|
|
6104
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
6105
|
+
}
|
|
6106
|
+
const openGridItemOrder = createMemo(() => {
|
|
6107
|
+
let itemOrder = null;
|
|
6108
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
6109
|
+
if (getOpenGridItemPosition && document) {
|
|
6110
|
+
const openItemIndex = open()[0];
|
|
6111
|
+
const openItem = document.querySelector(`.builder-accordion-title[data-index="${openItemIndex}"]`);
|
|
6112
|
+
let subjectItem = openItem;
|
|
6113
|
+
itemOrder = openItemIndex;
|
|
6114
|
+
if (subjectItem) {
|
|
6115
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
6116
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
6117
|
+
if (subjectItem) {
|
|
6118
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
6119
|
+
continue;
|
|
6120
|
+
}
|
|
6121
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
6122
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
6123
|
+
const index = parseInt(subjectItem.getAttribute("data-index") || "", 10);
|
|
6124
|
+
if (!isNaN(index)) {
|
|
6125
|
+
prevItemRect = subjectItemRect;
|
|
6126
|
+
itemOrder = index;
|
|
6127
|
+
}
|
|
6128
|
+
} else {
|
|
6129
|
+
break;
|
|
6130
|
+
}
|
|
6131
|
+
}
|
|
6132
|
+
}
|
|
6133
|
+
}
|
|
6134
|
+
}
|
|
6135
|
+
if (typeof itemOrder === "number") {
|
|
6136
|
+
itemOrder = itemOrder + 1;
|
|
6137
|
+
}
|
|
6138
|
+
return itemOrder;
|
|
6139
|
+
});
|
|
6140
|
+
const accordionDetailStyles = createMemo(() => {
|
|
6141
|
+
const styles = {
|
|
6142
|
+
...{
|
|
6143
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
6144
|
+
},
|
|
6145
|
+
...props.grid && {
|
|
6146
|
+
width: "100%"
|
|
6147
|
+
}
|
|
6148
|
+
};
|
|
6149
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
6150
|
+
});
|
|
6151
|
+
function onClick(index) {
|
|
6152
|
+
if (open().includes(index)) {
|
|
6153
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
6154
|
+
} else {
|
|
6155
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
6156
|
+
}
|
|
6157
|
+
}
|
|
6158
|
+
return (() => {
|
|
6159
|
+
const _el$ = _tmpl$9();
|
|
6160
|
+
insert(_el$, createComponent(For, {
|
|
6161
|
+
get each() {
|
|
6162
|
+
return props.items;
|
|
6163
|
+
},
|
|
6164
|
+
children: (item, _index) => {
|
|
6165
|
+
const index = _index();
|
|
6166
|
+
return [(() => {
|
|
6167
|
+
const _el$2 = _tmpl$24();
|
|
6168
|
+
_el$2.$$click = (event) => onClick(index);
|
|
6169
|
+
setAttribute(_el$2, "data-index", index);
|
|
6170
|
+
insert(_el$2, createComponent(blocks_default, {
|
|
6171
|
+
get blocks() {
|
|
6172
|
+
return item.title;
|
|
6173
|
+
},
|
|
6174
|
+
path: `items.${index}.title`,
|
|
6175
|
+
get parent() {
|
|
6176
|
+
return props.builderBlock.id;
|
|
6177
|
+
},
|
|
6178
|
+
get context() {
|
|
6179
|
+
return props.builderContext;
|
|
6180
|
+
},
|
|
6181
|
+
get registeredComponents() {
|
|
6182
|
+
return props.builderComponents;
|
|
6183
|
+
},
|
|
6184
|
+
get linkComponent() {
|
|
6185
|
+
return props.builderLinkComponent;
|
|
6186
|
+
}
|
|
6187
|
+
}));
|
|
6188
|
+
effect((_p$) => {
|
|
6189
|
+
const _v$ = getAccordionTitleClassName(index), _v$2 = {
|
|
6190
|
+
...accordionTitleStyles(),
|
|
6191
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
6192
|
+
...{
|
|
6193
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
6194
|
+
}
|
|
6195
|
+
};
|
|
6196
|
+
_v$ !== _p$._v$ && className(_el$2, _p$._v$ = _v$);
|
|
6197
|
+
_p$._v$2 = style(_el$2, _v$2, _p$._v$2);
|
|
6198
|
+
return _p$;
|
|
6199
|
+
}, {
|
|
6200
|
+
_v$: void 0,
|
|
6201
|
+
_v$2: void 0
|
|
6202
|
+
});
|
|
6203
|
+
return _el$2;
|
|
6204
|
+
})(), createComponent(Show, {
|
|
6205
|
+
get when() {
|
|
6206
|
+
return open().includes(index);
|
|
6207
|
+
},
|
|
6208
|
+
get children() {
|
|
6209
|
+
const _el$3 = _tmpl$24();
|
|
6210
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
6211
|
+
get blocks() {
|
|
6212
|
+
return item.detail;
|
|
6213
|
+
},
|
|
6214
|
+
path: `items.${index}.detail`,
|
|
6215
|
+
get parent() {
|
|
6216
|
+
return props.builderBlock.id;
|
|
6217
|
+
},
|
|
6218
|
+
get context() {
|
|
6219
|
+
return props.builderContext;
|
|
6220
|
+
},
|
|
6221
|
+
get registeredComponents() {
|
|
6222
|
+
return props.builderComponents;
|
|
6223
|
+
},
|
|
6224
|
+
get linkComponent() {
|
|
6225
|
+
return props.builderLinkComponent;
|
|
6226
|
+
}
|
|
6227
|
+
}));
|
|
6228
|
+
effect((_p$) => {
|
|
6229
|
+
const _v$3 = getAccordionDetailClassName(index), _v$4 = accordionDetailStyles();
|
|
6230
|
+
_v$3 !== _p$._v$3 && className(_el$3, _p$._v$3 = _v$3);
|
|
6231
|
+
_p$._v$4 = style(_el$3, _v$4, _p$._v$4);
|
|
6232
|
+
return _p$;
|
|
6233
|
+
}, {
|
|
6234
|
+
_v$3: void 0,
|
|
6235
|
+
_v$4: void 0
|
|
6236
|
+
});
|
|
6237
|
+
return _el$3;
|
|
6238
|
+
}
|
|
6239
|
+
})];
|
|
6240
|
+
}
|
|
6241
|
+
}));
|
|
6242
|
+
effect((_$p) => style(_el$, accordionStyles(), _$p));
|
|
6243
|
+
return _el$;
|
|
6244
|
+
})();
|
|
6245
|
+
}
|
|
6246
|
+
var accordion_default = Accordion;
|
|
6247
|
+
delegateEvents(["click"]);
|
|
6248
|
+
|
|
6249
|
+
// src/blocks/accordion/component-info.ts
|
|
6250
|
+
var defaultTitle = {
|
|
6251
|
+
"@type": "@builder.io/sdk:Element",
|
|
6252
|
+
layerName: "Accordion item title",
|
|
6253
|
+
responsiveStyles: {
|
|
6254
|
+
large: {
|
|
6255
|
+
marginTop: "10px",
|
|
6256
|
+
position: "relative",
|
|
6257
|
+
display: "flex",
|
|
6258
|
+
alignItems: "stretch",
|
|
6259
|
+
flexDirection: "column",
|
|
6260
|
+
paddingBottom: "10px"
|
|
6261
|
+
}
|
|
6262
|
+
},
|
|
6263
|
+
children: [{
|
|
6264
|
+
"@type": "@builder.io/sdk:Element",
|
|
6265
|
+
responsiveStyles: {
|
|
6266
|
+
large: {
|
|
6267
|
+
textAlign: "left",
|
|
6268
|
+
display: "flex",
|
|
6269
|
+
flexDirection: "column"
|
|
6270
|
+
}
|
|
6271
|
+
},
|
|
6272
|
+
component: {
|
|
6273
|
+
name: "Text",
|
|
6274
|
+
options: {
|
|
6275
|
+
text: "I am an accordion title. Click me!"
|
|
6276
|
+
}
|
|
6277
|
+
}
|
|
6278
|
+
}]
|
|
6279
|
+
};
|
|
6280
|
+
var defaultDetail = {
|
|
6281
|
+
"@type": "@builder.io/sdk:Element",
|
|
6282
|
+
layerName: "Accordion item detail",
|
|
6283
|
+
responsiveStyles: {
|
|
6284
|
+
large: {
|
|
6285
|
+
position: "relative",
|
|
6286
|
+
display: "flex",
|
|
6287
|
+
alignItems: "stretch",
|
|
6288
|
+
flexDirection: "column",
|
|
6289
|
+
marginTop: "10px",
|
|
6290
|
+
paddingBottom: "10px"
|
|
6291
|
+
}
|
|
6292
|
+
},
|
|
6293
|
+
children: [{
|
|
6294
|
+
"@type": "@builder.io/sdk:Element",
|
|
6295
|
+
responsiveStyles: {
|
|
6296
|
+
large: {
|
|
6297
|
+
paddingTop: "50px",
|
|
6298
|
+
textAlign: "left",
|
|
6299
|
+
display: "flex",
|
|
6300
|
+
flexDirection: "column",
|
|
6301
|
+
paddingBottom: "50px"
|
|
6302
|
+
}
|
|
6303
|
+
},
|
|
6304
|
+
component: {
|
|
6305
|
+
name: "Text",
|
|
6306
|
+
options: {
|
|
6307
|
+
text: "I am an accordion detail, hello!"
|
|
6308
|
+
}
|
|
6309
|
+
}
|
|
6310
|
+
}]
|
|
6311
|
+
};
|
|
6064
6312
|
var componentInfo10 = {
|
|
6313
|
+
name: "Builder:Accordion",
|
|
6314
|
+
canHaveChildren: true,
|
|
6315
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
6316
|
+
defaultStyles: {
|
|
6317
|
+
display: "flex",
|
|
6318
|
+
flexDirection: "column",
|
|
6319
|
+
alignItems: "stretch"
|
|
6320
|
+
},
|
|
6321
|
+
inputs: [{
|
|
6322
|
+
name: "items",
|
|
6323
|
+
type: "list",
|
|
6324
|
+
broadcast: true,
|
|
6325
|
+
subFields: [{
|
|
6326
|
+
name: "title",
|
|
6327
|
+
type: "uiBlocks",
|
|
6328
|
+
hideFromUI: true,
|
|
6329
|
+
defaultValue: [defaultTitle]
|
|
6330
|
+
}, {
|
|
6331
|
+
name: "detail",
|
|
6332
|
+
type: "uiBlocks",
|
|
6333
|
+
hideFromUI: true,
|
|
6334
|
+
defaultValue: [defaultDetail]
|
|
6335
|
+
}],
|
|
6336
|
+
defaultValue: [{
|
|
6337
|
+
title: [defaultTitle],
|
|
6338
|
+
detail: [defaultDetail]
|
|
6339
|
+
}, {
|
|
6340
|
+
title: [defaultTitle],
|
|
6341
|
+
detail: [defaultDetail]
|
|
6342
|
+
}],
|
|
6343
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
6344
|
+
}, {
|
|
6345
|
+
name: "oneAtATime",
|
|
6346
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
6347
|
+
type: "boolean",
|
|
6348
|
+
defaultValue: false
|
|
6349
|
+
}, {
|
|
6350
|
+
name: "grid",
|
|
6351
|
+
helperText: "Display as a grid",
|
|
6352
|
+
type: "boolean",
|
|
6353
|
+
defaultValue: false
|
|
6354
|
+
}, {
|
|
6355
|
+
name: "gridRowWidth",
|
|
6356
|
+
helperText: "Display as a grid",
|
|
6357
|
+
type: "string",
|
|
6358
|
+
showIf: (options) => options.get("grid"),
|
|
6359
|
+
defaultValue: "25%"
|
|
6360
|
+
}, {
|
|
6361
|
+
name: "useChildrenForItems",
|
|
6362
|
+
type: "boolean",
|
|
6363
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
6364
|
+
advanced: true,
|
|
6365
|
+
defaultValue: false,
|
|
6366
|
+
onChange: (options) => {
|
|
6367
|
+
if (options.get("useChildrenForItems") === true) {
|
|
6368
|
+
options.set("items", []);
|
|
6369
|
+
}
|
|
6370
|
+
}
|
|
6371
|
+
}]
|
|
6372
|
+
};
|
|
6373
|
+
|
|
6374
|
+
// src/blocks/custom-code/component-info.ts
|
|
6375
|
+
var componentInfo11 = {
|
|
6065
6376
|
name: "Custom Code",
|
|
6066
6377
|
static: true,
|
|
6067
6378
|
requiredPermissions: ["editCode"],
|
|
@@ -6084,7 +6395,7 @@ var componentInfo10 = {
|
|
|
6084
6395
|
advanced: true
|
|
6085
6396
|
}]
|
|
6086
6397
|
};
|
|
6087
|
-
var _tmpl$
|
|
6398
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
|
|
6088
6399
|
function CustomCode(props) {
|
|
6089
6400
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
6090
6401
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -6119,7 +6430,7 @@ function CustomCode(props) {
|
|
|
6119
6430
|
}
|
|
6120
6431
|
});
|
|
6121
6432
|
return (() => {
|
|
6122
|
-
const _el$ = _tmpl$
|
|
6433
|
+
const _el$ = _tmpl$10();
|
|
6123
6434
|
const _ref$ = elementRef;
|
|
6124
6435
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
6125
6436
|
effect((_p$) => {
|
|
@@ -6137,7 +6448,7 @@ function CustomCode(props) {
|
|
|
6137
6448
|
var custom_code_default = CustomCode;
|
|
6138
6449
|
|
|
6139
6450
|
// src/blocks/embed/component-info.ts
|
|
6140
|
-
var
|
|
6451
|
+
var componentInfo12 = {
|
|
6141
6452
|
name: "Embed",
|
|
6142
6453
|
static: true,
|
|
6143
6454
|
inputs: [{
|
|
@@ -6179,7 +6490,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
6179
6490
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
6180
6491
|
|
|
6181
6492
|
// src/blocks/embed/embed.tsx
|
|
6182
|
-
var _tmpl$
|
|
6493
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
6183
6494
|
function Embed(props) {
|
|
6184
6495
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
6185
6496
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -6217,7 +6528,7 @@ function Embed(props) {
|
|
|
6217
6528
|
}
|
|
6218
6529
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
6219
6530
|
return (() => {
|
|
6220
|
-
const _el$ = _tmpl$
|
|
6531
|
+
const _el$ = _tmpl$11();
|
|
6221
6532
|
const _ref$ = elem;
|
|
6222
6533
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
6223
6534
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -6227,7 +6538,7 @@ function Embed(props) {
|
|
|
6227
6538
|
var embed_default = Embed;
|
|
6228
6539
|
|
|
6229
6540
|
// src/blocks/form/form/component-info.ts
|
|
6230
|
-
var
|
|
6541
|
+
var componentInfo13 = {
|
|
6231
6542
|
name: "Form:Form",
|
|
6232
6543
|
// editableTags: ['builder-form-error']
|
|
6233
6544
|
defaults: {
|
|
@@ -6474,8 +6785,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
6474
6785
|
};
|
|
6475
6786
|
|
|
6476
6787
|
// src/blocks/form/form/form.tsx
|
|
6477
|
-
var _tmpl$
|
|
6478
|
-
var _tmpl$
|
|
6788
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<pre>`);
|
|
6789
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<form>`);
|
|
6479
6790
|
function FormComponent(props) {
|
|
6480
6791
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
6481
6792
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -6661,7 +6972,7 @@ function FormComponent(props) {
|
|
|
6661
6972
|
}
|
|
6662
6973
|
let formRef;
|
|
6663
6974
|
return (() => {
|
|
6664
|
-
const _el$ = _tmpl$
|
|
6975
|
+
const _el$ = _tmpl$25();
|
|
6665
6976
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
6666
6977
|
const _ref$ = formRef;
|
|
6667
6978
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -6744,7 +7055,7 @@ function FormComponent(props) {
|
|
|
6744
7055
|
return memo(() => submissionState() === "error")() && responseData();
|
|
6745
7056
|
},
|
|
6746
7057
|
get children() {
|
|
6747
|
-
const _el$2 = _tmpl$
|
|
7058
|
+
const _el$2 = _tmpl$12();
|
|
6748
7059
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
6749
7060
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
6750
7061
|
padding: "10px",
|
|
@@ -6776,7 +7087,7 @@ function FormComponent(props) {
|
|
|
6776
7087
|
var form_default = FormComponent;
|
|
6777
7088
|
|
|
6778
7089
|
// src/blocks/form/input/component-info.ts
|
|
6779
|
-
var
|
|
7090
|
+
var componentInfo14 = {
|
|
6780
7091
|
name: "Form:Input",
|
|
6781
7092
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6782
7093
|
inputs: [
|
|
@@ -6828,10 +7139,10 @@ var componentInfo13 = {
|
|
|
6828
7139
|
borderColor: "#ccc"
|
|
6829
7140
|
}
|
|
6830
7141
|
};
|
|
6831
|
-
var _tmpl$
|
|
7142
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<input>`);
|
|
6832
7143
|
function FormInputComponent(props) {
|
|
6833
7144
|
return (() => {
|
|
6834
|
-
const _el$ = _tmpl$
|
|
7145
|
+
const _el$ = _tmpl$13();
|
|
6835
7146
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6836
7147
|
get key() {
|
|
6837
7148
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -6861,7 +7172,7 @@ function FormInputComponent(props) {
|
|
|
6861
7172
|
var input_default = FormInputComponent;
|
|
6862
7173
|
|
|
6863
7174
|
// src/blocks/form/select/component-info.ts
|
|
6864
|
-
var
|
|
7175
|
+
var componentInfo15 = {
|
|
6865
7176
|
name: "Form:Select",
|
|
6866
7177
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6867
7178
|
defaultStyles: {
|
|
@@ -6904,11 +7215,11 @@ var componentInfo14 = {
|
|
|
6904
7215
|
static: true,
|
|
6905
7216
|
noWrap: true
|
|
6906
7217
|
};
|
|
6907
|
-
var _tmpl$
|
|
6908
|
-
var _tmpl$
|
|
7218
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<select>`);
|
|
7219
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<option>`);
|
|
6909
7220
|
function SelectComponent(props) {
|
|
6910
7221
|
return (() => {
|
|
6911
|
-
const _el$ = _tmpl$
|
|
7222
|
+
const _el$ = _tmpl$14();
|
|
6912
7223
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6913
7224
|
get value() {
|
|
6914
7225
|
return props.value;
|
|
@@ -6930,7 +7241,7 @@ function SelectComponent(props) {
|
|
|
6930
7241
|
children: (option, _index) => {
|
|
6931
7242
|
const index = _index();
|
|
6932
7243
|
return (() => {
|
|
6933
|
-
const _el$2 = _tmpl$
|
|
7244
|
+
const _el$2 = _tmpl$26();
|
|
6934
7245
|
insert(_el$2, () => option.name || option.value);
|
|
6935
7246
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
6936
7247
|
effect(() => _el$2.value = option.value);
|
|
@@ -6944,7 +7255,7 @@ function SelectComponent(props) {
|
|
|
6944
7255
|
var select_default = SelectComponent;
|
|
6945
7256
|
|
|
6946
7257
|
// src/blocks/form/submit-button/component-info.ts
|
|
6947
|
-
var
|
|
7258
|
+
var componentInfo16 = {
|
|
6948
7259
|
name: "Form:SubmitButton",
|
|
6949
7260
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
6950
7261
|
defaultStyles: {
|
|
@@ -6970,10 +7281,10 @@ var componentInfo15 = {
|
|
|
6970
7281
|
// TODO: defaultChildren
|
|
6971
7282
|
// canHaveChildren: true,
|
|
6972
7283
|
};
|
|
6973
|
-
var _tmpl$
|
|
7284
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
6974
7285
|
function SubmitButton(props) {
|
|
6975
7286
|
return (() => {
|
|
6976
|
-
const _el$ = _tmpl$
|
|
7287
|
+
const _el$ = _tmpl$15();
|
|
6977
7288
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
6978
7289
|
insert(_el$, () => props.text);
|
|
6979
7290
|
return _el$;
|
|
@@ -6982,7 +7293,7 @@ function SubmitButton(props) {
|
|
|
6982
7293
|
var submit_button_default = SubmitButton;
|
|
6983
7294
|
|
|
6984
7295
|
// src/blocks/img/component-info.ts
|
|
6985
|
-
var
|
|
7296
|
+
var componentInfo17 = {
|
|
6986
7297
|
// friendlyName?
|
|
6987
7298
|
name: "Raw:Img",
|
|
6988
7299
|
hideFromInsertMenu: true,
|
|
@@ -6997,10 +7308,10 @@ var componentInfo16 = {
|
|
|
6997
7308
|
noWrap: true,
|
|
6998
7309
|
static: true
|
|
6999
7310
|
};
|
|
7000
|
-
var _tmpl$
|
|
7311
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<img>`);
|
|
7001
7312
|
function ImgComponent(props) {
|
|
7002
7313
|
return (() => {
|
|
7003
|
-
const _el$ = _tmpl$
|
|
7314
|
+
const _el$ = _tmpl$16();
|
|
7004
7315
|
spread(_el$, mergeProps({
|
|
7005
7316
|
get style() {
|
|
7006
7317
|
return {
|
|
@@ -7024,7 +7335,7 @@ function ImgComponent(props) {
|
|
|
7024
7335
|
var img_default = ImgComponent;
|
|
7025
7336
|
|
|
7026
7337
|
// src/blocks/video/component-info.ts
|
|
7027
|
-
var
|
|
7338
|
+
var componentInfo18 = {
|
|
7028
7339
|
name: "Video",
|
|
7029
7340
|
canHaveChildren: true,
|
|
7030
7341
|
defaultStyles: {
|
|
@@ -7106,8 +7417,8 @@ var componentInfo17 = {
|
|
|
7106
7417
|
advanced: true
|
|
7107
7418
|
}]
|
|
7108
7419
|
};
|
|
7109
|
-
var _tmpl$
|
|
7110
|
-
var _tmpl$
|
|
7420
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
7421
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<div>`);
|
|
7111
7422
|
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
7112
7423
|
function Video(props) {
|
|
7113
7424
|
const videoProps = createMemo(() => {
|
|
@@ -7169,7 +7480,7 @@ function Video(props) {
|
|
|
7169
7480
|
return !props.lazyLoad;
|
|
7170
7481
|
},
|
|
7171
7482
|
get children() {
|
|
7172
|
-
const _el$3 = _tmpl$
|
|
7483
|
+
const _el$3 = _tmpl$17();
|
|
7173
7484
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
7174
7485
|
return _el$3;
|
|
7175
7486
|
}
|
|
@@ -7179,7 +7490,7 @@ function Video(props) {
|
|
|
7179
7490
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
7180
7491
|
},
|
|
7181
7492
|
get children() {
|
|
7182
|
-
const _el$4 = _tmpl$
|
|
7493
|
+
const _el$4 = _tmpl$27();
|
|
7183
7494
|
_el$4.style.setProperty("width", "100%");
|
|
7184
7495
|
_el$4.style.setProperty("pointer-events", "none");
|
|
7185
7496
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -7192,7 +7503,7 @@ function Video(props) {
|
|
|
7192
7503
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
7193
7504
|
},
|
|
7194
7505
|
get children() {
|
|
7195
|
-
const _el$5 = _tmpl$
|
|
7506
|
+
const _el$5 = _tmpl$27();
|
|
7196
7507
|
_el$5.style.setProperty("display", "flex");
|
|
7197
7508
|
_el$5.style.setProperty("flex-direction", "column");
|
|
7198
7509
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -7205,7 +7516,7 @@ function Video(props) {
|
|
|
7205
7516
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
7206
7517
|
},
|
|
7207
7518
|
get children() {
|
|
7208
|
-
const _el$6 = _tmpl$
|
|
7519
|
+
const _el$6 = _tmpl$27();
|
|
7209
7520
|
_el$6.style.setProperty("pointer-events", "none");
|
|
7210
7521
|
_el$6.style.setProperty("display", "flex");
|
|
7211
7522
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -7227,28 +7538,28 @@ var video_default = Video;
|
|
|
7227
7538
|
// src/constants/extra-components.ts
|
|
7228
7539
|
var getExtraComponents = () => [{
|
|
7229
7540
|
component: custom_code_default,
|
|
7230
|
-
...
|
|
7541
|
+
...componentInfo11
|
|
7231
7542
|
}, {
|
|
7232
7543
|
component: embed_default,
|
|
7233
|
-
...
|
|
7544
|
+
...componentInfo12
|
|
7234
7545
|
}, ...TARGET === "rsc" ? [] : [{
|
|
7235
7546
|
component: form_default,
|
|
7236
|
-
...
|
|
7547
|
+
...componentInfo13
|
|
7237
7548
|
}, {
|
|
7238
7549
|
component: input_default,
|
|
7239
|
-
...
|
|
7550
|
+
...componentInfo14
|
|
7240
7551
|
}, {
|
|
7241
7552
|
component: submit_button_default,
|
|
7242
|
-
...
|
|
7553
|
+
...componentInfo16
|
|
7243
7554
|
}, {
|
|
7244
7555
|
component: select_default,
|
|
7245
|
-
...
|
|
7556
|
+
...componentInfo15
|
|
7246
7557
|
}], {
|
|
7247
7558
|
component: img_default,
|
|
7248
|
-
...
|
|
7559
|
+
...componentInfo17
|
|
7249
7560
|
}, {
|
|
7250
7561
|
component: video_default,
|
|
7251
|
-
...
|
|
7562
|
+
...componentInfo18
|
|
7252
7563
|
}];
|
|
7253
7564
|
|
|
7254
7565
|
// src/constants/builder-registered-components.ts
|
|
@@ -7279,6 +7590,9 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7279
7590
|
}, ...TARGET === "rsc" ? [] : [{
|
|
7280
7591
|
component: tabs_default,
|
|
7281
7592
|
...componentInfo8
|
|
7593
|
+
}, {
|
|
7594
|
+
component: accordion_default,
|
|
7595
|
+
...componentInfo10
|
|
7282
7596
|
}], ...getExtraComponents()];
|
|
7283
7597
|
|
|
7284
7598
|
// src/functions/register-component.ts
|
|
@@ -7348,10 +7662,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7348
7662
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
7349
7663
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
7350
7664
|
)`;
|
|
7351
|
-
var _tmpl$
|
|
7665
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<script>`);
|
|
7352
7666
|
function InlinedScript(props) {
|
|
7353
7667
|
return (() => {
|
|
7354
|
-
const _el$ = _tmpl$
|
|
7668
|
+
const _el$ = _tmpl$18();
|
|
7355
7669
|
effect((_p$) => {
|
|
7356
7670
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
7357
7671
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -7415,6 +7729,18 @@ function flatten(object, path = null, separator = ".") {
|
|
|
7415
7729
|
};
|
|
7416
7730
|
}, {});
|
|
7417
7731
|
}
|
|
7732
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
7733
|
+
for (const key in obj) {
|
|
7734
|
+
const value = obj[key];
|
|
7735
|
+
const newKey = _current ? _current + "." + key : key;
|
|
7736
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$"))) {
|
|
7737
|
+
flattenMongoQuery(value, newKey, _res);
|
|
7738
|
+
} else {
|
|
7739
|
+
_res[newKey] = value;
|
|
7740
|
+
}
|
|
7741
|
+
}
|
|
7742
|
+
return _res;
|
|
7743
|
+
}
|
|
7418
7744
|
|
|
7419
7745
|
// src/types/api-version.ts
|
|
7420
7746
|
var DEFAULT_API_VERSION = "v3";
|
|
@@ -7516,7 +7842,7 @@ var generateContentUrl = (options) => {
|
|
|
7516
7842
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
7517
7843
|
}
|
|
7518
7844
|
if (query) {
|
|
7519
|
-
const flattened2 =
|
|
7845
|
+
const flattened2 = flattenMongoQuery({
|
|
7520
7846
|
query
|
|
7521
7847
|
});
|
|
7522
7848
|
for (const key in flattened2) {
|
|
@@ -7850,7 +8176,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7850
8176
|
}
|
|
7851
8177
|
|
|
7852
8178
|
// src/constants/sdk-version.ts
|
|
7853
|
-
var SDK_VERSION = "1.0.
|
|
8179
|
+
var SDK_VERSION = "1.0.28";
|
|
7854
8180
|
|
|
7855
8181
|
// src/functions/register.ts
|
|
7856
8182
|
var registry = {};
|
|
@@ -8334,7 +8660,7 @@ function EnableEditor(props) {
|
|
|
8334
8660
|
});
|
|
8335
8661
|
onMount(() => {
|
|
8336
8662
|
if (!props.apiKey) {
|
|
8337
|
-
logger.error("No API key provided to `
|
|
8663
|
+
logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
8338
8664
|
}
|
|
8339
8665
|
evaluateJsCode();
|
|
8340
8666
|
runHttpRequests();
|
|
@@ -8836,7 +9162,7 @@ var fetchSymbolContent = async ({
|
|
|
8836
9162
|
};
|
|
8837
9163
|
|
|
8838
9164
|
// src/blocks/symbol/symbol.tsx
|
|
8839
|
-
var _tmpl$
|
|
9165
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<div>`);
|
|
8840
9166
|
function Symbol2(props) {
|
|
8841
9167
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
8842
9168
|
const blocksWrapper = createMemo(() => {
|
|
@@ -8868,7 +9194,7 @@ function Symbol2(props) {
|
|
|
8868
9194
|
}
|
|
8869
9195
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8870
9196
|
return (() => {
|
|
8871
|
-
const _el$ = _tmpl$
|
|
9197
|
+
const _el$ = _tmpl$19();
|
|
8872
9198
|
spread(_el$, mergeProps({
|
|
8873
9199
|
get ["class"]() {
|
|
8874
9200
|
return className();
|