@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/index.js
CHANGED
|
@@ -3634,6 +3634,9 @@ function getProcessedBlock({
|
|
|
3634
3634
|
}
|
|
3635
3635
|
}
|
|
3636
3636
|
|
|
3637
|
+
// src/functions/camel-to-kebab-case.ts
|
|
3638
|
+
var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
3639
|
+
|
|
3637
3640
|
// src/components/block/animator.ts
|
|
3638
3641
|
function throttle(func, wait, options = {}) {
|
|
3639
3642
|
let context;
|
|
@@ -3684,7 +3687,6 @@ function assign(target, ..._args) {
|
|
|
3684
3687
|
}
|
|
3685
3688
|
return to;
|
|
3686
3689
|
}
|
|
3687
|
-
var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
3688
3690
|
function bindAnimations(animations) {
|
|
3689
3691
|
for (const animation of animations) {
|
|
3690
3692
|
switch (animation.trigger) {
|
|
@@ -3736,7 +3738,7 @@ function triggerAnimation(animation) {
|
|
|
3736
3738
|
element.style.transitionDelay = "0";
|
|
3737
3739
|
assign(element.style, animation.steps[0].styles);
|
|
3738
3740
|
setTimeout(() => {
|
|
3739
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
3741
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
3740
3742
|
if (animation.delay) {
|
|
3741
3743
|
element.style.transitionDelay = animation.delay + "s";
|
|
3742
3744
|
}
|
|
@@ -3796,7 +3798,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
3796
3798
|
}
|
|
3797
3799
|
attachDefaultState();
|
|
3798
3800
|
setTimeout(() => {
|
|
3799
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
3801
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
3800
3802
|
if (animation.delay) {
|
|
3801
3803
|
element.style.transitionDelay = animation.delay + "s";
|
|
3802
3804
|
}
|
|
@@ -3809,9 +3811,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
3809
3811
|
});
|
|
3810
3812
|
}
|
|
3811
3813
|
|
|
3812
|
-
// src/functions/camel-to-kebab-case.ts
|
|
3813
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
3814
|
-
|
|
3815
3814
|
// src/helpers/css.ts
|
|
3816
3815
|
var convertStyleMapToCSSArray = (style) => {
|
|
3817
3816
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -3938,10 +3937,10 @@ var getRepeatItemData = ({
|
|
|
3938
3937
|
return repeatArray;
|
|
3939
3938
|
};
|
|
3940
3939
|
var shouldPassLinkComponent = (block) => {
|
|
3941
|
-
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3940
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
3942
3941
|
};
|
|
3943
3942
|
var shouldPassRegisteredComponents = (block) => {
|
|
3944
|
-
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
3943
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
3945
3944
|
};
|
|
3946
3945
|
|
|
3947
3946
|
// src/constants/device-sizes.ts
|
|
@@ -4070,7 +4069,7 @@ function BlockStyles(props) {
|
|
|
4070
4069
|
className: `${className}:hover`,
|
|
4071
4070
|
styles: {
|
|
4072
4071
|
...hoverStyles,
|
|
4073
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
4072
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(hoverAnimation.easing)}`,
|
|
4074
4073
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
4075
4074
|
}
|
|
4076
4075
|
}) || "";
|
|
@@ -5930,8 +5929,12 @@ function Tabs(props) {
|
|
|
5930
5929
|
function activeTabContent(active) {
|
|
5931
5930
|
return props.tabs && props.tabs[active].content;
|
|
5932
5931
|
}
|
|
5933
|
-
function
|
|
5934
|
-
|
|
5932
|
+
function onClick(index) {
|
|
5933
|
+
if (index === activeTab() && props.collapsible) {
|
|
5934
|
+
setActiveTab(-1);
|
|
5935
|
+
} else {
|
|
5936
|
+
setActiveTab(index);
|
|
5937
|
+
}
|
|
5935
5938
|
}
|
|
5936
5939
|
return (() => {
|
|
5937
5940
|
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
@@ -5946,13 +5949,7 @@ function Tabs(props) {
|
|
|
5946
5949
|
const index = _index();
|
|
5947
5950
|
return (() => {
|
|
5948
5951
|
const _el$4 = _tmpl$33();
|
|
5949
|
-
_el$4.$$click = (event) =>
|
|
5950
|
-
if (index === activeTab() && props.collapsible) {
|
|
5951
|
-
setActiveTab(-1);
|
|
5952
|
-
} else {
|
|
5953
|
-
setActiveTab(index);
|
|
5954
|
-
}
|
|
5955
|
-
};
|
|
5952
|
+
_el$4.$$click = (event) => onClick(index);
|
|
5956
5953
|
setAttribute(_el$4, "key", index);
|
|
5957
5954
|
insert(_el$4, createComponent(blocks_default, {
|
|
5958
5955
|
get parent() {
|
|
@@ -5973,7 +5970,9 @@ function Tabs(props) {
|
|
|
5973
5970
|
}
|
|
5974
5971
|
}));
|
|
5975
5972
|
effect((_p$) => {
|
|
5976
|
-
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 =
|
|
5973
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = {
|
|
5974
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
5975
|
+
};
|
|
5977
5976
|
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
5978
5977
|
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
5979
5978
|
return _p$;
|
|
@@ -6052,8 +6051,320 @@ function Text(props) {
|
|
|
6052
6051
|
}
|
|
6053
6052
|
var text_default = Text;
|
|
6054
6053
|
|
|
6055
|
-
// src/blocks/
|
|
6054
|
+
// src/blocks/accordion/helpers.ts
|
|
6055
|
+
var convertOrderNumberToString = (order) => {
|
|
6056
|
+
return order.toString();
|
|
6057
|
+
};
|
|
6058
|
+
|
|
6059
|
+
// src/blocks/accordion/accordion.tsx
|
|
6060
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div class=builder-accordion>`);
|
|
6061
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<div>`);
|
|
6062
|
+
function Accordion(props) {
|
|
6063
|
+
const [open, setOpen] = createSignal([]);
|
|
6064
|
+
const onlyOneAtATime = createMemo(() => {
|
|
6065
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
6066
|
+
});
|
|
6067
|
+
const accordionStyles = createMemo(() => {
|
|
6068
|
+
const styles = {
|
|
6069
|
+
display: "flex",
|
|
6070
|
+
alignItems: "stretch",
|
|
6071
|
+
flexDirection: "column",
|
|
6072
|
+
...props.grid && {
|
|
6073
|
+
flexDirection: "row",
|
|
6074
|
+
alignItems: "flex-start",
|
|
6075
|
+
flexWrap: "wrap"
|
|
6076
|
+
}
|
|
6077
|
+
};
|
|
6078
|
+
return Object.fromEntries(Object.entries(styles).map(([key, value]) => [camelToKebabCase(key), value]));
|
|
6079
|
+
});
|
|
6080
|
+
const accordionTitleStyles = createMemo(() => {
|
|
6081
|
+
const shared = {
|
|
6082
|
+
display: "flex",
|
|
6083
|
+
flexDirection: "column"
|
|
6084
|
+
};
|
|
6085
|
+
const styles = Object.fromEntries(Object.entries({
|
|
6086
|
+
...shared,
|
|
6087
|
+
alignItems: "stretch",
|
|
6088
|
+
cursor: "pointer"
|
|
6089
|
+
}).map(([key, value]) => [camelToKebabCase(key), value]));
|
|
6090
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
6091
|
+
});
|
|
6092
|
+
function getAccordionTitleClassName(index) {
|
|
6093
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
6094
|
+
}
|
|
6095
|
+
function getAccordionDetailClassName(index) {
|
|
6096
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
6097
|
+
}
|
|
6098
|
+
const openGridItemOrder = createMemo(() => {
|
|
6099
|
+
let itemOrder = null;
|
|
6100
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
6101
|
+
if (getOpenGridItemPosition && document) {
|
|
6102
|
+
const openItemIndex = open()[0];
|
|
6103
|
+
const openItem = document.querySelector(`.builder-accordion-title[data-index="${openItemIndex}"]`);
|
|
6104
|
+
let subjectItem = openItem;
|
|
6105
|
+
itemOrder = openItemIndex;
|
|
6106
|
+
if (subjectItem) {
|
|
6107
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
6108
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
6109
|
+
if (subjectItem) {
|
|
6110
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
6111
|
+
continue;
|
|
6112
|
+
}
|
|
6113
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
6114
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
6115
|
+
const index = parseInt(subjectItem.getAttribute("data-index") || "", 10);
|
|
6116
|
+
if (!isNaN(index)) {
|
|
6117
|
+
prevItemRect = subjectItemRect;
|
|
6118
|
+
itemOrder = index;
|
|
6119
|
+
}
|
|
6120
|
+
} else {
|
|
6121
|
+
break;
|
|
6122
|
+
}
|
|
6123
|
+
}
|
|
6124
|
+
}
|
|
6125
|
+
}
|
|
6126
|
+
}
|
|
6127
|
+
if (typeof itemOrder === "number") {
|
|
6128
|
+
itemOrder = itemOrder + 1;
|
|
6129
|
+
}
|
|
6130
|
+
return itemOrder;
|
|
6131
|
+
});
|
|
6132
|
+
const accordionDetailStyles = createMemo(() => {
|
|
6133
|
+
const styles = {
|
|
6134
|
+
...{
|
|
6135
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
6136
|
+
},
|
|
6137
|
+
...props.grid && {
|
|
6138
|
+
width: "100%"
|
|
6139
|
+
}
|
|
6140
|
+
};
|
|
6141
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
6142
|
+
});
|
|
6143
|
+
function onClick(index) {
|
|
6144
|
+
if (open().includes(index)) {
|
|
6145
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
6146
|
+
} else {
|
|
6147
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
6148
|
+
}
|
|
6149
|
+
}
|
|
6150
|
+
return (() => {
|
|
6151
|
+
const _el$ = _tmpl$9();
|
|
6152
|
+
insert(_el$, createComponent(For, {
|
|
6153
|
+
get each() {
|
|
6154
|
+
return props.items;
|
|
6155
|
+
},
|
|
6156
|
+
children: (item, _index) => {
|
|
6157
|
+
const index = _index();
|
|
6158
|
+
return [(() => {
|
|
6159
|
+
const _el$2 = _tmpl$24();
|
|
6160
|
+
_el$2.$$click = (event) => onClick(index);
|
|
6161
|
+
setAttribute(_el$2, "data-index", index);
|
|
6162
|
+
insert(_el$2, createComponent(blocks_default, {
|
|
6163
|
+
get blocks() {
|
|
6164
|
+
return item.title;
|
|
6165
|
+
},
|
|
6166
|
+
path: `items.${index}.title`,
|
|
6167
|
+
get parent() {
|
|
6168
|
+
return props.builderBlock.id;
|
|
6169
|
+
},
|
|
6170
|
+
get context() {
|
|
6171
|
+
return props.builderContext;
|
|
6172
|
+
},
|
|
6173
|
+
get registeredComponents() {
|
|
6174
|
+
return props.builderComponents;
|
|
6175
|
+
},
|
|
6176
|
+
get linkComponent() {
|
|
6177
|
+
return props.builderLinkComponent;
|
|
6178
|
+
}
|
|
6179
|
+
}));
|
|
6180
|
+
effect((_p$) => {
|
|
6181
|
+
const _v$ = getAccordionTitleClassName(index), _v$2 = {
|
|
6182
|
+
...accordionTitleStyles(),
|
|
6183
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
6184
|
+
...{
|
|
6185
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
6186
|
+
}
|
|
6187
|
+
};
|
|
6188
|
+
_v$ !== _p$._v$ && className(_el$2, _p$._v$ = _v$);
|
|
6189
|
+
_p$._v$2 = style(_el$2, _v$2, _p$._v$2);
|
|
6190
|
+
return _p$;
|
|
6191
|
+
}, {
|
|
6192
|
+
_v$: void 0,
|
|
6193
|
+
_v$2: void 0
|
|
6194
|
+
});
|
|
6195
|
+
return _el$2;
|
|
6196
|
+
})(), createComponent(Show, {
|
|
6197
|
+
get when() {
|
|
6198
|
+
return open().includes(index);
|
|
6199
|
+
},
|
|
6200
|
+
get children() {
|
|
6201
|
+
const _el$3 = _tmpl$24();
|
|
6202
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
6203
|
+
get blocks() {
|
|
6204
|
+
return item.detail;
|
|
6205
|
+
},
|
|
6206
|
+
path: `items.${index}.detail`,
|
|
6207
|
+
get parent() {
|
|
6208
|
+
return props.builderBlock.id;
|
|
6209
|
+
},
|
|
6210
|
+
get context() {
|
|
6211
|
+
return props.builderContext;
|
|
6212
|
+
},
|
|
6213
|
+
get registeredComponents() {
|
|
6214
|
+
return props.builderComponents;
|
|
6215
|
+
},
|
|
6216
|
+
get linkComponent() {
|
|
6217
|
+
return props.builderLinkComponent;
|
|
6218
|
+
}
|
|
6219
|
+
}));
|
|
6220
|
+
effect((_p$) => {
|
|
6221
|
+
const _v$3 = getAccordionDetailClassName(index), _v$4 = accordionDetailStyles();
|
|
6222
|
+
_v$3 !== _p$._v$3 && className(_el$3, _p$._v$3 = _v$3);
|
|
6223
|
+
_p$._v$4 = style(_el$3, _v$4, _p$._v$4);
|
|
6224
|
+
return _p$;
|
|
6225
|
+
}, {
|
|
6226
|
+
_v$3: void 0,
|
|
6227
|
+
_v$4: void 0
|
|
6228
|
+
});
|
|
6229
|
+
return _el$3;
|
|
6230
|
+
}
|
|
6231
|
+
})];
|
|
6232
|
+
}
|
|
6233
|
+
}));
|
|
6234
|
+
effect((_$p) => style(_el$, accordionStyles(), _$p));
|
|
6235
|
+
return _el$;
|
|
6236
|
+
})();
|
|
6237
|
+
}
|
|
6238
|
+
var accordion_default = Accordion;
|
|
6239
|
+
delegateEvents(["click"]);
|
|
6240
|
+
|
|
6241
|
+
// src/blocks/accordion/component-info.ts
|
|
6242
|
+
var defaultTitle = {
|
|
6243
|
+
"@type": "@builder.io/sdk:Element",
|
|
6244
|
+
layerName: "Accordion item title",
|
|
6245
|
+
responsiveStyles: {
|
|
6246
|
+
large: {
|
|
6247
|
+
marginTop: "10px",
|
|
6248
|
+
position: "relative",
|
|
6249
|
+
display: "flex",
|
|
6250
|
+
alignItems: "stretch",
|
|
6251
|
+
flexDirection: "column",
|
|
6252
|
+
paddingBottom: "10px"
|
|
6253
|
+
}
|
|
6254
|
+
},
|
|
6255
|
+
children: [{
|
|
6256
|
+
"@type": "@builder.io/sdk:Element",
|
|
6257
|
+
responsiveStyles: {
|
|
6258
|
+
large: {
|
|
6259
|
+
textAlign: "left",
|
|
6260
|
+
display: "flex",
|
|
6261
|
+
flexDirection: "column"
|
|
6262
|
+
}
|
|
6263
|
+
},
|
|
6264
|
+
component: {
|
|
6265
|
+
name: "Text",
|
|
6266
|
+
options: {
|
|
6267
|
+
text: "I am an accordion title. Click me!"
|
|
6268
|
+
}
|
|
6269
|
+
}
|
|
6270
|
+
}]
|
|
6271
|
+
};
|
|
6272
|
+
var defaultDetail = {
|
|
6273
|
+
"@type": "@builder.io/sdk:Element",
|
|
6274
|
+
layerName: "Accordion item detail",
|
|
6275
|
+
responsiveStyles: {
|
|
6276
|
+
large: {
|
|
6277
|
+
position: "relative",
|
|
6278
|
+
display: "flex",
|
|
6279
|
+
alignItems: "stretch",
|
|
6280
|
+
flexDirection: "column",
|
|
6281
|
+
marginTop: "10px",
|
|
6282
|
+
paddingBottom: "10px"
|
|
6283
|
+
}
|
|
6284
|
+
},
|
|
6285
|
+
children: [{
|
|
6286
|
+
"@type": "@builder.io/sdk:Element",
|
|
6287
|
+
responsiveStyles: {
|
|
6288
|
+
large: {
|
|
6289
|
+
paddingTop: "50px",
|
|
6290
|
+
textAlign: "left",
|
|
6291
|
+
display: "flex",
|
|
6292
|
+
flexDirection: "column",
|
|
6293
|
+
paddingBottom: "50px"
|
|
6294
|
+
}
|
|
6295
|
+
},
|
|
6296
|
+
component: {
|
|
6297
|
+
name: "Text",
|
|
6298
|
+
options: {
|
|
6299
|
+
text: "I am an accordion detail, hello!"
|
|
6300
|
+
}
|
|
6301
|
+
}
|
|
6302
|
+
}]
|
|
6303
|
+
};
|
|
6056
6304
|
var componentInfo10 = {
|
|
6305
|
+
name: "Builder:Accordion",
|
|
6306
|
+
canHaveChildren: true,
|
|
6307
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
6308
|
+
defaultStyles: {
|
|
6309
|
+
display: "flex",
|
|
6310
|
+
flexDirection: "column",
|
|
6311
|
+
alignItems: "stretch"
|
|
6312
|
+
},
|
|
6313
|
+
inputs: [{
|
|
6314
|
+
name: "items",
|
|
6315
|
+
type: "list",
|
|
6316
|
+
broadcast: true,
|
|
6317
|
+
subFields: [{
|
|
6318
|
+
name: "title",
|
|
6319
|
+
type: "uiBlocks",
|
|
6320
|
+
hideFromUI: true,
|
|
6321
|
+
defaultValue: [defaultTitle]
|
|
6322
|
+
}, {
|
|
6323
|
+
name: "detail",
|
|
6324
|
+
type: "uiBlocks",
|
|
6325
|
+
hideFromUI: true,
|
|
6326
|
+
defaultValue: [defaultDetail]
|
|
6327
|
+
}],
|
|
6328
|
+
defaultValue: [{
|
|
6329
|
+
title: [defaultTitle],
|
|
6330
|
+
detail: [defaultDetail]
|
|
6331
|
+
}, {
|
|
6332
|
+
title: [defaultTitle],
|
|
6333
|
+
detail: [defaultDetail]
|
|
6334
|
+
}],
|
|
6335
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
6336
|
+
}, {
|
|
6337
|
+
name: "oneAtATime",
|
|
6338
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
6339
|
+
type: "boolean",
|
|
6340
|
+
defaultValue: false
|
|
6341
|
+
}, {
|
|
6342
|
+
name: "grid",
|
|
6343
|
+
helperText: "Display as a grid",
|
|
6344
|
+
type: "boolean",
|
|
6345
|
+
defaultValue: false
|
|
6346
|
+
}, {
|
|
6347
|
+
name: "gridRowWidth",
|
|
6348
|
+
helperText: "Display as a grid",
|
|
6349
|
+
type: "string",
|
|
6350
|
+
showIf: (options) => options.get("grid"),
|
|
6351
|
+
defaultValue: "25%"
|
|
6352
|
+
}, {
|
|
6353
|
+
name: "useChildrenForItems",
|
|
6354
|
+
type: "boolean",
|
|
6355
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
6356
|
+
advanced: true,
|
|
6357
|
+
defaultValue: false,
|
|
6358
|
+
onChange: (options) => {
|
|
6359
|
+
if (options.get("useChildrenForItems") === true) {
|
|
6360
|
+
options.set("items", []);
|
|
6361
|
+
}
|
|
6362
|
+
}
|
|
6363
|
+
}]
|
|
6364
|
+
};
|
|
6365
|
+
|
|
6366
|
+
// src/blocks/custom-code/component-info.ts
|
|
6367
|
+
var componentInfo11 = {
|
|
6057
6368
|
name: "Custom Code",
|
|
6058
6369
|
static: true,
|
|
6059
6370
|
requiredPermissions: ["editCode"],
|
|
@@ -6076,7 +6387,7 @@ var componentInfo10 = {
|
|
|
6076
6387
|
advanced: true
|
|
6077
6388
|
}]
|
|
6078
6389
|
};
|
|
6079
|
-
var _tmpl$
|
|
6390
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
|
|
6080
6391
|
function CustomCode(props) {
|
|
6081
6392
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
6082
6393
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -6110,7 +6421,7 @@ function CustomCode(props) {
|
|
|
6110
6421
|
}
|
|
6111
6422
|
});
|
|
6112
6423
|
return (() => {
|
|
6113
|
-
const _el$ = _tmpl$
|
|
6424
|
+
const _el$ = _tmpl$10();
|
|
6114
6425
|
const _ref$ = elementRef;
|
|
6115
6426
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
6116
6427
|
effect((_p$) => {
|
|
@@ -6128,7 +6439,7 @@ function CustomCode(props) {
|
|
|
6128
6439
|
var custom_code_default = CustomCode;
|
|
6129
6440
|
|
|
6130
6441
|
// src/blocks/embed/component-info.ts
|
|
6131
|
-
var
|
|
6442
|
+
var componentInfo12 = {
|
|
6132
6443
|
name: "Embed",
|
|
6133
6444
|
static: true,
|
|
6134
6445
|
inputs: [{
|
|
@@ -6170,7 +6481,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
6170
6481
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
6171
6482
|
|
|
6172
6483
|
// src/blocks/embed/embed.tsx
|
|
6173
|
-
var _tmpl$
|
|
6484
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
6174
6485
|
function Embed(props) {
|
|
6175
6486
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
6176
6487
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -6207,7 +6518,7 @@ function Embed(props) {
|
|
|
6207
6518
|
}
|
|
6208
6519
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
6209
6520
|
return (() => {
|
|
6210
|
-
const _el$ = _tmpl$
|
|
6521
|
+
const _el$ = _tmpl$11();
|
|
6211
6522
|
const _ref$ = elem;
|
|
6212
6523
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
6213
6524
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -6217,7 +6528,7 @@ function Embed(props) {
|
|
|
6217
6528
|
var embed_default = Embed;
|
|
6218
6529
|
|
|
6219
6530
|
// src/blocks/form/form/component-info.ts
|
|
6220
|
-
var
|
|
6531
|
+
var componentInfo13 = {
|
|
6221
6532
|
name: "Form:Form",
|
|
6222
6533
|
// editableTags: ['builder-form-error']
|
|
6223
6534
|
defaults: {
|
|
@@ -6464,8 +6775,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
6464
6775
|
};
|
|
6465
6776
|
|
|
6466
6777
|
// src/blocks/form/form/form.tsx
|
|
6467
|
-
var _tmpl$
|
|
6468
|
-
var _tmpl$
|
|
6778
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<pre>`);
|
|
6779
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<form>`);
|
|
6469
6780
|
function FormComponent(props) {
|
|
6470
6781
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
6471
6782
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -6651,7 +6962,7 @@ function FormComponent(props) {
|
|
|
6651
6962
|
}
|
|
6652
6963
|
let formRef;
|
|
6653
6964
|
return (() => {
|
|
6654
|
-
const _el$ = _tmpl$
|
|
6965
|
+
const _el$ = _tmpl$25();
|
|
6655
6966
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
6656
6967
|
const _ref$ = formRef;
|
|
6657
6968
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -6734,7 +7045,7 @@ function FormComponent(props) {
|
|
|
6734
7045
|
return memo(() => submissionState() === "error")() && responseData();
|
|
6735
7046
|
},
|
|
6736
7047
|
get children() {
|
|
6737
|
-
const _el$2 = _tmpl$
|
|
7048
|
+
const _el$2 = _tmpl$12();
|
|
6738
7049
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
6739
7050
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
6740
7051
|
padding: "10px",
|
|
@@ -6766,7 +7077,7 @@ function FormComponent(props) {
|
|
|
6766
7077
|
var form_default = FormComponent;
|
|
6767
7078
|
|
|
6768
7079
|
// src/blocks/form/input/component-info.ts
|
|
6769
|
-
var
|
|
7080
|
+
var componentInfo14 = {
|
|
6770
7081
|
name: "Form:Input",
|
|
6771
7082
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
6772
7083
|
inputs: [
|
|
@@ -6818,10 +7129,10 @@ var componentInfo13 = {
|
|
|
6818
7129
|
borderColor: "#ccc"
|
|
6819
7130
|
}
|
|
6820
7131
|
};
|
|
6821
|
-
var _tmpl$
|
|
7132
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<input>`);
|
|
6822
7133
|
function FormInputComponent(props) {
|
|
6823
7134
|
return (() => {
|
|
6824
|
-
const _el$ = _tmpl$
|
|
7135
|
+
const _el$ = _tmpl$13();
|
|
6825
7136
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6826
7137
|
get key() {
|
|
6827
7138
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -6851,7 +7162,7 @@ function FormInputComponent(props) {
|
|
|
6851
7162
|
var input_default = FormInputComponent;
|
|
6852
7163
|
|
|
6853
7164
|
// src/blocks/form/select/component-info.ts
|
|
6854
|
-
var
|
|
7165
|
+
var componentInfo15 = {
|
|
6855
7166
|
name: "Form:Select",
|
|
6856
7167
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
6857
7168
|
defaultStyles: {
|
|
@@ -6894,11 +7205,11 @@ var componentInfo14 = {
|
|
|
6894
7205
|
static: true,
|
|
6895
7206
|
noWrap: true
|
|
6896
7207
|
};
|
|
6897
|
-
var _tmpl$
|
|
6898
|
-
var _tmpl$
|
|
7208
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<select>`);
|
|
7209
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<option>`);
|
|
6899
7210
|
function SelectComponent(props) {
|
|
6900
7211
|
return (() => {
|
|
6901
|
-
const _el$ = _tmpl$
|
|
7212
|
+
const _el$ = _tmpl$14();
|
|
6902
7213
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
6903
7214
|
get value() {
|
|
6904
7215
|
return props.value;
|
|
@@ -6920,7 +7231,7 @@ function SelectComponent(props) {
|
|
|
6920
7231
|
children: (option, _index) => {
|
|
6921
7232
|
const index = _index();
|
|
6922
7233
|
return (() => {
|
|
6923
|
-
const _el$2 = _tmpl$
|
|
7234
|
+
const _el$2 = _tmpl$26();
|
|
6924
7235
|
insert(_el$2, () => option.name || option.value);
|
|
6925
7236
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
6926
7237
|
effect(() => _el$2.value = option.value);
|
|
@@ -6934,7 +7245,7 @@ function SelectComponent(props) {
|
|
|
6934
7245
|
var select_default = SelectComponent;
|
|
6935
7246
|
|
|
6936
7247
|
// src/blocks/form/submit-button/component-info.ts
|
|
6937
|
-
var
|
|
7248
|
+
var componentInfo16 = {
|
|
6938
7249
|
name: "Form:SubmitButton",
|
|
6939
7250
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
6940
7251
|
defaultStyles: {
|
|
@@ -6960,10 +7271,10 @@ var componentInfo15 = {
|
|
|
6960
7271
|
// TODO: defaultChildren
|
|
6961
7272
|
// canHaveChildren: true,
|
|
6962
7273
|
};
|
|
6963
|
-
var _tmpl$
|
|
7274
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
6964
7275
|
function SubmitButton(props) {
|
|
6965
7276
|
return (() => {
|
|
6966
|
-
const _el$ = _tmpl$
|
|
7277
|
+
const _el$ = _tmpl$15();
|
|
6967
7278
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
6968
7279
|
insert(_el$, () => props.text);
|
|
6969
7280
|
return _el$;
|
|
@@ -6972,7 +7283,7 @@ function SubmitButton(props) {
|
|
|
6972
7283
|
var submit_button_default = SubmitButton;
|
|
6973
7284
|
|
|
6974
7285
|
// src/blocks/img/component-info.ts
|
|
6975
|
-
var
|
|
7286
|
+
var componentInfo17 = {
|
|
6976
7287
|
// friendlyName?
|
|
6977
7288
|
name: "Raw:Img",
|
|
6978
7289
|
hideFromInsertMenu: true,
|
|
@@ -6987,10 +7298,10 @@ var componentInfo16 = {
|
|
|
6987
7298
|
noWrap: true,
|
|
6988
7299
|
static: true
|
|
6989
7300
|
};
|
|
6990
|
-
var _tmpl$
|
|
7301
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<img>`);
|
|
6991
7302
|
function ImgComponent(props) {
|
|
6992
7303
|
return (() => {
|
|
6993
|
-
const _el$ = _tmpl$
|
|
7304
|
+
const _el$ = _tmpl$16();
|
|
6994
7305
|
spread(_el$, mergeProps({
|
|
6995
7306
|
get style() {
|
|
6996
7307
|
return {
|
|
@@ -7014,7 +7325,7 @@ function ImgComponent(props) {
|
|
|
7014
7325
|
var img_default = ImgComponent;
|
|
7015
7326
|
|
|
7016
7327
|
// src/blocks/video/component-info.ts
|
|
7017
|
-
var
|
|
7328
|
+
var componentInfo18 = {
|
|
7018
7329
|
name: "Video",
|
|
7019
7330
|
canHaveChildren: true,
|
|
7020
7331
|
defaultStyles: {
|
|
@@ -7096,8 +7407,8 @@ var componentInfo17 = {
|
|
|
7096
7407
|
advanced: true
|
|
7097
7408
|
}]
|
|
7098
7409
|
};
|
|
7099
|
-
var _tmpl$
|
|
7100
|
-
var _tmpl$
|
|
7410
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
7411
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<div>`);
|
|
7101
7412
|
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
7102
7413
|
function Video(props) {
|
|
7103
7414
|
const videoProps = createMemo(() => {
|
|
@@ -7159,7 +7470,7 @@ function Video(props) {
|
|
|
7159
7470
|
return !props.lazyLoad;
|
|
7160
7471
|
},
|
|
7161
7472
|
get children() {
|
|
7162
|
-
const _el$3 = _tmpl$
|
|
7473
|
+
const _el$3 = _tmpl$17();
|
|
7163
7474
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
7164
7475
|
return _el$3;
|
|
7165
7476
|
}
|
|
@@ -7169,7 +7480,7 @@ function Video(props) {
|
|
|
7169
7480
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
7170
7481
|
},
|
|
7171
7482
|
get children() {
|
|
7172
|
-
const _el$4 = _tmpl$
|
|
7483
|
+
const _el$4 = _tmpl$27();
|
|
7173
7484
|
_el$4.style.setProperty("width", "100%");
|
|
7174
7485
|
_el$4.style.setProperty("pointer-events", "none");
|
|
7175
7486
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -7182,7 +7493,7 @@ function Video(props) {
|
|
|
7182
7493
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
7183
7494
|
},
|
|
7184
7495
|
get children() {
|
|
7185
|
-
const _el$5 = _tmpl$
|
|
7496
|
+
const _el$5 = _tmpl$27();
|
|
7186
7497
|
_el$5.style.setProperty("display", "flex");
|
|
7187
7498
|
_el$5.style.setProperty("flex-direction", "column");
|
|
7188
7499
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -7195,7 +7506,7 @@ function Video(props) {
|
|
|
7195
7506
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
7196
7507
|
},
|
|
7197
7508
|
get children() {
|
|
7198
|
-
const _el$6 = _tmpl$
|
|
7509
|
+
const _el$6 = _tmpl$27();
|
|
7199
7510
|
_el$6.style.setProperty("pointer-events", "none");
|
|
7200
7511
|
_el$6.style.setProperty("display", "flex");
|
|
7201
7512
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -7217,28 +7528,28 @@ var video_default = Video;
|
|
|
7217
7528
|
// src/constants/extra-components.ts
|
|
7218
7529
|
var getExtraComponents = () => [{
|
|
7219
7530
|
component: custom_code_default,
|
|
7220
|
-
...
|
|
7531
|
+
...componentInfo11
|
|
7221
7532
|
}, {
|
|
7222
7533
|
component: embed_default,
|
|
7223
|
-
...
|
|
7534
|
+
...componentInfo12
|
|
7224
7535
|
}, ...TARGET === "rsc" ? [] : [{
|
|
7225
7536
|
component: form_default,
|
|
7226
|
-
...
|
|
7537
|
+
...componentInfo13
|
|
7227
7538
|
}, {
|
|
7228
7539
|
component: input_default,
|
|
7229
|
-
...
|
|
7540
|
+
...componentInfo14
|
|
7230
7541
|
}, {
|
|
7231
7542
|
component: submit_button_default,
|
|
7232
|
-
...
|
|
7543
|
+
...componentInfo16
|
|
7233
7544
|
}, {
|
|
7234
7545
|
component: select_default,
|
|
7235
|
-
...
|
|
7546
|
+
...componentInfo15
|
|
7236
7547
|
}], {
|
|
7237
7548
|
component: img_default,
|
|
7238
|
-
...
|
|
7549
|
+
...componentInfo17
|
|
7239
7550
|
}, {
|
|
7240
7551
|
component: video_default,
|
|
7241
|
-
...
|
|
7552
|
+
...componentInfo18
|
|
7242
7553
|
}];
|
|
7243
7554
|
|
|
7244
7555
|
// src/constants/builder-registered-components.ts
|
|
@@ -7269,6 +7580,9 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
7269
7580
|
}, ...TARGET === "rsc" ? [] : [{
|
|
7270
7581
|
component: tabs_default,
|
|
7271
7582
|
...componentInfo8
|
|
7583
|
+
}, {
|
|
7584
|
+
component: accordion_default,
|
|
7585
|
+
...componentInfo10
|
|
7272
7586
|
}], ...getExtraComponents()];
|
|
7273
7587
|
|
|
7274
7588
|
// src/functions/register-component.ts
|
|
@@ -7338,10 +7652,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
7338
7652
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
7339
7653
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
7340
7654
|
)`;
|
|
7341
|
-
var _tmpl$
|
|
7655
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<script>`);
|
|
7342
7656
|
function InlinedScript(props) {
|
|
7343
7657
|
return (() => {
|
|
7344
|
-
const _el$ = _tmpl$
|
|
7658
|
+
const _el$ = _tmpl$18();
|
|
7345
7659
|
effect((_p$) => {
|
|
7346
7660
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
7347
7661
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -7403,6 +7717,18 @@ function flatten(object, path = null, separator = ".") {
|
|
|
7403
7717
|
};
|
|
7404
7718
|
}, {});
|
|
7405
7719
|
}
|
|
7720
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
7721
|
+
for (const key in obj) {
|
|
7722
|
+
const value = obj[key];
|
|
7723
|
+
const newKey = _current ? _current + "." + key : key;
|
|
7724
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$"))) {
|
|
7725
|
+
flattenMongoQuery(value, newKey, _res);
|
|
7726
|
+
} else {
|
|
7727
|
+
_res[newKey] = value;
|
|
7728
|
+
}
|
|
7729
|
+
}
|
|
7730
|
+
return _res;
|
|
7731
|
+
}
|
|
7406
7732
|
|
|
7407
7733
|
// src/types/api-version.ts
|
|
7408
7734
|
var DEFAULT_API_VERSION = "v3";
|
|
@@ -7504,7 +7830,7 @@ var generateContentUrl = (options) => {
|
|
|
7504
7830
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
7505
7831
|
}
|
|
7506
7832
|
if (query) {
|
|
7507
|
-
const flattened2 =
|
|
7833
|
+
const flattened2 = flattenMongoQuery({
|
|
7508
7834
|
query
|
|
7509
7835
|
});
|
|
7510
7836
|
for (const key in flattened2) {
|
|
@@ -7835,7 +8161,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7835
8161
|
}
|
|
7836
8162
|
|
|
7837
8163
|
// src/constants/sdk-version.ts
|
|
7838
|
-
var SDK_VERSION = "1.0.
|
|
8164
|
+
var SDK_VERSION = "1.0.28";
|
|
7839
8165
|
|
|
7840
8166
|
// src/functions/register.ts
|
|
7841
8167
|
var registry = {};
|
|
@@ -8317,7 +8643,7 @@ function EnableEditor(props) {
|
|
|
8317
8643
|
});
|
|
8318
8644
|
onMount(() => {
|
|
8319
8645
|
if (!props.apiKey) {
|
|
8320
|
-
logger.error("No API key provided to `
|
|
8646
|
+
logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
8321
8647
|
}
|
|
8322
8648
|
evaluateJsCode();
|
|
8323
8649
|
runHttpRequests();
|
|
@@ -8819,7 +9145,7 @@ var fetchSymbolContent = async ({
|
|
|
8819
9145
|
};
|
|
8820
9146
|
|
|
8821
9147
|
// src/blocks/symbol/symbol.tsx
|
|
8822
|
-
var _tmpl$
|
|
9148
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<div>`);
|
|
8823
9149
|
function Symbol2(props) {
|
|
8824
9150
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
8825
9151
|
const blocksWrapper = createMemo(() => {
|
|
@@ -8851,7 +9177,7 @@ function Symbol2(props) {
|
|
|
8851
9177
|
}
|
|
8852
9178
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
8853
9179
|
return (() => {
|
|
8854
|
-
const _el$ = _tmpl$
|
|
9180
|
+
const _el$ = _tmpl$19();
|
|
8855
9181
|
spread(_el$, mergeProps({
|
|
8856
9182
|
get ["class"]() {
|
|
8857
9183
|
return className();
|