dbm 1.1.1 → 1.1.2
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/CommandBaseObject.js +25 -0
- package/commands/SetProperty.js +18 -0
- package/commands/index.js +20 -8
- package/core/source/FromObject.js +8 -0
- package/core/source/index.js +9 -0
- package/flow/controllers/edit/EditMultipleValues.js +57 -0
- package/flow/controllers/edit/EditValue.js +52 -0
- package/flow/controllers/edit/index.js +2 -0
- package/flow/controllers/index.js +2 -1
- package/graphapi/webclient/admin/EditorGroup.js +59 -0
- package/graphapi/webclient/admin/ItemEditor.js +74 -0
- package/graphapi/webclient/admin/ItemSaveData.js +63 -0
- package/graphapi/webclient/admin/SaveData.js +60 -0
- package/graphapi/webclient/admin/SaveFunctions.js +7 -0
- package/graphapi/webclient/admin/ValueEditor.js +61 -0
- package/graphapi/webclient/admin/index.js +8 -0
- package/graphapi/webclient/decode/index.js +16 -3
- package/graphapi/webclient/index.js +17 -1
- package/package.json +1 -1
- package/react/admin/EditPage.js +87 -66
- package/react/admin/SelectImageFromLibrary.js +56 -0
- package/react/admin/editor/Editor.js +2 -0
- package/react/admin/editor/fields/ImageField.js +142 -4
- package/react/admin/index.js +1 -0
- package/react/area/OpenCloseExpandableArea.js +1 -1
- package/react/modules/index.js +11 -1
- package/react/text/index.js +2 -2
- package/site/BrowserUpdater.js +46 -0
- package/site/SiteDataLoader.js +9 -13
- package/site/SiteNavigation.js +0 -15
- package/site/index.js +20 -1
- package/utils/ArrayFunctions.js +0 -1
- package/utils/UrlFunctions.js +15 -11
package/site/index.js
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
+
import Dbm from "../index.js";
|
|
2
|
+
|
|
1
3
|
export {default as SiteNavigation} from "./SiteNavigation.js";
|
|
2
|
-
export {default as SiteDataLoader} from "./SiteDataLoader.js";
|
|
4
|
+
export {default as SiteDataLoader} from "./SiteDataLoader.js";
|
|
5
|
+
export {default as BrowserUpdater} from "./BrowserUpdater.js";
|
|
6
|
+
|
|
7
|
+
export const setupAndStart = function(aTitleSuffix) {
|
|
8
|
+
let siteNavigation = new Dbm.site.SiteNavigation();
|
|
9
|
+
siteNavigation.item.register("siteNavigation");
|
|
10
|
+
siteNavigation.start();
|
|
11
|
+
siteNavigation.setUrlFromLocation();
|
|
12
|
+
|
|
13
|
+
let siteDataLoader = new Dbm.site.SiteDataLoader();
|
|
14
|
+
siteDataLoader.item.register("siteDataLoader");
|
|
15
|
+
siteDataLoader.item.properties.url.connectInput(siteNavigation.item.properties.url);
|
|
16
|
+
|
|
17
|
+
let browserUpdater = new Dbm.site.BrowserUpdater();
|
|
18
|
+
siteDataLoader.item.register("site/browserUpdater");
|
|
19
|
+
browserUpdater.setTitleSuffix(aTitleSuffix);
|
|
20
|
+
browserUpdater.item.propertyInput("pageData", siteDataLoader.item.properties.currentPage);
|
|
21
|
+
}
|
package/utils/ArrayFunctions.js
CHANGED
|
@@ -125,7 +125,6 @@ export const filterByField = function(aArray, aField, aValue) {
|
|
|
125
125
|
for(let i = 0; i < currentArrayLength; i++) {
|
|
126
126
|
let currentItem = aArray[i];
|
|
127
127
|
let currentValue = Dbm.objectPath(aArray[i], aField);
|
|
128
|
-
console.log(currentValue, aValue);
|
|
129
128
|
if(currentValue === aValue) {
|
|
130
129
|
returnArray.push(currentItem);
|
|
131
130
|
}
|
package/utils/UrlFunctions.js
CHANGED
|
@@ -49,6 +49,20 @@ export let createCoverScaledImageUrl = function(aImageData, aWantedWidth, aWante
|
|
|
49
49
|
return url;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
export const getContainScaledImageUrl = function(aUrl, aWantedWidth, aWantedHeight) {
|
|
53
|
+
let scaleToWidth = Math.min(
|
|
54
|
+
Math.round(window.devicePixelRatio*aWantedWidth),
|
|
55
|
+
Math.max(
|
|
56
|
+
100,
|
|
57
|
+
100*Math.round(window.devicePixelRatio*window.innerWidth/100)
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
let scaleToHeight = Math.round(aWantedHeight*scaleToWidth/aWantedWidth);
|
|
62
|
+
|
|
63
|
+
return aUrl.split("{scale}").join("width=" + scaleToWidth + ",height=" + scaleToHeight + ",fit=contain");
|
|
64
|
+
}
|
|
65
|
+
|
|
52
66
|
export let createContainScaledImageUrl = function(aImageData, aWantedWidth, aWantedHeight) {
|
|
53
67
|
if(!aImageData || !aImageData["url"]) {
|
|
54
68
|
return null;
|
|
@@ -60,17 +74,7 @@ export let createContainScaledImageUrl = function(aImageData, aWantedWidth, aWan
|
|
|
60
74
|
}
|
|
61
75
|
|
|
62
76
|
if(aImageData["resizeUrl"]) {
|
|
63
|
-
|
|
64
|
-
Math.round(window.devicePixelRatio*aWantedWidth),
|
|
65
|
-
Math.max(
|
|
66
|
-
100,
|
|
67
|
-
100*Math.round(window.devicePixelRatio*window.innerWidth/100)
|
|
68
|
-
)
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
let scaleToHeight = Math.round(aWantedHeight*scaleToWidth/aWantedWidth);
|
|
72
|
-
|
|
73
|
-
url = aImageData["resizeUrl"].split("{scale}").join("width=" + scaleToWidth + ",height=" + scaleToHeight + ",fit=contain");
|
|
77
|
+
url = getContainScaledImageUrl(aImageData["resizeUrl"], aWantedWidth, aWantedHeight);
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
return url;
|