@saltcorn/builder 1.3.0-beta.0 → 1.3.0-beta.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.
@@ -0,0 +1,96 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ /*!
8
+ Copyright (c) 2017 Jed Watson.
9
+ Licensed under the MIT License (MIT), see
10
+ http://jedwatson.github.io/classnames
11
+ */
12
+
13
+ /*!
14
+ * Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com
15
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
16
+ */
17
+
18
+ /*! *****************************************************************************
19
+ Copyright (c) Microsoft Corporation.
20
+
21
+ Permission to use, copy, modify, and/or distribute this software for any
22
+ purpose with or without fee is hereby granted.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
25
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
26
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
27
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
28
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
29
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
30
+ PERFORMANCE OF THIS SOFTWARE.
31
+ ***************************************************************************** */
32
+
33
+ /*! *****************************************************************************
34
+ Copyright (c) Microsoft Corporation. All rights reserved.
35
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
36
+ this file except in compliance with the License. You may obtain a copy of the
37
+ License at http://www.apache.org/licenses/LICENSE-2.0
38
+
39
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
40
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
41
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
42
+ MERCHANTABLITY OR NON-INFRINGEMENT.
43
+
44
+ See the Apache Version 2.0 License for specific language governing permissions
45
+ and limitations under the License.
46
+ ***************************************************************************** */
47
+
48
+ /*!*
49
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
50
+ * For licensing, see LICENSE.md.
51
+ */
52
+
53
+ /**
54
+ * @license
55
+ * Lodash <https://lodash.com/>
56
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
57
+ * Released under MIT license <https://lodash.com/license>
58
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
59
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
60
+ */
61
+
62
+ /** @license React v0.19.1
63
+ * scheduler.production.min.js
64
+ *
65
+ * Copyright (c) Facebook, Inc. and its affiliates.
66
+ *
67
+ * This source code is licensed under the MIT license found in the
68
+ * LICENSE file in the root directory of this source tree.
69
+ */
70
+
71
+ /** @license React v16.13.1
72
+ * react-dom.production.min.js
73
+ *
74
+ * Copyright (c) Facebook, Inc. and its affiliates.
75
+ *
76
+ * This source code is licensed under the MIT license found in the
77
+ * LICENSE file in the root directory of this source tree.
78
+ */
79
+
80
+ /** @license React v16.13.1
81
+ * react-is.production.min.js
82
+ *
83
+ * Copyright (c) Facebook, Inc. and its affiliates.
84
+ *
85
+ * This source code is licensed under the MIT license found in the
86
+ * LICENSE file in the root directory of this source tree.
87
+ */
88
+
89
+ /** @license React v16.13.1
90
+ * react.production.min.js
91
+ *
92
+ * Copyright (c) Facebook, Inc. and its affiliates.
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE file in the root directory of this source tree.
96
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/builder",
3
- "version": "1.3.0-beta.0",
3
+ "version": "1.3.0-beta.10",
4
4
  "description": "Drag and drop view builder for Saltcorn, open-source no-code platform",
5
5
  "main": "index.js",
6
6
  "homepage": "https://saltcorn.com",
@@ -20,7 +20,7 @@
20
20
  "@babel/preset-react": "7.24.7",
21
21
  "@craftjs/core": "0.1.0-beta.20",
22
22
  "@craftjs/utils": "0.1.0-beta.20",
23
- "@saltcorn/common-code": "1.3.0-beta.0",
23
+ "@saltcorn/common-code": "1.3.0-beta.10",
24
24
  "saltcorn-craft-layers-noeye": "0.1.0-beta.22",
25
25
  "@fonticonpicker/react-fonticonpicker": "1.2.0",
26
26
  "@fortawesome/fontawesome-svg-core": "1.2.34",
@@ -223,14 +223,14 @@ const SettingsPanel = () => {
223
223
  {selected ? (
224
224
  <Fragment>
225
225
  {selected.isDeletable && (
226
- <button className="btn btn-sm btn-danger" onClick={deleteThis}>
226
+ <button className="btn btn-sm btn-danger delete-element-builder" onClick={deleteThis}>
227
227
  <FontAwesomeIcon icon={faTrashAlt} className="me-1" />
228
228
  Delete
229
229
  </button>
230
230
  )}
231
231
  {hasChildren && !selected.isDeletable ? (
232
232
  <button
233
- className="btn btn-sm btn-danger"
233
+ className="btn btn-sm btn-danger delete-children-builder"
234
234
  onClick={deleteChildren}
235
235
  >
236
236
  <FontAwesomeIcon icon={faTrashAlt} className="me-1" />
@@ -239,7 +239,7 @@ const SettingsPanel = () => {
239
239
  ) : (
240
240
  <button
241
241
  title="Duplicate element with its children"
242
- className="btn btn-sm btn-secondary ms-2"
242
+ className="btn btn-sm btn-secondary ms-2 duplicate-element-builder"
243
243
  onClick={duplicate}
244
244
  >
245
245
  <FontAwesomeIcon icon={faCopy} className="me-1" />
@@ -293,7 +293,7 @@ const AddColumnButton = () => {
293
293
  );
294
294
  };
295
295
  return (
296
- <button className="btn btn-primary mt-2" onClick={addColumn}>
296
+ <button className="btn btn-primary mt-2 add-column-builder" onClick={addColumn}>
297
297
  <FontAwesomeIcon icon={faPlus} className="me-2" />
298
298
  Add column
299
299
  </button>
@@ -316,7 +316,7 @@ const HistoryPanel = () => {
316
316
  <Fragment>
317
317
  {canUndo && (
318
318
  <button
319
- className="btn btn-sm btn-secondary ms-2 me-2"
319
+ className="btn btn-sm btn-secondary ms-2 me-2 undo-builder"
320
320
  title="Undo"
321
321
  onClick={() => actions.history.undo()}
322
322
  >
@@ -325,7 +325,7 @@ const HistoryPanel = () => {
325
325
  )}
326
326
  {canRedo && (
327
327
  <button
328
- className="btn btn-sm btn-secondary"
328
+ className="btn btn-sm btn-secondary redo-builder"
329
329
  title="Redo"
330
330
  onClick={() => actions.history.redo()}
331
331
  >
@@ -471,7 +471,7 @@ const Builder = ({ options, layout, mode }) => {
471
471
  ? faCaretSquareLeft
472
472
  : faCaretSquareRight
473
473
  }
474
- className={"float-end fa-lg"}
474
+ className={"float-end fa-lg builder-expand-toggle-left"}
475
475
  onClick={() => setIsLeftEnlarged(!isLeftEnlarged)}
476
476
  title={isLeftEnlarged ? "Shrink" : "Enlarge"}
477
477
  />
@@ -545,7 +545,7 @@ const Builder = ({ options, layout, mode }) => {
545
545
  icon={
546
546
  isEnlarged ? faCaretSquareRight : faCaretSquareLeft
547
547
  }
548
- className={"float-end me-2 mt-1 fa-lg"}
548
+ className={"float-end me-2 mt-1 fa-lg builder-expand-toggle-right"}
549
549
  onClick={() => setIsEnlarged(!isEnlarged)}
550
550
  title={isEnlarged ? "Shrink" : "Enlarge"}
551
551
  />
@@ -619,7 +619,9 @@ const ToolboxList = ({ expanded }) => {
619
619
  !disable_toolbox?.view && (
620
620
  <ViewElem connectors={connectors} views={views} />
621
621
  ),
622
- // <ContainerElem connectors={connectors} />,
622
+ !disable_toolbox?.dropdown_menu && (
623
+ <ContainerElem connectors={connectors} />
624
+ ),
623
625
  // <CardElem connectors={connectors} />,
624
626
  // <TabsElem connectors={connectors} />,
625
627
  <HTMLElem connectors={connectors} />,
@@ -197,7 +197,7 @@ const ActionSettings = () => {
197
197
  setInitialConfig(setProp, value, getCfgFields(value));
198
198
  }}
199
199
  >
200
- {options.actions.map((f, ix) =>
200
+ {options.actions.filter(Boolean).map((f, ix) =>
201
201
  f.optgroup && !f.options.length ? null : f.optgroup ? (
202
202
  <optgroup key={ix} label={f.label}>
203
203
  {f.options.map((a, jx) => (
@@ -942,10 +942,10 @@ const ContainerSettings = () => {
942
942
  </table>
943
943
  <table className="w-100" accordiontitle="Show if...">
944
944
  <tbody>
945
- {["show", "edit", "filter"].includes(options.mode) && (
945
+ {["show", "edit", "filter", "list"].includes(options.mode) && (
946
946
  <SettingsSectionHeaderRow title="Formula - show if true" />
947
947
  )}
948
- {["show", "edit", "filter"].includes(options.mode) && (
948
+ {["show", "edit", "filter", "list"].includes(options.mode) && (
949
949
  <tr>
950
950
  <td colSpan={2}>
951
951
  <input