@builder.io/sdk-solid 1.0.27 → 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 +379 -65
- package/lib/browser/dev.jsx +393 -115
- package/lib/browser/index.js +379 -65
- package/lib/browser/index.jsx +393 -115
- package/lib/edge/dev.js +379 -65
- package/lib/edge/dev.jsx +393 -115
- package/lib/edge/index.js +379 -65
- package/lib/edge/index.jsx +393 -115
- package/lib/node/dev.js +379 -65
- package/lib/node/dev.jsx +393 -115
- package/lib/node/index.js +379 -65
- package/lib/node/index.jsx +393 -115
- package/package.json +1 -1
package/lib/node/dev.js
CHANGED
|
@@ -638,6 +638,9 @@ function getProcessedBlock({
|
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
+
// src/functions/camel-to-kebab-case.ts
|
|
642
|
+
var camelToKebabCase = (str) => str ? str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
643
|
+
|
|
641
644
|
// src/components/block/animator.ts
|
|
642
645
|
function throttle(func, wait, options = {}) {
|
|
643
646
|
let context;
|
|
@@ -688,7 +691,6 @@ function assign(target, ..._args) {
|
|
|
688
691
|
}
|
|
689
692
|
return to;
|
|
690
693
|
}
|
|
691
|
-
var camelCaseToKebabCase = (str) => str ? str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`) : "";
|
|
692
694
|
function bindAnimations(animations) {
|
|
693
695
|
for (const animation of animations) {
|
|
694
696
|
switch (animation.trigger) {
|
|
@@ -741,7 +743,7 @@ function triggerAnimation(animation) {
|
|
|
741
743
|
element.style.transitionDelay = "0";
|
|
742
744
|
assign(element.style, animation.steps[0].styles);
|
|
743
745
|
setTimeout(() => {
|
|
744
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
746
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
745
747
|
if (animation.delay) {
|
|
746
748
|
element.style.transitionDelay = animation.delay + "s";
|
|
747
749
|
}
|
|
@@ -801,7 +803,7 @@ function bindScrollInViewAnimation(animation) {
|
|
|
801
803
|
}
|
|
802
804
|
attachDefaultState();
|
|
803
805
|
setTimeout(() => {
|
|
804
|
-
element.style.transition = `all ${animation.duration}s ${
|
|
806
|
+
element.style.transition = `all ${animation.duration}s ${camelToKebabCase(animation.easing)}`;
|
|
805
807
|
if (animation.delay) {
|
|
806
808
|
element.style.transitionDelay = animation.delay + "s";
|
|
807
809
|
}
|
|
@@ -814,9 +816,6 @@ function bindScrollInViewAnimation(animation) {
|
|
|
814
816
|
});
|
|
815
817
|
}
|
|
816
818
|
|
|
817
|
-
// src/functions/camel-to-kebab-case.ts
|
|
818
|
-
var camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
|
|
819
|
-
|
|
820
819
|
// src/helpers/css.ts
|
|
821
820
|
var convertStyleMapToCSSArray = (style) => {
|
|
822
821
|
const cssProps = Object.entries(style).map(([key, value]) => {
|
|
@@ -946,10 +945,10 @@ var getRepeatItemData = ({
|
|
|
946
945
|
return repeatArray;
|
|
947
946
|
};
|
|
948
947
|
var shouldPassLinkComponent = (block) => {
|
|
949
|
-
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
948
|
+
return block && (block.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
950
949
|
};
|
|
951
950
|
var shouldPassRegisteredComponents = (block) => {
|
|
952
|
-
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(block.name));
|
|
951
|
+
return block && (block.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(block.name));
|
|
953
952
|
};
|
|
954
953
|
|
|
955
954
|
// src/constants/device-sizes.ts
|
|
@@ -1078,7 +1077,7 @@ function BlockStyles(props) {
|
|
|
1078
1077
|
className: `${className}:hover`,
|
|
1079
1078
|
styles: {
|
|
1080
1079
|
...hoverStyles,
|
|
1081
|
-
transition: `all ${hoverAnimation.duration}s ${
|
|
1080
|
+
transition: `all ${hoverAnimation.duration}s ${camelToKebabCase(hoverAnimation.easing)}`,
|
|
1082
1081
|
transitionDelay: hoverAnimation.delay ? `${hoverAnimation.delay}s` : "0s"
|
|
1083
1082
|
}
|
|
1084
1083
|
}) || "";
|
|
@@ -2940,8 +2939,12 @@ function Tabs(props) {
|
|
|
2940
2939
|
function activeTabContent(active) {
|
|
2941
2940
|
return props.tabs && props.tabs[active].content;
|
|
2942
2941
|
}
|
|
2943
|
-
function
|
|
2944
|
-
|
|
2942
|
+
function onClick(index) {
|
|
2943
|
+
if (index === activeTab() && props.collapsible) {
|
|
2944
|
+
setActiveTab(-1);
|
|
2945
|
+
} else {
|
|
2946
|
+
setActiveTab(index);
|
|
2947
|
+
}
|
|
2945
2948
|
}
|
|
2946
2949
|
return (() => {
|
|
2947
2950
|
const _el$ = _tmpl$23(), _el$2 = _el$.firstChild;
|
|
@@ -2956,13 +2959,7 @@ function Tabs(props) {
|
|
|
2956
2959
|
const index = _index();
|
|
2957
2960
|
return (() => {
|
|
2958
2961
|
const _el$4 = _tmpl$33();
|
|
2959
|
-
_el$4.$$click = (event) =>
|
|
2960
|
-
if (index === activeTab() && props.collapsible) {
|
|
2961
|
-
setActiveTab(-1);
|
|
2962
|
-
} else {
|
|
2963
|
-
setActiveTab(index);
|
|
2964
|
-
}
|
|
2965
|
-
};
|
|
2962
|
+
_el$4.$$click = (event) => onClick(index);
|
|
2966
2963
|
setAttribute(_el$4, "key", index);
|
|
2967
2964
|
insert(_el$4, createComponent(blocks_default, {
|
|
2968
2965
|
get parent() {
|
|
@@ -2983,7 +2980,9 @@ function Tabs(props) {
|
|
|
2983
2980
|
}
|
|
2984
2981
|
}));
|
|
2985
2982
|
effect((_p$) => {
|
|
2986
|
-
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 =
|
|
2983
|
+
const _v$ = `builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`, _v$2 = {
|
|
2984
|
+
...activeTab() === index ? props.activeTabStyle : {}
|
|
2985
|
+
};
|
|
2987
2986
|
_v$ !== _p$._v$ && className(_el$4, _p$._v$ = _v$);
|
|
2988
2987
|
_p$._v$2 = style(_el$4, _v$2, _p$._v$2);
|
|
2989
2988
|
return _p$;
|
|
@@ -3062,8 +3061,320 @@ function Text(props) {
|
|
|
3062
3061
|
}
|
|
3063
3062
|
var text_default = Text;
|
|
3064
3063
|
|
|
3065
|
-
// src/blocks/
|
|
3064
|
+
// src/blocks/accordion/helpers.ts
|
|
3065
|
+
var convertOrderNumberToString = (order) => {
|
|
3066
|
+
return order.toString();
|
|
3067
|
+
};
|
|
3068
|
+
|
|
3069
|
+
// src/blocks/accordion/accordion.tsx
|
|
3070
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div class=builder-accordion>`);
|
|
3071
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<div>`);
|
|
3072
|
+
function Accordion(props) {
|
|
3073
|
+
const [open, setOpen] = createSignal([]);
|
|
3074
|
+
const onlyOneAtATime = createMemo(() => {
|
|
3075
|
+
return Boolean(props.grid || props.oneAtATime);
|
|
3076
|
+
});
|
|
3077
|
+
const accordionStyles = createMemo(() => {
|
|
3078
|
+
const styles = {
|
|
3079
|
+
display: "flex",
|
|
3080
|
+
alignItems: "stretch",
|
|
3081
|
+
flexDirection: "column",
|
|
3082
|
+
...props.grid && {
|
|
3083
|
+
flexDirection: "row",
|
|
3084
|
+
alignItems: "flex-start",
|
|
3085
|
+
flexWrap: "wrap"
|
|
3086
|
+
}
|
|
3087
|
+
};
|
|
3088
|
+
return Object.fromEntries(Object.entries(styles).map(([key, value]) => [camelToKebabCase(key), value]));
|
|
3089
|
+
});
|
|
3090
|
+
const accordionTitleStyles = createMemo(() => {
|
|
3091
|
+
const shared = {
|
|
3092
|
+
display: "flex",
|
|
3093
|
+
flexDirection: "column"
|
|
3094
|
+
};
|
|
3095
|
+
const styles = Object.fromEntries(Object.entries({
|
|
3096
|
+
...shared,
|
|
3097
|
+
alignItems: "stretch",
|
|
3098
|
+
cursor: "pointer"
|
|
3099
|
+
}).map(([key, value]) => [camelToKebabCase(key), value]));
|
|
3100
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
3101
|
+
});
|
|
3102
|
+
function getAccordionTitleClassName(index) {
|
|
3103
|
+
return `builder-accordion-title builder-accordion-title-${open().includes(index) ? "open" : "closed"}`;
|
|
3104
|
+
}
|
|
3105
|
+
function getAccordionDetailClassName(index) {
|
|
3106
|
+
return `builder-accordion-detail builder-accordion-detail-${open().includes(index) ? "open" : "closed"}`;
|
|
3107
|
+
}
|
|
3108
|
+
const openGridItemOrder = createMemo(() => {
|
|
3109
|
+
let itemOrder = null;
|
|
3110
|
+
const getOpenGridItemPosition = props.grid && open().length;
|
|
3111
|
+
if (getOpenGridItemPosition && document) {
|
|
3112
|
+
const openItemIndex = open()[0];
|
|
3113
|
+
const openItem = document.querySelector(`.builder-accordion-title[data-index="${openItemIndex}"]`);
|
|
3114
|
+
let subjectItem = openItem;
|
|
3115
|
+
itemOrder = openItemIndex;
|
|
3116
|
+
if (subjectItem) {
|
|
3117
|
+
let prevItemRect = subjectItem.getBoundingClientRect();
|
|
3118
|
+
while (subjectItem = subjectItem && subjectItem.nextElementSibling) {
|
|
3119
|
+
if (subjectItem) {
|
|
3120
|
+
if (subjectItem.classList.contains("builder-accordion-detail")) {
|
|
3121
|
+
continue;
|
|
3122
|
+
}
|
|
3123
|
+
const subjectItemRect = subjectItem.getBoundingClientRect();
|
|
3124
|
+
if (subjectItemRect.left > prevItemRect.left) {
|
|
3125
|
+
const index = parseInt(subjectItem.getAttribute("data-index") || "", 10);
|
|
3126
|
+
if (!isNaN(index)) {
|
|
3127
|
+
prevItemRect = subjectItemRect;
|
|
3128
|
+
itemOrder = index;
|
|
3129
|
+
}
|
|
3130
|
+
} else {
|
|
3131
|
+
break;
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
}
|
|
3136
|
+
}
|
|
3137
|
+
if (typeof itemOrder === "number") {
|
|
3138
|
+
itemOrder = itemOrder + 1;
|
|
3139
|
+
}
|
|
3140
|
+
return itemOrder;
|
|
3141
|
+
});
|
|
3142
|
+
const accordionDetailStyles = createMemo(() => {
|
|
3143
|
+
const styles = {
|
|
3144
|
+
...{
|
|
3145
|
+
order: typeof openGridItemOrder() === "number" ? openGridItemOrder() : void 0
|
|
3146
|
+
},
|
|
3147
|
+
...props.grid && {
|
|
3148
|
+
width: "100%"
|
|
3149
|
+
}
|
|
3150
|
+
};
|
|
3151
|
+
return Object.fromEntries(Object.entries(styles).filter(([_, value]) => value !== void 0));
|
|
3152
|
+
});
|
|
3153
|
+
function onClick(index) {
|
|
3154
|
+
if (open().includes(index)) {
|
|
3155
|
+
setOpen(onlyOneAtATime() ? [] : open().filter((item) => item !== index));
|
|
3156
|
+
} else {
|
|
3157
|
+
setOpen(onlyOneAtATime() ? [index] : open().concat(index));
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
return (() => {
|
|
3161
|
+
const _el$ = _tmpl$9();
|
|
3162
|
+
insert(_el$, createComponent(For, {
|
|
3163
|
+
get each() {
|
|
3164
|
+
return props.items;
|
|
3165
|
+
},
|
|
3166
|
+
children: (item, _index) => {
|
|
3167
|
+
const index = _index();
|
|
3168
|
+
return [(() => {
|
|
3169
|
+
const _el$2 = _tmpl$24();
|
|
3170
|
+
_el$2.$$click = (event) => onClick(index);
|
|
3171
|
+
setAttribute(_el$2, "data-index", index);
|
|
3172
|
+
insert(_el$2, createComponent(blocks_default, {
|
|
3173
|
+
get blocks() {
|
|
3174
|
+
return item.title;
|
|
3175
|
+
},
|
|
3176
|
+
path: `items.${index}.title`,
|
|
3177
|
+
get parent() {
|
|
3178
|
+
return props.builderBlock.id;
|
|
3179
|
+
},
|
|
3180
|
+
get context() {
|
|
3181
|
+
return props.builderContext;
|
|
3182
|
+
},
|
|
3183
|
+
get registeredComponents() {
|
|
3184
|
+
return props.builderComponents;
|
|
3185
|
+
},
|
|
3186
|
+
get linkComponent() {
|
|
3187
|
+
return props.builderLinkComponent;
|
|
3188
|
+
}
|
|
3189
|
+
}));
|
|
3190
|
+
effect((_p$) => {
|
|
3191
|
+
const _v$ = getAccordionTitleClassName(index), _v$2 = {
|
|
3192
|
+
...accordionTitleStyles(),
|
|
3193
|
+
width: props.grid ? props.gridRowWidth : void 0,
|
|
3194
|
+
...{
|
|
3195
|
+
order: openGridItemOrder() !== null ? convertOrderNumberToString(index) : convertOrderNumberToString(index + 1)
|
|
3196
|
+
}
|
|
3197
|
+
};
|
|
3198
|
+
_v$ !== _p$._v$ && className(_el$2, _p$._v$ = _v$);
|
|
3199
|
+
_p$._v$2 = style(_el$2, _v$2, _p$._v$2);
|
|
3200
|
+
return _p$;
|
|
3201
|
+
}, {
|
|
3202
|
+
_v$: void 0,
|
|
3203
|
+
_v$2: void 0
|
|
3204
|
+
});
|
|
3205
|
+
return _el$2;
|
|
3206
|
+
})(), createComponent(Show, {
|
|
3207
|
+
get when() {
|
|
3208
|
+
return open().includes(index);
|
|
3209
|
+
},
|
|
3210
|
+
get children() {
|
|
3211
|
+
const _el$3 = _tmpl$24();
|
|
3212
|
+
insert(_el$3, createComponent(blocks_default, {
|
|
3213
|
+
get blocks() {
|
|
3214
|
+
return item.detail;
|
|
3215
|
+
},
|
|
3216
|
+
path: `items.${index}.detail`,
|
|
3217
|
+
get parent() {
|
|
3218
|
+
return props.builderBlock.id;
|
|
3219
|
+
},
|
|
3220
|
+
get context() {
|
|
3221
|
+
return props.builderContext;
|
|
3222
|
+
},
|
|
3223
|
+
get registeredComponents() {
|
|
3224
|
+
return props.builderComponents;
|
|
3225
|
+
},
|
|
3226
|
+
get linkComponent() {
|
|
3227
|
+
return props.builderLinkComponent;
|
|
3228
|
+
}
|
|
3229
|
+
}));
|
|
3230
|
+
effect((_p$) => {
|
|
3231
|
+
const _v$3 = getAccordionDetailClassName(index), _v$4 = accordionDetailStyles();
|
|
3232
|
+
_v$3 !== _p$._v$3 && className(_el$3, _p$._v$3 = _v$3);
|
|
3233
|
+
_p$._v$4 = style(_el$3, _v$4, _p$._v$4);
|
|
3234
|
+
return _p$;
|
|
3235
|
+
}, {
|
|
3236
|
+
_v$3: void 0,
|
|
3237
|
+
_v$4: void 0
|
|
3238
|
+
});
|
|
3239
|
+
return _el$3;
|
|
3240
|
+
}
|
|
3241
|
+
})];
|
|
3242
|
+
}
|
|
3243
|
+
}));
|
|
3244
|
+
effect((_$p) => style(_el$, accordionStyles(), _$p));
|
|
3245
|
+
return _el$;
|
|
3246
|
+
})();
|
|
3247
|
+
}
|
|
3248
|
+
var accordion_default = Accordion;
|
|
3249
|
+
delegateEvents(["click"]);
|
|
3250
|
+
|
|
3251
|
+
// src/blocks/accordion/component-info.ts
|
|
3252
|
+
var defaultTitle = {
|
|
3253
|
+
"@type": "@builder.io/sdk:Element",
|
|
3254
|
+
layerName: "Accordion item title",
|
|
3255
|
+
responsiveStyles: {
|
|
3256
|
+
large: {
|
|
3257
|
+
marginTop: "10px",
|
|
3258
|
+
position: "relative",
|
|
3259
|
+
display: "flex",
|
|
3260
|
+
alignItems: "stretch",
|
|
3261
|
+
flexDirection: "column",
|
|
3262
|
+
paddingBottom: "10px"
|
|
3263
|
+
}
|
|
3264
|
+
},
|
|
3265
|
+
children: [{
|
|
3266
|
+
"@type": "@builder.io/sdk:Element",
|
|
3267
|
+
responsiveStyles: {
|
|
3268
|
+
large: {
|
|
3269
|
+
textAlign: "left",
|
|
3270
|
+
display: "flex",
|
|
3271
|
+
flexDirection: "column"
|
|
3272
|
+
}
|
|
3273
|
+
},
|
|
3274
|
+
component: {
|
|
3275
|
+
name: "Text",
|
|
3276
|
+
options: {
|
|
3277
|
+
text: "I am an accordion title. Click me!"
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
}]
|
|
3281
|
+
};
|
|
3282
|
+
var defaultDetail = {
|
|
3283
|
+
"@type": "@builder.io/sdk:Element",
|
|
3284
|
+
layerName: "Accordion item detail",
|
|
3285
|
+
responsiveStyles: {
|
|
3286
|
+
large: {
|
|
3287
|
+
position: "relative",
|
|
3288
|
+
display: "flex",
|
|
3289
|
+
alignItems: "stretch",
|
|
3290
|
+
flexDirection: "column",
|
|
3291
|
+
marginTop: "10px",
|
|
3292
|
+
paddingBottom: "10px"
|
|
3293
|
+
}
|
|
3294
|
+
},
|
|
3295
|
+
children: [{
|
|
3296
|
+
"@type": "@builder.io/sdk:Element",
|
|
3297
|
+
responsiveStyles: {
|
|
3298
|
+
large: {
|
|
3299
|
+
paddingTop: "50px",
|
|
3300
|
+
textAlign: "left",
|
|
3301
|
+
display: "flex",
|
|
3302
|
+
flexDirection: "column",
|
|
3303
|
+
paddingBottom: "50px"
|
|
3304
|
+
}
|
|
3305
|
+
},
|
|
3306
|
+
component: {
|
|
3307
|
+
name: "Text",
|
|
3308
|
+
options: {
|
|
3309
|
+
text: "I am an accordion detail, hello!"
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
}]
|
|
3313
|
+
};
|
|
3066
3314
|
var componentInfo10 = {
|
|
3315
|
+
name: "Builder:Accordion",
|
|
3316
|
+
canHaveChildren: true,
|
|
3317
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
3318
|
+
defaultStyles: {
|
|
3319
|
+
display: "flex",
|
|
3320
|
+
flexDirection: "column",
|
|
3321
|
+
alignItems: "stretch"
|
|
3322
|
+
},
|
|
3323
|
+
inputs: [{
|
|
3324
|
+
name: "items",
|
|
3325
|
+
type: "list",
|
|
3326
|
+
broadcast: true,
|
|
3327
|
+
subFields: [{
|
|
3328
|
+
name: "title",
|
|
3329
|
+
type: "uiBlocks",
|
|
3330
|
+
hideFromUI: true,
|
|
3331
|
+
defaultValue: [defaultTitle]
|
|
3332
|
+
}, {
|
|
3333
|
+
name: "detail",
|
|
3334
|
+
type: "uiBlocks",
|
|
3335
|
+
hideFromUI: true,
|
|
3336
|
+
defaultValue: [defaultDetail]
|
|
3337
|
+
}],
|
|
3338
|
+
defaultValue: [{
|
|
3339
|
+
title: [defaultTitle],
|
|
3340
|
+
detail: [defaultDetail]
|
|
3341
|
+
}, {
|
|
3342
|
+
title: [defaultTitle],
|
|
3343
|
+
detail: [defaultDetail]
|
|
3344
|
+
}],
|
|
3345
|
+
showIf: (options) => !options.get("useChildrenForItems")
|
|
3346
|
+
}, {
|
|
3347
|
+
name: "oneAtATime",
|
|
3348
|
+
helperText: "Only allow opening one at a time (collapse all others when new item openned)",
|
|
3349
|
+
type: "boolean",
|
|
3350
|
+
defaultValue: false
|
|
3351
|
+
}, {
|
|
3352
|
+
name: "grid",
|
|
3353
|
+
helperText: "Display as a grid",
|
|
3354
|
+
type: "boolean",
|
|
3355
|
+
defaultValue: false
|
|
3356
|
+
}, {
|
|
3357
|
+
name: "gridRowWidth",
|
|
3358
|
+
helperText: "Display as a grid",
|
|
3359
|
+
type: "string",
|
|
3360
|
+
showIf: (options) => options.get("grid"),
|
|
3361
|
+
defaultValue: "25%"
|
|
3362
|
+
}, {
|
|
3363
|
+
name: "useChildrenForItems",
|
|
3364
|
+
type: "boolean",
|
|
3365
|
+
helperText: "Use child elements for each slide, instead of the array. Useful for dynamically repeating items",
|
|
3366
|
+
advanced: true,
|
|
3367
|
+
defaultValue: false,
|
|
3368
|
+
onChange: (options) => {
|
|
3369
|
+
if (options.get("useChildrenForItems") === true) {
|
|
3370
|
+
options.set("items", []);
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
}]
|
|
3374
|
+
};
|
|
3375
|
+
|
|
3376
|
+
// src/blocks/custom-code/component-info.ts
|
|
3377
|
+
var componentInfo11 = {
|
|
3067
3378
|
name: "Custom Code",
|
|
3068
3379
|
static: true,
|
|
3069
3380
|
requiredPermissions: ["editCode"],
|
|
@@ -3086,7 +3397,7 @@ var componentInfo10 = {
|
|
|
3086
3397
|
advanced: true
|
|
3087
3398
|
}]
|
|
3088
3399
|
};
|
|
3089
|
-
var _tmpl$
|
|
3400
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
|
|
3090
3401
|
function CustomCode(props) {
|
|
3091
3402
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3092
3403
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3121,7 +3432,7 @@ function CustomCode(props) {
|
|
|
3121
3432
|
}
|
|
3122
3433
|
});
|
|
3123
3434
|
return (() => {
|
|
3124
|
-
const _el$ = _tmpl$
|
|
3435
|
+
const _el$ = _tmpl$10();
|
|
3125
3436
|
const _ref$ = elementRef;
|
|
3126
3437
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
|
|
3127
3438
|
effect((_p$) => {
|
|
@@ -3139,7 +3450,7 @@ function CustomCode(props) {
|
|
|
3139
3450
|
var custom_code_default = CustomCode;
|
|
3140
3451
|
|
|
3141
3452
|
// src/blocks/embed/component-info.ts
|
|
3142
|
-
var
|
|
3453
|
+
var componentInfo12 = {
|
|
3143
3454
|
name: "Embed",
|
|
3144
3455
|
static: true,
|
|
3145
3456
|
inputs: [{
|
|
@@ -3181,7 +3492,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
|
|
|
3181
3492
|
var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
|
|
3182
3493
|
|
|
3183
3494
|
// src/blocks/embed/embed.tsx
|
|
3184
|
-
var _tmpl$
|
|
3495
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div class=builder-embed>`);
|
|
3185
3496
|
function Embed(props) {
|
|
3186
3497
|
const [scriptsInserted, setScriptsInserted] = createSignal([]);
|
|
3187
3498
|
const [scriptsRun, setScriptsRun] = createSignal([]);
|
|
@@ -3219,7 +3530,7 @@ function Embed(props) {
|
|
|
3219
3530
|
}
|
|
3220
3531
|
createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
|
|
3221
3532
|
return (() => {
|
|
3222
|
-
const _el$ = _tmpl$
|
|
3533
|
+
const _el$ = _tmpl$11();
|
|
3223
3534
|
const _ref$ = elem;
|
|
3224
3535
|
typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
|
|
3225
3536
|
effect(() => _el$.innerHTML = props.content);
|
|
@@ -3229,7 +3540,7 @@ function Embed(props) {
|
|
|
3229
3540
|
var embed_default = Embed;
|
|
3230
3541
|
|
|
3231
3542
|
// src/blocks/form/form/component-info.ts
|
|
3232
|
-
var
|
|
3543
|
+
var componentInfo13 = {
|
|
3233
3544
|
name: "Form:Form",
|
|
3234
3545
|
// editableTags: ['builder-form-error']
|
|
3235
3546
|
defaults: {
|
|
@@ -3476,8 +3787,8 @@ var get = (obj, path, defaultValue) => {
|
|
|
3476
3787
|
};
|
|
3477
3788
|
|
|
3478
3789
|
// src/blocks/form/form/form.tsx
|
|
3479
|
-
var _tmpl$
|
|
3480
|
-
var _tmpl$
|
|
3790
|
+
var _tmpl$12 = /* @__PURE__ */ template(`<pre>`);
|
|
3791
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<form>`);
|
|
3481
3792
|
function FormComponent(props) {
|
|
3482
3793
|
const [formState, setFormState] = createSignal("unsubmitted");
|
|
3483
3794
|
const [responseData, setResponseData] = createSignal(null);
|
|
@@ -3663,7 +3974,7 @@ function FormComponent(props) {
|
|
|
3663
3974
|
}
|
|
3664
3975
|
let formRef;
|
|
3665
3976
|
return (() => {
|
|
3666
|
-
const _el$ = _tmpl$
|
|
3977
|
+
const _el$ = _tmpl$25();
|
|
3667
3978
|
_el$.addEventListener("submit", (event) => onSubmit(event));
|
|
3668
3979
|
const _ref$ = formRef;
|
|
3669
3980
|
typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
|
|
@@ -3746,7 +4057,7 @@ function FormComponent(props) {
|
|
|
3746
4057
|
return memo(() => submissionState() === "error")() && responseData();
|
|
3747
4058
|
},
|
|
3748
4059
|
get children() {
|
|
3749
|
-
const _el$2 = _tmpl$
|
|
4060
|
+
const _el$2 = _tmpl$12();
|
|
3750
4061
|
insert(_el$2, () => JSON.stringify(responseData(), null, 2));
|
|
3751
4062
|
effect(() => className(_el$2, "builder-form-error-text " + css({
|
|
3752
4063
|
padding: "10px",
|
|
@@ -3778,7 +4089,7 @@ function FormComponent(props) {
|
|
|
3778
4089
|
var form_default = FormComponent;
|
|
3779
4090
|
|
|
3780
4091
|
// src/blocks/form/input/component-info.ts
|
|
3781
|
-
var
|
|
4092
|
+
var componentInfo14 = {
|
|
3782
4093
|
name: "Form:Input",
|
|
3783
4094
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
3784
4095
|
inputs: [
|
|
@@ -3830,10 +4141,10 @@ var componentInfo13 = {
|
|
|
3830
4141
|
borderColor: "#ccc"
|
|
3831
4142
|
}
|
|
3832
4143
|
};
|
|
3833
|
-
var _tmpl$
|
|
4144
|
+
var _tmpl$13 = /* @__PURE__ */ template(`<input>`);
|
|
3834
4145
|
function FormInputComponent(props) {
|
|
3835
4146
|
return (() => {
|
|
3836
|
-
const _el$ = _tmpl$
|
|
4147
|
+
const _el$ = _tmpl$13();
|
|
3837
4148
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3838
4149
|
get key() {
|
|
3839
4150
|
return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
|
|
@@ -3863,7 +4174,7 @@ function FormInputComponent(props) {
|
|
|
3863
4174
|
var input_default = FormInputComponent;
|
|
3864
4175
|
|
|
3865
4176
|
// src/blocks/form/select/component-info.ts
|
|
3866
|
-
var
|
|
4177
|
+
var componentInfo15 = {
|
|
3867
4178
|
name: "Form:Select",
|
|
3868
4179
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
3869
4180
|
defaultStyles: {
|
|
@@ -3906,11 +4217,11 @@ var componentInfo14 = {
|
|
|
3906
4217
|
static: true,
|
|
3907
4218
|
noWrap: true
|
|
3908
4219
|
};
|
|
3909
|
-
var _tmpl$
|
|
3910
|
-
var _tmpl$
|
|
4220
|
+
var _tmpl$14 = /* @__PURE__ */ template(`<select>`);
|
|
4221
|
+
var _tmpl$26 = /* @__PURE__ */ template(`<option>`);
|
|
3911
4222
|
function SelectComponent(props) {
|
|
3912
4223
|
return (() => {
|
|
3913
|
-
const _el$ = _tmpl$
|
|
4224
|
+
const _el$ = _tmpl$14();
|
|
3914
4225
|
spread(_el$, mergeProps({}, () => props.attributes, {
|
|
3915
4226
|
get value() {
|
|
3916
4227
|
return props.value;
|
|
@@ -3932,7 +4243,7 @@ function SelectComponent(props) {
|
|
|
3932
4243
|
children: (option, _index) => {
|
|
3933
4244
|
const index = _index();
|
|
3934
4245
|
return (() => {
|
|
3935
|
-
const _el$2 = _tmpl$
|
|
4246
|
+
const _el$2 = _tmpl$26();
|
|
3936
4247
|
insert(_el$2, () => option.name || option.value);
|
|
3937
4248
|
effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
|
|
3938
4249
|
effect(() => _el$2.value = option.value);
|
|
@@ -3946,7 +4257,7 @@ function SelectComponent(props) {
|
|
|
3946
4257
|
var select_default = SelectComponent;
|
|
3947
4258
|
|
|
3948
4259
|
// src/blocks/form/submit-button/component-info.ts
|
|
3949
|
-
var
|
|
4260
|
+
var componentInfo16 = {
|
|
3950
4261
|
name: "Form:SubmitButton",
|
|
3951
4262
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
3952
4263
|
defaultStyles: {
|
|
@@ -3972,10 +4283,10 @@ var componentInfo15 = {
|
|
|
3972
4283
|
// TODO: defaultChildren
|
|
3973
4284
|
// canHaveChildren: true,
|
|
3974
4285
|
};
|
|
3975
|
-
var _tmpl$
|
|
4286
|
+
var _tmpl$15 = /* @__PURE__ */ template(`<button type=submit>`);
|
|
3976
4287
|
function SubmitButton(props) {
|
|
3977
4288
|
return (() => {
|
|
3978
|
-
const _el$ = _tmpl$
|
|
4289
|
+
const _el$ = _tmpl$15();
|
|
3979
4290
|
spread(_el$, mergeProps({}, () => props.attributes), false, true);
|
|
3980
4291
|
insert(_el$, () => props.text);
|
|
3981
4292
|
return _el$;
|
|
@@ -3984,7 +4295,7 @@ function SubmitButton(props) {
|
|
|
3984
4295
|
var submit_button_default = SubmitButton;
|
|
3985
4296
|
|
|
3986
4297
|
// src/blocks/img/component-info.ts
|
|
3987
|
-
var
|
|
4298
|
+
var componentInfo17 = {
|
|
3988
4299
|
// friendlyName?
|
|
3989
4300
|
name: "Raw:Img",
|
|
3990
4301
|
hideFromInsertMenu: true,
|
|
@@ -3999,10 +4310,10 @@ var componentInfo16 = {
|
|
|
3999
4310
|
noWrap: true,
|
|
4000
4311
|
static: true
|
|
4001
4312
|
};
|
|
4002
|
-
var _tmpl$
|
|
4313
|
+
var _tmpl$16 = /* @__PURE__ */ template(`<img>`);
|
|
4003
4314
|
function ImgComponent(props) {
|
|
4004
4315
|
return (() => {
|
|
4005
|
-
const _el$ = _tmpl$
|
|
4316
|
+
const _el$ = _tmpl$16();
|
|
4006
4317
|
spread(_el$, mergeProps({
|
|
4007
4318
|
get style() {
|
|
4008
4319
|
return {
|
|
@@ -4026,7 +4337,7 @@ function ImgComponent(props) {
|
|
|
4026
4337
|
var img_default = ImgComponent;
|
|
4027
4338
|
|
|
4028
4339
|
// src/blocks/video/component-info.ts
|
|
4029
|
-
var
|
|
4340
|
+
var componentInfo18 = {
|
|
4030
4341
|
name: "Video",
|
|
4031
4342
|
canHaveChildren: true,
|
|
4032
4343
|
defaultStyles: {
|
|
@@ -4108,8 +4419,8 @@ var componentInfo17 = {
|
|
|
4108
4419
|
advanced: true
|
|
4109
4420
|
}]
|
|
4110
4421
|
};
|
|
4111
|
-
var _tmpl$
|
|
4112
|
-
var _tmpl$
|
|
4422
|
+
var _tmpl$17 = /* @__PURE__ */ template(`<source type=video/mp4>`);
|
|
4423
|
+
var _tmpl$27 = /* @__PURE__ */ template(`<div>`);
|
|
4113
4424
|
var _tmpl$34 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
|
|
4114
4425
|
function Video(props) {
|
|
4115
4426
|
const videoProps = createMemo(() => {
|
|
@@ -4171,7 +4482,7 @@ function Video(props) {
|
|
|
4171
4482
|
return !props.lazyLoad;
|
|
4172
4483
|
},
|
|
4173
4484
|
get children() {
|
|
4174
|
-
const _el$3 = _tmpl$
|
|
4485
|
+
const _el$3 = _tmpl$17();
|
|
4175
4486
|
effect(() => setAttribute(_el$3, "src", props.video));
|
|
4176
4487
|
return _el$3;
|
|
4177
4488
|
}
|
|
@@ -4181,7 +4492,7 @@ function Video(props) {
|
|
|
4181
4492
|
return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
|
|
4182
4493
|
},
|
|
4183
4494
|
get children() {
|
|
4184
|
-
const _el$4 = _tmpl$
|
|
4495
|
+
const _el$4 = _tmpl$27();
|
|
4185
4496
|
_el$4.style.setProperty("width", "100%");
|
|
4186
4497
|
_el$4.style.setProperty("pointer-events", "none");
|
|
4187
4498
|
_el$4.style.setProperty("font-size", "0px");
|
|
@@ -4194,7 +4505,7 @@ function Video(props) {
|
|
|
4194
4505
|
return props.builderBlock?.children?.length && props.fitContent;
|
|
4195
4506
|
},
|
|
4196
4507
|
get children() {
|
|
4197
|
-
const _el$5 = _tmpl$
|
|
4508
|
+
const _el$5 = _tmpl$27();
|
|
4198
4509
|
_el$5.style.setProperty("display", "flex");
|
|
4199
4510
|
_el$5.style.setProperty("flex-direction", "column");
|
|
4200
4511
|
_el$5.style.setProperty("align-items", "stretch");
|
|
@@ -4207,7 +4518,7 @@ function Video(props) {
|
|
|
4207
4518
|
return props.builderBlock?.children?.length && !props.fitContent;
|
|
4208
4519
|
},
|
|
4209
4520
|
get children() {
|
|
4210
|
-
const _el$6 = _tmpl$
|
|
4521
|
+
const _el$6 = _tmpl$27();
|
|
4211
4522
|
_el$6.style.setProperty("pointer-events", "none");
|
|
4212
4523
|
_el$6.style.setProperty("display", "flex");
|
|
4213
4524
|
_el$6.style.setProperty("flex-direction", "column");
|
|
@@ -4229,28 +4540,28 @@ var video_default = Video;
|
|
|
4229
4540
|
// src/constants/extra-components.ts
|
|
4230
4541
|
var getExtraComponents = () => [{
|
|
4231
4542
|
component: custom_code_default,
|
|
4232
|
-
...
|
|
4543
|
+
...componentInfo11
|
|
4233
4544
|
}, {
|
|
4234
4545
|
component: embed_default,
|
|
4235
|
-
...
|
|
4546
|
+
...componentInfo12
|
|
4236
4547
|
}, ...TARGET === "rsc" ? [] : [{
|
|
4237
4548
|
component: form_default,
|
|
4238
|
-
...
|
|
4549
|
+
...componentInfo13
|
|
4239
4550
|
}, {
|
|
4240
4551
|
component: input_default,
|
|
4241
|
-
...
|
|
4552
|
+
...componentInfo14
|
|
4242
4553
|
}, {
|
|
4243
4554
|
component: submit_button_default,
|
|
4244
|
-
...
|
|
4555
|
+
...componentInfo16
|
|
4245
4556
|
}, {
|
|
4246
4557
|
component: select_default,
|
|
4247
|
-
...
|
|
4558
|
+
...componentInfo15
|
|
4248
4559
|
}], {
|
|
4249
4560
|
component: img_default,
|
|
4250
|
-
...
|
|
4561
|
+
...componentInfo17
|
|
4251
4562
|
}, {
|
|
4252
4563
|
component: video_default,
|
|
4253
|
-
...
|
|
4564
|
+
...componentInfo18
|
|
4254
4565
|
}];
|
|
4255
4566
|
|
|
4256
4567
|
// src/constants/builder-registered-components.ts
|
|
@@ -4281,6 +4592,9 @@ var getDefaultRegisteredComponents = () => [{
|
|
|
4281
4592
|
}, ...TARGET === "rsc" ? [] : [{
|
|
4282
4593
|
component: tabs_default,
|
|
4283
4594
|
...componentInfo8
|
|
4595
|
+
}, {
|
|
4596
|
+
component: accordion_default,
|
|
4597
|
+
...componentInfo10
|
|
4284
4598
|
}], ...getExtraComponents()];
|
|
4285
4599
|
|
|
4286
4600
|
// src/functions/register-component.ts
|
|
@@ -4350,10 +4664,10 @@ var getUpdateVariantVisibilityScript = ({
|
|
|
4350
4664
|
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
4351
4665
|
"${variationId}", "${contentId}", ${isHydrationTarget}
|
|
4352
4666
|
)`;
|
|
4353
|
-
var _tmpl$
|
|
4667
|
+
var _tmpl$18 = /* @__PURE__ */ template(`<script>`);
|
|
4354
4668
|
function InlinedScript(props) {
|
|
4355
4669
|
return (() => {
|
|
4356
|
-
const _el$ = _tmpl$
|
|
4670
|
+
const _el$ = _tmpl$18();
|
|
4357
4671
|
effect((_p$) => {
|
|
4358
4672
|
const _v$ = props.scriptStr, _v$2 = props.id;
|
|
4359
4673
|
_v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
|
|
@@ -4864,7 +5178,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4864
5178
|
}
|
|
4865
5179
|
|
|
4866
5180
|
// src/constants/sdk-version.ts
|
|
4867
|
-
var SDK_VERSION = "1.0.
|
|
5181
|
+
var SDK_VERSION = "1.0.28";
|
|
4868
5182
|
|
|
4869
5183
|
// src/functions/register.ts
|
|
4870
5184
|
var registry = {};
|
|
@@ -5348,7 +5662,7 @@ function EnableEditor(props) {
|
|
|
5348
5662
|
});
|
|
5349
5663
|
onMount(() => {
|
|
5350
5664
|
if (!props.apiKey) {
|
|
5351
|
-
logger.error("No API key provided to `
|
|
5665
|
+
logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
5352
5666
|
}
|
|
5353
5667
|
evaluateJsCode();
|
|
5354
5668
|
runHttpRequests();
|
|
@@ -5850,7 +6164,7 @@ var fetchSymbolContent = async ({
|
|
|
5850
6164
|
};
|
|
5851
6165
|
|
|
5852
6166
|
// src/blocks/symbol/symbol.tsx
|
|
5853
|
-
var _tmpl$
|
|
6167
|
+
var _tmpl$19 = /* @__PURE__ */ template(`<div>`);
|
|
5854
6168
|
function Symbol(props) {
|
|
5855
6169
|
const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
|
|
5856
6170
|
const blocksWrapper = createMemo(() => {
|
|
@@ -5882,7 +6196,7 @@ function Symbol(props) {
|
|
|
5882
6196
|
}
|
|
5883
6197
|
createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
|
|
5884
6198
|
return (() => {
|
|
5885
|
-
const _el$ = _tmpl$
|
|
6199
|
+
const _el$ = _tmpl$19();
|
|
5886
6200
|
spread(_el$, mergeProps({
|
|
5887
6201
|
get ["class"]() {
|
|
5888
6202
|
return className();
|