@prozilla-os/app-center 1.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Sieben De Beule
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ <div align="center">
2
+ <br />
3
+ <p>
4
+ <a href="https://os.prozilla.dev/"><img src="https://os.prozilla.dev/assets/logo.svg?v=2" height="200" alt="ProzillaOS" /></a>
5
+ </p>
6
+ <p>
7
+ <a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE.md"><img alt="License" src="https://img.shields.io/github/license/Prozilla/ProzillaOS?style=flat-square&color=FF4D5B&label=License"></a>
8
+ <a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Stars" src="https://img.shields.io/github/stars/Prozilla/ProzillaOS?style=flat-square&color=FED24C&label=%E2%AD%90"></a>
9
+ <a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Forks" src="https://img.shields.io/github/forks/Prozilla/ProzillaOS?style=flat-square&color=4D9CFF&label=Forks&logo=github"></a>
10
+ <a href="https://www.npmjs.com/package/prozilla-os"><img alt="NPM Version" src="https://img.shields.io/npm/v/prozilla-os?logo=npm&style=flat-square&label=prozilla-os&color=FF4D5B"></a>
11
+ </p>
12
+ </div>
13
+
14
+ ## About
15
+
16
+ `@prozilla-os/app-center` is a ProzillaOS application for browsing and installing applications.
17
+
18
+ ## Installation
19
+
20
+ `@prozilla-os/core` is required to run this application.
21
+
22
+ ```sh
23
+ npm install @prozilla-os/core @prozilla-os/app-center
24
+ yarn add @prozilla-os/core @prozilla-os/app-center
25
+ pnpm add @prozilla-os/core @prozilla-os/app-center
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ### Basic setup
31
+
32
+ ```tsx
33
+ import { Desktop, ModalsView, ProzillaOS, Taskbar, WindowsView, AppsConfig } from "@prozilla-os/core";
34
+ import { appCenter } from "@prozilla-os/app-center";
35
+
36
+ function App() {
37
+ return (
38
+ <ProzillaOS
39
+ systemName="Example"
40
+ tagLine="Powered by ProzillaOS"
41
+ config={{
42
+ apps: new AppsConfig({
43
+ apps: [ appCenter ]
44
+ })
45
+ }}
46
+ >
47
+ <Taskbar/>
48
+ <WindowsView/>
49
+ <ModalsView/>
50
+ <Desktop/>
51
+ </ProzillaOS>
52
+ );
53
+ }
54
+ ```
55
+
56
+ ## Links
57
+
58
+ - [Demo][demo]
59
+ - [Docs][docs]
60
+ - [GitHub][github]
61
+ - [npm][npm]
62
+ - [Discord][discord]
63
+ - [Ko-fi][ko-fi]
64
+
65
+ [demo]: https://os.prozilla.dev/app-center
66
+ [docs]: https://os.prozilla.dev/docs/reference/apps/app-center
67
+ [github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/apps/app-center
68
+ [npm]: https://www.npmjs.com/package/@prozilla-os/app-center
69
+ [discord]: https://discord.gg/JwbyQP4tdz
70
+ [ko-fi]: https://ko-fi.com/prozilla
package/dist/main.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { App } from '@prozilla-os/core';
2
+ import { WindowProps } from '@prozilla-os/core';
3
+
4
+ export declare const appCenter: App<WindowProps>;
5
+
6
+ export { }
package/dist/main.js ADDED
@@ -0,0 +1,54 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._AppCenter_i8u9y_1{display:flex;gap:.5rem;flex-direction:column;height:100%}._Header_13ehb_1{display:flex;gap:.75rem;flex-wrap:nowrap;height:2rem;min-height:2rem;margin:1rem;overflow:hidden}._SearchInput_13ehb_11{flex:1;width:auto;max-width:100%;padding:.25rem .5rem;height:100%;background-color:var(--background-color-2);border:none;border-radius:var(--border-radius-1);outline:none;font-family:inherit;font-size:inherit}._CategoryInput_13ehb_25{flex:.25;width:auto;max-width:100%;padding:.25rem .5rem;height:100%;color:var(--text-color);background-color:var(--background-color-1);border:none;border-radius:var(--border-radius-1);outline:none;font-size:inherit;font-family:inherit}._CategoryInput_13ehb_25>*{color:inherit;background-color:inherit;border:none;border-radius:var(--border-radius-1);outline:none;font-family:inherit;font-size:inherit}._List_a8xt6_1{--gap: 1rem;--columns: 6;display:flex;gap:var(--gap);flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:flex-start;margin:1rem;max-height:100%;overflow:auto}._App_a8xt6_16{display:flex;justify-content:space-evenly;align-items:center;flex-direction:column;width:calc((100% - var(--gap) * (var(--columns) - 1)) / var(--columns));height:auto;background-color:var(--background-color-1);border-radius:var(--border-radius-1);overflow:hidden;aspect-ratio:16 / 14;transition:background-color .2s ease-in-out;cursor:pointer}._App_a8xt6_16:hover,._App_a8xt6_16:focus-visible{background-color:var(--background-color-0)}._AppIcon_a8xt6_35{flex-grow:0;width:50%;height:auto;aspect-ratio:1;filter:drop-shadow(.1rem .1rem .2rem color-mix(in srgb,var(--black-4) 75%,transparent))}._AppIcon_a8xt6_35 div,._AppIcon_a8xt6_35 svg{width:100%;height:100%;aspect-ratio:inherit;border-radius:var(--border-radius-1)}._AppName_a8xt6_50{margin:0;font-size:1.25rem;font-weight:500}")),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { useSystemManager as h, APP_CATEGORIES as d, Image as _, App as C } from "@prozilla-os/core";
3
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
4
+ import { useState as u } from "react";
5
+ const m = "_AppCenter_i8u9y_1", g = {
6
+ AppCenter: m
7
+ }, y = "_Header_13ehb_1", I = "_SearchInput_13ehb_11", v = "_CategoryInput_13ehb_25", i = {
8
+ Header: y,
9
+ SearchInput: I,
10
+ CategoryInput: v
11
+ };
12
+ function N({ searchQuery: o, setSearchQuery: p, category: s, setCategory: a }) {
13
+ const { appsConfig: n } = h(), r = (e) => {
14
+ p(e.target.value);
15
+ }, A = (e) => {
16
+ a(e.target.value);
17
+ };
18
+ return /* @__PURE__ */ l("div", { className: i.Header, children: [
19
+ /* @__PURE__ */ t("input", { className: i.SearchInput, value: o, onChange: r, type: "text", placeholder: "Search..." }),
20
+ /* @__PURE__ */ l("select", { className: i.CategoryInput, value: s, onChange: A, children: [
21
+ /* @__PURE__ */ t("option", { value: "All", children: "All" }),
22
+ d.filter((e) => n.getAppsByCategory(e).length > 0).map(
23
+ (e) => /* @__PURE__ */ t("option", { value: e, children: e }, e)
24
+ )
25
+ ] })
26
+ ] });
27
+ }
28
+ const f = "_List_a8xt6_1", S = "_App_a8xt6_16", x = "_AppIcon_a8xt6_35", L = "_AppName_a8xt6_50", c = {
29
+ List: f,
30
+ App: S,
31
+ AppIcon: x,
32
+ AppName: L
33
+ };
34
+ function $({ apps: o, searchQuery: p, category: s }) {
35
+ return /* @__PURE__ */ t("div", { className: c.List, children: o.filter(({ name: a, id: n, category: r }) => (a.toLowerCase().includes(p) || n.toLowerCase().replaceAll("-", " ").includes(p)) && (s == "All" || r == s)).map(
36
+ ({ name: a, id: n, iconUrl: r }) => /* @__PURE__ */ l("div", { className: c.App, children: [
37
+ /* @__PURE__ */ t("div", { className: c.AppIcon, children: r && /* @__PURE__ */ t(_, { src: r }) }),
38
+ /* @__PURE__ */ t("p", { className: c.AppName, children: a })
39
+ ] }, n)
40
+ ) });
41
+ }
42
+ function H() {
43
+ const { appsConfig: o } = h(), [p, s] = u(""), [a, n] = u("All");
44
+ return /* @__PURE__ */ l("div", { className: g.AppCenter, children: [
45
+ /* @__PURE__ */ t(N, { searchQuery: p, setSearchQuery: s, category: a, setCategory: n }),
46
+ /* @__PURE__ */ t($, { apps: o.apps, searchQuery: p, category: a })
47
+ ] });
48
+ }
49
+ const P = new C("AppCenter", "app-center", H).setIconUrl("https://os.prozilla.dev/assets/apps/icons/app-center.svg").setPinnedByDefault(!0).setCategory("Utilities & tools");
50
+ P.setMetadata({ name: "@prozilla-os/app-center", version: "1.0.0", author: "Prozilla" });
51
+ export {
52
+ P as appCenter
53
+ };
54
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sources":["../src/components/header/Header.tsx","../src/components/list/List.tsx","../src/components/AppCenter.tsx","../src/main.ts"],"sourcesContent":["import { ChangeEvent } from \"react\";\nimport styles from \"./Header.module.css\";\nimport { APP_CATEGORIES, useSystemManager } from \"@prozilla-os/core\";\nimport { CategoryType } from \"../AppCenter\";\n\ninterface HeaderProps {\n\tsearchQuery: string;\n\tsetSearchQuery: React.Dispatch<React.SetStateAction<string>>;\n\tcategory: CategoryType;\n\tsetCategory: React.Dispatch<React.SetStateAction<CategoryType>>;\n}\n\nexport function Header({ searchQuery, setSearchQuery, category, setCategory }: HeaderProps) {\n\tconst { appsConfig } = useSystemManager();\n\n\tconst handleSearchChange = (event: ChangeEvent<HTMLInputElement>) => {\n\t\tsetSearchQuery(event.target.value);\n\t};\n\n\tconst handleCategoryChange = (event: ChangeEvent<HTMLSelectElement>) => {\n\t\tsetCategory(event.target.value as CategoryType);\n\t};\n\n\treturn <div className={styles.Header}>\n\t\t<input className={styles.SearchInput} value={searchQuery} onChange={handleSearchChange} type=\"text\" placeholder=\"Search...\"/>\n\t\t<select className={styles.CategoryInput} value={category} onChange={handleCategoryChange}>\n\t\t\t<option value={\"All\"}>All</option>\n\t\t\t{APP_CATEGORIES.filter((category) => {\n\t\t\t\treturn appsConfig.getAppsByCategory(category).length > 0;\n\t\t\t}).map((category) =>\n\t\t\t\t<option key={category} value={category}>{category}</option>\n\t\t\t)}\n\t\t</select>\n\t</div>;\n}","import { App, Image } from \"@prozilla-os/core\";\nimport styles from \"./List.module.css\";\nimport { CategoryType } from \"../AppCenter\";\n\ninterface ListProps {\n\tapps: App[];\n\tsearchQuery: string;\n\tcategory: CategoryType;\n}\n\nexport function List({ apps, searchQuery, category }: ListProps) {\n\treturn <div className={styles.List}>\n\t\t{apps.filter(({ name, id, category: appCategory }) => {\n\t\t\treturn (name.toLowerCase().includes(searchQuery) || id.toLowerCase().replaceAll(\"-\", \" \").includes(searchQuery))\n\t\t\t\t&& (category == \"All\" || appCategory == category);\n\t\t}).map(({ name, id, iconUrl }) =>\n\t\t\t<div key={id} className={styles.App}>\n\t\t\t\t<div className={styles.AppIcon}>{iconUrl && <Image src={iconUrl}/>}</div>\n\t\t\t\t<p className={styles.AppName}>{name}</p>\n\t\t\t</div>\n\t\t)}\n\t</div>;\n}","import { useSystemManager, APP_CATEGORIES } from \"@prozilla-os/core\";\nimport styles from \"./AppCenter.module.css\";\nimport { Header } from \"./header/Header\";\nimport { List } from \"./list/List\";\nimport { useState } from \"react\";\n\nexport type CategoryType = typeof APP_CATEGORIES[number] | \"All\";\n\nexport function AppCenter() {\n\tconst { appsConfig } = useSystemManager();\n\tconst [searchQuery, setSearchQuery] = useState(\"\");\n\tconst [category, setCategory] = useState<CategoryType>(\"All\");\n\n\treturn <div className={styles.AppCenter}>\n\t\t<Header searchQuery={searchQuery} setSearchQuery={setSearchQuery} category={category} setCategory={setCategory}/>\n\t\t<List apps={appsConfig.apps} searchQuery={searchQuery} category={category}/>\n\t</div>;\n}","import { App } from \"@prozilla-os/core\";\nimport { AppCenter } from \"./components/AppCenter\";\n\nconst appCenter = new App(\"AppCenter\", \"app-center\", AppCenter)\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/app-center.svg\")\n\t.setPinnedByDefault(true)\n\t.setCategory(\"Utilities & tools\");\nappCenter.setMetadata({ name: \"@prozilla-os/app-center\", version: \"1.0.0\", author: \"Prozilla\" });\n\n\nexport { appCenter };"],"names":["Header","searchQuery","setSearchQuery","category","setCategory","appsConfig","useSystemManager","handleSearchChange","event","handleCategoryChange","jsxs","styles","jsx","APP_CATEGORIES","List","apps","name","id","appCategory","iconUrl","Image","AppCenter","useState","appCenter","App"],"mappings":";;;;;;;;;;AAYO,SAASA,EAAO,EAAE,aAAAC,GAAa,gBAAAC,GAAgB,UAAAC,GAAU,aAAAC,KAA4B;AACrF,QAAA,EAAE,YAAAC,MAAeC,KAEjBC,IAAqB,CAACC,MAAyC;AACrD,IAAAN,EAAAM,EAAM,OAAO,KAAK;AAAA,EAAA,GAG5BC,IAAuB,CAACD,MAA0C;AAC3D,IAAAJ,EAAAI,EAAM,OAAO,KAAqB;AAAA,EAAA;AAG/C,SAAQ,gBAAAE,EAAA,OAAA,EAAI,WAAWC,EAAO,QAC7B,UAAA;AAAA,IAAC,gBAAAC,EAAA,SAAA,EAAM,WAAWD,EAAO,aAAa,OAAOV,GAAa,UAAUM,GAAoB,MAAK,QAAO,aAAY,YAAW,CAAA;AAAA,IAC3H,gBAAAG,EAAC,YAAO,WAAWC,EAAO,eAAe,OAAOR,GAAU,UAAUM,GACnE,UAAA;AAAA,MAAC,gBAAAG,EAAA,UAAA,EAAO,OAAO,OAAO,UAAG,OAAA;AAAA,MACxBC,EAAe,OAAO,CAACV,MAChBE,EAAW,kBAAkBF,CAAQ,EAAE,SAAS,CACvD,EAAE;AAAA,QAAI,CAACA,MACN,gBAAAS,EAAA,U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MAAMoB,IAAY,IAAIC,EAAI,aAAa,cAAcH,CAAS,EAC5D,WAAW,0DAA0D,EACrE,mBAAmB,EAAI,EACvB,YAAY,mBAAmB;AACjCE,EAAU,YAAY,EAAE,MAAM,2BAA2B,SAAS,SAAS,QAAQ,YAAY;"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@prozilla-os/app-center",
3
+ "description": "A ProzillaOS application for browsing and installing applications.",
4
+ "version": "1.0.1",
5
+ "homepage": "https://os.prozilla.dev/app-center",
6
+ "author": {
7
+ "name": "Prozilla",
8
+ "email": "business@prozilla.dev",
9
+ "url": "https://prozilla.dev/"
10
+ },
11
+ "funding": "https://ko-fi.com/prozilla",
12
+ "type": "module",
13
+ "main": "dist/main.js",
14
+ "types": "dist/main.d.ts",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/prozilla-os/ProzillaOS.git",
18
+ "directory": "packages/apps/app-center"
19
+ },
20
+ "license": "MIT",
21
+ "dependencies": {
22
+ "react": "^18.3.1",
23
+ "@prozilla-os/core": "1.3.3"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^20.14.5",
27
+ "@types/react": "^18.3.3",
28
+ "@vitejs/plugin-react-swc": "^3.7.0",
29
+ "typescript": "^5.5.4",
30
+ "vite": "^5.4.8",
31
+ "vite-plugin-dts": "^3.9.1",
32
+ "vite-plugin-lib-inject-css": "^2.1.1",
33
+ "@prozilla-os/dev-tools": "1.1.0"
34
+ },
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "sideEffects": [
39
+ "**/*.css"
40
+ ],
41
+ "publishConfig": {
42
+ "registry": "https://registry.npmjs.org/",
43
+ "access": "public"
44
+ },
45
+ "scripts": {
46
+ "build": "tsc && vite build"
47
+ }
48
+ }