cmspageblocks 1.0.2 → 1.0.7
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/build/index.js +64 -9
- package/package.json +7 -4
- package/rollup.config.js +6 -2
- package/src/components/Block.js +4 -2
- package/src/components/BlockTypes/Button.js +7 -0
- package/src/components/BlockTypes/Form.js +129 -0
- package/src/components/BlockTypes/ImageSlide.css.js +4 -0
- package/src/components/BlockTypes/ImageSlider.js +1 -0
- package/src/components/BlockTypes/Map.js +25 -0
- package/src/components/BlockTypes/Portal.js +7 -0
- package/src/components/BlockTypes/SearchBar.js +7 -0
- package/src/components/BlockTypes/index.js +17 -3
- package/src/components/Row.js +7 -5
- package/src/index.js +0 -1
package/build/index.js
CHANGED
|
@@ -1167,13 +1167,9 @@ var classnames = {exports: {}};
|
|
|
1167
1167
|
|
|
1168
1168
|
var classNames = classnames.exports;
|
|
1169
1169
|
|
|
1170
|
-
function
|
|
1171
|
-
|
|
1172
|
-
return /*#__PURE__*/React__default["default"].createElement("div",
|
|
1173
|
-
dangerouslySetInnerHTML: {
|
|
1174
|
-
__html: options.content
|
|
1175
|
-
}
|
|
1176
|
-
});
|
|
1170
|
+
function Button(_ref) {
|
|
1171
|
+
_ref.options;
|
|
1172
|
+
return /*#__PURE__*/React__default["default"].createElement("div", null, "Button");
|
|
1177
1173
|
}
|
|
1178
1174
|
|
|
1179
1175
|
function Image (_ref) {
|
|
@@ -3085,7 +3081,7 @@ function _taggedTemplateLiteral(strings, raw) {
|
|
|
3085
3081
|
}
|
|
3086
3082
|
|
|
3087
3083
|
var _templateObject$2;
|
|
3088
|
-
var SliderContainer = styled__default["default"].div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n.carousel .control-arrow,.carousel.carousel-slider .control-arrow{-webkit-transition:all .25s ease-in;-moz-transition:all .25s ease-in;-ms-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in;opacity:.4;filter:alpha(opacity=40);position:absolute;z-index:2;top:20px;background:none;border:0;font-size:32px;cursor:pointer}.carousel .control-arrow:focus,.carousel .control-arrow:hover{opacity:1;filter:alpha(opacity=100)}.carousel .control-arrow:before,.carousel.carousel-slider .control-arrow:before{margin:0 5px;display:inline-block;border-top:8px solid transparent;border-bottom:8px solid transparent;content:''}.carousel .control-disabled.control-arrow{opacity:0;filter:alpha(opacity=0);cursor:inherit;display:none}.carousel .control-prev.control-arrow{left:0}.carousel .control-prev.control-arrow:before{border-right:8px solid #fff}.carousel .control-next.control-arrow{right:0}.carousel .control-next.control-arrow:before{border-left:8px solid #fff}.carousel-root{outline:none}.carousel{position:relative;width:100%}.carousel *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.carousel img{width:100%;display:inline-block;pointer-events:none}.carousel .carousel{position:relative}.carousel .control-arrow{outline:0;border:0;background:none;top:50%;margin-top:-13px;font-size:18px}.carousel .thumbs-wrapper{margin:20px;overflow:hidden}.carousel .thumbs{-webkit-transition:all .15s ease-in;-moz-transition:all .15s ease-in;-ms-transition:all .15s ease-in;-o-transition:all .15s ease-in;transition:all .15s ease-in;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);position:relative;list-style:none;white-space:nowrap}.carousel .thumb{-webkit-transition:border .15s ease-in;-moz-transition:border .15s ease-in;-ms-transition:border .15s ease-in;-o-transition:border .15s ease-in;transition:border .15s ease-in;display:inline-block;margin-right:6px;white-space:nowrap;overflow:hidden;border:3px solid #fff;padding:2px}.carousel .thumb:focus{border:3px solid #ccc;outline:none}.carousel .thumb.selected,.carousel .thumb:hover{border:3px solid #333}.carousel .thumb img{vertical-align:top}.carousel.carousel-slider{position:relative;margin:0;overflow:hidden}.carousel.carousel-slider .control-arrow{top:0;color:#fff;font-size:26px;bottom:0;margin-top:0;padding:5px}.carousel.carousel-slider .control-arrow:hover{background:rgba(0,0,0,0.2)}.carousel .slider-wrapper{overflow:hidden;margin:auto;width:100%;-webkit-transition:height .15s ease-in;-moz-transition:height .15s ease-in;-ms-transition:height .15s ease-in;-o-transition:height .15s ease-in;transition:height .15s ease-in}.carousel .slider-wrapper.axis-horizontal .slider{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-horizontal .slider .slide{flex-direction:column;flex-flow:column}.carousel .slider-wrapper.axis-vertical{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-vertical .slider{-webkit-flex-direction:column;flex-direction:column}.carousel .slider{margin:0;padding:0;position:relative;list-style:none;width:100%}.carousel .slider.animated{-webkit-transition:all .35s ease-in-out;-moz-transition:all .35s ease-in-out;-ms-transition:all .35s ease-in-out;-o-transition:all .35s ease-in-out;transition:all .35s ease-in-out}.carousel .slide{min-width:100%;margin:0;position:relative;text-align:center}.carousel .slide img{width:100%;vertical-align:top;border:0}.carousel .slide iframe{display:inline-block;width:calc(100% - 80px);margin:0 40px 40px;border:0}.carousel .slide .legend{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-ms-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out;position:absolute;bottom:40px;left:50%;margin-left:-45%;width:90%;border-radius:10px;background:#000;color:#fff;padding:10px;font-size:12px;text-align:center;opacity:0.25;-webkit-transition:opacity .35s ease-in-out;-moz-transition:opacity .35s ease-in-out;-ms-transition:opacity .35s ease-in-out;-o-transition:opacity .35s ease-in-out;transition:opacity .35s ease-in-out}.carousel .control-dots{position:absolute;bottom:0;margin:10px 0;padding:0;text-align:center;width:100%;z-index:1}@media (min-width: 960px){.carousel .control-dots{bottom:0}}.carousel .control-dots .dot{-webkit-transition:opacity .25s ease-in;-moz-transition:opacity .25s ease-in;-ms-transition:opacity .25s ease-in;-o-transition:opacity .25s ease-in;transition:opacity .25s ease-in;opacity:.3;filter:alpha(opacity=30);box-shadow:1px 1px 2px rgba(0,0,0,0.9);background:#fff;border-radius:50%;width:8px;height:8px;cursor:pointer;display:inline-block;margin:0 8px}.carousel .control-dots .dot.selected,.carousel .control-dots .dot:hover{opacity:1;filter:alpha(opacity=100)}.carousel .carousel-status{position:absolute;top:0;right:0;padding:5px;font-size:10px;text-shadow:1px 1px 1px rgba(0,0,0,0.9);color:#fff}.carousel:hover .slide .legend{opacity:1}\n"])));
|
|
3084
|
+
var SliderContainer = styled__default["default"].div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n.carousel .control-arrow,.carousel.carousel-slider .control-arrow{-webkit-transition:all .25s ease-in;-moz-transition:all .25s ease-in;-ms-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in;opacity:.4;filter:alpha(opacity=40);position:absolute;z-index:2;top:20px;background:none;border:0;font-size:32px;cursor:pointer}.carousel .control-arrow:focus,.carousel .control-arrow:hover{opacity:1;filter:alpha(opacity=100)}.carousel .control-arrow:before,.carousel.carousel-slider .control-arrow:before{margin:0 5px;display:inline-block;border-top:8px solid transparent;border-bottom:8px solid transparent;content:''}.carousel .control-disabled.control-arrow{opacity:0;filter:alpha(opacity=0);cursor:inherit;display:none}.carousel .control-prev.control-arrow{left:0}.carousel .control-prev.control-arrow:before{border-right:8px solid #fff}.carousel .control-next.control-arrow{right:0}.carousel .control-next.control-arrow:before{border-left:8px solid #fff}.carousel-root{outline:none}.carousel{position:relative;width:100%}.carousel *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.carousel img{width:100%;display:inline-block;pointer-events:none}.carousel .carousel{position:relative}.carousel .control-arrow{outline:0;border:0;background:none;top:50%;margin-top:-13px;font-size:18px}.carousel .thumbs-wrapper{margin:20px;overflow:hidden}.carousel .thumbs{-webkit-transition:all .15s ease-in;-moz-transition:all .15s ease-in;-ms-transition:all .15s ease-in;-o-transition:all .15s ease-in;transition:all .15s ease-in;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);position:relative;list-style:none;white-space:nowrap}.carousel .thumb{-webkit-transition:border .15s ease-in;-moz-transition:border .15s ease-in;-ms-transition:border .15s ease-in;-o-transition:border .15s ease-in;transition:border .15s ease-in;display:inline-block;margin-right:6px;white-space:nowrap;overflow:hidden;border:3px solid #fff;padding:2px}.carousel .thumb:focus{border:3px solid #ccc;outline:none}.carousel .thumb.selected,.carousel .thumb:hover{border:3px solid #333}.carousel .thumb img{vertical-align:top}.carousel.carousel-slider{position:relative;margin:0;overflow:hidden}.carousel.carousel-slider .control-arrow{top:0;color:#fff;font-size:26px;bottom:0;margin-top:0;padding:5px}.carousel.carousel-slider .control-arrow:hover{background:rgba(0,0,0,0.2)}.carousel .slider-wrapper{overflow:hidden;margin:auto;width:100%;-webkit-transition:height .15s ease-in;-moz-transition:height .15s ease-in;-ms-transition:height .15s ease-in;-o-transition:height .15s ease-in;transition:height .15s ease-in}.carousel .slider-wrapper.axis-horizontal .slider{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-horizontal .slider .slide{flex-direction:column;flex-flow:column}.carousel .slider-wrapper.axis-vertical{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-vertical .slider{-webkit-flex-direction:column;flex-direction:column}.carousel .slider{margin:0;padding:0;position:relative;list-style:none;width:100%}.carousel .slider.animated{-webkit-transition:all .35s ease-in-out;-moz-transition:all .35s ease-in-out;-ms-transition:all .35s ease-in-out;-o-transition:all .35s ease-in-out;transition:all .35s ease-in-out}.carousel .slide{min-width:100%;margin:0;position:relative;text-align:center}.carousel .slide img{width:100%;vertical-align:top;border:0}.carousel .slide iframe{display:inline-block;width:calc(100% - 80px);margin:0 40px 40px;border:0}.carousel .slide .legend{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-ms-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out;position:absolute;bottom:40px;left:50%;margin-left:-45%;width:90%;border-radius:10px;background:#000;color:#fff;padding:10px;font-size:12px;text-align:center;opacity:0.25;-webkit-transition:opacity .35s ease-in-out;-moz-transition:opacity .35s ease-in-out;-ms-transition:opacity .35s ease-in-out;-o-transition:opacity .35s ease-in-out;transition:opacity .35s ease-in-out}.carousel .control-dots{position:absolute;bottom:0;margin:10px 0;padding:0;text-align:center;width:100%;z-index:1}@media (min-width: 960px){.carousel .control-dots{bottom:0}}.carousel .control-dots .dot{-webkit-transition:opacity .25s ease-in;-moz-transition:opacity .25s ease-in;-ms-transition:opacity .25s ease-in;-o-transition:opacity .25s ease-in;transition:opacity .25s ease-in;opacity:.3;filter:alpha(opacity=30);box-shadow:1px 1px 2px rgba(0,0,0,0.9);background:#fff;border-radius:50%;width:8px;height:8px;cursor:pointer;display:inline-block;margin:0 8px}.carousel .control-dots .dot.selected,.carousel .control-dots .dot:hover{opacity:1;filter:alpha(opacity=100)}.carousel .carousel-status{position:absolute;top:0;right:0;padding:5px;font-size:10px;text-shadow:1px 1px 1px rgba(0,0,0,0.9);color:#fff}.carousel:hover .slide .legend{opacity:1}\n ul li {\n padding: 0;\n }\n\n"])));
|
|
3089
3085
|
|
|
3090
3086
|
function ImageSlider(_ref) {
|
|
3091
3087
|
var options = _ref.options;
|
|
@@ -3093,6 +3089,7 @@ function ImageSlider(_ref) {
|
|
|
3093
3089
|
showThumbs: false,
|
|
3094
3090
|
swipeable: true
|
|
3095
3091
|
}, options.content.map(function (slide) {
|
|
3092
|
+
if (!slide.active) return;
|
|
3096
3093
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3097
3094
|
key: slide.image[0].reference
|
|
3098
3095
|
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
@@ -3102,6 +3099,41 @@ function ImageSlider(_ref) {
|
|
|
3102
3099
|
})));
|
|
3103
3100
|
}
|
|
3104
3101
|
|
|
3102
|
+
function HouseMap(_ref) {
|
|
3103
|
+
_ref.latitude;
|
|
3104
|
+
_ref.longitude;
|
|
3105
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null) // <MapContainer
|
|
3106
|
+
// center={[latitude, longitude]}
|
|
3107
|
+
// zoom={10}
|
|
3108
|
+
// scrollWheelZoom={false}
|
|
3109
|
+
// >
|
|
3110
|
+
// <TileLayer
|
|
3111
|
+
// attribution='© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
|
|
3112
|
+
// url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
3113
|
+
// />
|
|
3114
|
+
// <Marker position={[latitude, longitude]}>
|
|
3115
|
+
// {/* <Popup>
|
|
3116
|
+
// A pretty CSS3 popup. <br /> Easily customizable.
|
|
3117
|
+
// </Popup> */}
|
|
3118
|
+
// </Marker>
|
|
3119
|
+
// </MapContainer>
|
|
3120
|
+
;
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
function SearchBar(_ref) {
|
|
3124
|
+
_ref.options;
|
|
3125
|
+
return /*#__PURE__*/React__default["default"].createElement("div", null, "SearchBar");
|
|
3126
|
+
}
|
|
3127
|
+
|
|
3128
|
+
function Text (_ref) {
|
|
3129
|
+
var options = _ref.options;
|
|
3130
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3131
|
+
dangerouslySetInnerHTML: {
|
|
3132
|
+
__html: options.content
|
|
3133
|
+
}
|
|
3134
|
+
});
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3105
3137
|
var _templateObject$1, _templateObject2$1;
|
|
3106
3138
|
var BREAKPOINTS = {
|
|
3107
3139
|
DESKTOP: 992,
|
|
@@ -3133,6 +3165,30 @@ function Block(_ref) {
|
|
|
3133
3165
|
pageBlock.content;
|
|
3134
3166
|
|
|
3135
3167
|
switch (options.type) {
|
|
3168
|
+
case 'button':
|
|
3169
|
+
return /*#__PURE__*/React__default["default"].createElement(Wrapper, {
|
|
3170
|
+
options: options,
|
|
3171
|
+
key: pageBlock.id
|
|
3172
|
+
}, /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
3173
|
+
options: options
|
|
3174
|
+
}));
|
|
3175
|
+
|
|
3176
|
+
case 'map':
|
|
3177
|
+
return /*#__PURE__*/React__default["default"].createElement(Wrapper, {
|
|
3178
|
+
options: options,
|
|
3179
|
+
key: pageBlock.id
|
|
3180
|
+
}, /*#__PURE__*/React__default["default"].createElement(HouseMap, {
|
|
3181
|
+
options: options
|
|
3182
|
+
}));
|
|
3183
|
+
|
|
3184
|
+
case 'searchbar':
|
|
3185
|
+
return /*#__PURE__*/React__default["default"].createElement(Wrapper, {
|
|
3186
|
+
options: options,
|
|
3187
|
+
key: pageBlock.id
|
|
3188
|
+
}, /*#__PURE__*/React__default["default"].createElement(SearchBar, {
|
|
3189
|
+
options: options
|
|
3190
|
+
}));
|
|
3191
|
+
|
|
3136
3192
|
case 'text':
|
|
3137
3193
|
return /*#__PURE__*/React__default["default"].createElement(Wrapper, {
|
|
3138
3194
|
options: options,
|
|
@@ -3193,7 +3249,6 @@ function Row(_ref) {
|
|
|
3193
3249
|
|
|
3194
3250
|
function CmsBlocks(_ref) {
|
|
3195
3251
|
var content = _ref.content;
|
|
3196
|
-
// console.log({ content });
|
|
3197
3252
|
return /*#__PURE__*/React__default["default"].createElement(BlockContainer, null, content.page_rows.map(function (row, index) {
|
|
3198
3253
|
return /*#__PURE__*/React__default["default"].createElement(Row, {
|
|
3199
3254
|
content: row,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cmspageblocks",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,9 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"bukazu-portal-react": "^2.0.7",
|
|
32
32
|
"classnames": "^2.3.1",
|
|
33
|
-
"
|
|
33
|
+
"formik": "^2.2.9",
|
|
34
|
+
"leaflet": "^1.7.1",
|
|
35
|
+
"react-leaflet": "^3.2.2",
|
|
34
36
|
"react-responsive-carousel": "^3.2.21",
|
|
35
37
|
"styled-components": "^5.3.1"
|
|
36
38
|
},
|
|
@@ -39,8 +41,9 @@
|
|
|
39
41
|
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
|
40
42
|
"@babel/preset-env": "^7.15.0",
|
|
41
43
|
"@babel/preset-react": "^7.14.5",
|
|
42
|
-
"@rollup/plugin-commonjs": "^
|
|
44
|
+
"@rollup/plugin-commonjs": "^21.0.1",
|
|
43
45
|
"@rollup/plugin-json": "^4.1.0",
|
|
46
|
+
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
44
47
|
"babel-eslint": "^10.1.0",
|
|
45
48
|
"eslint": "^8.0.0",
|
|
46
49
|
"eslint-config-prettier": "^8.3.0",
|
|
@@ -51,7 +54,7 @@
|
|
|
51
54
|
"rollup": "^2.58.0",
|
|
52
55
|
"rollup-plugin-babel": "^4.4.0",
|
|
53
56
|
"rollup-plugin-import-css": "^3.0.2",
|
|
54
|
-
"rollup-plugin-node-
|
|
57
|
+
"rollup-plugin-node-polyfills": "^0.2.1",
|
|
55
58
|
"rollup-plugin-replace": "^2.2.0",
|
|
56
59
|
"webpack": "^5",
|
|
57
60
|
"webpack-cli": "^4.6.0",
|
package/rollup.config.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import resolve from 'rollup-plugin-node-resolve';
|
|
2
1
|
import babel from 'rollup-plugin-babel';
|
|
3
2
|
import json from '@rollup/plugin-json';
|
|
4
3
|
import commonjs from '@rollup/plugin-commonjs';
|
|
4
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
5
|
+
import nodePolyfills from 'rollup-plugin-node-polyfills';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
input: 'src/index.js',
|
|
@@ -17,7 +18,10 @@ export default {
|
|
|
17
18
|
exclude: 'node_modules/**',
|
|
18
19
|
}),
|
|
19
20
|
commonjs(),
|
|
20
|
-
|
|
21
|
+
nodePolyfills,
|
|
22
|
+
nodeResolve({
|
|
23
|
+
// preferBuiltins: true,
|
|
24
|
+
}),
|
|
21
25
|
json({
|
|
22
26
|
namedExports: false,
|
|
23
27
|
}),
|
package/src/components/Block.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {Text, Image, ImageSlider} from './BlockTypes';
|
|
4
|
+
import {Text, Image, ImageSlider, Button, Map, SearchBar} from './BlockTypes';
|
|
5
5
|
import { BlockContainer } from '../Main.css'
|
|
6
6
|
|
|
7
7
|
function Block({pageBlock}) {
|
|
8
8
|
const { options, content } = pageBlock;
|
|
9
9
|
|
|
10
10
|
switch(options.type) {
|
|
11
|
+
case 'button': return <Wrapper options={options} key={pageBlock.id}><Button options={options} /></Wrapper>
|
|
12
|
+
case 'map': return <Wrapper options={options} key={pageBlock.id}><Map options={options} /></Wrapper>
|
|
13
|
+
case 'searchbar': return <Wrapper options={options} key={pageBlock.id}><SearchBar options={options} /></Wrapper>
|
|
11
14
|
case 'text': return <Wrapper options={options} key={pageBlock.id}><Text options={options} /></Wrapper>
|
|
12
15
|
case 'image': return <Wrapper options={options}><Image options={options} /></Wrapper>
|
|
13
16
|
case 'image_slider': return <Wrapper options={options} key={pageBlock.id}><ImageSlider options={options} /></Wrapper>
|
|
@@ -17,7 +20,6 @@ function Block({pageBlock}) {
|
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
function Wrapper({ children, options }) {
|
|
20
|
-
|
|
21
23
|
let classes = '';
|
|
22
24
|
Object.entries(options.classes).forEach(element => {
|
|
23
25
|
classes += '';
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import PropTypes from 'prop-types';
|
|
3
|
+
// import { Formik } from 'formik';
|
|
4
|
+
// import axios from 'axios';
|
|
5
|
+
// import styled from 'styled-components';
|
|
6
|
+
|
|
7
|
+
// const Form = ({ form }) => {
|
|
8
|
+
// return (
|
|
9
|
+
// <Formik
|
|
10
|
+
// onSubmit={(values, actions) => {
|
|
11
|
+
// setTimeout(() => {
|
|
12
|
+
// axios.post(`https://cms.burobork.nl/recieve/form/${form.id}`, {
|
|
13
|
+
// form: {
|
|
14
|
+
// locale: 'nl',
|
|
15
|
+
// content: values,
|
|
16
|
+
// },
|
|
17
|
+
// });
|
|
18
|
+
// alert('Form has been sent!');
|
|
19
|
+
// actions.setSubmitting(false);
|
|
20
|
+
// }, 1000);
|
|
21
|
+
// }}
|
|
22
|
+
// render={({ values, errors, handleBlur, handleChange, handleSubmit }) => (
|
|
23
|
+
// <FormContainer>
|
|
24
|
+
// <form onSubmit={handleSubmit}>
|
|
25
|
+
// {form.options.fields.map(field => {
|
|
26
|
+
// if (field.type === 'select') {
|
|
27
|
+
// return (
|
|
28
|
+
// <div key={field.model}>
|
|
29
|
+
// <div htmlFor={field.model}>{field.label}</div>
|
|
30
|
+
// <select
|
|
31
|
+
// id={field.model}
|
|
32
|
+
// onChange={handleChange}
|
|
33
|
+
// onBlur={handleBlur}
|
|
34
|
+
// value={values[field.model]}
|
|
35
|
+
// name={field.model}
|
|
36
|
+
// >
|
|
37
|
+
// {field.values.map(opt => (
|
|
38
|
+
// <option key={opt.option_value} value={opt.option_value}>
|
|
39
|
+
// {opt.label}
|
|
40
|
+
// </option>
|
|
41
|
+
// ))}
|
|
42
|
+
// </select>
|
|
43
|
+
// </div>
|
|
44
|
+
// );
|
|
45
|
+
// } else if (field.type === 'textarea') {
|
|
46
|
+
// return <div key={field.model}>
|
|
47
|
+
// <div htmlFor={field.model}>
|
|
48
|
+
// {field.label}
|
|
49
|
+
// </div>
|
|
50
|
+
// <textarea id={field.model} onChange={handleChange} onBlur={handleBlur} value={values[field.model]} name={field.model} rows="5">
|
|
51
|
+
|
|
52
|
+
// </textarea>
|
|
53
|
+
// </div>;
|
|
54
|
+
// } else {
|
|
55
|
+
// return (
|
|
56
|
+
// <div key={field.model}>
|
|
57
|
+
// <label htmlFor={field.model}>
|
|
58
|
+
// {field.label}
|
|
59
|
+
// <input
|
|
60
|
+
// id={field.model}
|
|
61
|
+
// type="text"
|
|
62
|
+
// onChange={handleChange}
|
|
63
|
+
// onBlur={handleBlur}
|
|
64
|
+
// value={values[field.model]}
|
|
65
|
+
// name={field.model}
|
|
66
|
+
// required={field.required}
|
|
67
|
+
// />
|
|
68
|
+
// </label>
|
|
69
|
+
// {errors[field.name] && (
|
|
70
|
+
// <div id="feedback">{errors[field.name]}</div>
|
|
71
|
+
// )}
|
|
72
|
+
// </div>
|
|
73
|
+
// );
|
|
74
|
+
// }
|
|
75
|
+
// })}
|
|
76
|
+
// <button type="submit">Verzenden</button>
|
|
77
|
+
// </form>
|
|
78
|
+
// </FormContainer>
|
|
79
|
+
// )}
|
|
80
|
+
// />
|
|
81
|
+
// );
|
|
82
|
+
// };
|
|
83
|
+
|
|
84
|
+
// Form.propTypes = {
|
|
85
|
+
// form: PropTypes.object.isRequired,
|
|
86
|
+
// };
|
|
87
|
+
|
|
88
|
+
// export default Form;
|
|
89
|
+
|
|
90
|
+
// const FormContainer = styled.div`
|
|
91
|
+
// width: 100%;
|
|
92
|
+
// select {
|
|
93
|
+
// appearance: none;
|
|
94
|
+
// background: #fff;
|
|
95
|
+
// background-image: linear-gradient(45deg, transparent 50%, gray 50%),
|
|
96
|
+
// linear-gradient(135deg, gray 50%, transparent 50%),
|
|
97
|
+
// linear-gradient(to right, #ccc, #ccc);
|
|
98
|
+
// background-position: calc(100% - 20px) calc(1em),
|
|
99
|
+
// calc(100% - 15px) calc(1em), calc(100% - 2.5em);
|
|
100
|
+
// background-size: 5px 5px, 5px 5px, 1px 1.5em;
|
|
101
|
+
// background-repeat: no-repeat;
|
|
102
|
+
// }
|
|
103
|
+
|
|
104
|
+
// label {
|
|
105
|
+
// display: flex;
|
|
106
|
+
// flex-wrap: wrap;
|
|
107
|
+
// flex-direction: column;
|
|
108
|
+
// width: 100%;
|
|
109
|
+
// margin: 8px 0;
|
|
110
|
+
// }
|
|
111
|
+
// input,
|
|
112
|
+
// select,
|
|
113
|
+
// textarea {
|
|
114
|
+
// display: block;
|
|
115
|
+
// box-sizing: border-box;
|
|
116
|
+
// margin: 8px 0;
|
|
117
|
+
// padding: 8px;
|
|
118
|
+
// width: 100%;
|
|
119
|
+
// appearance: none;
|
|
120
|
+
// border: 1px solid rgba(0, 0, 0, 0.25);
|
|
121
|
+
// }
|
|
122
|
+
// button {
|
|
123
|
+
// border: 0;
|
|
124
|
+
// padding: 8px 16px;
|
|
125
|
+
// font-size: 1.4rem;
|
|
126
|
+
// line-height: 1.4;
|
|
127
|
+
// font-weight: bold;
|
|
128
|
+
// }
|
|
129
|
+
// `;
|
|
@@ -2,4 +2,8 @@ import styled from 'styled-components'
|
|
|
2
2
|
|
|
3
3
|
export const SliderContainer = styled.div`
|
|
4
4
|
.carousel .control-arrow,.carousel.carousel-slider .control-arrow{-webkit-transition:all .25s ease-in;-moz-transition:all .25s ease-in;-ms-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in;opacity:.4;filter:alpha(opacity=40);position:absolute;z-index:2;top:20px;background:none;border:0;font-size:32px;cursor:pointer}.carousel .control-arrow:focus,.carousel .control-arrow:hover{opacity:1;filter:alpha(opacity=100)}.carousel .control-arrow:before,.carousel.carousel-slider .control-arrow:before{margin:0 5px;display:inline-block;border-top:8px solid transparent;border-bottom:8px solid transparent;content:''}.carousel .control-disabled.control-arrow{opacity:0;filter:alpha(opacity=0);cursor:inherit;display:none}.carousel .control-prev.control-arrow{left:0}.carousel .control-prev.control-arrow:before{border-right:8px solid #fff}.carousel .control-next.control-arrow{right:0}.carousel .control-next.control-arrow:before{border-left:8px solid #fff}.carousel-root{outline:none}.carousel{position:relative;width:100%}.carousel *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.carousel img{width:100%;display:inline-block;pointer-events:none}.carousel .carousel{position:relative}.carousel .control-arrow{outline:0;border:0;background:none;top:50%;margin-top:-13px;font-size:18px}.carousel .thumbs-wrapper{margin:20px;overflow:hidden}.carousel .thumbs{-webkit-transition:all .15s ease-in;-moz-transition:all .15s ease-in;-ms-transition:all .15s ease-in;-o-transition:all .15s ease-in;transition:all .15s ease-in;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);position:relative;list-style:none;white-space:nowrap}.carousel .thumb{-webkit-transition:border .15s ease-in;-moz-transition:border .15s ease-in;-ms-transition:border .15s ease-in;-o-transition:border .15s ease-in;transition:border .15s ease-in;display:inline-block;margin-right:6px;white-space:nowrap;overflow:hidden;border:3px solid #fff;padding:2px}.carousel .thumb:focus{border:3px solid #ccc;outline:none}.carousel .thumb.selected,.carousel .thumb:hover{border:3px solid #333}.carousel .thumb img{vertical-align:top}.carousel.carousel-slider{position:relative;margin:0;overflow:hidden}.carousel.carousel-slider .control-arrow{top:0;color:#fff;font-size:26px;bottom:0;margin-top:0;padding:5px}.carousel.carousel-slider .control-arrow:hover{background:rgba(0,0,0,0.2)}.carousel .slider-wrapper{overflow:hidden;margin:auto;width:100%;-webkit-transition:height .15s ease-in;-moz-transition:height .15s ease-in;-ms-transition:height .15s ease-in;-o-transition:height .15s ease-in;transition:height .15s ease-in}.carousel .slider-wrapper.axis-horizontal .slider{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-horizontal .slider .slide{flex-direction:column;flex-flow:column}.carousel .slider-wrapper.axis-vertical{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-vertical .slider{-webkit-flex-direction:column;flex-direction:column}.carousel .slider{margin:0;padding:0;position:relative;list-style:none;width:100%}.carousel .slider.animated{-webkit-transition:all .35s ease-in-out;-moz-transition:all .35s ease-in-out;-ms-transition:all .35s ease-in-out;-o-transition:all .35s ease-in-out;transition:all .35s ease-in-out}.carousel .slide{min-width:100%;margin:0;position:relative;text-align:center}.carousel .slide img{width:100%;vertical-align:top;border:0}.carousel .slide iframe{display:inline-block;width:calc(100% - 80px);margin:0 40px 40px;border:0}.carousel .slide .legend{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-ms-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out;position:absolute;bottom:40px;left:50%;margin-left:-45%;width:90%;border-radius:10px;background:#000;color:#fff;padding:10px;font-size:12px;text-align:center;opacity:0.25;-webkit-transition:opacity .35s ease-in-out;-moz-transition:opacity .35s ease-in-out;-ms-transition:opacity .35s ease-in-out;-o-transition:opacity .35s ease-in-out;transition:opacity .35s ease-in-out}.carousel .control-dots{position:absolute;bottom:0;margin:10px 0;padding:0;text-align:center;width:100%;z-index:1}@media (min-width: 960px){.carousel .control-dots{bottom:0}}.carousel .control-dots .dot{-webkit-transition:opacity .25s ease-in;-moz-transition:opacity .25s ease-in;-ms-transition:opacity .25s ease-in;-o-transition:opacity .25s ease-in;transition:opacity .25s ease-in;opacity:.3;filter:alpha(opacity=30);box-shadow:1px 1px 2px rgba(0,0,0,0.9);background:#fff;border-radius:50%;width:8px;height:8px;cursor:pointer;display:inline-block;margin:0 8px}.carousel .control-dots .dot.selected,.carousel .control-dots .dot:hover{opacity:1;filter:alpha(opacity=100)}.carousel .carousel-status{position:absolute;top:0;right:0;padding:5px;font-size:10px;text-shadow:1px 1px 1px rgba(0,0,0,0.9);color:#fff}.carousel:hover .slide .legend{opacity:1}
|
|
5
|
+
ul li {
|
|
6
|
+
padding: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
// import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet'
|
|
3
|
+
|
|
4
|
+
function HouseMap({ latitude, longitude }) {
|
|
5
|
+
return (
|
|
6
|
+
<></>
|
|
7
|
+
// <MapContainer
|
|
8
|
+
// center={[latitude, longitude]}
|
|
9
|
+
// zoom={10}
|
|
10
|
+
// scrollWheelZoom={false}
|
|
11
|
+
// >
|
|
12
|
+
// <TileLayer
|
|
13
|
+
// attribution='© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
|
|
14
|
+
// url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
15
|
+
// />
|
|
16
|
+
// <Marker position={[latitude, longitude]}>
|
|
17
|
+
// {/* <Popup>
|
|
18
|
+
// A pretty CSS3 popup. <br /> Easily customizable.
|
|
19
|
+
// </Popup> */}
|
|
20
|
+
// </Marker>
|
|
21
|
+
// </MapContainer>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default HouseMap;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Button from './Button'
|
|
2
|
+
// import Form from './Form'
|
|
3
|
+
import Iframe from './Iframe'
|
|
2
4
|
import Image from './Image'
|
|
3
5
|
import ImageSlider from './ImageSlider'
|
|
4
|
-
import
|
|
6
|
+
import Map from './Map'
|
|
7
|
+
import Portal from './Portal'
|
|
8
|
+
import SearchBar from './SearchBar'
|
|
9
|
+
import Text from './Text'
|
|
5
10
|
|
|
6
|
-
export {
|
|
11
|
+
export {
|
|
12
|
+
Button,
|
|
13
|
+
Image,
|
|
14
|
+
ImageSlider,
|
|
15
|
+
Iframe,
|
|
16
|
+
Map,
|
|
17
|
+
Portal,
|
|
18
|
+
SearchBar,
|
|
19
|
+
Text
|
|
20
|
+
}
|
package/src/components/Row.js
CHANGED
|
@@ -2,9 +2,11 @@ import React from 'react'
|
|
|
2
2
|
import Block from './Block'
|
|
3
3
|
|
|
4
4
|
export default function Row({ content }) {
|
|
5
|
-
return (
|
|
6
|
-
{content.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
return (
|
|
6
|
+
<div className="row" style={content.options.style}>
|
|
7
|
+
{content.page_blocks.map(block => {
|
|
8
|
+
return <Block pageBlock={block} key={block.id} />
|
|
9
|
+
})}
|
|
10
|
+
</div>
|
|
11
|
+
)
|
|
10
12
|
}
|
package/src/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import Row from './components/Row'
|
|
|
3
3
|
import { BlockContainer } from './Main.css'
|
|
4
4
|
|
|
5
5
|
export default function CmsBlocks({ content }) {
|
|
6
|
-
// console.log({ content });
|
|
7
6
|
return <BlockContainer>
|
|
8
7
|
{content.page_rows.map((row, index) => {
|
|
9
8
|
return <Row content={row} key={index}></Row>
|