@cocreate/file 1.3.11 → 1.5.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 +35 -0
- package/CoCreate.config.js +2 -2
- package/LICENSE +683 -21
- package/demo/index.html +33 -9
- package/docs/index.html +27 -27
- package/package.json +7 -7
- package/src/client.js +555 -156
- package/src/index.js +22 -0
- package/src/server.js +66 -62
package/demo/index.html
CHANGED
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
|
+
<form>
|
|
16
|
+
<input type="file" import />
|
|
17
|
+
<button actions="import">import</button>
|
|
18
|
+
</form>
|
|
19
|
+
|
|
15
20
|
<form>
|
|
16
21
|
<input type="file" />
|
|
17
22
|
<button actions="upload">upload</button>
|
|
@@ -21,21 +26,40 @@
|
|
|
21
26
|
<input type="file" multiple />
|
|
22
27
|
<button actions="upload">upload</button>
|
|
23
28
|
</form>
|
|
29
|
+
|
|
24
30
|
<form>
|
|
25
31
|
<input type="file" directory />
|
|
26
32
|
<button actions="upload">upload</button>
|
|
27
33
|
</form>
|
|
34
|
+
|
|
28
35
|
<form>
|
|
29
|
-
<input
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
<input
|
|
37
|
+
type="file"
|
|
38
|
+
directory
|
|
39
|
+
render-selector="document; [template]" />
|
|
40
|
+
|
|
41
|
+
<button actions="saveLocally">saveLocally</button>
|
|
34
42
|
</form>
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
|
|
44
|
+
<div template file_id="{{id}}">
|
|
45
|
+
<button actions="createFile" value="tesing.js">createFile</button>
|
|
46
|
+
<button actions="deleteFile">deleteFile</button>
|
|
47
|
+
<button actions="createDirectory">createDirectory</button>
|
|
48
|
+
<button actions="deleteDirectory">deleteDirectory</button>
|
|
49
|
+
|
|
50
|
+
<input file="name" value="{{name}}" />
|
|
51
|
+
<input file="directory" value="{{directory}}" />
|
|
52
|
+
<input file="content-type" value="{{content-type}}" />
|
|
53
|
+
<textarea file="src" value-type="string">{{src}}</textarea>
|
|
54
|
+
<div>id: {{id}}</div>
|
|
37
55
|
</div>
|
|
38
|
-
|
|
39
|
-
<
|
|
56
|
+
|
|
57
|
+
<form>
|
|
58
|
+
<button actions="export" array="files">export</button>
|
|
59
|
+
</form>
|
|
60
|
+
|
|
61
|
+
<!-- <script src="../dist/CoCreate-file.js"></script> -->
|
|
62
|
+
<script src="../../../CoCreateJS/dist/CoCreate.js"></script>
|
|
63
|
+
<!-- <script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script> -->
|
|
40
64
|
</body>
|
|
41
65
|
</html>
|
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 convenient chain handler allows user to chain multiple components together. When one file is complete next one will start untill all file completed." />
|
|
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="/docs/index.css"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
array="files"
|
|
33
|
+
object="60888216117c640e7596303f"
|
|
34
|
+
key="src"
|
|
35
35
|
type="text/css"
|
|
36
36
|
save="true" />
|
|
37
37
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
scroll="sticky-nav,hide-nav"
|
|
45
45
|
scroll-up="10"
|
|
46
46
|
scroll-down="10"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
array="files"
|
|
48
|
+
object="60395ef42b3ac232657040fd"
|
|
49
|
+
key="src"></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"
|
|
53
53
|
resizable
|
|
54
|
-
resize-
|
|
54
|
+
resize-selector="[content_id='content']"
|
|
55
55
|
resize-property="margin-left"
|
|
56
56
|
resize-value="width">
|
|
57
57
|
<menu
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
array="files"
|
|
59
|
+
object="603717b07de7fb350ae9fec8"
|
|
60
|
+
key="src"></menu>
|
|
61
61
|
<div resize="right"></div>
|
|
62
62
|
</sidenav>
|
|
63
63
|
<main
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
share-width="700"
|
|
81
81
|
share-media="https://cdn.cocreate.app/docs/file.png"
|
|
82
82
|
hover="display:block!important"
|
|
83
|
-
hover-
|
|
83
|
+
hover-selector=".social-networks">
|
|
84
84
|
<div class="display:none social-networks">
|
|
85
85
|
<a
|
|
86
86
|
class="margin-right:15px"
|
|
@@ -151,11 +151,11 @@
|
|
|
151
151
|
class="border-bottom:1px_solid_lightgrey"
|
|
152
152
|
scroll
|
|
153
153
|
scroll-intersect="color:dodgerblue"
|
|
154
|
-
scroll-
|
|
154
|
+
scroll-selector="#file-install-section">
|
|
155
155
|
<span
|
|
156
156
|
class="display:flex align-items:center width:fit-content"
|
|
157
157
|
hover="display:block!important"
|
|
158
|
-
hover-
|
|
158
|
+
hover-selector="[href='#file-install']">
|
|
159
159
|
<h2 class="padding:5px_0px">Install</h2>
|
|
160
160
|
<a
|
|
161
161
|
class="margin-left:10px display:none"
|
|
@@ -178,11 +178,11 @@
|
|
|
178
178
|
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
179
179
|
scroll
|
|
180
180
|
scroll-intersect="color:dodgerblue"
|
|
181
|
-
scroll-
|
|
181
|
+
scroll-selector="#file-usage-section">
|
|
182
182
|
<span
|
|
183
183
|
class="display:flex align-items:center width:fit-content"
|
|
184
184
|
hover="display:block!important"
|
|
185
|
-
hover-
|
|
185
|
+
hover-selector="[href='#file-usage']">
|
|
186
186
|
<h2 class="padding:5px_0px">Usage</h2>
|
|
187
187
|
<a
|
|
188
188
|
class="margin-left:10px display:none"
|
|
@@ -214,11 +214,11 @@
|
|
|
214
214
|
class="margin-top:80px border-bottom:1px_solid_lightgrey"
|
|
215
215
|
scroll
|
|
216
216
|
scroll-intersect="color:dodgerblue"
|
|
217
|
-
scroll-
|
|
217
|
+
scroll-selector="#file-attributes-section">
|
|
218
218
|
<span
|
|
219
219
|
class="display:flex align-items:center width:fit-content"
|
|
220
220
|
hover="display:block!important"
|
|
221
|
-
hover-
|
|
221
|
+
hover-selector="[href='#file-attributes']">
|
|
222
222
|
<h2 class="padding:5px_0px">Attributes</h2>
|
|
223
223
|
<a
|
|
224
224
|
class="margin-left:10px display:none"
|
|
@@ -268,11 +268,11 @@
|
|
|
268
268
|
class="border-bottom:1px_solid_lightgrey"
|
|
269
269
|
scroll
|
|
270
270
|
scroll-intersect="color:dodgerblue"
|
|
271
|
-
scroll-
|
|
271
|
+
scroll-selector="#file-demo-section">
|
|
272
272
|
<span
|
|
273
273
|
class="display:flex align-items:center width:fit-content"
|
|
274
274
|
hover="display:block!important"
|
|
275
|
-
hover-
|
|
275
|
+
hover-selector="[href='#file-demo']">
|
|
276
276
|
<h2 class="padding:5px_0px">Demo</h2>
|
|
277
277
|
<a
|
|
278
278
|
class="margin-left:10px display:none"
|
|
@@ -297,9 +297,9 @@
|
|
|
297
297
|
<textarea
|
|
298
298
|
type="code"
|
|
299
299
|
lang="html"
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
array="demos"
|
|
301
|
+
object=""
|
|
302
|
+
key="demo"
|
|
303
303
|
save="false"
|
|
304
304
|
id="demo"
|
|
305
305
|
class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
show="#eye-slash"
|
|
323
323
|
hide="#eye, #demo-preview"
|
|
324
324
|
toggle="code-height"
|
|
325
|
-
toggle-
|
|
325
|
+
toggle-selector="#demo-code"
|
|
326
326
|
><i
|
|
327
327
|
class="height:18px fill:#505050"
|
|
328
328
|
src="/assets/svg/eye.svg"></i
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
show="#eye, #demo-preview"
|
|
335
335
|
hide="#eye-slash"
|
|
336
336
|
toggle="code-height"
|
|
337
|
-
toggle-
|
|
337
|
+
toggle-selector="#demo-code"
|
|
338
338
|
><i
|
|
339
339
|
class="height:20px fill:#505050"
|
|
340
340
|
src="/assets/svg/eye-slash.svg"></i
|
|
@@ -361,7 +361,7 @@
|
|
|
361
361
|
<a
|
|
362
362
|
class="margin-right:5px"
|
|
363
363
|
fullscreen
|
|
364
|
-
fullscreen-
|
|
364
|
+
fullscreen-selector="#playground"></a>
|
|
365
365
|
</div>
|
|
366
366
|
</div>
|
|
367
367
|
<!-- End SandBox -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/file",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"start": "npx webpack --config webpack.config.js",
|
|
29
|
-
"build": "
|
|
29
|
+
"build": "npx webpack --mode=production --config webpack.config.js",
|
|
30
30
|
"dev": "npx webpack --config webpack.config.js --watch",
|
|
31
31
|
"postinstal": "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); } }\""
|
|
32
32
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"url": "git+https://github.com/CoCreate-app/CoCreate-file.git"
|
|
36
36
|
},
|
|
37
37
|
"author": "CoCreate LLC",
|
|
38
|
-
"license": "
|
|
38
|
+
"license": "AGPL-3.0",
|
|
39
39
|
"bugs": {
|
|
40
40
|
"url": "https://github.com/CoCreate-app/CoCreate-file/issues"
|
|
41
41
|
},
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"webpack-log": "^3.0.1"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@cocreate/actions": "^1.
|
|
63
|
-
"@cocreate/config": "^1.
|
|
64
|
-
"@cocreate/render": "^1.
|
|
65
|
-
"@cocreate/utils": "^1.
|
|
62
|
+
"@cocreate/actions": "^1.9.0",
|
|
63
|
+
"@cocreate/config": "^1.2.0",
|
|
64
|
+
"@cocreate/render": "^1.25.0",
|
|
65
|
+
"@cocreate/utils": "^1.22.0"
|
|
66
66
|
}
|
|
67
67
|
}
|