@prozilla-os/calculator 1.1.18 → 1.1.21

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/main.d.ts CHANGED
@@ -1,6 +1,229 @@
1
- import { App } from '@prozilla-os/core';
2
- import { WindowProps } from '@prozilla-os/core';
1
+ import { FC } from 'react';
2
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
3
+
4
+ /**
5
+ * An application that can be ran by ProzillaOS.
6
+ *
7
+ * Applications can be installed by adding them to {@link AppsConfig.apps}.
8
+ * @typeParam AppProps - The props of the {@link windowContent} of this app.
9
+ */
10
+ declare class App<AppProps extends WindowProps = WindowProps> {
11
+ /**
12
+ * The display name of this application.
13
+ */
14
+ name: string;
15
+ /**
16
+ * The unique ID of this application.
17
+ */
18
+ id: string;
19
+ /**
20
+ * Main component that renders this app inside a window.
21
+ */
22
+ windowContent: FC<AppProps> | null;
23
+ /**
24
+ * Default options that get passed to the {@link App.windowContent} component.
25
+ */
26
+ windowOptions?: Partial<AppProps> & DefaultWindowOptions;
27
+ /**
28
+ * Description of this application.
29
+ */
30
+ description: string | null;
31
+ /**
32
+ * URL of the icon of this application.
33
+ */
34
+ iconUrl: string | null;
35
+ /**
36
+ * Defines what the app can handle and how it can be used elsewhere in the system.
37
+ */
38
+ role: string | null;
39
+ /**
40
+ * An array of file extensions that this application can interpret.
41
+ */
42
+ associatedExtensions: string[];
43
+ /**
44
+ * Determines whether the app is pinned by default.
45
+ * @default true
46
+ */
47
+ pinnedByDefault: boolean;
48
+ /**
49
+ * Determines whether the app is launched at startup.
50
+ * @default false
51
+ */
52
+ launchAtStartup: boolean;
53
+ /**
54
+ * The category the app belongs to.
55
+ */
56
+ category: typeof APP_CATEGORIES[number] | null;
57
+ /**
58
+ * Metadata of the app's package.
59
+ */
60
+ metadata: AppMetadata | null;
61
+ /**
62
+ * Determines whether a desktop icon is added to the default data.
63
+ * @default false
64
+ */
65
+ showDesktopIcon: boolean;
66
+ isActive: boolean;
67
+ isPinned?: boolean;
68
+ isInstalled: boolean;
69
+ constructor(name: App["name"], id: App["id"], windowContent: App<AppProps>["windowContent"], windowOptions?: Partial<AppProps> & DefaultWindowOptions);
70
+ /**
71
+ * Returns the component that renders the content of a window for this app.
72
+ */
73
+ WindowContent: (props: AppProps) => JSX_2.Element | null;
74
+ /**
75
+ * Sets the display name of this application.
76
+ */
77
+ setName(name: string): this;
78
+ /**
79
+ * Sets the description of this application.
80
+ */
81
+ setDescription(description: App["description"]): this;
82
+ /**
83
+ * Sets the URL of the icon of this application.
84
+ */
85
+ setIconUrl(iconUrl: App["iconUrl"]): this;
86
+ /**
87
+ * Sets the role of this application.
88
+ */
89
+ setRole(role: string | null): this;
90
+ /**
91
+ * Sets the associated extensions of this application.
92
+ */
93
+ setAssociatedExtensions(extensions: string[] | null): this;
94
+ /**
95
+ * Changes whether this application is pinned by default or not.
96
+ */
97
+ setPinnedByDefault(pinnedByDefault: boolean): this;
98
+ /**
99
+ * Changes whether this application is launched at startup or not.
100
+ */
101
+ setLaunchAtStartup(launchAtStartup: boolean): this;
102
+ /**
103
+ * Changes whether this application is installed by default or not.
104
+ */
105
+ setInstalled(installed: boolean): this;
106
+ /**
107
+ * Sets the category this application belongs to.
108
+ */
109
+ setCategory(category: typeof APP_CATEGORIES[number] | null): this;
110
+ /**
111
+ * Sets the metadata for this application.
112
+ */
113
+ setMetadata(metadata: AppMetadata | null): this;
114
+ /**
115
+ * Changes whether this application has a desktop icon in the default data.
116
+ */
117
+ setShowDesktopIcon(showDesktopIcon: boolean): this;
118
+ /**
119
+ * Sets the default options for the {@link App.windowContent} component.
120
+ */
121
+ setWindowOptions(windowOptions: Partial<AppProps> & DefaultWindowOptions): this;
122
+ }
123
+
124
+ declare const APP_CATEGORIES: readonly ["Business", "Developer tools", "Education", "Entertainment", "Food & dining", "Health & fitness", "Kids & family", "Lifestyle", "Media", "Medical", "Multimedia design", "Music", "Navigation & maps", "News & weather", "Personal finance", "Personalization", "Photo & video", "Productivity", "Security", "Shopping", "Social", "Sports", "Travel", "Utilities & tools"];
125
+
126
+ declare interface AppMetadata {
127
+ name: string;
128
+ version: `${number}.${number}.${number}`;
129
+ author: string;
130
+ }
3
131
 
4
132
  export declare const calculator: App<WindowProps>;
5
133
 
134
+ declare interface DefaultWindowOptions {
135
+ size?: Vector2;
136
+ [key: string]: unknown;
137
+ }
138
+
139
+ declare class Vector2 {
140
+ x: number;
141
+ y: number;
142
+ constructor(xy: number);
143
+ constructor(x: number, y?: number);
144
+ static get ZERO(): Vector2;
145
+ get clone(): Vector2;
146
+ get magnitude(): number;
147
+ setX(x: number): this;
148
+ setY(y: number): this;
149
+ set(x: number, y: number): this;
150
+ round(): this;
151
+ normalize(): this;
152
+ scale(scalar: number): this;
153
+ getDistanceSquared(x: number, y?: number): number;
154
+ getDistanceSquared(vector2: Vector2): number;
155
+ getDistance(x: number, y?: number): number;
156
+ getDistance(vector2: Vector2): number;
157
+ add(x: number, y?: number): this;
158
+ add(vector2: Vector2): this;
159
+ subtract(x: number, y?: number): this;
160
+ subtract(vector2: Vector2): this;
161
+ multiply(x: number, y?: number): this;
162
+ multiply(vector2: Vector2): this;
163
+ divide(x: number, y?: number): this;
164
+ divide(vector2: Vector2): this;
165
+ lerp(vector2: Vector2, t: number): this;
166
+ static sum(vector2A: Vector2, vector2B: Vector2): Vector2;
167
+ static difference(vector2A: Vector2, vector2B: Vector2): Vector2;
168
+ static product(vector2A: Vector2, vector2B: Vector2): Vector2;
169
+ static division(vector2A: Vector2, vector2B: Vector2): Vector2;
170
+ static scale(vector2: Vector2, scalar: number): Vector2;
171
+ static normalize(vector2: Vector2): Vector2;
172
+ static lerp(vector2A: Vector2, vector2B: Vector2, t: number): Vector2;
173
+ static from({ x, y }: {
174
+ x: number;
175
+ y: number;
176
+ }): Vector2;
177
+ static parseVector(x: number | Vector2, y?: number): {
178
+ x: number;
179
+ y: number;
180
+ };
181
+ }
182
+
183
+ declare interface WindowOptions {
184
+ /** The ID of the window. */
185
+ id?: string;
186
+ /** The app associated with the window. */
187
+ app?: App;
188
+ /**
189
+ * The size of the window.
190
+ * @default new Vector2(700, 400)
191
+ */
192
+ size?: Vector2;
193
+ /** The position of the window. */
194
+ position?: Vector2;
195
+ fullscreen?: boolean | string;
196
+ options?: object;
197
+ isFocused?: boolean;
198
+ lastInteraction?: number;
199
+ minimized?: boolean;
200
+ [key: string]: unknown;
201
+ }
202
+
203
+ declare interface WindowProps extends WindowOptions {
204
+ /**
205
+ * Whether to start the window in fullscreen mode.
206
+ * @default false
207
+ */
208
+ fullscreen?: boolean;
209
+ /** Function that sets the title of the window. */
210
+ setTitle?: React.Dispatch<React.SetStateAction<string>>;
211
+ /** Function that sets the icon URL of the window. */
212
+ setIconUrl?: React.Dispatch<React.SetStateAction<string>>;
213
+ /** Function that closes the window. */
214
+ close?: (event?: Event | React.UIEvent<HTMLElement>) => void;
215
+ /** Function that brings the window in focus. */
216
+ focus?: (event?: Event | React.UIEvent<HTMLElement>, force?: boolean) => void;
217
+ /** Whether the window is currently focused and should allow interactions. */
218
+ active?: boolean;
219
+ /** Whether to start the window in minimized mode. */
220
+ minimized?: boolean;
221
+ /** Function that toggles the minimized mode of the window. */
222
+ toggleMinimized?: (event?: Event) => void;
223
+ /** The depth value of the window. */
224
+ index?: number;
225
+ /** Whether the window is in standalone mode. */
226
+ standalone?: boolean;
227
+ }
228
+
6
229
  export { }
package/dist/main.js CHANGED
@@ -1,7 +1,8 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode("._Calculator_ufkko_1{display:flex;flex-direction:column;height:100%;--output-height: 20%;--button-gap: .25rem}._Output_ufkko_10{display:flex;gap:.25rem;flex-direction:column;justify-content:center;align-items:flex-end;height:var(--output-height);padding:.5rem}._Calculation_ufkko_20,._Preview_ufkko_20{margin:0}._Calculation_ufkko_20{color:var(--foreground-color-2);height:1.25rem}._Preview_ufkko_20{color:var(--foreground-color-0);font-size:2.5rem}._Input_ufkko_34{display:flex;gap:var(--button-gap);flex-direction:column;height:calc(100% - var(--output-height));padding:.5rem}._InputRow_ufkko_42{flex:1;display:flex;gap:var(--button-gap)}._Button_ufkko_48{flex:1;border-radius:var(--border-radius-0);font-size:1.5rem}._InputRow_ufkko_42:first-of-type ._Button_ufkko_48{--normal-color: var(--background-color-1);--hover-color: var(--background-color-2)}._InputRow_ufkko_42 ._Button_ufkko_48:last-of-type{--text-color: var(--background-color-0);--normal-color: var(--blue-0);--hover-color: var(--blue-1)}._ButtonLarge_ufkko_65{min-width:calc(50% - var(--button-gap) / 2)}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { Button as a, App as R, Vector2 as $ } from "@prozilla-os/core";
2
+ import { Button as a, App as R } from "@prozilla-os/core";
3
3
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
4
- import { useState as f, useCallback as B, useEffect as F } from "react";
4
+ import { useState as f, useCallback as B, useEffect as $ } from "react";
5
+ import { Vector2 as F } from "@prozilla-os/shared";
5
6
  const L = "_Calculator_ufkko_1", O = "_Output_ufkko_10", P = "_Calculation_ufkko_20", g = "_Preview_ufkko_20", E = "_Input_ufkko_34", S = "_InputRow_ufkko_42", z = "_Button_ufkko_48", x = "_ButtonLarge_ufkko_65", e = {
6
7
  Calculator: L,
7
8
  Output: O,
@@ -17,7 +18,7 @@ function D({ active: b }) {
17
18
  o("0"), _(null), h(null), w(null);
18
19
  }, []), n = B((s) => {
19
20
  let c = !1;
20
- k != null && (I && l != null ? (_(parseFloat(l)), h(null), o(null)) : d(), c = !0), !(s === "." && (l != null && l.includes("."))) && (s === "-" ? l === "0" ? o("-0") : l != null && o((parseFloat(l) * -1).toString()) : s === "%" && l != null ? o((parseFloat(l) / 100).toString()) : l === "0" || l === "-0" || l == null || c ? o(s === "." ? "0." : l === "-0" ? `-${s}` : s) : o(l + s));
21
+ k != null && (I && l != null ? (_(parseFloat(l)), h(null), o(null)) : d(), c = !0), !(s === "." && l?.includes(".")) && (s === "-" ? l === "0" ? o("-0") : l != null && o((parseFloat(l) * -1).toString()) : s === "%" && l != null ? o((parseFloat(l) / 100).toString()) : l === "0" || l === "-0" || l == null || c ? o(s === "." ? "0." : l === "-0" ? `-${s}` : s) : o(l + s));
21
22
  }, [l, I, d, k]), m = B((s = !1) => {
22
23
  if (i != null && l != null) {
23
24
  h(parseFloat(l));
@@ -43,7 +44,7 @@ function D({ active: b }) {
43
44
  }, [i, l, N]), u = B((s) => {
44
45
  i != null && k == null ? m(!0) : l != null && (_(parseFloat(l)), h(null), o(null)), w(s);
45
46
  }, [m, i, l, k]);
46
- F(() => {
47
+ $(() => {
47
48
  const s = (c) => {
48
49
  if (b)
49
50
  switch (c.preventDefault(), c.key) {
@@ -167,8 +168,8 @@ function D({ active: b }) {
167
168
  ] })
168
169
  ] });
169
170
  }
170
- const j = new R("Calculator", "calculator", D, { size: new $(400, 600) }).setIconUrl("https://os.prozilla.dev/assets/apps/icons/calculator.svg").setPinnedByDefault(!1).setCategory("Utilities & tools");
171
- j.setMetadata({ name: "@prozilla-os/calculator", version: "1.1.17", author: "Prozilla" });
171
+ const j = new R("Calculator", "calculator", D, { size: new F(400, 600) }).setIconUrl("https://os.prozilla.dev/assets/apps/icons/calculator.svg").setPinnedByDefault(!1).setCategory("Utilities & tools");
172
+ j.setMetadata({ name: "@prozilla-os/calculator", version: "1.1.19", author: "Prozilla" });
172
173
  export {
173
174
  j as calculator
174
175
  };
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../src/components/Calculator.tsx","../src/main.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport styles from \"./Calculator.module.css\";\nimport { Button, WindowProps } from \"@prozilla-os/core\";\n\nexport function Calculator({ active }: WindowProps) {\n\tconst [input, setInput] = useState<string | null>(\"0\");\n\tconst [firstNumber, setFirstNumber] = useState<number | null>(null);\n\tconst [secondNumber, setSecondNumber] = useState<number | null>(null);\n\tconst [operation, setOperation] = useState<string | null>(null);\n\tconst [isIntermediate, setIsIntermediate] = useState(false);\n\n\tconst reset = useCallback(() => {\n\t\tsetInput(\"0\");\n\t\tsetFirstNumber(null);\n\t\tsetSecondNumber(null);\n\t\tsetOperation(null);\n\t}, []);\n\n\tconst addInput = useCallback((string: string) => {\n\t\tlet hasReset = false;\n\t\tif (secondNumber != null) {\n\t\t\tif (isIntermediate && input != null) {\n\t\t\t\tsetFirstNumber(parseFloat(input));\n\t\t\t\tsetSecondNumber(null);\n\t\t\t\tsetInput(null);\n\t\t\t} else {\n\t\t\t\treset();\n\t\t\t}\n\t\t\thasReset = true;\n\t\t}\t\t\t\n\n\t\tif (string === \".\" && input?.includes(\".\"))\n\t\t\treturn;\n\n\t\tif (string === \"-\") {\n\t\t\tif (input === \"0\") {\n\t\t\t\tsetInput(\"-0\");\n\t\t\t} else if (input != null) {\n\t\t\t\tsetInput((parseFloat(input) * -1).toString());\n\t\t\t}\n\t\t} else if (string === \"%\" && input != null) {\n\t\t\tsetInput((parseFloat(input) / 100).toString());\n\t\t} else if (input === \"0\" || input === \"-0\" || input == null || hasReset) {\n\t\t\tif (string === \".\") {\n\t\t\t\tsetInput(input === \"-0\" ? \"0.\" : \"0.\");\n\t\t\t} else {\n\t\t\t\tsetInput(input === \"-0\" ? `-${string}` : string);\n\t\t\t}\n\t\t} else {\n\t\t\tsetInput(input + string);\n\t\t}\n\n\t}, [input, isIntermediate, reset, secondNumber]);\n\n\tconst calculate = useCallback((intermediate = false) => {\n\t\tif (firstNumber != null && input != null) {\n\t\t\tsetSecondNumber(parseFloat(input));\n\n\t\t\tconst a = firstNumber;\n\t\t\tconst b = parseFloat(input);\n\t\t\t\n\t\t\tlet result = 0;\n\t\t\tswitch (operation) {\n\t\t\t\tcase \"×\":\n\t\t\t\t\tresult = a * b;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"÷\":\n\t\t\t\t\tresult = a / b;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = a + b;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = a - b;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tsetInput(result.toString());\n\t\t}\n\n\t\tsetIsIntermediate(intermediate);\n\t}, [firstNumber, input, operation]);\n\n\tconst changeOperation = useCallback((operation: string) => {\n\t\tif (firstNumber != null && secondNumber == null) {\n\t\t\tcalculate(true);\n\t\t} else if (input != null) {\n\t\t\tsetFirstNumber(parseFloat(input));\n\t\t\tsetSecondNumber(null);\n\t\t\tsetInput(null);\n\t\t}\n\n\t\tsetOperation(operation);\n\t}, [calculate, firstNumber, input, secondNumber]);\n\n\tuseEffect(() => {\n\t\tconst onKeyDown = (event: KeyboardEvent) => {\n\t\t\tif (!active)\n\t\t\t\treturn;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tswitch (event.key) {\n\t\t\t\tcase \"0\":\n\t\t\t\tcase \"1\":\n\t\t\t\tcase \"2\":\n\t\t\t\tcase \"3\":\n\t\t\t\tcase \"4\":\n\t\t\t\tcase \"5\":\n\t\t\t\tcase \"6\":\n\t\t\t\tcase \"7\":\n\t\t\t\tcase \"8\":\n\t\t\t\tcase \"9\":\n\t\t\t\t\taddInput(event.key);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \".\":\n\t\t\t\tcase \",\":\n\t\t\t\t\taddInput(\".\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Escape\":\n\t\t\t\t\treset();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"=\":\n\t\t\t\tcase \"Enter\":\n\t\t\t\t\tcalculate();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tchangeOperation(\"×\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"/\":\n\t\t\t\t\tchangeOperation(\"÷\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"+\":\n\t\t\t\tcase \"-\":\n\t\t\t\t\tchangeOperation(event.key);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"%\":\n\t\t\t\t\taddInput(\"%\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Backspace\":\n\t\t\t\t\tif (input != null && input.length > 0) {\n\t\t\t\t\t\tsetInput(input.slice(0, -1));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener(\"keydown\", onKeyDown);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"keydown\", onKeyDown);\n\t\t};\n\t}, [active, addInput, calculate, changeOperation, reset]);\n\n\tlet calculation = \"\";\n\tif (operation != null)\n\t\tcalculation = `${firstNumber} ${operation} ${secondNumber != null ? secondNumber + \" =\" : \"\"}`;\n\n\treturn (<div className={styles.Calculator}>\n\t\t<div className={styles.Output}>\n\t\t\t<p className={styles.Calculation}>{calculation}</p>\n\t\t\t<p className={styles.Preview}>{input ?? firstNumber}</p>\n\t\t</div>\n\t\t<div className={styles.Input}>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={styles.Button} onClick={reset}>C</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"-\"); }}>+/-</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"%\"); }}>%</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { changeOperation(\"÷\"); }}>÷</Button>\n\t\t\t</div>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"7\"); }}>7</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"8\"); }}>8</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"9\"); }}>9</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { changeOperation(\"×\"); }}>×</Button>\n\t\t\t</div>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"4\"); }}>4</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"5\"); }}>5</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"6\"); }}>6</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { changeOperation(\"-\"); }}>-</Button>\n\t\t\t</div>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"1\"); }}>1</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"2\"); }}>2</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"3\"); }}>3</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { changeOperation(\"+\"); }}>+</Button>\n\t\t\t</div>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={`${styles.Button} ${styles.ButtonLarge}`} onClick={() => { addInput(\"0\"); }}>0</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\".\"); }}>.</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { calculate(); }}>=</Button>\n\t\t\t</div>\n\t\t</div>\n\t</div>);\n}","import { App, Vector2 } from \"@prozilla-os/core\";\nimport { Calculator } from \"./components/Calculator\";\n\nconst calculator = new App(\"Calculator\", \"calculator\", Calculator, { size: new Vector2(400, 600) })\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/calculator.svg\")\n\t.setPinnedByDefault(false)\n\t.setCategory(\"Utilities & tools\");\ncalculator.setMetadata({ name: \"@prozilla-os/calculator\", version: \"1.1.17\", author: \"Prozilla\" });\n\n\nexport { calculator };"],"names":["Calculator","active","input","setInput","useState","firstNumber","setFirstNumber","secondNumber","setSecondNumber","operation","setOperation","isIntermediate","setIsIntermediate","reset","useCallback","addInput","string","hasReset","calculate","intermediate","a","b","result","changeOperation","useEffect","onKeyDown","event","calculation","jsxs","styles","jsx","Button","calculator","App","Vector2"],"mappings":";;;;;;;;;;;;;AAIgB,SAAAA,EAAW,EAAE,QAAAC,KAAuB;AACnD,QAAM,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tsx","../src/main.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport styles from \"./Calculator.module.css\";\nimport { Button, WindowProps } from \"@prozilla-os/core\";\n\nexport function Calculator({ active }: WindowProps) {\n\tconst [input, setInput] = useState<string | null>(\"0\");\n\tconst [firstNumber, setFirstNumber] = useState<number | null>(null);\n\tconst [secondNumber, setSecondNumber] = useState<number | null>(null);\n\tconst [operation, setOperation] = useState<string | null>(null);\n\tconst [isIntermediate, setIsIntermediate] = useState(false);\n\n\tconst reset = useCallback(() => {\n\t\tsetInput(\"0\");\n\t\tsetFirstNumber(null);\n\t\tsetSecondNumber(null);\n\t\tsetOperation(null);\n\t}, []);\n\n\tconst addInput = useCallback((string: string) => {\n\t\tlet hasReset = false;\n\t\tif (secondNumber != null) {\n\t\t\tif (isIntermediate && input != null) {\n\t\t\t\tsetFirstNumber(parseFloat(input));\n\t\t\t\tsetSecondNumber(null);\n\t\t\t\tsetInput(null);\n\t\t\t} else {\n\t\t\t\treset();\n\t\t\t}\n\t\t\thasReset = true;\n\t\t}\t\t\t\n\n\t\tif (string === \".\" && input?.includes(\".\"))\n\t\t\treturn;\n\n\t\tif (string === \"-\") {\n\t\t\tif (input === \"0\") {\n\t\t\t\tsetInput(\"-0\");\n\t\t\t} else if (input != null) {\n\t\t\t\tsetInput((parseFloat(input) * -1).toString());\n\t\t\t}\n\t\t} else if (string === \"%\" && input != null) {\n\t\t\tsetInput((parseFloat(input) / 100).toString());\n\t\t} else if (input === \"0\" || input === \"-0\" || input == null || hasReset) {\n\t\t\tif (string === \".\") {\n\t\t\t\tsetInput(input === \"-0\" ? \"0.\" : \"0.\");\n\t\t\t} else {\n\t\t\t\tsetInput(input === \"-0\" ? `-${string}` : string);\n\t\t\t}\n\t\t} else {\n\t\t\tsetInput(input + string);\n\t\t}\n\n\t}, [input, isIntermediate, reset, secondNumber]);\n\n\tconst calculate = useCallback((intermediate = false) => {\n\t\tif (firstNumber != null && input != null) {\n\t\t\tsetSecondNumber(parseFloat(input));\n\n\t\t\tconst a = firstNumber;\n\t\t\tconst b = parseFloat(input);\n\t\t\t\n\t\t\tlet result = 0;\n\t\t\tswitch (operation) {\n\t\t\t\tcase \"×\":\n\t\t\t\t\tresult = a * b;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"÷\":\n\t\t\t\t\tresult = a / b;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"+\":\n\t\t\t\t\tresult = a + b;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tresult = a - b;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tsetInput(result.toString());\n\t\t}\n\n\t\tsetIsIntermediate(intermediate);\n\t}, [firstNumber, input, operation]);\n\n\tconst changeOperation = useCallback((operation: string) => {\n\t\tif (firstNumber != null && secondNumber == null) {\n\t\t\tcalculate(true);\n\t\t} else if (input != null) {\n\t\t\tsetFirstNumber(parseFloat(input));\n\t\t\tsetSecondNumber(null);\n\t\t\tsetInput(null);\n\t\t}\n\n\t\tsetOperation(operation);\n\t}, [calculate, firstNumber, input, secondNumber]);\n\n\tuseEffect(() => {\n\t\tconst onKeyDown = (event: KeyboardEvent) => {\n\t\t\tif (!active)\n\t\t\t\treturn;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tswitch (event.key) {\n\t\t\t\tcase \"0\":\n\t\t\t\tcase \"1\":\n\t\t\t\tcase \"2\":\n\t\t\t\tcase \"3\":\n\t\t\t\tcase \"4\":\n\t\t\t\tcase \"5\":\n\t\t\t\tcase \"6\":\n\t\t\t\tcase \"7\":\n\t\t\t\tcase \"8\":\n\t\t\t\tcase \"9\":\n\t\t\t\t\taddInput(event.key);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \".\":\n\t\t\t\tcase \",\":\n\t\t\t\t\taddInput(\".\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Escape\":\n\t\t\t\t\treset();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"=\":\n\t\t\t\tcase \"Enter\":\n\t\t\t\t\tcalculate();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tchangeOperation(\"×\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"/\":\n\t\t\t\t\tchangeOperation(\"÷\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"+\":\n\t\t\t\tcase \"-\":\n\t\t\t\t\tchangeOperation(event.key);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"%\":\n\t\t\t\t\taddInput(\"%\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Backspace\":\n\t\t\t\t\tif (input != null && input.length > 0) {\n\t\t\t\t\t\tsetInput(input.slice(0, -1));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener(\"keydown\", onKeyDown);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"keydown\", onKeyDown);\n\t\t};\n\t}, [active, addInput, calculate, changeOperation, reset]);\n\n\tlet calculation = \"\";\n\tif (operation != null)\n\t\tcalculation = `${firstNumber} ${operation} ${secondNumber != null ? secondNumber + \" =\" : \"\"}`;\n\n\treturn <div className={styles.Calculator}>\n\t\t<div className={styles.Output}>\n\t\t\t<p className={styles.Calculation}>{calculation}</p>\n\t\t\t<p className={styles.Preview}>{input ?? firstNumber}</p>\n\t\t</div>\n\t\t<div className={styles.Input}>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={styles.Button} onClick={reset}>C</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"-\"); }}>+/-</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"%\"); }}>%</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { changeOperation(\"÷\"); }}>÷</Button>\n\t\t\t</div>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"7\"); }}>7</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"8\"); }}>8</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"9\"); }}>9</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { changeOperation(\"×\"); }}>×</Button>\n\t\t\t</div>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"4\"); }}>4</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"5\"); }}>5</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"6\"); }}>6</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { changeOperation(\"-\"); }}>-</Button>\n\t\t\t</div>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"1\"); }}>1</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"2\"); }}>2</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\"3\"); }}>3</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { changeOperation(\"+\"); }}>+</Button>\n\t\t\t</div>\n\t\t\t<div className={styles.InputRow}>\n\t\t\t\t<Button className={`${styles.Button} ${styles.ButtonLarge}`} onClick={() => { addInput(\"0\"); }}>0</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { addInput(\".\"); }}>.</Button>\n\t\t\t\t<Button className={styles.Button} onClick={() => { calculate(); }}>=</Button>\n\t\t\t</div>\n\t\t</div>\n\t</div>;\n}","import { App } from \"@prozilla-os/core\";\nimport { Calculator } from \"./components/Calculator\";\nimport { Vector2 } from \"@prozilla-os/shared\";\n\nconst calculator = new App(\"Calculator\", \"calculator\", Calculator, { size: new Vector2(400, 600) })\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/calculator.svg\")\n\t.setPinnedByDefault(false)\n\t.setCategory(\"Utilities & tools\");\n\nexport { calculator };"],"names":["Calculator","active","input","setInput","useState","firstNumber","setFirstNumber","secondNumber","setSecondNumber","operation","setOperation","isIntermediate","setIsIntermediate","reset","useCallback","addInput","string","hasReset","calculate","intermediate","a","b","result","changeOperation","useEffect","onKeyDown","event","calculation","jsxs","styles","jsx","Button","calculator","App","Vector2"],"mappings":";;;;;;;;;;;;;;AAIO,SAASA,EAAW,EAAE,QAAAC,KAAuB;AACnD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAwB,GAAG,GAC/C,CAACC,GAAaC,CAAc,IAAIF,EAAwB,IAAI,GAC5D,CAACG,GAAcC,CAAe,IAAIJ,EAAwB,IAAI,GAC9D,CAACK,GAAWC,CAAY,IAAIN,EAAwB,IAAI,GACxD,CAACO,GAAgBC,CAAiB,IAAIR,EAAS,EAAK,GAEpDS,IAAQC,EAAY,MAAM;AAC/B,IAAAX,EAAS,GAAG,GACZG,EAAe,IAAI,GACnBE,EAAgB,IAAI,GACpBE,EAAa,IAAI;AAAA,EAClB,GAAG,CAAA,CAAE,GAECK,IAAWD,EAAY,CAACE,MAAmB;AAChD,QAAIC,IAAW;AAYf,IAXIV,KAAgB,SACfI,KAAkBT,KAAS,QAC9BI,EAAe,WAAWJ,CAAK,CAAC,GAChCM,EAAgB,IAAI,GACpBL,EAAS,IAAI,KAEbU,EAAA,GAEDI,IAAW,KAGR,EAAAD,MAAW,OAAOd,GAAO,SAAS,GAAG,OAGrCc,MAAW,MACVd,MAAU,MACbC,EAAS,IAAI,IACHD,KAAS,QACnBC,GAAU,WAAWD,CAAK,IAAI,IAAI,UAAU,IAEnCc,MAAW,OAAOd,KAAS,OACrCC,GAAU,WAAWD,CAAK,IAAI,KAAK,UAAU,IACnCA,MAAU,OAAOA,MAAU,QAAQA,KAAS,QAAQe,IAE7Dd,EADGa,MAAW,MACY,OAEjBd,MAAU,OAAO,IAAIc,CAAM,KAAKA,CAFJ,IAKtCb,EAASD,IAAQc,CAAM;AAAA,EAGzB,GAAG,CAACd,GAAOS,GAAgBE,GAAON,CAAY,CAAC,GAEzCW,IAAYJ,EAAY,CAACK,IAAe,OAA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EAAA,GACD;AACD;AC/LA,MAAMc,IAAa,IAAIC,EAAI,cAAc,cAAcjC,GAAY,EAAE,MAAM,IAAIkC,EAAQ,KAAK,GAAG,EAAA,CAAG,EAChG,WAAW,0DAA0D,EACrE,mBAAmB,EAAK,EACxB,YAAY,mBAAmB;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prozilla-os/calculator",
3
3
  "description": "A ProzillaOS application for making basic calculations.",
4
- "version": "1.1.18",
4
+ "version": "1.1.21",
5
5
  "homepage": "https://os.prozilla.dev/calculator",
6
6
  "author": {
7
7
  "name": "Prozilla",
@@ -20,17 +20,18 @@
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
22
  "react": "^18.3.1",
23
- "@prozilla-os/core": "1.3.13"
23
+ "@prozilla-os/core": "2.0.1",
24
+ "@prozilla-os/shared": "1.3.0"
24
25
  },
25
26
  "devDependencies": {
26
27
  "@types/node": "^20.14.5",
27
- "@types/react": "^18.3.3",
28
+ "@types/react": "^18.3.27",
28
29
  "@vitejs/plugin-react-swc": "^3.7.0",
29
30
  "typescript": "^5.5.4",
30
- "vite": "^5.4.8",
31
- "vite-plugin-dts": "^3.9.1",
31
+ "vite": "^7.3.1",
32
+ "vite-plugin-dts": "^4.5.4",
32
33
  "vite-plugin-lib-inject-css": "^2.1.1",
33
- "@prozilla-os/dev-tools": "1.1.10"
34
+ "@prozilla-os/dev-tools": "1.1.13"
34
35
  },
35
36
  "files": [
36
37
  "dist"