@putkoff/abstract-securefiles 0.0.27 → 0.0.32
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/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/secure_files.tsx +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
4
5
|
var abstractFiles = require('@putkoff/abstract-files');
|
|
5
6
|
var abstractUtilities = require('@putkoff/abstract-utilities');
|
|
6
7
|
|
|
@@ -9,7 +10,7 @@ function checkTokenValid() {
|
|
|
9
10
|
return !!tok && !abstractUtilities.isTokenExpired(tok);
|
|
10
11
|
}
|
|
11
12
|
const SecureFiles = () => {
|
|
12
|
-
const [loggedIn, setLoggedIn] =
|
|
13
|
+
const [loggedIn, setLoggedIn] = react.useState(checkTokenValid());
|
|
13
14
|
const filesHook = abstractFiles.useFiles(); // ← one single hook instance
|
|
14
15
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(abstractFiles.Upload, { onUploaded: filesHook.load }), jsxRuntime.jsx(abstractFiles.FileTable, { files: filesHook.files, loading: filesHook.loading, error: filesHook.error, onDownload: filesHook.toggleShare, onToggleShare: filesHook.toggleShare, onPatchShare: filesHook.patchShareSettings, onDelete: filesHook.deleteFile })] }));
|
|
15
16
|
};
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/secure_files.tsx"],"sourcesContent":["// src/App.tsx\n// src/index.tsx\nimport './styles/index.css';\nimport React from \"react\";\nimport {\n useFiles,\n FileTable,\n Upload\n} from \"@putkoff/abstract-files\";\n\nimport {\n getToken, // ⬅️ use the *non-throwing* helper\n isTokenExpired
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/secure_files.tsx"],"sourcesContent":["// src/App.tsx\n// src/index.tsx\nimport './styles/index.css';\nimport React from \"react\";\nimport { useState} from 'react';\nimport {\n useFiles,\n FileTable,\n Upload\n} from \"@putkoff/abstract-files\";\n\nimport {\n getToken, // ⬅️ use the *non-throwing* helper\n isTokenExpired\n} from \"@putkoff/abstract-utilities\";\nfunction checkTokenValid() {\n const tok = getToken();\n return !!tok && !isTokenExpired(tok);\n}\nconst SecureFiles: React.FC = () => {\n const [loggedIn, setLoggedIn] = useState(checkTokenValid());\n const filesHook = useFiles(); // ← one single hook instance\n return (\n <>\n {/* pass the same load & file‐list into both children */}\n <Upload onUploaded={filesHook.load} />\n <FileTable\n files={filesHook.files}\n loading={filesHook.loading}\n error={filesHook.error}\n onDownload={filesHook.toggleShare} // or downloadFile\n onToggleShare={filesHook.toggleShare}\n onPatchShare={filesHook.patchShareSettings}\n onDelete={filesHook.deleteFile}\n />\n\n </>\n )\n}\n\nexport default SecureFiles;"],"names":["getToken","isTokenExpired","useState","useFiles","_jsxs","_Fragment","_jsx","Upload","FileTable"],"mappings":";;;;;;;AAeA,SAAS,eAAe,GAAA;AACtB,IAAA,MAAM,GAAG,GAAGA,0BAAQ,EAAE;IACtB,OAAO,CAAC,CAAC,GAAG,IAAI,CAACC,gCAAc,CAAC,GAAG,CAAC;AACtC;AACA,MAAM,WAAW,GAAa,MAAK;IACjC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAGC,cAAQ,CAAC,eAAe,EAAE,CAAC;AAC3D,IAAA,MAAM,SAAS,GAAGC,sBAAQ,EAAE,CAAC;IAC7B,QACEC,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CAEEC,cAAA,CAACC,oBAAM,EAAA,EAAC,UAAU,EAAE,SAAS,CAAC,IAAI,EAAA,CAAI,EACtCD,cAAA,CAACE,uBAAS,EAAA,EACR,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,OAAO,EAAE,SAAS,CAAC,OAAO,EAC1B,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,UAAU,EAAE,SAAS,CAAC,WAAW,EACjC,aAAa,EAAE,SAAS,CAAC,WAAW,EACpC,YAAY,EAAE,SAAS,CAAC,kBAAkB,EAC1C,QAAQ,EAAE,SAAS,CAAC,UAAU,EAAA,CAC9B,CAAA,EAAA,CAED;AAEP;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { useFiles, Upload, FileTable } from '@putkoff/abstract-files';
|
|
3
|
-
import {
|
|
4
|
+
import { getToken, isTokenExpired } from '@putkoff/abstract-utilities';
|
|
4
5
|
|
|
5
6
|
function checkTokenValid() {
|
|
6
7
|
const tok = getToken();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/secure_files.tsx"],"sourcesContent":["// src/App.tsx\n// src/index.tsx\nimport './styles/index.css';\nimport React from \"react\";\nimport {\n useFiles,\n FileTable,\n Upload\n} from \"@putkoff/abstract-files\";\n\nimport {\n getToken, // ⬅️ use the *non-throwing* helper\n isTokenExpired
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/secure_files.tsx"],"sourcesContent":["// src/App.tsx\n// src/index.tsx\nimport './styles/index.css';\nimport React from \"react\";\nimport { useState} from 'react';\nimport {\n useFiles,\n FileTable,\n Upload\n} from \"@putkoff/abstract-files\";\n\nimport {\n getToken, // ⬅️ use the *non-throwing* helper\n isTokenExpired\n} from \"@putkoff/abstract-utilities\";\nfunction checkTokenValid() {\n const tok = getToken();\n return !!tok && !isTokenExpired(tok);\n}\nconst SecureFiles: React.FC = () => {\n const [loggedIn, setLoggedIn] = useState(checkTokenValid());\n const filesHook = useFiles(); // ← one single hook instance\n return (\n <>\n {/* pass the same load & file‐list into both children */}\n <Upload onUploaded={filesHook.load} />\n <FileTable\n files={filesHook.files}\n loading={filesHook.loading}\n error={filesHook.error}\n onDownload={filesHook.toggleShare} // or downloadFile\n onToggleShare={filesHook.toggleShare}\n onPatchShare={filesHook.patchShareSettings}\n onDelete={filesHook.deleteFile}\n />\n\n </>\n )\n}\n\nexport default SecureFiles;"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;AAeA,SAAS,eAAe,GAAA;AACtB,IAAA,MAAM,GAAG,GAAG,QAAQ,EAAE;IACtB,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;AACtC;AACA,MAAM,WAAW,GAAa,MAAK;IACjC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;AAC3D,IAAA,MAAM,SAAS,GAAG,QAAQ,EAAE,CAAC;IAC7B,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CAEEC,GAAA,CAAC,MAAM,EAAA,EAAC,UAAU,EAAE,SAAS,CAAC,IAAI,EAAA,CAAI,EACtCA,GAAA,CAAC,SAAS,EAAA,EACR,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,OAAO,EAAE,SAAS,CAAC,OAAO,EAC1B,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,UAAU,EAAE,SAAS,CAAC,WAAW,EACjC,aAAa,EAAE,SAAS,CAAC,WAAW,EACpC,YAAY,EAAE,SAAS,CAAC,kBAAkB,EAC1C,QAAQ,EAAE,SAAS,CAAC,UAAU,EAAA,CAC9B,CAAA,EAAA,CAED;AAEP;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putkoff/abstract-securefiles",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"description": "A reusable Secure file system",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@heroicons/react": "^2.2.0",
|
|
37
|
-
"@putkoff/abstract-apis": "0.0.
|
|
38
|
-
"@putkoff/abstract-files": "0.0.
|
|
39
|
-
"@putkoff/abstract-utilities": "1.0.
|
|
37
|
+
"@putkoff/abstract-apis": "0.0.456",
|
|
38
|
+
"@putkoff/abstract-files": "0.0.304",
|
|
39
|
+
"@putkoff/abstract-utilities": "1.0.156",
|
|
40
40
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
41
41
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
42
42
|
"@tailwindcss/postcss": "^4.1.11",
|
package/src/secure_files.tsx
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// src/index.tsx
|
|
3
3
|
import './styles/index.css';
|
|
4
4
|
import React from "react";
|
|
5
|
+
import { useState} from 'react';
|
|
5
6
|
import {
|
|
6
7
|
useFiles,
|
|
7
8
|
FileTable,
|
|
@@ -10,8 +11,7 @@ import {
|
|
|
10
11
|
|
|
11
12
|
import {
|
|
12
13
|
getToken, // ⬅️ use the *non-throwing* helper
|
|
13
|
-
isTokenExpired
|
|
14
|
-
useState
|
|
14
|
+
isTokenExpired
|
|
15
15
|
} from "@putkoff/abstract-utilities";
|
|
16
16
|
function checkTokenValid() {
|
|
17
17
|
const tok = getToken();
|