dbm 1.4.15 → 1.4.17
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/commands/index.js +1 -1
- package/css/admin.css +6 -1
- package/css/all.css +4 -1
- package/css/cookie-bar.css +40 -0
- package/css/elements.css +41 -0
- package/css/form-field.css +46 -0
- package/css/grid.css +8 -0
- package/css/icons.css +2 -0
- package/css/utils.css +12 -6
- package/dbm.js +1 -1
- package/ecommerce/Cart.js +44 -9
- package/ecommerce/LocalStorageCartLoader.js +7 -3
- package/flow/controllers/select/SingleSelection.js +7 -0
- package/flow/updatefunctions/basic/index.js +1 -1
- package/graphapi/webclient/decode/Relations.js +12 -0
- package/loading/index.js +34 -0
- package/package.json +1 -1
- package/react/BaseObject.js +22 -5
- package/react/admin/editor/Editor.js +5 -6
- package/react/admin/editor/fields/ArrayField.js +24 -7
- package/react/admin/editor/fields/Link.js +53 -0
- package/react/admin/editor/fields/index.js +2 -1
- package/react/admin/objects/ExploreObject.js +103 -0
- package/react/admin/objects/explore/Relation.js +67 -0
- package/react/admin/objects/explore/RelationType.js +38 -0
- package/react/admin/objects/explore/RelationTypeGroup.js +22 -0
- package/react/admin/objects/explore/index.js +3 -0
- package/react/admin/objects/index.js +3 -1
- package/react/admin/objects/itemeditors/DraggableHierarchyDisplay.js +1 -1
- package/react/admin/objects/itemeditors/TextAreaField.js +26 -0
- package/react/admin/objects/itemeditors/index.js +1 -0
- package/react/animation/AnimationController.js +1 -3
- package/react/animation/index.js +15 -0
- package/react/area/InsertElement.js +3 -0
- package/react/area/Layout.js +20 -0
- package/react/area/List.js +4 -0
- package/react/area/ModalDialog.js +89 -0
- package/react/area/NativeElement.js +37 -0
- package/react/area/RepeatedSlider.js +73 -0
- package/react/area/SingleItemSlideshow.js +69 -0
- package/react/area/SlideshowSteps.js +45 -0
- package/react/area/index.js +7 -1
- package/react/blocks/admin/objects/Explore.js +18 -0
- package/react/blocks/admin/objects/index.js +2 -1
- package/react/blocks/content/Buttons.js +33 -0
- package/react/blocks/content/ContentBlock.js +7 -2
- package/react/blocks/content/SectionsGrid.js +19 -0
- package/react/blocks/content/Spacing.js +13 -0
- package/react/blocks/content/SpacingLine.js +18 -0
- package/react/blocks/content/index.js +5 -1
- package/react/blocks/index.js +108 -0
- package/react/context/AddContextVariables.js +9 -4
- package/react/cookies/CookieBar.js +6 -4
- package/react/cookies/CookieOverlayMessage.js +6 -4
- package/react/dynamic/DesignRepositoryProxy.js +22 -0
- package/react/dynamic/DynamicDesignElement.js +24 -0
- package/react/dynamic/index.js +60 -0
- package/react/form/EditObjectProperty.js +15 -2
- package/react/form/EditableContent.js +71 -0
- package/react/form/GraphApiImageWithAltText.js +268 -0
- package/react/form/Link.js +40 -0
- package/react/form/Url.js +25 -0
- package/react/form/index.js +4 -0
- package/react/index.js +12 -0
- package/react/interaction/Checked.js +32 -0
- package/react/interaction/ClickOutsideTrigger.js +1 -1
- package/react/interaction/index.js +2 -1
- package/react/svg/AddGlobalFilterClasses.js +3 -3
- package/react/svg/BlendColorFilter.js +42 -0
- package/react/svg/GlobalFilters.js +1 -1
- package/react/svg/MatrixFilter.js +1 -3
- package/react/svg/index.js +20 -0
- package/react/text/index.js +4 -0
- package/repository/Item.js +8 -0
- package/repository/admin/index.js +10 -0
- package/repository/index.js +3 -0
- package/repository/proxy/RepositoryProxy.js +60 -0
- package/repository/proxy/index.js +1 -0
- package/site/BrowserUpdater.js +3 -3
- package/startup/index.js +1 -1
- package/tracking/Controller.js +26 -8
- package/tracking/ConversionLinker.js +53 -0
- package/tracking/DataLayerTracker.js +27 -18
- package/tracking/GtagTracker.js +112 -0
- package/tracking/MetaPixelTracker.js +1 -1
- package/tracking/PageListTracker.js +46 -0
- package/tracking/SingleAccountMetaPixelTracker.js +118 -0
- package/tracking/TagManagerTracker.js +2 -2
- package/tracking/index.js +58 -0
- package/utils/svg/ColorMatrixFunctions.js +13 -0
package/commands/index.js
CHANGED
|
@@ -57,7 +57,7 @@ export const trackEvent = function(aEventName, aAdditionalData = {}) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export const performCommands = function(aCommands, aFromObject = null, aEventData = null) {
|
|
60
|
-
let currentArray = aCommands;
|
|
60
|
+
let currentArray = Dbm.utils.ArrayFunctions.singleOrArray(aCommands);
|
|
61
61
|
let currentArrayLength = currentArray.length;
|
|
62
62
|
for(let i = 0; i < currentArrayLength; i++) {
|
|
63
63
|
let currentCommand = currentArray[i];
|
package/css/admin.css
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
.dbm-admin {
|
|
2
2
|
background-color: #f6f7f9;
|
|
3
|
+
color: #313131;
|
|
4
|
+
|
|
5
|
+
h1, h2, h3, h4, h5, h6 {
|
|
6
|
+
color: #313131;
|
|
7
|
+
}
|
|
3
8
|
}
|
|
4
9
|
|
|
5
10
|
.dbm-admin-box {
|
|
@@ -15,7 +20,7 @@
|
|
|
15
20
|
|
|
16
21
|
.dbm-admin-hero {
|
|
17
22
|
background: rgb(41,56,97);
|
|
18
|
-
background: linear-gradient(
|
|
23
|
+
background: linear-gradient(to bottom right, #4b4795 0%, #608be1 100%);
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
.dbm-admin-hero .on-hero-text {
|
package/css/all.css
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.cookie-bar-position {
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.cookie-bar {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
border-top: 1px solid #1A1A1A;
|
|
11
|
+
-webkit-backdrop-filter: blur(5px);
|
|
12
|
+
backdrop-filter: blur(5px);
|
|
13
|
+
background-color: rgba(255, 255, 255, 0.7);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.cookie-bar-padding {
|
|
17
|
+
padding: 10px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cookie-bar-title {
|
|
21
|
+
font-size: 18px;
|
|
22
|
+
font-weight: bold;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.cookie-overlay-message-box {
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
border: 1px solid #1A1A1A;
|
|
28
|
+
border-radius: 20px;
|
|
29
|
+
-webkit-backdrop-filter: blur(5px);
|
|
30
|
+
backdrop-filter: blur(5px);
|
|
31
|
+
background-color: rgba(255, 255, 255, 0.7);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.cookie-overlay-message-box-padding {
|
|
35
|
+
padding: 20px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cookie-bar-description {
|
|
39
|
+
line-height: 1.3;
|
|
40
|
+
}
|
package/css/elements.css
CHANGED
|
@@ -24,4 +24,45 @@
|
|
|
24
24
|
|
|
25
25
|
.standard-dropdown-row-padding {
|
|
26
26
|
padding: 8px 15px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.help-section-row {
|
|
30
|
+
border: 1px solid var(--help-section-row-border-color, #3b3b3b);
|
|
31
|
+
border-radius: var(--help-section-row-border-radius, 5px);
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.help-section-row-question {
|
|
36
|
+
color: #FFFFFF;
|
|
37
|
+
background-color: var(--help-section-row-question-background-color, #3b3b3b);
|
|
38
|
+
font-weight: bold;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.help-section-row-question-padding {
|
|
42
|
+
padding: 5px 11px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.help-section-row-answer-padding {
|
|
46
|
+
padding: 5px 11px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.help-section-row-answer-title {
|
|
50
|
+
font-weight: bold;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.help-section-row-read-more-link {
|
|
54
|
+
color: var(--standard-link-color, #0000FF);
|
|
55
|
+
font-weight: bold;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@media (min-width: 600px) {
|
|
59
|
+
.help-section-row-read-more-link {
|
|
60
|
+
font-size: 14px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.help-section-row-question-icon {
|
|
66
|
+
width: 15px;
|
|
67
|
+
height: 15px;
|
|
27
68
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.standard-field {
|
|
2
|
+
border: 1px solid var(--standard-field-border-color, #797979);
|
|
3
|
+
border-radius: var(--standard-field-border-radius, 5px);
|
|
4
|
+
font-size: var(--standard-field-size, 18px);
|
|
5
|
+
font-family: var(--standard-body-font, sans-serif);
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.standard-field-padding {
|
|
10
|
+
padding: var(--standard-field-vertical-padding, 10px) var(--standard-field-horizontal-padding, 10px);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.standard-field-padding-left-side {
|
|
14
|
+
padding-left: var(--standard-field-horizontal-padding, 10px);
|
|
15
|
+
padding-top: var(--standard-field-vertical-padding, 10px);
|
|
16
|
+
padding-bottom: var(--standard-field-vertical-padding, 10px);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.standard-field-padding-right-side {
|
|
20
|
+
padding-right: var(--standard-field-horizontal-padding, 10px);
|
|
21
|
+
padding-top: var(--standard-field-vertical-padding, 10px);
|
|
22
|
+
padding-bottom: var(--standard-field-vertical-padding, 10px);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.standard-field-padding-vertical {
|
|
26
|
+
padding-top: var(--standard-field-vertical-padding, 10px);
|
|
27
|
+
padding-bottom: var(--standard-field-vertical-padding, 10px);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.with-left-field-icon {
|
|
31
|
+
padding-left: calc(2 * var(--standard-field-horizontal-padding, 10px) + var(--field-icon-size, 16px));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.left-field-icon-position {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 50%;
|
|
37
|
+
left: calc(var(--standard-field-horizontal-padding, 10px) + 0.5 * var(--field-icon-size, 16px));
|
|
38
|
+
transform: translate(-50%, -50%);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.integrated-field {
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
border: none;
|
|
44
|
+
display: block;
|
|
45
|
+
font-size: var(--standard-body-font, sans-serif);
|
|
46
|
+
}
|
package/css/grid.css
ADDED
package/css/icons.css
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
height: var(--field-icon-size, 16px);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/*
|
|
16
17
|
.standard-icon-color {
|
|
17
18
|
filter: url("#standard-icon-color");
|
|
18
19
|
}
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
.hover-icon.remove-action-icon-color:hover {
|
|
34
35
|
filter: url("#remove-action-icon-hover-color");
|
|
35
36
|
}
|
|
37
|
+
*/
|
|
36
38
|
|
|
37
39
|
.drag-handle-icon {
|
|
38
40
|
width: 8px;
|
package/css/utils.css
CHANGED
|
@@ -95,6 +95,12 @@
|
|
|
95
95
|
top: 0;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
.middle-left {
|
|
99
|
+
left: 0;
|
|
100
|
+
top: 50%;
|
|
101
|
+
transform: translate(-50%, -50%);
|
|
102
|
+
}
|
|
103
|
+
|
|
98
104
|
.top-right {
|
|
99
105
|
right: 0;
|
|
100
106
|
top: 0;
|
|
@@ -105,6 +111,12 @@
|
|
|
105
111
|
bottom: 0;
|
|
106
112
|
}
|
|
107
113
|
|
|
114
|
+
.middle-right {
|
|
115
|
+
right: 0;
|
|
116
|
+
top: 50%;
|
|
117
|
+
transform: translate(50%, -50%);
|
|
118
|
+
}
|
|
119
|
+
|
|
108
120
|
.bottom-right {
|
|
109
121
|
right: 0;
|
|
110
122
|
bottom: 0;
|
|
@@ -209,12 +221,6 @@
|
|
|
209
221
|
pointer-events: all;
|
|
210
222
|
}
|
|
211
223
|
|
|
212
|
-
.integrated-field {
|
|
213
|
-
box-sizing: border-box;
|
|
214
|
-
border: none;
|
|
215
|
-
display: block;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
224
|
.centered-cell-holder {
|
|
219
225
|
display: flex;
|
|
220
226
|
justify-content: center;
|
package/dbm.js
CHANGED
|
@@ -103,8 +103,8 @@ export const getCachedGraphApi = function() {
|
|
|
103
103
|
export * as utils from "./utils/index.js";
|
|
104
104
|
export * as core from "./core/index.js";
|
|
105
105
|
export * as loading from "./loading/index.js";
|
|
106
|
-
export * as react from "./react/index.js";
|
|
107
106
|
export * as repository from "./repository/index.js";
|
|
107
|
+
export * as react from "./react/index.js";
|
|
108
108
|
export * as graphapi from "./graphapi/index.js";
|
|
109
109
|
export * as commands from "./commands/index.js";
|
|
110
110
|
export * as flow from "./flow/index.js";
|
package/ecommerce/Cart.js
CHANGED
|
@@ -4,10 +4,11 @@ export default class Cart extends Dbm.core.BaseObject {
|
|
|
4
4
|
_construct() {
|
|
5
5
|
super._construct();
|
|
6
6
|
|
|
7
|
-
this._changeCommand =
|
|
7
|
+
this._changeCommand = this._getScopedCallFunctionCommand(this._changed);
|
|
8
|
+
|
|
9
|
+
this.item.requireProperty("lineItems", []).addUpdate(this._changeCommand);
|
|
10
|
+
this.item.requireProperty("meta", {}).addUpdate(this._changeCommand);
|
|
8
11
|
|
|
9
|
-
this.item.setValue("lineItems", []);
|
|
10
|
-
Dbm.flow.addUpdateCommand(this.item.properties.lineItems, this._changeCommand);
|
|
11
12
|
this.item.setValue("numberOfItems", 0);
|
|
12
13
|
this.item.setValue("numberOfLines", 0);
|
|
13
14
|
|
|
@@ -29,7 +30,9 @@ export default class Cart extends Dbm.core.BaseObject {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
Dbm.flow.addUpdateCommand(lineItem.item.properties.product, this._changeCommand);
|
|
32
34
|
Dbm.flow.addUpdateCommand(lineItem.item.properties.quantity, this._changeCommand);
|
|
35
|
+
//METODO: save change for meta
|
|
33
36
|
|
|
34
37
|
this.item.addToArray("lineItems", lineItem.item);
|
|
35
38
|
|
|
@@ -65,13 +68,45 @@ export default class Cart extends Dbm.core.BaseObject {
|
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
removeLineItem(aItem) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
this.item.removeFromArray("lineItems", aItem);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
emptyCart() {
|
|
75
|
+
this.item.lineItems = [];
|
|
76
|
+
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
setMeta(aKey, aValue) {
|
|
81
|
+
let newMeta = {...this.item.meta};
|
|
82
|
+
newMeta[aKey] = aValue;
|
|
83
|
+
this.item.meta = newMeta;
|
|
84
|
+
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
getAsObject() {
|
|
89
|
+
let returnObject = {};
|
|
90
|
+
|
|
91
|
+
let encodedLineItems = [];
|
|
92
|
+
|
|
93
|
+
let currentArray = this.item.lineItems;
|
|
94
|
+
let currentArrayLength = currentArray.length;
|
|
95
|
+
for(let i = 0; i < currentArrayLength; i++) {
|
|
96
|
+
let currentData = currentArray[i];
|
|
97
|
+
|
|
98
|
+
let meta = currentData.meta.controller.getAsObject();
|
|
99
|
+
//METODO: links in meta
|
|
100
|
+
let encodedData = {"type": currentData.type, "quantity": currentData.quantity, "meta": meta};
|
|
101
|
+
if(currentData.product) {
|
|
102
|
+
encodedData["product"] = currentData.product.id;
|
|
103
|
+
}
|
|
104
|
+
encodedLineItems.push(encodedData);
|
|
74
105
|
}
|
|
106
|
+
|
|
107
|
+
returnObject = {"lineItems": encodedLineItems, "meta": {...this.item.meta}};
|
|
108
|
+
|
|
109
|
+
return returnObject;
|
|
75
110
|
}
|
|
76
111
|
|
|
77
112
|
_changed() {
|
|
@@ -49,6 +49,10 @@ export default class LocalStorageCartLoader extends Dbm.core.BaseObject {
|
|
|
49
49
|
lineItem.setProduct(product);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
if(cartData.meta) {
|
|
54
|
+
this.item.cart.meta = cartData.meta;
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
catch(theError) {
|
|
@@ -81,10 +85,10 @@ export default class LocalStorageCartLoader extends Dbm.core.BaseObject {
|
|
|
81
85
|
encodedLineItems.push(encodedData);
|
|
82
86
|
}
|
|
83
87
|
|
|
84
|
-
console.log(encodedLineItems);
|
|
85
|
-
|
|
86
88
|
try {
|
|
87
|
-
let
|
|
89
|
+
let saveData = {"lineItems": encodedLineItems, "meta": this.item.cart.meta};
|
|
90
|
+
console.log(saveData);
|
|
91
|
+
let cartDataString = localStorage.setItem(this.item.storageKey, JSON.stringify(saveData));
|
|
88
92
|
}
|
|
89
93
|
catch(theError) {
|
|
90
94
|
console.error(theError);
|
|
@@ -5,6 +5,9 @@ export default class SingleSelection extends Dbm.core.BaseObject {
|
|
|
5
5
|
super._construct();
|
|
6
6
|
|
|
7
7
|
this._valueMap = new Map();
|
|
8
|
+
let proxy = new Proxy({}, {get: this._proxy_get_selectionProperty.bind(this)});
|
|
9
|
+
|
|
10
|
+
this.item.setValue("selectionProperties", proxy);
|
|
8
11
|
|
|
9
12
|
let valueUpdatedCommand = Dbm.commands.callFunction(this._valueUpdated.bind(this));
|
|
10
13
|
|
|
@@ -16,6 +19,10 @@ export default class SingleSelection extends Dbm.core.BaseObject {
|
|
|
16
19
|
this.item.requireProperty("matched", false);
|
|
17
20
|
}
|
|
18
21
|
|
|
22
|
+
_proxy_get_selectionProperty(aTarget, aPropertyName, aReceiver) {
|
|
23
|
+
return this.addSelectionValue(aPropertyName);
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
addSelectionValue(aValue) {
|
|
20
27
|
//console.log("addSelectionValue");
|
|
21
28
|
//console.log(aValue);
|
|
@@ -114,7 +114,7 @@ export const translation = function(aId, aDefaultValue = null, aPath = null, aAd
|
|
|
114
114
|
updateFunction.input.properties.additionalPath.setOrConnect(aAdditionalPath);
|
|
115
115
|
|
|
116
116
|
if(!aTranslations) {
|
|
117
|
-
aTranslations = Dbm.getRepositoryItem("site/translations").requireProperty("data");
|
|
117
|
+
aTranslations = Dbm.getRepositoryItem("site/translations").requireProperty("data", {});
|
|
118
118
|
}
|
|
119
119
|
updateFunction.input.properties.translations.setOrConnect(aTranslations);
|
|
120
120
|
|
|
@@ -20,6 +20,8 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
|
|
|
20
20
|
let currentRelationsItem = aItem["relations/in"];
|
|
21
21
|
if(!currentRelationsItem) {
|
|
22
22
|
currentRelationsItem = new Dbm.repository.Item();
|
|
23
|
+
currentRelationsItem.setValue("direction", "in");
|
|
24
|
+
currentRelationsItem.setValue("all", []);
|
|
23
25
|
aItem.setValue("relations/in", currentRelationsItem);
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -31,9 +33,12 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
|
|
|
31
33
|
let typeItem = currentRelationsItem[currentType];
|
|
32
34
|
if(!typeItem) {
|
|
33
35
|
typeItem = new Dbm.repository.Item();
|
|
36
|
+
typeItem.setValue("type", currentType);
|
|
34
37
|
typeItem.setValue("objects", []);
|
|
35
38
|
typeItem.setValue("relations", []);
|
|
39
|
+
typeItem.setValue("allRelations", []);
|
|
36
40
|
currentRelationsItem.setValue(currentType, typeItem);
|
|
41
|
+
currentRelationsItem.addToArray("all", typeItem);
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
let relation = Dbm.getRepositoryItem(currentRelationData["relationId"]);
|
|
@@ -44,6 +49,7 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
|
|
|
44
49
|
relation.setValue("to", aItem);
|
|
45
50
|
relation.setValue("startAt", currentRelationData["startAt"]);
|
|
46
51
|
relation.setValue("endAt", currentRelationData["endAt"]);
|
|
52
|
+
typeItem.addToArray("allRelations", relation);
|
|
47
53
|
|
|
48
54
|
if(this._isRelationValid(currentRelationData["startAt"], currentRelationData["endAt"])) {
|
|
49
55
|
typeItem.addToArray("objects", linkedItem);
|
|
@@ -58,6 +64,8 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
|
|
|
58
64
|
let currentRelationsItem = aItem["relations/out"];
|
|
59
65
|
if(!currentRelationsItem) {
|
|
60
66
|
currentRelationsItem = new Dbm.repository.Item();
|
|
67
|
+
currentRelationsItem.setValue("direction", "out");
|
|
68
|
+
currentRelationsItem.setValue("all", []);
|
|
61
69
|
aItem.setValue("relations/out", currentRelationsItem);
|
|
62
70
|
}
|
|
63
71
|
|
|
@@ -69,9 +77,12 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
|
|
|
69
77
|
let typeItem = currentRelationsItem[currentType];
|
|
70
78
|
if(!typeItem) {
|
|
71
79
|
typeItem = new Dbm.repository.Item();
|
|
80
|
+
typeItem.setValue("type", currentType);
|
|
72
81
|
typeItem.setValue("objects", []);
|
|
73
82
|
typeItem.setValue("relations", []);
|
|
83
|
+
typeItem.setValue("allRelations", []);
|
|
74
84
|
currentRelationsItem.setValue(currentType, typeItem);
|
|
85
|
+
currentRelationsItem.addToArray("all", typeItem);
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
let relation = Dbm.getRepositoryItem(currentRelationData["relationId"]);
|
|
@@ -82,6 +93,7 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
|
|
|
82
93
|
relation.setValue("to", linkedItem);
|
|
83
94
|
relation.setValue("startAt", currentRelationData["startAt"]);
|
|
84
95
|
relation.setValue("endAt", currentRelationData["endAt"]);
|
|
96
|
+
typeItem.addToArray("allRelations", relation);
|
|
85
97
|
|
|
86
98
|
if(this._isRelationValid(currentRelationData["startAt"], currentRelationData["endAt"])) {
|
|
87
99
|
typeItem.addToArray("objects", linkedItem);
|
package/loading/index.js
CHANGED
|
@@ -74,4 +74,38 @@ export const loadFont = function(aUrl, aFontName) {
|
|
|
74
74
|
loader.load();
|
|
75
75
|
|
|
76
76
|
return loader;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const getJson = function(aUrl, aCallback = null, aHeaders = null) {
|
|
80
|
+
let request = new Dbm.loading.JsonLoader();
|
|
81
|
+
request.setUrl(aUrl);
|
|
82
|
+
if(aHeaders) {
|
|
83
|
+
request.item.headers = aHeaders;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if(aCallback) {
|
|
87
|
+
let callbackCommand = Dbm.commands.callFunction(aCallback, [Dbm.core.source.staticObject(request, "item.data")]);
|
|
88
|
+
Dbm.flow.runWhenMatched(request.item.properties.status, Dbm.loading.LoadingStatus.LOADED, callbackCommand);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
request.load();
|
|
92
|
+
|
|
93
|
+
return request.item.properties.data;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const postJson = function(aUrl, aBody, aCallback = null, aHeaders = null) {
|
|
97
|
+
let request = new Dbm.loading.JsonLoader();
|
|
98
|
+
request.setupJsonPost(aUrl, aBody);
|
|
99
|
+
if(aHeaders) {
|
|
100
|
+
request.item.headers = aHeaders;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if(aCallback) {
|
|
104
|
+
let callbackCommand = Dbm.commands.callFunction(aCallback, [Dbm.core.source.staticObject(request, "item.data")]);
|
|
105
|
+
Dbm.flow.runWhenMatched(request.item.properties.status, Dbm.loading.LoadingStatus.LOADED, callbackCommand);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
request.load();
|
|
109
|
+
|
|
110
|
+
return request.item.properties.data;
|
|
77
111
|
}
|
package/package.json
CHANGED
package/react/BaseObject.js
CHANGED
|
@@ -6,13 +6,30 @@ export default class BaseObject extends Component {
|
|
|
6
6
|
constructor(aProps, aContext) {
|
|
7
7
|
super(aProps, aContext);
|
|
8
8
|
this.state = {"dynamicUpdate": 0};
|
|
9
|
-
this._dynamicProps = {}
|
|
10
|
-
this.
|
|
11
|
-
|
|
12
|
-
this._prepareProps();
|
|
13
|
-
this._constructAfterProps();
|
|
9
|
+
this._dynamicProps = {};
|
|
10
|
+
this._safeConstruct();
|
|
14
11
|
}
|
|
15
12
|
|
|
13
|
+
_safeConstruct() {
|
|
14
|
+
if(Dbm.getRepositoryItem("development").catchRenderErrors) {
|
|
15
|
+
try {
|
|
16
|
+
this._construct();
|
|
17
|
+
|
|
18
|
+
this._prepareProps();
|
|
19
|
+
this._constructAfterProps();
|
|
20
|
+
}
|
|
21
|
+
catch(theError) {
|
|
22
|
+
console.error("Error while constructing", this, theError);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this._construct();
|
|
27
|
+
|
|
28
|
+
this._prepareProps();
|
|
29
|
+
this._constructAfterProps();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
16
33
|
_construct() {
|
|
17
34
|
|
|
18
35
|
}
|
|
@@ -12,16 +12,15 @@ export default class Editor extends Dbm.react.BaseObject {
|
|
|
12
12
|
|
|
13
13
|
let all = Dbm.flow.updatefunctions.logic.allAtValue(1);
|
|
14
14
|
|
|
15
|
-
all.addCheck(Dbm.loading.loadScript("
|
|
16
|
-
all.addCheck(Dbm.loading.loadScript("
|
|
17
|
-
all.addCheck(Dbm.loading.loadScript("
|
|
18
|
-
all.addCheck(Dbm.loading.loadScript("
|
|
19
|
-
all.addCheck(Dbm.loading.loadScript("https://cdn.jsdelivr.net/npm/@editorjs/raw@latest").item.properties.status);
|
|
15
|
+
all.addCheck(Dbm.loading.loadScript("/assets/js/admin/image.js").item.properties.status);
|
|
16
|
+
all.addCheck(Dbm.loading.loadScript("/assets/js/admin/header.js").item.properties.status);
|
|
17
|
+
all.addCheck(Dbm.loading.loadScript("/assets/js/admin/list.js").item.properties.status);
|
|
18
|
+
all.addCheck(Dbm.loading.loadScript("/assets/js/admin/raw.js").item.properties.status);
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
//METODO: select which tools should be used
|
|
23
22
|
|
|
24
|
-
all.addCheck(Dbm.loading.loadScript("
|
|
23
|
+
all.addCheck(Dbm.loading.loadScript("/assets/js/admin/editor.js").item.properties.status);
|
|
25
24
|
|
|
26
25
|
this.item.setValue("element", document.createElement("div"));
|
|
27
26
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Dbm from "../../../../index.js";
|
|
3
3
|
|
|
4
|
-
export default class
|
|
4
|
+
export default class ArrayField extends Dbm.react.BaseObject {
|
|
5
5
|
_construct() {
|
|
6
6
|
super._construct();
|
|
7
7
|
|
|
@@ -66,14 +66,31 @@ export default class SelectObjectsField extends Dbm.react.BaseObject {
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
return this._createMainElement(Dbm.react.form.EditArray, {value: this.item.properties.value},
|
|
69
|
-
React.createElement("div", {},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
React.createElement("div", {"className": "flex-row small-item-spacing"},
|
|
70
|
+
React.createElement("div", {"className": "flex-row-item flex-resize"},
|
|
71
|
+
this.getPropValue("children")
|
|
72
|
+
),
|
|
73
|
+
React.createElement("div", {"className": "flex-row-item flex-no-resize"},
|
|
74
|
+
React.createElement("div", {className: "spacing small"}),
|
|
75
|
+
React.createElement(Dbm.react.interaction.ConfirmButton, {"command": this._getScopedCallFunctionCommand(this._removeItem, [Dbm.react.source.contextVariable("arrayEditor"), Dbm.react.source.contextVariable("item")])},
|
|
76
|
+
React.createElement(Dbm.react.image.Image, {"src": "/assets/img/icons/delete.svg", "className": "background-contain text-row-icon action-icon-color cursor-pointer"}),
|
|
77
|
+
React.createElement("div", {"data-slot": "confirm", className: "absolute-container cursor-pointer", title: "Click to remove"},
|
|
78
|
+
React.createElement(Dbm.react.image.Image, {"src": "/assets/img/icons/delete.svg", "className": "background-contain text-row-icon hover-icon remove-action-icon-color cursor-pointer"}),
|
|
79
|
+
React.createElement("div", {className:"centered-tip-text no-pointer-events"},
|
|
80
|
+
"Remove?"
|
|
81
|
+
)
|
|
82
|
+
)
|
|
83
|
+
)
|
|
73
84
|
)
|
|
74
85
|
),
|
|
75
|
-
React.createElement(
|
|
76
|
-
|
|
86
|
+
React.createElement("div", {"data-slot": "spacing", className: "spacing small"}),
|
|
87
|
+
React.createElement("div", {"data-slot": "after", "className": "flex-row"},
|
|
88
|
+
React.createElement("div", {className: "spacing small"}),
|
|
89
|
+
React.createElement("div", {"className": "flex-row-item"},
|
|
90
|
+
React.createElement(Dbm.react.interaction.CommandButton, {command: Dbm.commands.callFunction(this._add.bind(this), [Dbm.react.source.contextVariable("arrayEditor")])},
|
|
91
|
+
React.createElement("div", {className: "action-button action-button-padding"}, "Add")
|
|
92
|
+
)
|
|
93
|
+
)
|
|
77
94
|
)
|
|
78
95
|
);
|
|
79
96
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Dbm from "../../../../index.js";
|
|
3
|
+
|
|
4
|
+
export default class Link extends Dbm.react.BaseObject {
|
|
5
|
+
_construct() {
|
|
6
|
+
super._construct();
|
|
7
|
+
|
|
8
|
+
this._valueChangedBound = this._valueChanged.bind(this);
|
|
9
|
+
this._objectChangedBound = this._objectChanged.bind(this);
|
|
10
|
+
|
|
11
|
+
Dbm.flow.addUpdateCommand(this.item.requireProperty("value", this._getObjectData()), Dbm.commands.callFunction(this._valueChangedBound));
|
|
12
|
+
|
|
13
|
+
let editorData = Dbm.objectPath(this.context, "moduleData.editorData");
|
|
14
|
+
Dbm.flow.addUpdateCommand(editorData.properties.data, Dbm.commands.callFunction(this._objectChangedBound));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
_getObjectData() {
|
|
18
|
+
let fieldName = this.getPropValue("name");
|
|
19
|
+
|
|
20
|
+
let editorData = Dbm.objectPath(this.context, "moduleData.editorData");
|
|
21
|
+
|
|
22
|
+
let returnData = editorData.data[fieldName];
|
|
23
|
+
if(!returnData) {
|
|
24
|
+
returnData = {};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return returnData;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
_valueChanged() {
|
|
32
|
+
//console.log("_valueChanged");
|
|
33
|
+
|
|
34
|
+
let fieldName = this.getPropValue("name");
|
|
35
|
+
let newValue = this.item.value;
|
|
36
|
+
let editorData = Dbm.objectPath(this.context, "moduleData.editorData");
|
|
37
|
+
|
|
38
|
+
let newData = {...editorData.data};
|
|
39
|
+
newData[fieldName] = newValue;
|
|
40
|
+
|
|
41
|
+
editorData.data = newData;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_objectChanged() {
|
|
45
|
+
//console.log("_objectChanged");
|
|
46
|
+
|
|
47
|
+
this.item.value = this._getObjectData();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_renderMainElement() {
|
|
51
|
+
return this._createMainElement(Dbm.react.form.Link, {value: this.item.properties.value, className: "standard-field standard-field-padding full-width"});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -6,4 +6,5 @@ export {default as SelectObjectField} from "./SelectObjectField.js";
|
|
|
6
6
|
export {default as SelectObjectsField} from "./SelectObjectsField.js";
|
|
7
7
|
export {default as SelectionField} from "./SelectionField.js";
|
|
8
8
|
export {default as ArrayField} from "./ArrayField.js";
|
|
9
|
-
export {default as EditorBlocks} from "./EditorBlocks.js";
|
|
9
|
+
export {default as EditorBlocks} from "./EditorBlocks.js";
|
|
10
|
+
export {default as Link} from "./Link.js";
|