@builder.io/sdk-react-nextjs 0.5.9 → 0.6.0
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/USE_CLIENT_BUNDLE-29f9ac5c.js +23 -0
- package/lib/browser/USE_CLIENT_BUNDLE-dfa97c43.mjs +664 -0
- package/lib/browser/USE_SERVER_BUNDLE-25e181fa.js +1 -0
- package/lib/browser/USE_SERVER_BUNDLE-fcd44ecb.mjs +11 -0
- package/lib/browser/bundle-5cab6113.js +76 -0
- package/lib/browser/bundle-babbd573.mjs +2419 -0
- package/lib/browser/index.cjs +1 -0
- package/lib/browser/index.mjs +34 -0
- package/lib/edge/USE_CLIENT_BUNDLE-3cbb02d5.mjs +664 -0
- package/lib/edge/USE_CLIENT_BUNDLE-d0b99f60.js +23 -0
- package/lib/edge/USE_SERVER_BUNDLE-4eeb4634.mjs +11 -0
- package/lib/edge/USE_SERVER_BUNDLE-bbd89085.js +1 -0
- package/lib/edge/bundle-9ed99f98.mjs +4863 -0
- package/lib/edge/bundle-e4764e2a.js +96 -0
- package/lib/edge/index.cjs +1 -0
- package/lib/edge/index.mjs +34 -0
- package/lib/node/USE_CLIENT_BUNDLE-29f9ac5c.js +23 -0
- package/lib/node/USE_CLIENT_BUNDLE-dfa97c43.mjs +664 -0
- package/lib/node/USE_SERVER_BUNDLE-25e181fa.js +1 -0
- package/lib/node/USE_SERVER_BUNDLE-fcd44ecb.mjs +11 -0
- package/lib/node/bundle-5cab6113.js +76 -0
- package/lib/node/bundle-babbd573.mjs +2419 -0
- package/lib/node/index.cjs +1 -0
- package/lib/node/index.mjs +34 -0
- package/package.json +96 -13
- package/types/constants/sdk-version.d.ts +1 -0
- package/types/functions/deopt.d.ts +4 -0
- package/types/functions/evaluate/browser-runtime/index.d.ts +1 -0
- package/{dist → types}/functions/fetch-builder-props.d.ts +2 -1
- package/{dist → types}/functions/get-content/index.d.ts +4 -5
- package/{dist → types}/index-helpers/blocks-exports.d.ts +2 -2
- package/dist/blocks/button/button.js +0 -12
- package/dist/blocks/button/component-info.js +0 -34
- package/dist/blocks/columns/columns.js +0 -119
- package/dist/blocks/columns/component-info.js +0 -219
- package/dist/blocks/custom-code/component-info.js +0 -23
- package/dist/blocks/custom-code/custom-code.js +0 -51
- package/dist/blocks/embed/component-info.js +0 -39
- package/dist/blocks/embed/embed.js +0 -42
- package/dist/blocks/embed/helpers.js +0 -2
- package/dist/blocks/fragment/component-info.js +0 -7
- package/dist/blocks/fragment/fragment.js +0 -6
- package/dist/blocks/helpers.js +0 -40
- package/dist/blocks/image/component-info.js +0 -122
- package/dist/blocks/image/image.helpers.js +0 -47
- package/dist/blocks/image/image.js +0 -82
- package/dist/blocks/img/component-info.js +0 -15
- package/dist/blocks/img/img.js +0 -10
- package/dist/blocks/section/component-info.js +0 -40
- package/dist/blocks/section/section.js +0 -17
- package/dist/blocks/symbol/component-info.js +0 -34
- package/dist/blocks/symbol/symbol.helpers.js +0 -31
- package/dist/blocks/symbol/symbol.js +0 -29
- package/dist/blocks/text/component-info.js +0 -19
- package/dist/blocks/text/text.js +0 -7
- package/dist/blocks/video/component-info.js +0 -82
- package/dist/blocks/video/video.js +0 -50
- package/dist/components/block/block.helpers.js +0 -69
- package/dist/components/block/block.js +0 -92
- package/dist/components/block/components/block-styles.js +0 -65
- package/dist/components/block/components/block-wrapper.js +0 -36
- package/dist/components/block/components/component-ref/component-ref.helpers.js +0 -22
- package/dist/components/block/components/component-ref/component-ref.js +0 -21
- package/dist/components/block/components/interactive-element.js +0 -20
- package/dist/components/block/components/repeated-block.js +0 -7
- package/dist/components/block/types.js +0 -1
- package/dist/components/blocks/blocks-wrapper.js +0 -38
- package/dist/components/blocks/blocks.js +0 -10
- package/dist/components/content/components/enable-editor.js +0 -250
- package/dist/components/content/components/styles.helpers.js +0 -58
- package/dist/components/content/components/styles.js +0 -30
- package/dist/components/content/content.helpers.js +0 -30
- package/dist/components/content/content.js +0 -74
- package/dist/components/content/content.types.js +0 -1
- package/dist/components/content/wrap-component-ref.js +0 -6
- package/dist/components/content-variants/content-variants.js +0 -45
- package/dist/components/content-variants/content-variants.types.js +0 -1
- package/dist/components/content-variants/helpers.js +0 -189
- package/dist/components/inlined-script.js +0 -5
- package/dist/components/inlined-styles.js +0 -5
- package/dist/constants/builder-registered-components.js +0 -60
- package/dist/constants/device-sizes.js +0 -45
- package/dist/constants/sdk-version.d.ts +0 -1
- package/dist/constants/sdk-version.js +0 -1
- package/dist/constants/target.js +0 -2
- package/dist/context/builder.context.js +0 -12
- package/dist/context/components.context.js +0 -2
- package/dist/context/types.js +0 -1
- package/dist/functions/camel-to-kebab-case.js +0 -1
- package/dist/functions/evaluate/browser-runtime/browser.js +0 -31
- package/dist/functions/evaluate/evaluate.js +0 -47
- package/dist/functions/evaluate/helpers.js +0 -10
- package/dist/functions/evaluate/index.js +0 -1
- package/dist/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
- package/dist/functions/evaluate/non-node-runtime/acorn-interpreter.js +0 -3111
- package/dist/functions/evaluate/non-node-runtime/index.d.ts +0 -1
- package/dist/functions/evaluate/non-node-runtime/index.js +0 -2
- package/dist/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
- package/dist/functions/evaluate/non-node-runtime/non-node-runtime.js +0 -83
- package/dist/functions/event-handler-name.js +0 -4
- package/dist/functions/extract-text-styles.js +0 -22
- package/dist/functions/fast-clone.js +0 -4
- package/dist/functions/fetch-builder-props.js +0 -25
- package/dist/functions/get-block-actions-handler.js +0 -10
- package/dist/functions/get-block-actions.js +0 -28
- package/dist/functions/get-block-component-options.js +0 -10
- package/dist/functions/get-block-properties.js +0 -72
- package/dist/functions/get-builder-search-params/index.js +0 -38
- package/dist/functions/get-content/generate-content-url.js +0 -33
- package/dist/functions/get-content/index.js +0 -100
- package/dist/functions/get-content/types.js +0 -1
- package/dist/functions/get-fetch.js +0 -11
- package/dist/functions/get-global-this.js +0 -15
- package/dist/functions/get-processed-block.js +0 -46
- package/dist/functions/get-react-native-block-styles.js +0 -17
- package/dist/functions/is-browser.js +0 -3
- package/dist/functions/is-editing.js +0 -5
- package/dist/functions/is-iframe.js +0 -4
- package/dist/functions/is-non-node-server.d.ts +0 -4
- package/dist/functions/is-non-node-server.js +0 -8
- package/dist/functions/is-previewing.js +0 -11
- package/dist/functions/register-component.js +0 -38
- package/dist/functions/register.js +0 -27
- package/dist/functions/sanitize-react-native-block-styles.js +0 -61
- package/dist/functions/set-editor-settings.js +0 -12
- package/dist/functions/set.js +0 -14
- package/dist/functions/track/helpers.js +0 -51
- package/dist/functions/track/index.js +0 -71
- package/dist/functions/track/interaction.js +0 -53
- package/dist/functions/transform-block-properties.js +0 -5
- package/dist/functions/transform-block.js +0 -4
- package/dist/helpers/ab-tests.js +0 -122
- package/dist/helpers/canTrack.js +0 -2
- package/dist/helpers/cookie.js +0 -55
- package/dist/helpers/css.js +0 -27
- package/dist/helpers/flatten.js +0 -19
- package/dist/helpers/localStorage.js +0 -24
- package/dist/helpers/logger.js +0 -7
- package/dist/helpers/nullable.js +0 -1
- package/dist/helpers/preview-lru-cache/get.js +0 -9
- package/dist/helpers/preview-lru-cache/helpers.js +0 -9
- package/dist/helpers/preview-lru-cache/init.js +0 -15
- package/dist/helpers/preview-lru-cache/set.js +0 -7
- package/dist/helpers/preview-lru-cache/types.js +0 -6
- package/dist/helpers/sessionId.js +0 -30
- package/dist/helpers/url.js +0 -15
- package/dist/helpers/uuid.js +0 -15
- package/dist/helpers/visitorId.js +0 -30
- package/dist/index-helpers/blocks-exports.js +0 -19
- package/dist/index-helpers/top-of-file.js +0 -4
- package/dist/index.js +0 -7
- package/dist/scripts/init-editing.js +0 -110
- package/dist/server-index.js +0 -10
- package/dist/types/api-version.js +0 -1
- package/dist/types/builder-block.js +0 -1
- package/dist/types/builder-content.js +0 -1
- package/dist/types/builder-props.js +0 -1
- package/dist/types/can-track.js +0 -1
- package/dist/types/components.js +0 -1
- package/dist/types/deep-partial.js +0 -1
- package/dist/types/element.js +0 -1
- package/dist/types/enforced-partials.js +0 -1
- package/dist/types/input.js +0 -1
- package/dist/types/targets.js +0 -1
- package/dist/types/typescript.js +0 -1
- /package/{dist → types}/blocks/button/button.d.ts +0 -0
- /package/{dist → types}/blocks/button/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/columns/columns.d.ts +0 -0
- /package/{dist → types}/blocks/columns/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/custom-code/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/custom-code/custom-code.d.ts +0 -0
- /package/{dist → types}/blocks/embed/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/embed/embed.d.ts +0 -0
- /package/{dist → types}/blocks/embed/helpers.d.ts +0 -0
- /package/{dist → types}/blocks/fragment/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/fragment/fragment.d.ts +0 -0
- /package/{dist → types}/blocks/helpers.d.ts +0 -0
- /package/{dist → types}/blocks/image/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/image/image.d.ts +0 -0
- /package/{dist → types}/blocks/image/image.helpers.d.ts +0 -0
- /package/{dist → types}/blocks/img/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/img/img.d.ts +0 -0
- /package/{dist → types}/blocks/section/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/section/section.d.ts +0 -0
- /package/{dist → types}/blocks/symbol/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/symbol/symbol.d.ts +0 -0
- /package/{dist → types}/blocks/symbol/symbol.helpers.d.ts +0 -0
- /package/{dist → types}/blocks/text/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/text/text.d.ts +0 -0
- /package/{dist → types}/blocks/video/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/video/video.d.ts +0 -0
- /package/{dist → types}/components/block/block.d.ts +0 -0
- /package/{dist → types}/components/block/block.helpers.d.ts +0 -0
- /package/{dist → types}/components/block/components/block-styles.d.ts +0 -0
- /package/{dist → types}/components/block/components/block-wrapper.d.ts +0 -0
- /package/{dist → types}/components/block/components/component-ref/component-ref.d.ts +0 -0
- /package/{dist → types}/components/block/components/component-ref/component-ref.helpers.d.ts +0 -0
- /package/{dist → types}/components/block/components/interactive-element.d.ts +0 -0
- /package/{dist → types}/components/block/components/repeated-block.d.ts +0 -0
- /package/{dist → types}/components/block/types.d.ts +0 -0
- /package/{dist → types}/components/blocks/blocks-wrapper.d.ts +0 -0
- /package/{dist → types}/components/blocks/blocks.d.ts +0 -0
- /package/{dist → types}/components/content/components/enable-editor.d.ts +0 -0
- /package/{dist → types}/components/content/components/styles.d.ts +0 -0
- /package/{dist → types}/components/content/components/styles.helpers.d.ts +0 -0
- /package/{dist → types}/components/content/content.d.ts +0 -0
- /package/{dist → types}/components/content/content.helpers.d.ts +0 -0
- /package/{dist → types}/components/content/content.types.d.ts +0 -0
- /package/{dist → types}/components/content/wrap-component-ref.d.ts +0 -0
- /package/{dist → types}/components/content-variants/content-variants.d.ts +0 -0
- /package/{dist → types}/components/content-variants/content-variants.types.d.ts +0 -0
- /package/{dist → types}/components/content-variants/helpers.d.ts +0 -0
- /package/{dist → types}/components/inlined-script.d.ts +0 -0
- /package/{dist → types}/components/inlined-styles.d.ts +0 -0
- /package/{dist → types}/constants/builder-registered-components.d.ts +0 -0
- /package/{dist → types}/constants/device-sizes.d.ts +0 -0
- /package/{dist → types}/constants/target.d.ts +0 -0
- /package/{dist → types}/context/builder.context.d.ts +0 -0
- /package/{dist → types}/context/components.context.d.ts +0 -0
- /package/{dist → types}/context/types.d.ts +0 -0
- /package/{dist → types}/functions/camel-to-kebab-case.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/browser-runtime/browser.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/evaluate.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/helpers.d.ts +0 -0
- /package/{dist → types}/functions/evaluate/index.d.ts +0 -0
- /package/{dist → types}/functions/event-handler-name.d.ts +0 -0
- /package/{dist → types}/functions/extract-text-styles.d.ts +0 -0
- /package/{dist → types}/functions/fast-clone.d.ts +0 -0
- /package/{dist → types}/functions/get-block-actions-handler.d.ts +0 -0
- /package/{dist → types}/functions/get-block-actions.d.ts +0 -0
- /package/{dist → types}/functions/get-block-component-options.d.ts +0 -0
- /package/{dist → types}/functions/get-block-properties.d.ts +0 -0
- /package/{dist → types}/functions/get-builder-search-params/index.d.ts +0 -0
- /package/{dist → types}/functions/get-content/generate-content-url.d.ts +0 -0
- /package/{dist → types}/functions/get-content/types.d.ts +0 -0
- /package/{dist → types}/functions/get-fetch.d.ts +0 -0
- /package/{dist → types}/functions/get-global-this.d.ts +0 -0
- /package/{dist → types}/functions/get-processed-block.d.ts +0 -0
- /package/{dist → types}/functions/get-react-native-block-styles.d.ts +0 -0
- /package/{dist → types}/functions/is-browser.d.ts +0 -0
- /package/{dist → types}/functions/is-editing.d.ts +0 -0
- /package/{dist → types}/functions/is-iframe.d.ts +0 -0
- /package/{dist → types}/functions/is-previewing.d.ts +0 -0
- /package/{dist → types}/functions/register-component.d.ts +0 -0
- /package/{dist → types}/functions/register.d.ts +0 -0
- /package/{dist → types}/functions/sanitize-react-native-block-styles.d.ts +0 -0
- /package/{dist → types}/functions/set-editor-settings.d.ts +0 -0
- /package/{dist → types}/functions/set.d.ts +0 -0
- /package/{dist → types}/functions/track/helpers.d.ts +0 -0
- /package/{dist → types}/functions/track/index.d.ts +0 -0
- /package/{dist → types}/functions/track/interaction.d.ts +0 -0
- /package/{dist → types}/functions/transform-block-properties.d.ts +0 -0
- /package/{dist → types}/functions/transform-block.d.ts +0 -0
- /package/{dist → types}/helpers/ab-tests.d.ts +0 -0
- /package/{dist → types}/helpers/canTrack.d.ts +0 -0
- /package/{dist → types}/helpers/cookie.d.ts +0 -0
- /package/{dist → types}/helpers/css.d.ts +0 -0
- /package/{dist → types}/helpers/flatten.d.ts +0 -0
- /package/{dist → types}/helpers/localStorage.d.ts +0 -0
- /package/{dist → types}/helpers/logger.d.ts +0 -0
- /package/{dist → types}/helpers/nullable.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/get.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/helpers.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/init.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/set.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/types.d.ts +0 -0
- /package/{dist → types}/helpers/sessionId.d.ts +0 -0
- /package/{dist → types}/helpers/url.d.ts +0 -0
- /package/{dist → types}/helpers/uuid.d.ts +0 -0
- /package/{dist → types}/helpers/visitorId.d.ts +0 -0
- /package/{dist → types}/index-helpers/top-of-file.d.ts +0 -0
- /package/{dist → types}/index.d.ts +0 -0
- /package/{dist → types}/scripts/init-editing.d.ts +0 -0
- /package/{dist → types}/server-index.d.ts +0 -0
- /package/{dist → types}/types/api-version.d.ts +0 -0
- /package/{dist → types}/types/builder-block.d.ts +0 -0
- /package/{dist → types}/types/builder-content.d.ts +0 -0
- /package/{dist → types}/types/builder-props.d.ts +0 -0
- /package/{dist → types}/types/can-track.d.ts +0 -0
- /package/{dist → types}/types/components.d.ts +0 -0
- /package/{dist → types}/types/deep-partial.d.ts +0 -0
- /package/{dist → types}/types/element.d.ts +0 -0
- /package/{dist → types}/types/enforced-partials.d.ts +0 -0
- /package/{dist → types}/types/input.d.ts +0 -0
- /package/{dist → types}/types/targets.d.ts +0 -0
- /package/{dist → types}/types/typescript.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-5cab6113.js"),t=require("./USE_CLIENT_BUNDLE-29f9ac5c.js");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-25e181fa.js");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { B as i, v as m, C as c, R as g, u as p, S as l, T as d, F as C, m as u, J as B, z as S, A as f, D as E, G as R, E as h, i as x, w as k, x as y, y as F, H as P } from "./bundle-babbd573.mjs";
|
|
2
|
+
import { c as w, F as A, d as T, S as V, V as b } from "./USE_CLIENT_BUNDLE-dfa97c43.mjs";
|
|
3
|
+
import "lru-cache";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "react";
|
|
6
|
+
import "next/navigation";
|
|
7
|
+
import "./USE_SERVER_BUNDLE-fcd44ecb.mjs";
|
|
8
|
+
export {
|
|
9
|
+
i as Blocks,
|
|
10
|
+
w as Button,
|
|
11
|
+
m as Columns,
|
|
12
|
+
c as Content,
|
|
13
|
+
A as Fragment,
|
|
14
|
+
T as Image,
|
|
15
|
+
g as RenderBlocks,
|
|
16
|
+
p as RenderContent,
|
|
17
|
+
V as Section,
|
|
18
|
+
l as Symbol,
|
|
19
|
+
d as Text,
|
|
20
|
+
b as Video,
|
|
21
|
+
C as _processContentResult,
|
|
22
|
+
u as createRegisterComponentMessage,
|
|
23
|
+
B as fetchBuilderProps,
|
|
24
|
+
S as fetchEntries,
|
|
25
|
+
f as fetchOneEntry,
|
|
26
|
+
E as getAllContent,
|
|
27
|
+
R as getBuilderSearchParams,
|
|
28
|
+
h as getContent,
|
|
29
|
+
x as isEditing,
|
|
30
|
+
k as isPreviewing,
|
|
31
|
+
y as register,
|
|
32
|
+
F as setEditorSettings,
|
|
33
|
+
P as track
|
|
34
|
+
};
|
package/package.json
CHANGED
|
@@ -1,38 +1,121 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-nextjs",
|
|
3
|
-
"description": "Builder.io SDK for
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Builder.io RSC SDK for NextJS App Directory",
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"files": [
|
|
6
|
-
"
|
|
6
|
+
"lib",
|
|
7
|
+
"types"
|
|
7
8
|
],
|
|
8
|
-
"types": "./
|
|
9
|
+
"types": "./types/index.d.ts",
|
|
10
|
+
"main": "./lib/node/index.cjs",
|
|
11
|
+
"module": "./lib/node/index.mjs",
|
|
9
12
|
"exports": {
|
|
10
|
-
".":
|
|
13
|
+
".": {
|
|
14
|
+
"node": {
|
|
15
|
+
"types": "./types/index.d.ts",
|
|
16
|
+
"import": "./lib/node/index.mjs",
|
|
17
|
+
"require": "./lib/node/index.cjs"
|
|
18
|
+
},
|
|
19
|
+
"browser": {
|
|
20
|
+
"types": "./types/index.d.ts",
|
|
21
|
+
"import": "./lib/browser/index.mjs",
|
|
22
|
+
"require": "./lib/browser/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"edge-routine": {
|
|
25
|
+
"types": "./types/index.d.ts",
|
|
26
|
+
"import": "./lib/edge/index.mjs",
|
|
27
|
+
"require": "./lib/edge/index.cjs"
|
|
28
|
+
},
|
|
29
|
+
"workerd": {
|
|
30
|
+
"types": "./types/index.d.ts",
|
|
31
|
+
"import": "./lib/edge/index.mjs",
|
|
32
|
+
"require": "./lib/edge/index.cjs"
|
|
33
|
+
},
|
|
34
|
+
"deno": {
|
|
35
|
+
"types": "./types/index.d.ts",
|
|
36
|
+
"import": "./lib/edge/index.mjs",
|
|
37
|
+
"require": "./lib/edge/index.cjs"
|
|
38
|
+
},
|
|
39
|
+
"lagon": {
|
|
40
|
+
"types": "./types/index.d.ts",
|
|
41
|
+
"import": "./lib/edge/index.mjs",
|
|
42
|
+
"require": "./lib/edge/index.cjs"
|
|
43
|
+
},
|
|
44
|
+
"netlify": {
|
|
45
|
+
"types": "./types/index.d.ts",
|
|
46
|
+
"import": "./lib/edge/index.mjs",
|
|
47
|
+
"require": "./lib/edge/index.cjs"
|
|
48
|
+
},
|
|
49
|
+
"edge-light": {
|
|
50
|
+
"types": "./types/index.d.ts",
|
|
51
|
+
"import": "./lib/edge/index.mjs",
|
|
52
|
+
"require": "./lib/edge/index.cjs"
|
|
53
|
+
},
|
|
54
|
+
"bun": {
|
|
55
|
+
"types": "./types/index.d.ts",
|
|
56
|
+
"import": "./lib/edge/index.mjs",
|
|
57
|
+
"require": "./lib/edge/index.cjs"
|
|
58
|
+
},
|
|
59
|
+
"react-native": {
|
|
60
|
+
"types": "./types/index.d.ts",
|
|
61
|
+
"import": "./lib/node/index.mjs",
|
|
62
|
+
"require": "./lib/node/index.cjs"
|
|
63
|
+
},
|
|
64
|
+
"electron": {
|
|
65
|
+
"types": "./types/index.d.ts",
|
|
66
|
+
"import": "./lib/node/index.mjs",
|
|
67
|
+
"require": "./lib/node/index.cjs"
|
|
68
|
+
},
|
|
69
|
+
"default": {
|
|
70
|
+
"types": "./types/index.d.ts",
|
|
71
|
+
"import": "./lib/browser/index.mjs",
|
|
72
|
+
"require": "./lib/browser/index.cjs"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"./edge": {
|
|
76
|
+
"types": "./types/index.d.ts",
|
|
77
|
+
"import": "./lib/edge/index.mjs",
|
|
78
|
+
"require": "./lib/edge/index.cjs"
|
|
79
|
+
},
|
|
80
|
+
"./node": {
|
|
81
|
+
"types": "./types/index.d.ts",
|
|
82
|
+
"import": "./lib/node/index.mjs",
|
|
83
|
+
"require": "./lib/node/index.cjs"
|
|
84
|
+
},
|
|
85
|
+
"./browser": {
|
|
86
|
+
"types": "./types/index.d.ts",
|
|
87
|
+
"import": "./lib/browser/index.mjs",
|
|
88
|
+
"require": "./lib/browser/index.cjs"
|
|
89
|
+
}
|
|
11
90
|
},
|
|
12
91
|
"scripts": {
|
|
13
|
-
"
|
|
14
|
-
"build": "
|
|
92
|
+
"types": "tsc",
|
|
93
|
+
"build": "nx run-many -p @builder.io/sdk-react-nextjs -t types build:node build:edge build:browser",
|
|
94
|
+
"build:node": "SDK_ENV=node vite build --mode lib",
|
|
95
|
+
"build:edge": "SDK_ENV=edge vite build --mode lib",
|
|
96
|
+
"build:browser": "SDK_ENV=browser vite build --mode lib"
|
|
15
97
|
},
|
|
16
98
|
"peerDependencies": {
|
|
17
|
-
"next": "
|
|
99
|
+
"next": "13.4.20-canary.10",
|
|
18
100
|
"react": "^18.2.0",
|
|
19
101
|
"react-dom": "^18.2.0"
|
|
20
102
|
},
|
|
21
103
|
"devDependencies": {
|
|
22
|
-
"
|
|
104
|
+
"@builder.io/sdks": "workspace:*",
|
|
105
|
+
"@vitejs/plugin-react": "^4.0.4",
|
|
106
|
+
"next": "13.4.20-canary.10",
|
|
23
107
|
"nx": "^16.6.0",
|
|
24
108
|
"nx-cloud": "^16.2.0",
|
|
25
109
|
"react": "^18.2.0",
|
|
26
110
|
"rimraf": "^3.0.2",
|
|
27
|
-
"typescript": "^5.1.6"
|
|
111
|
+
"typescript": "^5.1.6",
|
|
112
|
+
"vite": "^4.4.9",
|
|
113
|
+
"vite-plugin-dts": "^3.5.2"
|
|
28
114
|
},
|
|
29
115
|
"dependencies": {
|
|
30
116
|
"lru-cache": "^10.0.0"
|
|
31
117
|
},
|
|
32
118
|
"nx": {
|
|
33
|
-
"implicitDependencies": [
|
|
34
|
-
"@builder.io/sdks"
|
|
35
|
-
],
|
|
36
119
|
"targets": {
|
|
37
120
|
"build": {
|
|
38
121
|
"dependsOn": [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_VERSION = "0.6.0";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { runInBrowser as evaluator } from './browser.js';
|
|
@@ -33,7 +33,8 @@ type GetBuilderPropsOptions = (Omit<GetContentOptions, 'model'> & {
|
|
|
33
33
|
searchParams?: undefined;
|
|
34
34
|
});
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Given an `apiKey` and `url` (or `path` + `searchParams`), provides all props that `Content` needs to render Builder Content.
|
|
37
|
+
*
|
|
37
38
|
*/
|
|
38
39
|
export declare const fetchBuilderProps: (_args: GetBuilderPropsOptions) => Promise<ContentVariantsPrps>;
|
|
39
40
|
export {};
|
|
@@ -5,17 +5,16 @@ import type { GetContentOptions } from './types.js';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function fetchOneEntry(options: GetContentOptions): Promise<BuilderContent | null>;
|
|
7
7
|
/**
|
|
8
|
-
* @deprecated
|
|
9
|
-
* Consider using `fetchBuilderProps` instead for easier setup.
|
|
8
|
+
* @deprecated `getContent` was renamed to `fetchOneEntry`. This is a temporary alias to avoid breaking changes.
|
|
10
9
|
*
|
|
11
|
-
* NOTE:
|
|
10
|
+
* NOTE: consider using `fetchBuilderProps` instead for easier setup.
|
|
12
11
|
*/
|
|
13
12
|
export declare const getContent: typeof fetchOneEntry;
|
|
14
13
|
type ContentResults = {
|
|
15
14
|
results: BuilderContent[];
|
|
16
15
|
};
|
|
17
16
|
/**
|
|
18
|
-
* Exported only for testing purposes.
|
|
17
|
+
* @internal Exported only for testing purposes. Do not use.
|
|
19
18
|
*/
|
|
20
19
|
export declare const _processContentResult: (options: GetContentOptions, content: ContentResults, url?: URL) => Promise<ContentResults>;
|
|
21
20
|
/**
|
|
@@ -23,7 +22,7 @@ export declare const _processContentResult: (options: GetContentOptions, content
|
|
|
23
22
|
*/
|
|
24
23
|
export declare function fetchEntries(options: GetContentOptions): Promise<ContentResults>;
|
|
25
24
|
/**
|
|
26
|
-
* @deprecated
|
|
25
|
+
* @deprecated `getAllContent` was renamed to `fetchEntries`. This is a temporary alias to avoid breaking changes.
|
|
27
26
|
*/
|
|
28
27
|
export declare const getAllContent: typeof fetchEntries;
|
|
29
28
|
export {};
|
|
@@ -10,10 +10,10 @@ import { default as Blocks } from '../components/blocks/blocks';
|
|
|
10
10
|
import { default as Content } from '../components/content-variants/content-variants';
|
|
11
11
|
export { Blocks, Content };
|
|
12
12
|
/**
|
|
13
|
-
* @deprecated
|
|
13
|
+
* @deprecated Renamed to `Blocks`.
|
|
14
14
|
*/
|
|
15
15
|
export declare const RenderBlocks: typeof Blocks;
|
|
16
16
|
/**
|
|
17
|
-
* @deprecated
|
|
17
|
+
* @deprecated Renamed to `Content`.
|
|
18
18
|
*/
|
|
19
19
|
export declare const RenderContent: typeof Content;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
function Button(props) {
|
|
4
|
-
return (React.createElement(React.Fragment, null,
|
|
5
|
-
props.link ? (React.createElement(React.Fragment, null,
|
|
6
|
-
React.createElement("a", { role: "button", ...props.attributes, href: props.link, target: props.openLinkInNewTab ? "_blank" : undefined }, props.text))) : (React.createElement(React.Fragment, null,
|
|
7
|
-
React.createElement("button", { ...props.attributes, style: props.attributes.style, className: props.attributes.className + " button-3e7bc8b2" }, props.text))),
|
|
8
|
-
React.createElement("style", null, `.button-3e7bc8b2 {
|
|
9
|
-
all: unset;
|
|
10
|
-
}`)));
|
|
11
|
-
}
|
|
12
|
-
export default Button;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export const componentInfo = {
|
|
2
|
-
name: 'Core:Button',
|
|
3
|
-
image: 'https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13',
|
|
4
|
-
defaultStyles: {
|
|
5
|
-
// TODO: make min width more intuitive and set one
|
|
6
|
-
appearance: 'none',
|
|
7
|
-
paddingTop: '15px',
|
|
8
|
-
paddingBottom: '15px',
|
|
9
|
-
paddingLeft: '25px',
|
|
10
|
-
paddingRight: '25px',
|
|
11
|
-
backgroundColor: '#000000',
|
|
12
|
-
color: 'white',
|
|
13
|
-
borderRadius: '4px',
|
|
14
|
-
textAlign: 'center',
|
|
15
|
-
cursor: 'pointer'
|
|
16
|
-
},
|
|
17
|
-
inputs: [{
|
|
18
|
-
name: 'text',
|
|
19
|
-
type: 'text',
|
|
20
|
-
defaultValue: 'Click me!',
|
|
21
|
-
bubble: true
|
|
22
|
-
}, {
|
|
23
|
-
name: 'link',
|
|
24
|
-
type: 'url',
|
|
25
|
-
bubble: true
|
|
26
|
-
}, {
|
|
27
|
-
name: 'openLinkInNewTab',
|
|
28
|
-
type: 'boolean',
|
|
29
|
-
defaultValue: false,
|
|
30
|
-
friendlyName: 'Open link in new tab'
|
|
31
|
-
}],
|
|
32
|
-
static: true,
|
|
33
|
-
noWrap: true
|
|
34
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import Blocks from "../../components/blocks/blocks";
|
|
3
|
-
import { getSizesForBreakpoints } from "../../constants/device-sizes.js";
|
|
4
|
-
import InlinedStyles from "../../components/inlined-styles";
|
|
5
|
-
import { TARGET } from "../../constants/target.js";
|
|
6
|
-
function Columns(props) {
|
|
7
|
-
const gutterSize = typeof props.space === "number" ? props.space || 0 : 20;
|
|
8
|
-
const cols = props.columns || [];
|
|
9
|
-
const stackAt = props.stackColumnsAt || "tablet";
|
|
10
|
-
const getWidth = function getWidth(index) {
|
|
11
|
-
return cols[index]?.width || 100 / cols.length;
|
|
12
|
-
};
|
|
13
|
-
const getColumnCssWidth = function getColumnCssWidth(index) {
|
|
14
|
-
const subtractWidth = (gutterSize * (cols.length - 1)) / cols.length;
|
|
15
|
-
return `calc(${getWidth(index)}% - ${subtractWidth}px)`;
|
|
16
|
-
};
|
|
17
|
-
const getTabletStyle = function getTabletStyle({ stackedStyle, desktopStyle, }) {
|
|
18
|
-
return stackAt === "tablet" ? stackedStyle : desktopStyle;
|
|
19
|
-
};
|
|
20
|
-
const getMobileStyle = function getMobileStyle({ stackedStyle, desktopStyle, }) {
|
|
21
|
-
return stackAt === "never" ? desktopStyle : stackedStyle;
|
|
22
|
-
};
|
|
23
|
-
const flexDir = props.stackColumnsAt === "never"
|
|
24
|
-
? "row"
|
|
25
|
-
: props.reverseColumnsWhenStacked
|
|
26
|
-
? "column-reverse"
|
|
27
|
-
: "column";
|
|
28
|
-
const columnsCssVars = function columnsCssVars() {
|
|
29
|
-
return {
|
|
30
|
-
"--flex-dir": flexDir,
|
|
31
|
-
"--flex-dir-tablet": getTabletStyle({
|
|
32
|
-
stackedStyle: flexDir,
|
|
33
|
-
desktopStyle: "row",
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const columnCssVars = function columnCssVars(index) {
|
|
38
|
-
const gutter = index === 0 ? 0 : gutterSize;
|
|
39
|
-
if (TARGET === "reactNative") {
|
|
40
|
-
return {
|
|
41
|
-
marginLeft: props.stackColumnsAt === "never" ? gutter : 0,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const width = getColumnCssWidth(index);
|
|
45
|
-
const gutterPixels = `${gutter}px`;
|
|
46
|
-
const mobileWidth = "100%";
|
|
47
|
-
const mobileMarginLeft = 0;
|
|
48
|
-
const marginLeftKey = "marginLeft";
|
|
49
|
-
return {
|
|
50
|
-
width,
|
|
51
|
-
[marginLeftKey]: gutterPixels,
|
|
52
|
-
"--column-width-mobile": getMobileStyle({
|
|
53
|
-
stackedStyle: mobileWidth,
|
|
54
|
-
desktopStyle: width,
|
|
55
|
-
}),
|
|
56
|
-
"--column-margin-left-mobile": getMobileStyle({
|
|
57
|
-
stackedStyle: mobileMarginLeft,
|
|
58
|
-
desktopStyle: gutterPixels,
|
|
59
|
-
}),
|
|
60
|
-
"--column-width-tablet": getTabletStyle({
|
|
61
|
-
stackedStyle: mobileWidth,
|
|
62
|
-
desktopStyle: width,
|
|
63
|
-
}),
|
|
64
|
-
"--column-margin-left-tablet": getTabletStyle({
|
|
65
|
-
stackedStyle: mobileMarginLeft,
|
|
66
|
-
desktopStyle: gutterPixels,
|
|
67
|
-
}),
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
const getWidthForBreakpointSize = function getWidthForBreakpointSize(size) {
|
|
71
|
-
const breakpointSizes = getSizesForBreakpoints(props.builderContext.content?.meta?.breakpoints || {});
|
|
72
|
-
return breakpointSizes[size].max;
|
|
73
|
-
};
|
|
74
|
-
const columnsStyles = function columnsStyles() {
|
|
75
|
-
return `
|
|
76
|
-
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
77
|
-
.${props.builderBlock.id}-breakpoints {
|
|
78
|
-
flex-direction: var(--flex-dir-tablet);
|
|
79
|
-
align-items: stretch;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.${props.builderBlock.id}-breakpoints > .builder-column {
|
|
83
|
-
width: var(--column-width-tablet) !important;
|
|
84
|
-
margin-left: var(--column-margin-left-tablet) !important;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
@media (max-width: ${getWidthForBreakpointSize("small")}px) {
|
|
89
|
-
.${props.builderBlock.id}-breakpoints {
|
|
90
|
-
flex-direction: var(--flex-dir);
|
|
91
|
-
align-items: stretch;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.${props.builderBlock.id}-breakpoints > .builder-column {
|
|
95
|
-
width: var(--column-width-mobile) !important;
|
|
96
|
-
margin-left: var(--column-margin-left-mobile) !important;
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
`;
|
|
100
|
-
};
|
|
101
|
-
return (React.createElement(React.Fragment, null,
|
|
102
|
-
React.createElement("div", { className: `builder-columns ${props.builderBlock.id}-breakpoints` +
|
|
103
|
-
" div-cc9939b0", style: columnsCssVars() },
|
|
104
|
-
TARGET !== "reactNative" ? (React.createElement(React.Fragment, null,
|
|
105
|
-
React.createElement(InlinedStyles, { styles: columnsStyles() }))) : null,
|
|
106
|
-
props.columns?.map((column, index) => (React.createElement("div", { className: "builder-column div-cc9939b0-2", style: columnCssVars(index), key: index },
|
|
107
|
-
React.createElement(Blocks, { blocks: column.blocks, path: `component.options.columns.${index}.blocks`, parent: props.builderBlock.id, styleProp: {
|
|
108
|
-
flexGrow: "1",
|
|
109
|
-
}, context: props.builderContext, registeredComponents: props.builderComponents }))))),
|
|
110
|
-
React.createElement("style", null, `.div-cc9939b0 {
|
|
111
|
-
display: flex;
|
|
112
|
-
line-height: normal;
|
|
113
|
-
}.div-cc9939b0-2 {
|
|
114
|
-
display: flex;
|
|
115
|
-
flex-direction: column;
|
|
116
|
-
align-items: stretch;
|
|
117
|
-
}`)));
|
|
118
|
-
}
|
|
119
|
-
export default Columns;
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
export const componentInfo = {
|
|
2
|
-
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
3
|
-
name: 'Columns',
|
|
4
|
-
isRSC: true,
|
|
5
|
-
inputs: [{
|
|
6
|
-
name: 'columns',
|
|
7
|
-
type: 'array',
|
|
8
|
-
broadcast: true,
|
|
9
|
-
subFields: [{
|
|
10
|
-
name: 'blocks',
|
|
11
|
-
type: 'array',
|
|
12
|
-
hideFromUI: true,
|
|
13
|
-
defaultValue: [{
|
|
14
|
-
'@type': '@builder.io/sdk:Element',
|
|
15
|
-
responsiveStyles: {
|
|
16
|
-
large: {
|
|
17
|
-
display: 'flex',
|
|
18
|
-
flexDirection: 'column',
|
|
19
|
-
alignItems: 'stretch',
|
|
20
|
-
flexShrink: '0',
|
|
21
|
-
position: 'relative',
|
|
22
|
-
marginTop: '30px',
|
|
23
|
-
textAlign: 'center',
|
|
24
|
-
lineHeight: 'normal',
|
|
25
|
-
height: 'auto',
|
|
26
|
-
minHeight: '20px',
|
|
27
|
-
minWidth: '20px',
|
|
28
|
-
overflow: 'hidden'
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
component: {
|
|
32
|
-
name: 'Image',
|
|
33
|
-
options: {
|
|
34
|
-
image: 'https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d',
|
|
35
|
-
backgroundPosition: 'center',
|
|
36
|
-
backgroundSize: 'cover',
|
|
37
|
-
aspectRatio: 0.7004048582995948
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}, {
|
|
41
|
-
'@type': '@builder.io/sdk:Element',
|
|
42
|
-
responsiveStyles: {
|
|
43
|
-
large: {
|
|
44
|
-
display: 'flex',
|
|
45
|
-
flexDirection: 'column',
|
|
46
|
-
alignItems: 'stretch',
|
|
47
|
-
flexShrink: '0',
|
|
48
|
-
position: 'relative',
|
|
49
|
-
marginTop: '30px',
|
|
50
|
-
textAlign: 'center',
|
|
51
|
-
lineHeight: 'normal',
|
|
52
|
-
height: 'auto'
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
component: {
|
|
56
|
-
name: 'Text',
|
|
57
|
-
options: {
|
|
58
|
-
text: '<p>Enter some text...</p>'
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}]
|
|
62
|
-
}, {
|
|
63
|
-
name: 'width',
|
|
64
|
-
type: 'number',
|
|
65
|
-
hideFromUI: true,
|
|
66
|
-
helperText: 'Width %, e.g. set to 50 to fill half of the space'
|
|
67
|
-
}, {
|
|
68
|
-
name: 'link',
|
|
69
|
-
type: 'url',
|
|
70
|
-
helperText: 'Optionally set a url that clicking this column will link to'
|
|
71
|
-
}],
|
|
72
|
-
defaultValue: [{
|
|
73
|
-
blocks: [{
|
|
74
|
-
'@type': '@builder.io/sdk:Element',
|
|
75
|
-
responsiveStyles: {
|
|
76
|
-
large: {
|
|
77
|
-
display: 'flex',
|
|
78
|
-
flexDirection: 'column',
|
|
79
|
-
alignItems: 'stretch',
|
|
80
|
-
flexShrink: '0',
|
|
81
|
-
position: 'relative',
|
|
82
|
-
marginTop: '30px',
|
|
83
|
-
textAlign: 'center',
|
|
84
|
-
lineHeight: 'normal',
|
|
85
|
-
height: 'auto',
|
|
86
|
-
minHeight: '20px',
|
|
87
|
-
minWidth: '20px',
|
|
88
|
-
overflow: 'hidden'
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
component: {
|
|
92
|
-
name: 'Image',
|
|
93
|
-
options: {
|
|
94
|
-
image: 'https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d',
|
|
95
|
-
backgroundPosition: 'center',
|
|
96
|
-
backgroundSize: 'cover',
|
|
97
|
-
aspectRatio: 0.7004048582995948
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
'@type': '@builder.io/sdk:Element',
|
|
102
|
-
responsiveStyles: {
|
|
103
|
-
large: {
|
|
104
|
-
display: 'flex',
|
|
105
|
-
flexDirection: 'column',
|
|
106
|
-
alignItems: 'stretch',
|
|
107
|
-
flexShrink: '0',
|
|
108
|
-
position: 'relative',
|
|
109
|
-
marginTop: '30px',
|
|
110
|
-
textAlign: 'center',
|
|
111
|
-
lineHeight: 'normal',
|
|
112
|
-
height: 'auto'
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
component: {
|
|
116
|
-
name: 'Text',
|
|
117
|
-
options: {
|
|
118
|
-
text: '<p>Enter some text...</p>'
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}]
|
|
122
|
-
}, {
|
|
123
|
-
blocks: [{
|
|
124
|
-
'@type': '@builder.io/sdk:Element',
|
|
125
|
-
responsiveStyles: {
|
|
126
|
-
large: {
|
|
127
|
-
display: 'flex',
|
|
128
|
-
flexDirection: 'column',
|
|
129
|
-
alignItems: 'stretch',
|
|
130
|
-
flexShrink: '0',
|
|
131
|
-
position: 'relative',
|
|
132
|
-
marginTop: '30px',
|
|
133
|
-
textAlign: 'center',
|
|
134
|
-
lineHeight: 'normal',
|
|
135
|
-
height: 'auto',
|
|
136
|
-
minHeight: '20px',
|
|
137
|
-
minWidth: '20px',
|
|
138
|
-
overflow: 'hidden'
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
component: {
|
|
142
|
-
name: 'Image',
|
|
143
|
-
options: {
|
|
144
|
-
image: 'https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d',
|
|
145
|
-
backgroundPosition: 'center',
|
|
146
|
-
backgroundSize: 'cover',
|
|
147
|
-
aspectRatio: 0.7004048582995948
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}, {
|
|
151
|
-
'@type': '@builder.io/sdk:Element',
|
|
152
|
-
responsiveStyles: {
|
|
153
|
-
large: {
|
|
154
|
-
display: 'flex',
|
|
155
|
-
flexDirection: 'column',
|
|
156
|
-
alignItems: 'stretch',
|
|
157
|
-
flexShrink: '0',
|
|
158
|
-
position: 'relative',
|
|
159
|
-
marginTop: '30px',
|
|
160
|
-
textAlign: 'center',
|
|
161
|
-
lineHeight: 'normal',
|
|
162
|
-
height: 'auto'
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
component: {
|
|
166
|
-
name: 'Text',
|
|
167
|
-
options: {
|
|
168
|
-
text: '<p>Enter some text...</p>'
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}]
|
|
172
|
-
}],
|
|
173
|
-
onChange: (options) => {
|
|
174
|
-
function clearWidths() {
|
|
175
|
-
columns.forEach(col => {
|
|
176
|
-
col.delete('width');
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
const columns = options.get('columns');
|
|
180
|
-
if (Array.isArray(columns)) {
|
|
181
|
-
const containsColumnWithWidth = !!columns.find(col => col.get('width'));
|
|
182
|
-
if (containsColumnWithWidth) {
|
|
183
|
-
const containsColumnWithoutWidth = !!columns.find(col => !col.get('width'));
|
|
184
|
-
if (containsColumnWithoutWidth) {
|
|
185
|
-
clearWidths();
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
const sumWidths = columns.reduce((memo, col) => {
|
|
189
|
-
return memo + col.get('width');
|
|
190
|
-
}, 0);
|
|
191
|
-
const widthsDontAddUp = sumWidths !== 100;
|
|
192
|
-
if (widthsDontAddUp) {
|
|
193
|
-
clearWidths();
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}, {
|
|
200
|
-
name: 'space',
|
|
201
|
-
type: 'number',
|
|
202
|
-
defaultValue: 20,
|
|
203
|
-
helperText: 'Size of gap between columns',
|
|
204
|
-
advanced: true
|
|
205
|
-
}, {
|
|
206
|
-
name: 'stackColumnsAt',
|
|
207
|
-
type: 'string',
|
|
208
|
-
defaultValue: 'tablet',
|
|
209
|
-
helperText: 'Convert horizontal columns to vertical at what device size',
|
|
210
|
-
enum: ['tablet', 'mobile', 'never'],
|
|
211
|
-
advanced: true
|
|
212
|
-
}, {
|
|
213
|
-
name: 'reverseColumnsWhenStacked',
|
|
214
|
-
type: 'boolean',
|
|
215
|
-
defaultValue: false,
|
|
216
|
-
helperText: 'When stacking columns for mobile devices, reverse the ordering',
|
|
217
|
-
advanced: true
|
|
218
|
-
}]
|
|
219
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const componentInfo = {
|
|
2
|
-
name: 'Custom Code',
|
|
3
|
-
static: true,
|
|
4
|
-
requiredPermissions: ['editCode'],
|
|
5
|
-
inputs: [{
|
|
6
|
-
name: 'code',
|
|
7
|
-
type: 'html',
|
|
8
|
-
required: true,
|
|
9
|
-
defaultValue: '<p>Hello there, I am custom HTML code!</p>',
|
|
10
|
-
code: true
|
|
11
|
-
}, {
|
|
12
|
-
name: 'replaceNodes',
|
|
13
|
-
type: 'boolean',
|
|
14
|
-
helperText: 'Preserve server rendered dom nodes',
|
|
15
|
-
advanced: true
|
|
16
|
-
}, {
|
|
17
|
-
name: 'scriptsClientOnly',
|
|
18
|
-
type: 'boolean',
|
|
19
|
-
defaultValue: false,
|
|
20
|
-
helperText: 'Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads',
|
|
21
|
-
advanced: true
|
|
22
|
-
}]
|
|
23
|
-
};
|