Skip to content

Commit

Permalink
[ Quantumcast ] - New Command "Open Packz Manual" (#6621)
Browse files Browse the repository at this point in the history
* Update quantumcast extension

- Contributions/merge 1684352334444420000 (#14)
- Release 0.0.4 (#13)
- Update CHANGELOG.md (#12)
- eslint mod (#11)
- V0.0.3 (#10)
- V0.0.3 (#9)
- Release 0.0.2 (#8)
- release 0.0.1 (#5)
- Modified CHANGELOG (#4)
- Merge initial release 0.0.1 (#3)
- Dev (#2)
- npm update (#1)
- Added logos
- Initial project setup
- Update README.md
- Initial commit

* Added missing icon and removed some matadata images

* Removed raycast-env.d.ts

---------

Co-authored-by: Per Nielsen Tikær <per@raycast.com>
  • Loading branch information
jcgerhard and pernielsentikaer committed May 19, 2023
1 parent c305759 commit 8883c26
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 95 deletions.
2 changes: 1 addition & 1 deletion extensions/quantumcast/.eslintrc.json
Expand Up @@ -3,4 +3,4 @@
"extends": [
"@raycast"
]
}
}
1 change: 1 addition & 0 deletions extensions/quantumcast/.gitignore
Expand Up @@ -3,3 +3,4 @@

# Misc
.DS_Store
raycast-env.d.ts
10 changes: 8 additions & 2 deletions extensions/quantumcast/CHANGELOG.md
@@ -1,13 +1,19 @@
# Quantumcast Changelog

## [0.0.4] - 2023-05-17

- ✨ New - Extension preferences `Packz Manual Language`
- ✨ New - Command `Open Packz Manual`
- 💎 Improvements - Update package `quantumlib` to v0.0.10

## [0.0.3] - 2023-04-21

- ✨ New - Adding new command `Open Cloudflow API Documentation`
- ✨ New - Command `Open Cloudflow API Documentation`
- 💎 Improvements - Update package `quantumlib` to v0.0.9

## [0.0.2] - 2023-04-18

- ✨ New - Adding new command `Open Cloudflow Workspace`
- ✨ New - Command `Open Cloudflow Workspace`
- 💎 Improvements - Update package `quantumlib` to v0.0.8
- 💎 Improvements - Update package `@raycast/api` to v1.49.3
- 💎 Improvements - Redesign the README
Expand Down
Binary file removed extensions/quantumcast/metadata/quantumcast-01.png
Binary file not shown.
Binary file removed extensions/quantumcast/metadata/quantumcast-02.png
Binary file not shown.
Binary file removed extensions/quantumcast/metadata/quantumcast-04.png
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
178 changes: 89 additions & 89 deletions extensions/quantumcast/package-lock.json

Large diffs are not rendered by default.

51 changes: 48 additions & 3 deletions extensions/quantumcast/package.json
Expand Up @@ -19,6 +19,13 @@
"description": "Open the Cloudflow documentation in the browser",
"mode": "no-view"
},
{
"name": "open-packz-manual",
"title": "Open Packz Manual",
"subtitle": "Quantumcast",
"description": "Open the Packz documentation in the browser",
"mode": "view"
},
{
"name": "open-cloudflow-workspace",
"title": "Open Cloudflow Workspace",
Expand All @@ -42,15 +49,53 @@
"type": "textfield",
"required": true,
"default": "http://127.0.0.1:9090"
},
{
"name": "packzManualLanguage",
"title": "Packz Manual Language",
"description": "The prefered language for the Packz manual",
"type": "dropdown",
"required": true,
"data": [
{
"title": "English",
"value": "en"
},
{
"title": "German",
"value": "de"
},
{
"title": "Spanish",
"value": "es"
},
{
"title": "French",
"value": "fr"
},
{
"title": "Italian",
"value": "it"
},
{
"title": "Japanese",
"value": "ja"
},
{
"title": "Chinese",
"value": "zh"
}
],
"default": "en"
}
],
"dependencies": {
"@raycast/api": "^1.48.8",
"quantumlib": "^0.0.9"
"@raycast/api": "^1.51.2",
"quantumlib": "^0.0.10"
},
"devDependencies": {
"@raycast/eslint-config": "^1.0.5",
"@types/node": "^18.8.3",
"@types/node": "^18.16.12",
"@types/react": "^18.0.9",
"eslint": "^8.37.0",
"prettier": "^2.8.7",
Expand Down
55 changes: 55 additions & 0 deletions extensions/quantumcast/src/open-packz-manual.tsx
@@ -0,0 +1,55 @@
import { List, Action, ActionPanel, getPreferenceValues, open } from '@raycast/api';
import { useState, useEffect } from 'react';
import { packz, env } from 'quantumlib';

interface PackzInstallation {
folder: string;
url: string;
executable: string;
}

export default function Command() {
const { packzManualLanguage } = getPreferenceValues();
const [packzInstallations, setPackzInstallations] = useState<PackzInstallation[]>([]);

useEffect(() => {
const fetchPackInstallations = async () => {
const data = await packz.listInstallations(env.applicationsFolder);
setPackzInstallations(data);
};
fetchPackInstallations();
}, []);

return (
<List searchBarPlaceholder="Select a Packz manual release to open in your default browser">
{packzInstallations.map((installation: PackzInstallation) => (
<List.Item
id={installation.folder}
key={installation.folder}
title={installation.folder}
icon="../assets/quantumcast.png"
accessories={[{ text: installation.executable }]}
actions={
<ActionPanel title="Quantumcast - Open Packz Manual">
<Action
title="Open in Browser"
icon={Icon.Globe}
onAction={async () =>
open(packz.getManualURL(`${installation.url}/${installation.executable}`, packzManualLanguage) ?? '')
}
/>
<Action.Open title="Reveal in Finder" target={installation.url} />
<Action.CopyToClipboard
title="Copy URL to Clipboard"
content={
packz.getManualURL(`${installation.url}/${installation.executable}`, packzManualLanguage) ?? ''
}
shortcut={{ modifiers: ['cmd', 'shift'], key: 'c' }}
/>
</ActionPanel>
}
/>
))}
</List>
);
}

0 comments on commit 8883c26

Please sign in to comment.