@bananacool467/authtics-host 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -1,10 +1,8 @@
1
1
  # Authtics Host
2
2
 
3
- Version 0.1.0
3
+ Version 0.1.2
4
4
  License: MIT
5
5
 
6
- **(NOTE: THIS IS AUTHTICS HOST'S FIRST RELEASE 🎉🎉🎉)**
7
-
8
6
  Authtics Host is a framework inspired by Next.js. Authtics Host supports SSR (Server-Side Rendering) and uses esbuild.
9
7
 
10
8
  **(NOTE: The short name for Authtics Host is HostJS or Host.js)**
@@ -107,11 +105,12 @@ export default function App() {
107
105
  return (
108
106
  <RouteMap>
109
107
  <Route at="/" statusCode={200} page={Index} />
110
- <RouteMap/>
108
+ </RouteMap>
111
109
  )
112
110
  }
113
111
  ```
114
112
  **(NOTE: You can change the `statusCode` to anything you want, the property is optional, it either gives 404 or 200 if the `statusCode` is missing.)**
113
+
115
114
  **(NOTE: To make an 404 page you can use:**
116
115
  ```tsx
117
116
  <Route statusCode={404} page={NotFound} />
@@ -160,6 +159,8 @@ The Developer Panel is what you could use to help you debug your code. The Devel
160
159
  **About Host** — Shows the current version of Authtics Host
161
160
  **Server Info** — Shows how much heap was used and how much CPU was used on the server and how much requests there were and how much users are currently on the site and how long the site has been up
162
161
 
162
+ The information the Developer Panel shows is just your **DAT** (Developer Access Token).
163
+
163
164
  **(NOTE: If you do not set DAT restriction (Which will be explained on how to set it up in the next section), you will only get access to the Console and Network tabs)**
164
165
 
165
166
  ## Developer Panel Notes And Warnings And DAT (Developer Access Token)
package/dist/devPanel.js CHANGED
@@ -177,6 +177,9 @@ export default function DevPanel() {
177
177
  const [hostName, setHostName] = useState(undefined);
178
178
  const [protocol, setProtocol] = useState(undefined);
179
179
  const [path, setPath] = useState(undefined);
180
+ const contextMenuTimeoutMobile = useRef(undefined);
181
+ const [cursorPosition, setCursorPosition] = useState({ x: 0, y: 0 });
182
+ const [contextMenuShown, setContextMenuShown] = useState(false);
180
183
  const [isSsr, setIsSsr] = useState(false);
181
184
  const datRestrictionMissingRef = useRef(true);
182
185
  const cpuUsage = useRef(0);
@@ -376,6 +379,18 @@ export default function DevPanel() {
376
379
  }, 250);
377
380
  }, 250);
378
381
  }, []);
382
+ const datTouchStart = (e) => {
383
+ e.preventDefault();
384
+ setCursorPosition({ x: e.clientX || e.touches[0].clientX, y: e.clientY || e.touches[0].clientY });
385
+ contextMenuTimeoutMobile.current = setTimeout(() => {
386
+ setContextMenuShown(true);
387
+ clearTimeout(contextMenuTimeoutMobile.current);
388
+ }, 1000);
389
+ };
390
+ const datTouchEnd = (e) => {
391
+ e.preventDefault();
392
+ clearTimeout(contextMenuTimeoutMobile.current);
393
+ };
379
394
  const restart = async () => {
380
395
  const resp = await fetch('/__authtics_host_apis__/restart', {
381
396
  method: 'POST',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananacool467/authtics-host",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A Next.js-inspired SSR framework for Node.js with TypeScript and JSX support.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -36,7 +36,8 @@
36
36
  "hot-reload",
37
37
  "dev",
38
38
  "developer",
39
- "HostJS"
39
+ "HostJS",
40
+ "Host.js"
40
41
  ],
41
42
  "author": "bananacool467",
42
43
  "license": "MIT",