@ozdao/prometheus-framework 0.0.78 → 0.0.80

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-451d2614.mjs +80 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-5ea8b4fa.js +1 -0
  3. package/dist/ButtonFollow-0d83a04a.mjs +130 -0
  4. package/dist/ButtonFollow-f9c5dc7a.js +1 -0
  5. package/dist/CardHeader-2d7e5d49.mjs +76 -0
  6. package/dist/CardHeader-dff9c71a.js +1 -0
  7. package/dist/Comments-b6e32958.js +1 -0
  8. package/dist/Comments-d2a8fd0f.mjs +76 -0
  9. package/dist/EditProductImages-1d4b44a9.mjs +236 -0
  10. package/dist/EditProductImages-d9228ad0.js +1 -0
  11. package/dist/EmptyState-34d85f10.mjs +36 -0
  12. package/dist/EmptyState-7658d7d6.js +1 -0
  13. package/dist/Feed-932d976d.js +1 -0
  14. package/dist/Feed-962e009b.js +1 -0
  15. package/dist/Feed-c93012c7.mjs +346 -0
  16. package/dist/Feed-d8e33aed.mjs +397 -0
  17. package/dist/PlaceholderUserpic-1a6cf257.mjs +28 -0
  18. package/dist/PlaceholderUserpic-3bf126ee.js +1 -0
  19. package/dist/Popup.vue_vue_type_style_index_0_lang-8981c189.mjs +280 -0
  20. package/dist/Popup.vue_vue_type_style_index_0_lang-931f265a.js +1 -0
  21. package/dist/Product-3c64a352.mjs +904 -0
  22. package/dist/Product-67efba5c.js +7 -0
  23. package/dist/ProductEdit-04760699.js +1 -0
  24. package/dist/ProductEdit-39adf62f.mjs +113 -0
  25. package/dist/ProfileBlogposts-00424109.js +1 -0
  26. package/dist/ProfileBlogposts-65a7a5e0.mjs +56 -0
  27. package/dist/ProfileComments-5884d09f.mjs +43 -0
  28. package/dist/ProfileComments-677731b3.js +1 -0
  29. package/dist/ProfileEvents-85a88674.mjs +55 -0
  30. package/dist/ProfileEvents-b5431cd6.js +1 -0
  31. package/dist/ProfileLikes-4a57f637.mjs +43 -0
  32. package/dist/ProfileLikes-8ccf6815.js +1 -0
  33. package/dist/ProfileOrganizations-5d681498.mjs +202 -0
  34. package/dist/ProfileOrganizations-c7688210.js +1 -0
  35. package/dist/Publics-889c25fc.js +1 -0
  36. package/dist/Publics-8bea4201.mjs +44 -0
  37. package/dist/UploadImage-34bc4a3f.mjs +99 -0
  38. package/dist/UploadImage-75b1a18a.js +1 -0
  39. package/dist/auth-18f80fef.mjs +1501 -0
  40. package/dist/auth-78fd9408.js +8 -0
  41. package/dist/auth.client.cjs +5 -5
  42. package/dist/auth.client.js +5 -5
  43. package/dist/auth.validation-6bccabd6.mjs +20 -0
  44. package/dist/auth.validation-a18510e8.js +1 -0
  45. package/dist/community.client.cjs +8 -9
  46. package/dist/community.client.js +568 -552
  47. package/dist/community.server.js +3 -2
  48. package/dist/community.server.mjs +3 -2
  49. package/dist/events.client.cjs +1 -1
  50. package/dist/events.client.js +10 -10
  51. package/dist/files.client.cjs +1 -0
  52. package/dist/files.client.js +1 -0
  53. package/dist/files.server.js +5 -2
  54. package/dist/files.server.mjs +5 -2
  55. package/dist/main.css +1 -1
  56. package/dist/organizations-0e9ff7ca.mjs +319 -0
  57. package/dist/organizations-c77ea9d0.js +1 -0
  58. package/dist/organizations.client.cjs +2 -2
  59. package/dist/organizations.client.js +26 -26
  60. package/dist/prometheus-framework.cjs.js +3 -3
  61. package/dist/prometheus-framework.es.js +8 -8
  62. package/dist/style.css +1 -1
  63. package/dist/users.client.cjs +1 -1
  64. package/dist/users.client.js +10 -10
  65. package/package.json +3 -3
  66. package/src/modules/community/components/elements/ImageUpload.vue +7 -5
  67. package/src/modules/community/components/pages/BlogPost.vue +12 -15
  68. package/src/modules/community/components/pages/CreateBlogPost.vue +14 -1
  69. package/src/modules/community/controllers/blog.controller.js +2 -1
  70. package/src/modules/files/controllers/files.controller.js +5 -1
  71. package/src/modules/files/routes/files.routes.js +3 -1
@@ -1,12 +1,12 @@
1
1
  import { openBlock as o, createElementBlock as _, renderSlot as z, createElementVNode as r, defineComponent as L, h as w, resolveComponent as I, createBlock as b, withCtx as c, createTextVNode as N, createCommentVNode as y, reactive as B, onMounted as j, unref as a, toDisplayString as $, Fragment as O, renderList as R, normalizeClass as F, createVNode as n, ref as H, withAsyncContext as T } from "vue";
2
- import { _ as M, a as A, s as p, F as g, b as G } from "./auth-84680727.mjs";
3
- import { B as D, m as Y } from "./ButtonFollow-6bbf3e24.mjs";
4
- import { I as q, _ as J } from "./UploadImage-b1acc48f.mjs";
5
- import { P as K } from "./PlaceholderUserpic-4fe04ec9.mjs";
2
+ import { _ as M, a as A, s as p, F as g, b as G } from "./auth-18f80fef.mjs";
3
+ import { B as D, m as Y } from "./ButtonFollow-0d83a04a.mjs";
4
+ import { I as q, _ as J } from "./UploadImage-34bc4a3f.mjs";
5
+ import { P as K } from "./PlaceholderUserpic-1a6cf257.mjs";
6
6
  import { useRoute as Z, useRouter as E } from "vue-router";
7
7
  import "./Tab.vue_vue_type_style_index_0_lang-4ed993c7.mjs";
8
8
  import "./inputs.validation-5732152a.mjs";
9
- import "./auth.validation-2d33e8c7.mjs";
9
+ import "./auth.validation-6bccabd6.mjs";
10
10
  import "./globals-f538c0ef.mjs";
11
11
  import "vue-i18n";
12
12
  const Q = { class: "mobile-menu-section mn-semi pd-r-zero pd-t-thin pd-b-thin pd-medium bg-grey radius-medium" }, U = {
@@ -502,7 +502,7 @@ const ze = { class: "pd-medium for-transition w-100" }, Le = /* @__PURE__ */ r("
502
502
  },
503
503
  component: () => import(
504
504
  /* webpackChunkName: "profile" */
505
- "./ProfileBlogposts-55037a06.mjs"
505
+ "./ProfileBlogposts-65a7a5e0.mjs"
506
506
  )
507
507
  }, {
508
508
  path: "profile/:_id/comments",
@@ -515,7 +515,7 @@ const ze = { class: "pd-medium for-transition w-100" }, Le = /* @__PURE__ */ r("
515
515
  },
516
516
  component: () => import(
517
517
  /* webpackChunkName: "profile" */
518
- "./ProfileComments-66651060.mjs"
518
+ "./ProfileComments-5884d09f.mjs"
519
519
  )
520
520
  }, {
521
521
  path: "profile/:_id/edit",
@@ -535,7 +535,7 @@ const ze = { class: "pd-medium for-transition w-100" }, Le = /* @__PURE__ */ r("
535
535
  },
536
536
  component: () => import(
537
537
  /* webpackChunkName: "profile" */
538
- "./ProfileEvents-ddaf8fba.mjs"
538
+ "./ProfileEvents-85a88674.mjs"
539
539
  )
540
540
  }, {
541
541
  path: "profile/:_id/likes",
@@ -548,7 +548,7 @@ const ze = { class: "pd-medium for-transition w-100" }, Le = /* @__PURE__ */ r("
548
548
  },
549
549
  component: () => import(
550
550
  /* webpackChunkName: "profile" */
551
- "./ProfileLikes-7f965631.mjs"
551
+ "./ProfileLikes-4a57f637.mjs"
552
552
  )
553
553
  }, {
554
554
  path: "profile/:_id/organizations",
@@ -561,7 +561,7 @@ const ze = { class: "pd-medium for-transition w-100" }, Le = /* @__PURE__ */ r("
561
561
  },
562
562
  component: () => import(
563
563
  /* webpackChunkName: "profile" */
564
- "./ProfileOrganizations-e4fd2b05.mjs"
564
+ "./ProfileOrganizations-5d681498.mjs"
565
565
  )
566
566
  }];
567
567
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/prometheus-framework",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
4
4
  "description": "Web3 Framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -114,8 +114,8 @@
114
114
  "require": "./dist/files.client.cjs"
115
115
  },
116
116
  "./modules/files/server": {
117
- "import": "./dist/files.server.js",
118
- "require": "./dist/files.server.cjs"
117
+ "import": "./dist/files.server.mjs",
118
+ "require": "./dist/files.server.js"
119
119
  }
120
120
  },
121
121
  "browser": {
@@ -38,23 +38,25 @@ function updateBlock(updatedBlock) {
38
38
 
39
39
  async function onFileChange(e) {
40
40
  let file = e.target.files[0];
41
+
42
+ console.log(file)
41
43
  let formData = new FormData();
44
+ let uploadPath = 'unsorted'
42
45
 
43
46
  formData.append("file", file);
44
-
47
+ console.log(formData.has("file"));
45
48
  try {
46
49
  const $axios = axios.create({baseURL: process.env.API_URL, withCredentials: true})
47
50
 
48
- console.log(formData)
49
- console.log( process.env.API_URL)
50
- let response = await $axios.post("/api/upload/image", formData, {
51
+ let response = await $axios.post(`/api/upload/file?folderName=${encodeURIComponent(uploadPath)}`, formData, {
51
52
  headers: {
52
53
  "Content-Type": "multipart/form-data"
53
54
  }
54
55
  });
55
56
  imageUrl.value = response.data.filepath;
57
+ console.log(imageUrl.value)
56
58
  emit('input', imageUrl.value);
57
- emit('updateBlock', props.prop, imageUrl.value);
59
+ emit('updateBlock', props.prop, { content: imageUrl.value });
58
60
  } catch (error) {
59
61
  console.error(error);
60
62
  }
@@ -35,7 +35,7 @@
35
35
  <component
36
36
  v-if="blogpost && blogpost.content"
37
37
  v-for="(block, index) in blogpost.content"
38
- :is="getComponent(block.type.name)"
38
+ :is="ComponentMap[block.type]"
39
39
  :key="index"
40
40
  :index="index"
41
41
  :component="block"
@@ -99,25 +99,22 @@
99
99
  isLoading.value = false;
100
100
  });
101
101
 
102
- const options = [
103
- {name: 'Textarea', value: 'p'},
104
- {name: 'H2', value: 'h2'},
105
- {name: 'Caption', value: 'caption'},
106
- {name: 'ImageUpload', value: Image}
107
- ]
108
-
109
- function getComponent(blockTypeName) {
110
- return options.find(option => option.name === blockTypeName)?.value;
111
- }
102
+ const ComponentMap = {
103
+ 'Textarea': 'p',
104
+ 'H2': 'h2',
105
+ 'Bullets': 'p',
106
+ 'Caption': 'p',
107
+ 'ImageUpload': Image
108
+ };
112
109
 
113
110
  function getBlockProps(block) {
114
- if (block.type.name === 'Textarea') {
111
+ if (block.type === 'Textarea') {
115
112
  return { innerHTML: block.content };
116
- } else if (block.type.name === 'H2') {
113
+ } else if (block.type === 'H2') {
117
114
  return { innerHTML: block.content };
118
- } else if (block.type.name === 'Caption') {
115
+ } else if (block.type === 'Caption') {
119
116
  return { innerHTML: block.content };
120
- } else if (block.type.name === 'ImageUpload') {
117
+ } else if (block.type === 'ImageUpload') {
121
118
  return { src: block.content };
122
119
  }
123
120
  return {};
@@ -2,10 +2,16 @@
2
2
  <article
3
3
  class="pd-big"
4
4
  >
5
+
5
6
  <div
6
7
  v-if="post"
7
8
  class="cols-2 gap-thin"
8
9
  >
10
+
11
+ {{ post.owner }}
12
+ {{ post.creator }}
13
+
14
+
9
15
  <section
10
16
  class="w-100 bg-grey pd-big radius-big"
11
17
  >
@@ -126,7 +132,14 @@ onMounted(async () =>{
126
132
  post.value = blog.state.current;
127
133
  }
128
134
 
129
- post.value.owner = auth.state.user._id;
135
+ post.value.owner = {
136
+ target: auth.state.user._id,
137
+ type: 'user'
138
+ }
139
+ post.value.creator = {
140
+ target: auth.state.user._id,
141
+ type: 'user'
142
+ }
130
143
  })
131
144
 
132
145
 
@@ -209,7 +209,8 @@ const controllerFactory = (db) => {
209
209
  url: req.body.name.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, ''),
210
210
  name: req.body.name,
211
211
  tags: req.body.tags ? req.body.tags : ['All'],
212
- owner: user._id,
212
+ owner: req.body.owner,
213
+ creator: req.body.creator,
213
214
  content: req.body.content,
214
215
  views: 1
215
216
  };
@@ -85,9 +85,13 @@ const controllerFactory = (db, publicPath) => {
85
85
  };
86
86
 
87
87
  const uploadFileController = async (req, res, next) => {
88
- const folderName = req.query.folderName; // получаем folderName из параметров запроса
88
+
89
+ const folderName = req.query.folderName ? req.query.folderName : 'unsorted'; // получаем folderName из параметров запроса
89
90
  const upload = multer({ storage: createStorage(folderName, publicPath) }).single('file');
90
91
 
92
+ console.log(folderName)
93
+ console.log(req.files)
94
+
91
95
  upload(req, res, function(err) {
92
96
  if (err instanceof multer.MulterError) {
93
97
  console.log(err)
@@ -10,6 +10,8 @@ module.exports = function(app, db, origins, publicPath) {
10
10
 
11
11
  const origin = req.headers.origin;
12
12
 
13
+ console.log(origin)
14
+
13
15
  if (origins.includes(origin)) {
14
16
  res.setHeader('Access-Control-Allow-Origin', origin);
15
17
  }
@@ -21,7 +23,7 @@ module.exports = function(app, db, origins, publicPath) {
21
23
 
22
24
  app.post(
23
25
  "/api/upload/image",
24
- controller.uploadImageController
26
+ controller.uploadFileController
25
27
  );
26
28
 
27
29
  app.post(