@saltcorn/builder 0.6.1-beta.0 → 0.6.1
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_bundle.js +9 -9
- package/package.json +1 -1
- package/src/components/Builder.js +77 -0
- package/src/components/Library.js +43 -3
- package/src/components/RenderNode.js +17 -1
- package/src/components/Toolbox.js +207 -5
- package/src/components/context.js +6 -0
- package/src/components/elements/Action.js +38 -2
- package/src/components/elements/Aggregation.js +29 -2
- package/src/components/elements/BoxModelEditor.js +18 -1
- package/src/components/elements/Card.js +31 -2
- package/src/components/elements/Column.js +28 -2
- package/src/components/elements/Columns.js +50 -4
- package/src/components/elements/Container.js +119 -3
- package/src/components/elements/DropDownFilter.js +27 -2
- package/src/components/elements/Empty.js +18 -1
- package/src/components/elements/Field.js +29 -2
- package/src/components/elements/HTMLCode.js +18 -2
- package/src/components/elements/Image.js +29 -2
- package/src/components/elements/JoinField.js +28 -2
- package/src/components/elements/LineBreak.js +17 -1
- package/src/components/elements/Link.js +34 -2
- package/src/components/elements/SearchBar.js +29 -2
- package/src/components/elements/Tabs.js +29 -2
- package/src/components/elements/Text.js +36 -2
- package/src/components/elements/ToggleFilter.js +31 -2
- package/src/components/elements/View.js +27 -2
- package/src/components/elements/ViewLink.js +36 -2
- package/src/components/elements/faicons.js +481 -0
- package/src/components/elements/utils.js +279 -16
- package/src/components/preview_context.js +6 -1
- package/src/components/storage.js +59 -2
- package/src/index.js +12 -0
package/package.json
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category saltcorn-builder
|
|
3
|
+
* @module components/Builder
|
|
4
|
+
* @subcategory components
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
import React, {
|
|
2
8
|
useEffect,
|
|
3
9
|
useContext,
|
|
@@ -52,6 +58,13 @@ import { InitNewElement, Library } from "./Library";
|
|
|
52
58
|
import { RenderNode } from "./RenderNode";
|
|
53
59
|
const { Provider } = optionsCtx;
|
|
54
60
|
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @returns {div}
|
|
64
|
+
* @category saltcorn-builder
|
|
65
|
+
* @subcategory components
|
|
66
|
+
* @namespace
|
|
67
|
+
*/
|
|
55
68
|
const SettingsPanel = () => {
|
|
56
69
|
const { actions, selected, query } = useEditor((state, query) => {
|
|
57
70
|
const currentNodeId = state.events.selected;
|
|
@@ -80,14 +93,24 @@ const SettingsPanel = () => {
|
|
|
80
93
|
};
|
|
81
94
|
});
|
|
82
95
|
|
|
96
|
+
/** */
|
|
83
97
|
const deleteThis = () => {
|
|
84
98
|
actions.delete(selected.id);
|
|
85
99
|
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @param {number} offset
|
|
103
|
+
* @returns {NodeId}
|
|
104
|
+
*/
|
|
86
105
|
const otherSibling = (offset) => {
|
|
87
106
|
const siblings = query.node(selected.parent).childNodes();
|
|
88
107
|
const sibIx = siblings.findIndex((sib) => sib === selected.id);
|
|
89
108
|
return siblings[sibIx + offset];
|
|
90
109
|
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @param {object} event
|
|
113
|
+
*/
|
|
91
114
|
const handleUserKeyPress = (event) => {
|
|
92
115
|
const { keyCode, target } = event;
|
|
93
116
|
if (target.tagName.toLowerCase() === "body" && selected) {
|
|
@@ -145,11 +168,19 @@ const SettingsPanel = () => {
|
|
|
145
168
|
}, [handleUserKeyPress]);
|
|
146
169
|
const hasChildren =
|
|
147
170
|
selected && selected.children && selected.children.length > 0;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @returns {void}
|
|
174
|
+
*/
|
|
148
175
|
const deleteChildren = () => {
|
|
149
176
|
selected.children.forEach((child) => {
|
|
150
177
|
actions.delete(child);
|
|
151
178
|
});
|
|
152
179
|
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @returns {void}
|
|
183
|
+
*/
|
|
153
184
|
const duplicate = () => {
|
|
154
185
|
const {
|
|
155
186
|
data: { parent },
|
|
@@ -212,10 +243,20 @@ const SettingsPanel = () => {
|
|
|
212
243
|
</div>
|
|
213
244
|
);
|
|
214
245
|
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @returns {button}
|
|
249
|
+
* @category saltcorn-builder
|
|
250
|
+
* @subcategory components
|
|
251
|
+
* @namespace
|
|
252
|
+
*/
|
|
215
253
|
const SaveButton = () => {
|
|
216
254
|
const { query, actions } = useEditor(() => {});
|
|
217
255
|
const options = useContext(optionsCtx);
|
|
218
256
|
|
|
257
|
+
/**
|
|
258
|
+
* @returns {void}
|
|
259
|
+
*/
|
|
219
260
|
const onClick = () => {
|
|
220
261
|
const data = craftToSaltcorn(JSON.parse(query.serialize()));
|
|
221
262
|
const urlroot = options.page_id ? "pageedit" : "viewedit";
|
|
@@ -239,6 +280,13 @@ const SaveButton = () => {
|
|
|
239
280
|
""
|
|
240
281
|
);
|
|
241
282
|
};
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* @returns {a|""}
|
|
286
|
+
* @category saltcorn-builder
|
|
287
|
+
* @subcategory components
|
|
288
|
+
* @namespace
|
|
289
|
+
*/
|
|
242
290
|
const ViewPageLink = () => {
|
|
243
291
|
const { query, actions } = useEditor(() => {});
|
|
244
292
|
const options = useContext(optionsCtx);
|
|
@@ -250,6 +298,13 @@ const ViewPageLink = () => {
|
|
|
250
298
|
""
|
|
251
299
|
);
|
|
252
300
|
};
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @returns {Fragment}
|
|
304
|
+
* @category saltcorn-builder
|
|
305
|
+
* @subcategory components
|
|
306
|
+
* @namespace
|
|
307
|
+
*/
|
|
253
308
|
const HistoryPanel = () => {
|
|
254
309
|
const { canUndo, canRedo, actions } = useEditor((state, query) => ({
|
|
255
310
|
canUndo: query.history.canUndo(),
|
|
@@ -280,6 +335,14 @@ const HistoryPanel = () => {
|
|
|
280
335
|
);
|
|
281
336
|
};
|
|
282
337
|
|
|
338
|
+
/**
|
|
339
|
+
* @param {object} opts
|
|
340
|
+
* @param {object} opts.layout
|
|
341
|
+
* @returns {button}
|
|
342
|
+
* @category saltcorn-builder
|
|
343
|
+
* @subcategory components
|
|
344
|
+
* @namespace
|
|
345
|
+
*/
|
|
283
346
|
const NextButton = ({ layout }) => {
|
|
284
347
|
const { query, actions } = useEditor(() => {});
|
|
285
348
|
const options = useContext(optionsCtx);
|
|
@@ -287,6 +350,10 @@ const NextButton = ({ layout }) => {
|
|
|
287
350
|
useEffect(() => {
|
|
288
351
|
layoutToNodes(layout, query, actions);
|
|
289
352
|
}, []);
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* @returns {void}
|
|
356
|
+
*/
|
|
290
357
|
const onClick = () => {
|
|
291
358
|
const { columns, layout } = craftToSaltcorn(JSON.parse(query.serialize()));
|
|
292
359
|
document
|
|
@@ -304,6 +371,16 @@ const NextButton = ({ layout }) => {
|
|
|
304
371
|
);
|
|
305
372
|
};
|
|
306
373
|
|
|
374
|
+
/**
|
|
375
|
+
* @param {object} props
|
|
376
|
+
* @param {object} props.options
|
|
377
|
+
* @param {object} props.layout
|
|
378
|
+
* @param {string} props.mode
|
|
379
|
+
* @returns {ErrorBoundary}
|
|
380
|
+
* @category saltcorn-builder
|
|
381
|
+
* @subcategory components
|
|
382
|
+
* @namespace
|
|
383
|
+
*/
|
|
307
384
|
const Builder = ({ options, layout, mode }) => {
|
|
308
385
|
const [showLayers, setShowLayers] = useState(true);
|
|
309
386
|
const [previews, setPreviews] = useState({});
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category saltcorn-builder
|
|
3
|
+
* @module components/Library
|
|
4
|
+
* @subcategory components
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
import React, { useEffect, useContext, useState, Fragment } from "react";
|
|
2
8
|
import { useEditor, useNode } from "@craftjs/core";
|
|
3
9
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
@@ -8,13 +14,27 @@ import { craftToSaltcorn, layoutToNodes } from "./storage";
|
|
|
8
14
|
import optionsCtx from "./context";
|
|
9
15
|
import { WrapElem } from "./Toolbox";
|
|
10
16
|
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param {object[]} xs
|
|
20
|
+
* @returns {object[]}
|
|
21
|
+
*/
|
|
11
22
|
const twoByTwos = (xs) => {
|
|
12
23
|
if (xs.length <= 2) return [xs];
|
|
13
24
|
const [x, y, ...rest] = xs;
|
|
14
25
|
return [[x, y], ...twoByTwos(rest)];
|
|
15
26
|
};
|
|
16
27
|
|
|
17
|
-
export
|
|
28
|
+
export /**
|
|
29
|
+
* @param {object} props
|
|
30
|
+
* @param {*} props.name
|
|
31
|
+
* @param {*} props.layout
|
|
32
|
+
* @returns {Fraggment}
|
|
33
|
+
* @category saltcorn-builder
|
|
34
|
+
* @subcategory components
|
|
35
|
+
* @namespace
|
|
36
|
+
*/
|
|
37
|
+
const LibraryElem = ({ name, layout }) => {
|
|
18
38
|
const {
|
|
19
39
|
selected,
|
|
20
40
|
connectors: { connect, drag },
|
|
@@ -32,11 +52,22 @@ export const LibraryElem = ({ name, layout }) => {
|
|
|
32
52
|
);
|
|
33
53
|
};
|
|
34
54
|
|
|
55
|
+
/**
|
|
56
|
+
* @type {object}
|
|
57
|
+
*/
|
|
35
58
|
LibraryElem.craft = {
|
|
36
59
|
displayName: "LibraryElem",
|
|
37
60
|
};
|
|
38
61
|
|
|
39
|
-
export
|
|
62
|
+
export /**
|
|
63
|
+
* @param {object} props
|
|
64
|
+
* @param {object} props.nodekeys
|
|
65
|
+
* @returns {object[]}
|
|
66
|
+
* @category saltcorn-builder
|
|
67
|
+
* @subcategory components
|
|
68
|
+
* @namespace
|
|
69
|
+
*/
|
|
70
|
+
const InitNewElement = ({ nodekeys }) => {
|
|
40
71
|
const { actions, query, connectors } = useEditor((state, query) => {
|
|
41
72
|
return {};
|
|
42
73
|
});
|
|
@@ -86,7 +117,13 @@ export const InitNewElement = ({ nodekeys }) => {
|
|
|
86
117
|
return [];
|
|
87
118
|
};
|
|
88
119
|
|
|
89
|
-
export
|
|
120
|
+
export /**
|
|
121
|
+
* @category saltcorn-builder
|
|
122
|
+
* @returns {div}
|
|
123
|
+
* @subcategory components
|
|
124
|
+
* @namespace
|
|
125
|
+
*/
|
|
126
|
+
const Library = () => {
|
|
90
127
|
const { actions, selected, query, connectors } = useEditor((state, query) => {
|
|
91
128
|
return {
|
|
92
129
|
selected: state.events.selected,
|
|
@@ -98,6 +135,9 @@ export const Library = () => {
|
|
|
98
135
|
const [icon, setIcon] = useState();
|
|
99
136
|
const [recent, setRecent] = useState([]);
|
|
100
137
|
|
|
138
|
+
/**
|
|
139
|
+
* @returns {void}
|
|
140
|
+
*/
|
|
101
141
|
const addSelected = () => {
|
|
102
142
|
const layout = craftToSaltcorn(JSON.parse(query.serialize()), selected);
|
|
103
143
|
const data = { layout, icon, name: newName };
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category saltcorn-builder
|
|
3
|
+
* @module components/RenderNode
|
|
4
|
+
* @subcategory components
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
import { useNode, useEditor } from "@craftjs/core";
|
|
2
8
|
//import { ROOT_NODE } from "@craftjs/utils";
|
|
3
9
|
import React, { useEffect, useRef, useCallback, Fragment } from "react";
|
|
@@ -17,7 +23,14 @@ Contains code copied from craft.js landing page example
|
|
|
17
23
|
Copyright (c) 2020 Previnash Wong Sze Chuan
|
|
18
24
|
*/
|
|
19
25
|
|
|
20
|
-
export
|
|
26
|
+
export /**
|
|
27
|
+
* @param {object} props
|
|
28
|
+
* @param {string} props.render
|
|
29
|
+
* @category saltcorn-builder
|
|
30
|
+
* @subcategory components
|
|
31
|
+
* @namespace
|
|
32
|
+
*/
|
|
33
|
+
const RenderNode = ({ render }) => {
|
|
21
34
|
const { id } = useNode();
|
|
22
35
|
const { actions, query, isActive } = useEditor((state) => ({
|
|
23
36
|
isActive: state.nodes[id].events.selected,
|
|
@@ -81,6 +94,9 @@ export const RenderNode = ({ render }) => {
|
|
|
81
94
|
};
|
|
82
95
|
}, [scroll]);
|
|
83
96
|
|
|
97
|
+
/**
|
|
98
|
+
* @returns {void}
|
|
99
|
+
*/
|
|
84
100
|
const duplicate = () => {
|
|
85
101
|
const {
|
|
86
102
|
data: { parent },
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category saltcorn-builder
|
|
3
|
+
* @module components / Toolbox
|
|
4
|
+
* @subcategory components
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
import React, { useEffect, useContext, Fragment } from "react";
|
|
2
8
|
import { Element, useEditor } from "@craftjs/core";
|
|
3
9
|
import { Text } from "./elements/Text";
|
|
@@ -27,9 +33,33 @@ import {
|
|
|
27
33
|
TextareaT,
|
|
28
34
|
} from "react-bootstrap-icons";
|
|
29
35
|
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param {object[]} xs
|
|
39
|
+
* @param {object} def
|
|
40
|
+
* @returns {object}
|
|
41
|
+
*/
|
|
30
42
|
const headOr = (xs, def) => (xs && xs.length > 0 ? xs[0] : def);
|
|
31
43
|
|
|
32
|
-
export
|
|
44
|
+
export /**
|
|
45
|
+
* @param {object} props
|
|
46
|
+
* @param {object} props.children
|
|
47
|
+
* @param {object} props.connectors
|
|
48
|
+
* @param {string|object} props.icon
|
|
49
|
+
* @param {object[]} props.icons
|
|
50
|
+
* @param {string} props.text
|
|
51
|
+
* @param {string|number} [props.fontSize]
|
|
52
|
+
* @param {string} props.title
|
|
53
|
+
* @param {string} props.innerClass
|
|
54
|
+
* @param {boolean} props.bold
|
|
55
|
+
* @param {string} props.label
|
|
56
|
+
* @param {boolean} props.disable
|
|
57
|
+
* @returns {div}
|
|
58
|
+
* @category saltcorn-builder
|
|
59
|
+
* @subcategory components / Toolbox
|
|
60
|
+
* @namespace
|
|
61
|
+
*/
|
|
62
|
+
const WrapElem = ({
|
|
33
63
|
children,
|
|
34
64
|
connectors,
|
|
35
65
|
icon,
|
|
@@ -61,6 +91,15 @@ export const WrapElem = ({
|
|
|
61
91
|
<label>{label}</label>
|
|
62
92
|
</div>
|
|
63
93
|
);
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @param {object} props
|
|
97
|
+
* @param {object} props.connectors
|
|
98
|
+
* @returns {WrapElem}
|
|
99
|
+
* @category saltcorn-builder
|
|
100
|
+
* @subcategory components / Toolbox
|
|
101
|
+
* @namespace
|
|
102
|
+
*/
|
|
64
103
|
const TextElem = ({ connectors }) => (
|
|
65
104
|
<WrapElem
|
|
66
105
|
connectors={connectors}
|
|
@@ -73,6 +112,14 @@ const TextElem = ({ connectors }) => (
|
|
|
73
112
|
<Text text="Hello world" block={false} textStyle={""} />
|
|
74
113
|
</WrapElem>
|
|
75
114
|
);
|
|
115
|
+
/**
|
|
116
|
+
* @param {object} props
|
|
117
|
+
* @param {object} props.connectors
|
|
118
|
+
* @returns {WrapElem}
|
|
119
|
+
* @category saltcorn-builder
|
|
120
|
+
* @subcategory components / Toolbox
|
|
121
|
+
* @namespace
|
|
122
|
+
*/
|
|
76
123
|
const ColumnsElem = ({ connectors }) => (
|
|
77
124
|
<WrapElem
|
|
78
125
|
connectors={connectors}
|
|
@@ -84,6 +131,14 @@ const ColumnsElem = ({ connectors }) => (
|
|
|
84
131
|
<Columns contents={[]} />
|
|
85
132
|
</WrapElem>
|
|
86
133
|
);
|
|
134
|
+
/**
|
|
135
|
+
* @param {object} props
|
|
136
|
+
* @param {object} props.connectors
|
|
137
|
+
* @returns {WrapElem}
|
|
138
|
+
* @category saltcorn-builder
|
|
139
|
+
* @subcategory components / Toolbox
|
|
140
|
+
* @namespace
|
|
141
|
+
*/
|
|
87
142
|
const TabsElem = ({ connectors }) => (
|
|
88
143
|
<WrapElem
|
|
89
144
|
connectors={connectors}
|
|
@@ -94,6 +149,14 @@ const TabsElem = ({ connectors }) => (
|
|
|
94
149
|
<Tabs contents={[]} />
|
|
95
150
|
</WrapElem>
|
|
96
151
|
);
|
|
152
|
+
/**
|
|
153
|
+
* @param {object} props
|
|
154
|
+
* @param {object} props.connectors
|
|
155
|
+
* @returns {WrapElem}
|
|
156
|
+
* @category saltcorn-builder
|
|
157
|
+
* @subcategory components / Toolbox
|
|
158
|
+
* @namespace
|
|
159
|
+
*/
|
|
97
160
|
const LineBreakElem = ({ connectors }) => (
|
|
98
161
|
<WrapElem
|
|
99
162
|
connectors={connectors}
|
|
@@ -105,6 +168,14 @@ const LineBreakElem = ({ connectors }) => (
|
|
|
105
168
|
<LineBreak />
|
|
106
169
|
</WrapElem>
|
|
107
170
|
);
|
|
171
|
+
/**
|
|
172
|
+
* @param {object} props
|
|
173
|
+
* @param {object} props.connectors
|
|
174
|
+
* @returns {WrapElem}
|
|
175
|
+
* @category saltcorn-builder
|
|
176
|
+
* @subcategory components / Toolbox
|
|
177
|
+
* @namespace
|
|
178
|
+
*/
|
|
108
179
|
const HTMLElem = ({ connectors }) => (
|
|
109
180
|
<WrapElem
|
|
110
181
|
connectors={connectors}
|
|
@@ -115,6 +186,14 @@ const HTMLElem = ({ connectors }) => (
|
|
|
115
186
|
<HTMLCode text={""} />
|
|
116
187
|
</WrapElem>
|
|
117
188
|
);
|
|
189
|
+
/**
|
|
190
|
+
* @param {object} props
|
|
191
|
+
* @param {object} props.connectors
|
|
192
|
+
* @returns {WrapElem}
|
|
193
|
+
* @category saltcorn-builder
|
|
194
|
+
* @subcategory components / Toolbox
|
|
195
|
+
* @namespace
|
|
196
|
+
*/
|
|
118
197
|
const CardElem = ({ connectors }) => (
|
|
119
198
|
<WrapElem
|
|
120
199
|
connectors={connectors}
|
|
@@ -125,6 +204,14 @@ const CardElem = ({ connectors }) => (
|
|
|
125
204
|
<Element canvas is={Card} isFormula={{}} url=""></Element>
|
|
126
205
|
</WrapElem>
|
|
127
206
|
);
|
|
207
|
+
/**
|
|
208
|
+
* @param {object} props
|
|
209
|
+
* @param {object} props.connectors
|
|
210
|
+
* @returns {WrapElem}
|
|
211
|
+
* @category saltcorn-builder
|
|
212
|
+
* @subcategory components / Toolbox
|
|
213
|
+
* @namespace
|
|
214
|
+
*/
|
|
128
215
|
const ImageElem = ({ connectors, images }) => (
|
|
129
216
|
<WrapElem
|
|
130
217
|
connectors={connectors}
|
|
@@ -135,6 +222,14 @@ const ImageElem = ({ connectors, images }) => (
|
|
|
135
222
|
<Image fileid={images.length > 0 ? images[0].id : 0} />
|
|
136
223
|
</WrapElem>
|
|
137
224
|
);
|
|
225
|
+
/**
|
|
226
|
+
* @param {object} props
|
|
227
|
+
* @param {object} props.connectors
|
|
228
|
+
* @returns {WrapElem}
|
|
229
|
+
* @category saltcorn-builder
|
|
230
|
+
* @subcategory components / Toolbox
|
|
231
|
+
* @namespace
|
|
232
|
+
*/
|
|
138
233
|
const LinkElem = ({ connectors }) => (
|
|
139
234
|
<WrapElem
|
|
140
235
|
connectors={connectors}
|
|
@@ -145,6 +240,14 @@ const LinkElem = ({ connectors }) => (
|
|
|
145
240
|
<Link />
|
|
146
241
|
</WrapElem>
|
|
147
242
|
);
|
|
243
|
+
/**
|
|
244
|
+
* @param {object} props
|
|
245
|
+
* @param {object} props.connectors
|
|
246
|
+
* @returns {WrapElem}
|
|
247
|
+
* @category saltcorn-builder
|
|
248
|
+
* @subcategory components / Toolbox
|
|
249
|
+
* @namespace
|
|
250
|
+
*/
|
|
148
251
|
const ViewElem = ({ connectors, views }) => (
|
|
149
252
|
<WrapElem
|
|
150
253
|
connectors={connectors}
|
|
@@ -160,6 +263,14 @@ const ViewElem = ({ connectors, views }) => (
|
|
|
160
263
|
/>
|
|
161
264
|
</WrapElem>
|
|
162
265
|
);
|
|
266
|
+
/**
|
|
267
|
+
* @param {object} props
|
|
268
|
+
* @param {object} props.connectors
|
|
269
|
+
* @returns {WrapElem}
|
|
270
|
+
* @category saltcorn-builder
|
|
271
|
+
* @subcategory components / Toolbox
|
|
272
|
+
* @namespace
|
|
273
|
+
*/
|
|
163
274
|
const SearchElem = ({ connectors }) => (
|
|
164
275
|
<WrapElem
|
|
165
276
|
connectors={connectors}
|
|
@@ -170,6 +281,14 @@ const SearchElem = ({ connectors }) => (
|
|
|
170
281
|
<SearchBar />
|
|
171
282
|
</WrapElem>
|
|
172
283
|
);
|
|
284
|
+
/**
|
|
285
|
+
* @param {object} props
|
|
286
|
+
* @param {object} props.connectors
|
|
287
|
+
* @returns {WrapElem}
|
|
288
|
+
* @category saltcorn-builder
|
|
289
|
+
* @subcategory components / Toolbox
|
|
290
|
+
* @namespace
|
|
291
|
+
*/
|
|
173
292
|
const ContainerElem = ({ connectors }) => (
|
|
174
293
|
<WrapElem
|
|
175
294
|
connectors={connectors}
|
|
@@ -180,6 +299,14 @@ const ContainerElem = ({ connectors }) => (
|
|
|
180
299
|
<Element canvas is={Container}></Element>
|
|
181
300
|
</WrapElem>
|
|
182
301
|
);
|
|
302
|
+
/**
|
|
303
|
+
* @param {object} props
|
|
304
|
+
* @param {object} props.connectors
|
|
305
|
+
* @returns {WrapElem}
|
|
306
|
+
* @category saltcorn-builder
|
|
307
|
+
* @subcategory components / Toolbox
|
|
308
|
+
* @namespace
|
|
309
|
+
*/
|
|
183
310
|
const FieldElem = ({ connectors, fields, field_view_options }) => (
|
|
184
311
|
<WrapElem
|
|
185
312
|
connectors={connectors}
|
|
@@ -196,6 +323,14 @@ const FieldElem = ({ connectors, fields, field_view_options }) => (
|
|
|
196
323
|
/>
|
|
197
324
|
</WrapElem>
|
|
198
325
|
);
|
|
326
|
+
/**
|
|
327
|
+
* @param {object} props
|
|
328
|
+
* @param {object} props.connectors
|
|
329
|
+
* @returns {WrapElem}
|
|
330
|
+
* @category saltcorn-builder
|
|
331
|
+
* @subcategory components / Toolbox
|
|
332
|
+
* @namespace
|
|
333
|
+
*/
|
|
199
334
|
const DropDownFilterElem = ({ connectors, fields }) => (
|
|
200
335
|
<WrapElem
|
|
201
336
|
connectors={connectors}
|
|
@@ -211,6 +346,14 @@ const DropDownFilterElem = ({ connectors, fields }) => (
|
|
|
211
346
|
/>
|
|
212
347
|
</WrapElem>
|
|
213
348
|
);
|
|
349
|
+
/**
|
|
350
|
+
* @param {object} props
|
|
351
|
+
* @param {object} props.connectors
|
|
352
|
+
* @returns {WrapElem}
|
|
353
|
+
* @category saltcorn-builder
|
|
354
|
+
* @subcategory components / Toolbox
|
|
355
|
+
* @namespace
|
|
356
|
+
*/
|
|
214
357
|
const ToggleFilterElem = ({ connectors, fields }) => (
|
|
215
358
|
<WrapElem
|
|
216
359
|
connectors={connectors}
|
|
@@ -221,6 +364,14 @@ const ToggleFilterElem = ({ connectors, fields }) => (
|
|
|
221
364
|
<ToggleFilter name={fields[0].name} value={""} label={""} block={false} />
|
|
222
365
|
</WrapElem>
|
|
223
366
|
);
|
|
367
|
+
/**
|
|
368
|
+
* @param {object} props
|
|
369
|
+
* @param {object} props.connectors
|
|
370
|
+
* @returns {WrapElem}
|
|
371
|
+
* @category saltcorn-builder
|
|
372
|
+
* @subcategory components / Toolbox
|
|
373
|
+
* @namespace
|
|
374
|
+
*/
|
|
224
375
|
const JoinFieldElem = ({ connectors, options }) => (
|
|
225
376
|
<WrapElem
|
|
226
377
|
connectors={connectors}
|
|
@@ -236,6 +387,14 @@ const JoinFieldElem = ({ connectors, options }) => (
|
|
|
236
387
|
/>
|
|
237
388
|
</WrapElem>
|
|
238
389
|
);
|
|
390
|
+
/**
|
|
391
|
+
* @param {object} props
|
|
392
|
+
* @param {object} props.connectors
|
|
393
|
+
* @returns {WrapElem}
|
|
394
|
+
* @category saltcorn-builder
|
|
395
|
+
* @subcategory components / Toolbox
|
|
396
|
+
* @namespace
|
|
397
|
+
*/
|
|
239
398
|
const ViewLinkElem = ({ connectors, options }) => (
|
|
240
399
|
<WrapElem
|
|
241
400
|
connectors={connectors}
|
|
@@ -255,6 +414,14 @@ const ViewLinkElem = ({ connectors, options }) => (
|
|
|
255
414
|
</WrapElem>
|
|
256
415
|
);
|
|
257
416
|
|
|
417
|
+
/**
|
|
418
|
+
* @param {object} props
|
|
419
|
+
* @param {object} props.connectors
|
|
420
|
+
* @returns {WrapElem}
|
|
421
|
+
* @category saltcorn-builder
|
|
422
|
+
* @subcategory components / Toolbox
|
|
423
|
+
* @namespace
|
|
424
|
+
*/
|
|
258
425
|
const ActionElem = ({ connectors, options }) => (
|
|
259
426
|
<WrapElem
|
|
260
427
|
connectors={connectors}
|
|
@@ -274,6 +441,15 @@ const ActionElem = ({ connectors, options }) => (
|
|
|
274
441
|
/>
|
|
275
442
|
</WrapElem>
|
|
276
443
|
);
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* @param {object} props
|
|
447
|
+
* @param {object} props.connectors
|
|
448
|
+
* @returns {WrapElem}
|
|
449
|
+
* @category saltcorn-builder
|
|
450
|
+
* @subcategory components / Toolbox
|
|
451
|
+
* @namespace
|
|
452
|
+
*/
|
|
277
453
|
const AggregationElem = ({ connectors, child_field_list, agg_field_opts }) => (
|
|
278
454
|
<WrapElem
|
|
279
455
|
connectors={connectors}
|
|
@@ -295,7 +471,13 @@ const AggregationElem = ({ connectors, child_field_list, agg_field_opts }) => (
|
|
|
295
471
|
</WrapElem>
|
|
296
472
|
);
|
|
297
473
|
|
|
298
|
-
export
|
|
474
|
+
export /**
|
|
475
|
+
* @returns {Fragment}
|
|
476
|
+
* @category saltcorn-builder
|
|
477
|
+
* @subcategory components / Toolbox
|
|
478
|
+
* @namespace
|
|
479
|
+
*/
|
|
480
|
+
const ToolboxShow = () => {
|
|
299
481
|
const { connectors, query } = useEditor();
|
|
300
482
|
const options = useContext(optionsCtx);
|
|
301
483
|
const {
|
|
@@ -351,7 +533,15 @@ export const ToolboxShow = () => {
|
|
|
351
533
|
);
|
|
352
534
|
};
|
|
353
535
|
|
|
354
|
-
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
export /**
|
|
539
|
+
* @returns {Fragment}
|
|
540
|
+
* @category saltcorn-builder
|
|
541
|
+
* @subcategory components / Toolbox
|
|
542
|
+
* @namespace
|
|
543
|
+
*/
|
|
544
|
+
const ToolboxFilter = () => {
|
|
355
545
|
const { connectors, query } = useEditor();
|
|
356
546
|
const options = useContext(optionsCtx);
|
|
357
547
|
const { fields, views } = options;
|
|
@@ -385,7 +575,13 @@ export const ToolboxFilter = () => {
|
|
|
385
575
|
);
|
|
386
576
|
};
|
|
387
577
|
|
|
388
|
-
export
|
|
578
|
+
export /**
|
|
579
|
+
* @returns {Fragment}
|
|
580
|
+
* @category saltcorn-builder
|
|
581
|
+
* @subcategory components / Toolbox
|
|
582
|
+
* @namespace
|
|
583
|
+
*/
|
|
584
|
+
const ToolboxEdit = () => {
|
|
389
585
|
const { connectors, query } = useEditor();
|
|
390
586
|
const options = useContext(optionsCtx);
|
|
391
587
|
const { fields, field_view_options, images, views } = options;
|
|
@@ -423,7 +619,13 @@ export const ToolboxEdit = () => {
|
|
|
423
619
|
);
|
|
424
620
|
};
|
|
425
621
|
|
|
426
|
-
export
|
|
622
|
+
export /**
|
|
623
|
+
* @returns {Fragment}
|
|
624
|
+
* @category saltcorn-builder
|
|
625
|
+
* @subcategory components / Toolbox
|
|
626
|
+
* @namespace
|
|
627
|
+
*/
|
|
628
|
+
const ToolboxPage = () => {
|
|
427
629
|
const { connectors, query } = useEditor();
|
|
428
630
|
const options = useContext(optionsCtx);
|
|
429
631
|
const { views, images } = options;
|