Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions resources/electron/electron-plugin/dist/server/api/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ router.delete('/trash-item', (req, res) => __awaiter(void 0, void 0, void 0, fun
yield shell.trashItem(path);
res.sendStatus(200);
}
catch (_a) {
res.status(400).json();
catch (e) {
res.status(400).json({
error: e instanceof Error ? e.message : String(e),
});
}
}));
export default router;
25 changes: 24 additions & 1 deletion resources/electron/electron-plugin/dist/server/api/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,19 @@ router.post('/always-on-top', (req, res) => {
(_a = state.windows[id]) === null || _a === void 0 ? void 0 : _a.setAlwaysOnTop(alwaysOnTop);
res.sendStatus(200);
});
router.post('/fullscreen', (req, res) => {
var _a;
const { id, fullscreen } = req.body;
(_a = state.windows[id]) === null || _a === void 0 ? void 0 : _a.setFullScreen(fullscreen);
res.sendStatus(200);
});
router.get('/current', (req, res) => {
const currentWindow = Object.values(state.windows).find((window) => window.id === BrowserWindow.getFocusedWindow().id);
const focused = BrowserWindow.getFocusedWindow();
if (!focused) {
res.sendStatus(404);
return;
}
const currentWindow = Object.values(state.windows).find((window) => window.id === focused.id);
const id = Object.keys(state.windows).find((key) => state.windows[key] === currentWindow);
res.json(getWindowData(id));
});
Expand Down Expand Up @@ -239,6 +250,18 @@ router.post('/open', (req, res) => {
payload: [id],
});
});
window.on('enter-full-screen', () => {
notifyLaravel('events', {
event: 'Native\\Desktop\\Events\\Windows\\WindowFullscreened',
payload: [id],
});
});
window.on('leave-full-screen', () => {
notifyLaravel('events', {
event: 'Native\\Desktop\\Events\\Windows\\WindowUnfullscreened',
payload: [id],
});
});
window.on('show', () => {
notifyLaravel('events', {
event: 'Native\\Desktop\\Events\\Windows\\WindowShown',
Expand Down
15 changes: 15 additions & 0 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,25 @@ public function isHidden(): bool
return $this->client->get('app/is-hidden')->json('is_hidden');
}

/**
* @deprecated v3 moves this to System::language(), which v2 does not have yet.
*/
public function getLocale(): string
{
return $this->client->get('app/locale')->json('locale');
}

/**
* @deprecated v3 moves this to System::region(), which v2 does not have yet.
*/
public function getLocaleCountryCode(): string
{
return $this->client->get('app/locale-country-code')->json('locale_country_code');
}

/**
* @deprecated v3 moves this to System::locale(), which v2 does not have yet.
*/
public function getSystemLocale(): string
{
return $this->client->get('app/system-locale')->json('system_locale');
Expand All @@ -57,6 +66,9 @@ public function version(): string
return $this->client->get('app/version')->json('version');
}

/**
* @deprecated Use Dock::badge(?string $label) instead, v3 removes this method.
*/
public function badgeCount($count = null): int
{
if ($count === null) {
Expand Down Expand Up @@ -111,6 +123,9 @@ public function isEmojiPanelSupported(): bool
return (bool) $this->client->get('app/is-emoji-panel-supported')->json('supported');
}

/**
* @deprecated v3 removes this method and replaces it with a Blade element. There is no v2 replacement.
*/
public function showEmojiPanel(): void
{
$this->client->post('app/show-emoji-panel');
Expand Down
12 changes: 7 additions & 5 deletions src/Facades/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
use Illuminate\Support\Facades\Facade;

/**
* @deprecated v3 renames this facade to NativeApp, because it collides with Laravel's own App facade. Nothing changes in v2.
*
* @method static void quit()
* @method static void relaunch()
* @method static void focus()
* @method static void hide()
* @method static bool isHidden()
* @method static string getLocale()
* @method static string getLocaleCountryCode()
* @method static string getSystemLocale()
* @method static string getLocale() Deprecated: v3 moves this to System::language(), which v2 does not have yet.
* @method static string getLocaleCountryCode() Deprecated: v3 moves this to System::region(), which v2 does not have yet.
* @method static string getSystemLocale() Deprecated: v3 moves this to System::locale(), which v2 does not have yet.
* @method static string version()
* @method static int badgeCount($count = null)
* @method static int badgeCount($count = null) Deprecated: use Dock::badge(?string $label) instead, v3 removes this method.
* @method static void addRecentDocument(string $path)
* @method static array recentDocuments()
* @method static void clearRecentDocuments()
* @method static bool isRunningBundled()
* @method static bool openAtLogin(?bool $open = null)
* @method static bool isEmojiPanelSupported()
* @method static void showEmojiPanel()
* @method static void showEmojiPanel() Deprecated: v3 removes this method and replaces it with a Blade element. There is no v2 replacement.
* @method static static when($value = null, ?callable $callback = null, ?callable $default = null)
* @method static static unless($value = null, ?callable $callback = null, ?callable $default = null)
*/
Expand Down
Loading