@builder.io/react 8.0.6-1 → 8.0.6-3
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/builder-react-lite.cjs.js +2 -0
- package/dist/builder-react-lite.cjs.js.map +1 -0
- package/dist/builder-react-lite.esm.js +2 -0
- package/dist/builder-react-lite.esm.js.map +1 -0
- package/dist/builder-react.browser.js +11 -0
- package/dist/builder-react.browser.js.map +1 -0
- package/dist/builder-react.cjs.js +2 -0
- package/dist/builder-react.cjs.js.map +1 -0
- package/dist/builder-react.es5.js +2 -0
- package/dist/builder-react.es5.js.map +1 -0
- package/dist/builder-react.unpkg.js +11 -0
- package/dist/builder-react.unpkg.js.map +1 -0
- package/dist/lib/lib/on-change.js +228 -0
- package/dist/lib/lib/on-change.js.map +1 -0
- package/dist/lib/package.json +110 -0
- package/dist/lib/rollup.config.js +131 -0
- package/dist/lib/rollup.config.js.map +1 -0
- package/dist/lib/src/blocks/Button.js +86 -0
- package/dist/lib/src/blocks/Button.js.map +1 -0
- package/dist/lib/src/blocks/Columns.js +243 -0
- package/dist/lib/src/blocks/Columns.js.map +1 -0
- package/dist/lib/src/blocks/CustomCode.js +227 -0
- package/dist/lib/src/blocks/CustomCode.js.map +1 -0
- package/dist/lib/src/blocks/Embed.js +114 -0
- package/dist/lib/src/blocks/Embed.js.map +1 -0
- package/dist/lib/src/blocks/Fragment.js +45 -0
- package/dist/lib/src/blocks/Fragment.js.map +1 -0
- package/dist/lib/src/blocks/Image.js +532 -0
- package/dist/lib/src/blocks/Image.js.map +1 -0
- package/dist/lib/src/blocks/Mutation.js +93 -0
- package/dist/lib/src/blocks/Mutation.js.map +1 -0
- package/dist/lib/src/blocks/PersonalizationContainer.js +174 -0
- package/dist/lib/src/blocks/PersonalizationContainer.js.map +1 -0
- package/dist/lib/src/blocks/Router.js +354 -0
- package/dist/lib/src/blocks/Router.js.map +1 -0
- package/dist/lib/src/blocks/Section.js +150 -0
- package/dist/lib/src/blocks/Section.js.map +1 -0
- package/dist/lib/src/blocks/Slot.js +41 -0
- package/dist/lib/src/blocks/Slot.js.map +1 -0
- package/dist/lib/src/blocks/StateProvider.js +61 -0
- package/dist/lib/src/blocks/StateProvider.js.map +1 -0
- package/dist/lib/src/blocks/Symbol.js +192 -0
- package/dist/lib/src/blocks/Symbol.js.map +1 -0
- package/dist/lib/src/blocks/Text.js +132 -0
- package/dist/lib/src/blocks/Text.js.map +1 -0
- package/dist/lib/src/blocks/Video.js +261 -0
- package/dist/lib/src/blocks/Video.js.map +1 -0
- package/dist/lib/src/blocks/forms/Button.js +74 -0
- package/dist/lib/src/blocks/forms/Button.js.map +1 -0
- package/dist/lib/src/blocks/forms/Form.js +590 -0
- package/dist/lib/src/blocks/forms/Form.js.map +1 -0
- package/dist/lib/src/blocks/forms/Input.js +133 -0
- package/dist/lib/src/blocks/forms/Input.js.map +1 -0
- package/dist/lib/src/blocks/forms/Label.js +81 -0
- package/dist/lib/src/blocks/forms/Label.js.map +1 -0
- package/dist/lib/src/blocks/forms/Select.js +104 -0
- package/dist/lib/src/blocks/forms/Select.js.map +1 -0
- package/dist/lib/src/blocks/forms/TextArea.js +89 -0
- package/dist/lib/src/blocks/forms/TextArea.js.map +1 -0
- package/dist/lib/src/blocks/raw/Img.js +66 -0
- package/dist/lib/src/blocks/raw/Img.js.map +1 -0
- package/dist/lib/src/blocks/raw/RawText.js +47 -0
- package/dist/lib/src/blocks/raw/RawText.js.map +1 -0
- package/dist/lib/src/builder-react-lite.js +31 -0
- package/dist/lib/src/builder-react-lite.js.map +1 -0
- package/dist/lib/src/builder-react.js +106 -0
- package/dist/lib/src/builder-react.js.map +1 -0
- package/dist/lib/src/components/Link.js +35 -0
- package/dist/lib/src/components/Link.js.map +1 -0
- package/dist/lib/src/components/builder-block.component.js +556 -0
- package/dist/lib/src/components/builder-block.component.js.map +1 -0
- package/dist/lib/src/components/builder-blocks.component.js +167 -0
- package/dist/lib/src/components/builder-blocks.component.js.map +1 -0
- package/dist/lib/src/components/builder-component.component.js +1126 -0
- package/dist/lib/src/components/builder-component.component.js.map +1 -0
- package/dist/lib/src/components/builder-content.component.js +321 -0
- package/dist/lib/src/components/builder-content.component.js.map +1 -0
- package/dist/lib/src/components/insert-spacer.component.js +106 -0
- package/dist/lib/src/components/insert-spacer.component.js.map +1 -0
- package/dist/lib/src/components/no-wrap.js +7 -0
- package/dist/lib/src/components/no-wrap.js.map +1 -0
- package/dist/lib/src/components/variants-provider.component.js +108 -0
- package/dist/lib/src/components/variants-provider.component.js.map +1 -0
- package/dist/lib/src/constants/device-sizes.constant.js +91 -0
- package/dist/lib/src/constants/device-sizes.constant.js.map +1 -0
- package/dist/lib/src/constants/file-types.constant.js +72 -0
- package/dist/lib/src/constants/file-types.constant.js.map +1 -0
- package/dist/lib/src/decorators/builder-block.decorator.js +10 -0
- package/dist/lib/src/decorators/builder-block.decorator.js.map +1 -0
- package/dist/lib/src/functions/apply-patch-with-mutation.js +80 -0
- package/dist/lib/src/functions/apply-patch-with-mutation.js.map +1 -0
- package/dist/lib/src/functions/apply-patch-with-mutation.test.js +54 -0
- package/dist/lib/src/functions/apply-patch-with-mutation.test.js.map +1 -0
- package/dist/lib/src/functions/block-to-html-string.js +21 -0
- package/dist/lib/src/functions/block-to-html-string.js.map +1 -0
- package/dist/lib/src/functions/debonce-next-tick.js +43 -0
- package/dist/lib/src/functions/debonce-next-tick.js.map +1 -0
- package/dist/lib/src/functions/extract-localized-values.js +35 -0
- package/dist/lib/src/functions/extract-localized-values.js.map +1 -0
- package/dist/lib/src/functions/filter-with-custom-targeting.js +88 -0
- package/dist/lib/src/functions/filter-with-custom-targeting.js.map +1 -0
- package/dist/lib/src/functions/get-builder-pixel.js +27 -0
- package/dist/lib/src/functions/get-builder-pixel.js.map +1 -0
- package/dist/lib/src/functions/get.js +12 -0
- package/dist/lib/src/functions/get.js.map +1 -0
- package/dist/lib/src/functions/is-debug.js +8 -0
- package/dist/lib/src/functions/is-debug.js.map +1 -0
- package/dist/lib/src/functions/no-wrap.js +60 -0
- package/dist/lib/src/functions/no-wrap.js.map +1 -0
- package/dist/lib/src/functions/safe-dynamic-require.js +51 -0
- package/dist/lib/src/functions/safe-dynamic-require.js.map +1 -0
- package/dist/lib/src/functions/set.js +21 -0
- package/dist/lib/src/functions/set.js.map +1 -0
- package/dist/lib/src/functions/should-force-browser-runtime-in-node.js +22 -0
- package/dist/lib/src/functions/should-force-browser-runtime-in-node.js.map +1 -0
- package/dist/lib/src/functions/string-to-function.js +166 -0
- package/dist/lib/src/functions/string-to-function.js.map +1 -0
- package/dist/lib/src/functions/throttle.js +42 -0
- package/dist/lib/src/functions/throttle.js.map +1 -0
- package/dist/lib/src/functions/traverse.js +72 -0
- package/dist/lib/src/functions/traverse.js.map +1 -0
- package/dist/lib/src/functions/try-eval.js +75 -0
- package/dist/lib/src/functions/try-eval.js.map +1 -0
- package/dist/lib/src/functions/update-metadata.js +42 -0
- package/dist/lib/src/functions/update-metadata.js.map +1 -0
- package/dist/lib/src/functions/utils.js +20 -0
- package/dist/lib/src/functions/utils.js.map +1 -0
- package/dist/lib/src/functions/with-builder.js +10 -0
- package/dist/lib/src/functions/with-builder.js.map +1 -0
- package/dist/lib/src/functions/with-children.js +77 -0
- package/dist/lib/src/functions/with-children.js.map +1 -0
- package/dist/lib/src/hooks/useIsPreviewing.js +16 -0
- package/dist/lib/src/hooks/useIsPreviewing.js.map +1 -0
- package/dist/lib/src/scripts/init-editing.js +19 -0
- package/dist/lib/src/scripts/init-editing.js.map +1 -0
- package/dist/lib/src/sdk-version.js +5 -0
- package/dist/lib/src/sdk-version.js.map +1 -0
- package/dist/lib/src/store/builder-async-requests.js +19 -0
- package/dist/lib/src/store/builder-async-requests.js.map +1 -0
- package/dist/lib/src/store/builder-meta.js +13 -0
- package/dist/lib/src/store/builder-meta.js.map +1 -0
- package/dist/lib/src/store/builder-store.js +15 -0
- package/dist/lib/src/store/builder-store.js.map +1 -0
- package/dist/lib/src/to-error.js +22 -0
- package/dist/lib/src/to-error.js.map +1 -0
- package/dist/lib/test/basic.test.js +212 -0
- package/dist/lib/test/basic.test.js.map +1 -0
- package/dist/lib/test/functions/render-block.js +24 -0
- package/dist/lib/test/functions/render-block.js.map +1 -0
- package/dist/lib/test/image.test.js +107 -0
- package/dist/lib/test/image.test.js.map +1 -0
- package/dist/lib/test/setupTests.js +8 -0
- package/dist/lib/test/setupTests.js.map +1 -0
- package/dist/types/lib/on-change.d.ts +8 -0
- package/dist/types/rollup.config.d.ts +44 -0
- package/dist/types/src/blocks/Button.d.ts +7 -0
- package/dist/types/src/blocks/Columns.d.ts +1 -0
- package/dist/types/src/blocks/CustomCode.d.ts +1 -0
- package/dist/types/src/blocks/Embed.d.ts +1 -0
- package/dist/types/src/blocks/Fragment.d.ts +5 -0
- package/dist/types/src/blocks/Image.d.ts +6 -0
- package/dist/types/src/blocks/Mutation.d.ts +8 -0
- package/dist/types/src/blocks/PersonalizationContainer.d.ts +19 -0
- package/dist/types/src/blocks/Router.d.ts +32 -0
- package/dist/types/src/blocks/Section.d.ts +1 -0
- package/dist/types/src/blocks/Slot.d.ts +5 -0
- package/dist/types/src/blocks/StateProvider.d.ts +1 -0
- package/dist/types/src/blocks/Symbol.d.ts +19 -0
- package/dist/types/src/blocks/Text.d.ts +6 -0
- package/dist/types/src/blocks/Video.d.ts +1 -0
- package/dist/types/src/blocks/forms/Button.d.ts +5 -0
- package/dist/types/src/blocks/forms/Form.d.ts +24 -0
- package/dist/types/src/blocks/forms/Input.d.ts +10 -0
- package/dist/types/src/blocks/forms/Label.d.ts +8 -0
- package/dist/types/src/blocks/forms/Select.d.ts +12 -0
- package/dist/types/src/blocks/forms/TextArea.d.ts +9 -0
- package/dist/types/src/blocks/raw/Img.d.ts +7 -0
- package/dist/types/src/blocks/raw/RawText.d.ts +8 -0
- package/dist/types/src/builder-react-lite.d.ts +17 -0
- package/dist/types/src/builder-react.d.ts +45 -0
- package/dist/types/src/components/Link.d.ts +9 -0
- package/dist/types/src/components/builder-block.component.d.ts +50 -0
- package/dist/types/src/components/builder-blocks.component.d.ts +29 -0
- package/dist/types/src/components/builder-component.component.d.ts +324 -0
- package/dist/types/src/components/builder-content.component.d.ts +271 -0
- package/dist/types/src/components/insert-spacer.component.d.ts +13 -0
- package/dist/types/src/components/no-wrap.d.ts +2 -0
- package/dist/types/src/components/variants-provider.component.d.ts +8 -0
- package/dist/types/src/constants/device-sizes.constant.d.ts +57 -0
- package/dist/types/src/constants/file-types.constant.d.ts +2 -0
- package/dist/types/src/decorators/builder-block.decorator.d.ts +5 -0
- package/dist/types/src/functions/apply-patch-with-mutation.d.ts +5 -0
- package/dist/types/src/functions/apply-patch-with-mutation.test.d.ts +1 -0
- package/dist/types/src/functions/block-to-html-string.d.ts +3 -0
- package/dist/types/src/functions/debonce-next-tick.d.ts +2 -0
- package/dist/types/src/functions/extract-localized-values.d.ts +2 -0
- package/dist/types/src/functions/filter-with-custom-targeting.d.ts +15 -0
- package/dist/types/src/functions/get-builder-pixel.d.ts +2 -0
- package/dist/types/src/functions/get.d.ts +1 -0
- package/dist/types/src/functions/is-debug.d.ts +1 -0
- package/dist/types/src/functions/no-wrap.d.ts +33 -0
- package/dist/types/src/functions/safe-dynamic-require.d.ts +3 -0
- package/dist/types/src/functions/set.d.ts +1 -0
- package/dist/types/src/functions/should-force-browser-runtime-in-node.d.ts +1 -0
- package/dist/types/src/functions/string-to-function.d.ts +7 -0
- package/dist/types/src/functions/throttle.d.ts +1 -0
- package/dist/types/src/functions/traverse.d.ts +34 -0
- package/dist/types/src/functions/try-eval.d.ts +1 -0
- package/dist/types/src/functions/update-metadata.d.ts +17 -0
- package/dist/types/src/functions/utils.d.ts +2 -0
- package/dist/types/src/functions/with-builder.d.ts +2 -0
- package/dist/types/src/functions/with-children.d.ts +29 -0
- package/dist/types/src/hooks/useIsPreviewing.d.ts +1 -0
- package/dist/types/src/scripts/init-editing.d.ts +1 -0
- package/dist/types/src/sdk-version.d.ts +1 -0
- package/dist/types/src/store/builder-async-requests.d.ts +13 -0
- package/dist/types/src/store/builder-meta.d.ts +6 -0
- package/dist/types/src/store/builder-store.d.ts +10 -0
- package/dist/types/src/to-error.d.ts +13 -0
- package/dist/types/test/basic.test.d.ts +4 -0
- package/dist/types/test/functions/render-block.d.ts +3 -0
- package/dist/types/test/image.test.d.ts +1 -0
- package/dist/types/test/setupTests.d.ts +0 -0
- package/package.json +1 -1
- package/src/constants/device-sizes.constant.ts +1 -1
- package/src/scripts/init-editing.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-block.js","sourceRoot":"","sources":["../../../../test/functions/render-block.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEO,IAAM,EAAE,GAAG,UAAC,OAAiC,EAAE,KAAc,IAAqB,OAAA,YACvF,OAAO,EAAE,yBAAyB,EAClC,EAAE,EAAE,kBAAW,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAE,IACpE,OAAO,EACV,EAJuF,CAIvF,CAAC;AAJU,QAAA,EAAE,MAIZ;AAEI,IAAM,KAAK,GAAG,UACnB,IAAY,EACZ,OAAa,EACb,SAAmC,EACnC,KAAc;IAEd,OAAA,IAAA,UAAE,wBAEK,SAAS,KACZ,SAAS,EAAE;YACT,IAAI,MAAA;YACJ,OAAO,SAAA;SACR,KAEH,KAAK,CACN;AATD,CASC,CAAC;AAfS,QAAA,KAAK,SAed"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
var React = __importStar(require("react"));
|
|
27
|
+
var Image_1 = require("../src/blocks/Image");
|
|
28
|
+
var reactTestRenderer = __importStar(require("react-test-renderer"));
|
|
29
|
+
var render_block_1 = require("./functions/render-block");
|
|
30
|
+
var builder_react_1 = require("../src/builder-react");
|
|
31
|
+
describe('Image', function () {
|
|
32
|
+
it('Builder image url', function () {
|
|
33
|
+
var tree = reactTestRenderer
|
|
34
|
+
.create(React.createElement(Image_1.Image, { image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F755c131471fb49ab91dc0bdc45bc85b5?width=1003" }))
|
|
35
|
+
.toJSON();
|
|
36
|
+
expect(tree).toMatchSnapshot();
|
|
37
|
+
});
|
|
38
|
+
it('Builder image url with width', function () {
|
|
39
|
+
var tree = reactTestRenderer
|
|
40
|
+
.create(React.createElement(Image_1.Image, { image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F755c131471fb49ab91dc0bdc45bc85b5?width=1003" }))
|
|
41
|
+
.toJSON();
|
|
42
|
+
expect(tree).toMatchSnapshot();
|
|
43
|
+
});
|
|
44
|
+
it('Shopify image url', function () {
|
|
45
|
+
var tree = reactTestRenderer
|
|
46
|
+
.create(React.createElement(Image_1.Image, { image: "https://cdn.shopify.com/s/files/1/0374/6457/2041/products/valerie-elash-o1Ic6JdypmA-unsplash.jpg?v=1592506853" }))
|
|
47
|
+
.toJSON();
|
|
48
|
+
expect(tree).toMatchSnapshot();
|
|
49
|
+
});
|
|
50
|
+
it('Amp image', function () {
|
|
51
|
+
var imageBlock = (0, render_block_1.block)('Image', {
|
|
52
|
+
image: 'https://cdn.shopify.com/s/files/1/0374/6457/2041/products/valerie-elash-o1Ic6JdypmA-unsplash.jpg?v=1592506853',
|
|
53
|
+
}, {
|
|
54
|
+
responsiveStyles: {
|
|
55
|
+
large: {
|
|
56
|
+
width: '345px',
|
|
57
|
+
},
|
|
58
|
+
medium: {
|
|
59
|
+
width: '100%',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}, 1234);
|
|
63
|
+
var renderedBlock = reactTestRenderer
|
|
64
|
+
.create(React.createElement(builder_react_1.BuilderPage, { model: "page", ampMode: true, content: {
|
|
65
|
+
data: {
|
|
66
|
+
blocks: [imageBlock],
|
|
67
|
+
},
|
|
68
|
+
} }))
|
|
69
|
+
.toJSON();
|
|
70
|
+
expect(renderedBlock).toMatchSnapshot();
|
|
71
|
+
});
|
|
72
|
+
it('Lazy load', function () {
|
|
73
|
+
var tree = reactTestRenderer
|
|
74
|
+
.create(React.createElement(Image_1.Image, { image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F755c131471fb49ab91dc0bdc45bc85b5?width=1003", lazy: true }))
|
|
75
|
+
.toJSON();
|
|
76
|
+
expect(tree).toMatchSnapshot();
|
|
77
|
+
});
|
|
78
|
+
it('with sizes, srcset, and alt', function () {
|
|
79
|
+
var tree = reactTestRenderer
|
|
80
|
+
.create(React.createElement(Image_1.Image, { sizes: "(max-width: 600px) 67vw, 92vw", srcset: "nosrcset", altText: "this great image", image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F755c131471fb49ab91dc0bdc45bc85b5?width=1003", amp: "true" }))
|
|
81
|
+
.toJSON();
|
|
82
|
+
expect(tree).toMatchSnapshot();
|
|
83
|
+
});
|
|
84
|
+
it('with responsive styles', function () {
|
|
85
|
+
var imageBlock = (0, render_block_1.block)('Image', {
|
|
86
|
+
image: 'https://cdn.shopify.com/s/files/1/0374/6457/2041/products/valerie-elash-o1Ic6JdypmA-unsplash.jpg?v=1592506853',
|
|
87
|
+
}, {
|
|
88
|
+
responsiveStyles: {
|
|
89
|
+
large: {
|
|
90
|
+
width: '345px',
|
|
91
|
+
},
|
|
92
|
+
medium: {
|
|
93
|
+
width: '100%',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
}, 1234);
|
|
97
|
+
var renderedBlock = reactTestRenderer
|
|
98
|
+
.create(React.createElement(builder_react_1.BuilderPage, { model: "page", content: {
|
|
99
|
+
data: {
|
|
100
|
+
blocks: [imageBlock],
|
|
101
|
+
},
|
|
102
|
+
} }))
|
|
103
|
+
.toJSON();
|
|
104
|
+
expect(renderedBlock).toMatchSnapshot();
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
//# sourceMappingURL=image.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.test.js","sourceRoot":"","sources":["../../../test/image.test.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupTests.js","sourceRoot":"","sources":["../../../test/setupTests.ts"],"names":[],"mappings":";AAAA,UAAU,CAAC;IACT,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;AACjE,CAAC,CAAC,CAAC;AACH,SAAS,CAAC;IACR,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;AAClD,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export = onChange;
|
|
2
|
+
declare function onChange(object: any, onChange: any, options: any): any;
|
|
3
|
+
declare namespace onChange {
|
|
4
|
+
export { target, unsubscribe, __esModule, onChange as default };
|
|
5
|
+
}
|
|
6
|
+
declare function target(proxy: any): any;
|
|
7
|
+
declare function unsubscribe(proxy: any): any;
|
|
8
|
+
declare const __esModule: boolean;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare const _default: ({
|
|
2
|
+
output: {
|
|
3
|
+
file: string;
|
|
4
|
+
name: string;
|
|
5
|
+
format: string;
|
|
6
|
+
sourcemap: boolean;
|
|
7
|
+
amd: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
input: string;
|
|
12
|
+
external: string[];
|
|
13
|
+
watch: {
|
|
14
|
+
include: string;
|
|
15
|
+
};
|
|
16
|
+
plugins: any[];
|
|
17
|
+
} | {
|
|
18
|
+
output: {
|
|
19
|
+
file: string;
|
|
20
|
+
format: string;
|
|
21
|
+
sourcemap: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
external: string[];
|
|
24
|
+
plugins: any[];
|
|
25
|
+
input: string;
|
|
26
|
+
watch: {
|
|
27
|
+
include: string;
|
|
28
|
+
};
|
|
29
|
+
} | {
|
|
30
|
+
output: {
|
|
31
|
+
file: string;
|
|
32
|
+
format: string;
|
|
33
|
+
name: string;
|
|
34
|
+
sourcemap: boolean;
|
|
35
|
+
amd?: undefined;
|
|
36
|
+
};
|
|
37
|
+
input: string;
|
|
38
|
+
external: string[];
|
|
39
|
+
watch: {
|
|
40
|
+
include: string;
|
|
41
|
+
};
|
|
42
|
+
plugins: any[];
|
|
43
|
+
})[];
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Columns: Function;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CustomCode: Function;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Embed: Function;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BuilderElement } from '@builder.io/sdk';
|
|
2
|
+
import { Breakpoints } from '../constants/device-sizes.constant';
|
|
3
|
+
export declare function updateQueryParam(uri: string | undefined, key: string, value: string | number | boolean): string;
|
|
4
|
+
export declare function getSrcSet(url: string): string;
|
|
5
|
+
export declare const getSizes: (sizes: string, block: BuilderElement, contentBreakpoints?: Breakpoints) => string;
|
|
6
|
+
export declare const Image: Function;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BuilderElement } from '@builder.io/sdk';
|
|
3
|
+
import { Query } from '../functions/filter-with-custom-targeting';
|
|
4
|
+
export type PersonalizationContainerProps = {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
previewingIndex: number | null;
|
|
7
|
+
builderBlock?: BuilderElement;
|
|
8
|
+
builderState: any;
|
|
9
|
+
variants?: [
|
|
10
|
+
{
|
|
11
|
+
query: Query[];
|
|
12
|
+
startDate?: string;
|
|
13
|
+
endDate?: string;
|
|
14
|
+
blocks: BuilderElement[];
|
|
15
|
+
}
|
|
16
|
+
];
|
|
17
|
+
attributes: any;
|
|
18
|
+
};
|
|
19
|
+
export declare function PersonalizationContainer(props: PersonalizationContainerProps): React.JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BuilderElement } from '@builder.io/sdk';
|
|
2
|
+
export interface RouterProps {
|
|
3
|
+
model?: string;
|
|
4
|
+
data?: string;
|
|
5
|
+
content?: any;
|
|
6
|
+
handleRouting?: boolean;
|
|
7
|
+
builderBlock?: BuilderElement;
|
|
8
|
+
preloadOnHover?: boolean;
|
|
9
|
+
onRoute?: (routeEvent: RouteEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface RouteEvent {
|
|
12
|
+
/**
|
|
13
|
+
* Url being routed to
|
|
14
|
+
*/
|
|
15
|
+
url: string;
|
|
16
|
+
/**
|
|
17
|
+
* Html anchor element the href is on that
|
|
18
|
+
* caused the route
|
|
19
|
+
*/
|
|
20
|
+
anchorNode: HTMLAnchorElement;
|
|
21
|
+
/**
|
|
22
|
+
* Has preventDefault() been called preventing
|
|
23
|
+
* builder from routing to the clicked URL
|
|
24
|
+
*/
|
|
25
|
+
defaultPrevented: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Prevents builder from handling routing for you to handle
|
|
28
|
+
* yourself
|
|
29
|
+
*/
|
|
30
|
+
preventDefault(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const Router: Function;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Section: Function;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StateProvider: Function;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BuilderElement } from '@builder.io/sdk';
|
|
2
|
+
export interface SymbolInfo {
|
|
3
|
+
model?: string;
|
|
4
|
+
entry?: string;
|
|
5
|
+
data?: any;
|
|
6
|
+
content?: any;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
dynamic?: boolean;
|
|
9
|
+
ownerId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SymbolProps {
|
|
12
|
+
symbol?: SymbolInfo;
|
|
13
|
+
dataOnly?: boolean;
|
|
14
|
+
dynamic?: boolean;
|
|
15
|
+
builderBlock?: BuilderElement;
|
|
16
|
+
attributes?: any;
|
|
17
|
+
inheritState?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const Symbol: Function;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Video: void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BuilderElement } from '@builder.io/sdk';
|
|
2
|
+
export interface FormProps {
|
|
3
|
+
attributes?: any;
|
|
4
|
+
name?: string;
|
|
5
|
+
action?: string;
|
|
6
|
+
validate?: boolean;
|
|
7
|
+
method?: string;
|
|
8
|
+
builderBlock?: BuilderElement;
|
|
9
|
+
sendSubmissionsTo?: string;
|
|
10
|
+
sendSubmissionsToEmail?: string;
|
|
11
|
+
sendWithJs?: boolean;
|
|
12
|
+
contentType?: string;
|
|
13
|
+
customHeaders?: {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
};
|
|
16
|
+
successUrl?: string;
|
|
17
|
+
previewState?: string;
|
|
18
|
+
successMessage?: BuilderElement[];
|
|
19
|
+
errorMessage?: BuilderElement[];
|
|
20
|
+
sendingMessage?: BuilderElement[];
|
|
21
|
+
resetFormOnSubmit?: boolean;
|
|
22
|
+
errorMessagePath?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const Form: Function;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BuilderElement } from '@builder.io/sdk';
|
|
3
|
+
export interface RawTextProps {
|
|
4
|
+
attributes?: any;
|
|
5
|
+
text?: string;
|
|
6
|
+
builderBlock?: BuilderElement;
|
|
7
|
+
}
|
|
8
|
+
export declare const RawText: (props: RawTextProps) => React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import './scripts/init-editing';
|
|
2
|
+
import { builder, Builder } from '@builder.io/sdk';
|
|
3
|
+
export { BuilderElement } from '@builder.io/sdk';
|
|
4
|
+
export { BuilderBlocks } from './components/builder-blocks.component';
|
|
5
|
+
export { BuilderBlock as BuilderBlockComponent } from './components/builder-block.component';
|
|
6
|
+
export { BuilderContent } from './components/builder-content.component';
|
|
7
|
+
import { BuilderComponent } from './components/builder-component.component';
|
|
8
|
+
export { BuilderStoreContext } from './store/builder-store';
|
|
9
|
+
export { BuilderMetaContext } from './store/builder-meta';
|
|
10
|
+
export { BuilderAsyncRequestsContext } from './store/builder-async-requests';
|
|
11
|
+
export { withChildren } from './functions/with-children';
|
|
12
|
+
export { BuilderComponent as BuilderPage };
|
|
13
|
+
export { BuilderComponent };
|
|
14
|
+
export { stringToFunction } from './functions/string-to-function';
|
|
15
|
+
export { useIsPreviewing } from './hooks/useIsPreviewing';
|
|
16
|
+
export { builder, Builder };
|
|
17
|
+
export default builder;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import './scripts/init-editing';
|
|
2
|
+
import { builder, Builder } from '@builder.io/sdk';
|
|
3
|
+
export { BuilderElement } from '@builder.io/sdk';
|
|
4
|
+
export { BuilderBlocks } from './components/builder-blocks.component';
|
|
5
|
+
export { BuilderBlock as BuilderBlockComponent } from './components/builder-block.component';
|
|
6
|
+
export { BuilderContent } from './components/builder-content.component';
|
|
7
|
+
import { BuilderComponent, onChange, RegisteredComponent } from './components/builder-component.component';
|
|
8
|
+
export { BuilderStoreContext, BuilderStore } from './store/builder-store';
|
|
9
|
+
export { BuilderMetaContext } from './store/builder-meta';
|
|
10
|
+
export { BuilderAsyncRequestsContext } from './store/builder-async-requests';
|
|
11
|
+
export { BuilderBlock } from './decorators/builder-block.decorator';
|
|
12
|
+
export * from './functions/update-metadata';
|
|
13
|
+
export { withBuilder } from './functions/with-builder';
|
|
14
|
+
export { withChildren } from './functions/with-children';
|
|
15
|
+
export { noWrap } from './functions/no-wrap';
|
|
16
|
+
export { BuilderComponent as BuilderPage, onChange, RegisteredComponent };
|
|
17
|
+
export { BuilderComponent };
|
|
18
|
+
export { BuilderComponent as Content };
|
|
19
|
+
export { Text } from './blocks/Text';
|
|
20
|
+
export { Slot as Dropzone } from './blocks/Slot';
|
|
21
|
+
export { Fragment } from './blocks/Fragment';
|
|
22
|
+
export { Columns } from './blocks/Columns';
|
|
23
|
+
export { Embed } from './blocks/Embed';
|
|
24
|
+
export { CustomCode } from './blocks/CustomCode';
|
|
25
|
+
export { Image, getSrcSet } from './blocks/Image';
|
|
26
|
+
export { Video } from './blocks/Video';
|
|
27
|
+
export { Symbol } from './blocks/Symbol';
|
|
28
|
+
export { Button } from './blocks/Button';
|
|
29
|
+
export { Section } from './blocks/Section';
|
|
30
|
+
export { StateProvider } from './blocks/StateProvider';
|
|
31
|
+
export { Router } from './blocks/Router';
|
|
32
|
+
export { Mutation } from './blocks/Mutation';
|
|
33
|
+
export { Form } from './blocks/forms/Form';
|
|
34
|
+
export { FormInput } from './blocks/forms/Input';
|
|
35
|
+
export { FormSubmitButton } from './blocks/forms/Button';
|
|
36
|
+
export { Label } from './blocks/forms/Label';
|
|
37
|
+
export { FormSelect } from './blocks/forms/Select';
|
|
38
|
+
export { TextArea } from './blocks/forms/TextArea';
|
|
39
|
+
export { Img } from './blocks/raw/Img';
|
|
40
|
+
export { RawText } from './blocks/raw/RawText';
|
|
41
|
+
export { PersonalizationContainer } from './blocks/PersonalizationContainer';
|
|
42
|
+
export { stringToFunction } from './functions/string-to-function';
|
|
43
|
+
export { useIsPreviewing } from './hooks/useIsPreviewing';
|
|
44
|
+
export { builder, Builder };
|
|
45
|
+
export default builder;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Link component should be used instead of an anchor tag in our components,
|
|
4
|
+
* this is to allow our users to override anchor tags in
|
|
5
|
+
* case they're using a routing Lib that requires using their
|
|
6
|
+
* custom Link component (e.g Next, Gatsby, React Router)
|
|
7
|
+
* <BuilderComponent renderLink=(props) => <myCustomLink {...props} /> />
|
|
8
|
+
*/
|
|
9
|
+
export declare const Link: (props: React.AnchorHTMLAttributes<HTMLAnchorElement>) => React.JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Builder, BuilderElement } from '@builder.io/sdk';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Size } from '../constants/device-sizes.constant';
|
|
5
|
+
export declare function deepCloneWithConditions<T = any>(obj: T): T;
|
|
6
|
+
export interface BuilderBlockProps {
|
|
7
|
+
fieldName?: string;
|
|
8
|
+
block: BuilderElement;
|
|
9
|
+
child?: boolean;
|
|
10
|
+
index?: number;
|
|
11
|
+
size?: Size;
|
|
12
|
+
emailMode?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface BuilderBlockState {
|
|
15
|
+
state: any;
|
|
16
|
+
rootState: any;
|
|
17
|
+
context: any;
|
|
18
|
+
update: Function;
|
|
19
|
+
}
|
|
20
|
+
export declare class BuilderBlock extends React.Component<BuilderBlockProps, {
|
|
21
|
+
hasError: boolean;
|
|
22
|
+
updates: number;
|
|
23
|
+
}> {
|
|
24
|
+
private _asyncRequests?;
|
|
25
|
+
private _errors?;
|
|
26
|
+
private _logs?;
|
|
27
|
+
hydrated: boolean;
|
|
28
|
+
state: {
|
|
29
|
+
hasError: boolean;
|
|
30
|
+
updates: number;
|
|
31
|
+
};
|
|
32
|
+
private privateState;
|
|
33
|
+
get store(): BuilderBlockState;
|
|
34
|
+
static getDerivedStateFromError(error: any): {
|
|
35
|
+
hasError: boolean;
|
|
36
|
+
};
|
|
37
|
+
componentDidCatch(error: any, errorInfo: any): void;
|
|
38
|
+
stringToFunction(str: string, expression?: boolean): (state: object, event?: Event | null | undefined, block?: any, builder?: Builder | undefined, Device?: any, update?: Function | null | undefined, _Builder?: typeof Builder | undefined, context?: object | undefined) => any;
|
|
39
|
+
get block(): BuilderElement;
|
|
40
|
+
emotionCss(responsiveStyles: BuilderElement['responsiveStyles']): any;
|
|
41
|
+
eval(str: string): any;
|
|
42
|
+
componentWillUnmount(): void;
|
|
43
|
+
onWindowMessage: (event: MessageEvent) => void;
|
|
44
|
+
componentDidMount(): void;
|
|
45
|
+
getElement(index?: number, state?: any): React.ReactNode;
|
|
46
|
+
get id(): string;
|
|
47
|
+
contents(state: BuilderBlockState): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | JSX.Element[] | null | undefined;
|
|
48
|
+
render(): JSX.Element;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Size } from '../constants/device-sizes.constant';
|
|
3
|
+
export interface BuilderBlocksProps {
|
|
4
|
+
fieldName?: string;
|
|
5
|
+
blocks?: any[] | React.ReactNode;
|
|
6
|
+
child?: boolean;
|
|
7
|
+
size?: Size;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
parentElementId?: string;
|
|
10
|
+
parent?: any;
|
|
11
|
+
dataPath?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
emailMode?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface BuilderBlocksState {
|
|
16
|
+
}
|
|
17
|
+
export declare class BuilderBlocks extends React.Component<BuilderBlocksProps, BuilderBlocksState> {
|
|
18
|
+
hydrated: boolean;
|
|
19
|
+
get isRoot(): boolean;
|
|
20
|
+
get noBlocks(): boolean;
|
|
21
|
+
get path(): string;
|
|
22
|
+
get parentId(): any;
|
|
23
|
+
componentDidMount(): void;
|
|
24
|
+
onClickEmptyBlocks: () => void;
|
|
25
|
+
onHoverEmptyBlocks: () => void;
|
|
26
|
+
render(): JSX.Element;
|
|
27
|
+
static renderInto(elementOrSelector: string | HTMLElement, props: BuilderBlocksProps | undefined, builderState: any): void;
|
|
28
|
+
}
|
|
29
|
+
export {};
|