@cocreate/file 1.12.0 → 1.14.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 CHANGED
@@ -1,3 +1,27 @@
1
+ # [1.14.0](https://github.com/CoCreate-app/CoCreate-file/compare/v1.13.0...v1.14.0) (2023-11-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update licensing details ([8c40ebb](https://github.com/CoCreate-app/CoCreate-file/commit/8c40ebb79f9c81d27574a43130daec77c3f778ba))
7
+
8
+
9
+ ### Features
10
+
11
+ * upgrade dependencies for latest features and fixes ([d30415b](https://github.com/CoCreate-app/CoCreate-file/commit/d30415b76459f3d0fb80085a2560e667d3e66a8d))
12
+
13
+ # [1.13.0](https://github.com/CoCreate-app/CoCreate-file/compare/v1.12.0...v1.13.0) (2023-11-25)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * update nav, edit button and css path ([b88261d](https://github.com/CoCreate-app/CoCreate-file/commit/b88261df87594c7693a29cef287780d3ac44583b))
19
+
20
+
21
+ ### Features
22
+
23
+ * upgrade dependencies for latest features and fixes ([4fb4643](https://github.com/CoCreate-app/CoCreate-file/commit/4fb4643bdda0f7d3ca6fc09f95884e8703e92590))
24
+
1
25
  # [1.12.0](https://github.com/CoCreate-app/CoCreate-file/compare/v1.11.0...v1.12.0) (2023-11-19)
2
26
 
3
27
 
package/README.md CHANGED
@@ -82,4 +82,10 @@ We appreciate your continued support, thank you!
82
82
 
83
83
  # License
84
84
 
85
- [The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-file/blob/master/LICENSE)
85
+ This software is dual-licensed under the GNU Affero General Public License version 3 (AGPLv3) and a commercial license.
86
+
87
+ - **Open Source Use**: For open-source projects and non-commercial use, this software is available under the AGPLv3. The AGPLv3 allows you to freely use, modify, and distribute this software, provided that all modifications and derivative works are also licensed under the AGPLv3. For the full license text, see the [LICENSE file](https://github.com/CoCreate-app/CoCreate-file/blob/master/LICENSE).
88
+
89
+ - **Commercial Use**: For-profit companies and individuals intending to use this software for commercial purposes must obtain a commercial license. The commercial license is available when you sign up for an API key on our [website](https://cocreate.app). This license permits proprietary use and modification of the software without the copyleft requirements of the AGPLv3. It is ideal for integrating this software into proprietary commercial products and applications.
90
+
91
+ If you have not purchased a commercial license and intend to use this software for commercial purposes, you are required to sign up for an API key on our website.
package/docs/index.html CHANGED
@@ -28,7 +28,7 @@
28
28
  type="text/css" />
29
29
  <link
30
30
  rel="stylesheet"
31
- href="/docs/index.css"
31
+ href="../index.css"
32
32
  array="files"
33
33
  object="60888216117c640e7596303f"
34
34
  key="src"
@@ -38,15 +38,15 @@
38
38
  </head>
39
39
 
40
40
  <body>
41
+ <!-- Navbar -->
41
42
  <nav
42
- class="nav display:flex align-items:center left:0px background:whitesmoke padding-top:10px padding-bottom:10px"
43
+ class="width:100% display:flex align-items:center background:transparent padding-top:10px padding-bottom:10px"
43
44
  content_id="content"
44
- scroll="sticky-nav,hide-nav"
45
- scroll-up="10"
46
- scroll-down="10"
47
- array="files"
48
- object="60395ef42b3ac232657040fd"
49
- key="src"></nav>
45
+ scroll="sticky-nav,"
46
+ scroll-up="5"
47
+ scroll-down="5"
48
+ path="../"
49
+ src="../components/navbar.html"></nav>
50
50
  <sidenav
51
51
  id="menuL"
52
52
  class="position:fixed top:0px left:0px overflow:hidden background:whitesmoke height:100vh width:0px width:300px@xl"
@@ -371,10 +371,8 @@
371
371
  <button
372
372
  href="https://github.com/CoCreate-app/CoCreate-file/tree/master/docs/index.html?message=docs%3A%20describe%20your%20change..."
373
373
  target="_blank"
374
- class="position:fixed bottom:15px right:15px padding:15px background:dodgerblue color:#fff font-size:1.5rem grow-hover border-radius:50% border-width:0 box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
375
- <i
376
- class="height:20px fill:#505050"
377
- src="/assets/svg/pencil-alt.svg"></i>
374
+ class="display:flex justify-content:center align-items:center position:fixed bottom:15px right:15px height:50px width:50px border-radius:50% box-shadow:0px_2px_10px_0px_rgba(0,_0,_0,_0.4)">
375
+ <i class="height:20px" src="../assets/svg/pencil-alt.svg"></i>
378
376
  </button>
379
377
  </main>
380
378
  <script src="https://CoCreate.app/dist/CoCreate.js"></script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/file",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "A headless file uploader that uses HTML5 attributes for customization. Allows easy upload of files to server.",
5
5
  "keywords": [
6
6
  "file",
@@ -59,9 +59,9 @@
59
59
  "webpack-log": "^3.0.1"
60
60
  },
61
61
  "dependencies": {
62
- "@cocreate/actions": "^1.12.4",
63
- "@cocreate/config": "^1.6.9",
64
- "@cocreate/render": "^1.32.0",
65
- "@cocreate/utils": "^1.27.4"
62
+ "@cocreate/actions": "^1.14.0",
63
+ "@cocreate/config": "^1.8.0",
64
+ "@cocreate/render": "^1.35.0",
65
+ "@cocreate/utils": "^1.29.0"
66
66
  }
67
67
  }
package/src/client.js CHANGED
@@ -33,12 +33,18 @@ import '@cocreate/element-prototype';
33
33
  const inputs = new Map();
34
34
  const Files = new Map();
35
35
 
36
+ /**
37
+ * Initializes file elements. If no parameter is provided, it queries and initializes all elements with type="file".
38
+ * It can also initialize a single element or an array of elements. Specifically focuses on elements of type 'file'.
39
+ *
40
+ * @param {(Element|Element[]|null)} [elements] - Optional. An element, an array of elements, or null.
41
+ * - If null or omitted, the function queries and initializes all elements in the document with type="file".
42
+ * - If a single element is provided, it initializes that element (assuming it is of type "file").
43
+ * - If an array of elements is provided, each element in the array is initialized.
44
+ */
36
45
  function init(elements) {
37
- // Returns an array of elements.
38
46
  if (!elements)
39
47
  elements = document.querySelectorAll('[type="file"]')
40
-
41
- // If elements is an not array of elements returns an array of elements.
42
48
  else if (!Array.isArray(elements))
43
49
  elements = [elements]
44
50
  for (let i = 0; i < elements.length; i++) {