@prozilla-os/browser 1.1.17 → 1.1.18
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.js +1 -1
- package/dist/main.js.map +1 -1
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -99,7 +99,7 @@ function D({ url: s = p, focus: v }) {
|
|
|
99
99
|
] });
|
|
100
100
|
}
|
|
101
101
|
const K = new S("Browser", "browser", D, { size: new y(700, 500) }).setIconUrl("https://os.prozilla.dev/assets/apps/icons/browser.svg").setRole(A.APP_ROLES.browser).setCategory("Utilities & tools");
|
|
102
|
-
K.setMetadata({ name: "@prozilla-os/browser", version: "1.1.
|
|
102
|
+
K.setMetadata({ name: "@prozilla-os/browser", version: "1.1.17", author: "Prozilla" });
|
|
103
103
|
export {
|
|
104
104
|
K as browser
|
|
105
105
|
};
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/constants/browser.const.ts","../src/components/Browser.tsx","../src/main.ts"],"sourcesContent":["export const HOME_URL = \"https://prozilla.dev/\";\nexport const SEARCH_URL = \"https://www.google.com/search?igu=1\";","import { ChangeEventHandler, KeyboardEventHandler, useEffect, useRef, useState } from \"react\";\nimport styles from \"./Browser.module.css\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCaretLeft, faCaretRight, faHome, faRotateRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { isValidUrl, useHistory, WebView, WindowProps } from \"@prozilla-os/core\";\nimport { HOME_URL, SEARCH_URL } from \"../constants/browser.const\";\n\nexport interface BrowserProps extends WindowProps {\n\turl?: string;\n}\n\nexport function Browser({ url: startUrl = HOME_URL, focus }: BrowserProps) {\n\tconst [url, setUrl] = useState<string>(startUrl);\n\tconst [input, setInput] = useState(startUrl);\n\tconst { history, pushState, stateIndex, undo, redo, undoAvailable, redoAvailable } = useHistory(startUrl);\n\tconst ref = useRef<HTMLIFrameElement>(null);\n\n\tuseEffect(() => {\n\t\tif (history.length === 0)\n\t\t\treturn;\n\n\t\tsetUrl(history[stateIndex]);\n\t}, [history, stateIndex]);\n\n\tconst reload = () => {\n\t\tif (ref.current == null || ref.current.contentWindow == null)\n\t\t\treturn;\n\n\t\tref.current.contentWindow.location.href = url;\n\t};\n\n\tconst updateUrl = (newUrl: string) => {\n\t\tif (url === newUrl) {\n\t\t\treturn reload();\n\t\t}\n\n\t\tsetUrl(newUrl);\n\t\tsetInput(newUrl);\n\t\tpushState(newUrl);\n\t};\n\n\tconst onInputChange = (event: Event) => {\n\t\tsetInput((event.target as HTMLInputElement).value);\n\t};\n\n\tconst onKeyDown = (event: KeyboardEvent) => {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\n\t\tif (event.key === \"Enter\" && value !== \"\") {\n\t\t\tif (isValidUrl(value)) {\n\t\t\t\tupdateUrl(value);\n\t\t\t} else {\n\t\t\t\tupdateUrl(`${SEARCH_URL}&q=${value}`);\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (<div className={styles.Browser}>\n\t\t<div className={styles.Header}>\n\t\t\t<div className={styles.NavBar}>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Back\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { undo(); }}\n\t\t\t\t\tdisabled={!undoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretLeft}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Forward\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { redo(); }}\n\t\t\t\t\tdisabled={!redoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretRight}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Reload\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={reload}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faRotateRight}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Home\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { updateUrl(HOME_URL); }}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faHome}/>\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\tvalue={input}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label=\"Search bar\"\n\t\t\t\t\tclassName={styles.SearchBar}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tonChange={onInputChange as unknown as ChangeEventHandler}\n\t\t\t\t\tonKeyDown={onKeyDown as unknown as KeyboardEventHandler}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className={styles.Bookmarks}>\n\n\t\t\t</div>\n\t\t</div>\n\t\t<WebView ref={ref} source={url} title=\"Browser\" focus={focus}/>\n\t</div>);\n}","import { App, AppsConfig, Vector2 } from \"@prozilla-os/core\";\nimport { Browser, BrowserProps } from \"./components/Browser\";\n\nconst browser = new App<BrowserProps>(\"Browser\", \"browser\", Browser, { size: new Vector2(700, 500) })\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/browser.svg\")\n\t.setRole(AppsConfig.APP_ROLES.browser)\n\t.setCategory(\"Utilities & tools\");\nbrowser.setMetadata({ name: \"@prozilla-os/browser\", version: \"1.1.
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/constants/browser.const.ts","../src/components/Browser.tsx","../src/main.ts"],"sourcesContent":["export const HOME_URL = \"https://prozilla.dev/\";\nexport const SEARCH_URL = \"https://www.google.com/search?igu=1\";","import { ChangeEventHandler, KeyboardEventHandler, useEffect, useRef, useState } from \"react\";\nimport styles from \"./Browser.module.css\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faCaretLeft, faCaretRight, faHome, faRotateRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { isValidUrl, useHistory, WebView, WindowProps } from \"@prozilla-os/core\";\nimport { HOME_URL, SEARCH_URL } from \"../constants/browser.const\";\n\nexport interface BrowserProps extends WindowProps {\n\turl?: string;\n}\n\nexport function Browser({ url: startUrl = HOME_URL, focus }: BrowserProps) {\n\tconst [url, setUrl] = useState<string>(startUrl);\n\tconst [input, setInput] = useState(startUrl);\n\tconst { history, pushState, stateIndex, undo, redo, undoAvailable, redoAvailable } = useHistory(startUrl);\n\tconst ref = useRef<HTMLIFrameElement>(null);\n\n\tuseEffect(() => {\n\t\tif (history.length === 0)\n\t\t\treturn;\n\n\t\tsetUrl(history[stateIndex]);\n\t}, [history, stateIndex]);\n\n\tconst reload = () => {\n\t\tif (ref.current == null || ref.current.contentWindow == null)\n\t\t\treturn;\n\n\t\tref.current.contentWindow.location.href = url;\n\t};\n\n\tconst updateUrl = (newUrl: string) => {\n\t\tif (url === newUrl) {\n\t\t\treturn reload();\n\t\t}\n\n\t\tsetUrl(newUrl);\n\t\tsetInput(newUrl);\n\t\tpushState(newUrl);\n\t};\n\n\tconst onInputChange = (event: Event) => {\n\t\tsetInput((event.target as HTMLInputElement).value);\n\t};\n\n\tconst onKeyDown = (event: KeyboardEvent) => {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\n\t\tif (event.key === \"Enter\" && value !== \"\") {\n\t\t\tif (isValidUrl(value)) {\n\t\t\t\tupdateUrl(value);\n\t\t\t} else {\n\t\t\t\tupdateUrl(`${SEARCH_URL}&q=${value}`);\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (<div className={styles.Browser}>\n\t\t<div className={styles.Header}>\n\t\t\t<div className={styles.NavBar}>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Back\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { undo(); }}\n\t\t\t\t\tdisabled={!undoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretLeft}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Forward\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { redo(); }}\n\t\t\t\t\tdisabled={!redoAvailable}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faCaretRight}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Reload\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={reload}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faRotateRight}/>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttitle=\"Home\"\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tclassName={styles.IconButton}\n\t\t\t\t\tonClick={() => { updateUrl(HOME_URL); }}\n\t\t\t\t>\n\t\t\t\t\t<FontAwesomeIcon icon={faHome}/>\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\tvalue={input}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\taria-label=\"Search bar\"\n\t\t\t\t\tclassName={styles.SearchBar}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t\tonChange={onInputChange as unknown as ChangeEventHandler}\n\t\t\t\t\tonKeyDown={onKeyDown as unknown as KeyboardEventHandler}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className={styles.Bookmarks}>\n\n\t\t\t</div>\n\t\t</div>\n\t\t<WebView ref={ref} source={url} title=\"Browser\" focus={focus}/>\n\t</div>);\n}","import { App, AppsConfig, Vector2 } from \"@prozilla-os/core\";\nimport { Browser, BrowserProps } from \"./components/Browser\";\n\nconst browser = new App<BrowserProps>(\"Browser\", \"browser\", Browser, { size: new Vector2(700, 500) })\n\t.setIconUrl(\"https://os.prozilla.dev/assets/apps/icons/browser.svg\")\n\t.setRole(AppsConfig.APP_ROLES.browser)\n\t.setCategory(\"Utilities & tools\");\nbrowser.setMetadata({ name: \"@prozilla-os/browser\", version: \"1.1.17\", author: \"Prozilla\" });\n\n\nexport { browser };"],"names":["HOME_URL","SEARCH_URL","Browser","startUrl","focus","url","setUrl","useState","input","setInput","history","pushState","stateIndex","undo","redo","undoAvailable","redoAvailable","useHistory","ref","useRef","useEffect","reload","updateUrl","newUrl","onInputChange","event","onKeyDown","value","isValidUrl","jsxs","styles","jsx","FontAwesomeIcon","faCaretLeft","faCaretRight","faRotateRight","faHome","WebView","browser","App","Vector2","AppsConfig"],"mappings":";;;;;;;;;;;;GAAaA,IAAW,yBACXC,IAAa;ACUnB,SAASC,EAAQ,EAAE,KAAKC,IAAWH,GAAU,OAAAI,KAAuB;AAC1E,QAAM,CAACC,GAAKC,CAAM,IAAIC,EAAiBJ,CAAQ,GACzC,CAACK,GAAOC,CAAQ,IAAIF,EAASJ,CAAQ,GACrC,EAAE,SAAAO,GAAS,WAAAC,GAAW,YAAAC,GAAY,MAAAC,GAAM,MAAAC,GAAM,eAAAC,GAAe,eAAAC,EAAA,IAAkBC,EAAWd,CAAQ,GAClGe,IAAMC,EAA0B,IAAI;AAE1C,EAAAC,EAAU,MAAM;AACf,IAAIV,EAAQ,WAAW,KAGhBJ,EAAAI,EAAQE,CAAU,CAAC;AAAA,EAAA,GACxB,CAACF,GAASE,CAAU,CAAC;AAExB,QAAMS,IAAS,MAAM;AACpB,IAAIH,EAAI,WAAW,QAAQA,EAAI,QAAQ,iBAAiB,SAGpDA,EAAA,QAAQ,cAAc,SAAS,OAAOb;AAAA,EAAA,GAGrCiB,IAAY,CAACC,MAAmB;AACrC,QAAIlB,MAAQkB;AACX,aAAOF,EAAO;AAGf,IAAAf,EAAOiB,CAAM,GACbd,EAASc,CAAM,GACfZ,EAAUY,CAAM;AAAA,EAAA,GAGXC,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AA,UAAA;AAAA,YACA,OAAM;AAAA,YACN,UAAU;AAAA,YACV,WAAWD,EAAO;AAAA,YAClB,SAAS,MAAM;AAAE,cAAAR,EAAUtB,CAAQ;AAAA,YAAG;AAAA,YAEtC,UAAA,gBAAA+B,EAACC,GAAgB,EAAA,MAAMI,EAAO,CAAA;AAAA,UAAA;AAAA,QAC/B;AAAA,QACA,gBAAAL;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,OAAOvB;AAAA,YACP,MAAK;AAAA,YACL,cAAW;AAAA,YACX,WAAWsB,EAAO;AAAA,YAClB,UAAU;AAAA,YACV,UAAUN;AAAA,YACV,WAAAE;AAAA,UAAA;AAAA,QACD;AAAA,MAAA,GACD;AAAA,MACC,gBAAAK,EAAA,OAAA,EAAI,WAAWD,EAAO,UAEvB,CAAA;AAAA,IAAA,GACD;AAAA,sBACCO,GAAQ,EAAA,KAAAnB,GAAU,QAAQb,GAAK,OAAM,WAAU,OAAAD,GAAa;AAAA,EAC9D,EAAA,CAAA;AACD;AC3GM,MAAAkC,IAAU,IAAIC,EAAkB,WAAW,WAAWrC,GAAS,EAAE,MAAM,IAAIsC,EAAQ,KAAK,GAAG,GAAG,EAClG,WAAW,uDAAuD,EAClE,QAAQC,EAAW,UAAU,OAAO,EACpC,YAAY,mBAAmB;AACjCH,EAAQ,YAAY,EAAE,MAAM,wBAAwB,SAAS,UAAU,QAAQ,YAAY;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prozilla-os/browser",
|
|
3
3
|
"description": "A ProzillaOS application for browsing the internet.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.18",
|
|
5
5
|
"homepage": "https://os.prozilla.dev/browser",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Prozilla",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"react": "^18.3.1",
|
|
23
|
-
"@prozilla-os/core": "1.3.
|
|
23
|
+
"@prozilla-os/core": "1.3.13"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^20.14.5",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vite": "^5.4.8",
|
|
31
31
|
"vite-plugin-dts": "^3.9.1",
|
|
32
32
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
33
|
-
"@prozilla-os/dev-tools": "1.1.
|
|
33
|
+
"@prozilla-os/dev-tools": "1.1.10"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist"
|