@arcanejs/toolkit-frontend 0.3.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.
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+
3
+ interface Props extends React.HTMLAttributes<HTMLSpanElement> {
4
+ /**
5
+ * Icon name from https://fonts.google.com/icons?icon.style=Outlined
6
+ */
7
+ icon: string;
8
+ }
9
+ declare const Icon: React.FunctionComponent<Props>;
10
+
11
+ declare const TRANSPARENCY_SVG = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\">\n <rect width=\"10px\" height=\"10px\" fill=\"#333\" />\n <rect width=\"5px\" height=\"5px\" fill=\"#ddd\" y=\"5\"/>\n <rect width=\"5px\" height=\"5px\" fill=\"#ddd\" x=\"5\"/>\n</svg>\n";
12
+ declare const TRANSPARENCY_SVG_URI: string;
13
+
14
+ declare const index_Icon: typeof Icon;
15
+ declare const index_TRANSPARENCY_SVG: typeof TRANSPARENCY_SVG;
16
+ declare const index_TRANSPARENCY_SVG_URI: typeof TRANSPARENCY_SVG_URI;
17
+ declare namespace index {
18
+ export { index_Icon as Icon, index_TRANSPARENCY_SVG as TRANSPARENCY_SVG, index_TRANSPARENCY_SVG_URI as TRANSPARENCY_SVG_URI };
19
+ }
20
+
21
+ export { Icon as I, TRANSPARENCY_SVG as T, TRANSPARENCY_SVG_URI as a, index as i };
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+
3
+ interface Props extends React.HTMLAttributes<HTMLSpanElement> {
4
+ /**
5
+ * Icon name from https://fonts.google.com/icons?icon.style=Outlined
6
+ */
7
+ icon: string;
8
+ }
9
+ declare const Icon: React.FunctionComponent<Props>;
10
+
11
+ declare const TRANSPARENCY_SVG = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\">\n <rect width=\"10px\" height=\"10px\" fill=\"#333\" />\n <rect width=\"5px\" height=\"5px\" fill=\"#ddd\" y=\"5\"/>\n <rect width=\"5px\" height=\"5px\" fill=\"#ddd\" x=\"5\"/>\n</svg>\n";
12
+ declare const TRANSPARENCY_SVG_URI: string;
13
+
14
+ declare const index_Icon: typeof Icon;
15
+ declare const index_TRANSPARENCY_SVG: typeof TRANSPARENCY_SVG;
16
+ declare const index_TRANSPARENCY_SVG_URI: typeof TRANSPARENCY_SVG_URI;
17
+ declare namespace index {
18
+ export { index_Icon as Icon, index_TRANSPARENCY_SVG as TRANSPARENCY_SVG, index_TRANSPARENCY_SVG_URI as TRANSPARENCY_SVG_URI };
19
+ }
20
+
21
+ export { Icon as I, TRANSPARENCY_SVG as T, TRANSPARENCY_SVG_URI as a, index as i };
@@ -0,0 +1,36 @@
1
+ import { createGlobalStyle, RuleSet } from 'styled-components';
2
+
3
+ declare const GlobalStyle: ReturnType<typeof createGlobalStyle>;
4
+ declare const THEME: {
5
+ colorGreen: string;
6
+ colorRed: string;
7
+ colorAmber: string;
8
+ bgDark1: string;
9
+ bg: string;
10
+ bgLight1: string;
11
+ borderDark: string;
12
+ borderLight: string;
13
+ borderLighter: string;
14
+ borderLighterer: string;
15
+ hint: string;
16
+ hintRGB: string;
17
+ hintDark1: string;
18
+ textNormal: string;
19
+ textMuted: string;
20
+ sizingPx: {
21
+ spacing: number;
22
+ unitHeight: number;
23
+ };
24
+ };
25
+ type Theme = typeof THEME;
26
+ declare const BaseStyle: ReturnType<typeof createGlobalStyle>;
27
+ declare const buttonStateNormal: RuleSet<object>;
28
+ declare const buttonStateNormalHover: RuleSet<object>;
29
+ declare const buttonStateNormalActive: RuleSet<object>;
30
+ declare const buttonPressed: RuleSet<object>;
31
+ declare const buttonDisabled: RuleSet<object>;
32
+ declare const rectButton: RuleSet<object>;
33
+ declare const touchIndicatorNormal: RuleSet<object>;
34
+ declare const touchIndicatorTouching: RuleSet<object>;
35
+
36
+ export { BaseStyle, GlobalStyle, THEME, type Theme, buttonDisabled, buttonPressed, buttonStateNormal, buttonStateNormalActive, buttonStateNormalHover, rectButton, touchIndicatorNormal, touchIndicatorTouching };
@@ -0,0 +1,36 @@
1
+ import { createGlobalStyle, RuleSet } from 'styled-components';
2
+
3
+ declare const GlobalStyle: ReturnType<typeof createGlobalStyle>;
4
+ declare const THEME: {
5
+ colorGreen: string;
6
+ colorRed: string;
7
+ colorAmber: string;
8
+ bgDark1: string;
9
+ bg: string;
10
+ bgLight1: string;
11
+ borderDark: string;
12
+ borderLight: string;
13
+ borderLighter: string;
14
+ borderLighterer: string;
15
+ hint: string;
16
+ hintRGB: string;
17
+ hintDark1: string;
18
+ textNormal: string;
19
+ textMuted: string;
20
+ sizingPx: {
21
+ spacing: number;
22
+ unitHeight: number;
23
+ };
24
+ };
25
+ type Theme = typeof THEME;
26
+ declare const BaseStyle: ReturnType<typeof createGlobalStyle>;
27
+ declare const buttonStateNormal: RuleSet<object>;
28
+ declare const buttonStateNormalHover: RuleSet<object>;
29
+ declare const buttonStateNormalActive: RuleSet<object>;
30
+ declare const buttonPressed: RuleSet<object>;
31
+ declare const buttonDisabled: RuleSet<object>;
32
+ declare const rectButton: RuleSet<object>;
33
+ declare const touchIndicatorNormal: RuleSet<object>;
34
+ declare const touchIndicatorTouching: RuleSet<object>;
35
+
36
+ export { BaseStyle, GlobalStyle, THEME, type Theme, buttonDisabled, buttonPressed, buttonStateNormal, buttonStateNormalActive, buttonStateNormalHover, rectButton, touchIndicatorNormal, touchIndicatorTouching };
@@ -0,0 +1,27 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+ var _chunkY5UYS6EXjs = require('./chunk-Y5UYS6EX.js');
14
+ require('./chunk-MLKGABMK.js');
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+ exports.BaseStyle = _chunkY5UYS6EXjs.BaseStyle; exports.GlobalStyle = _chunkY5UYS6EXjs.GlobalStyle; exports.THEME = _chunkY5UYS6EXjs.THEME; exports.buttonDisabled = _chunkY5UYS6EXjs.buttonDisabled; exports.buttonPressed = _chunkY5UYS6EXjs.buttonPressed; exports.buttonStateNormal = _chunkY5UYS6EXjs.buttonStateNormal; exports.buttonStateNormalActive = _chunkY5UYS6EXjs.buttonStateNormalActive; exports.buttonStateNormalHover = _chunkY5UYS6EXjs.buttonStateNormalHover; exports.rectButton = _chunkY5UYS6EXjs.rectButton; exports.touchIndicatorNormal = _chunkY5UYS6EXjs.touchIndicatorNormal; exports.touchIndicatorTouching = _chunkY5UYS6EXjs.touchIndicatorTouching;
@@ -0,0 +1,27 @@
1
+ import {
2
+ BaseStyle,
3
+ GlobalStyle,
4
+ THEME,
5
+ buttonDisabled,
6
+ buttonPressed,
7
+ buttonStateNormal,
8
+ buttonStateNormalActive,
9
+ buttonStateNormalHover,
10
+ rectButton,
11
+ touchIndicatorNormal,
12
+ touchIndicatorTouching
13
+ } from "./chunk-6Z2ACPNM.mjs";
14
+ import "./chunk-7P6ASYW6.mjs";
15
+ export {
16
+ BaseStyle,
17
+ GlobalStyle,
18
+ THEME,
19
+ buttonDisabled,
20
+ buttonPressed,
21
+ buttonStateNormal,
22
+ buttonStateNormalActive,
23
+ buttonStateNormalHover,
24
+ rectButton,
25
+ touchIndicatorNormal,
26
+ touchIndicatorTouching
27
+ };
@@ -0,0 +1,9 @@
1
+ import { BaseComponentProto } from '@arcanejs/protocol';
2
+
3
+ type FrontendComponentRenderer = {
4
+ namespace: string;
5
+ render: (component: BaseComponentProto<string>) => JSX.Element;
6
+ };
7
+ type FrontendComponentRenderers = FrontendComponentRenderer[];
8
+
9
+ export type { FrontendComponentRenderer, FrontendComponentRenderers };
@@ -0,0 +1,9 @@
1
+ import { BaseComponentProto } from '@arcanejs/protocol';
2
+
3
+ type FrontendComponentRenderer = {
4
+ namespace: string;
5
+ render: (component: BaseComponentProto<string>) => JSX.Element;
6
+ };
7
+ type FrontendComponentRenderers = FrontendComponentRenderer[];
8
+
9
+ export type { FrontendComponentRenderer, FrontendComponentRenderers };
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";
package/dist/types.mjs ADDED
File without changes
@@ -0,0 +1,23 @@
1
+ declare function switchToMouseMode(ev: MouseEvent): void;
2
+ declare function switchToTouchMode(): void;
3
+ declare function initialiseListeners(): void;
4
+ declare const usePressable: (click: () => void) => {
5
+ touching: boolean;
6
+ handlers: {
7
+ onClick: React.MouseEventHandler<unknown>;
8
+ onTouchStart: React.TouchEventHandler<unknown>;
9
+ onTouchMove: React.TouchEventHandler<unknown>;
10
+ onTouchEnd: React.TouchEventHandler<unknown>;
11
+ };
12
+ };
13
+ declare function trackTouch(touch: React.Touch, move: (pos: {
14
+ pageX: number;
15
+ pageY: number;
16
+ }) => void, end: (pos: {
17
+ pageX: number;
18
+ pageY: number;
19
+ }) => void): void;
20
+
21
+ declare const calculateClass: (...args: (string | undefined | null | false)[]) => string;
22
+
23
+ export { calculateClass, initialiseListeners, switchToMouseMode, switchToTouchMode, trackTouch, usePressable };
@@ -0,0 +1,23 @@
1
+ declare function switchToMouseMode(ev: MouseEvent): void;
2
+ declare function switchToTouchMode(): void;
3
+ declare function initialiseListeners(): void;
4
+ declare const usePressable: (click: () => void) => {
5
+ touching: boolean;
6
+ handlers: {
7
+ onClick: React.MouseEventHandler<unknown>;
8
+ onTouchStart: React.TouchEventHandler<unknown>;
9
+ onTouchMove: React.TouchEventHandler<unknown>;
10
+ onTouchEnd: React.TouchEventHandler<unknown>;
11
+ };
12
+ };
13
+ declare function trackTouch(touch: React.Touch, move: (pos: {
14
+ pageX: number;
15
+ pageY: number;
16
+ }) => void, end: (pos: {
17
+ pageX: number;
18
+ pageY: number;
19
+ }) => void): void;
20
+
21
+ declare const calculateClass: (...args: (string | undefined | null | false)[]) => string;
22
+
23
+ export { calculateClass, initialiseListeners, switchToMouseMode, switchToTouchMode, trackTouch, usePressable };
@@ -0,0 +1,17 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkXEIKOLS2js = require('../chunk-XEIKOLS2.js');
9
+ require('../chunk-MLKGABMK.js');
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ exports.calculateClass = _chunkXEIKOLS2js.calculateClass; exports.initialiseListeners = _chunkXEIKOLS2js.initialiseListeners; exports.switchToMouseMode = _chunkXEIKOLS2js.switchToMouseMode; exports.switchToTouchMode = _chunkXEIKOLS2js.switchToTouchMode; exports.trackTouch = _chunkXEIKOLS2js.trackTouch; exports.usePressable = _chunkXEIKOLS2js.usePressable;
@@ -0,0 +1,17 @@
1
+ import {
2
+ calculateClass,
3
+ initialiseListeners,
4
+ switchToMouseMode,
5
+ switchToTouchMode,
6
+ trackTouch,
7
+ usePressable
8
+ } from "../chunk-35U577MM.mjs";
9
+ import "../chunk-7P6ASYW6.mjs";
10
+ export {
11
+ calculateClass,
12
+ initialiseListeners,
13
+ switchToMouseMode,
14
+ switchToTouchMode,
15
+ trackTouch,
16
+ usePressable
17
+ };
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@arcanejs/toolkit-frontend",
3
+ "version": "0.3.0",
4
+ "private": false,
5
+ "description": "Library of the frontend react components used to render the @arcanejs Toolkit",
6
+ "keywords": [],
7
+ "license": "MIT",
8
+ "author": {
9
+ "name": "Sam Lanning",
10
+ "url": "https://samlanning.com"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/arcanejs/arcanejs.git"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "@arcanejs/source": "./src/components/index.tsx",
19
+ "types": "./dist/components/index.d.ts",
20
+ "import": "./dist/components/index.mjs",
21
+ "require": "./dist/components/index.js"
22
+ },
23
+ "./components/core": {
24
+ "@arcanejs/source": "./src/components/core/index.ts",
25
+ "types": "./dist/components/core/index.d.ts",
26
+ "import": "./dist/components/core/index.mjs",
27
+ "require": "./dist/components/core/index.js"
28
+ },
29
+ "./styling": {
30
+ "@arcanejs/source": "./src/styling.ts",
31
+ "types": "./dist/styling.d.ts",
32
+ "import": "./dist/styling.mjs",
33
+ "require": "./dist/styling.js"
34
+ },
35
+ "./types": {
36
+ "@arcanejs/source": "./src/types.ts",
37
+ "types": "./dist/types.d.ts",
38
+ "import": "./dist/types.mjs",
39
+ "require": "./dist/types.js"
40
+ },
41
+ "./util": {
42
+ "@arcanejs/source": "./src/util/index.ts",
43
+ "types": "./dist/util/index.d.ts",
44
+ "import": "./dist/util/index.mjs",
45
+ "require": "./dist/util/index.js"
46
+ },
47
+ "./package.json": "./package.json"
48
+ },
49
+ "devDependencies": {
50
+ "@types/eslint": "^8.56.5",
51
+ "@types/node": "^20.11.24",
52
+ "@types/react": "^18",
53
+ "@types/react-dom": "^18",
54
+ "check-export-map": "^1.3.1",
55
+ "eslint": "^8.57.0",
56
+ "tsup": "^8.1.0",
57
+ "typescript": "^5.3.3",
58
+ "@arcanejs/eslint-config": "^0.0.0",
59
+ "@arcanejs/typescript-config": "^0.0.0"
60
+ },
61
+ "dependencies": {
62
+ "react": "^18",
63
+ "react-dom": "18.3.1",
64
+ "styled-components": "^6.1.13",
65
+ "@arcanejs/protocol": "^0.4.0"
66
+ },
67
+ "files": [
68
+ "dist"
69
+ ],
70
+ "publishConfig": {
71
+ "access": "public"
72
+ },
73
+ "scripts": {
74
+ "lint": "eslint . --max-warnings 0",
75
+ "build": "rm -rf dist && tsup && check-export-map"
76
+ }
77
+ }