dbm 1.2.9 → 1.4.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.
Files changed (43) hide show
  1. package/css/admin.css +99 -0
  2. package/css/all.css +8 -0
  3. package/css/elements.css +27 -0
  4. package/css/icons.css +40 -0
  5. package/css/ratio.css +11 -0
  6. package/css/rows.css +28 -0
  7. package/css/tags.css +114 -0
  8. package/css/utils.css +256 -0
  9. package/css/variables.css +3 -0
  10. package/graphapi/webclient/decode/Relations.js +18 -11
  11. package/loading/ImageLoader.js +65 -0
  12. package/loading/index.js +27 -1
  13. package/package.json +10 -4
  14. package/react/BaseObject.js +5 -3
  15. package/react/admin/CreatePage.js +2 -2
  16. package/react/admin/objects/itemeditors/FormattedField.js +21 -0
  17. package/react/admin/objects/itemeditors/FormattedFieldWithTranslations.js +38 -0
  18. package/react/admin/objects/itemeditors/MultipleRelations.js +147 -0
  19. package/react/admin/objects/itemeditors/RichTextField.js +21 -0
  20. package/react/admin/objects/itemeditors/RichTextFieldWithTranslations.js +38 -0
  21. package/react/admin/objects/itemeditors/index.js +5 -0
  22. package/react/area/InsertElement.js +2 -1
  23. package/react/blocks/faq/AskAQuestion.js +1 -0
  24. package/react/image/gallery/ImageGallery.js +84 -0
  25. package/react/image/gallery/ImageGallerySection.js +220 -0
  26. package/react/image/gallery/index.js +2 -0
  27. package/react/image/index.js +3 -1
  28. package/react/index.js +2 -0
  29. package/react/svg/GlobalFilters.js +22 -0
  30. package/react/svg/MatrixFilter.js +25 -0
  31. package/react/svg/index.js +43 -0
  32. package/react/thirdparty/index.js +2 -0
  33. package/react/thirdparty/tinymce/Editor.js +106 -0
  34. package/react/thirdparty/tinymce/InlineEditor.js +28 -0
  35. package/react/thirdparty/tinymce/index.js +2 -0
  36. package/react/thirdparty/vimeo/Player.js +65 -0
  37. package/react/thirdparty/vimeo/index.js +1 -0
  38. package/repository/Item.js +28 -0
  39. package/utils/ArrayFunctions.js +69 -0
  40. package/utils/StringFunctions.js +12 -1
  41. package/utils/index.js +2 -1
  42. package/utils/svg/ColorMatrixFunctions.js +12 -0
  43. package/utils/svg/index.js +1 -0
package/css/admin.css ADDED
@@ -0,0 +1,99 @@
1
+ .dbm-admin {
2
+ background-color: #f6f7f9;
3
+ }
4
+
5
+ .dbm-admin-box {
6
+ box-sizing: border-box;
7
+ border-radius: 15px;
8
+ background-color: #FFFFFF;
9
+ box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
10
+ }
11
+
12
+ .dbm-admin-box-padding {
13
+ padding: 20px;
14
+ }
15
+
16
+ .dbm-admin-hero {
17
+ background: rgb(41,56,97);
18
+ background: linear-gradient(117deg, #4b4795 0%, #608be1 100%);
19
+ }
20
+
21
+ .dbm-admin-hero .on-hero-text {
22
+ color: #FFFFFF;
23
+ }
24
+
25
+ .dbm-admin-hero-overlap {
26
+ position: relative;
27
+ top: -40px;
28
+ }
29
+
30
+ .page-title-form-field {
31
+ font-weight: 700;
32
+ font-size: 24px;
33
+ }
34
+
35
+ .dbm-admin-logo {
36
+ height: 24px;
37
+ width: auto;
38
+ }
39
+
40
+ .ce-block__content,
41
+ .ce-toolbar__content {
42
+ max-width: none;
43
+ }
44
+
45
+ .editor-block-box {
46
+ border: 1px solid #1A1A1A;
47
+ border-radius: 5px;
48
+ box-sizing: border-box;
49
+ }
50
+ .editor-block-box-padding {
51
+ padding: 20px;
52
+ }
53
+
54
+ .image.editor-preview {
55
+ width: 120px;
56
+ height: 120px;
57
+ }
58
+
59
+ .dbm-admin .save-all-position {
60
+ position: fixed;
61
+ bottom: 10px;
62
+ right: 10px;
63
+ }
64
+
65
+ .image-library-preview {
66
+ width: 120px;
67
+ height: 120px;
68
+ }
69
+
70
+ .image-library-margins {
71
+ margin-right: 5px;
72
+ margin-bottom: 5px;
73
+ }
74
+
75
+ .action-button {
76
+ border: 1px solid #ADADAD;
77
+ color: #ADADAD;
78
+ font-size: 10px;
79
+ border-radius: 9999px;
80
+ cursor: pointer;
81
+ }
82
+
83
+ .action-button:hover {
84
+ background-color: #ADADAD;
85
+ color: #FFFFFF;
86
+ }
87
+
88
+ .action-button-padding {
89
+ padding: 3px 10px;
90
+ }
91
+
92
+ .language-circle {
93
+ width: 28px;
94
+ height: 28px;
95
+ border-radius: 9999px;
96
+ background-color: #ADADAD;
97
+ font-size: 10px;
98
+ font-weight: bold;
99
+ }
package/css/all.css ADDED
@@ -0,0 +1,8 @@
1
+ @import './variables.css';
2
+ @import './utils.css';
3
+ @import './ratio.css';
4
+ @import './admin.css';
5
+ @import './rows.css';
6
+ @import './icons.css';
7
+ @import './tags.css';
8
+ @import './elements.css';
@@ -0,0 +1,27 @@
1
+ .popover-holder {
2
+ border: none;
3
+ padding: 0;
4
+ margin: 0;
5
+ overflow: visible;
6
+ background-color: transparent;
7
+ color: inherit;
8
+ }
9
+
10
+ .dropdown-menu-min-width {
11
+ min-width: 300px;
12
+ }
13
+
14
+ .dropdown-menu-max-height {
15
+ max-height: 400px;
16
+ overflow: auto;
17
+ }
18
+
19
+ .standard-dropdown {
20
+ border: 1px solid #000000;
21
+ background-color: #FFFFFF;
22
+ box-sizing: border-box;
23
+ }
24
+
25
+ .standard-dropdown-row-padding {
26
+ padding: 8px 15px;
27
+ }
package/css/icons.css ADDED
@@ -0,0 +1,40 @@
1
+ .standard-icon {
2
+ width: var(--standard-icon-size, 24px);
3
+ height: var(--standard-icon-size, 24px);
4
+ }
5
+
6
+ .text-row-icon {
7
+ width: var(--standard-icon-size, 24px);
8
+ height: var(--standard-icon-size, 24px);
9
+ }
10
+
11
+ .field-icon {
12
+ width: var(--field-icon-size, 16px);
13
+ height: var(--field-icon-size, 16px);
14
+ }
15
+
16
+ .standard-icon-color {
17
+ filter: url("#standard-icon-color");
18
+ }
19
+
20
+ .action-icon-color {
21
+ filter: url("#action-icon-color");
22
+ }
23
+
24
+ .text-icon-color {
25
+ filter: url("#text-icon-color");
26
+ }
27
+
28
+ .white-icon-color {
29
+ filter: url("#white-icon-color");
30
+ }
31
+
32
+ .hover-item:hover .remove-action-icon-color,
33
+ .hover-icon.remove-action-icon-color:hover {
34
+ filter: url("#remove-action-icon-hover-color");
35
+ }
36
+
37
+ .drag-handle-icon {
38
+ width: 8px;
39
+ height: 12px;
40
+ }
package/css/ratio.css ADDED
@@ -0,0 +1,11 @@
1
+ .ratio-1-1 {
2
+ aspect-ratio: 1;
3
+ }
4
+
5
+ .ratio-4-3 {
6
+ aspect-ratio: 1.33;
7
+ }
8
+
9
+ .ratio-16-9 {
10
+ aspect-ratio: 1.78;
11
+ }
package/css/rows.css ADDED
@@ -0,0 +1,28 @@
1
+ .standard-alternating-rows > .standard-row:nth-of-type(2n+1),
2
+ .standard-alternating-rows > *:nth-of-type(2n+1) .standard-row {
3
+ background-color: var(--alternating-rows-background, #F8F8F8);
4
+ }
5
+
6
+ .standard-row-padding {
7
+ padding: var(--standard-row-vertical-padding, 4px) var(--standard-row-horizonal-padding, 10px);
8
+ }
9
+
10
+ .standard-row-padding-horizontal-padding {
11
+ padding-left: var(--standard-row-horizonal-padding, 10px);
12
+ padding-right: var(--standard-row-horizonal-padding, 10px);
13
+ }
14
+
15
+ .standard-row-padding-vertival-padding {
16
+ padding-top: var(--standard-row-vertical-padding, 4px);
17
+ padding-bottom: var(--standard-row-vertical-padding, 4px);
18
+ }
19
+
20
+ .hierarchy-indent {
21
+ margin-left: var(--hierarchy-indent-margin-left, 40px);
22
+ }
23
+
24
+ .append-drop-position {
25
+ height: 12px;
26
+ border: 1px dashed rgba(0, 0, 0, 0.1);
27
+ border-radius: 4px;
28
+ }
package/css/tags.css ADDED
@@ -0,0 +1,114 @@
1
+ .standard-tag {
2
+ border-radius: var(--standard-tag-border-radius, 9999px);
3
+
4
+ border-style: solid;
5
+ border-width: var(--standard-tag-border-width, 1px);
6
+ }
7
+
8
+ .standard-tag,
9
+ .complex-standard-tag {
10
+ font-size: var(--standard-tag-font-size, 14px);
11
+ line-height: 1;
12
+ }
13
+
14
+ .complex-standard-tag.info-tag .standard-tag-part,
15
+ .standard-tag.info-tag {
16
+ background-color: #f1f4f9;
17
+ border-color: #d2dcec;
18
+ }
19
+
20
+ .complex-standard-tag.add-tag .standard-tag-part,
21
+ .standard-tag.add-tag {
22
+ background-color: #FFFFFF;
23
+ border-color: #ADADAD;
24
+ border-style: dashed;
25
+ }
26
+
27
+ .standard-tag-part {
28
+ border-top-style: solid;
29
+ border-top-width: var(--standard-tag-border-width, 1px);
30
+ border-bottom-style: solid;
31
+ border-bottom-width: var(--standard-tag-border-width, 1px);
32
+ }
33
+
34
+ .standard-tag-part.start {
35
+ border-top-left-radius: var(--standard-tag-border-radius, 9999px);
36
+ border-bottom-left-radius: var(--standard-tag-border-radius, 9999px);
37
+
38
+ border-left-style: solid;
39
+ border-left-width: var(--standard-tag-border-width, 1px);
40
+ }
41
+
42
+ .standard-tag-part.end {
43
+ border-top-right-radius: var(--standard-tag-border-radius, 9999px);
44
+ border-bottom-right-radius: var(--standard-tag-border-radius, 9999px);
45
+
46
+ border-right-style: solid;
47
+ border-right-width: var(--standard-tag-border-width, 1px);
48
+ }
49
+
50
+ .standard-tag-padding {
51
+ padding: var(--standard-tag-vertical-padding, 5px) var(--standard-tag-horizontal-padding, 12px);
52
+ }
53
+
54
+ .standard-tag-start-padding {
55
+ padding-left: var(--standard-tag-horizontal-padding, 12px);
56
+ padding-top: var(--standard-tag-vertical-padding, 5px);
57
+ padding-bottom: var(--standard-tag-vertical-padding, 5px);
58
+ }
59
+
60
+ .standard-tag-end-padding {
61
+ padding-right: var(--standard-tag-horizontal-padding, 12px);
62
+ padding-top: var(--standard-tag-vertical-padding, 5px);
63
+ padding-bottom: var(--standard-tag-vertical-padding, 5px);
64
+ }
65
+
66
+ .standard-tag-horizontal-padding {
67
+ padding-left: var(--standard-tag-horizontal-padding, 12px);
68
+ padding-right: var(--standard-tag-horizontal-padding, 12px);
69
+ }
70
+
71
+ .standard-tag-vertical-padding {
72
+ padding-top: var(--standard-tag-vertical-padding, 5px);
73
+ padding-bottom: var(--standard-tag-vertical-padding, 5px);
74
+ }
75
+
76
+ .standard-tag-part-padding {
77
+ padding-left: var(--standard-tag-part-horizontal-padding, 6px);
78
+ padding-right: var(--standard-tag-part-horizontal-padding, 6px);
79
+ }
80
+
81
+ .standard-tag-part-padding-left {
82
+ padding-left: var(--standard-tag-part-horizontal-padding, 6px);
83
+ }
84
+
85
+ .standard-tag-part-padding-right {
86
+ padding-right: var(--standard-tag-part-horizontal-padding, 6px);
87
+ }
88
+
89
+ .standard-tag-part-separator {
90
+ width: 1px;
91
+ height: 100%;
92
+ background-color: rgba(255,255,255,0.6);
93
+ }
94
+
95
+ .standard-tag-icon {
96
+ width: 12px;
97
+ aspect-ratio: 1;
98
+ }
99
+
100
+ .standard-tag-list {
101
+
102
+ }
103
+
104
+ .standard-tag-list-expand {
105
+ margin-right: calc(-1 * var(--standard-tag-list-horizontal-margin, 10px));
106
+ margin-bottom: calc(-1 * var(--standard-tag-list-vertical-margin, 5px));
107
+ overflow: hidden;
108
+ }
109
+
110
+ .standard-tag-list .standard-tag-list-item{
111
+ float: left;
112
+ margin-right: var(--standard-tag-list-horizontal-margin, 10px);
113
+ margin-bottom: var(--standard-tag-list-vertical-margin, 5px);
114
+ }
package/css/utils.css ADDED
@@ -0,0 +1,256 @@
1
+ .text-align-center {
2
+ text-align: center;
3
+ }
4
+
5
+ .text-align-left {
6
+ text-align: left;
7
+ }
8
+
9
+ .text-align-right {
10
+ text-align: right;
11
+ }
12
+
13
+ .bold-text {
14
+ font-weight: bold;
15
+ }
16
+
17
+ .paragraph-no-margins-around > p:first-of-type {
18
+ margin-top: 0;
19
+ }
20
+
21
+ .paragraph-no-margins-around > p:last-of-type {
22
+ margin-bottom: 0;
23
+ }
24
+
25
+ .no-margins {
26
+ margin: 0;
27
+ }
28
+
29
+ .flex-row.vertically-center-items {
30
+ align-items: center;
31
+ }
32
+
33
+ .flex-row.vertically-baseline-items {
34
+ align-items: baseline;
35
+ }
36
+
37
+ .flex-row.vertically-end-items,
38
+ .flex-row.vertically-bottom-items {
39
+ align-items: flex-end;
40
+ }
41
+
42
+
43
+ .flex-no-resize {
44
+ flex-grow: 0;
45
+ flex-shrink: 0;
46
+ }
47
+
48
+ .flex-resize {
49
+ flex-grow: 1;
50
+ flex-shrink: 1;
51
+ }
52
+
53
+ .flex-wrap {
54
+ flex-wrap: wrap;
55
+ }
56
+
57
+ .full-size {
58
+ width: 100%;
59
+ height: 100%;
60
+ }
61
+
62
+ .full-width {
63
+ width: 100%;
64
+ }
65
+
66
+ .full-height {
67
+ height: 100%;
68
+ }
69
+
70
+ .absolute-container {
71
+ position: relative;
72
+ }
73
+ .position-relative {
74
+ position: relative;
75
+ }
76
+ .position-absolute {
77
+ position: absolute;
78
+ }
79
+ .absolute-overlay {
80
+ position: absolute;
81
+ left: 0;
82
+ top: 0;
83
+ right: 0;
84
+ bottom: 0;
85
+ }
86
+
87
+ .absolute-for-transform {
88
+ position: absolute;
89
+ left: 0;
90
+ top: 0;
91
+ }
92
+
93
+ .top-left {
94
+ left: 0;
95
+ top: 0;
96
+ }
97
+
98
+ .top-right {
99
+ right: 0;
100
+ top: 0;
101
+ }
102
+
103
+ .bottom-left {
104
+ left: 0;
105
+ bottom: 0;
106
+ }
107
+
108
+ .bottom-right {
109
+ right: 0;
110
+ bottom: 0;
111
+ }
112
+
113
+ .transform-y50-percent-overlap {
114
+ transform: translateY(-50%);
115
+ }
116
+
117
+ .centered-tip-text {
118
+ position: absolute;
119
+ left: 50%;
120
+ transform: translate(-50%, 2px);
121
+ font-size: 10px;
122
+ width: 200px;
123
+ text-align: center;
124
+ }
125
+
126
+ .overflow-hidden {
127
+ overflow: hidden;
128
+ }
129
+
130
+ .flex-row {
131
+ display: flex;
132
+ }
133
+
134
+ .flex-column {
135
+ display: flex;
136
+ flex-direction: column;
137
+ }
138
+
139
+ .flex-row.justify-center {
140
+ justify-content: center;
141
+ }
142
+
143
+ .flex-row.justify-between {
144
+ justify-content: space-between;
145
+ }
146
+
147
+ .cursor-pointer {
148
+ cursor: pointer;
149
+ }
150
+
151
+ .cursor-grab {
152
+ cursor: grab;
153
+ }
154
+
155
+ .display-block {
156
+ display: block;
157
+ }
158
+
159
+ .display-none {
160
+ display: none;
161
+ }
162
+
163
+ .image.background-cover {
164
+ background-position: center center;
165
+ background-repeat: no-repeat;
166
+ background-size: cover;
167
+ }
168
+
169
+ .image.background-contain {
170
+ background-position: center center;
171
+ background-repeat: no-repeat;
172
+ background-size: contain;
173
+ }
174
+
175
+ .image.background-center {
176
+ background-position: center center;
177
+ background-repeat: no-repeat;
178
+ }
179
+
180
+ .image.background-top-left {
181
+ background-position: top left;
182
+ background-repeat: no-repeat;
183
+ }
184
+
185
+ .image.background-center-left {
186
+ background-position: center left;
187
+ background-repeat: no-repeat;
188
+ }
189
+
190
+ .border-box-sizing {
191
+ box-sizing: border-box;
192
+ }
193
+
194
+ @media (prefers-reduced-motion: no-preference) {
195
+ .color-fade {
196
+ transition: color 0.3s ease-out;
197
+ }
198
+ }
199
+
200
+ .no-pointer-events {
201
+ pointer-events: none;
202
+ }
203
+
204
+ .all-pointer-events {
205
+ pointer-events: all;
206
+ }
207
+
208
+ .integrated-field {
209
+ box-sizing: border-box;
210
+ border: none;
211
+ display: block;
212
+ }
213
+
214
+ .centered-cell-holder {
215
+ display: flex;
216
+ justify-content: center;
217
+ align-items: center;
218
+ }
219
+
220
+ button.skip-default {
221
+ appearance: none;
222
+ border: none;
223
+ padding: 0;
224
+ text-align: inherit;
225
+ background: none;
226
+ color: inherit;
227
+ display: block;
228
+ font-size: inherit;
229
+ line-height: inherit;
230
+ font-family: inherit;
231
+ }
232
+
233
+ .no-opacity {
234
+ opacity: 0;
235
+ }
236
+
237
+ .clear-both {
238
+ clear: both;
239
+ }
240
+
241
+ .custom-styled-link {
242
+ color: inherit;
243
+ text-decoration: none;
244
+ }
245
+
246
+ .no-line-height {
247
+ line-height: 1;
248
+ }
249
+
250
+ .object-fit-cover {
251
+ object-fit: cover;
252
+ }
253
+
254
+ .full-rounded {
255
+ border-radius: 9999px;
256
+ }
@@ -0,0 +1,3 @@
1
+ :root {
2
+
3
+ }
@@ -32,16 +32,19 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
32
32
  if(!typeItem) {
33
33
  typeItem = new Dbm.repository.Item();
34
34
  typeItem.setValue("objects", []);
35
+ typeItem.setValue("relations", []);
35
36
  currentRelationsItem.setValue(currentType, typeItem);
36
37
  }
37
38
 
38
- if(this._isRelationValid(currentRelationData["startAt"], currentRelationData["endAt"])) {
39
- let newArray = [].concat(typeItem["objects"]);
40
- newArray.push(Dbm.getInstance().repository.getItem(currentRelationData["id"]));
41
- typeItem["objects"] = newArray;
42
- //METODO: set up relations
39
+ let relation = Dbm.getRepositoryItem(currentRelationData["relationId"]);
40
+ if(typeItem.relations.indexOf(relation) === -1) {
41
+ let linkedItem = Dbm.getRepositoryItem(currentRelationData["id"]);
42
+ //METODO: add data to relation
43
+ if(this._isRelationValid(currentRelationData["startAt"], currentRelationData["endAt"])) {
44
+ typeItem.addToArray("objects", linkedItem);
45
+ typeItem.addToArray("relations", relation);
46
+ }
43
47
  }
44
-
45
48
  }
46
49
  }
47
50
 
@@ -62,14 +65,18 @@ export default class Relations extends Dbm.graphapi.webclient.decode.DecodeBaseO
62
65
  if(!typeItem) {
63
66
  typeItem = new Dbm.repository.Item();
64
67
  typeItem.setValue("objects", []);
68
+ typeItem.setValue("relations", []);
65
69
  currentRelationsItem.setValue(currentType, typeItem);
66
70
  }
67
71
 
68
- if(this._isRelationValid(currentRelationData["startAt"], currentRelationData["endAt"])) {
69
- let newArray = [].concat(typeItem["objects"]);
70
- newArray.push(Dbm.getInstance().repository.getItem(currentRelationData["id"]));
71
- typeItem["objects"] = newArray;
72
- //METODO: set up relations
72
+ let relation = Dbm.getRepositoryItem(currentRelationData["relationId"]);
73
+ if(typeItem.relations.indexOf(relation) === -1) {
74
+ let linkedItem = Dbm.getRepositoryItem(currentRelationData["id"]);
75
+ //METODO: add data to relation
76
+ if(this._isRelationValid(currentRelationData["startAt"], currentRelationData["endAt"])) {
77
+ typeItem.addToArray("objects", linkedItem);
78
+ typeItem.addToArray("relations", relation);
79
+ }
73
80
  }
74
81
  }
75
82
  }
@@ -0,0 +1,65 @@
1
+ import Dbm from "../index.js";
2
+
3
+ export default class JsonLoader extends Dbm.core.BaseObject {
4
+
5
+ _construct() {
6
+
7
+ super._construct();
8
+
9
+ this.item.setValue("url", null);
10
+ this.item.setValue("element", null);
11
+
12
+ this.item.setValue("width", 0);
13
+ this.item.setValue("height", 0);
14
+
15
+ this._callback_loadedBound = this._callback_loaded.bind(this);
16
+ this._callback_loadingErrorBound = this._callback_loadingError.bind(this);
17
+
18
+ this.item.setValue("status", Dbm.loading.LoadingStatus.NOT_STARTED);
19
+ }
20
+
21
+ get completed() {
22
+ let status = this.item.status;
23
+ return (status === Dbm.loading.LoadingStatus.LOADED || status === Dbm.loading.LoadingStatus.ERROR);
24
+ }
25
+
26
+ setUrl(aUrl) {
27
+ this.item.url = aUrl;
28
+
29
+ return this;
30
+ }
31
+
32
+ _callback_loaded(aEvent) {
33
+ console.log(aEvent, this.item.element);
34
+
35
+ this.item.width = this.item.element.naturalWidth;
36
+ this.item.height = this.item.element.naturalHeight;
37
+
38
+ this.item.status = Dbm.loading.LoadingStatus.LOADED;
39
+ }
40
+
41
+ _callback_loadingError(aEvent) {
42
+ console.log(aEvent);
43
+
44
+ this.item.status = Dbm.loading.LoadingStatus.ERROR;
45
+ }
46
+
47
+ load() {
48
+
49
+ if(this.item.status !== Dbm.loading.LoadingStatus.NOT_STARTED) {
50
+ return this;
51
+ }
52
+
53
+ let image = new Image();
54
+ image.addEventListener("load", this._callback_loadedBound);
55
+ image.addEventListener("error", this._callback_loadingErrorBound);
56
+
57
+ this.item.element = image;
58
+
59
+ this.item.status = Dbm.loading.LoadingStatus.LOADING;
60
+ image.src = this.item.url;
61
+ console.log(image);
62
+
63
+ return this;
64
+ }
65
+ }