@builder.io/sdk-react 1.0.19-dev-0 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +13 -13
- package/lib/browser/blocks-exports.mjs +339 -349
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-cfff49d1.js → server-entry-a562cf23.js} +1 -1
- package/lib/browser/{server-entry-1a86f409.cjs → server-entry-a77461d4.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-87a3568e.cjs → blocks-523eb4f1.cjs} +4 -4
- package/lib/edge/{blocks-03aafa4f.js → blocks-683aad9f.js} +26 -26
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-58695538.cjs → button-0d418bcf.cjs} +1 -1
- package/lib/edge/{button-14d13356.js → button-9f6acf3e.js} +3 -3
- package/lib/edge/{columns-f98bd830.cjs → columns-1613d62d.cjs} +2 -2
- package/lib/edge/{columns-d2f7e212.js → columns-b0785992.js} +33 -33
- package/lib/edge/{content-variants-ad9f707f.js → content-variants-13f821c6.js} +68 -68
- package/lib/edge/{content-variants-7e661199.cjs → content-variants-281298f6.cjs} +5 -5
- package/lib/edge/dynamic-renderer-8b343325.js +8 -0
- package/lib/edge/{dynamic-renderer-1c9f24c0.cjs → dynamic-renderer-b29b45ca.cjs} +1 -1
- package/lib/edge/form-0483aa64.cjs +1 -0
- package/lib/edge/{form-04cf10db.js → form-db27fc26.js} +56 -66
- package/lib/edge/{get-class-prop-name-859a7f60.js → get-class-prop-name-6bfc4756.js} +1 -1
- package/lib/edge/{get-class-prop-name-f1301669.cjs → get-class-prop-name-e3ba0522.cjs} +1 -1
- package/lib/edge/{image-2cc909d9.js → image-0008c792.js} +25 -25
- package/lib/edge/image-ee3dd857.cjs +17 -0
- package/lib/edge/{img-b4ff1bef.js → img-43a8ffe0.js} +1 -1
- package/lib/edge/{img-0c1e53c0.cjs → img-f01d904d.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-c6fee09c.js → input-805a9ac6.js} +1 -1
- package/lib/edge/{input-2103da14.cjs → input-e6483bd7.cjs} +1 -1
- package/lib/edge/select-4966723f.js +20 -0
- package/lib/edge/select-e5d1e627.cjs +1 -0
- package/lib/edge/{server-entry-00891f33.cjs → server-entry-83648311.cjs} +1 -1
- package/lib/edge/{server-entry-d46a218d.js → server-entry-c13e82bd.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-8fa7f242.js → slot-1b0351de.js} +4 -4
- package/lib/edge/{slot-bb84f342.cjs → slot-3ef77ae1.cjs} +1 -1
- package/lib/edge/{symbol-636383eb.cjs → symbol-883d624f.cjs} +1 -1
- package/lib/edge/{symbol-324dadc8.js → symbol-f1632f93.js} +2 -2
- package/lib/edge/{video-d02ff89b.js → video-58c2cc8d.js} +15 -15
- package/lib/edge/video-e20dcbbc.cjs +1 -0
- package/lib/node/blocks-exports.cjs +72 -32
- package/lib/node/blocks-exports.mjs +1018 -902
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +22 -23
- package/lib/node/{server-entry-8c84ddbd.js → server-entry-8c712c9b.js} +1 -1
- package/lib/node/{server-entry-ff6fc2b4.cjs → server-entry-bedf45f8.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -6
- package/types/blocks/button/button.d.ts +1 -1
- package/types/blocks/button/button.types.d.ts +1 -1
- package/types/blocks/button/component-info.d.ts +1 -1
- package/types/blocks/columns/columns.d.ts +1 -1
- package/types/blocks/columns/columns.types.d.ts +2 -2
- package/types/blocks/columns/component-info.d.ts +1 -1
- package/types/blocks/custom-code/component-info.d.ts +1 -1
- package/types/blocks/embed/component-info.d.ts +1 -1
- package/types/blocks/form/form/component-info.d.ts +1 -1
- package/types/blocks/form/form/form.d.ts +2 -2
- package/types/blocks/form/input/component-info.d.ts +1 -1
- package/types/blocks/form/select/component-info.d.ts +1 -1
- package/types/blocks/form/submit-button/component-info.d.ts +1 -1
- package/types/blocks/fragment/component-info.d.ts +1 -1
- package/types/blocks/fragment/fragment.d.ts +1 -1
- package/types/blocks/image/component-info.d.ts +1 -1
- package/types/blocks/image/image.d.ts +1 -1
- package/types/blocks/image/image.types.d.ts +1 -1
- package/types/blocks/img/component-info.d.ts +1 -1
- package/types/blocks/raw-text/component-info.d.ts +1 -1
- package/types/blocks/section/component-info.d.ts +1 -1
- package/types/blocks/section/section.d.ts +1 -1
- package/types/blocks/slot/component-info.d.ts +1 -1
- package/types/blocks/slot/slot.d.ts +1 -1
- package/types/blocks/symbol/component-info.d.ts +1 -1
- package/types/blocks/symbol/symbol.d.ts +1 -1
- package/types/blocks/symbol/symbol.helpers.d.ts +2 -2
- package/types/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/blocks/text/component-info.d.ts +1 -1
- package/types/blocks/text/text.d.ts +1 -1
- package/types/blocks/textarea/component-info.d.ts +1 -1
- package/types/blocks/video/component-info.d.ts +1 -1
- package/types/blocks/video/video.d.ts +1 -1
- package/types/blocks/video/video.types.d.ts +1 -1
- package/types/components/block/animator.d.ts +1 -1
- package/types/components/block/block.d.ts +2 -2
- package/types/components/block/block.helpers.d.ts +4 -4
- package/types/components/block/components/block-styles.d.ts +2 -2
- package/types/components/block/components/block-wrapper.d.ts +2 -2
- package/types/components/block/components/component-ref/component-ref.d.ts +1 -1
- package/types/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/types/components/block/components/interactive-element.d.ts +3 -3
- package/types/components/block/components/repeated-block.d.ts +1 -1
- package/types/components/block/types.d.ts +2 -2
- package/types/components/blocks/blocks-wrapper.d.ts +1 -1
- package/types/components/blocks/blocks.d.ts +1 -1
- package/types/components/blocks/blocks.types.d.ts +1 -1
- package/types/components/content/components/enable-editor.d.ts +2 -2
- package/types/components/content/components/styles.d.ts +1 -1
- package/types/components/content/content.d.ts +1 -1
- package/types/components/content/content.helpers.d.ts +3 -3
- package/types/components/content/content.types.d.ts +2 -2
- package/types/components/content/contentProps.types.d.ts +2 -2
- package/types/components/content-variants/content-variants.d.ts +1 -1
- package/types/components/content-variants/content-variants.types.d.ts +4 -4
- package/types/components/content-variants/helpers.d.ts +5 -5
- package/types/constants/builder-registered-components.d.ts +1 -1
- package/types/constants/extra-components.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/index.d.ts +1 -1
- package/types/context/types.d.ts +4 -4
- package/types/functions/evaluate/browser-runtime/browser.d.ts +2 -2
- package/types/functions/evaluate/browser-runtime/index.d.ts +1 -1
- package/types/functions/evaluate/choose-eval.d.ts +1 -1
- package/types/functions/evaluate/edge-runtime/edge-runtime.d.ts +1 -1
- package/types/functions/evaluate/edge-runtime/index.d.ts +1 -1
- package/types/functions/evaluate/evaluate.d.ts +1 -1
- package/types/functions/evaluate/helpers.d.ts +3 -3
- package/types/functions/evaluate/index.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/node-runtime.d.ts +1 -2
- package/types/functions/evaluate/placeholder-runtime.d.ts +1 -1
- package/types/functions/fetch-builder-props.d.ts +3 -3
- package/types/functions/get-block-actions-handler.d.ts +2 -2
- package/types/functions/get-block-actions.d.ts +2 -2
- package/types/functions/get-block-component-options.d.ts +1 -1
- package/types/functions/get-block-properties.d.ts +2 -2
- package/types/functions/get-builder-search-params/index.d.ts +1 -1
- package/types/functions/get-content/generate-content-url.d.ts +1 -1
- package/types/functions/get-content/index.d.ts +2 -2
- package/types/functions/get-processed-block.d.ts +2 -2
- package/types/functions/get-style.d.ts +2 -2
- package/types/functions/is-editing.d.ts +1 -1
- package/types/functions/is-previewing.d.ts +1 -1
- package/types/functions/register-component.d.ts +1 -1
- package/types/functions/register.d.ts +2 -2
- package/types/functions/track/index.d.ts +2 -2
- package/types/functions/transform-block-properties.d.ts +2 -2
- package/types/functions/transform-block.d.ts +1 -1
- package/types/functions/transform-style-property.d.ts +2 -2
- package/types/helpers/ab-tests.d.ts +3 -3
- package/types/helpers/cookie.d.ts +1 -1
- package/types/helpers/localStorage.d.ts +2 -2
- package/types/helpers/preview-lru-cache/get.d.ts +1 -1
- package/types/helpers/preview-lru-cache/set.d.ts +1 -1
- package/types/helpers/sessionId.d.ts +1 -1
- package/types/helpers/subscribe-to-editor.d.ts +3 -3
- package/types/helpers/visitorId.d.ts +1 -1
- package/types/index-helpers/blocks-exports.d.ts +11 -11
- package/types/index.d.ts +3 -3
- package/types/server-index.d.ts +27 -27
- package/types/types/builder-content.d.ts +3 -3
- package/types/types/builder-props.d.ts +2 -2
- package/types/types/components.d.ts +2 -2
- package/types/types/enforced-partials.d.ts +1 -1
- package/lib/edge/dynamic-renderer-96ba4e48.js +0 -8
- package/lib/edge/form-e83f7b7a.cjs +0 -1
- package/lib/edge/image-7e1361ce.cjs +0 -17
- package/lib/edge/select-b8ad0a4c.cjs +0 -1
- package/lib/edge/select-f260d051.js +0 -20
- package/lib/edge/video-64014cc4.cjs +0 -1
- package/lib/node/init.cjs +0 -1
- package/lib/node/init.mjs +0 -8
- package/lib/node/node-runtime-1ca09d03.js +0 -137
- package/lib/node/node-runtime-56212f7c.cjs +0 -41
- package/types/blocks/form/component-info.d.ts +0 -2
- package/types/blocks/form/form.d.ts +0 -3
- package/types/blocks/input/component-info.d.ts +0 -2
- package/types/blocks/input/input.d.ts +0 -15
- package/types/blocks/select/component-info.d.ts +0 -2
- package/types/blocks/select/select.d.ts +0 -16
- package/types/blocks/submit-button/component-info.d.ts +0 -2
- package/types/blocks/submit-button/submit-button.d.ts +0 -10
- package/types/components/content/components/context-updater.d.ts +0 -5
- package/types/components/dynamic-renderer.d.ts +0 -3
- package/types/functions/evaluate/node-runtime/init.d.ts +0 -2
- package/types/functions/get-react-native-block-styles.d.ts +0 -15
- package/types/functions/sanitize-react-native-block-styles.d.ts +0 -3
- package/types/functions/sanitize-rn-allowed-css.d.ts +0 -8
- package/types/node-runtime/index.d.ts +0 -1
- package/types/node-runtime/node-runtime.d.ts +0 -9
- package/types/node-runtime.d.ts +0 -1
package/lib/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-bedf45f8.cjs");require("react/jsx-runtime");require("react");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/node/index.mjs
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { Blocks as
|
|
2
|
-
import { _processContentResult as
|
|
1
|
+
import { Blocks as i, BuilderContext as s, Button as n, Columns as c, Content as m, Fragment as g, Image as a, Section as d, Symbol as l, Text as p, Video as u } from "./blocks-exports.mjs";
|
|
2
|
+
import { _processContentResult as B, createRegisterComponentMessage as C, fetchBuilderProps as E, fetchEntries as h, fetchOneEntry as x, getBuilderSearchParams as S, isEditing as b, isPreviewing as P, register as k, setEditorSettings as y, subscribeToEditor as R, track as T } from "./server-entry-8c712c9b.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./node-runtime-1ca09d03.js";
|
|
6
5
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
i as Blocks,
|
|
7
|
+
s as BuilderContext,
|
|
8
|
+
n as Button,
|
|
10
9
|
c as Columns,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
m as Content,
|
|
11
|
+
g as Fragment,
|
|
12
|
+
a as Image,
|
|
14
13
|
d as Section,
|
|
15
14
|
l as Symbol,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
p as Text,
|
|
16
|
+
u as Video,
|
|
17
|
+
B as _processContentResult,
|
|
18
|
+
C as createRegisterComponentMessage,
|
|
19
|
+
E as fetchBuilderProps,
|
|
20
|
+
h as fetchEntries,
|
|
21
|
+
x as fetchOneEntry,
|
|
22
|
+
S as getBuilderSearchParams,
|
|
23
|
+
b as isEditing,
|
|
24
|
+
P as isPreviewing,
|
|
25
|
+
k as register,
|
|
26
|
+
y as setEditorSettings,
|
|
27
|
+
R as subscribeToEditor,
|
|
28
|
+
T as track
|
|
30
29
|
};
|
|
@@ -477,7 +477,7 @@ function H(e, t) {
|
|
|
477
477
|
const n = new URL(t.origin), r = n.hostname;
|
|
478
478
|
return (e || je).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
479
479
|
}
|
|
480
|
-
const De = "1.0.
|
|
480
|
+
const De = "1.0.20", T = {};
|
|
481
481
|
function Ke(e, t) {
|
|
482
482
|
let n = T[e];
|
|
483
483
|
if (n || (n = T[e] = []), n.push(t), c()) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";const b="react",I="[Builder.io]: ",d={log:(...e)=>console.log(I,...e),error:(...e)=>console.error(I,...e),warn:(...e)=>console.warn(I,...e),debug:(...e)=>console.debug(I,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const ce=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},M=e=>e instanceof URLSearchParams?ce(e):e,F=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function ue(){return c()&&window.self!==window.top}function k(e){return ue()&&F(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const de=()=>{if(c()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},le=()=>typeof navigator=="object"&&navigator.userAgent||"",N=()=>{const e=le(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||b==="reactNative"}},n=e.match(/Tablet|iPad/i),r=de();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},C=e=>JSON.parse(JSON.stringify(e)),p=e=>e!=null,fe=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},D=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},j=async e=>D(e),ge=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),he=[["secure",""],["SameSite","None"]],pe=({name:e,value:t,expires:n})=>{const o=(c()?location.protocol==="https:":!0)?he:[[]],s=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...s,["path","/"],["domain",fe(window.location.hostname)],...o];return ge(a)},_=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=pe({name:e,value:t,expires:n});document.cookie=o}catch(o){d.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}},me="builder.tests",P=e=>`${me}.${e}`,ye=({contentId:e})=>j({name:P(e),canTrack:!0}),we=({contentId:e})=>D({name:P(e),canTrack:!0}),Se=({contentId:e,value:t})=>_({name:P(e),value:t,canTrack:!0}),K=e=>p(e.id)&&p(e.variations)&&Object.keys(e.variations).length>0,be=({id:e,variations:t})=>{var o;let n=0;const r=Math.random();for(const s in t){const a=(o=t[s])==null?void 0:o.testRatio;if(n+=a,r<n)return s}return e},W=e=>{const t=be(e);return Se({contentId:e.id,value:t}).catch(n=>{d.error("could not store A/B test variation: ",n)}),t},$=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},Ie=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!K(e))return e;const n=we({contentId:e.id})||W({variations:e.variations,id:e.id}),r=$({item:e,testGroupId:n});return{...e,...r}},ve=async({item:e,canTrack:t})=>{if(!t||!K(e))return e;const r=await ye({contentId:e.id})||W({variations:e.variations,id:e.id}),o=$({item:e,testGroupId:r});return{...e,...o}},G=e=>p(e)?e:!0,Ee=e=>({type:"builder.registerComponent",data:z(e)}),ke=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},Ce=e=>typeof e=="function"?ke(e):C(e),z=({inputs:e,...t})=>({...C(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((r,[o,s])=>({...r,[o]:Ce(s)}),{}))});function Pe(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function Oe(){const e=Pe().fetch;if(typeof e=="undefined")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
2
|
-
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const J=Oe();function v(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],a=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...v(s,a,n)}:{...r,[a]:s}},{})}const Te="v3",R="builder.",xe="options.",O=e=>{if(!e)return{};const t=M(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(R)){const o=r.replace(R,"").replace(xe,"");n[o]=t[r]}}),n},Ae=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return O(e)},B=e=>typeof e=="number"&&!isNaN(e)&&e>=0,T=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:s,enrich:a,locale:l,apiVersion:y=Te,fields:m,omit:E,offset:u,cacheSeconds:g,staleCacheSeconds:h,sort:w,includeUnpublished:x}=e;if(!s)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const ie=t!==1,i=new URL(`https://cdn.builder.io/api/${y}/content/${o}`);if(i.searchParams.set("apiKey",s),i.searchParams.set("limit",String(t)),i.searchParams.set("noTraverse",String(ie)),i.searchParams.set("includeRefs",String(!0)),l&&i.searchParams.set("locale",l),a&&i.searchParams.set("enrich",String(a)),i.searchParams.set("omit",E||"meta.componentsUsed"),m&&i.searchParams.set("fields",m),Number.isFinite(u)&&u>-1&&i.searchParams.set("offset",String(Math.floor(u))),typeof x=="boolean"&&i.searchParams.set("includeUnpublished",String(x)),g&&B(g)&&i.searchParams.set("cacheSeconds",String(g)),h&&B(h)&&i.searchParams.set("staleCacheSeconds",String(h)),w){const f=v({sort:w});for(const S in f)i.searchParams.set(S,JSON.stringify(f[S]))}const ae={...Ae(),...M(e.options||{})},A=v(ae);for(const f in A)i.searchParams.set(f,String(A[f]));if(n&&i.searchParams.set("userAttributes",JSON.stringify(n)),r){const f=v({query:r});for(const S in f)i.searchParams.set(S,JSON.stringify(f[S]))}return i},Re=e=>"results"in e;async function H(e){const t=await q({...e,limit:1});return t&&t[0]||null}const Be=async e=>{var s;const t=T(e);return await(await((s=e.fetch)!=null?s:J)(t.href,e.fetchOptions)).json()},X=async(e,t,n=T(e))=>{const r=G(e.canTrack);if(n.search.includes("preview="),!r||!(c()||b==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await ve({item:s,canTrack:r}));t.results=o}catch(o){d.error("Could not process A/B tests. ",o)}return t.results};async function q(e){try{const t=T(e),n=await Be(e);return Re(n)?X(e,n):(d.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return d.error("Error fetching data. ",t),null}}function Le(e){if(!c())return!1;const t=F(e||window.location.search);return k(t)?!1:t.indexOf("builder.preview=")!==-1}function Ve(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Y(){return Ve().replace(/-/g,"")}const Q="builderSessionId",Ue=async({canTrack:e})=>{if(!e)return;const t=await j({name:Q,canTrack:e});if(p(t))return t;{const n=Me();return Fe({id:n,canTrack:e}),n}},Me=()=>Y(),Fe=({id:e,canTrack:t})=>_({name:Q,value:e,canTrack:t}),Z=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Ne=({key:e,canTrack:t})=>{var n;try{return t?(n=Z())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},De=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=Z())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},ee="builderVisitorId",je=({canTrack:e})=>{if(!e)return;const t=Ne({key:ee,canTrack:e});if(p(t))return t;{const n=_e();return Ke({id:n,canTrack:e}),n}},_e=()=>Y(),Ke=({id:e,canTrack:t})=>De({key:ee,value:e,canTrack:t}),We=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ue({canTrack:e}),n=je({canTrack:e});return{sessionId:t,visitorId:n}},$e=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await We({canTrack:t}),userAttributes:N(),ownerId:n}});async function te(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!k()&&(c()||b==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await $e(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Ge=e=>te({...e,canTrack:!0}),ze=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function ne(e,t){const n=new URL(t.origin),r=n.hostname;return(e||ze).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Je="1.0.
|
|
2
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const J=Oe();function v(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],a=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...v(s,a,n)}:{...r,[a]:s}},{})}const Te="v3",R="builder.",xe="options.",O=e=>{if(!e)return{};const t=M(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(R)){const o=r.replace(R,"").replace(xe,"");n[o]=t[r]}}),n},Ae=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return O(e)},B=e=>typeof e=="number"&&!isNaN(e)&&e>=0,T=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:s,enrich:a,locale:l,apiVersion:y=Te,fields:m,omit:E,offset:u,cacheSeconds:g,staleCacheSeconds:h,sort:w,includeUnpublished:x}=e;if(!s)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const ie=t!==1,i=new URL(`https://cdn.builder.io/api/${y}/content/${o}`);if(i.searchParams.set("apiKey",s),i.searchParams.set("limit",String(t)),i.searchParams.set("noTraverse",String(ie)),i.searchParams.set("includeRefs",String(!0)),l&&i.searchParams.set("locale",l),a&&i.searchParams.set("enrich",String(a)),i.searchParams.set("omit",E||"meta.componentsUsed"),m&&i.searchParams.set("fields",m),Number.isFinite(u)&&u>-1&&i.searchParams.set("offset",String(Math.floor(u))),typeof x=="boolean"&&i.searchParams.set("includeUnpublished",String(x)),g&&B(g)&&i.searchParams.set("cacheSeconds",String(g)),h&&B(h)&&i.searchParams.set("staleCacheSeconds",String(h)),w){const f=v({sort:w});for(const S in f)i.searchParams.set(S,JSON.stringify(f[S]))}const ae={...Ae(),...M(e.options||{})},A=v(ae);for(const f in A)i.searchParams.set(f,String(A[f]));if(n&&i.searchParams.set("userAttributes",JSON.stringify(n)),r){const f=v({query:r});for(const S in f)i.searchParams.set(S,JSON.stringify(f[S]))}return i},Re=e=>"results"in e;async function H(e){const t=await q({...e,limit:1});return t&&t[0]||null}const Be=async e=>{var s;const t=T(e);return await(await((s=e.fetch)!=null?s:J)(t.href,e.fetchOptions)).json()},X=async(e,t,n=T(e))=>{const r=G(e.canTrack);if(n.search.includes("preview="),!r||!(c()||b==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await ve({item:s,canTrack:r}));t.results=o}catch(o){d.error("Could not process A/B tests. ",o)}return t.results};async function q(e){try{const t=T(e),n=await Be(e);return Re(n)?X(e,n):(d.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return d.error("Error fetching data. ",t),null}}function Le(e){if(!c())return!1;const t=F(e||window.location.search);return k(t)?!1:t.indexOf("builder.preview=")!==-1}function Ve(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Y(){return Ve().replace(/-/g,"")}const Q="builderSessionId",Ue=async({canTrack:e})=>{if(!e)return;const t=await j({name:Q,canTrack:e});if(p(t))return t;{const n=Me();return Fe({id:n,canTrack:e}),n}},Me=()=>Y(),Fe=({id:e,canTrack:t})=>_({name:Q,value:e,canTrack:t}),Z=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Ne=({key:e,canTrack:t})=>{var n;try{return t?(n=Z())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},De=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=Z())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},ee="builderVisitorId",je=({canTrack:e})=>{if(!e)return;const t=Ne({key:ee,canTrack:e});if(p(t))return t;{const n=_e();return Ke({id:n,canTrack:e}),n}},_e=()=>Y(),Ke=({id:e,canTrack:t})=>De({key:ee,value:e,canTrack:t}),We=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ue({canTrack:e}),n=je({canTrack:e});return{sessionId:t,visitorId:n}},$e=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await We({canTrack:t}),userAttributes:N(),ownerId:n}});async function te(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!k()&&(c()||b==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await $e(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Ge=e=>te({...e,canTrack:!0}),ze=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function ne(e,t){const n=new URL(t.origin),r=n.hostname;return(e||ze).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Je="1.0.20",L={};function re(e,t){let n=L[e];if(n||(n=L[e]=[]),n.push(t),c()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const He=()=>{re("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let V=!1;const oe=(e={})=>{var t,n;V||(V=!0,c()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:b,version:Je,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var s,a;if(!ne(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const l=o.data.text,y=o.data.arguments||[],m=o.data.id,E=new Function(l);let u,g=null;try{u=E.apply(null,y)}catch(h){g=h}g?(s=window.parent)==null||s.postMessage({type:"builder.evaluateError",data:{id:m,error:g.message}},"*"):u&&typeof u.then=="function"?u.then(h=>{var w;(w=window.parent)==null||w.postMessage({type:"builder.evaluateResult",data:{id:m,result:h}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:u,id:m}},"*");break}}})))},se=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!ne(t,r))return;const{data:o}=r;if(o)switch(o.type){case"builder.configureSdk":{n.configureSdk(o.data);break}case"builder.triggerAnimation":{n.animation(o.data);break}case"builder.contentUpdate":{const s=o.data,a=s.key||s.alias||s.entry||s.modelName,l=s.data;a===e&&n.contentUpdate(l);break}}},Xe=(e,t,n)=>{if(!c)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};oe();const r=se({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},U={};function qe(e){if(c()){Object.assign(U,e);const t={type:"builder.settingsChange",data:U};parent.postMessage(t,"*")}}const Ye=async e=>{var r,o,s;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((o=e.userAttributes)==null?void 0:o.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:O(e.searchParams||((s=e.url)==null?void 0:s.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await H(n)}};exports.TARGET=b;exports._processContentResult=X;exports._track=te;exports.checkIsDefined=p;exports.createEditorListener=se;exports.createRegisterComponentMessage=Ee;exports.fastClone=C;exports.fetch=J;exports.fetchBuilderProps=Ye;exports.fetchEntries=q;exports.fetchOneEntry=H;exports.getBuilderSearchParams=O;exports.getDefaultCanTrack=G;exports.getUserAttributes=N;exports.handleABTestingSync=Ie;exports.isBrowser=c;exports.isEditing=k;exports.isPreviewing=Le;exports.logger=d;exports.register=re;exports.registerInsertMenu=He;exports.serializeComponentInfo=z;exports.setEditorSettings=qe;exports.setupBrowserForEditing=oe;exports.subscribeToEditor=Xe;exports.track=Ge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-bedf45f8.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-
|
|
1
|
+
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-8c712c9b.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
s as createRegisterComponentMessage,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react",
|
|
3
3
|
"description": "Builder.io SDK for React",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.20",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/react",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -79,11 +79,6 @@
|
|
|
79
79
|
"require": "./lib/browser/index.cjs"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
-
"./init": {
|
|
83
|
-
"types": "./types/index.d.ts",
|
|
84
|
-
"import": "./lib/node/init.mjs",
|
|
85
|
-
"require": "./lib/node/init.cjs"
|
|
86
|
-
},
|
|
87
82
|
"./edge": {
|
|
88
83
|
"types": "./types/index.d.ts",
|
|
89
84
|
"import": "./lib/edge/edge-entry.mjs",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuilderBlock } from '../../types/builder-block
|
|
2
|
-
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block';
|
|
2
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props';
|
|
3
3
|
type Column = {
|
|
4
4
|
blocks: BuilderBlock[];
|
|
5
5
|
width?: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -27,7 +27,7 @@ export type FormProps = BuilderDataProps & BuilderComponentsProp & BuilderLinkCo
|
|
|
27
27
|
* This import is used by the Svelte SDK. Do not remove.
|
|
28
28
|
*/
|
|
29
29
|
export type FormState = "unsubmitted" | "sending" | "success" | "error";
|
|
30
|
-
import type { BuilderBlock } from "../../../types/builder-block
|
|
31
|
-
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from "../../../types/builder-props
|
|
30
|
+
import type { BuilderBlock } from "../../../types/builder-block";
|
|
31
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from "../../../types/builder-props";
|
|
32
32
|
declare function FormComponent(props: FormProps): React.JSX.Element;
|
|
33
33
|
export default FormComponent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -3,6 +3,6 @@ export type DropzoneProps = BuilderDataProps & {
|
|
|
3
3
|
name: string;
|
|
4
4
|
attributes: any;
|
|
5
5
|
};
|
|
6
|
-
import type { BuilderDataProps } from "../../types/builder-props
|
|
6
|
+
import type { BuilderDataProps } from "../../types/builder-props";
|
|
7
7
|
declare function Slot(props: DropzoneProps): React.JSX.Element;
|
|
8
8
|
export default Slot;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../../context/types
|
|
2
|
-
import type { BuilderContent } from '../../types/builder-content
|
|
1
|
+
import type { BuilderContextInterface } from '../../context/types';
|
|
2
|
+
import type { BuilderContent } from '../../types/builder-content';
|
|
3
3
|
export interface SymbolInfo {
|
|
4
4
|
model?: string;
|
|
5
5
|
entry?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuilderContent } from '../../types/builder-content
|
|
2
|
-
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props
|
|
1
|
+
import type { BuilderContent } from '../../types/builder-content';
|
|
2
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props';
|
|
3
3
|
interface SymbolInfo {
|
|
4
4
|
model?: string;
|
|
5
5
|
entry?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BuilderAnimation } from '../../types/builder-block
|
|
1
|
+
import type { BuilderAnimation } from '../../types/builder-block';
|
|
2
2
|
export declare function bindAnimations(animations: BuilderAnimation[]): void;
|
|
3
3
|
export declare function triggerAnimation(animation: BuilderAnimation): void;
|
|
4
4
|
export declare function bindHoverAnimation(animation: BuilderAnimation): void;
|
|
@@ -5,7 +5,7 @@ export type BlockProps = {
|
|
|
5
5
|
registeredComponents: RegisteredComponents;
|
|
6
6
|
linkComponent: any;
|
|
7
7
|
};
|
|
8
|
-
import type { BuilderContextInterface, RegisteredComponents } from "../../context/types
|
|
9
|
-
import type { BuilderBlock } from "../../types/builder-block
|
|
8
|
+
import type { BuilderContextInterface, RegisteredComponents } from "../../context/types";
|
|
9
|
+
import type { BuilderBlock } from "../../types/builder-block";
|
|
10
10
|
declare function Block(props: BlockProps): React.JSX.Element;
|
|
11
11
|
export default Block;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { BuilderContextInterface, RegisteredComponents } from '../../context/types
|
|
2
|
-
import type { BuilderBlock } from '../../types/builder-block
|
|
3
|
-
import type { RepeatData } from './types
|
|
1
|
+
import type { BuilderContextInterface, RegisteredComponents } from '../../context/types';
|
|
2
|
+
import type { BuilderBlock } from '../../types/builder-block';
|
|
3
|
+
import type { RepeatData } from './types';
|
|
4
4
|
export declare const getComponent: ({ block, context, registeredComponents }: {
|
|
5
5
|
block: BuilderBlock;
|
|
6
6
|
context: BuilderContextInterface;
|
|
7
7
|
registeredComponents: RegisteredComponents;
|
|
8
|
-
}) => import("../../context/types
|
|
8
|
+
}) => import("../../context/types").RegisteredComponent;
|
|
9
9
|
export declare const getRepeatItemData: ({ block, context }: {
|
|
10
10
|
block: BuilderBlock;
|
|
11
11
|
context: BuilderContextInterface;
|
|
@@ -3,7 +3,7 @@ export type BlockStylesProps = {
|
|
|
3
3
|
block: BuilderBlock;
|
|
4
4
|
context: BuilderContextInterface;
|
|
5
5
|
};
|
|
6
|
-
import type { BuilderContextInterface } from "../../../context/types
|
|
7
|
-
import type { BuilderBlock } from "../../../types/builder-block
|
|
6
|
+
import type { BuilderContextInterface } from "../../../context/types";
|
|
7
|
+
import type { BuilderBlock } from "../../../types/builder-block";
|
|
8
8
|
declare function BlockStyles(props: BlockStylesProps): React.JSX.Element;
|
|
9
9
|
export default BlockStyles;
|
|
@@ -9,7 +9,7 @@ type BlockWrapperProps = {
|
|
|
9
9
|
/**
|
|
10
10
|
* This component renders a block's wrapper HTML element (from the block's `tagName` property).
|
|
11
11
|
*/
|
|
12
|
-
import type { BuilderContextInterface } from "../../../context/types
|
|
13
|
-
import type { BuilderBlock } from "../../../types/builder-block
|
|
12
|
+
import type { BuilderContextInterface } from "../../../context/types";
|
|
13
|
+
import type { BuilderBlock } from "../../../types/builder-block";
|
|
14
14
|
declare function BlockWrapper(props: BlockWrapperProps): React.JSX.Element;
|
|
15
15
|
export default BlockWrapper;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BuilderContextInterface, RegisteredComponents } from '../../../../context/types
|
|
2
|
-
import type { BuilderBlock } from '../../../../types/builder-block
|
|
3
|
-
import type { BuilderDataProps } from '../../../../types/builder-props
|
|
1
|
+
import type { BuilderContextInterface, RegisteredComponents } from '../../../../context/types';
|
|
2
|
+
import type { BuilderBlock } from '../../../../types/builder-block';
|
|
3
|
+
import type { BuilderDataProps } from '../../../../types/builder-props';
|
|
4
4
|
import type { InteractiveElementProps } from '../interactive-element';
|
|
5
5
|
type ComponentOptions = BuilderDataProps & {
|
|
6
6
|
[index: string]: any;
|
|
@@ -7,8 +7,8 @@ export type InteractiveElementProps = {
|
|
|
7
7
|
includeBlockProps: boolean;
|
|
8
8
|
children?: any;
|
|
9
9
|
};
|
|
10
|
-
import type { BuilderContextInterface } from "../../../context/types
|
|
11
|
-
import type { BuilderBlock } from "../../../types/builder-block
|
|
12
|
-
import type { Dictionary } from "../../../types/typescript
|
|
10
|
+
import type { BuilderContextInterface } from "../../../context/types";
|
|
11
|
+
import type { BuilderBlock } from "../../../types/builder-block";
|
|
12
|
+
import type { Dictionary } from "../../../types/typescript";
|
|
13
13
|
declare function InteractiveElement(props: InteractiveElementProps): React.JSX.Element;
|
|
14
14
|
export default InteractiveElement;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
type Props = Omit<BlockProps, "context"> & {
|
|
3
3
|
repeatContext: BuilderContextInterface;
|
|
4
4
|
};
|
|
5
|
-
import type { BuilderContextInterface } from "../../../context/types
|
|
5
|
+
import type { BuilderContextInterface } from "../../../context/types";
|
|
6
6
|
import type { BlockProps } from "../block";
|
|
7
7
|
declare function RepeatedBlock(props: Props): React.JSX.Element;
|
|
8
8
|
export default RepeatedBlock;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../../context/types
|
|
2
|
-
import type { BuilderBlock } from '../../types/builder-block
|
|
1
|
+
import type { BuilderContextInterface } from '../../context/types';
|
|
2
|
+
import type { BuilderBlock } from '../../types/builder-block';
|
|
3
3
|
export interface RepeatData {
|
|
4
4
|
block: BuilderBlock;
|
|
5
5
|
context: BuilderContextInterface;
|
|
@@ -14,6 +14,6 @@ export type BlocksWrapperProps = {
|
|
|
14
14
|
BlocksWrapperProps: any;
|
|
15
15
|
children?: any;
|
|
16
16
|
};
|
|
17
|
-
import type { BuilderBlock } from "../../types/builder-block
|
|
17
|
+
import type { BuilderBlock } from "../../types/builder-block";
|
|
18
18
|
declare function BlocksWrapper(props: BlocksWrapperProps): React.JSX.Element;
|
|
19
19
|
export default BlocksWrapper;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BuilderContextInterface, RegisteredComponents } from '../../context/types
|
|
1
|
+
import type { BuilderContextInterface, RegisteredComponents } from '../../context/types';
|
|
2
2
|
import type { BlocksWrapperProps } from './blocks-wrapper';
|
|
3
3
|
export type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'>> & {
|
|
4
4
|
context?: BuilderContextInterface;
|
|
@@ -4,7 +4,7 @@ type BuilderEditorProps = Omit<ContentProps, "customComponents" | "apiVersion" |
|
|
|
4
4
|
setBuilderContextSignal?: (signal: any) => any;
|
|
5
5
|
children?: any;
|
|
6
6
|
};
|
|
7
|
-
import type { BuilderContextInterface } from "../../../context/types
|
|
8
|
-
import type { ContentProps } from "../content.types
|
|
7
|
+
import type { BuilderContextInterface } from "../../../context/types";
|
|
8
|
+
import type { ContentProps } from "../content.types";
|
|
9
9
|
declare function EnableEditor(props: BuilderEditorProps): React.JSX.Element;
|
|
10
10
|
export default EnableEditor;
|
|
@@ -5,6 +5,6 @@ interface Props {
|
|
|
5
5
|
contentId?: string;
|
|
6
6
|
isNestedRender?: boolean;
|
|
7
7
|
}
|
|
8
|
-
import type { CustomFont } from "./styles.helpers
|
|
8
|
+
import type { CustomFont } from "./styles.helpers";
|
|
9
9
|
declare function ContentStyles(props: Props): React.JSX.Element;
|
|
10
10
|
export default ContentStyles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BuilderContent } from '../../types/builder-content
|
|
2
|
-
import type { Nullable } from '../../types/typescript
|
|
3
|
-
import type { ContentProps } from './content.types
|
|
1
|
+
import type { BuilderContent } from '../../types/builder-content';
|
|
2
|
+
import type { Nullable } from '../../types/typescript';
|
|
3
|
+
import type { ContentProps } from './content.types';
|
|
4
4
|
export declare const getRootStateInitialValue: ({ content, data, locale }: Pick<ContentProps, 'content' | 'data' | 'locale'>) => {
|
|
5
5
|
locale?: string;
|
|
6
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuilderRenderState } from '../../context/types
|
|
2
|
-
export type { ContentProps } from './contentProps.types
|
|
1
|
+
import type { BuilderRenderState } from '../../context/types';
|
|
2
|
+
export type { ContentProps } from './contentProps.types';
|
|
3
3
|
export interface BuilderComponentStateChange {
|
|
4
4
|
state: BuilderRenderState;
|
|
5
5
|
ref: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EnforcePartials } from '../../types/enforced-partials
|
|
2
|
-
import type { ContentVariantsPrps } from '../content-variants/content-variants.types
|
|
1
|
+
import type { EnforcePartials } from '../../types/enforced-partials';
|
|
2
|
+
import type { ContentVariantsPrps } from '../content-variants/content-variants.types';
|
|
3
3
|
interface InternalRenderProps {
|
|
4
4
|
showContent: boolean;
|
|
5
5
|
isSsrAbTest: boolean;
|
|
@@ -5,6 +5,6 @@ type VariantsProviderProps = ContentVariantsPrps & {
|
|
|
5
5
|
*/
|
|
6
6
|
isNestedRender?: boolean;
|
|
7
7
|
};
|
|
8
|
-
import type { ContentVariantsPrps } from "./content-variants.types
|
|
8
|
+
import type { ContentVariantsPrps } from "./content-variants.types";
|
|
9
9
|
declare function ContentVariants(props: VariantsProviderProps): React.JSX.Element;
|
|
10
10
|
export default ContentVariants;
|