dbm 1.4.14 → 1.4.16
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/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/graphapi/webclient/decode/index.js +3 -0
- package/loading/index.js +34 -0
- package/node/googlemaps/index.js +53 -0
- package/node/index.js +1 -0
- package/package.json +1 -1
- package/react/BaseObject.js +32 -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 +13 -5
- package/react/admin/objects/itemeditors/HierarchyOrderedRelationsList.js +2 -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/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 +6 -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/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 +150 -1
- package/react/context/AddContextVariables.js +9 -4
- package/react/cookies/CookieBar.js +1 -1
- package/react/cookies/CookieOverlayMessage.js +2 -2
- 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 +14 -8
- package/tracking/DataLayerTracker.js +27 -18
- package/tracking/GtagTracker.js +112 -0
- package/tracking/MetaPixelTracker.js +1 -1
- package/tracking/SingleAccountMetaPixelTracker.js +118 -0
- package/tracking/TagManagerTracker.js +2 -2
- package/tracking/index.js +24 -0
- package/utils/svg/ColorMatrixFunctions.js +13 -0
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);
|
|
@@ -225,4 +225,7 @@ export const fullSetup = function() {
|
|
|
225
225
|
setupDefaultDecoder("menuLocation", ["identifier"], ["menu"], []);
|
|
226
226
|
setupDefaultDecoder("menu", ["order"], [], ["menuItems"], [Dbm.commands.callFunction(linkUpMenu, [Dbm.core.source.event("item")])]);
|
|
227
227
|
setupDefaultDecoder("menuItem", ["label", "link"], [], []);
|
|
228
|
+
|
|
229
|
+
setupDefaultDecoder("review", ["rating", "from", "description", "date"], ["source"], []);
|
|
230
|
+
setupDefaultDecoder("reviewSource", ["imageUrl", "link"], ["type"], []);
|
|
228
231
|
}
|
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
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import Dbm from "../../index.js";
|
|
2
|
+
|
|
3
|
+
export const findPlace = async function(aName) {
|
|
4
|
+
let response = await fetch("https://places.googleapis.com/v1/places:searchText", {
|
|
5
|
+
method: "POST",
|
|
6
|
+
headers: {
|
|
7
|
+
"Content-Type": "application/json",
|
|
8
|
+
"X-Goog-Api-Key": Dbm.getRepositoryItem("googleMapsApi").apiKey,
|
|
9
|
+
"X-Goog-FieldMask": "*"
|
|
10
|
+
},
|
|
11
|
+
body: JSON.stringify({
|
|
12
|
+
textQuery: aName,
|
|
13
|
+
maxResultCount: 1
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
let repsonseText = await response.text();
|
|
18
|
+
|
|
19
|
+
let place = null;
|
|
20
|
+
try {
|
|
21
|
+
let responseData = JSON.parse(repsonseText);
|
|
22
|
+
place = Dbm.objectPath(responseData, "places.0");
|
|
23
|
+
}
|
|
24
|
+
catch(theError) {
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return place;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const getReviews = async function(aPlaceId) {
|
|
32
|
+
let response = await fetch("https://places.googleapis.com/v1/places/" + aPlaceId, {
|
|
33
|
+
headers: {
|
|
34
|
+
"X-Goog-Api-Key": Dbm.getRepositoryItem("googleMapsApi").apiKey,
|
|
35
|
+
"X-Goog-FieldMask": "*"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
let repsonseText = await response.text();
|
|
40
|
+
let reviews = [];
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
let responseData = JSON.parse(repsonseText);
|
|
44
|
+
console.log(responseData);
|
|
45
|
+
reviews = Dbm.objectPath(responseData, "reviews");
|
|
46
|
+
}
|
|
47
|
+
catch(theError) {
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return reviews;
|
|
52
|
+
}
|
|
53
|
+
|
package/node/index.js
CHANGED
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
|
}
|
|
@@ -111,6 +128,16 @@ export default class BaseObject extends Component {
|
|
|
111
128
|
return value;
|
|
112
129
|
}
|
|
113
130
|
|
|
131
|
+
getPropValueWithoutNull(aName, aDefaultValue) {
|
|
132
|
+
let value = this.getPropValue(aName);
|
|
133
|
+
|
|
134
|
+
if(value === null || value === undefined) {
|
|
135
|
+
value = aDefaultValue;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return value;
|
|
139
|
+
}
|
|
140
|
+
|
|
114
141
|
createRef(aName) {
|
|
115
142
|
let refToProperty = this.item["ref/" + aName];
|
|
116
143
|
|
|
@@ -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
|
|