@lowdefy/layout 3.23.2 → 4.0.0-alpha.10
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/Area.js +22 -49
- package/dist/BlockLayout.js +60 -65
- package/dist/deriveLayout.js +125 -166
- package/dist/gutterSetup.js +11 -20
- package/dist/index.js +15 -28
- package/dist/layoutParamsToArea.js +13 -31
- package/dist/style.less +17 -0
- package/package.json +25 -35
package/dist/Area.js
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
require("antd/lib/row/style/css");
|
|
9
|
-
|
|
10
|
-
var _row = _interopRequireDefault(require("antd/lib/row"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _gutterSetup = _interopRequireDefault(require("./gutterSetup.js"));
|
|
15
|
-
|
|
16
|
-
var _blockTools = require("@lowdefy/block-tools");
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
1
|
/*
|
|
21
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
22
3
|
|
|
23
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
24
5
|
you may not use this file except in compliance with the License.
|
|
@@ -31,32 +12,24 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
31
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
32
13
|
See the License for the specific language governing permissions and
|
|
33
14
|
limitations under the License.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
border: highlightBorders && '1px dashed red'
|
|
56
|
-
}
|
|
57
|
-
}, children);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
Area.defaultProps = _blockTools.blockDefaultProps;
|
|
61
|
-
var _default = Area;
|
|
62
|
-
exports.default = _default;
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
import { Row } from 'antd';
|
|
17
|
+
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
|
+
import gutterSetup from './gutterSetup.js';
|
|
19
|
+
const Area = ({ area , areaStyle , children , highlightBorders , id , makeCssClass })=>/*#__PURE__*/ React.createElement(Row, {
|
|
20
|
+
id: id,
|
|
21
|
+
align: area.align,
|
|
22
|
+
className: makeCssClass(areaStyle),
|
|
23
|
+
gutter: gutterSetup(area.gutter),
|
|
24
|
+
justify: area.justify,
|
|
25
|
+
style: {
|
|
26
|
+
// antd keeps bottom margin which can cause overflow issues.
|
|
27
|
+
flexDirection: area.direction,
|
|
28
|
+
flexWrap: area.wrap,
|
|
29
|
+
overflow: area.overflow,
|
|
30
|
+
border: highlightBorders && '1px dashed red'
|
|
31
|
+
}
|
|
32
|
+
}, children)
|
|
33
|
+
;
|
|
34
|
+
Area.defaultProps = blockDefaultProps;
|
|
35
|
+
export default Area;
|
package/dist/BlockLayout.js
CHANGED
|
@@ -1,67 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
import { Col } from 'antd';
|
|
17
|
+
import deriveLayout from './deriveLayout.js';
|
|
18
|
+
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
+
function _extends() {
|
|
20
|
+
_extends = Object.assign || function(target) {
|
|
21
|
+
for(var i = 1; i < arguments.length; i++){
|
|
22
|
+
var source = arguments[i];
|
|
23
|
+
for(var key in source){
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
25
|
+
target[key] = source[key];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
};
|
|
31
|
+
return _extends.apply(this, arguments);
|
|
32
|
+
}
|
|
33
|
+
const alignSelf = (align)=>{
|
|
34
|
+
if (align === 'bottom') {
|
|
35
|
+
return 'flex-end';
|
|
36
|
+
}
|
|
37
|
+
if (align === 'top') {
|
|
38
|
+
return 'flex-start';
|
|
39
|
+
}
|
|
40
|
+
if (align === 'middle') {
|
|
41
|
+
return 'center';
|
|
42
|
+
}
|
|
43
|
+
return align;
|
|
36
44
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
layout,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, children);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(_col.default, _extends({}, (0, _deriveLayout.default)(layout), {
|
|
56
|
-
style: {
|
|
57
|
-
alignSelf: alignSelf(layout.align),
|
|
58
|
-
border: highlightBorders && '1px dashed #8eccf5'
|
|
59
|
-
},
|
|
60
|
-
id: id,
|
|
61
|
-
className: makeCssClass(blockStyle)
|
|
62
|
-
}), children);
|
|
45
|
+
const BlockLayout = ({ id , blockStyle , children , highlightBorders , layout , makeCssClass })=>{
|
|
46
|
+
if (layout && layout.disabled) {
|
|
47
|
+
return(/*#__PURE__*/ React.createElement("div", {
|
|
48
|
+
id: id,
|
|
49
|
+
className: makeCssClass(blockStyle)
|
|
50
|
+
}, children));
|
|
51
|
+
}
|
|
52
|
+
return(/*#__PURE__*/ React.createElement(Col, _extends({}, deriveLayout(layout), {
|
|
53
|
+
style: {
|
|
54
|
+
alignSelf: alignSelf(layout.align),
|
|
55
|
+
border: highlightBorders && '1px dashed #8eccf5'
|
|
56
|
+
},
|
|
57
|
+
id: id,
|
|
58
|
+
className: makeCssClass(blockStyle)
|
|
59
|
+
}), children));
|
|
63
60
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var _default = BlockLayout;
|
|
67
|
-
exports.default = _default;
|
|
61
|
+
BlockLayout.defaultProps = blockDefaultProps;
|
|
62
|
+
export default BlockLayout;
|
package/dist/deriveLayout.js
CHANGED
|
@@ -1,176 +1,135 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (value === false) {
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
const sanitizeGrow = (value)=>{
|
|
17
|
+
if (value === 'unset' || value === 'inherit' || value === 'initial') {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
if (type.isNumber(value) && value >= 0) {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
if (value === true) {
|
|
24
|
+
return 1;
|
|
25
|
+
}
|
|
26
|
+
if (value === false) {
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
30
29
|
return 0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return 0;
|
|
34
30
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
const sanitizeShrink = (value)=>{
|
|
32
|
+
if (value === 'unset' || value === 'inherit' || value === 'initial') {
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
if (type.isNumber(value) && value >= 0) {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
if (value === true) {
|
|
39
|
+
return 1;
|
|
40
|
+
}
|
|
41
|
+
if (value === false) {
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
46
44
|
return 1;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (value === false) {
|
|
50
|
-
return 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return 1;
|
|
54
45
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return 'auto';
|
|
46
|
+
const sanitizeSize = (value)=>{
|
|
47
|
+
if (type.isNumber(value)) {
|
|
48
|
+
return `${value}px`;
|
|
49
|
+
}
|
|
50
|
+
if (type.isString(value)) {
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
return 'auto';
|
|
66
54
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (_helpers.type.isNone(flex) && _helpers.type.isNone(grow) && _helpers.type.isNone(shrink) && _helpers.type.isNone(size)) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (flex) {
|
|
81
|
-
return flex === true ? '0 1 auto' : flex;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return "".concat(sanitizeGrow(grow), " ").concat(sanitizeShrink(shrink), " ").concat(sanitizeSize(size));
|
|
55
|
+
const deriveFlex = ({ flex , grow , shrink , size })=>{
|
|
56
|
+
if (type.isNone(flex) && type.isNone(grow) && type.isNone(shrink) && type.isNone(size)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
if (flex) {
|
|
60
|
+
return flex === true ? '0 1 auto' : flex;
|
|
61
|
+
}
|
|
62
|
+
return `${sanitizeGrow(grow)} ${sanitizeShrink(shrink)} ${sanitizeSize(size)}`;
|
|
85
63
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
64
|
+
const diffOffsetAndSpan = (obj)=>{
|
|
65
|
+
if (obj.offset && !obj.span) {
|
|
66
|
+
obj.span = 24 - obj.offset;
|
|
67
|
+
return obj;
|
|
68
|
+
}
|
|
69
|
+
if (!obj.span) {
|
|
70
|
+
obj.span = 24;
|
|
71
|
+
}
|
|
90
72
|
return obj;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (!obj.span) {
|
|
94
|
-
obj.span = 24;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return obj;
|
|
98
73
|
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
lg,
|
|
115
|
-
xl,
|
|
116
|
-
xxl
|
|
117
|
-
} = _ref2;
|
|
118
|
-
var colProps = {
|
|
119
|
-
xs: {
|
|
120
|
-
span: 24
|
|
121
|
-
},
|
|
122
|
-
sm: {
|
|
123
|
-
span: 24
|
|
124
|
-
},
|
|
125
|
-
md: diffOffsetAndSpan({
|
|
126
|
-
offset,
|
|
127
|
-
order,
|
|
128
|
-
pull,
|
|
129
|
-
push,
|
|
130
|
-
span
|
|
131
|
-
})
|
|
132
|
-
};
|
|
133
|
-
var flexValue = deriveFlex({
|
|
134
|
-
flex,
|
|
135
|
-
grow,
|
|
136
|
-
shrink,
|
|
137
|
-
size
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
if (flexValue) {
|
|
141
|
-
colProps = {
|
|
142
|
-
flex: flexValue,
|
|
143
|
-
order
|
|
74
|
+
const deriveLayout = ({ flex , offset , order , pull , push , span , grow , shrink , size , xs , sm , md , lg , xl , xxl , })=>{
|
|
75
|
+
let colProps = {
|
|
76
|
+
xs: {
|
|
77
|
+
span: 24
|
|
78
|
+
},
|
|
79
|
+
sm: {
|
|
80
|
+
span: 24
|
|
81
|
+
},
|
|
82
|
+
md: diffOffsetAndSpan({
|
|
83
|
+
offset,
|
|
84
|
+
order,
|
|
85
|
+
pull,
|
|
86
|
+
push,
|
|
87
|
+
span
|
|
88
|
+
})
|
|
144
89
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
90
|
+
const flexValue = deriveFlex({
|
|
91
|
+
flex,
|
|
92
|
+
grow,
|
|
93
|
+
shrink,
|
|
94
|
+
size
|
|
95
|
+
});
|
|
96
|
+
if (flexValue) {
|
|
97
|
+
colProps = {
|
|
98
|
+
flex: flexValue,
|
|
99
|
+
order
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (type.isObject(sm)) {
|
|
103
|
+
colProps.sm = {
|
|
104
|
+
...colProps.sm,
|
|
105
|
+
...diffOffsetAndSpan(sm)
|
|
106
|
+
};
|
|
107
|
+
colProps.xs = {
|
|
108
|
+
...colProps.xs,
|
|
109
|
+
...diffOffsetAndSpan(sm)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (type.isObject(xs)) {
|
|
113
|
+
colProps.xs = {
|
|
114
|
+
...colProps.xs,
|
|
115
|
+
...diffOffsetAndSpan(xs)
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (type.isObject(md)) {
|
|
119
|
+
colProps.md = {
|
|
120
|
+
...colProps.md,
|
|
121
|
+
...diffOffsetAndSpan(md)
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
if (type.isObject(lg)) {
|
|
125
|
+
colProps.lg = diffOffsetAndSpan(lg);
|
|
126
|
+
}
|
|
127
|
+
if (type.isObject(xl)) {
|
|
128
|
+
colProps.xl = diffOffsetAndSpan(xl);
|
|
129
|
+
}
|
|
130
|
+
if (type.isObject(xxl)) {
|
|
131
|
+
colProps.xxl = diffOffsetAndSpan(xxl);
|
|
132
|
+
}
|
|
133
|
+
return colProps;
|
|
173
134
|
};
|
|
174
|
-
|
|
175
|
-
var _default = deriveLayout;
|
|
176
|
-
exports.default = _default;
|
|
135
|
+
export default deriveLayout;
|
package/dist/gutterSetup.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
1
|
/*
|
|
11
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
12
3
|
|
|
13
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
5
|
you may not use this file except in compliance with the License.
|
|
@@ -21,14 +12,14 @@ var _helpers = require("@lowdefy/helpers");
|
|
|
21
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
13
|
See the License for the specific language governing permissions and
|
|
23
14
|
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
const gutterSetup = (gutter)=>{
|
|
17
|
+
if (type.isInt(gutter) || type.isObject(gutter)) {
|
|
18
|
+
return [
|
|
19
|
+
gutter,
|
|
20
|
+
gutter
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
return gutter;
|
|
31
24
|
};
|
|
32
|
-
|
|
33
|
-
var _default = gutterSetup;
|
|
34
|
-
exports.default = _default;
|
|
25
|
+
export default gutterSetup;
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, "Area", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _Area.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "BlockLayout", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _BlockLayout.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "layoutParamsToArea", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _layoutParamsToArea.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
24
7
|
|
|
25
|
-
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
26
9
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import Area from './Area.js';
|
|
16
|
+
import BlockLayout from './BlockLayout.js';
|
|
17
|
+
import layoutParamsToArea from './layoutParamsToArea.js';
|
|
18
|
+
export { Area, BlockLayout, layoutParamsToArea };
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
1
|
/*
|
|
11
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
12
3
|
|
|
13
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
5
|
you may not use this file except in compliance with the License.
|
|
@@ -21,26 +12,17 @@ var _helpers = require("@lowdefy/helpers");
|
|
|
21
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
13
|
See the License for the specific language governing permissions and
|
|
23
14
|
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
layout
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
const layoutParamsToArea = ({ areaKey , area , layout })=>{
|
|
17
|
+
if (areaKey !== 'content') {
|
|
18
|
+
return area;
|
|
19
|
+
}
|
|
20
|
+
area.align = type.isNone(area.align) ? layout.contentAlign : area.align;
|
|
21
|
+
area.justify = type.isNone(area.justify) ? layout.contentJustify : area.justify;
|
|
22
|
+
area.direction = type.isNone(area.direction) ? layout.contentDirection : area.direction;
|
|
23
|
+
area.wrap = type.isNone(area.wrap) ? layout.contentWrap : area.wrap;
|
|
24
|
+
area.overflow = type.isNone(area.overflow) ? layout.contentOverflow : area.overflow;
|
|
25
|
+
area.gutter = type.isNone(area.gutter) ? layout.contentGutter : area.gutter;
|
|
33
26
|
return area;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
area.align = _helpers.type.isNone(area.align) ? layout.contentAlign : area.align;
|
|
37
|
-
area.justify = _helpers.type.isNone(area.justify) ? layout.contentJustify : area.justify;
|
|
38
|
-
area.direction = _helpers.type.isNone(area.direction) ? layout.contentDirection : area.direction;
|
|
39
|
-
area.wrap = _helpers.type.isNone(area.wrap) ? layout.contentWrap : area.wrap;
|
|
40
|
-
area.overflow = _helpers.type.isNone(area.overflow) ? layout.contentOverflow : area.overflow;
|
|
41
|
-
area.gutter = _helpers.type.isNone(area.gutter) ? layout.contentGutter : area.gutter;
|
|
42
|
-
return area;
|
|
43
27
|
};
|
|
44
|
-
|
|
45
|
-
var _default = layoutParamsToArea;
|
|
46
|
-
exports.default = _default;
|
|
28
|
+
export default layoutParamsToArea;
|
package/dist/style.less
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
@import 'antd/lib/grid/style/index.less';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/layout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.10",
|
|
4
4
|
"licence": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -25,55 +25,45 @@
|
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "https://github.com/lowdefy/lowdefy.git"
|
|
27
27
|
},
|
|
28
|
-
"
|
|
28
|
+
"type": "module",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.js",
|
|
31
|
+
"./*": "./dist/*"
|
|
32
|
+
},
|
|
29
33
|
"files": [
|
|
30
34
|
"dist/*"
|
|
31
35
|
],
|
|
32
36
|
"scripts": {
|
|
33
|
-
"build": "
|
|
37
|
+
"build": "yarn swc",
|
|
34
38
|
"clean": "rm -rf dist",
|
|
39
|
+
"copyfiles": "copyfiles -u 1 \"./src/**/*\" dist -e \"./src/**/*.js\" -e \"./src/**/*.yaml\" -e \"./src/**/*.snap\"",
|
|
35
40
|
"prepare": "yarn build",
|
|
36
|
-
"
|
|
41
|
+
"swc": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start && yarn copyfiles",
|
|
37
42
|
"test": "jest --coverage"
|
|
38
43
|
},
|
|
39
44
|
"dependencies": {
|
|
40
|
-
"@lowdefy/block-
|
|
41
|
-
"@lowdefy/helpers": "
|
|
42
|
-
"antd": "4.
|
|
45
|
+
"@lowdefy/block-utils": "4.0.0-alpha.10",
|
|
46
|
+
"@lowdefy/helpers": "4.0.0-alpha.10",
|
|
47
|
+
"antd": "4.18.2",
|
|
43
48
|
"react": "17.0.2",
|
|
44
49
|
"react-dom": "17.0.2"
|
|
45
50
|
},
|
|
46
51
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"jest": "26.6.3",
|
|
60
|
-
"js-yaml": "4.1.0",
|
|
61
|
-
"less": "3.13.0",
|
|
62
|
-
"less-loader": "9.0.0",
|
|
63
|
-
"path-browserify": "1.0.1",
|
|
64
|
-
"process": "0.11.10",
|
|
65
|
-
"react-markdown": "5.0.3",
|
|
66
|
-
"react-syntax-highlight": "15.3.1",
|
|
67
|
-
"react-test-renderer": "17.0.2",
|
|
68
|
-
"style-loader": "2.0.0",
|
|
69
|
-
"webpack": "5.38.1",
|
|
70
|
-
"webpack-cli": "4.7.0",
|
|
71
|
-
"webpack-dev-server": "3.11.2",
|
|
72
|
-
"yaml-jest": "1.0.5",
|
|
73
|
-
"yaml-loader": "0.6.0"
|
|
52
|
+
"@emotion/jest": "11.7.1",
|
|
53
|
+
"@lowdefy/block-dev": "4.0.0-alpha.10",
|
|
54
|
+
"@swc/cli": "0.1.55",
|
|
55
|
+
"@swc/core": "1.2.135",
|
|
56
|
+
"@swc/jest": "0.2.17",
|
|
57
|
+
"@testing-library/dom": "8.11.3",
|
|
58
|
+
"@testing-library/react": "13.0.0-alpha.4",
|
|
59
|
+
"@testing-library/user-event": "14.0.0-alpha.14",
|
|
60
|
+
"copyfiles": "2.4.1",
|
|
61
|
+
"jest": "27.5.1",
|
|
62
|
+
"jest-serializer-html": "7.1.0",
|
|
63
|
+
"jest-transform-yaml": "1.0.0"
|
|
74
64
|
},
|
|
75
65
|
"publishConfig": {
|
|
76
66
|
"access": "public"
|
|
77
67
|
},
|
|
78
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "d697b4b5f354697d9481a371b90a00ca0944f486"
|
|
79
69
|
}
|