Compare commits

...

No commits in common. "master" and "gh-pages" have entirely different histories.

156 changed files with 639 additions and 18044 deletions

3
.github/FUNDING.yml vendored
View file

@ -1,3 +0,0 @@
# These are supported funding model platforms
ko_fi: flowworks
patreon: flow_works

View file

@ -1,38 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View file

@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View file

@ -1,15 +0,0 @@
name: build
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.1.0
- name: Install dependencies
run: npm i
- name: Build FlowOS
run: npm run build

View file

@ -1,49 +0,0 @@
name: Deploy
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Build project
run: npx vite build --base="/FlowOS/"
- name: Upload production-ready build files
uses: actions/upload-artifact@v3
with:
name: production-files
path: ./dist
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: production-files
path: ./dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

View file

@ -1,36 +0,0 @@
name: Release
on:
push:
branches: [master]
permissions:
contents: read # for checkout
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GH_TOKEN: ${{ secrets.PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

View file

@ -1,15 +0,0 @@
name: ts-standard
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]
jobs:
ts-standard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.1.0
- name: Install dependencies
run: npm i
- name: Run ts-standard test
run: npm run test

4
.gitignore vendored
View file

@ -1,4 +0,0 @@
dist
stats.json
node_modules
docs

0
.nojekyll Normal file
View file

View file

@ -1,15 +0,0 @@
{
"branches": ["master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/npm", {
"npmPublish": false
}],
["@semantic-release/git", {
"assets": ["package.json", "package-lock.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
]
}

View file

@ -1,128 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
https://discord.gg/flowos.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View file

@ -1,55 +0,0 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
1. Follow the guidelines for making a commit. If the guidelines aren't followed your pull request will be closed.
2. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
3. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
4. Increase the version numbers in any examples files and the README.md to the new version that this pull request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
5. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.
## Commit Guidelines
All commits made should follow the [Semantic Release](https://github.com/semantic-release/semantic-release#commit-message-format) commit message format.
## Pull Request Guidelines
A PR should be named using the following anatomy:
`[emoji]` `(#issue)` `summary`
As an example: `[] (#126) cool thing added`
### emoji
The emoji should be the first thing in the name, to let everyone know what kind of change the PR is putting forward. Here is a table of the standard emojis, and why they should be used.
| Emoji | Keyword | Meaning |
|-----------------------------------------|------------|--------------------------------------------------------|
| :heavy_plus_sign: `:heavy_plus_sign:` | `add` | Create a capability e.g. feature, test, dependency. |
| :heavy_minus_sign: `:heavy_minus_sign:` | `remove` | Remove a capability e.g. feature, test, dependency. |
| :hammer: `:hammer:` | `refactor` | An update to existing code and/or refactoring. |
| :bug: `:bug:` | `fix` | Fix an issue e.g. bug, typo, accident, misstatement. |
| :up: `:up:` | `bump` | Increase the version of something e.g. dependency. |
| :bricks: `:bricks:` | `build` | Change *only* to the build process, tooling, or infra. |
| :memo: `:memo:` | `docs` | A change to documentation *only*. |
| :arrow_right_hook: `:arrow_right_hook:` | `revert` | Reverting a previous commit. |
| :knot: `:knot:` | `merge` | Merging a branch into another. |
### issue
Following the emoji is the issue number - this is the issue the PR addresses. It is formatted as `(#XXX)` where XXX is the GitHub issue number.
### summary
This is a short summary of what your commit is doing.
## Code of Conduct
Our Code of Conduct is located at `CODE_OF_CONDUCT.md`.

21
LICENSE
View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2023 Flow Works
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,65 +0,0 @@
<div align="center">
<img src="https://raw.githubusercontent.com/Flow-Works/FlowOS/master/src/assets/flow.png" width="100px">
# FlowOS
<img src="https://cdn.rawgit.com/standard/standard/master/badge.svg" height="50">
<a href="https://discord.gg/axUqK8CN2n"><img src="https://raw.githubusercontent.com/Flow-Works/FlowOS/master/src/assets/badge.png" height="50"></a><br/>
<img src="https://img.shields.io/github/stars/flow-works/flowos?style=for-the-badge" />
<img src="https://img.shields.io/github/issues-pr/flow-works/flowos?style=for-the-badge" />
<img src="https://img.shields.io/github/forks/flow-works/flowos?style=for-the-badge&color=orange" />
<img src="https://img.shields.io/github/commit-activity/t/Flow-Works/FlowOS?style=for-the-badge&color=violet" />
<img src="https://img.shields.io/github/actions/workflow/status/flow-works/flowos/build.yml?style=for-the-badge" />
<br>
<i>The most aesthetic webOS.</i>
<br>
<a href="https://docs.flow-works.me"><strong>Read the docs »</strong></a>
<br>
</div>
## What is FlowOS?
FlowOS is a web OS proxy made for the Titanium Network 2023 Proxathon. It's extremely customizable with an API to make your apps, themes, and modules.
## Getting Started
To run FlowOS on your local machine, you need Node.js 16 or above.
1. Clone the repository
```bash
git clone https://github.com/Flow-Works/FlowOS
```
2. Install packages
```bash
npm install
```
3. Run!
```bash
npm run serve
```
## Contributing
## Made with
FlowOS is made with the following software:
* [Kat21's HTML Library](https://github.com/datkat21/html)
* [Prism Code Editor](https://github.com/FIameCaster/prism-code-editor)
* [Vite](https://vitejs.dev)
* [Ultraviolet](https://github.com/titaniumnetwork-dev/ultraviolet)
## Contributors
* [ThinLiquid](https://github.com/ThinLiquid)
* [proudparrot2](https://github.com/proudparrot2)
* [FlameCaster](https://github.com/FlameCaster)
* [RisingGlitch](https://github.com/RisingGlitch)
* [httphypixelnet](https://github.com/httphypixelnet)
* [idk-pixel](https://github.com/idk-pixel)
### Special Thanks
* [datkat21](https://github.com/datkat21)
* [alexfeed1990](https://github.com/alexfeed1990)
## License
FlowOS is licensed under the MIT license. See the `LICENSE` file for more information.

View file

@ -0,0 +1,46 @@
const l="/FlowOS/assets/web-browser-8b47647b.svg",d={config:{name:"Browser",type:"process",icon:l,targetVer:"1.0.0-indev.0"},run:async i=>{const t=await i.loadLibrary("lib/WindowManager").then(o=>o.createWindow({title:"Browser",icon:l,width:500,height:700},i)),c=await i.loadLibrary("lib/XOR");t.content.style.height="100%",t.content.style.display="flex",t.content.style.flexDirection="column",t.content.innerHTML=`
<div style="display: flex;padding: 10px;gap: 10px;">
<div id="tabs-container" style="display: flex;gap: 10px;"></div>
<button class="add">+</button>
</div>
<div class="tools" style="display:flex;gap:10px;align-items:center;">
<i class='back material-symbols-rounded'>arrow_back</i>
<i class='forward material-symbols-rounded'>arrow_forward</i>
<i class='refresh material-symbols-rounded'>refresh</i>
<input class="inp" style="border-radius: 15px;flex: 1;background: var(--base);border:none;padding: 0px 16px;height: 30px;">
<i class='toggle material-symbols-rounded'>toggle_on</i>
<i class='fullscreen material-symbols-rounded'>fullscreen</i>
</div>
<div id="content-container"></div>
<style>
iframe {
width: 100%;
height: 100%;
border: none;
}
#content-container {
flex: 1;
background: white;
}
.add {
border: none;
background: transparent;
}
#tabs-container > div {
padding: 5px 10px;
}
.active {
background: var(--surface-0);
border-radius: 10px!important;
}
.tools {
background: var(--surface-0);
padding: 10px;
}
</style>
`;class a{active=!1;proxy=!0;header=document.createElement("div");iframe=document.createElement("iframe");constructor(e){this.iframe.src=`/service/${c.encode(e)}`,this.iframe.style.display="none",this.header.innerHTML=`
<span class="title">Tab</span>
<span class="close">&times;</sp>
`}toggle(){if(this.proxy=!this.proxy,!this.proxy){this===n.activeTab&&(t.content.querySelector(".toggle").innerHTML="toggle_off"),this.header.querySelector(".title").innerText="Tab",this.iframe.src=t.content.querySelector("input")?.value;return}this===n.activeTab&&(t.content.querySelector(".toggle").innerHTML="toggle_on"),this.iframe.src=`/service/${c.encode(t.content.querySelector("input")?.value??"")}`}}class s{tabs=[];tabHistory=[];activeTab;addTab(e){this.tabs.push(e),this.setActiveTab(e),e.header.querySelector(".title").onclick=()=>this.setActiveTab(e),e.header.querySelector(".close").onclick=()=>this.closeTab(e),t.content.querySelector("#content-container")?.appendChild(e.iframe),t.content.querySelector("#tabs-container")?.appendChild(e.header),e.iframe.onload=()=>{e.header.querySelector(".title").textContent=e.iframe.contentDocument?.title??"Tab",e.iframe.contentDocument?.title===""&&(e.header.querySelector(".title").textContent="Tab"),e===this.activeTab&&(t.content.querySelector(".inp").value=c.decode(e.iframe.contentWindow.location.href.split("/service/")[1]))}}closeTab(e){if(e.header.remove(),e.iframe.remove(),e.active){const r=t.content.querySelector("#tabs-container")?.lastElementChild;r!==void 0?(r?.querySelector(".title")).click():this.addTab(new a("https://google.com"))}}setActiveTab(e){if(this.tabs.forEach(r=>{r.active&&(r.active=!1,r.iframe.style.display="none",r.header.classList.remove("active"))}),e.proxy){try{t.content.querySelector(".inp").value=c.decode(e.iframe.contentWindow.location.href.split("/service/")[1])}catch{t.content.querySelector(".inp").value="about:blank"}t.content.querySelector(".toggle").innerHTML="toggle_on"}else{e.header.querySelector(".title").textContent="Tab";try{t.content.querySelector(".inp").value=e.iframe.contentWindow.location.href}catch{t.content.querySelector(".inp").value="about:blank"}t.content.querySelector(".toggle").innerHTML="toggle_off"}e.active=!0,e.iframe.style.display="block",e.header.classList.add("active"),this.activeTab=e,this.tabHistory.push(e)}}const n=new s;t.content.querySelector(".inp")?.addEventListener("keydown",o=>{o.key==="Enter"&&(n.activeTab.iframe.src=n.activeTab.proxy?`/service/${c.encode(t.content.querySelector(".inp").value)}`:t.content.querySelector(".inp").value)}),t.content.querySelector("button").onclick=()=>{n.addTab(new a("https://google.com"))},t.content.querySelector(".refresh").onclick=()=>{n.activeTab.iframe.contentWindow?.location.reload()},t.content.querySelector(".back").onclick=()=>{n.activeTab.iframe.contentWindow?.history.back()},t.content.querySelector(".forward").onclick=()=>{n.activeTab.iframe.contentWindow?.history.forward()},t.content.querySelector(".toggle").onclick=()=>{n.activeTab.toggle()},t.content.onfullscreenchange=()=>{t.content.querySelector(".fullscreen").innerHTML=document.fullscreenElement!==null?"fullscreen_exit":"fullscreen"},t.content.querySelector(".fullscreen").onclick=async()=>{document.fullscreenElement===null?await t.content.requestFullscreen().catch(o=>console.error):await document.exitFullscreen().catch(o=>console.error)},n.addTab(new a("https://google.com"))}};export{d as default};

View file

@ -0,0 +1 @@
let t;const u={config:{name:"Components",type:"library",targetVer:"0.0.1"},init:(r,n,e)=>{t=r},data:{Input:{new:()=>{const{HTML:r}=t,n=new r("input");return n.style({"border-radius":"5px",padding:"2.5px",outline:"none",background:"transparent",border:"1px solid var(--surface-0)"}),n}},Button:{new:(r="normal")=>{function n(d,a){const s=parseInt(d,16),p=(s>>16)+a,i=(s>>8&255)+a;return((s&255)+a|i<<8|p<<16).toString(16)}const{HTML:e}=t,o=new e("button");return o.style({"border-radius":"5px",padding:"2.5px 5px",background:"var(--base)",border:"1px solid var(--surface-0)"}),r==="normal"?o.style({background:"var(--base)"}):r==="primary"&&o.style({background:"var(--primary)",color:"var(--base)",border:`1px solid #${n(document.documentElement.style.getPropertyValue("--primary").replace("#",""),-40)}`}),o}},Icon:{new:(r,n="inherit")=>{const{HTML:e}=t;return new e("i").class("material-symbols-rounded").text(r).style({"font-size":n})}},Dropdown:{new:r=>{const{HTML:n}=t,e=new n("select");return e.style({"border-radius":"5px",padding:"2.5px",background:"var(--base)",border:"1px solid var(--surface-1)"}).appendMany(...r.map(o=>new n("option").text(o))),e}}}};export{u as default};

View file

@ -0,0 +1,11 @@
import{H as o,d as w}from"./index-e011716a.js";import{n as f}from"./application-default-icon-a19c8ba0.js";const T={config:{name:"Desktop",type:"process",targetVer:"1.0.0-indev.0"},run:async e=>{const c=(await e.loadLibrary("lib/SplashScreen")).getElement();c.appendTo(document.body);const{fs:s}=e,y=await e.loadLibrary("lib/WindowManager"),t=await e.loadLibrary("lib/Launcher"),{Input:b}=await e.loadLibrary("lib/Components"),p=b.new().attr({type:"text",placeholder:"Search"}).style({width:"100%","border-radius":"10px",padding:"5px","margin-bottom":"10px",position:"sticky",top:"0"}).on("keyup",()=>{n.elm.innerHTML="",i().catch(a=>console.error(a))}).appendTo(t.element),n=new o("div").style({overflow:"scroll",height:"max-content",position:"relative"});new o("div").style({height:"100%",overflow:"scroll","padding-bottom":"30px"}).append(n).appendTo(t.element).class("gradient-blur");const i=async()=>{n.html(""),(await s.readdir("/home/Applications/")).filter(l=>l.endsWith(".app")&&(p.elm!==null?l.toLowerCase().includes(p.elm.value.toLowerCase()):!0)).forEach(l=>{s.readFile(`/home/Applications/${l}`).then(async r=>{const u=w.Buffer.from(r).toString(),d=await e.kernel.getExecutable(u),g=new o("div").style({display:"flex","align-items":"center",padding:"5px",cursor:"pointer",gap:"10px","border-bottom":"1px solid var(--surface-0)"}).on("click",()=>{e.launch(u).catch(h=>console.error(h)),t.toggle()}).appendTo(n);new o("img").attr({src:d.config.icon??f,alt:`${d.config.name} icon`,height:"40px"}).appendTo(g),new o("div").text(d.config.name).appendTo(g)}).catch(r=>console.error(r))})};await i(),document.addEventListener("fs_update",()=>{i().catch(a=>console.error(a))}),t.element.on("click",a=>{a.target===a.currentTarget&&t.toggle()});const m=await e.loadLibrary("lib/StatusBar");m.element.qs('div[data-toolbar-id="start"]')?.on("click",()=>{t.toggle()}),document.body.style.flexDirection="column-reverse",await m.element.appendTo(document.body),await t.element.appendTo(document.body),await y.windowArea.appendTo(document.body),c.cleanup(),t.element.prepend(new o("div").html(`
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-if+5+1+2-3"
data-ad-client="ca-pub-9675905177363247"
data-ad-slot="2569234651"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
<\/script>
`))}};export{T as default};

99
assets/Editor-d71c30b8.js Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

8
assets/Files-bbe10c74.js Normal file
View file

@ -0,0 +1,8 @@
import{d as u}from"./index-e011716a.js";const w="/FlowOS/assets/file-manager-0e3c2c9d.svg",h={config:{name:"Files",type:"process",icon:w,targetVer:"1.0.0-indev.0"},run:async i=>{const s=await i.loadLibrary("lib/WindowManager").then(e=>e.createWindow({title:"Files",icon:w,width:500,height:400},i)),n=i.fs,r=await i.loadLibrary("lib/MIMETypes");s.content.style.display="flex",s.content.style.flexDirection="column";let d="/home";async function c(e){d=e;const b=await n.readdir(e),y=e==="/"?'<span class="material-symbols-rounded">first_page</span>':'<span class="back material-symbols-rounded">chevron_left</span>';s.content.innerHTML=`
<div style="padding: 5px;display: flex;align-items: center;gap: 5px;">
${y}${e}
<div style="flex:1;"></div>
<i class='folder material-symbols-rounded' style="font-size: 17.5px;">create_new_folder</i><i class='file material-symbols-rounded' style="font-size: 17.5px;">note_add</i>
</div>
<div class="files" style="background: var(--base);flex: 1;border-radius: 10px;display: flex;flex-direction: column;"></div>
`,y!=='<span class="material-symbols-rounded">first_page</span>'&&(s.content.querySelector(".back").onclick=async()=>{await c(e.split("/").slice(0,-1).join("/"))}),s.content.querySelector(".file").onclick=async()=>{const t=prompt("Enter file name");t!=null&&await n.writeFile(`${e}/${t}`,"")},s.content.querySelector(".folder").onclick=async()=>{const t=prompt("Enter folder name");t!=null&&await n.mkdir(`${e}/${t}`)};for(const t of b){const l=e==="/"?"":"/",p=await n.stat(e+l+t),o=document.createElement("div");o.setAttribute("style","display: flex;gap: 5px;align-items:center;padding: 5px;border-bottom: 1px solid var(--text);display:flex;align-items:center;gap: 5px;");const g=()=>`<span class="material-symbols-rounded">${r[t.split(".")[1]]===void 0?"draft":r[t.split(".")[1]].icon}</span>`,x=p.isDirectory()?'<span class="material-symbols-rounded">folder</span>':g();o.innerHTML+=`${x} <span style="flex:1;">${t}</span><span class="material-symbols-rounded delete">delete_forever</span><span class="material-symbols-rounded rename">edit</span>`,o.querySelector(".rename").onclick=async()=>{const a=prompt("Rename");console.log(a),a!=null&&await n.rename(e+l+t,e+l+a)},o.querySelector(".delete").onclick=async()=>{p.isDirectory()?await n.rmdir(e+l+t):await n.unlink(e+l+t)};const m=async a=>{a.split(".").at(-1)==="lnk"?await n.readFile(a).then(async f=>{await m(u.Buffer.from(f).toString())}):a.split(".").at(-1)==="app"?await n.readFile(a).then(async f=>{await i.launch(u.Buffer.from(f).toString())}):await i.launch(r[a.split(".").at(-1)]===void 0?"apps/Editor":r[a.split(".")[1]].opensWith[0],{path:a})};o.ondblclick=async()=>{p.isDirectory()?await c(e+l+t):await m(e+l+t)},s.content.querySelector(".files")?.appendChild(o)}}await c(d),document.addEventListener("fs_update",()=>{c(d).catch(e=>console.error(e))})}};export{h as default};

1
assets/HTML-86c365f8.js Normal file
View file

@ -0,0 +1 @@
import{H as t}from"./index-e011716a.js";const n={config:{name:"HTML",type:"library",targetVer:"1.0.0-indev.0"},init:(a,e,r)=>{},data:t};export{n as default};

View file

@ -0,0 +1 @@
import{d as l}from"./index-e011716a.js";const i="/FlowOS/assets/org.gnome.Loupe-1c680d25.svg",g={config:{name:"Image Viewer",type:"process",icon:i,targetVer:"1.0.0-indev.0"},run:async t=>{if(Object.keys(t.data).length>0){const e=await t.loadLibrary("lib/WindowManager").then(a=>a.createWindow({title:"Image Viewer",icon:i,width:500,height:500},t)),o=t.fs,r=await t.loadLibrary("lib/MIMETypes"),d=await t.loadLibrary("lib/HTML"),n=async()=>{e.content.innerHTML="";const a=await o.readFile(t.data.path),c=`data:${r[t.data.path.split(".").at(-1)].type};base64,${encodeURIComponent(l.Buffer.from(a).toString("base64"))}`;new d("div").style({width:"100%",height:"100%",background:`url(${c})`,"background-size":"contain","background-position":"center","background-repeat":"no-repeat","aspect-ratio":"1 / 1"}).appendTo(e.content)};await n(),document.addEventListener("fs_update",()=>{n().catch(a=>console.error(a))});return}await t.kill(),await t.launch("apps/Files")}};export{g as default};

1
assets/Info-8067e8c7.js Normal file
View file

@ -0,0 +1 @@
import{H as t}from"./index-e011716a.js";const s="/FlowOS/assets/userinfo-2a654358.svg",o="/FlowOS/assets/badge-629f981b.png",r={config:{name:"Info",type:"process",icon:s,targetVer:"1.0.0-indev.0"},run:async n=>{const e=await n.loadLibrary("lib/WindowManager").then(a=>a.createWindow({title:"Info",icon:s,width:300,height:400,canResize:!1},n));e.content.style.padding="10px",e.content.style.textAlign="center",e.content.style.display="flex",e.content.style.flexDirection="column",e.content.style.justifyContent="center",e.content.style.alignItems="center",e.content.style.background="var(--base)",new t("div").appendTo(e.content).appendMany(new t("h1").style({margin:"0"}).text("FlowOS").append(new t("sup").text(`${n.sysInfo.codename}`).style({"font-size":"0.5em"})),new t("p").style({margin:"0"}).text(`v${String(n.sysInfo.version)}`),new t("br"),new t("a").attr({href:"https://discord.gg/nj93ywpyRy"}).append(new t("img").attr({src:o,height:"50"})),new t("br"),new t("a").text("Discord").attr({href:"https://discord.gg/86F8dK9vfn",class:"discord"}),new t("span").text(" - "),new t("a").text("Github").attr({href:"https://github.com/Flow-Works/FlowOS",class:"github"}))}};export{r as default};

View file

@ -0,0 +1 @@
let e=!1;const t={config:{name:"Launcher",type:"library",targetVer:"1.0.0-indev.0"},init:(a,r)=>{t.data.element=new a.HTML("div").style({background:`${document.documentElement.style.getPropertyValue("--mantle")}E0`,width:"350px",height:"500px",margin:"20px",padding:"10px",overflow:"hidden","border-radius":"20px",border:"1px solid var(--surface-0)",position:"fixed",bottom:"-500px",left:"0",transition:"bottom 0.5s cubic-bezier(1,0,0,1)","z-index":"1000","box-shadow":"0 0 10px 0 rgba(0,0,0,0.5)","user-select":"none","backdrop-filter":"blur(10px)"})},data:{toggle:()=>(e?t.data.element.style({bottom:"-500px"}):t.data.element.style({bottom:"68px"}),e=!e,e)}};export{t as default};

View file

@ -0,0 +1 @@
const t={config:{name:"MIMETypes",type:"library",targetVer:"1.0.0-indev.0"},init:(i,e,p)=>{},data:{aac:{type:"audio/aac",description:"AAC Audio",opensWith:["apps/MusicPlayer"],icon:"audio_file"},abw:{type:"application/x-abiword",description:"AbiWord Document",opensWith:["apps/Editor"],icon:"description"},apng:{type:"image/apng",description:"Animated PNG File",opensWith:["apps/ImageViewer"],icon:"image"},app:{type:"application/x-flow-executable",description:"FlowOS Application",opensWith:[],icon:"deployed_code"},avif:{type:"image/avif",description:"AVIF Image",opensWith:["apps/ImageViewer"],icon:"image"},cjs:{type:"application/javascript",description:"CommonJS Module",opensWith:["apps/Editor"],icon:"code"},htm:{type:"text/html",description:"HTML Document",opensWith:["apps/Editor"],icon:"code"},html:{type:"text/html",description:"HTML Document",opensWith:["apps/Editor"],icon:"code"},js:{type:"text/javascript",description:"JavaScript File",opensWith:["apps/Editor"],icon:"code"},lnk:{type:"application/x-ms-shortcut",description:"Windows Shortcut",opensWith:[],icon:"file_present"},md:{type:"text/markdown",description:"Markdown Document",opensWith:["apps/Editor"],icon:"markdown"},mjs:{type:"text/javascript",description:"JavaScript Module",opensWith:["apps/Editor"],icon:"code"},mp4:{type:"video/mp4",description:"MP4 Video",opensWith:["apps/VideoPlayer"],icon:"video_file"},png:{type:"image/png",description:"PNG File",opensWith:["apps/ImageViewer"],icon:"image"},svg:{type:"image/svg+xml",description:"SVG File",opensWith:["apps/ImageViewer"],icon:"image"},theme:{type:"application/x-flow-theme",description:"FlowOS Theme",opensWith:["apps/Editor"],icon:"palette"},txt:{type:"text/plain",description:"Text Document",opensWith:["apps/Editor"],icon:"description"}}};export{t as default};

View file

@ -0,0 +1 @@
const c="/FlowOS/assets/software-properties-abb09ac9.svg",l="/FlowOS/assets/application-executable-b031e44a.svg",r="/FlowOS/assets/icon-library-63ab8699.svg",s={config:{name:"Manager",type:"process",icon:c,targetVer:"1.0.0-indev.0"},run:async e=>{const a=await e.loadLibrary("lib/WindowManager").then(n=>n.createWindow({title:"Manager",icon:c,width:350,height:500,canResize:!1},e)),t=await e.loadLibrary("lib/HTML");a.content.style.display="flex",a.content.style.flexDirection="column",a.content.style.gap="10px",a.content.style.padding="10px",a.content.style.background="var(--base)";for(const n in e.kernel.packageList){const i=new t("div").style({display:"flex",gap:"10px",padding:"10px",background:"var(--surface-0)",borderRadius:"10px"}).appendTo(a.content);new t("img").attr({src:e.kernel.packageList[n].executable.config.icon??(e.kernel.packageList[n].executable.config.type==="library"?r:l),style:"border-radius: 40%;aspect-ratio: 1 / 1;height: 50px;"}).appendTo(i);const o=new t("div").appendTo(i);new t("h3").style({margin:"0"}).text(e.kernel.packageList[n].executable.config.name).appendTo(o),new t("code").text(e.kernel.packageList[n].executable.config.type).appendTo(o)}}};export{s as default};

View file

@ -0,0 +1 @@
import{d as m,l as u}from"./index-e011716a.js";const d="/FlowOS/assets/preferences-system-c8f3e310.svg",f={config:{name:"Settings",type:"process",icon:d,targetVer:"2.0.0"},run:async a=>{const l=await a.loadLibrary("lib/WindowManager").then(t=>t.createWindow({title:"Settings",icon:d,width:500,height:500},a)),{fs:r}=a,o=await a.loadLibrary("lib/HTML"),{Input:w,Button:p,Dropdown:s}=await a.loadLibrary("lib/Components"),c=async t=>{l.content.innerHTML="";for(const e in t){let n=w.new();if(e==="THEME_PRIMARY"){const{extras:i}=JSON.parse(m.Buffer.from(await r.readFile(`/etc/themes/${t.THEME}.theme`)).toString());n=s.new(Object.keys(i))}else e==="THEME"&&(n=s.new((await r.readdir("/etc/themes")).map(i=>i.replace(".theme",""))));e==="THEME_PRIMARY"||e==="THEME"?n.elm.value=t[e]:n.attr({value:t[e]}),console.log(n.getValue()),new o("div").appendMany(new o("label").style({"text-transform":"capitalize"}).text(`${e.toLowerCase().replaceAll("_"," ")}:`),new o("br"),new o("div").style({display:"flex",gap:"5px"}).appendMany(n,p.new().text("Save").on("click",()=>{t[e]=n.getValue(),r.writeFile("/etc/flow",u.stringify(t)).then(()=>{document.dispatchEvent(new CustomEvent("config_update",{detail:{config:t}})),(e==="THEME"||e==="THEME_PRIMARY")&&document.dispatchEvent(new CustomEvent("theme_update",{}))}).catch(i=>console.error(i))}))).appendTo(l.content)}};await c(a.kernel.config),document.addEventListener("config_update",t=>{c(t.detail.config).catch(e=>console.error(e))})}};export{f as default};

View file

@ -0,0 +1 @@
import{F as a}from"./index-e011716a.js";let i,o;const r={config:{name:"SplashScreen",type:"library",targetVer:"1.0.0-indev.0"},init:(e,t,n)=>{i=e,o=t},data:{getElement:()=>{const{HTML:e}=i,t=new e("div").style({position:"absolute",top:"0",left:"0",width:"100vw",height:"100vh",display:"flex","flex-direction":"column","align-items":"center","justify-content":"center","z-index":"1000000"});new e("img").attr({src:a,width:128}).appendTo(t);const n=new e("h1").style({margin:"0"}).text("FlowOS").appendTo(t);return new e("sup").style({"font-size":"0.5em"}).text(o.codename).appendTo(n),new e("p").style({margin:"0"}).text("loading...").appendTo(t),t}}};export{r as default};

View file

@ -0,0 +1,13 @@
import{n as d}from"./application-default-icon-a19c8ba0.js";import{g as o}from"./utils-2c87b698.js";const t={config:{name:"StatusBar",type:"library",targetVer:"1.0.0-indev.0"},init:(e,a,n)=>{if(t.data.element=new e.HTML("toolbar"),t.data.element.html(`
<div class="outlined" data-toolbar-id="start"><span class="material-symbols-rounded">space_dashboard</span></div>
<div data-toolbar-id="apps"></div>
<div style="flex:1;"></div>
<div class="outlined" data-toolbar-id="plugins"><span class="material-symbols-rounded">expand_less</span></div>
<div class="outlined" data-toolbar-id="controls">
<span class="material-symbols-rounded battery">battery_2_bar</span>
<span class="material-symbols-rounded signal">signal_cellular_4_bar</span>
</div>
<div class="outlined" data-toolbar-id="calendar"></div>
`),setInterval(()=>{o().then(l=>{t.data.element.qs('div[data-toolbar-id="calendar"]')?.text(l)}).catch(l=>console.error)},1e3),"getBattery"in navigator)navigator.getBattery().then(l=>{t.data.updateBatteryIcon(l),l.addEventListener("levelchange",()=>{t.data.updateBatteryIcon(l)}),l.addEventListener("chargingchange",()=>{t.data.updateBatteryIcon(l)})});else{const l=document.querySelector('div[data-toolbar-id="controls"] > .battery');l!=null&&(l.innerHTML="battery_unknown")}async function i(l){fetch(`${a.config.SERVER}/bare/`).then(()=>{const r=performance.now()-l;t.data.updateIcon(r)}).catch(()=>{document.querySelector('div[data-toolbar-id="controls"] > .signal').innerHTML="signal_cellular_connected_no_internet_4_bar"})}setInterval(()=>i(performance.now()),1e4),document.addEventListener("app_opened",l=>{new e.HTML("app").appendMany(new e.HTML("img").attr({alt:`${l.detail.proc.config.name} icon`,"data-id":l.detail.token,src:l.detail.proc.config.icon??d}).on("click",()=>{l.detail.win.focus(),l.detail.win.toggleMin()})).appendTo(t.data.element.qs('div[data-toolbar-id="apps"]')?.elm)}),document.addEventListener("app_closed",l=>{t.data.element.qs('div[data-toolbar-id="apps"]')?.qs(`img[data-id="${l.detail.token}"]`)?.elm.parentElement?.remove()})},data:{updateBatteryIcon(e){let a="";e.charging===!0?e.level===1?a="battery_charging_full":e.level>=.9?a="battery_charging_90":e.level>=.8?a="battery_charging_80":e.level>=.6?a="battery_charging_60":e.level>=.5?a="battery_charging_50":e.level>=.3?a="battery_charging_30":e.level>=0&&(a="battery_charging_20"):e.level===1?a="battery_full":e.level>=.6?a="battery_6_bar":e.level>=.5?a="battery_5_bar":e.level>=.4?a="battery_4_bar":e.level>=.3?a="battery_3_bar":e.level>=.2?a="battery_2_bar":e.level>=.1?a="battery_1_bar":e.level>=0&&(a="battery_0_bar");const n=document.querySelector('div[data-toolbar-id="controls"] > .battery');n!=null&&(n.innerHTML=a)},updateIcon(e){let a="";e>=200&&e<400?a="signal_cellular_1_bar":e>=400&&e<600?a="signal_cellular_2_bar":e>=600&&e<800?a="signal_cellular_3_bar":e>=800?a="signal_cellular_4_bar":a="signal_cellular_0_bar",document.querySelector('div[data-toolbar-id="controls"] > .signal').innerHTML=a}}};export{t as default};

1
assets/Store-c0013081.js Normal file
View file

@ -0,0 +1 @@
import{d as $}from"./index-e011716a.js";import{n as k}from"./application-default-icon-a19c8ba0.js";const v="/FlowOS/assets/softwarecenter-ac603202.svg",j={config:{name:"Store",type:"process",icon:v,targetVer:"1.0.0-indev.0"},run:async o=>{const u=await o.loadLibrary("lib/WindowManager").then(e=>e.createWindow({title:"Store",icon:v,width:500,height:700},o)),{fs:c}=o,n=await o.loadLibrary("lib/HTML"),{Button:g,Icon:s}=await o.loadLibrary("lib/Components");fetch(`${o.kernel.config.SERVER}/apps/list/`).then(async e=>await e.json()).then(E).catch(e=>console.error(e));async function m(){const a=await(await fetch(`${o.kernel.config.SERVER}/apps/list/`)).json(),y=new n(u.content).qs("div");a.forEach(async(r,x)=>{const p=y?.qsa("div")?.[x];p?.html(""),fetch(`${o.kernel.config.SERVER}/cors/?url=${r}`).then(async t=>await t.json()).then(t=>{t.apps.forEach(i=>{c.exists(`/home/Applications/${i.url.split("/").at(-1)?.replace(".js",".app")}`).then(d=>{const l=g.new().style({display:"flex",gap:"5px","align-items":"center"}).text("Uninstall").prepend(s.new("delete")).on("click",()=>f(i.url));d?fetch(`${o.kernel.config.SERVER}/cors?url=${i.url}`).then(async h=>await h.text()).then(async h=>{$.Buffer.from(await c.readFile(`/opt/apps/${i.url.split("/").at(-1)}`)).toString()!==h&&l.text("Update").prepend(s.new("update")).on("click",()=>w(i.url))}).catch(h=>console.error(h)):l.text("Install").prepend(s.new("download")).on("click",()=>w(i.url)),new n("div").style({display:"flex","flex-direction":"row",gap:"10px",padding:"10px",background:"var(--base)","border-radius":"10px"}).appendMany(new n("img").attr({src:i.icon??k}).style({"aspect-ratio":"1 / 1",width:"60px",height:"60px"}),new n("div").appendMany(new n("h3").style({margin:"0"}).text(i.name),l)).appendTo(p)}).catch(d=>console.error(d))})}).catch(t=>console.error(t))})}function E(e){u.content.innerHTML="";const a=new n("div").appendTo(u.content);e.forEach(y=>{fetch(`${o.kernel.config.SERVER}/cors/?url=${y}`).then(async r=>await r.json()).then(r=>{const x=s.new("arrow_drop_up");new n("h2").text(r.name).style({margin:"0",padding:"10px",display:"flex",gap:"5px","align-items":"center"}).prepend(x).appendTo(a).on("click",()=>{p.style({height:p.elm.style.height==="0px"?"max-content":"0"}),x.text(`arrow_drop_${p.elm.style.height==="0px"?"up":"down"}`)});const p=new n("div").appendTo(a).style({height:"0",display:"flex","flex-direction":"column",gap:"10px",overflow:"hidden",padding:"0 10px"});r.apps.forEach(t=>{c.exists(`/home/Applications/${t.url.split("/").at(-1)?.replace(".js",".app")}`).then(i=>{const d=g.new().style({display:"flex",gap:"5px","align-items":"center"}).text("Uninstall").prepend(s.new("delete")).on("click",()=>f(t.url));i?fetch(`${o.kernel.config.SERVER}/cors?url=${t.url}`).then(async l=>await l.text()).then(async l=>{$.Buffer.from(await c.readFile(`/opt/apps/${t.url.split("/").at(-1)}`)).toString()!==l&&d.text("Update").prepend(s.new("update")).un("click",()=>f(t.url)).on("click",()=>w(t.url))}).catch(l=>console.error(l)):d.text("Install").prepend(s.new("download")).un("click",()=>f(t.url)).on("click",()=>w(t.url)),new n("div").style({display:"flex","flex-direction":"row",gap:"10px",padding:"10px",background:"var(--base)","border-radius":"10px"}).appendMany(new n("img").attr({src:t.icon??k}).style({"aspect-ratio":"1 / 1",width:"60px",height:"60px"}),new n("div").appendMany(new n("h3").style({margin:"0"}).text(t.name),d)).appendTo(p)}).catch(i=>console.error(i))})}).catch(r=>console.error(r))})}function w(e){fetch(e).then(async a=>await a.text()).then(async a=>{await c.writeFile(`/home/Applications/${e.split("/").at(-1)?.replace(".js",".app")}`,`apps/${e.split("/").at(-1)?.split(".")[0]}`),await c.writeFile(`/opt/apps/${e.split("/").at(-1)}`,a),await m()}).catch(a=>console.error(a))}function f(e){c.unlink(`/home/Applications/${e.split("/").at(-1)?.replace(".js",".app")}`).then(async()=>{await c.unlink(`/opt/apps/${e.split("/").at(-1)}`),await m()}).catch(a=>console.error(a))}}};export{j as default};

View file

@ -0,0 +1,15 @@
const l="/FlowOS/assets/utilities-system-monitor-125f7e39.svg",c={config:{name:"Task Manager",type:"process",icon:l,targetVer:"1.0.0-indev.0"},run:async n=>{const e=await n.loadLibrary("lib/WindowManager").then(d=>d.createWindow({title:"Task Manager",icon:l,width:600,height:200},n)),t=await n.loadLibrary("lib/HTML");e.content.style.display="flex",e.content.style.flexDirection="column",e.content.style.gap="10px",e.content.style.padding="10px",e.content.style.background="var(--base)",new t("style").html(`tbody tr:hover {
background: var(--surface-1);
border-radius: 10px;
}
tr:first-child td:first-child { border-top-left-radius: 10px; }
tr:first-child td:last-child { border-top-right-radius: 10px; }
tr:last-child td:first-child { border-bottom-left-radius: 10px; }
tr:last-child td:last-child { border-bottom-right-radius: 10px; }
table, table td, table th {
border: none!important;
border-collapse:collapse;
}`).appendTo(e.content);const r=new t("table").style({width:"100%"}).appendTo(e.content),o=()=>{const{processList:d}=n.kernel;r.html(""),new t("thead").appendTo(r).append(new t("tr").style({padding:"5px","border-radius":"10px"}).appendMany(new t("th").style({"text-align":"center",width:"10%"}).text("PID"),new t("th").style({"text-align":"left",width:"45%"}).text("Process Name"),new t("th").style({"text-align":"left",width:"45%"}).text("Session Token")));const i=new t("tbody").appendTo(r);for(const a of d)new t("tr").style({padding:"5px","border-radius":"10px"}).appendTo(i).appendMany(new t("td").style({"text-align":"center"}).text(a.pid.toString()),new t("td").style({"text-align":"left"}).text(a.name),new t("td").style({"text-align":"left"}).text(a.token)).on("click",()=>{n.killProcess(a.pid).catch(s=>console.error(s))})};o(),document.addEventListener("update_process",()=>o())}};export{c as default};

View file

@ -0,0 +1 @@
const i="/FlowOS/assets/theme-config-7bf94f6c.svg",m={config:{name:"Theme Maker",type:"process",icon:i,targetVer:"2.0.0"},run:async t=>{const o=await t.loadLibrary("lib/WindowManager"),n=await t.loadLibrary("lib/HTML"),{Input:c,Button:w}=await t.loadLibrary("lib/Components"),h=o.createWindow({title:"Theme Maker",icon:i,width:600,height:200},t),r=new n(h.content),l=["crust","mantle","base","surface-0","surface-1","surface-2","text"],s=c.new().attr({value:"My Theme"});r.appendMany(new n("div").appendMany(new n("label").text("Name: "),s),...l.map(e=>new n("div").appendMany(new n("label").text(`${e[0].toUpperCase()+e.slice(1)}: `),c.new().attr({type:"color",id:e,value:"#000000"}))),w.new().text("Create").on("click",()=>{const e={name:s.getValue(),colors:{}};l.forEach(a=>{e.colors[a]=r.qs(`#${a}`)?.getValue()}),t.fs.writeFile(`/etc/themes/${e.name.replace(/\s/g,"")}.theme`,JSON.stringify(e)).then(()=>{o.createModal("ok","Theme Manager","Theme created successfully.",t).catch(a=>console.error(a))}).catch(a=>console.error(a))}))}};export{m as default};

View file

@ -0,0 +1 @@
const i={config:{name:"User Access Control",type:"process",targetVer:"1.0.0-indev.0"},run:async a=>{if(Object.keys(a.data).length<=0)return;const t=a.data.process.process,r=a.data.executable;return await new Promise(o=>{a.loadLibrary("lib/WindowManager").then(async n=>{let e="Unknown action";switch(a.data.type){case"launch":{e=`${t.config.name} wants to launch ${r.config.name}`;break}case"kill":{e=`${t.config.name} wants to kill ${a.data.name}`;break}case"fs":{e=`${t.config.name} wants to modify/access ${a.data.path}`;break}}n.createModal("allow","User Account Control",e,a).then(async({value:c,win:s})=>{o(!!c)}).catch(c=>console.error(c))}).catch(n=>console.error(n))})}};export{i as default};

View file

@ -0,0 +1,23 @@
import{H as r}from"./index-e011716a.js";import{s as m}from"./utils-2c87b698.js";import{n as w}from"./application-default-icon-a19c8ba0.js";function v(n,t){let s=0,e=0;n.querySelector("window-header")?.addEventListener("mousedown",i);function i(o){o.preventDefault(),d(),s=o.clientX,e=o.clientY,document.onmouseup=l,document.onmousemove=h}function h(o){o.preventDefault();const c=o.clientX-s,p=o.clientY-e,y=n.offsetTop+p,u=n.offsetLeft+c,x=t.offsetWidth,g=t.offsetHeight;y>=0&&y+n.offsetHeight<=g&&(n.style.top=`${y}px`),u>=0&&u+n.offsetWidth<=x&&(n.style.left=`${u}px`),s=o.clientX,e=o.clientY}function l(){document.onmouseup=null,document.onmousemove=null,t.onmouseleave=null}function d(){l(),t.onmouseenter=null}}class f{element;header;realContent;content;maximized;minimized;width;height;isMinimized=!1;isMaximized=!1;wm;process;onClose;config;constructor(t,s,e,i=()=>{}){this.process=t,this.wm=s,this.config=e,this.onClose=i,this.element=document.createElement("window"),this.element.style.zIndex=(s.getHighestZIndex()+1).toString(),this.element.style.position="absolute",this.focus(),this.element.onmousedown=()=>{this.focus()},(e.canResize===void 0||e.canResize===null)&&(e.canResize=!0),e.canResize||(this.element.style.resize="none"),this.element.style.width=`${e.width??300}px`,this.element.style.height=`${e.height??200}px`,this.header=document.createElement("window-header"),this.header.innerHTML=`<img alt="${m(e.title)} icon" src="${m(e.icon===""?w:e.icon)}"></img> <div class="title">${m(e.title)}</div><div style="flex:1;"></div><i id="min" class='material-symbols-rounded' style="margin-bottom: 5px;">minimize</i><i id="close" class='material-symbols-rounded'>close</i>`,e.canResize&&(this.header.innerHTML=`<img alt="${m(e.title)} icon" src="${m(e.icon===""?w:e.icon)}"></img> <div class="title">${m(e.title)}</div><div style="flex:1;"></div><i id="min" class='material-symbols-rounded' style="margin-bottom: 5px;">minimize</i><i id="max" class='material-symbols-rounded' style="font-size: 20px;">square</i><i id="close" class='material-symbols-rounded'>close</i>`),this.header.querySelector("#close").onclick=()=>{this.process.kill().catch(d=>console.error(d))},this.header.querySelector("#min").onclick=()=>this.toggleMin(),e.canResize&&(this.header.querySelector("#max").onclick=()=>this.toggleMax()),this.realContent=document.createElement("window-content");const h=this.realContent.attachShadow({mode:"open"});h.innerHTML=`
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<style>
.material-symbols-rounded {
font-variation-settings:
'FILL' 0,
'wght' 400,
'GRAD' 200,
'opsz' 48
}
</style>
<style>
* {
-ms-overflow-style: none;
scrollbar-width: none;
font-family: "Satoshi", sans-serif;
font-weight: 600;
color: var(--text);
}
</style>
`;const l=document.createElement("body");l.style.margin="0px",l.style.height="100%",h.appendChild(l),this.content=l,this.element.appendChild(this.header),this.element.appendChild(this.realContent),v(this.element,document.querySelector("window-area"))}toggleMin(){return this.isMinimized?(this.element.style.pointerEvents="all",this.element.style.opacity="1",this.element.style.transform="translateY(0)"):(this.element.style.pointerEvents="none",this.element.style.opacity="0",this.element.style.transform="translateY(10px)"),this.isMinimized=!this.isMinimized,this.isMinimized}prevTop;prevLeft;prevWidth;prevHeight;toggleMax(){return this.isMaximized?(this.element.style.width=this.prevWidth,this.element.style.height=this.prevHeight,this.element.style.top=this.prevTop,this.element.style.left=this.prevLeft):(this.prevTop=this.element.style.top,this.prevLeft=this.element.style.left,this.prevWidth=this.element.style.width,this.prevHeight=this.element.style.height,this.element.style.top="0",this.element.style.left="0",this.element.style.width="calc(100% - 2px)",this.element.style.height="calc(100% - 3px)"),this.isMaximized=!this.isMaximized,this.isMaximized}focus(){this.element.style.zIndex!==this.wm.getHighestZIndex().toString()&&(this.element.style.zIndex=(this.wm.getHighestZIndex()+1).toString())}close(){this.element.style.pointerEvents="none",this.element.style.opacity="0",this.element.style.transform="translateY(10px)",this.onClose(),setTimeout(()=>{this.element.remove()},200)}setTitle(t){this.header.querySelector(".title").innerText=t}}const a={config:{name:"WindowManager",type:"library",targetVer:"1.0.0-indev.0"},init:(n,t,s)=>{document.addEventListener("app_closed",e=>{a.data.windows.find(i=>i.process.token===e.detail.token?(i.close(),!0):!1)})},data:{windowArea:new r("window-area"),windows:[],getHighestZIndex:()=>{const n=a.data.windows.map(s=>parseInt(s.element.style.zIndex)),t=Math.max(...n);return t===-1/0?0:t},createWindow:(n,t)=>{const s=new f(t,a.data,n),e={detail:{token:t.token,proc:t.process,win:s}};return document.dispatchEvent(new CustomEvent("app_opened",e)),a.data.windows.push(s),a.data.windowArea.elm.appendChild(s.element),s},createModal:async(n,t,s,e)=>{const i=new f(e,a.data,{title:t,icon:"",width:350,height:150,canResize:!1}),h={detail:{token:e.token,proc:e.process,win:i}},{Button:l}=await e.loadLibrary("lib/Components");return{value:await new Promise(d=>{i.content.style.padding="10px",i.content.style.display="flex",i.content.style.flexDirection="column",i.content.style.gap="10px";const o=new r("div").style({display:"flex",gap:"10px",justifyContent:"center",height:"max-content"}).appendTo(i.content);new r("img").attr({src:e.process.config.icon??w}).style({height:"100%","aspect-ratio":"1 / 1",borderRadius:"50%",alignSelf:"center"}).appendTo(o);const c=new r("div").style({display:"flex",gap:"10px","flex-direction":"column","justify-content":"center",height:"max-content"}).appendTo(o);new r("h3").text(t).style({margin:"0"}).appendTo(c),new r("p").text(s).style({margin:"0"}).appendTo(c);const p=new r("div").style({display:"flex",gap:"10px",alignItems:"right"}).appendTo(c);n==="allow"&&document.dispatchEvent(new CustomEvent("app_opened",h)),n==="allow"?(l.new("primary").text("Allow").appendTo(p).on("click",()=>{d(!0),i.close()}),l.new().text("Deny").appendTo(p).on("click",()=>{d(!1),i.close()})):n==="ok"&&l.new("primary").text("OK").appendTo(p).on("click",()=>{i.close(),d(!0)}),a.data.windows.push(i),a.data.windowArea.elm.appendChild(i.element)}),win:i}}}};export{a as default};

1
assets/XOR-dd425f29.js Normal file
View file

@ -0,0 +1 @@
const d={config:{name:"XOR",type:"library",targetVer:"1.0.0-indev.0"},init:(r,t,n)=>{},data:{encode:r=>encodeURIComponent(r.toString().split("").map((t,n)=>{let e;return n%2===0?e=!1:e=!0,e?String.fromCharCode(t.charCodeAt(0)^2):t}).join("")),decode:r=>{const[t,...n]=r.split("?");return decodeURIComponent(t).split("").map((e,i)=>{let o;return i%2===0?o=!1:o=!0,o?String.fromCharCode(e.charCodeAt(0)^2):e}).join("")+(n.length>0?`?${n.join("?")}`:"")}}};export{d as default};

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -0,0 +1 @@
const a="/FlowOS/assets/application-default-icon-4eb948ca.svg";export{a as n};

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#528bff;font-family:Fira Code,Fira Mono,Menlo,Consolas,DejaVu Sans Mono,monospace;--editor__bg: #292c33;--widget__border: #3a3f4b;--widget__bg: #21252b;--widget__color: #ccc;--widget__color-active: #fff;--widget__color-options: #b2b2b2;--widget__bg-input: #1b1d23;--widget__bg-hover: #5a5d5e4f;--widget__bg-active: #336699;--widget__focus-ring: #5299e0;--search__bg-find: #528bff3d;--widget__bg-error: #5a1d1d;--widget__error-ring: #be1100;--editor__bg-highlight: #99bbff0a;--editor__bg-selection-match: #4a566d66;--editor__line-number: #636d83;--editor__bg-scrollbar: 220, 13%, 41%;--editor__bg-fold: #c5c5c5;--bg-guide-indent: #abb2bf26;color-scheme:dark}.prism-code-editor textarea::selection{background:#3e4451;color:#0000}.pce-matches .match{--search__bg-find: #515c6a}.active-line{--editor__line-number: #abb2bf}.guide-indents .active{--bg-guide-indent: #abb2c280}.token.comment,.token.prolog,.token.cdata{color:#5c6370}[class*=language-],.token.punctuation,.token.entity{color:#abb2bf}.token.keyword,.selector .punctuation,.selector .combinator,.selector .operator,.token.token.arrow{color:#c678dd}.token.attr-name,.doctype .name,.selector .class,.selector .pseudo-element,.selector .pseudo-class,.token.boolean,.token.constant,.token.number,.token.unit,.token.atrule,.token.keyword-null,.token.keyword-undefined{color:#d19a66}.token.class-name,.token.maybe-class-name{color:#e5c07b}.token.property,.token.tag,.token.doctype,.token.symbol,.token.deleted,.token.important,.token.keyword-this,.token.this .token.variable,.token.selector,.language-css .variable,.token.property-access{color:#e06c75}.token.string,.token.char,.token.inserted,.token.regex,.token.attr-value,.token.string.url,.token.attr-value>.punctuation,.token.code-snippet.code{color:#98c379}.language-markdown .url>.variable,.language-markdown .url>.content,.token.function,.token.selector .id{color:#61afef}.token.url,.token.hexcode,.token.keyword-get,.token.builtin,.token.operator{color:#56b6c2}.token.attr-value>.attr-equals,.language-css .property{color:#abb2bf}.language-css .token.important,.token.atrule .token.rule,.language-markdown .italic{color:#c678dd}.token.token.interpolation-punctuation{color:#be5046}.language-json .token.keyword-null,.language-markdown .bold *{color:#d19a66}.language-markdown .code.keyword,.language-json .token.operator,.language-markdown .token.url,.language-markdown .url>.operator,.language-markdown .token.url-reference>.string{color:#abb2bf}.language-css .function,.language-markdown .token.blockquote.punctuation,.language-markdown .token.hr.punctuation,.language-markdown .token.url>.token.url,.language-markdown .token.url-reference.url{color:#56b6c2}.language-markdown .strike *,.language-markdown .token.list.punctuation,.language-markdown .token.title.important>.token.punctuation{color:#e06c75}.token.bold{font-weight:700}.token.comment,.token.italic{font-style:italic}.token.namespace{opacity:.8}.token.bracket-level-0,.token.bracket-level-3,.token.bracket-level-6,.token.bracket-level-9{color:gold}.token.bracket-level-1,.token.bracket-level-4,.token.bracket-level-7,.token.bracket-level-10{color:orchid}.token.bracket-level-2,.token.bracket-level-5,.token.bracket-level-8,.token.bracket-level-11{color:#179fff}.token.bracket-error{color:#ff1212cc}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #888,inset 0 0 0 9in #0064001a}.active-tagname,.word-matches span{background:#575757b8}";export{e as default};

View file

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View file

@ -0,0 +1,14 @@
import{p as m,a as K,I as U,u as lt,l as et,g as dt}from"./Editor-d71c30b8.js";import{y as it,$ as J,b as pt,v as _,B as j,C as q,S as A,E as V}from"./utils-wvIv1qJ9-6ba7c9bb.js";import"./index-e011716a.js";const ct=/[([{][^\n)\]}]*$|(?:(?:^|[^.])\b(?:if\s*\(.+?\)|else|case.+?:))[ \t]*$/,P=/\[]|\(\)|{}/,W=/<(?![!\d])([^\s>\/=$<%]+)(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*>[ \t]*$/,rt=/^<\/(?!\d)[^\s>\/=$<%]+\s*>/,Y=/[([{][^\n)\]}]*$/;m.clike=m.js=m.javascript=m.ts=m.typescript=m.java=m.cs=m.csharp=m.c=m.cpp={comments:{line:"//",block:["/*","*/"]},autoIndent:[([n],l)=>ct.test(l.slice(0,n)),([n,l],t)=>P.test(t[n-1]+t[l])]};m.css=m.sass=m.scss={comments:{block:["/*","*/"]},autoIndent:[([n],l)=>Y.test(l.slice(0,n)),([n,l],t)=>P.test(t[n-1]+t[l])]};const ot=/^(?:area|base|w?br|col|embed|hr|img|input|link|meta|source|track)$/,st=n=>!ot.test(n.match(W)?.[1]||"br");m.markup=m.html=m.markdown=m.md={comments:{block:["<!--","-->"]},autoIndent:[([n],l)=>st(l=l.slice(0,n))||Y.test(l),([n,l],t)=>P.test(t[n-1]+t[l])||st(t.slice(0,n))&&rt.test(t.slice(l))],autoCloseTags([n,l],t){const d=n==l&&(t.slice(0,n)+">").match(W)?.[1];if(d&&!ot.test(d))return`</${d}>`}};const F=/(?:^|[^\w$])<(?:(?!\d)([^\s>\/=<%]+)(?:(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))*\*\/)+(?:[^\s{*<>\/=]+(?:(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))*\*\/)*=\s*(?:"[^"]*"|'[^']*'|[^\s{'"\/>=]+|(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})))?|(?:\{(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\.{3}(?:[^{}]|(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\}))*\})))*(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))*\*\/)*)?>[ \t]*$/,ut=/^<\/(?!\d)[^\s>\/=<%]*\s*>/,gt=({tags:n,pairs:l},{brackets:t,pairs:d},x)=>{for(let w=n.length,$,v=0;$=n[--w];)if($[3]>x&&$[1]<x)v=$[1];else if($[2]<2&&!$[5]&&$[1]>=v&&$[3]<=x&&!(n[l[w]]?.[1]<x)){for(let k=t.length,f;f=t[--k];)if(f[1]>=$[3]&&f[1]<x&&f[3]=="{"&&!(t[d[k]]?.[1]<x))return;return!0}},nt={line:"//",block:["/*","*/"]},ft={block:["{/*","*/}"]};m.jsx=m.tsx={comments:nt,getComments(n,l){const{matchBrackets:t,matchTags:d}=n.extensions;return(t&&d?gt(d,t,l):it(n,".plain-text",0,0,l))?ft:nt},autoIndent:[([n],l)=>F.test(l=l.slice(0,n))||ct.test(l),([n,l],t)=>P.test(t[n-1]+t[l])||F.test(t.slice(0,n))&&ut.test(t.slice(l))],autoCloseTags([n,l],t){const d=n==l&&(t.slice(0,n)+">").match(F);return d?`</${d[1]||""}>`:""}};const mt=/[([{][^\n)\]}]*$|:[ \t]*$/;m.py=m.python={comments:{line:"#"},autoIndent:[([n],l)=>mt.test(l.slice(0,n)),([n,l],t)=>P.test(t[n-1]+t[l])]};m.xml=m.ssml=m.atom=m.rss=m.mathml=m.svg={comments:{block:["<!--","-->"]},autoIndent:[([n],l)=>W.test(l=l.slice(0,n))||Y.test(l),([n,l],t)=>P.test(t[n-1]+t[l])||W.test(t.slice(0,n))&&rt.test(t.slice(l))],autoCloseTags([n,l],t){const d=n==l&&(t.slice(0,n)+">").match(W);return d?`</${d[1]}>`:""}};const Q=[],X=[],xt=(n=!0)=>{let l,t;const d=[],x=[],w=v=>{if(l=[],x.length=d.length=t=0,$(v.tokens,0),n)for(let k=0,f;f=d[k];){let o=f[0].alias;f[0].alias=(o?(o.join?.(" ")||o)+" ":"")+`bracket-${x[k++]==null?"error":"level-"+f[2]%12}`}},$=(v,k)=>{for(let f=0,o;o=v[f++];){if(typeof o!="string"){const y=o.type,E=o.content;if(y!="regex"){if(Array.isArray(E))$(E,k);else if((o.alias||y)=="punctuation"){let M=E.charCodeAt(E.length-1),b=!!Q[M];if(b||X[M]){if(d[t]=[o,k,0,E,b],b)l.push([t,M]);else for(let a=l.length;a;){let[e,s]=l[--a];if(M-s<3&&M-s>0){x[x[t]=e]=t,d[t][2]=d[e][2]=l.length=a;break}}t++}}}}k+=o.length}};return{update(v){this.update=()=>{},v.extensions.matchBrackets=this,v.addListener("tokenize",w),n&&v.tokens[0]?v.update():w(v)},brackets:d,pairs:x}};Q[40]=Q[91]=Q[123]=!0;X[41]=X[93]=X[125]=!0;const bt=()=>({update(n){this.update=()=>{};let l,t=-1,d=[],x=([k,f]=n.getSelection())=>{let o=k==f&&(l=n.extensions.matchBrackets)&&n.focused&&w(f)||-1;o!=t&&($(),o+1?(d=[l.pairs[o],o].map(y=>it(n,".punctuation",0,-1,l.brackets[y][1])),d[0].nextSibling==d[1]&&(d[0].textContent+=d[1].textContent,d[1].textContent="",d[1]=d[0]),$(!0)):d=[],t=o)},w=k=>{for(let f=0,{brackets:o,pairs:y}=l,E;E=o[++f];)if(!E[4]&&E[1]>k-2&&o[y[f]]?.[1]<=k)return f},$=k=>d.forEach(f=>f.classList.toggle("active-bracket",!!k)),v=addEventListener.bind(n.textarea);v("blur",()=>x()),v("focus",()=>x()),n.addListener("selectionChange",x),n.addListener("update",()=>{$(),t=-1})}}),$t=K('<div style="position:relative;display:inline-block"> </div>',"left:var(--padding-left)","guide-indents"),kt=K("","width:1px;position:absolute;background:var(--bg-guide-indent)"),vt=()=>{let n,l=0,t,d=-1,x;const w=[],$=[],v=$t.cloneNode(!0),k=v.lastChild,f=[],o=b=>{t=[];const a=E(b.split(`
`)),e=a.length;for(let s=0,i=[],r=a[0];r;s++){const{style:c}=w[s]||(w[s]=kt.cloneNode()),[h,u,p]=r,g=$[s];r=a[s+1],h!=g?.[0]&&(c.top=h+"00%"),u!=g?.[1]&&(c.height=u+"00%"),p!=g?.[2]&&(c.left=p+"00%");const C=i[0]!=h&&r?.[0]!=h,S=i[0]+i[1]!=h+u&&r?.[0]+r?.[1]!=h+u;for(let L=-C,z=u+S;L<z;L++)t[L+h]=s;i=$[s]=a[s]}for(let s=l;s>e;)w[--s].remove();k.append(...w.slice(l,l=e))},y=()=>{const b=t[x.activeLineNumber-1]??-1;b!=d&&(d>-1&&(w[d].className=""),b>-1&&(w[b].className="active")),d=b},E=b=>{const a=b.length,e=[],s=[];for(let i=0,r=-1,c=0,h=0;;c++){const u=c==a,p=u?0:f[c]=M(b[c]);if(p==-1)r==-1&&(r=c);else{for(let g=p;g<i;g++)e[g][1]=(r>-1&&(g>p||u)?r:c)-e[g][0];for(let g=i;g<p;)s[h++]=e[g]=[r==-1||g>i?c:r,0,g++*n];r=-1,i=p}if(u)break}return f.length=a,s},M=b=>{let a=b.search(/\S/),e=0;if(a==-1)return-1;for(let s=0;s<a;)e+=b[s++]==" "?n-e%n:1;return Math.ceil(e/n)};return{lines:k.children,indentLevels:f,update(b,a){x||(x=b,b.extensions.indentGuides=this,b.overlays.append(v),b.addListener("update",o),b.addListener("selectionChange",y)),v.style.display=a.wordWrap?"none":"",n!=(n=a.tabSize||2)&&(o(b.value),y())}}},yt=K(" <span></span> ","position:absolute;top:0;opacity:0;padding:inherit"),Ct=()=>{let n=!1,l,t=" ",d=" ",x=yt.cloneNode(!0),[w,$,v]=x.childNodes,k=([o,y,E])=>{let{value:M,activeLine:b}=l,a=E=="backward"?o:y,e=J(M,a),s=/.*/.exec(M.slice(a))[0];!e&&!s&&(s=" "),t!=e&&(w.data=t=e),d!=s&&(v.data=d=s),x.parentNode!=b&&b.prepend(x),n!=(n=!1)&&f()},f=()=>pt(l,$);return{update(o){l||(o.addListener("selectionChange",k),l=o,o.extensions.cursor=this,o.textarea.addEventListener("beforeinput",y=>{n=/history/.test(y.inputType)}),o.activeLine&&k(o.getSelection()))},getPosition(){const o=$.getBoundingClientRect(),y=l.overlays.getBoundingClientRect();return{top:o.y-y.y,bottom:y.bottom-o.bottom,left:o.x-y.x,right:y.right-o.x,height:o.height}},scrollIntoView:f,element:$}},at=navigator.clipboard,H=lt?4:2,St=(n=['""',"''","``","()","[]","{}"],l=/([^\w$'"`]["'`]|.[[({])[;:,.\])}>\s]|.[[({]`/s)=>({update(t,d){this.update=()=>{};let x;const{textarea:w,keyCommandMap:$,inputCommandMap:v,getSelection:k}=t,f=({insertSpaces:a=!0,tabSize:e})=>[a?" ":" ",a?e||2:1],o=()=>!t.extensions.cursor?.scrollIntoView(),y=([a,e],[s,i],r,c)=>(a<e||!c&&l.test((r[e-1]||" ")+s+(r[e]||" ")))&&!j(t,s+r.slice(a,e)+i,null,null,a+1,e+1),E=([a,e],s,i)=>a==e&&i[e]==s&&!t.setSelection(a+1),M=(a,e,s,i,r,c)=>{let h=e.join(`
`);if(h!=a.join(`
`)){const u=a.length-1,p=e[u],g=a[u],C=g.length-p.length,S=e[0].length-a[0].length,L=s+(S<0?e:a)[0].search(/\S|$/),z=i-g.length+(C>0?p:g).search(/\S|$/),O=s-i+h.length+C,T=L>r?r:Math.max(L,r+S),B=c+s-i+h.length;j(t,h,s,i,T,c<z?B+C:Math.max(z+O,B))}},b=(a,e,s,i,r,c,h,u)=>{M(e,e.map(a?p=>p.slice(p.search(/\S|$/)?u-p.search(/\S|$/)%u:0):p=>p&&h.repeat(u-p.search(/\S|$/)%u)+p),s,i,r,c)};v["<"]=(a,e,s)=>y(e,"<>",s,!0),n.forEach(([a,e])=>{const s=a==e;v[a]=(i,r,c)=>(s&&E(r,e,c)||y(r,a+e,c))&&o(),s||(v[e]=(i,r,c)=>E(r,e,c)&&o())}),v[">"]=(a,e,s)=>{const i=m[_(t)]?.autoCloseTags?.call(t,e,s);i&&(j(t,">"+i,null,null,e[0]+1),U(a))},$.Tab=(a,[e,s],i)=>{if(et||d.readOnly||q(a)&6)return;const[r,c]=f(d),h=a.shiftKey,[u,p,g]=A(i,e,s);return e<s||h?b(h,u,p,g,e,s,r,c):j(t,r.repeat(c-(e-p)%c)),o()},$.Enter=(a,e,s)=>{const i=q(a)&7;if(!i||i==H){i&&(e=Array(2).fill(A(s,e[1],e[1])[2]));const[r,c]=f(d),h=m[_(t)]?.autoIndent,u=Math.floor(J(s,e[0]).search(/\S|$/)/c)*c,p=h?.[0]?.call(t,e,s)?c:0,g=h?.[1]?.call(t,e,s),C=`
`+r.repeat(u+p)+(g?`
`+r.repeat(u):"");if(C[1]||e[1]<s.length)return j(t,C,e[0],e[1],e[0]+u+p+1),o()}},$.Backspace=(a,[e,s],i)=>{if(e==s){const r=J(i,e),[,c]=f(d),h=n.includes(i.slice(e-1,e+1)),u=r.length%c||c;if(h||u!=1&&!/\S|^$/.test(r))return j(t,"",e-(h?1:u),e+ +h),o()}};for(let a=0;a<2;a++)$[a?"ArrowDown":"ArrowUp"]=(e,[s,i],r)=>{const c=q(e);if((c&7)==1){if(c==1){const h=a?s:r.lastIndexOf(`
`,s-1),u=a?r.indexOf(`
`,i)+1:i;if(h>-1&&u>0){const[p,g,C]=A(r,h,u),S=p[a?"pop":"shift"](),L=S.length+1;p[a?"unshift":"push"](S),j(t,p.join(`
`),g,C,s+(a?L:-L),i+(a?L:-L))}}else{const[h,u,p]=A(r,s,i),g=h.join(`
`),C=a?g.length+1:0;j(t,g+`
`+g,u,p,s+C,i+C)}return o()}};w.addEventListener("keydown",a=>{const e=q(a),s=a.keyCode;if(e==H&&(s==221||s==219)){const[i,r]=k();b(s==219,...A(t.value,i,r),i,r,...f(d))}else if(e==(lt?10:2)&&s==77)dt(!et),U(a);else if(a.code=="Backslash"&&e==H||s==65&&e==9){const i=t.value,r=e==9,[c,h]=k(),u=r?c:i.lastIndexOf(`
`,c-1)+1,p=m[_(t,u)]||{},{line:g,block:C}=p.getComments?.(t,u,i)||p.comments||{},[S,L,z]=A(i,c,h),O=S.length-1;if(r){if(C){const[T,B]=C,D=i.slice(c,h),I=i.slice(0,c).search(V(T)+" ?$"),N=RegExp("^ ?"+V(B)).test(i.slice(h));I+1&&N?j(t,D,I,h+ +(i[h]==" ")+B.length,I,I+h-c):j(t,`${T} ${D} ${B}`,c,h,c+T.length+1,h+T.length+1),o()}}else if(g){const T=V(g),B=RegExp(`^\\s*(${T} ?|$)`),D=RegExp(T+" ?"),I=!/\S/.test(i.slice(L,z)),N=S.map(S.every(R=>B.test(R))&&!I?R=>R.replace(D,""):R=>I||/\S/.test(R)?R.replace(/^\s*/,`$&${g} `):R);M(S,N,L,z,c,h),o()}else if(C){const[T,B]=C,D=S[0].search(/\S|$/),I=S[0].startsWith(T,D)&&S[O].endsWith(B),N=S.slice();N[0]=S[0].replace(I?RegExp(V(T)+" ?"):/(?=\S)|$/,I?"":T+" ");let R=N[0].length-S[0].length;N[O]=I?N[O].replace(RegExp(`( ?${V(B)})?$`),""):N[O]+" "+B;let Z=N.join(`
`),G=D+L,tt=G>c?c:Math.max(c+R,G),ht=G>h-(c!=h)?h:Math.min(Math.max(G,h+R),L+Z.length);j(t,Z,L,z,tt,Math.max(tt,ht)),o()}}else if(e==8+H&&s==75){const i=t.value,[r,c,h]=k(),[u,p,g]=A(i,r,c),C=h=="forward"?c-g+u.pop().length:r-p,S=A(i,g+1)[0][0].length;j(t,"",p-!!p,g+!p,p+Math.min(C,S)),o()}}),["copy","cut","paste"].forEach(a=>w.addEventListener(a,e=>{const[s,i]=k();if(s==i&&at){const[[r],c,h]=A(t.value,s,i);a=="paste"?e.clipboardData.getData("text/plain")==x&&(j(t,x+`
`,c,c,s+x.length+1),o(),U(e)):(at.writeText(x=r),a=="cut"&&(j(t,"",c,h+1),o()),U(e))}}))}}),jt=n=>{n.addExtensions(St(),vt(),xt(),bt(),Ct())};export{jt as addExtensions};

Binary file not shown.

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#aeafad;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #282a36;--widget__border: #454545;--widget__bg: #21222c;--widget__color: #f8f8f2;--widget__color-active: #fff;--widget__color-options: #b2b2a8;--widget__bg-input: #282a36;--widget__bg-hover: #5a5d5e80;--widget__bg-active: #6272a466;--widget__focus-ring: #bd93f9;--search__bg-find: #ffffff40;--widget__bg-error: #5a1d1d;--widget__error-ring: #ff5555;--editor__border-highlight: 2px solid #44475a;--editor__bg-selection-match: #424450;--editor__line-number: #6272a4;--editor__bg-scrollbar: 0, 0%, 50%;--editor__bg-fold: #c5c5c5;--bg-guide-indent: #ffffff1a;color-scheme:dark}.match-highlight{--editor__bg-highlight: #44475a}.prism-code-editor textarea::selection{background:#44475a;color:#0000}.pce-matches .match{--search__bg-find: #ffb86c80}.active-line{--editor__line-number: #c6c6c6}.guide-indents .active{--bg-guide-indent: #ffffff45}.token.comment,.token.prolog,.token.cdata{color:#6272a4}[class*=language-],.token.punctuation,.language-markdown .code.keyword{color:#f8f8f2}.token.namespace{opacity:.7}.token.tag,.token.operator,.token.attr-equals,.token.doctype,.token.symbol,.token.unit,.token.selector,.token.deleted,.token.keyword,.token.regex-flags,.token.atrule .rule,.token.token.interpolation-punctuation,.language-markdown .url .content{color:#ff79c6}.token.boolean,.token.number,.token.color,.language-markdown .token.title,.token.nil{color:#bd93f9}.selector .class,.selector .id,.token.pseudo-element,.token.pseudo-class,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted,.token.function,.token.function .maybe-class-name,.doctype .name,.language-markdown .code-language,.language-markdown .code-snippet.code{color:#50fa7b}.token.class-name,.token.maybe-class-name,.language-css .token.function,.language-scss .token.function,.language-sass .token.function,.language-css .token.property,.language-scss .token.property,.language-sass .token.property,.language-markdown .url{color:#8be9fd}.token.entity,.token.url,.token.variable,.token.generic{color:#f8f8f2}.token.regex,.token.language-regex,.token.attr-value,.token.string,.token.string-property,.language-markdown .italic *{color:#f1fa8c}.token.regex-delimiter{color:#f55}.token.important,.token.parameter,.token.url,.token.atrule,.language-markdown .bold *,.token.constant{color:#ffb86c}.language-tsx .token.builtin,.language-typescript .token.builtin{color:#8be9fd}.token.important,.token.bold{font-weight:700}.token.italic,.token.parameter,.token.attr-name,.doctype .name,.selector .class,.token.pseudo-element,.token.pseudo-class,.tag>.class-name{font-style:italic}.parameter .punctuation{font-style:normal}.token.bracket-level-0,.token.bracket-level-6{color:#f8f8f2}.token.bracket-level-1,.token.bracket-level-7{color:#ff79c6}.token.bracket-level-2,.token.bracket-level-8{color:#8be9fd}.token.bracket-level-3,.token.bracket-level-9{color:#50fa7b}.token.bracket-level-4,.token.bracket-level-10{color:#bd93f9}.token.bracket-level-5,.token.bracket-level-11{color:#ffb86c}.token.bracket-error{color:#f55}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #b9b9b9,inset 0 0 0 9in #0064001a}.active-tagname,.word-matches span{background:#8be9fd4f}";export{e as default};

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#2f81f7;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #0d1117;--widget__border: #303741;--widget__bg: #161b22;--widget__color: #b8bfc7;--widget__color-active: #fff;--widget__color-options: #757e8a;--widget__bg-input: #0d1117;--widget__bg-hover: #5a5d5e4f;--widget__bg-active: #1f6feb66;--widget__focus-ring: #007acc;--search__bg-find: #f2cc6080;--widget__bg-error: #5a1d1d;--widget__error-ring: #be1100;--editor__bg-highlight: #6e76811a;--editor__bg-selection-match: #3fb95040;--editor__line-number: #6e7681;--editor__bg-scrollbar: 210, 10%, 32%;--editor__bg-fold: #7d8590;--bg-guide-indent: #e6edf31f;color-scheme:dark}.prism-code-editor textarea::selection{color:#0000;background:#264f78}.pce-matches .match{--search__bg-find: #8c8d6c}.active-line{--editor__line-number: #e6edf3}.guide-indents .active{--bg-guide-indent: #e6edf33d}[class*=language-],.language-markdown .url>.operator,.token.punctuation,.token.code.keyword{color:#e6edf3}.token.atrule,.token.variable,.language-css .token.url,.token.parameter,.token.list.punctuation,.token.class-name,.token.maybe-class-name{color:#ffa657}.token.atrule .rule,.token.unit,.token.selector .combinator,.token.operator,.token.regex-flags,.token.keyword{color:#ff7b72}.token.tag,.token.selector,.token.doctype{color:#7ee787}.token.token.interpolation-punctuation,.token.attr-value,.token.string,.token.regex,.language-regex,.token.string-property,.language-markdown .url .content,.language-markdown .url .variable{color:#a5d6ff}.token.builtin,.token.selector .class,.token.selector .id,.token.pseudo-class,.token.pseudo-element,.token.attr-name,.language-css .token.property,.language-scss .token.property,.language-sass .token.property,.token.number,.token.color,.token.boolean,.token.constant,.token.title.important,.title.important .punctuation,.language-css .token.function,.language-scss .token.function,.language-sass .token.function,.token.code-snippet.code,.token.doctype .name,.token.property-access,.token.keyword-null,.token.keyword-this,.language-jsx .tag>.punctuation,.language-tsx .tag>.punctuation{color:#79c0ff}.token.function{color:#d2a8ff}.token.comment,.token.cdata{color:#8b949e}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.bracket-level-0,.token.bracket-level-6{color:#79c0ff}.token.bracket-level-1,.token.bracket-level-7{color:#56d364}.token.bracket-level-2,.token.bracket-level-8{color:#e3b341}.token.bracket-level-3,.token.bracket-level-9{color:#ffa198}.token.bracket-level-4,.token.bracket-level-10{color:#ff9bce}.token.bracket-level-5,.token.bracket-level-11{color:#d2a8ff}.token.bracket-error{color:#7d8590}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #3fb95099,inset 0 0 0 9in #3fb95040}.active-tagname,.word-matches span{box-shadow:inset 0 0 0 1px #6e768199,inset 0 0 0 9in #6e768180}";export{e as default};

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#539bf5;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #22272e;--widget__border: #444;--widget__bg: #22272e;--widget__color: #adbac7;--widget__color-active: #fff;--widget__color-options: #8a99a8;--widget__bg-input: #2d333b;--widget__bg-hover: #5a5d5e4f;--widget__bg-active: #1f6feb66;--widget__focus-ring: #007acc;--search__bg-find: #eac55f80;--widget__bg-error: #5a1d1d;--widget__error-ring: #be1100;--editor__bg-highlight: #636e7b1a;--editor__bg-selection-match: #57ab5a40;--editor__line-number: #636e7b;--editor__line-number-active: #adbac7;--editor__bg-scrollbar: 210, 10%, 35%;--editor__bg-fold: #768390;--bg-guide-indent: #adbac71f;color-scheme:dark}.prism-code-editor textarea::selection{background:#264f78;color:#0000}.pce-matches .match{--search__bg-find: #888a6c}.active-line{--editor__line-number: #adbac7}.guide-indents .active{--bg-guide-indent: #adbac73d}[class*=language-],.language-markdown .url>.operator,.token.punctuation,.token.code.keyword{color:#adbac7}.token.class-name,.token.maybe-class-name,.token.atrule,.token.variable,.language-css .token.url,.token.parameter,.token.list.punctuation{color:#f69d50}.token.atrule .rule,.token.unit,.token.selector .combinator,.token.operator,.token.regex-flags,.token.keyword{color:#f47067}.token.tag,.token.selector,.token.doctype{color:#8ddb8c}.token.function{color:#dcbdfb}.token.token.interpolation-punctuation,.token.attr-value,.token.string,.token.regex,.language-regex,.token.string-property,.language-markdown .url .content,.language-markdown .url .variable{color:#96d0ff}.token.builtin,.token.selector .class,.token.selector .id,.token.pseudo-class,.token.pseudo-element,.token.attr-name,.language-css .token.property,.language-scss .token.property,.language-sass .token.property,.token.number,.token.constant,.token.color,.token.boolean,.token.title.important,.title.important .punctuation,.language-css .token.function,.language-scss .token.function,.language-sass .token.function,.token.code-snippet.code,.token.doctype .name,.token.property-access,.token.keyword-null,.token.keyword-this,.language-jsx .tag>.punctuation,.language-tsx .tag>.punctuation{color:#6cb6ff}.token.comment,.token.cdata{color:#768390}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.bracket-level-0,.token.bracket-level-6{color:#6cb6ff}.token.bracket-level-1,.token.bracket-level-7{color:#6bc46d}.token.bracket-level-2,.token.bracket-level-8{color:#daaa3f}.token.bracket-level-3,.token.bracket-level-9{color:#ff938a}.token.bracket-level-4,.token.bracket-level-10{color:#fc8dc7}.token.bracket-level-5,.token.bracket-level-11{color:#dcbdfb}.token.bracket-error{color:#768390}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #57ab5a99,inset 0 0 0 9in #57ab5a40}.active-tagname,.word-matches span{box-shadow:inset 0 0 0 1px #636e7b99,inset 0 0 0 9in #636e7b80}";export{e as default};

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#24292e;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #fff;--widget__border: #bfbfbf;--widget__bg: #f6f8fa;--widget__color: #434d56;--widget__color-active: #000;--widget__color-options: #5a6772;--widget__bg-input: #fafbfc;--widget__bg-hover: #b8b8b84f;--widget__bg-active: #2188ff33;--widget__focus-ring: #007acc;--search__bg-find: #ffdf5d66;--widget__bg-error: #f2dede;--widget__error-ring: #be1100;--editor__bg-highlight: #f6f8fa;--editor__bg-selection-match: #34d05840;--editor__line-number: #1b1f2380;--editor__bg-scrollbar: 210, 7%, 55%;--editor__bg-fold: #656d76;--bg-guide-indent: #1f23281f;color-scheme:light}.prism-code-editor textarea::selection{color:#0000;background:#add6ff}.pce-matches .match{--search__bg-find: #e9e5ba}.active-line{--editor__line-number: #1f2328}.guide-indents .active{--bg-guide-indent: #1f23284d}[class*=language-],.language-markdown .url>.operator,.token.punctuation{color:#24292e}.token.doctype,.token.builtin{color:#005cc5}.token.atrule,.token.variable,.language-css .token.url,.token.parameter,.token.list.punctuation,.token.maybe-class-name,.token.class-name{color:#e36209}.token.keyword,.token.doctype .name,.token.atrule .rule,.token.unit,.token.selector .combinator,.token.regex-flags,.token.operator{color:#d73a49}.token.tag,.token.selector{color:#22863a}.token.selector .class,.token.selector .id,.token.pseudo-class,.token.pseudo-element,.token.function{color:#6f42c1}.token.token.interpolation-punctuation,.token.attr-value,.token.string,.token.regex,.language-regex,.token.string-property,.language-markdown .url .content,.language-markdown .url .variable{color:#032f62}.token.code.keyword{color:#24292e}.token.attr-name,.language-css .token.property,.language-sass .token.property,.language-scss .token.property,.token.number,.token.constant,.token.color,.token.boolean,.token.title.important,.title.important .punctuation,.token.property-access,.token.nil,.token.keyword-this,.language-css .token.function,.language-sass .token.function,.language-scss .token.function,.token.code-snippet.code{color:#005cc5}.token.comment,.token.cdata{color:#6a737d}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.language-jsx .tag>.punctuation,.language-tsx .tag>.punctuation{color:#0550ae}.token.bracket-level-0,.token.bracket-level-6{color:#0366d6}.token.bracket-level-1,.token.bracket-level-7{color:#138934}.token.bracket-level-2,.token.bracket-level-8{color:#b37700}.token.bracket-level-3,.token.bracket-level-9{color:#cb2431}.token.bracket-level-4,.token.bracket-level-10{color:#a43276}.token.bracket-level-5,.token.bracket-level-11{color:#8a3ddb}.token.bracket-error{color:#ff1212cc}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #34d05899,inset 0 0 0 9in #35d05940}.active-tagname,.word-matches span{box-shadow:inset 0 0 0 1px #afb8c199,inset 0 0 0 9in #eaeef280}";export{e as default};

View file

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

1
assets/index-a6009835.js Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
@font-face{font-family:Material Symbols Outlined;font-style:normal;font-weight:100 700;font-display:block;src:url(/FlowOS/assets/material-symbols-outlined-af655217.woff2) format("woff2")}.material-symbols-outlined{font-family:Material Symbols Outlined;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Symbols Rounded;font-style:normal;font-weight:100 700;font-display:block;src:url(/FlowOS/assets/material-symbols-rounded-dc1c3bdf.woff2) format("woff2")}.material-symbols-rounded{font-family:Material Symbols Rounded;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Symbols Sharp;font-style:normal;font-weight:100 700;font-display:block;src:url(/FlowOS/assets/material-symbols-sharp-7488f367.woff2) format("woff2")}.material-symbols-sharp{font-family:Material Symbols Sharp;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}

368
assets/index-e011716a.js Normal file

File diff suppressed because one or more lines are too long

BIN
assets/index-e011716a.js.gz Normal file

Binary file not shown.

View file

@ -0,0 +1 @@
import{y as E}from"./utils-wvIv1qJ9-6ba7c9bb.js";import"./Editor-d71c30b8.js";import"./index-e011716a.js";const S="xml,rss,atom,jsx,tsx".split(","),w="area,base,br,col,embed,hr,img,input,link,meta,source,track,wbr".split(","),v=a=>{let n=[],t=[],i,c,f=(l,o)=>{i=[],t.length=n.length=c=0,h(l,o,0)},h=(l,o,e)=>{for(let r=0,d=S.includes(o),u=l.length;r<u;){const s=l[r++],p=s.content,T=s.type,x=s.length;if(Array.isArray(p))if(T=="tag"){if(p[0].content){const g=a.value,m=p[0].length,y=g[e+1]=="/",b=g.slice(e+1+y,e+m),k=g[e+x-2]=="/"||!d&&w.includes(b);if(p[2]&&d&&h(p.slice(1,-1),o,e+m),!k)if(y)for(let L=i.length;L;)b==i[--L][1]&&(n[n[c]=i[L][0]]=c,i.length=L,L=0);else i.push([c,b]);t[c++]=[s,e,1+y,e+x,b,k]}}else{let g=s.alias||T;h(p,g.indexOf("language-")?o:g.slice(9),e)}e+=x}};return a.addListener("tokenize",l=>{f(l.tokens,l.language)}),f(a.tokens,a.options.language),a.extensions.matchTags={tags:t,pairs:n}},C=(a,n)=>{for(let t=0,i=n.length;t<i;t++)if(n[t][1]<=a&&n[t][3]>=a)return t},z=()=>({update(a){this.update=()=>{};let n,t;const{tags:i,pairs:c}=this.matcher=a.extensions.matchTags||v(a),f=l=>[n,t].forEach(o=>{o&&o.classList.toggle("active-tagname",!l)}),h=()=>{let[l,o]=a.getSelection(),e,r;if(l==o&&a.focused){let d=C(l,i),u=i[d];if(u&&u[4]){const s=E(a,".tag>.tag",-u[2],0),p=c[d];if(s&&p+1){const T=E(a,".tag>.tag",0,0,i[p][1]);[e,r]=[s,T].map(x=>{let g=x.childNodes,m=g[1];return(g[2]||m.data)&&(m=document.createElement("span"),m.append(...[].slice.call(g,1)),x.append(m)),m})}}}n!=e&&(f(!0),n=e,t=r,f())};a.addListener("selectionChange",h)}}),I=(a,n)=>({update(t){this.update=()=>{};let i,c;const{tags:f}=this.matcher=t.extensions.matchTags||v(t),h=e=>E(t,".tag>.punctuation",0,0,e),l=e=>[i,c].forEach(r=>{r&&r.classList.toggle(a,!e)}),o=()=>{let[e,r]=t.getSelection(),d,u;if(e==r&&t.focused){let s=f[C(e,f)];s&&(n||(r<s[1]+s[2]||r>s[1]+s[2]+s[4].length)&&h())&&(d=h(s[1]),u=h(s[3]-1))}(i!=d||c!=u)&&(l(!0),i=d,c=u,l())};t.addListener("selectionChange",o),t.textarea.addEventListener("focus",o),t.textarea.addEventListener("blur",o)}});export{v as createTagMatcher,I as highlightTagPunctuation,z as matchTags};

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#80a4c2;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #011627;--widget__border: #122d42;--widget__bg: #021320;--widget__color: #d6deeb;--widget__color-active: #fff;--widget__color-options: #b3bccc;--widget__bg-input: #0b253a;--widget__bg-hover: #5a5d5e80;--widget__bg-active: #122d4266;--widget__focus-ring: #5f7e97;--search__bg-find: #5f7e9778;--widget__bg-error: #ab0300f2;--widget__error-ring: #ef5350;--editor__bg-highlight: #0003;--editor__bg-selection-match: #5f7e9778;--editor__line-number: #4b6479;--editor__bg-scrollbar: 206, 88%, 27%;--editor__bg-fold: #c5c5c5;--bg-guide-indent: #5e81ce52;color-scheme:dark}.match-highlight{--editor__bg-highlight: #7e57c259}.prism-code-editor textarea::selection{background:#1d3b53;color:#0000}.pce-matches .match{--search__bg-find: #545a8b}.active-line{--editor__line-number: #c5e4fd}.guide-indents .active{--bg-guide-indent: #b3cfe7b3}.token.comment,.token.prolog,.token.cdata{color:#637777;font-style:italic}.token.namespace{opacity:.7}.token.property{color:#80cbc4}.token.keyword,.token.punctuation,.tag .token.script-punctuation,.token.literal-property,.token.operator,.token.atrule .rule,.language-css .important,.language-markdown .italic *{color:#c792ea}[class*=language-],.language-css .punctuation,.language-markdown .code.keyword,.language-markdown .url .content{color:#d6deeb}.selector .punctuation{color:#c792ea}.token.tag,.token.doctype{color:#caece6}.token.number,.token.tag .class-name{color:#f78c6c}.token.boolean,.token.keyword-null{color:#ff5874}.token.selector{color:#ff6363}.language-markdown .token.url{color:#ff869a}.token.unit,.token.color{color:#ffeb95}.token.atrule,.token.parameter{color:#d7dbe0}.token.token.interpolation-punctuation{color:#d3423e}.tag .punctuation,.doctype .punctuation,.selector .combinator,.selector .operator,.token.attr-equals,.token.property-access,.language-markdown .url .markup-bracket{color:#7fdbca}.selector .id{color:#fad430}.token.attr-value>.punctuation{color:#d9f5dd}.token.attr-name,.doctype .name,.token.variable,.selector .class,.selector .pseudo-element,.selector .pseudo-class,.language-typescript .token.builtin,.language-tsx .token.builtin,.language-markdown .bold *,.language-markdown .code.code-snippet{color:#c5e478}.token.function,.token.keyword-undefined,.token.function .maybe-class-name,.token.title.important,.token.title>.punctuation,.language-markdown .url .variable{color:#82aaff}.token.attr-value,.token.string,.token.string-property{color:#ecc48d}.token.class-name,.token.maybe-class-name{color:#ffcb8b}.token.important,.token.bold{font-weight:700}.token.function,.token.keyword,.token.italic,.token.attr-name,.token.pseudo-class,.token.pseudo-element,.selector .class,.selector .id,.token.atrule .rule,.doctype .name{font-style:italic}.language-css .function{color:#c5e478;font-style:normal}.token.keyword-this,.token.keyword-null,.token.keyword-undefined{font-style:normal}.token.bracket-level-0,.token.bracket-level-3,.token.bracket-level-6,.token.bracket-level-9{color:gold}.token.bracket-level-1,.token.bracket-level-4,.token.bracket-level-7,.token.bracket-level-10{color:orchid}.token.bracket-level-2,.token.bracket-level-5,.token.bracket-level-8,.token.bracket-level-11{color:#179fff}.token.bracket-error{color:#ff1212cc}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #b3cfe7a1,inset 0 0 0 9in #5f7e974d}.active-tagname,.word-matches span{background:#f6bbe533}";export{e as default};

View file

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View file

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

1
assets/prism-de3d353c.js Normal file
View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#000;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #f5f2f0;--widget__border: #bfbfbf;--widget__bg: #edeae8;--widget__color: #444;--widget__color-active: #000;--widget__color-options: #666;--widget__bg-input: #f5f2f0;--widget__bg-hover: #b8b8b84f;--widget__bg-active: #c2dff2;--widget__focus-ring: #0077f0;--search__bg-find: #ea5c0054;--widget__bg-error: #f2dede;--widget__error-ring: #be1100;--editor__bg-highlight: #eae8e6;--editor__bg-selection-match: #b6d5fc80;--editor__line-number: #9d897b;--editor__bg-scrollbar: 24, 7%, 35%;--editor__bg-fold: #424242;--bg-guide-indent: #4b413a33;color-scheme:light}.prism-code-editor textarea::selection{background:#b6d5fc;color:#0000}.pce-matches .match{--search__bg-find: #c7ada9}.active-line{--editor__line-number: #4d3a2e}.guide-indents .active{--bg-guide-indent: #38322f66}[class*=language-]{color:#000}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#905}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#9a6e3a}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function,.token.class-name{color:#dd4a68}.token.regex,.token.important,.token.variable{color:#e90}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.bracket-level-0,.token.bracket-level-3,.token.bracket-level-6,.token.bracket-level-9{color:#0431fa}.token.bracket-level-1,.token.bracket-level-4,.token.bracket-level-7,.token.bracket-level-10{color:#319331}.token.bracket-level-2,.token.bracket-level-5,.token.bracket-level-8,.token.bracket-level-11{color:#7b3814}.token.bracket-error{color:#ff1212cc}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #b9b9b9,inset 0 0 0 9in #0064001a}.active-tagname,.word-matches span{background:#57575740}";export{e as default};

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#f8f8f2;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #272822;--widget__border: #4f5148;--widget__bg: #242622;--widget__color: #cfd1c7;--widget__color-active: #fff;--widget__color-options: #9ea092;--widget__bg-input: #35372f;--widget__bg-hover: #5a5d5e4f;--widget__bg-active: #99947c66;--widget__focus-ring: #99947c;--search__bg-find: #ea5c0054;--widget__bg-error: #5a1d1d;--widget__error-ring: #be1100;--editor__bg-highlight: #36362b;--editor__bg-selection-match: #575b6180;--editor__line-number: #90908a;--editor__bg-scrollbar: 0, 0%, 45%;--editor__bg-fold: #c5c5c5;--bg-guide-indent: #9e9f9640;color-scheme:dark}.prism-code-editor textarea::selection{background:#575a5a;color:#0000}.pce-matches .match{--search__bg-find: #885a3c}.active-line{--editor__line-number: #c2c2bf}.guide-indents .active{--bg-guide-indent: #dbdbd973}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#8292a2}[class*=language-],.token.punctuation{color:#f8f8f2}.token.namespace{opacity:.7}.token.property,.token.tag,.token.constant,.token.symbol,.token.deleted,.token.keyword.control-flow,.token.keyword.module{color:#f92672}.token.boolean,.token.number{color:#ae81ff}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#a6e22e}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.function,.token.class-name{color:#e6db74}.token.keyword{color:#66d9ef}.token.regex,.token.important{color:#fd971f}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.bracket-level-0,.token.bracket-level-3,.token.bracket-level-6,.token.bracket-level-9{color:gold}.token.bracket-level-1,.token.bracket-level-4,.token.bracket-level-7,.token.bracket-level-10{color:orchid}.token.bracket-level-2,.token.bracket-level-5,.token.bracket-level-8,.token.bracket-level-11{color:#179fff}.token.bracket-error{color:#ff1212cc}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #888,inset 0 0 0 9in #0064001a}.active-tagname,.word-matches span{background:#4a4a7680}";export{e as default};

View file

@ -0,0 +1 @@
const e=".prism-code-editor{font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #fdf6e3;caret-color:#657b83;--widget__border: #c2c2c2;--widget__bg: #f9f0d7;--widget__color: #405359;--widget__color-active: #000;--widget__color-options: #657a81;--widget__bg-input: #fdf6e3;--widget__bg-hover: #b8b8b84f;--widget__bg-active: #6fa3b34d;--widget__focus-ring: #4bafce;--search__bg-find: #eb5e0054;--widget__bg-error: #f2dede;--widget__error-ring: #be1100;--editor__bg-highlight: #eee8d5;--editor__bg-selection-match: #f3f0e299;--editor__line-number: #53abc6;--editor__bg-scrollbar: 0, 0%, 25%;--editor__bg-fold: #424242;--bg-guide-indent: #586e7580;color-scheme:light}.prism-code-editor textarea::selection{background:#ede7d4;color:#0000}.pce-matches .match{--search__bg-find: #edba8f}.active-line{--editor__line-number: #0b216f}.guide-indents .active{--bg-guide-indent: #081e2580}[class*=language-]{color:#657b83}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#93a1a1}.token.punctuation{color:#586e75}.token.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#268bd2}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.url,.token.inserted{color:#2aa198}.token.entity{color:#657b83;background:#eee8d5}.token.atrule,.token.attr-value,.token.keyword{color:#859900}.token.function,.token.class-name{color:#b58900}.token.regex,.token.important,.token.variable{color:#cb4b16}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.bracket-level-0,.token.bracket-level-3,.token.bracket-level-6,.token.bracket-level-9{color:#0431fa}.token.bracket-level-1,.token.bracket-level-4,.token.bracket-level-7,.token.bracket-level-10{color:#319331}.token.bracket-level-2,.token.bracket-level-5,.token.bracket-level-8,.token.bracket-level-11{color:#7b3814}.token.bracket-error{color:#ff1212cc}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #b9b9b9,inset 0 0 0 9in #0064001a}.active-tagname,.word-matches span{background:#57575740}";export{e as default};

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#fff;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #141414;--widget__border: #383838;--widget__bg: #141414;--widget__color: #ccc;--widget__color-active: #fff;--widget__color-options: #aaa;--widget__bg-input: #222;--widget__bg-hover: #282828;--widget__bg-active: #336699;--widget__focus-ring: #5299e0;--search__bg-find: #43474cab;--widget__bg-error: #4d1919;--widget__error-ring: #cc0000;--editor__bg-highlight: #1f1f1f;--editor__bg-selection-match: #27292a80;--editor__line-number: #8292a2;--editor__bg-scrollbar: 0, 0%, 45%;--editor__bg-fold: #c5c5c5;--bg-guide-indent: #ededed1f;color-scheme:dark}.prism-code-editor textarea::selection{background:#27292a;color:#0000}.pce-matches .match{--search__bg-find: #3a3e41}.active-line{--editor__line-number: #d3d9de}.guide-indents .active{--bg-guide-indent: #ededed3d}[class*=language-]{color:#fff}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#787878}.token.punctuation,.token.namespace{opacity:.7}.token.tag,.token.boolean,.token.number,.token.deleted{color:#cf694a}.token.keyword,.token.property,.token.selector,.token.constant,.token.symbol,.token.builtin{color:#f9ee9a}.token.attr-name,.token.attr-value,.token.string,.token.char,.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string,.token.variable,.token.inserted{color:#919e6b}.token.atrule{color:#7386a5}.token.regex,.token.important{color:#e9c163}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.tag,.token.attr-name,.tag>.token.punctuation{color:#ad895c}.token.bracket-level-0,.token.bracket-level-3,.token.bracket-level-6,.token.bracket-level-9{color:gold;opacity:1}.token.bracket-level-1,.token.bracket-level-4,.token.bracket-level-7,.token.bracket-level-10{color:orchid;opacity:1}.token.bracket-level-2,.token.bracket-level-5,.token.bracket-level-8,.token.bracket-level-11{color:#179fff;opacity:1}.token.bracket-error{color:#ff1212cc;opacity:1}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #888,inset 0 0 0 9in #0064001a}.active-tagname,.word-matches span{background:#575757b8}";export{e as default};

View file

@ -0,0 +1 @@
const e='.prism-search{display:grid;border:1px solid var(--widget__border);grid:auto / 1em auto;gap:.3em;padding:.3em;border-radius:.3em;margin:-99in 0 0;font:400 1em/1.5 Arial,Helvetica,sans-serif;color:var(--widget__color);background:var(--widget__bg);position:sticky;top:.5em;right:.5em;left:.5em;z-index:4;pointer-events:auto;box-sizing:border-box}.prism-search *{box-sizing:border-box}.prism-search button{all:unset;cursor:pointer}.pce-readonly>.prism-search-container>div{grid:auto / auto}.prism-search>div>div{display:flex}.prism-search input{padding:0 0 0 .3em;width:calc(var(--search-width, 20em) - 10ch - 4px);font:inherit;border:none;background:#0000;color:var(--widget__color)}.prism-search ::placeholder{color:inherit;opacity:.6}.pce-match-count{margin-right:auto}.pce-options{color:var(--widget__color-options);font-size:80%;gap:.25em;align-items:center}.pce-options button{padding:0 .2em;border-radius:.2em;width:1.2em;text-align:center;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace}.pce-options button span{pointer-events:none}.prism-search button:focus-visible{outline:1px solid var(--widget__focus-ring);z-index:1}.prism-search .pce-input,.pce-options button{box-shadow:0 0 0 1px var(--_border, var(--widget__border));margin:1px}.prism-search .pce-input{display:flex;position:relative;justify-content:flex-end;background:var(--widget__bg-input);border-radius:.15em;height:1.5em}.prism-search input:focus{outline:0}.pce-input:focus-within{--_border: var(--widget__focus-ring)}.pce-input.pce-find button{display:grid;align-items:center;padding:0 .4em}.pce-input.pce-replace button{width:7.3ch;text-align:center}.pce-input.pce-replace :last-child{width:2.7ch}.pce-input button{box-shadow:-1px 0 0 0 var(--widget__border);margin-left:1px}.prev-match:before{transform:rotate(-90deg)}.next-match:before,.pce-expand:before{transform:rotate(90deg)}@media (hover: hover){.prism-search button:hover{background:var(--widget__bg-hover)}}.pce-options button[aria-pressed=true]{background:var(--widget__bg-active);color:var(--widget__color-active);--_border: var(--widget__focus-ring)}.pce-input>:nth-child(3){border-radius:0 .15em .15em 0}.pce-input.pce-find.pce-error{--_border: var(--widget__error-ring);position:relative}.search-error{display:none;position:absolute;top:100%;box-shadow:inherit;width:100%;white-space:normal;word-break:break-word;left:0;background:var(--widget__bg-error);padding:.5em;z-index:1}.pce-error:focus-within .search-error{display:block}button.pce-close{display:grid;width:1.3em;height:1.3em;place-items:center;margin-left:auto;border-radius:.3em}.pce-input.pce-find button:before,.pce-expand:before,.pce-close:before{content:"";background:currentColor;height:1.2em;opacity:.75}.pce-close:before{clip-path:polygon(50% 44.34%,0% 74.34%,9.43% 80%,9.43% 20%,0% 25.66%,50% 55.66%,100% 25.66%,90.57% 20%,50% 44.34%,9.43% 20%,9.43% 80%,50% 55.66%,90.57% 80%,100% 74.34%);width:.72em}.prism-search>div{display:grid;gap:.25em;width:var(--search-width, 20em)}button.pce-expand{display:grid;place-items:center;border-radius:.25em;margin:-.15em}.pce-readonly>.prism-search-container .pce-expand,[aria-expanded=false]+div .pce-replace,.pce-readonly>.prism-search-container .pce-replace{display:none}.pce-expand[aria-expanded=true]:before{transform:rotate(180deg)}.pce-input.pce-find button:before,.pce-expand:before{width:.84em;clip-path:polygon(50% 28.96%,0% 63.96%,10.1% 71.04%,50% 43.11%,89.9% 71.04%,100% 63.96%)}button.pce-regex{display:flex;align-self:stretch}.pce-regex span{display:flex;align-self:stretch;align-items:flex-end}.pce-regex span:before{content:"";width:.3em;height:.3em;background:currentColor;margin:0 0 .2em .1em}.pce-regex span:after{content:"*";line-height:0;font-size:140%;margin-bottom:.5em}button.pce-in-selection{display:grid;place-items:center;align-self:stretch}button.pce-whole{position:relative}.pce-whole:after{content:"";position:absolute;bottom:.31em;right:.27em;left:.27em;height:.25em;clip-path:inset(1px -1px -1px);box-shadow:0 0 0 1px}.pce-in-selection:before{content:"";height:80%;width:90%;background:currentColor;clip-path:polygon(0 16%,80% 16%,80% 24%,0 24%,0 46%,100% 46%,100% 54%,0 54%,0 76%,60% 76%,60% 84%,0 84%)}.pce-matches span{background:var(--search__bg-find)}.pce-matches :empty{padding:0 2px;margin:0 -2px}';export{e as default};

View file

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1 @@
@font-face{font-family:Satoshi;src:url(//cdn.fontshare.com/wf/NWBQYJIM7GCZ5XWD7D26ARB3VDY55ZRT/K63EV2KZIGKLE7RANQ2U42S6SVHU5RJ7/X6XYTKIVDUW7GZTZPZNN4EUM5KH54KHF.woff2) format("woff2"),url(//cdn.fontshare.com/wf/NWBQYJIM7GCZ5XWD7D26ARB3VDY55ZRT/K63EV2KZIGKLE7RANQ2U42S6SVHU5RJ7/X6XYTKIVDUW7GZTZPZNN4EUM5KH54KHF.woff) format("woff"),url(//cdn.fontshare.com/wf/NWBQYJIM7GCZ5XWD7D26ARB3VDY55ZRT/K63EV2KZIGKLE7RANQ2U42S6SVHU5RJ7/X6XYTKIVDUW7GZTZPZNN4EUM5KH54KHF.ttf) format("truetype");font-weight:300 900;font-display:swap;font-style:normal}@font-face{font-family:Satoshi;src:url(//cdn.fontshare.com/wf/3JZIFUW7KLFSPLVCIUI2DLGNIER6IFCX/MMP4RUF5LYGUAZS3DCJC3GJ6F6SAGKSN/E3NEPGEAHYCHR37DSBXHV33XCYYRE2CY.woff2) format("woff2"),url(//cdn.fontshare.com/wf/3JZIFUW7KLFSPLVCIUI2DLGNIER6IFCX/MMP4RUF5LYGUAZS3DCJC3GJ6F6SAGKSN/E3NEPGEAHYCHR37DSBXHV33XCYYRE2CY.woff) format("woff"),url(//cdn.fontshare.com/wf/3JZIFUW7KLFSPLVCIUI2DLGNIER6IFCX/MMP4RUF5LYGUAZS3DCJC3GJ6F6SAGKSN/E3NEPGEAHYCHR37DSBXHV33XCYYRE2CY.ttf) format("truetype");font-weight:300 900;font-display:swap;font-style:italic}:root{--primary: #89b4fa;--text: #cdd6f4;--surface-2: #585b70;--surface-1: #45475a;--surface-0: #313244;--base: #1e1e2e;--mantle: #181825;--crust: #11111b;--app-radius: 25%}.material-symbols-rounded{font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 200,"opsz" 24}body,html{background-color:var(--crust);width:100vw;height:100vh;display:flex;flex-direction:column;margin:0;overflow:hidden}*::-webkit-scrollbar{display:none}*{box-sizing:border-box;-ms-overflow-style:none;scrollbar-width:none;font-family:Satoshi,sans-serif;font-weight:600;color:var(--text)}toolbar{width:100%;display:flex;gap:10px;background:var(--mantle);margin:0;padding:10px;border-radius:20px 20px 0 0;border:1px solid var(--surface-0);box-shadow:1px 3px 10px #0003,0 0 10px #0003;user-select:none;position:relvative;z-index:1001}toolbar>div{display:flex;align-self:center}toolbar>div.outlined{padding:10px;background:var(--base);border-radius:10px;border:1px solid var(--surface-0);box-shadow:1px 3px 10px #0000001a,0 0 10px #0000001a;align-items:center;justify-content:center}toolbar>div[data-toolbar-id=start]{cursor:pointer}toolbar>div[data-toolbar-id=start] *{transition:color .1s ease-in-out}toolbar>div[data-toolbar-id=start] *:hover{color:var(--primary)}toolbar>div[data-toolbar-id=controls]{gap:5px}toolbar>div[data-toolbar-id=controls] *{font-size:24px}toolbar>div[data-toolbar-id=plugins]{width:24px;cursor:pointer;padding:10px 0}toolbar>div app{display:flex;align-items:center;cursor:pointer}toolbar>div app img{aspect-ratio:1 / 1;height:35px;border-radius:var(--app-radius)}window-area{position:relative;width:calc(100% - 20px);height:100%;overflow:hidden;margin:10px}window-area window{resize:both;max-width:100%;max-height:100%;min-height:35px;min-width:210px;background:var(--base);display:flex;flex-direction:column;border-radius:5px;box-shadow:0 10px 10px #0003,0 0 10px #0003;overflow:hidden;border:1px solid;border-color:color-mix(in srgb,var(--text) 20%,transparent);background:var(--crust);transition:.2s opacity,.2s transform}window-area window window-header{height:35px;padding:7.5px;display:flex;align-items:center;gap:7.5px;user-select:none}window-area window window-header img{aspect-ratio:1 / 1;height:1.2em;border-radius:var(--app-radius)}window-area window window-content{height:100%;border-radius:10px 10px 0 0;background:var(--mantle);overflow:scroll}window-area window window-content h1{margin-top:0}.gradient-blur{mask:linear-gradient(to bottom,transparent,black 5%),linear-gradient(to top,transparent,black 35%);mask-size:100% 50%;mask-repeat:no-repeat;mask-position:top,bottom}

View file

@ -0,0 +1 @@
const e='.prism-code-editor{overflow:auto;display:grid;background:var(--editor__bg);line-height:1.4;--_pse: var(--padding-inline, .75em);--_ns: var(--number-spacing, .75em);--padding-left: var(--_pse);scroll-padding-left:var(--padding-left);-webkit-user-select:none;user-select:none;isolation:isolate;white-space:pre}.show-line-numbers{--padding-left: calc(var(--_pse) + var(--number-width) + var(--_ns));grid:1fr / 0 1fr}.pce-wrapper{margin:.5em 0;position:relative;pointer-events:none;-webkit-text-size-adjust:none;text-size-adjust:none}.prism-code-editor textarea{all:unset;box-sizing:border-box;height:100%;width:100%;color:#0000;-webkit-user-select:auto;user-select:auto;overflow:hidden;pointer-events:auto;padding:0 var(--_pse) 0 var(--padding-left)}.pce-no-selection>:focus{z-index:1}.pce-line{padding:0 var(--_pse) 0 0;margin:0 0 0 var(--padding-left);position:relative}.show-line-numbers .pce-line:before{content:attr(data-line);display:inline-block;margin:0 0 0 calc(-1 * var(--padding-left));padding:0 var(--_ns) 0 0;box-sizing:border-box;color:var(--editor__line-number);text-align:end}.show-line-numbers:before{content:"";background:inherit;pointer-events:none}.show-line-numbers:before,.pce-line:before{position:sticky;height:100%;z-index:2;left:0;width:var(--padding-left)}.pce-wrap .pce-line:before{position:absolute}.pce-overlays,div.pce-overlays>*,.pce-no-selection~.active-line:after,.active-line.match-highlight:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0}.active-line:after{border:var(--editor__border-highlight);background:var(--editor__bg-highlight);z-index:-2}.pce-wrap{white-space:pre-wrap;word-break:break-word}.selection-matches span{background:var(--editor__bg-selection-match)}.pce-nowrap .active-bracket{display:inline-block}',r="div.pce-rtl{direction:rtl;scroll-padding:0 var(--padding-left) 0 0}div.pce-rtl:before,.pce-rtl .pce-line:before{left:auto;right:0;background:none}.pce-rtl textarea,.pce-rtl .selection-matches,.pce-rtl .pce-matches{padding:0 var(--padding-left) 0 var(--_pse)!important}.pce-rtl .guide-indents{left:auto!important;right:var(--padding-left);transform:scaleX(-1)}.pce-rtl .pce-copy:after{left:calc(100% + .5em);right:auto}.pce-rtl.show-line-numbers .pce-line:before{margin:0 calc(-1 * var(--padding-left)) 0 0;padding:0 0 0 var(--_ns);background:var(--editor__bg)}.pce-rtl .pce-line{padding:0 0 0 var(--_pse);margin:0 var(--padding-left) 0 0}.pce-rtl.pce-nowrap .pce-fold{right:calc(2px + var(--padding-left) - var(--_ns))}.pce-rtl .pce-fold{margin:0 calc(2px - var(--_ns)) 0 0}.pce-rtl .closed-fold>:after{transform:translateY(-50%) rotate(90deg)}div.pce-rtl .active-bracket{display:inline}",t="@media (hover: hover){.prism-code-editor::-webkit-scrollbar-corner,.prism-code-editor::-webkit-scrollbar-track{background:#0000}.prism-code-editor::-webkit-scrollbar{height:1em;width:1em}.prism-code-editor::-webkit-scrollbar-thumb{background:hsla(var(--editor__bg-scrollbar),.36);width:2em;height:2em}.prism-code-editor::-webkit-scrollbar-thumb:hover{background:hsla(var(--editor__bg-scrollbar),.5)}.prism-code-editor::-webkit-scrollbar-thumb:active{background:hsla(var(--editor__bg-scrollbar),.66)}}",i=e+r+t;export{i as default};

View file

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

1
assets/utils-2c87b698.js Normal file
View file

@ -0,0 +1 @@
const r=async()=>{const t=new Date;let e=t.getHours(),s=t.getMinutes(),o="AM";return o=e>=12?"PM":"AM",e===0?e=12:e>12&&(e%=12),e=e<10?`0${e}`:e,s=s<10?`0${s}`:s,`${e}:${s} ${o}`},u=n=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},e=/[&<>"'/]/ig;return n.replace(e,s=>t[s])};export{r as g,u as s};

View file

@ -0,0 +1,6 @@
import{o as x,f as m,r as u,s as p}from"./Editor-d71c30b8.js";const S=e=>e.replace(/[$+?|.^*(){}[\]\\]/g,"\\$&"),$=(e,t)=>e.slice(e.lastIndexOf(`
`,t-1)+1,t),E=(e,t,l=t)=>[e.slice(t=e.lastIndexOf(`
`,t-1)+1,l=(l=e.indexOf(`
`,l))+1?l:e.length).split(`
`),t,l],h=(e,t,l=0,o=l,s=e.getSelection()[0])=>{const d=e.value,n=d.slice(s).search(/\n|$/)+1,g=e.wrapper.children[x(d,0,s)],a=g.querySelectorAll(t),r=new Range;r.setEndAfter(g);for(let i=a.length,c,f;i;)if(r.setStartAfter(c=a[--i]),f=r.toString().length,f<=n+o&&f+c.textContent.length>=n-l)return c;return null},C=(e,t)=>h(e,'[class*="language-"]',0,0,t)?.className.match(/language-(\w+)/)[1]||e.options.language,k=(e,t,l,o,s,d)=>{const{textarea:n,getSelection:g,value:a,focused:r}=e;if(e.options.readOnly)return;r||n.focus();const i=s!=null?m([s,d??s,g()[2]]):0;if(l!=null&&n.setSelectionRange(l,o??l),u||n.dispatchEvent(new InputEvent("beforeinput",{data:t})),p||u){const c=p&&!a[n.selectionEnd]&&/^$|\n$/.test(a)&&/\n$/.test(t);c&&(n.selectionEnd--,t=t.slice(0,-1)),u&&(t+=`
`),document.execCommand(t?"insertHTML":"delete",!1,t.replace(/&/g,"&amp;").replace(/</g,"&lt;")),c&&n.selectionStart++}else document.execCommand(t?"insertText":"delete",!1,t);i&&(n.setSelectionRange(...i),m())},v=e=>e.altKey+e.ctrlKey*2+e.metaKey*4+e.shiftKey*8,w=(e,t,l=0)=>{const o=e.scrollContainer.style,s=document.documentElement.style;o.scrollPaddingBlock=s.scrollPaddingBlock=`${l}px ${p&&!t.textContent?t.offsetHeight:0}px`,t.scrollIntoView({block:"nearest"}),o.scrollPaddingBlock=s.scrollPaddingBlock=""};export{$,k as B,v as C,S as E,E as S,w as b,C as v,h as y};

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#aeafad;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #1e1e1e;--widget__border: #444;--widget__bg: #1e1e1e;--widget__color: #ccc;--widget__color-active: #fff;--widget__color-options: #aaa;--widget__bg-input: #262626;--widget__bg-hover: #2e2e2e;--widget__bg-active: #336699;--widget__focus-ring: #5299e0;--search__bg-find: #eb5e0054;--widget__bg-error: #4d1919;--widget__error-ring: #cc0000;--editor__border-highlight: 2px solid #282828;--editor__bg-selection-match: #add6ff26;--editor__line-number: #888;--editor__bg-scrollbar: 0, 0%, 50%;--editor__bg-fold: #c5c5c5;--bg-guide-indent: #9994;color-scheme:dark}.match-highlight{--editor__bg-highlight: #282828}.prism-code-editor textarea::selection{background:#264f78;color:#0000}.pce-matches .match{--search__bg-find: #675451}.active-line{--editor__line-number: #ccc}.guide-indents .active{--bg-guide-indent: #eee6}.token.namespace{opacity:.7}.token.comment,.token.prolog,.token.blockquote.punctuation{color:#6a9955}.token.punctuation,.token.operator,.token.combinator,.token.plain-text{color:#d4d4d4}.token.number,.token.symbol,.token.inserted,.token.unit{color:#b5cea8}.token.string,.token.string-property.property,.token.char,.token.deleted{color:#ce9178}.url .token.string.url{text-decoration:underline}.token.doctype .doctype-tag,.token.operator.arrow,.token.keyword,.token.important,.token.token.interpolation-punctuation,.token.boolean,.token.tag,.token.entity,.token.regex-flags{color:#569cd6}.token.atrule .token.rule{color:#c586c0}.token.function,.token.function .maybe-class-name{color:#dcdcaa}.token.italic{font-style:italic}.token.strike{text-decoration:line-through}.token.class-name,[class*=language-t] .builtin,.token.maybe-class-name{color:#4ec9b0}.token.doctype .name,.token.atrule,.token.atrule .url,.token.property,.token.variable,.token.parameter,.token.interpolation,.token.attr-name{color:#9cdcfe}.token.selector,.token.escape{color:#d7ba7d}.tag>.token.punctuation,.doctype .token.punctuation,.token.cdata{color:gray}.token.attr-value,.token.attr-value .token.punctuation{color:#ce9178}.token.attr-value .token.punctuation.attr-equals{color:#d4d4d4}.token.namespace{color:#4ec9b0}.token.color{color:#ce9178}.token.constant{color:#4fc1ff}[class*=language-]{color:#9cdcfe}.token.regex,.language-regex,.token.char-set.class-name,.token.char-class .operator{color:#d16969}.language-markup,.language-markdown,.language-md,.language-html,.language-xml,.language-svg,.language-text,.language-css,.language-sass,.language-scss{color:#d4d4d4}.token.important.title .punctuation,.token.list.punctuation,.language-markdown .token.bold *{color:#569cd6}.language-markdown .token.code>.punctuation,.language-markdown .token.code.keyword{color:#d4d4d4}.language-markdown .token.url .content,.language-markdown .token.code-snippet.keyword,.token.url-reference .variable{color:#ce9178}.token.group.punctuation,.token.quantifier.number,.token.char-class .punctuation{color:#d7ba7d}.token.keyword.module,.token.keyword.control-flow,.token.keyword-if,.token.keyword-else,.token.keyword-return,.token.keyword-switch,.token.keyword-case,.token.keyword-default,.token.keyword-import,.token.keyword-from,.token.keyword-export,.token.keyword-as,.token.keyword-for,.token.keyword-while,.token.keyword-break,.token.keyword-continue,.token.keyword-try,.token.keyword-catch,.token.keyword-finally,.token.keyword-throw,.token.keyword-yield,.token.keyword-await{color:#c586c0}.token.bracket-level-0,.token.bracket-level-3,.token.bracket-level-6,.token.bracket-level-9{color:gold}.token.bracket-level-1,.token.bracket-level-4,.token.bracket-level-7,.token.bracket-level-10{color:orchid}.token.bracket-level-2,.token.bracket-level-5,.token.bracket-level-8,.token.bracket-level-11{color:#179fff}.token.bracket-error{color:#ff1212cc}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #888,inset 0 0 0 9in #0064001a}.active-tagname,.word-matches span{background:#575757b8}";export{e as default};

View file

@ -0,0 +1 @@
const e=".prism-code-editor{caret-color:#000;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;--editor__bg: #fff;--widget__border: #bfbfbf;--widget__bg: #f2f2f2;--widget__color: #444;--widget__color-active: #000;--widget__color-options: #666;--widget__bg-input: #fff;--widget__bg-hover: #b8b8b84f;--widget__bg-active: #c2dff2;--widget__focus-ring: #0077f0;--search__bg-find: #ea5c0054;--widget__bg-error: #f2dede;--widget__error-ring: #be1100;--editor__border-highlight: 2px solid #eee;--editor__bg-selection-match: #add6ff80;--editor__line-number: #53abc6;--editor__bg-scrollbar: 0, 0%, 25%;--editor__bg-fold: #424242;--bg-guide-indent: #3333;color-scheme:light}.match-highlight{--editor__bg-highlight: #eee}.prism-code-editor textarea::selection{background:#add6ff;color:#0000}.pce-matches .match{--search__bg-find: #c1adab}.active-line{--editor__line-number: #0b216f}.guide-indents .active{--bg-guide-indent: #0006}.token.namespace{opacity:.7}.token.comment,.token.prolog{color:green}.token.number,.token.symbol,.token.inserted,.token.unit{color:#098658}.token.string,.token.string-property.property,.token.char,.token.deleted{color:#a31515}.url .token.string.url{text-decoration:underline;color:#001080}.token.operator,.token.combinator,.token.punctuation,.token.plain-text,.token.quantifier.number{color:#000}.token.operator.arrow,.token.keyword,.token.important,.token.token.interpolation-punctuation,.token.boolean,.token.entity,.token.attr-value,.token.attr-value .token.punctuation,.token.regex-flags{color:#00f}.token.atrule .token.rule{color:#af00db}.token.atrule .token.url{color:#9cdcfe}.token.atrule .token.url .token.function,.token.function,.token.function .token.maybe-class-name{color:#795e26}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.strike{text-decoration:line-through}.token.class-name,.token.builtin,.token.maybe-class-name{color:#267f99}.token.doctype .name,.token.property,.token.attr-name{color:#e50000}.token.variable,.token.parameter,.token.literal-property,.token.atrule{color:#001080}.token.doctype .token.doctype-tag,.token.selector,.token.escape,.token.tag,.tag>.token.punctuation,.doctype .token.punctuation,.token.cdata{color:maroon}.token.attr-value .token.punctuation.attr-equals{color:#000}.token.namespace{color:#4ec9b0}.token.constant{color:#0070c1}[class*=language-]{color:#001080}.token.regex,.language-regex,.token.char-set.class-name,.token.char-class .operator{color:#811f3f}.language-markup,.language-markdown,.language-md,.language-html,.language-xml,.language-svg,.language-text,.language-css,.language-scss,.language-sass{color:#000}.token.color,.token.blockquote.punctuation,.token.list.punctuation{color:#0451a5}.language-markdown .token.bold *{color:navy}.language-markdown .token.code>.punctuation,.language-markdown .token.code.keyword{color:#000}.token.important.title *,.token.important.title,.language-markdown .token.code-snippet.keyword{color:maroon}.language-markdown .token.url .content,.token.url-reference .variable,.token.group.punctuation,.token.char-class .punctuation{color:#a31515}.token.keyword.module,.token.keyword.control-flow,.token.keyword-if,.token.keyword-else,.token.keyword-return,.token.keyword-switch,.token.keyword-case,.token.keyword-default,.token.keyword-import,.token.keyword-from,.token.keyword-export,.token.keyword-as,.token.keyword-for,.token.keyword-while,.token.keyword-break,.token.keyword-continue,.token.keyword-try,.token.keyword-catch,.token.keyword-finally,.token.keyword-throw,.token.keyword-yield,.token.keyword-await{color:#af00db}.token.bracket-level-0,.token.bracket-level-3,.token.bracket-level-6,.token.bracket-level-9{color:#0431fa}.token.bracket-level-1,.token.bracket-level-4,.token.bracket-level-7,.token.bracket-level-10{color:#319331}.token.bracket-level-2,.token.bracket-level-5,.token.bracket-level-8,.token.bracket-level-11{color:#7b3814}.token.bracket-error{color:#ff1212cc}.token.markup-bracket{color:inherit}.active-bracket{box-shadow:inset 0 0 0 1px #b9b9b9,inset 0 0 0 9in #0064001a}.active-tagname,.word-matches span{background:#57575740}";export{e as default};

View file

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View file

@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FlowOS</title>
<link rel="shortcut icon" href="./src/assets/flow.png" type="image/png">
<link rel="shortcut icon" href="/FlowOS/assets/flow-9a6c45c5.png" type="image/png">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9675905177363247" crossorigin="anonymous"></script>
@ -17,8 +17,9 @@
gtag('config', 'G-X4XVQRWEVM');
</script>
<script type="module" crossorigin src="/FlowOS/assets/index-e011716a.js"></script>
</head>
<body>
<script src="./src/bootloader.ts" type="module"></script>
</body>
</html>

12318
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,56 +0,0 @@
{
"name": "flowos",
"version": "2.4.0",
"description": "The most aesthetic webOS.",
"main": "src/bootloader.ts",
"scripts": {
"docs": "typedoc src/**",
"test": "ts-standard",
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"serve": "vite dev",
"commit": "cz"
},
"keywords": [],
"author": "",
"license": "MIT",
"devDependencies": {
"@semantic-release/git": "^10.0.1",
"@types/node": "^20.11.3",
"@types/uuid": "^9.0.5",
"@types/web": "^0.0.117",
"commitizen": "^4.3.0",
"less": "^4.2.0",
"semantic-release": "^23.0.0",
"ts-standard": "^12.0.2",
"typedoc": "^0.25.3",
"typedoc-material-theme": "^1.0.2",
"typedoc-plugin-missing-exports": "^2.1.0",
"typescript": "^5.2.2",
"vite": "^4.5.2",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-dynamic-import": "^1.5.0",
"vite-plugin-node-polyfills": "^0.15.0"
},
"dependencies": {
"ansi-to-html": "^0.7.2",
"chalk": "^5.3.0",
"eruda": "^3.0.1",
"js-ini": "^1.6.0",
"material-symbols": "^0.14.3",
"prism-code-editor": "^2.3.0",
"semver": "^7.5.4",
"uuid": "^9.0.1"
},
"ts-standard": {
"ignore": [
"public"
]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}

View file

@ -1,346 +0,0 @@
export default class HTML {
/** The HTML element referenced in this instance. Change using `.swapRef()`, or remove using `.cleanup()`. */
elm: HTMLInputElement | HTMLElement
/**
* Create a new instance of the HTML class.
* @param elm The HTML element to be created or classified from.
*/
constructor (elm: string | HTMLElement) {
this.elm = elm instanceof HTMLElement ? elm : document.createElement(elm === '' ? 'div' : elm)
}
/**
* Sets the text of the current element.
* @param val The text to set to.
* @returns HTML
*/
text (val: string): HTML {
this.elm.innerText = val
return this
}
/**
* Sets the text of the current element.
* @param val The text to set to.
* @returns HTML
*/
html (val: string): HTML {
this.elm.innerHTML = val
return this
}
/**
* Safely remove the element. Can be used in combination with a `.swapRef()` to achieve a "delete & swap" result.
* @returns HTML
*/
cleanup (): HTML {
this.elm.remove()
return this
}
/**
* querySelector something.
* @param selector The query selector.
* @returns The HTML element (not as HTML)
*/
query (selector: string): HTMLElement | null {
return this.elm.querySelector(selector)
}
/**
* An easier querySelector method.
* @param query The string to query
* @returns a new HTML
*/
qs (query: string): HTML | null {
return this.elm.querySelector(query) != null ? HTML.from(this.elm.querySelector(query) as HTMLElement) : null
}
/**
* An easier querySelectorAll method.
* @param query The string to query
* @returns a new HTML
*/
qsa (query: string): Array<HTML | null> | null {
return this.elm.querySelector(query) != null
? Array.from(this.elm.querySelectorAll(query)).map((e) =>
HTML.from(e as HTMLElement)
)
: null
}
/**
* Sets the ID of the element.
* @param val The ID to set.
* @returns HTML
*/
id (val: string): HTML {
this.elm.id = val
return this
}
/**
* Toggle on/off a class.
* @param val The class to toggle.
* @returns HTML
*/
class (...val: string[]): HTML {
for (const element of val) {
this.elm.classList.toggle(element)
}
return this
}
/**
* Toggles ON a class.
* @param val The class to enable.
* @returns HTML
*/
classOn (...val: string[]): HTML {
for (const element of val) {
this.elm.classList.add(element)
}
return this
}
/**
* Toggles OFF a class.
* @param val The class to disable.
* @returns HTML
*/
classOff (...val: string[]): HTML {
for (const element of val) {
this.elm.classList.remove(element)
}
return this
}
/**
* Apply CSS styles (dashed method.) Keys use CSS syntax, e.g. `background-color`.
* @param obj The styles to apply (as an object of `key: value;`.)
* @returns HTML
*/
style (obj: { [x: string]: string | null }): HTML {
for (const key of Object.keys(obj)) {
this.elm.style.setProperty(key, obj[key])
}
return this
}
/**
* Apply CSS styles (JS method.) Keys use JS syntax, e.g. `backgroundColor`.
* @param obj The styles to apply (as an object of `key: value;`)
* @returns HTML
*/
styleJs (obj: { [key: string]: string | null }): HTML {
for (const key of Object.keys(obj)) {
// @ts-expect-error No other workaround I could find.
this.elm.style[key] = obj[key]
}
return this
}
/**
* Apply an event listener.
* @param ev The event listener type to add.
* @param cb The event listener callback to add.
* @returns HTML
*/
on (ev: string, cb: EventListenerOrEventListenerObject): HTML {
this.elm.addEventListener(ev, cb)
return this
}
/**
* Remove an event listener.
* @param ev The event listener type to remove.
* @param cb The event listener callback to remove.
* @returns HTML
*/
un (ev: string, cb: EventListenerOrEventListenerObject): HTML {
this.elm.removeEventListener(ev, cb)
return this
}
/**
* Append this element to another element. Uses `appendChild()` on the parent.
* @param parent Element to append to. HTMLElement, HTML, and string (as querySelector) are supported.
* @returns HTML
*/
appendTo (parent: HTMLElement | HTML | string): HTML {
if (parent instanceof HTMLElement) {
parent.appendChild(this.elm)
} else if (parent instanceof HTML) {
parent.elm.appendChild(this.elm)
} else if (typeof parent === 'string') {
document.querySelector(parent)?.appendChild(this.elm)
}
return this
}
/**
* Append an element. Typically used as a `.append(new HTML(...))` call.
* @param elem The element to append.
* @returns HTML
*/
append (elem: string | HTMLElement | HTML): HTML {
if (elem instanceof HTMLElement) {
this.elm.appendChild(elem)
} else if (elem instanceof HTML) {
this.elm.appendChild(elem.elm)
} else if (typeof elem === 'string') {
const newElem = document.createElement(elem)
this.elm.appendChild(newElem)
return new HTML(newElem.tagName)
}
return this
}
/**
* Prepend an element. Typically used as a `.prepend(new HTML(...))` call.
* @param elem The element to prepend.
* @returns HTML
*/
prepend (elem: string | HTMLElement | HTML): HTML {
if (elem instanceof HTMLElement) {
this.elm.prepend(elem)
} else if (elem instanceof HTML) {
this.elm.prepend(elem.elm)
} else if (typeof elem === 'string') {
const newElem = document.createElement(elem)
this.elm.prepend(newElem)
return new HTML(newElem.tagName)
}
return this
}
/**
* Append multiple elements. Typically used as a `.appendMany(new HTML(...), new HTML(...)` call.
* @param elements The elements to append.
* @returns HTML
*/
appendMany (...elements: any[]): HTML {
for (const elem of elements) {
this.append(elem)
}
return this
}
/**
* Prepend multiple elements. Typically used as a `.prependMany(new HTML(...), new HTML(...)` call.
* @param elements The elements to prepend.
* @returns HTML
*/
prependMany (...elements: any[]): HTML {
for (const elem of elements) {
this.prepend(elem)
}
return this
}
/**
* Clear the innerHTML of the element.
* @returns HTML
*/
clear (): HTML {
this.elm.innerHTML = ''
return this
}
/**
* Set attributes (object method.)
* @param obj The attributes to set (as an object of `key: value;`)
* @returns HTML
*/
attr (obj: { [x: string]: any }): HTML {
for (const key in obj) {
if (obj[key] == null) {
this.elm.removeAttribute(key)
} else {
this.elm.setAttribute(key, obj[key])
}
}
return this
}
/**
* Set the text value of the element. Only works if element is `input` or `textarea`.
* @param str The value to set.
* @returns HTML
*/
val (str: any): HTML {
const x = this.elm as HTMLInputElement
x.value = str
return this
}
/**
* Retrieve text content from the element. (as innerText, not trimmed)
* @returns string
*/
getText (): string {
return (this.elm as HTMLInputElement).innerText
}
/**
* Retrieve HTML content from the element.
* @returns string
*/
getHTML (): string {
return (this.elm as HTMLInputElement).innerHTML
}
/**
* Retrieve the value of the element. Only applicable if it is an `input` or `textarea`.
* @returns string
*/
getValue (): string {
return (this.elm as HTMLInputElement).value
}
/**
* Swap the local `elm` with a new HTMLElement.
* @param elm The element to swap with.
* @returns HTML
*/
swapRef (elm: HTMLElement): HTML {
this.elm = elm
return this
}
/**
* An alternative method to create an HTML instance.
* @param elm Element to create from.
* @returns HTML
*/
static from (elm: HTMLElement | string): HTML | null {
if (typeof elm === 'string') {
const element = HTML.qs(elm)
return element === null ? null : element
} else {
return new HTML(elm)
}
}
/**
* An easier querySelector method.
* @param query The string to query
* @returns a new HTML
*/
static qs (query: string): HTML | null {
return document.querySelector(query) != null ? HTML.from(document.querySelector(query) as HTMLElement) : null
}
/**
* An easier querySelectorAll method.
* @param query The string to query
* @returns a new HTML
*/
static qsa (query: string): Array<HTML | null> | null {
return document.querySelector(query) != null
? Array.from(document.querySelectorAll(query)).map((e) =>
HTML.from(e as HTMLElement)
)
: null
}
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.9 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.5 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 32 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 32 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.7 KiB

Some files were not shown because too many files have changed in this diff Show more