@cocreate/organizations 1.15.19 → 1.16.0
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/CHANGELOG.md +20 -0
- package/CoCreate.config.js +2 -2
- package/demo/CoCreate-createUser.html +16 -16
- package/demo/index.html +25 -25
- package/demo/industries/industries.html +11 -11
- package/demo/industries/industry-datatable.html +33 -33
- package/demo/industries/industry-documents-datatable.1.html +29 -28
- package/docs/index.html +27 -27
- package/package.json +5 -6
- package/src/client.js +133 -41
- package/src/server.js +12 -11
- package/webpack.config.js +79 -73
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [1.16.0](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.15.19...v1.16.0) (2023-08-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* crud attributes renamed ([c8ad6c1](https://github.com/CoCreate-app/CoCreate-organizations/commit/c8ad6c1a2045f2a24ced0dba608b06a5f89fda19))
|
|
7
|
+
* replace -target -selector ([9b52d00](https://github.com/CoCreate-app/CoCreate-organizations/commit/9b52d00874b7da439be63e5a787d79d7162f2095))
|
|
8
|
+
* updated actions callback data object ([0a98309](https://github.com/CoCreate-app/CoCreate-organizations/commit/0a983090903d966909f22e5969aaa064fb33e8f1))
|
|
9
|
+
* updated fetch-limit to filter-limit ([c3b4414](https://github.com/CoCreate-app/CoCreate-organizations/commit/c3b44140a5902f757b38566158936ab25a16369e))
|
|
10
|
+
* webpack.config and package.json make use of mode=production instead of process.env ([c35d271](https://github.com/CoCreate-app/CoCreate-organizations/commit/c35d271cc9e78fcc5c2b3cadf8b6115cf75c694f))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **client.js:** Add generateDB and create functions ([179b6dd](https://github.com/CoCreate-app/CoCreate-organizations/commit/179b6dd30b12b6c0a34dcb88d6942c44f9c53dd9))
|
|
16
|
+
* name attribute and variable renamed to key ([2af9415](https://github.com/CoCreate-app/CoCreate-organizations/commit/2af9415027d35529232f08c31da0c25535c552c2))
|
|
17
|
+
* renamed CRUD attributes and params ([5e616bf](https://github.com/CoCreate-app/CoCreate-organizations/commit/5e616bf1895bd711afe91272e8670007a3a63560))
|
|
18
|
+
* Update package.json - changed "@cocreate/form" dependency to "@cocreate/elements" ([bbfa9c4](https://github.com/CoCreate-app/CoCreate-organizations/commit/bbfa9c4b90f9722767b6fa41253bcc522df322d9))
|
|
19
|
+
* update template_id to render-selector attribute. update filter attributes to filter selector-attributes ([f180ae3](https://github.com/CoCreate-app/CoCreate-organizations/commit/f180ae38c037945fc8f7d6dbf6d877d503681f51))
|
|
20
|
+
|
|
1
21
|
## [1.15.19](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.15.18...v1.15.19) (2023-06-14)
|
|
2
22
|
|
|
3
23
|
|
package/CoCreate.config.js
CHANGED
|
@@ -14,34 +14,34 @@
|
|
|
14
14
|
<body class="padding:20px">
|
|
15
15
|
<form>
|
|
16
16
|
<input
|
|
17
|
-
|
|
17
|
+
array="organizations"
|
|
18
18
|
class="floating-label"
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
key="name"
|
|
20
|
+
object=""
|
|
21
21
|
placeholder="org name" />
|
|
22
22
|
<input
|
|
23
|
-
|
|
23
|
+
array="users"
|
|
24
24
|
class="floating-label"
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
key="name"
|
|
26
|
+
object=""
|
|
27
27
|
placeholder="user name" />
|
|
28
28
|
|
|
29
29
|
<input
|
|
30
30
|
type="hidden"
|
|
31
31
|
id="org_id"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
array="organizations"
|
|
33
|
+
object=""
|
|
34
|
+
key="_id"
|
|
35
35
|
placeholder="OrganizationId"
|
|
36
36
|
readonly />
|
|
37
37
|
|
|
38
|
-
<!-- User_id will be used to copy user
|
|
38
|
+
<!-- User_id will be used to copy user object from current organizion and insert orgdb defined above-->
|
|
39
39
|
<input
|
|
40
40
|
type="hidden"
|
|
41
41
|
id="user_id"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
array="users"
|
|
43
|
+
object=""
|
|
44
|
+
key="_id"
|
|
45
45
|
placeholder="UserId"
|
|
46
46
|
readonly />
|
|
47
47
|
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
<input
|
|
50
50
|
type="hidden"
|
|
51
51
|
id="key"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
array="organizations"
|
|
53
|
+
object=""
|
|
54
|
+
key="key"
|
|
55
55
|
placeholder="API Key"
|
|
56
56
|
uuid="32"
|
|
57
57
|
readonly />
|
package/demo/index.html
CHANGED
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
<input
|
|
39
39
|
type="text"
|
|
40
40
|
id="org-name"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
array="organizations"
|
|
42
|
+
object=""
|
|
43
|
+
key="name"
|
|
44
44
|
placeholder="Organization Name"
|
|
45
45
|
class="floating-label" />
|
|
46
46
|
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
|
|
49
49
|
<input
|
|
50
50
|
type="text"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
array="users"
|
|
52
|
+
object=""
|
|
53
|
+
key="name"
|
|
54
54
|
placeholder="User Name"
|
|
55
55
|
class="floating-label" />
|
|
56
56
|
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
<input
|
|
59
59
|
type="hidden"
|
|
60
60
|
id="org_id"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
array="organizations"
|
|
62
|
+
object=""
|
|
63
|
+
key="_id"
|
|
64
64
|
value=""
|
|
65
65
|
placeholder="OrganizationId" />
|
|
66
66
|
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
<input
|
|
69
69
|
type="hidden"
|
|
70
70
|
id="key"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
array="organizations"
|
|
72
|
+
object=""
|
|
73
|
+
key="key"
|
|
74
74
|
placeholder="API Key"
|
|
75
75
|
uuid="32"
|
|
76
76
|
readonly />
|
|
@@ -81,26 +81,26 @@
|
|
|
81
81
|
<cocreate-select
|
|
82
82
|
sortable
|
|
83
83
|
class="floating-label"
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
array="organizations"
|
|
85
|
+
key="industry"
|
|
86
86
|
placeholder="Industry"
|
|
87
87
|
realtime="false"
|
|
88
88
|
save="false">
|
|
89
89
|
<input
|
|
90
90
|
placeholder="Search"
|
|
91
|
-
|
|
91
|
+
filter-parent="[array]" />
|
|
92
92
|
<ul
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
array="industries"
|
|
94
|
+
render-selector="[template]"
|
|
95
95
|
class="options overflow:auto">
|
|
96
96
|
<li
|
|
97
97
|
class="template option"
|
|
98
|
-
|
|
99
|
-
value="{{
|
|
98
|
+
template
|
|
99
|
+
value="{{object._id}}">
|
|
100
100
|
<h4
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
array="industries"
|
|
102
|
+
object="{{object._id}}"
|
|
103
|
+
key="name">
|
|
104
104
|
industry name
|
|
105
105
|
</h4>
|
|
106
106
|
</li>
|
|
@@ -114,9 +114,9 @@
|
|
|
114
114
|
Register
|
|
115
115
|
<a
|
|
116
116
|
href="index.html"
|
|
117
|
-
pass-
|
|
118
|
-
pass-
|
|
119
|
-
pass-
|
|
117
|
+
pass-array="modules"
|
|
118
|
+
pass-object=""
|
|
119
|
+
pass-key="html"
|
|
120
120
|
pass_to="render"></a>
|
|
121
121
|
</button>
|
|
122
122
|
</div>
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
<a
|
|
59
59
|
actions="pass, openModal"
|
|
60
60
|
modal-src="render.html"
|
|
61
|
-
pass-
|
|
62
|
-
pass-
|
|
61
|
+
pass-array="modules"
|
|
62
|
+
pass-object=""
|
|
63
63
|
pass_to="builder"
|
|
64
64
|
modal-width="100%"
|
|
65
65
|
pass_id="render">
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
class="display:flex height:18px fill:#505050"
|
|
68
68
|
src="/assets/svg/palette.svg"></i>
|
|
69
69
|
<div
|
|
70
|
-
pass-
|
|
71
|
-
pass-
|
|
70
|
+
pass-array="modules"
|
|
71
|
+
pass-object=""
|
|
72
72
|
pass_to="render"
|
|
73
73
|
class="sessionBuilderUI_Id"></div>
|
|
74
74
|
</a>
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
<a
|
|
78
78
|
<a
|
|
79
79
|
actions="deleteDocument, closeModal"
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
array="modules"
|
|
81
|
+
object=""
|
|
82
82
|
pass_id="form-fields"
|
|
83
83
|
class="btn-modal-close">
|
|
84
84
|
<i
|
|
@@ -90,19 +90,19 @@
|
|
|
90
90
|
</div>
|
|
91
91
|
|
|
92
92
|
<div content_id="content">
|
|
93
|
-
<form
|
|
93
|
+
<form array="industries" class="padding:15px" realtime="false">
|
|
94
94
|
<h3>Indusrty Creator</h3>
|
|
95
95
|
<input
|
|
96
|
-
|
|
96
|
+
object=""
|
|
97
97
|
pass_id="form-fields"
|
|
98
|
-
|
|
98
|
+
key="name"
|
|
99
99
|
placeholder="Industry Name"
|
|
100
100
|
class="floating-label" />
|
|
101
101
|
|
|
102
102
|
<textarea
|
|
103
|
-
|
|
103
|
+
object=""
|
|
104
104
|
pass_id="form-fields"
|
|
105
|
-
|
|
105
|
+
key="description"
|
|
106
106
|
placeholder="Description"
|
|
107
107
|
class="floating-label"></textarea>
|
|
108
108
|
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
<input
|
|
22
22
|
type="text"
|
|
23
23
|
class="floating-label"
|
|
24
|
-
filter-
|
|
25
|
-
|
|
24
|
+
filter-key="name"
|
|
25
|
+
filter-closest="table; tbody"
|
|
26
26
|
placeholder="Industry Name" />
|
|
27
27
|
<span
|
|
28
28
|
class="position:absolute bottom:20px right:20px float:right z-index:6">
|
|
29
29
|
<!-- need a solution to update toggle value="desc|asc" and define and upadte icons... show hide works great but to much html and orderby only has 2 values -->
|
|
30
30
|
<a
|
|
31
|
-
filter-sort-
|
|
31
|
+
filter-sort-key="name"
|
|
32
32
|
filter-sort-toggle
|
|
33
|
-
|
|
33
|
+
filter-closest="table; tbody">
|
|
34
34
|
<i></i>
|
|
35
35
|
</a>
|
|
36
36
|
</span>
|
|
@@ -40,63 +40,63 @@
|
|
|
40
40
|
<input
|
|
41
41
|
type="text"
|
|
42
42
|
class="floating-label"
|
|
43
|
-
filter-
|
|
44
|
-
|
|
43
|
+
filter-key="_id"
|
|
44
|
+
filter-closest="table; tbody"
|
|
45
45
|
placeholder="Industry_id" />
|
|
46
46
|
<span
|
|
47
47
|
class="position:absolute bottom:20px right:20px float:right z-index:6">
|
|
48
48
|
<a
|
|
49
|
-
filter-sort-
|
|
49
|
+
filter-sort-key="_id"
|
|
50
50
|
value=""
|
|
51
51
|
filter-sort-direction="asc"
|
|
52
52
|
click-value="desc, asc"
|
|
53
53
|
click-attribute="filter-sort-direction"
|
|
54
|
-
|
|
54
|
+
filter-closest="table; tbody">
|
|
55
55
|
</a>
|
|
56
56
|
</span>
|
|
57
57
|
</td>
|
|
58
58
|
</tr>
|
|
59
59
|
|
|
60
60
|
<tbody
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
array="industries"
|
|
62
|
+
key=""
|
|
63
63
|
filter-value=""
|
|
64
|
-
filter-sort-
|
|
64
|
+
filter-sort-key="name"
|
|
65
65
|
filter-sort-direction="asc"
|
|
66
|
-
|
|
66
|
+
render-selector="[template]">
|
|
67
67
|
<tr
|
|
68
|
-
template
|
|
68
|
+
template
|
|
69
69
|
class="background:gainsboro:hover border-bottom:1px_solid_darkgray">
|
|
70
70
|
<td class="padding:10px">
|
|
71
71
|
<div class="min-width:200px">
|
|
72
72
|
<div class="icon-wrapper">
|
|
73
|
-
<span pass_id="me1234"
|
|
73
|
+
<span pass_id="me1234" key="icon"></span>
|
|
74
74
|
</div>
|
|
75
75
|
<div>
|
|
76
76
|
<a
|
|
77
77
|
actions="pass, openModal"
|
|
78
78
|
modal-src="render.html"
|
|
79
|
-
pass-
|
|
80
|
-
pass-
|
|
79
|
+
pass-array="module_activity"
|
|
80
|
+
pass-object="{{object._id}}"
|
|
81
81
|
pass_to="form-fields"
|
|
82
82
|
modal-width="320px"
|
|
83
83
|
modal-color="#229954">
|
|
84
84
|
<h4
|
|
85
|
-
|
|
86
|
-
pass-
|
|
87
|
-
|
|
85
|
+
array="{{object.array}}"
|
|
86
|
+
pass-object="{{object._id}}"
|
|
87
|
+
key="name">
|
|
88
88
|
Name
|
|
89
89
|
</h4>
|
|
90
90
|
<div
|
|
91
|
-
pass-
|
|
92
|
-
pass-
|
|
91
|
+
pass-array="modules"
|
|
92
|
+
pass-object=""
|
|
93
93
|
pass_to="render"
|
|
94
94
|
pass_id="render"></div>
|
|
95
95
|
</a>
|
|
96
96
|
<h5
|
|
97
|
-
|
|
98
|
-
pass-
|
|
99
|
-
|
|
97
|
+
array="{{object.array}}"
|
|
98
|
+
pass-object="{{object._id}}"
|
|
99
|
+
key="description"></h5>
|
|
100
100
|
</div>
|
|
101
101
|
</div>
|
|
102
102
|
</td>
|
|
@@ -104,20 +104,20 @@
|
|
|
104
104
|
<a
|
|
105
105
|
actions="pass, openModal"
|
|
106
106
|
modal-src="render.html"
|
|
107
|
-
pass-
|
|
108
|
-
pass-
|
|
107
|
+
pass-object=""
|
|
108
|
+
pass-array="module_activity"
|
|
109
109
|
pass_to="form-fields"
|
|
110
110
|
modal-width="320px"
|
|
111
111
|
modal-color="#229954">
|
|
112
112
|
<b
|
|
113
|
-
|
|
114
|
-
pass-
|
|
115
|
-
|
|
113
|
+
array="{{object.array}}"
|
|
114
|
+
pass-object="{{object._id}}"
|
|
115
|
+
key="_id"
|
|
116
116
|
>Industry Id</b
|
|
117
117
|
>
|
|
118
118
|
<div
|
|
119
|
-
pass-
|
|
120
|
-
pass-
|
|
119
|
+
pass-array="module_activity"
|
|
120
|
+
pass-object=""
|
|
121
121
|
pass_to="render"></div>
|
|
122
122
|
</a>
|
|
123
123
|
</td>
|
|
@@ -129,8 +129,8 @@
|
|
|
129
129
|
<button
|
|
130
130
|
actions="pass, openModal"
|
|
131
131
|
modal-src="render.html"
|
|
132
|
-
pass-
|
|
133
|
-
pass-
|
|
132
|
+
pass-array="modules"
|
|
133
|
+
pass-object=""
|
|
134
134
|
pass_to="render"
|
|
135
135
|
modal-width="320px"
|
|
136
136
|
modal-height="100%"
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
<input
|
|
22
22
|
type="text"
|
|
23
23
|
class="floating-label"
|
|
24
|
-
filter-
|
|
25
|
-
|
|
24
|
+
filter-key="name"
|
|
25
|
+
filter-closest="table; tbody"
|
|
26
26
|
placeholder="Industry Name" />
|
|
27
27
|
<span
|
|
28
28
|
class="position:absolute bottom:20px right:20px float:right z-index:6">
|
|
29
29
|
<!-- need a solution to update toggle value="desc|asc" and define and upadte icons... show hide works great but to much html and orderby only has 2 values -->
|
|
30
30
|
<a
|
|
31
|
-
filter-sort-
|
|
31
|
+
filter-sort-key="name"
|
|
32
32
|
filter-sort-toggle
|
|
33
|
-
|
|
33
|
+
filter-closest="table; tbody">
|
|
34
34
|
<i></i>
|
|
35
35
|
</a>
|
|
36
36
|
</span>
|
|
@@ -40,59 +40,60 @@
|
|
|
40
40
|
<input
|
|
41
41
|
type="text"
|
|
42
42
|
class="floating-label"
|
|
43
|
-
filter-
|
|
44
|
-
|
|
43
|
+
filter-key="_id"
|
|
44
|
+
filter-closest="table; tbody"
|
|
45
45
|
placeholder="Industry_id" />
|
|
46
46
|
<span
|
|
47
47
|
class="position:absolute bottom:20px right:20px float:right z-index:6">
|
|
48
48
|
<a
|
|
49
|
-
filter-sort-
|
|
49
|
+
filter-sort-key="_id"
|
|
50
50
|
value=""
|
|
51
51
|
filter-sort-direction="asc"
|
|
52
52
|
click-value="desc, asc"
|
|
53
53
|
click-attribute="filter-sort-direction"
|
|
54
|
-
|
|
54
|
+
filter-closest="table; tbody">
|
|
55
55
|
</a>
|
|
56
56
|
</span>
|
|
57
57
|
</td>
|
|
58
58
|
</tr>
|
|
59
59
|
|
|
60
60
|
<tbody
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
array="industry_documents"
|
|
62
|
+
key=""
|
|
63
63
|
filter-value=""
|
|
64
64
|
filter-value-type="or"
|
|
65
|
-
|
|
66
|
-
filter-sort-
|
|
65
|
+
filter-limit=""
|
|
66
|
+
filter-sort-key="name"
|
|
67
67
|
filter-sort-direction="asc"
|
|
68
|
-
|
|
68
|
+
render-selector="[template]"
|
|
69
69
|
pass_to="me1234">
|
|
70
70
|
<tr
|
|
71
|
-
|
|
71
|
+
template
|
|
72
|
+
class="background:gainsboro:hover border-bottom:1px_solid_darkgray">
|
|
72
73
|
<td class="padding:10px">
|
|
73
74
|
<div class="min-width:200px">
|
|
74
75
|
<div class="icon-wrapper">
|
|
75
|
-
<span pass_id="me1234"
|
|
76
|
+
<span pass_id="me1234" key="icon"></span>
|
|
76
77
|
</div>
|
|
77
78
|
<div>
|
|
78
79
|
<a
|
|
79
80
|
actions="pass, openModal"
|
|
80
81
|
modal-src="render.html"
|
|
81
|
-
pass-
|
|
82
|
-
pass-
|
|
82
|
+
pass-array="module_activity"
|
|
83
|
+
pass-object=""
|
|
83
84
|
pass_to="form-fields"
|
|
84
85
|
modal-width="320px"
|
|
85
86
|
modal-color="#229954">
|
|
86
|
-
<h4 pass_id="me1234"
|
|
87
|
+
<h4 pass_id="me1234" key="name">
|
|
87
88
|
Name
|
|
88
89
|
</h4>
|
|
89
90
|
<div
|
|
90
|
-
pass-
|
|
91
|
-
pass-
|
|
91
|
+
pass-array="modules"
|
|
92
|
+
pass-object=""
|
|
92
93
|
pass_to="render"
|
|
93
94
|
pass_id="render"></div>
|
|
94
95
|
</a>
|
|
95
|
-
<h5
|
|
96
|
+
<h5 key="description"></h5>
|
|
96
97
|
</div>
|
|
97
98
|
</div>
|
|
98
99
|
</td>
|
|
@@ -100,15 +101,15 @@
|
|
|
100
101
|
<a
|
|
101
102
|
actions="pass, openModal"
|
|
102
103
|
modal-src="render.html"
|
|
103
|
-
pass-
|
|
104
|
-
pass-
|
|
104
|
+
pass-object=""
|
|
105
|
+
pass-array="module_activity"
|
|
105
106
|
pass_to="form-fields"
|
|
106
107
|
modal-width="320px"
|
|
107
108
|
modal-color="#229954">
|
|
108
|
-
<b pass_id="me1234"
|
|
109
|
+
<b pass_id="me1234" key="_id">Document Id</b>
|
|
109
110
|
<div
|
|
110
|
-
pass-
|
|
111
|
-
pass-
|
|
111
|
+
pass-array="module_activity"
|
|
112
|
+
pass-object=""
|
|
112
113
|
pass_to="render"></div>
|
|
113
114
|
</a>
|
|
114
115
|
</td>
|
|
@@ -120,8 +121,8 @@
|
|
|
120
121
|
<button
|
|
121
122
|
actions="pass, openModal"
|
|
122
123
|
modal-src="render.html"
|
|
123
|
-
pass-
|
|
124
|
-
pass-
|
|
124
|
+
pass-array="modules"
|
|
125
|
+
pass-object=""
|
|
125
126
|
pass_to="render"
|
|
126
127
|
modal-width="320px"
|
|
127
128
|
modal-height="100%"
|
package/docs/index.html
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
sizes="32x32"
|
|
12
12
|
href="https://cocreate.app/images/favicon.ico" />
|
|
13
13
|
<meta
|
|
14
|
-
|
|
14
|
+
key="description"
|
|
15
15
|
content="A simple HTML5 and pure javascript component. Easy configuration using HTML5 attributes or Javscript api and highly styleable." />
|
|
16
16
|
<meta
|
|
17
|
-
|
|
17
|
+
key="keywords"
|
|
18
18
|
content="helper classes, utility classes, css framework, css library, inline style classes" />
|
|
19
19
|
<meta name="robots" content="index,follow" />
|
|
20
20
|
<meta
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
<link
|
|
30
30
|
rel="stylesheet"
|
|
31
31
|
href="https://ws.cocreate.app/docs.css"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
array="apples"
|
|
33
|
+
object="6069ff5042ef8ff5175a5c8d"
|
|
34
|
+
key="css"
|
|
35
35
|
type="text/css" />
|
|
36
36
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
37
37
|
</head>
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
scroll="sticky-nav,hide-nav"
|
|
43
43
|
scroll-up="10"
|
|
44
44
|
scroll-down="10"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
array="files"
|
|
46
|
+
object="60395ef42b3ac232657040fd"
|
|
47
|
+
key="src"></nav>
|
|
48
48
|
<sidenav
|
|
49
49
|
id="menuL"
|
|
50
50
|
class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
|
|
51
51
|
resizable
|
|
52
|
-
resize-
|
|
52
|
+
resize-selector="[content_id='content']"
|
|
53
53
|
resize-property="margin-left"
|
|
54
54
|
resize-value="width">
|
|
55
55
|
<menu
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
array="files"
|
|
57
|
+
object="603717b07de7fb350ae9fec8"
|
|
58
|
+
key="src"></menu>
|
|
59
59
|
<div resize="right"></div>
|
|
60
60
|
</sidenav>
|
|
61
61
|
<main
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
share-width="700"
|
|
79
79
|
share-media="https://cdn.cocreate.app/docs/organizations.png"
|
|
80
80
|
hover="display:block!important"
|
|
81
|
-
hover-
|
|
81
|
+
hover-selector=".social-networks">
|
|
82
82
|
<div class="display:none social-networks">
|
|
83
83
|
<a
|
|
84
84
|
class="margin-right:15px"
|
|
@@ -137,11 +137,11 @@
|
|
|
137
137
|
class="border-bottom:1px_solid_lightgrey"
|
|
138
138
|
scroll
|
|
139
139
|
scroll-intersect="color:dodgerblue"
|
|
140
|
-
scroll-
|
|
140
|
+
scroll-selector="#organizations-install-section">
|
|
141
141
|
<span
|
|
142
142
|
class="display:flex align-items:center width:fit-content"
|
|
143
143
|
hover="display:block!important"
|
|
144
|
-
hover-
|
|
144
|
+
hover-selector="[href='#organizations-install']">
|
|
145
145
|
<h2 class="padding:5px_0px">Install</h2>
|
|
146
146
|
<a
|
|
147
147
|
class="margin-left:10px display:none"
|
|
@@ -164,11 +164,11 @@
|
|
|
164
164
|
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
165
165
|
scroll
|
|
166
166
|
scroll-intersect="color:dodgerblue"
|
|
167
|
-
scroll-
|
|
167
|
+
scroll-selector="#organizations-usage-section">
|
|
168
168
|
<span
|
|
169
169
|
class="display:flex align-items:center width:fit-content"
|
|
170
170
|
hover="display:block!important"
|
|
171
|
-
hover-
|
|
171
|
+
hover-selector="[href='#organizations-usage']">
|
|
172
172
|
<h2 class="padding:5px_0px">Usage</h2>
|
|
173
173
|
<a
|
|
174
174
|
class="margin-left:10px display:none"
|
|
@@ -189,11 +189,11 @@
|
|
|
189
189
|
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
190
190
|
scroll
|
|
191
191
|
scroll-intersect="color:dodgerblue"
|
|
192
|
-
scroll-
|
|
192
|
+
scroll-selector="#organizations-attributes-section">
|
|
193
193
|
<span
|
|
194
194
|
class="display:flex align-items:center width:fit-content"
|
|
195
195
|
hover="display:block!important"
|
|
196
|
-
hover-
|
|
196
|
+
hover-selector="[href='#organizations-attributes']">
|
|
197
197
|
<h2 class="padding:5px_0px">Attributes</h2>
|
|
198
198
|
<a
|
|
199
199
|
class="margin-left:10px display:none"
|
|
@@ -242,11 +242,11 @@
|
|
|
242
242
|
class="border-bottom:1px_solid_lightgrey"
|
|
243
243
|
scroll
|
|
244
244
|
scroll-intersect="color:dodgerblue"
|
|
245
|
-
scroll-
|
|
245
|
+
scroll-selector="#organizations-demo-section">
|
|
246
246
|
<span
|
|
247
247
|
class="display:flex align-items:center width:fit-content"
|
|
248
248
|
hover="display:block!important"
|
|
249
|
-
hover-
|
|
249
|
+
hover-selector="[href='#organizations-demo']">
|
|
250
250
|
<h2 class="padding:5px_0px">Demo</h2>
|
|
251
251
|
<a
|
|
252
252
|
class="margin-left:10px display:none"
|
|
@@ -270,9 +270,9 @@
|
|
|
270
270
|
<textarea
|
|
271
271
|
type="code"
|
|
272
272
|
lang="html"
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
array="demos"
|
|
274
|
+
object=""
|
|
275
|
+
key="demo"
|
|
276
276
|
save="false"
|
|
277
277
|
id="demo"
|
|
278
278
|
class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
show="#eye-slash"
|
|
296
296
|
hide="#eye, #demo-preview"
|
|
297
297
|
toggle="code-height"
|
|
298
|
-
toggle-
|
|
298
|
+
toggle-selector="#demo-code"
|
|
299
299
|
><i
|
|
300
300
|
class="height:18px fill:#505050"
|
|
301
301
|
src="/assets/svg/eye.svg"></i
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
show="#eye, #demo-preview"
|
|
308
308
|
hide="#eye-slash"
|
|
309
309
|
toggle="code-height"
|
|
310
|
-
toggle-
|
|
310
|
+
toggle-selector="#demo-code"
|
|
311
311
|
><i
|
|
312
312
|
class="height:20px fill:#505050"
|
|
313
313
|
src="/assets/svg/eye-slash.svg"></i
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
<a
|
|
335
335
|
class="margin-right:5px"
|
|
336
336
|
fullscreen
|
|
337
|
-
fullscreen-
|
|
337
|
+
fullscreen-selector="#playground"></a>
|
|
338
338
|
</div>
|
|
339
339
|
</div>
|
|
340
340
|
<!-- End SandBox -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/organizations",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "A simple organizations component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"organizations",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"start": "npx webpack --config webpack.config.js",
|
|
28
|
-
"build": "
|
|
28
|
+
"build": "npx webpack --mode=production --config webpack.config.js",
|
|
29
29
|
"dev": "npx webpack --config webpack.config.js --watch",
|
|
30
30
|
"postinstall": "node -e \"const { execSync } = require('child_process'); try { execSync('coc --version', { stdio: 'ignore' }); } catch (error) { try { execSync('npm install -g @cocreate/cli', { stdio: 'inherit' }); console.log('Installed \"@cocreate/cli\" globally.'); } catch (error) { console.error('Failed to install \"@cocreate/cli\" globally:', error); } }\""
|
|
31
31
|
},
|
|
@@ -58,9 +58,8 @@
|
|
|
58
58
|
"webpack-log": "^3.0.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@cocreate/actions": "^1.8.
|
|
62
|
-
"@cocreate/crud-client": "^1.21.
|
|
63
|
-
"@cocreate/
|
|
64
|
-
"@cocreate/indexeddb": "^1.10.19"
|
|
61
|
+
"@cocreate/actions": "^1.8.32",
|
|
62
|
+
"@cocreate/crud-client": "^1.21.24",
|
|
63
|
+
"@cocreate/elements": "^1.17.33"
|
|
65
64
|
}
|
|
66
65
|
}
|
package/src/client.js
CHANGED
|
@@ -1,60 +1,152 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import form from '@cocreate/form';
|
|
1
|
+
import Crud from '@cocreate/crud-client';
|
|
2
|
+
import Action from '@cocreate/actions';
|
|
3
|
+
import Elements from '@cocreate/elements';
|
|
5
4
|
|
|
6
|
-
const CoCreateOrganization = {
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
async function generateDB(organization = { object: {} }, user = { object: {} }) {
|
|
7
|
+
const organization_id = organization.object._id || Crud.ObjectId();
|
|
8
|
+
const defaultKey = organization.object.key || uuid.generate();
|
|
9
|
+
const user_id = user.object._id || Crud.ObjectId();
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
let apiKey = await Crud.send({ method: 'create.object', database: organization_id, array: 'keys', organization_id })
|
|
12
|
+
if (apiKey && apiKey.object && apiKey.object[0])
|
|
13
|
+
return
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
try {
|
|
16
|
+
// Create organization
|
|
17
|
+
organization.method = 'create.object'
|
|
18
|
+
organization.storage = 'indexeddb'
|
|
19
|
+
organization.database = organization_id
|
|
20
|
+
organization.array = 'organizations'
|
|
21
|
+
organization.object._id = organization_id
|
|
22
|
+
organization.object.name = organization.object.name || 'untitiled'
|
|
23
|
+
organization.organization_id = organization_id
|
|
24
|
+
Crud.send(organization);
|
|
25
|
+
|
|
26
|
+
// Create user
|
|
27
|
+
user.method = 'create.object'
|
|
28
|
+
user.storage = 'indexeddb'
|
|
29
|
+
user.database = organization_id
|
|
30
|
+
user.array = 'users'
|
|
31
|
+
user.object._id = user_id
|
|
32
|
+
user.object.firstname = user.object.firstname || 'untitiled'
|
|
33
|
+
user.object.lastname = user.object.lastname || 'untitiled'
|
|
34
|
+
user.organization_id = organization_id
|
|
35
|
+
Crud.send(user);
|
|
19
36
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
37
|
+
// Create default key
|
|
38
|
+
let key = {
|
|
39
|
+
method: 'create.object',
|
|
40
|
+
storage: 'indexeddb',
|
|
41
|
+
database: organization_id,
|
|
42
|
+
array: 'keys',
|
|
43
|
+
object: {
|
|
44
|
+
_id: Crud.ObjectId(),
|
|
45
|
+
type: "key",
|
|
46
|
+
key: defaultKey,
|
|
47
|
+
actions: {
|
|
48
|
+
signIn: true,
|
|
49
|
+
signUp: true
|
|
50
|
+
},
|
|
51
|
+
default: true
|
|
52
|
+
},
|
|
53
|
+
organization_id
|
|
24
54
|
}
|
|
55
|
+
Crud.send(key);
|
|
56
|
+
|
|
57
|
+
// Create role
|
|
58
|
+
let role_id = Crud.ObjectId();
|
|
59
|
+
let role = {
|
|
60
|
+
method: 'create.object',
|
|
61
|
+
storage: 'indexeddb',
|
|
62
|
+
database: organization_id,
|
|
63
|
+
array: 'keys',
|
|
64
|
+
object: {
|
|
65
|
+
_id: role_id,
|
|
66
|
+
type: "role",
|
|
67
|
+
name: "admin",
|
|
68
|
+
admin: "true"
|
|
69
|
+
},
|
|
70
|
+
organization_id
|
|
71
|
+
};
|
|
72
|
+
Crud.send(role);
|
|
25
73
|
|
|
26
|
-
|
|
27
|
-
|
|
74
|
+
// Create user key
|
|
75
|
+
let userKey = {
|
|
76
|
+
method: 'create.object',
|
|
77
|
+
storage: 'indexeddb',
|
|
78
|
+
database: organization_id,
|
|
79
|
+
array: 'keys',
|
|
80
|
+
object: {
|
|
81
|
+
_id: Crud.ObjectId(),
|
|
82
|
+
type: "user",
|
|
83
|
+
key: user_id,
|
|
84
|
+
array: 'users', // could be any array
|
|
85
|
+
roles: [role_id],
|
|
86
|
+
email: user.object.email,
|
|
87
|
+
password: user.object.password || btoa('0000')
|
|
88
|
+
},
|
|
89
|
+
organization_id
|
|
90
|
+
};
|
|
91
|
+
Crud.send(userKey);
|
|
28
92
|
|
|
29
|
-
|
|
30
|
-
user = user.document[0]
|
|
93
|
+
return { organization: organization.object, key: key.object, user: user.object, role: role.object, userKey: userKey.object }
|
|
31
94
|
|
|
32
|
-
|
|
95
|
+
} catch (error) {
|
|
96
|
+
return false
|
|
97
|
+
}
|
|
98
|
+
}
|
|
33
99
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
100
|
+
async function create(btn) {
|
|
101
|
+
let formEl = btn.closest("form");
|
|
102
|
+
if (!formEl) return;
|
|
38
103
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
user,
|
|
42
|
-
broadcastBrowser: false,
|
|
43
|
-
organization_id
|
|
44
|
-
});
|
|
104
|
+
let organization = Elements.getFormData(formEl, 'organizations')
|
|
105
|
+
let user = Elements.getFormData(formEl, 'users')
|
|
45
106
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
107
|
+
if (!organization || !organization.object)
|
|
108
|
+
return
|
|
109
|
+
if (!user || !user.object)
|
|
110
|
+
return
|
|
111
|
+
|
|
112
|
+
if (!organization.object._id && !user.object._id) {
|
|
113
|
+
let objects = await generateDB(organization, user)
|
|
114
|
+
if (!objects)
|
|
115
|
+
return
|
|
49
116
|
}
|
|
50
|
-
};
|
|
51
117
|
|
|
52
|
-
|
|
118
|
+
Elements.setTypeValue(formEl, organization)
|
|
119
|
+
Elements.setTypeValue(formEl, user)
|
|
120
|
+
|
|
121
|
+
organization = organization.object[0]
|
|
122
|
+
user = user.object[0]
|
|
123
|
+
|
|
124
|
+
let organization_id = organization._id
|
|
125
|
+
|
|
126
|
+
if (Crud.socket.organization !== true) {
|
|
127
|
+
Crud.socket.organization = true
|
|
128
|
+
Crud.socket.create({ organization_id })
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
let response = await Crud.socket.send({
|
|
132
|
+
method: 'createOrganization',
|
|
133
|
+
organization,
|
|
134
|
+
user,
|
|
135
|
+
broadcastBrowser: false,
|
|
136
|
+
organization_id
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
document.dispatchEvent(new CustomEvent('createdOrganization', {
|
|
140
|
+
detail: response
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
Action.init({
|
|
53
145
|
name: "createOrganization",
|
|
54
146
|
endEvent: "createdOrganization",
|
|
55
|
-
callback: (
|
|
56
|
-
CoCreateOrganization.
|
|
147
|
+
callback: (action) => {
|
|
148
|
+
CoCreateOrganization.create(action.element);
|
|
57
149
|
}
|
|
58
150
|
});
|
|
59
151
|
|
|
60
|
-
export default
|
|
152
|
+
export default { generateDB, create };
|
package/src/server.js
CHANGED
|
@@ -41,34 +41,35 @@ class CoCreateOrganization {
|
|
|
41
41
|
type: "user",
|
|
42
42
|
key: user._id,
|
|
43
43
|
roles: ['user'],
|
|
44
|
-
email: user.
|
|
45
|
-
password: user.
|
|
44
|
+
email: user.object.email,
|
|
45
|
+
password: user.object.password || btoa('0000'),
|
|
46
46
|
user: {
|
|
47
|
-
|
|
47
|
+
array: 'users'
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
const Data = {}
|
|
52
|
+
Data.method = 'create.object'
|
|
52
53
|
Data.database = process.env.organization_id
|
|
53
54
|
Data.organization_id = process.env.organization_id
|
|
54
55
|
|
|
55
56
|
if (organization) {
|
|
56
|
-
const response = await this.crud.
|
|
57
|
-
this.wsManager.broadcast(this.platformSocket,
|
|
57
|
+
const response = await this.crud.send({ ...Data, method: 'create.object', array: 'organizations', object: organization })
|
|
58
|
+
this.wsManager.broadcast(this.platformSocket, response);
|
|
58
59
|
}
|
|
59
60
|
if (user) {
|
|
60
|
-
const response = await this.crud.
|
|
61
|
-
this.wsManager.broadcast(this.platformSocket,
|
|
61
|
+
const response = await this.crud.send({ ...Data, method: 'create.object', array: 'users', object: user })
|
|
62
|
+
this.wsManager.broadcast(this.platformSocket, response);
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
if (userKey) {
|
|
65
|
-
const response = await this.crud.
|
|
66
|
-
this.wsManager.broadcast(this.platformSocket,
|
|
66
|
+
const response = await this.crud.send({ ...Data, method: 'create.object', array: 'keys', object: userKey })
|
|
67
|
+
this.wsManager.broadcast(this.platformSocket, response);
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
this.wsManager.send(socket,
|
|
70
|
+
this.wsManager.send(socket, data);
|
|
70
71
|
} catch (error) {
|
|
71
|
-
console.log('
|
|
72
|
+
console.log('createObject error', error);
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
}
|
package/webpack.config.js
CHANGED
|
@@ -1,84 +1,90 @@
|
|
|
1
1
|
const path = require("path")
|
|
2
2
|
const TerserPlugin = require("terser-webpack-plugin")
|
|
3
3
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
|
|
4
|
-
let isProduction = process.env.NODE_ENV === "production"
|
|
5
4
|
const { CleanWebpackPlugin } = require("clean-webpack-plugin")
|
|
6
5
|
|
|
7
|
-
module.exports = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
output: {
|
|
12
|
-
path: path.resolve(__dirname, "dist"),
|
|
13
|
-
filename: isProduction ? "[name].min.js" : "[name].js",
|
|
14
|
-
libraryTarget: "umd",
|
|
15
|
-
libraryExport: "default",
|
|
16
|
-
library: ["CoCreate", "organizations"],
|
|
17
|
-
globalObject: "this",
|
|
18
|
-
},
|
|
6
|
+
module.exports = (env, argv) => {
|
|
7
|
+
let isProduction = false
|
|
8
|
+
if (argv.mode === 'production')
|
|
9
|
+
isProduction = true
|
|
19
10
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
filename: "[name].css",
|
|
24
|
-
}),
|
|
25
|
-
],
|
|
26
|
-
// Default mode for Webpack is production.
|
|
27
|
-
// Depending on mode Webpack will apply different things
|
|
28
|
-
// on final bundle. For now we don't need production's JavaScript
|
|
29
|
-
// minifying and other thing so let's set mode to development
|
|
30
|
-
mode: isProduction ? "production" : "development",
|
|
31
|
-
module: {
|
|
32
|
-
rules: [
|
|
33
|
-
{
|
|
34
|
-
test: /.js$/,
|
|
35
|
-
exclude: /(node_modules)/,
|
|
36
|
-
use: {
|
|
37
|
-
loader: "babel-loader",
|
|
38
|
-
options: {
|
|
39
|
-
plugins: ["@babel/plugin-transform-modules-commonjs"],
|
|
40
|
-
},
|
|
11
|
+
const config = {
|
|
12
|
+
entry: {
|
|
13
|
+
"CoCreate-organizations": "./src/index.js",
|
|
41
14
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
15
|
+
output: {
|
|
16
|
+
path: path.resolve(__dirname, "dist"),
|
|
17
|
+
filename: isProduction ? "[name].min.js" : "[name].js",
|
|
18
|
+
libraryTarget: "umd",
|
|
19
|
+
libraryExport: "default",
|
|
20
|
+
library: ["CoCreate", "organizations"],
|
|
21
|
+
globalObject: "this",
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
plugins: [
|
|
25
|
+
new CleanWebpackPlugin(),
|
|
26
|
+
new MiniCssExtractPlugin({
|
|
27
|
+
filename: "[name].css",
|
|
28
|
+
}),
|
|
48
29
|
],
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
// Default mode for Webpack is production.
|
|
31
|
+
// Depending on mode Webpack will apply different things
|
|
32
|
+
// on final bundle. For now we don't need production's JavaScript
|
|
33
|
+
// minifying and other thing so let's set mode to development
|
|
34
|
+
mode: isProduction ? "production" : "development",
|
|
35
|
+
module: {
|
|
36
|
+
rules: [
|
|
37
|
+
{
|
|
38
|
+
test: /.js$/,
|
|
39
|
+
exclude: /(node_modules)/,
|
|
40
|
+
use: {
|
|
41
|
+
loader: "babel-loader",
|
|
42
|
+
options: {
|
|
43
|
+
plugins: ["@babel/plugin-transform-modules-commonjs"],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
test: /.css$/i,
|
|
49
|
+
use: [
|
|
50
|
+
{ loader: "style-loader", options: { injectType: "linkTag" } },
|
|
51
|
+
"file-loader",
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
52
56
|
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
// add source map
|
|
58
|
+
...(isProduction ? {} : { devtool: "eval-source-map" }),
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
optimization: {
|
|
61
|
+
minimize: true,
|
|
62
|
+
minimizer: [
|
|
63
|
+
new TerserPlugin({
|
|
64
|
+
extractComments: true,
|
|
65
|
+
// cache: true,
|
|
66
|
+
parallel: true,
|
|
67
|
+
// sourceMap: true, // Must be set to true if using source-maps in production
|
|
68
|
+
terserOptions: {
|
|
69
|
+
// https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
|
|
70
|
+
// extractComments: 'all',
|
|
71
|
+
compress: {
|
|
72
|
+
drop_console: true,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
],
|
|
77
|
+
splitChunks: {
|
|
78
|
+
chunks: "all",
|
|
79
|
+
minSize: 200,
|
|
80
|
+
// maxSize: 99999,
|
|
81
|
+
//minChunks: 1,
|
|
78
82
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
83
|
+
cacheGroups: {
|
|
84
|
+
defaultVendors: false,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
return config
|
|
90
|
+
}
|