isite 2023.1.8 → 2023.8.10

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 (38) hide show
  1. package/apps/charts/app.js +1 -1
  2. package/apps/charts/site_files/html/index.html +1 -1
  3. package/apps/charts/site_files/js/chart-animated.js +1 -20
  4. package/apps/charts/site_files/js/charts.js +1 -1
  5. package/apps/charts/site_files/js/custom.js +151 -153
  6. package/apps/client-side/app.js +39 -14
  7. package/apps/client-side/site_files/css/bootstrap5-addon.css +20 -8
  8. package/apps/client-side/site_files/css/effect.css +2 -2
  9. package/apps/client-side/site_files/css/font-awesome.css +6 -6
  10. package/apps/client-side/site_files/css/font-awesome.min.css +1 -1
  11. package/apps/client-side/site_files/css/layout.css +4 -4
  12. package/apps/client-side/site_files/css/modal.css +3 -3
  13. package/apps/client-side/site_files/css/print.css +1 -0
  14. package/apps/client-side/site_files/css/tabs.css +72 -68
  15. package/apps/client-side/site_files/css/treeview.css +49 -48
  16. package/apps/client-side/site_files/html/directive/i-date-old.html +24 -0
  17. package/apps/client-side/site_files/html/directive/i-date.html +19 -15
  18. package/apps/client-side/site_files/html/directive/i-datetime.html +11 -22
  19. package/apps/client-side/site_files/html/require_payments.html +11 -12
  20. package/apps/client-side/site_files/html/require_permissions.html +2 -2
  21. package/apps/client-side/site_files/html/words.html +66 -0
  22. package/apps/client-side/site_files/js/app.js +162 -0
  23. package/apps/client-side/site_files/js/bootstrap-5-directive.js +70 -106
  24. package/apps/client-side/site_files/js/directive-core.js +1 -7
  25. package/apps/client-side/site_files/js/site.js +11 -1
  26. package/index.js +6 -0
  27. package/lib/app.js +379 -0
  28. package/lib/collection.js +12 -4
  29. package/lib/data.js +1 -0
  30. package/lib/fsm.js +398 -387
  31. package/lib/mongodb.js +2 -1
  32. package/lib/parser.js +3 -3
  33. package/lib/routing.js +36 -25
  34. package/lib/security.js +9 -5
  35. package/lib/words.js +17 -30
  36. package/object-options/index.js +11 -11
  37. package/object-options/lib/fn.js +0 -30
  38. package/package.json +2 -1
@@ -1,161 +1,159 @@
1
- ;
2
1
  ((w, d) => {
3
-
4
- const YXChart = {
5
-
6
- "data": [{
7
- "country": "USA",
8
- "visits": 3025
9
- }],
10
-
11
- "colors": {
12
- "saturation": 0.4,
13
- "list" : [
14
- "#ff5722"
15
- ]
2
+ const YXChart = {
3
+ data: [
4
+ {
5
+ country: 'USA',
6
+ visits: 3025,
7
+ },
8
+ ],
9
+
10
+ colors: {
11
+ saturation: 0.4,
12
+ list: ['#ff5722'],
13
+ },
14
+
15
+ yAxes: [
16
+ {
17
+ type: 'CategoryAxis',
18
+ renderer: {
19
+ minGridDistance: 20,
20
+ grid: {
21
+ location: 0,
22
+ },
16
23
  },
17
-
18
- "yAxes": [{
19
- "type": "CategoryAxis",
20
- "renderer": {
21
- "minGridDistance": 20,
22
- "grid": {
23
- "location": 0
24
- }
25
- },
26
- "dataFields": {
27
- "category": "country"
28
- }
29
- }],
30
-
31
-
32
- "xAxes": [{
33
- "type": "ValueAxis",
34
- "renderer": {
35
- "maxLabelPosition": 0.98
36
- }
37
- }],
38
-
39
-
40
- "series": [{
41
- "name": "test name",
42
- "type": "ColumnSeries",
43
-
44
-
45
- "dataFields": {
46
- "categoryY": "country",
47
- "valueX": "visits"
48
- },
49
-
50
-
51
- "defaultState": {
52
- "ransitionDuration": 1000
53
- },
54
-
55
-
56
- "sequencedInterpolation": !0,
57
- "sequencedInterpolationDelay": 100,
58
-
59
-
60
- "columns": {
61
- "template": {
62
- "tooltipText": "",
63
- "fill": "#0000ff"
64
- },
65
- "strokeOpacity": 0
66
- }
67
- }],
68
-
69
-
70
- "cursor": {
71
- "type": "XYCursor",
72
- "behavior": "zoomY"
73
- }
74
- };
75
-
76
- const XYChart = {
77
- "colors": {
78
- "saturation": 0.4,
79
- "list" : [
80
- "#ff5722"
81
- ]
24
+ dataFields: {
25
+ category: 'country',
82
26
  },
83
- "data": [{
84
- "country": "USA",
85
- "visits": 3025
86
- }],
87
- "yAxes": [{
88
- "type": "ValueAxis",
89
- "renderer": {
90
- "maxLabelPosition": 0.98
91
- }
92
- }],
93
- "xAxes": [{
94
- "type": "CategoryAxis",
95
- "renderer": {
96
- "minGridDistance": 20,
97
- "grid": {
98
- "location": 0
99
- }
100
- },
101
- "dataFields": {
102
- "category": "country"
103
- }
104
- }],
105
- "series": [{
106
- "name": "test name",
107
- "type": "ColumnSeries",
108
- "dataFields": {
109
- "categoryX": "country",
110
- "valueY": "visits"
111
- },
112
- "columns": {
113
- "template": {
114
- "tooltipText": "",
115
- "fill": "#0000ff"
116
- },
117
- "strokeOpacity": 0
118
- },
119
- "defaultState": {
120
- "ransitionDuration": 1000
121
- },
122
- "sequencedInterpolation": !0,
123
- "sequencedInterpolationDelay": 100
124
- }],
125
-
27
+ },
28
+ ],
29
+
30
+ xAxes: [
31
+ {
32
+ type: 'ValueAxis',
33
+ renderer: {
34
+ maxLabelPosition: 0.98,
35
+ },
36
+ },
37
+ ],
126
38
 
127
- "cursor": {
128
- "type": "XYCursor",
129
- "behavior": "zoomX"
130
- }
131
- };
39
+ series: [
40
+ {
41
+ name: 'test name',
42
+ type: 'ColumnSeries',
132
43
 
133
- w.site = w.site || {};
134
- w.site.create_chart = function (options) {
135
- am4core.useTheme(am4themes_animated);
44
+ dataFields: {
45
+ categoryY: 'country',
46
+ valueX: 'visits',
47
+ },
136
48
 
137
- if (options.type == 'xy') {
138
- XYChart.xAxes[0].dataFields.category = options.x;
139
- XYChart.series[0].dataFields.categoryX = options.x;
140
- XYChart.series[0].dataFields.valueY = options.y;
141
- if(options.color){
142
- XYChart.colors.list[0] = options.color;
143
- }
144
-
145
- XYChart.data = options.data;
146
- am4core.createFromConfig(XYChart, document.querySelector(options.selector), am4charts.XYChart);
147
- } else if (options.type == 'yx') {
148
- YXChart.yAxes[0].dataFields.category = options.y;
149
- YXChart.series[0].dataFields.categoryY = options.y;
150
- YXChart.series[0].dataFields.valueX = options.x;
151
- if(options.color){
152
- YXChart.colors.list[0] = options.color;
153
- }
154
- YXChart.data = options.data;
155
- am4core.createFromConfig(YXChart, document.querySelector(options.selector), am4charts.XYChart);
156
- }
49
+ defaultState: {
50
+ ransitionDuration: 1000,
51
+ },
157
52
 
158
-
159
- };
53
+ sequencedInterpolation: !0,
54
+ sequencedInterpolationDelay: 100,
160
55
 
161
- })(window, document);
56
+ columns: {
57
+ template: {
58
+ tooltipText: '',
59
+ fill: '#0000ff',
60
+ },
61
+ strokeOpacity: 0,
62
+ },
63
+ },
64
+ ],
65
+
66
+ cursor: {
67
+ type: 'XYCursor',
68
+ behavior: 'zoomY',
69
+ },
70
+ };
71
+
72
+ const XYChart = {
73
+ colors: {
74
+ saturation: 0.4,
75
+ list: ['#ff5722'],
76
+ },
77
+ data: [
78
+ {
79
+ country: 'USA',
80
+ visits: 3025,
81
+ },
82
+ ],
83
+ yAxes: [
84
+ {
85
+ type: 'ValueAxis',
86
+ renderer: {
87
+ maxLabelPosition: 0.98,
88
+ },
89
+ },
90
+ ],
91
+ xAxes: [
92
+ {
93
+ type: 'CategoryAxis',
94
+ renderer: {
95
+ minGridDistance: 20,
96
+ grid: {
97
+ location: 0,
98
+ },
99
+ },
100
+ dataFields: {
101
+ category: 'country',
102
+ },
103
+ },
104
+ ],
105
+ series: [
106
+ {
107
+ name: 'test name',
108
+ type: 'ColumnSeries',
109
+ dataFields: {
110
+ categoryX: 'country',
111
+ valueY: 'visits',
112
+ },
113
+ columns: {
114
+ template: {
115
+ tooltipText: '',
116
+ fill: '#0000ff',
117
+ },
118
+ strokeOpacity: 0,
119
+ },
120
+ defaultState: {
121
+ ransitionDuration: 1000,
122
+ },
123
+ sequencedInterpolation: !0,
124
+ sequencedInterpolationDelay: 100,
125
+ },
126
+ ],
127
+
128
+ cursor: {
129
+ type: 'XYCursor',
130
+ behavior: 'zoomX',
131
+ },
132
+ };
133
+
134
+ w.site = w.site || {};
135
+ w.site.create_chart = function (options) {
136
+ am4core.useTheme(am4themes_animated);
137
+
138
+ if (options.type == 'xy') {
139
+ XYChart.xAxes[0].dataFields.category = options.x;
140
+ XYChart.series[0].dataFields.categoryX = options.x;
141
+ XYChart.series[0].dataFields.valueY = options.y;
142
+ if (options.color) {
143
+ XYChart.colors.list[0] = options.color;
144
+ }
145
+
146
+ XYChart.data = options.data;
147
+ am4core.createFromConfig(XYChart, document.querySelector(options.selector), am4charts.XYChart);
148
+ } else if (options.type == 'yx') {
149
+ YXChart.yAxes[0].dataFields.category = options.y;
150
+ YXChart.series[0].dataFields.categoryY = options.y;
151
+ YXChart.series[0].dataFields.valueX = options.x;
152
+ if (options.color) {
153
+ YXChart.colors.list[0] = options.color;
154
+ }
155
+ YXChart.data = options.data;
156
+ am4core.createFromConfig(YXChart, document.querySelector(options.selector), am4charts.XYChart);
157
+ }
158
+ };
159
+ })(window, document);
@@ -46,6 +46,7 @@ module.exports = function (site) {
46
46
  __dirname + '/site_files/js/directive-core.js',
47
47
  __dirname + '/site_files/js/directive.js',
48
48
  __dirname + '/site_files/js/last.js',
49
+ __dirname + '/site_files/js/xlsx.js',
49
50
  ],
50
51
  });
51
52
 
@@ -70,6 +71,7 @@ module.exports = function (site) {
70
71
  __dirname + '/site_files/js/bootstrap5.js',
71
72
  __dirname + '/site_files/js/bootstrap-5-addon.js',
72
73
  __dirname + '/site_files/js/WebShareEditor.js',
74
+ __dirname + '/site_files/js/xlsx.js',
73
75
  ],
74
76
  });
75
77
 
@@ -98,7 +100,15 @@ module.exports = function (site) {
98
100
  ],
99
101
  });
100
102
 
101
-
103
+ site.get(
104
+ {
105
+ name: '/x-words',
106
+ },
107
+ (req, res) => {
108
+ res.render('client-side/words.html', {}, { parser: 'html css js', public: true });
109
+ }
110
+ );
111
+
102
112
  site.get({
103
113
  name: '/x-css',
104
114
  path: __dirname + '/site_files/css',
@@ -162,7 +172,7 @@ module.exports = function (site) {
162
172
  __dirname + '/site_files/css/font-awesome.css',
163
173
  ],
164
174
  });
165
-
175
+
166
176
  site.get({
167
177
  name: ['/x-css/bootstrap-5-support.css', '/x-css/bootstrap-support.css'],
168
178
  parser: 'css2',
@@ -192,7 +202,7 @@ module.exports = function (site) {
192
202
  __dirname + '/site_files/css/WebShareEditor.css',
193
203
  ],
194
204
  });
195
-
205
+
196
206
  site.get({
197
207
  name: ['/x-css/sa.css'],
198
208
  parser: 'css2',
@@ -225,27 +235,43 @@ module.exports = function (site) {
225
235
  });
226
236
 
227
237
  site.post({ name: '/x-api/upload/image', public: true }, (req, res) => {
228
- site.createDir(site.options.upload_dir + '/' + req.headers['folder'], () => {
229
- site.createDir(site.options.upload_dir + '/' + req.headers['folder'] + '/images', () => {
238
+ let folder = req.headers['folder'] || new Date().getFullYear() + '_' + new Date().getMonth() + '_' + new Date().getDate();
239
+
240
+ site.createDir(site.options.upload_dir + '/' + folder, () => {
241
+ site.createDir(site.options.upload_dir + '/' + folder + '/images', () => {
230
242
  let response = {
231
243
  image: {},
232
244
  done: !0,
233
245
  };
234
246
  let file = req.files.fileToUpload;
235
247
  if (file) {
236
- let newName = 'image_' + new Date().getTime().toString() + Math.random().toString() + site.path.extname(file.originalFilename);
237
- let newpath = site.path.resolve(site.options.upload_dir + '/' + req.headers['folder'] + '/images/' + newName);
248
+ let name1 = 'image_' + new Date().getTime().toString() + Math.random().toString().replace('.', '_');
249
+ let newName = name1 + site.path.extname(file.originalFilename);
250
+ let newName2 = name1 + '.webp';
251
+ let newpath = site.path.resolve(site.options.upload_dir + '/' + folder + '/images/' + newName);
252
+ let newpath2 = site.path.resolve(site.options.upload_dir + '/' + folder + '/images/' + newName2);
238
253
  site.mv(file.filepath, newpath, function (err) {
239
254
  if (err) {
240
255
  response.error = err;
241
256
  response.done = !1;
257
+ res.json(response);
242
258
  } else {
243
259
  response.image.name = file.originalFilename;
244
260
  response.image.path = newpath;
245
- response.image.url = '/x-api/image/' + req.headers['folder'] + '/' + newName;
261
+ response.image.url = '/x-api/image/' + folder + '/' + newName;
246
262
  response.image.size = file.size;
263
+ if (!response.image.name.like('*.webp')) {
264
+ site.webp.cwebp(newpath, newpath2, '-q 80').then((output) => {
265
+ console.log(output);
266
+ response.image.path = newpath2;
267
+ response.image.url = '/x-api/image/' + folder + '/' + newName2;
268
+ res.json(response);
269
+ site.fs.unlink(newpath, () => {});
270
+ });
271
+ } else {
272
+ res.json(response);
273
+ }
247
274
  }
248
- res.json(response);
249
275
  });
250
276
  } else {
251
277
  response.error = 'no file';
@@ -257,7 +283,7 @@ module.exports = function (site) {
257
283
  });
258
284
 
259
285
  site.get({ name: '/x-api/image/:category/:name', public: true }, (req, res) => {
260
- res.set('Cache-Control', 'public, max-age=2592000');
286
+ res.set('Cache-Control', 'public, max-age=' + 60 * site.options.cache.images);
261
287
  res.download(site.options.upload_dir + '/' + req.params.category + '/images/' + req.params.name);
262
288
  });
263
289
 
@@ -294,11 +320,10 @@ module.exports = function (site) {
294
320
  });
295
321
 
296
322
  site.get({ name: '/x-api/audio/:category/:name', public: true }, (req, res) => {
297
- res.set('Cache-Control', 'public, max-age=2592000');
323
+ res.set('Cache-Control', 'public, max-age=' + 60 * site.options.cache.images);
298
324
  res.download(site.options.upload_dir + '/' + req.params.category + '/audios/' + req.params.name);
299
325
  });
300
326
 
301
-
302
327
  site.post({ name: '/x-api/upload/video', public: true }, (req, res) => {
303
328
  site.createDir(site.options.upload_dir + '/' + req.headers['folder'], () => {
304
329
  site.createDir(site.options.upload_dir + '/' + req.headers['folder'] + '/videos', () => {
@@ -332,11 +357,10 @@ module.exports = function (site) {
332
357
  });
333
358
 
334
359
  site.get({ name: '/x-api/video/:category/:name', public: true }, (req, res) => {
335
- res.set('Cache-Control', 'public, max-age=2592000');
360
+ res.set('Cache-Control', 'public, max-age=' + 60 * site.options.cache.images);
336
361
  res.download(site.options.upload_dir + '/' + req.params.category + '/videos/' + req.params.name);
337
362
  });
338
363
 
339
-
340
364
  site.post({ name: '/x-api/upload/file', public: true }, (req, res) => {
341
365
  site.createDir(site.options.upload_dir + '/' + req.headers['folder'], () => {
342
366
  site.createDir(site.options.upload_dir + '/' + req.headers['folder'] + '/files', () => {
@@ -375,6 +399,7 @@ module.exports = function (site) {
375
399
  site.getTLV = function (name, value) {
376
400
  return Buffer.concat([Buffer.from([name], 'utf8'), Buffer.from([value.length], 'utf8'), Buffer.from(value, 'utf8')]);
377
401
  };
402
+
378
403
  site.onPOST('/x-api/zakat', (req, res) => {
379
404
  let obj = req.data || {};
380
405
  let value = [];
@@ -42,6 +42,7 @@ body {
42
42
  }
43
43
  label {
44
44
  float: left;
45
+ color: var(--label-color);
45
46
  }
46
47
  .ar label {
47
48
  float: right;
@@ -66,7 +67,7 @@ fieldset legend {
66
67
  width: auto;
67
68
  padding: 5px;
68
69
  }
69
- .ar fieldset legend{
70
+ .ar fieldset legend {
70
71
  float: right;
71
72
  }
72
73
  legend::after {
@@ -101,8 +102,8 @@ i-button {
101
102
  display: contents;
102
103
  }
103
104
  i-button button {
104
- margin: 5px;
105
- padding: 7px 9px;
105
+ margin: 5px !important;
106
+ padding: 7px 9px !important;
106
107
  }
107
108
  i-button.default button {
108
109
  margin: 3px;
@@ -124,19 +125,30 @@ i-file button {
124
125
  i-upload {
125
126
  display: inline-block;
126
127
  }
127
- i-date .fa {
128
+ i-date .left-10,
129
+ i-datetime .left-10 {
130
+ margin-left: 10px;
131
+ }
132
+ i-date .fas,
133
+ i-datetime .fas {
128
134
  font-size: 24px;
129
135
  vertical-align: middle;
130
136
  margin-top: 5px;
137
+ cursor: pointer;
138
+ }
139
+ i-date .fas:hover,
140
+ i-datetime .fas:hover {
141
+ font-size: 26px;
131
142
  }
132
143
  i-date p,
133
144
  i-datetime p {
134
- margin-top: 10px !important;
145
+ margin: 0 !important;
135
146
  }
136
- i-datetime.is-invalid .row {
137
- border: 1px solid #dc3545 !important;
138
- border-radius: 10px !important;
147
+ i-date input,
148
+ i-datetime input {
149
+ margin: 0 !important;
139
150
  }
151
+
140
152
  .modal-content {
141
153
  width: 75vw;
142
154
  height: 100vh;
@@ -110,8 +110,8 @@
110
110
  justify-content: center;
111
111
  }
112
112
  .center {
113
- margin: 0 auto;
114
- text-align: center;
113
+ margin: 0 auto ;
114
+ text-align: center ;
115
115
  }
116
116
  .center,
117
117
  .center p,
@@ -4585,8 +4585,8 @@ readers do not read off random characters that represent icons */
4585
4585
  font-style: normal;
4586
4586
  font-weight: 400;
4587
4587
  font-display: block;
4588
- src: url("../webfonts/fa-brands-400.eot");
4589
- src: url("../webfonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.woff") format("woff"), url("../webfonts/fa-brands-400.ttf") format("truetype"), url("../webfonts/fa-brands-400.svg#fontawesome") format("svg"); }
4588
+ src: url("/webfonts/fa-brands-400.eot");
4589
+ src: url("/webfonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("/webfonts/fa-brands-400.woff2") format("woff2"), url("/webfonts/fa-brands-400.woff") format("woff"), url("/webfonts/fa-brands-400.ttf") format("truetype"), url("/webfonts/fa-brands-400.svg#fontawesome") format("svg"); }
4590
4590
 
4591
4591
  .fab {
4592
4592
  font-family: 'Font Awesome 5 Brands';
@@ -4596,8 +4596,8 @@ readers do not read off random characters that represent icons */
4596
4596
  font-style: normal;
4597
4597
  font-weight: 400;
4598
4598
  font-display: block;
4599
- src: url("../webfonts/fa-regular-400.eot");
4600
- src: url("../webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.woff") format("woff"), url("../webfonts/fa-regular-400.ttf") format("truetype"), url("../webfonts/fa-regular-400.svg#fontawesome") format("svg"); }
4599
+ src: url("/webfonts/fa-regular-400.eot");
4600
+ src: url("/webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("/webfonts/fa-regular-400.woff2") format("woff2"), url("/webfonts/fa-regular-400.woff") format("woff"), url("/webfonts/fa-regular-400.ttf") format("truetype"), url("/webfonts/fa-regular-400.svg#fontawesome") format("svg"); }
4601
4601
 
4602
4602
  .far {
4603
4603
  font-family: 'Font Awesome 5 Free';
@@ -4607,8 +4607,8 @@ readers do not read off random characters that represent icons */
4607
4607
  font-style: normal;
4608
4608
  font-weight: 900;
4609
4609
  font-display: block;
4610
- src: url("../webfonts/fa-solid-900.eot");
4611
- src: url("../webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.woff") format("woff"), url("../webfonts/fa-solid-900.ttf") format("truetype"), url("../webfonts/fa-solid-900.svg#fontawesome") format("svg"); }
4610
+ src: url("/webfonts/fa-solid-900.eot");
4611
+ src: url("/webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("/webfonts/fa-solid-900.woff2") format("woff2"), url("/webfonts/fa-solid-900.woff") format("woff"), url("/webfonts/fa-solid-900.ttf") format("truetype"), url("/webfonts/fa-solid-900.svg#fontawesome") format("svg"); }
4612
4612
 
4613
4613
  .fa,
4614
4614
  .fas {