Skip to content

Commit f124836

Browse files
committed
Merge branch 'v2' of github.com:NativePHP/laravel into v2
2 parents 4fe8c2f + 2ea542c commit f124836

File tree

9 files changed

+47
-47
lines changed

9 files changed

+47
-47
lines changed

resources/electron/electron-plugin/dist/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ class NativePHP {
3636
addEventListeners(app) {
3737
app.on("open-url", (event, url) => {
3838
notifyLaravel("events", {
39-
event: "\\Native\\Laravel\\Events\\App\\OpenedFromURL",
39+
event: "\\Native\\Desktop\\Events\\App\\OpenedFromURL",
4040
payload: [url],
4141
});
4242
});
4343
app.on("open-file", (event, path) => {
4444
notifyLaravel("events", {
45-
event: "\\Native\\Laravel\\Events\\App\\OpenFile",
45+
event: "\\Native\\Desktop\\Events\\App\\OpenFile",
4646
payload: [path],
4747
});
4848
});
@@ -146,7 +146,7 @@ class NativePHP {
146146
this.mainWindow.focus();
147147
}
148148
notifyLaravel("events", {
149-
event: "\\Native\\Laravel\\Events\\App\\OpenedFromURL",
149+
event: "\\Native\\Desktop\\Events\\App\\OpenedFromURL",
150150
payload: {
151151
url: commandLine[commandLine.length - 1],
152152
},

resources/electron/electron-plugin/dist/server/api/autoUpdater.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ router.post("/quit-and-install", (req, res) => {
1717
});
1818
autoUpdater.addListener("checking-for-update", () => {
1919
notifyLaravel("events", {
20-
event: `\\Native\\Laravel\\Events\\AutoUpdater\\CheckingForUpdate`,
20+
event: `\\Native\\Desktop\\Events\\AutoUpdater\\CheckingForUpdate`,
2121
});
2222
});
2323
autoUpdater.addListener("update-available", (event) => {
2424
notifyLaravel("events", {
25-
event: `\\Native\\Laravel\\Events\\AutoUpdater\\UpdateAvailable`,
25+
event: `\\Native\\Desktop\\Events\\AutoUpdater\\UpdateAvailable`,
2626
payload: {
2727
version: event.version,
2828
files: event.files,
@@ -36,7 +36,7 @@ autoUpdater.addListener("update-available", (event) => {
3636
});
3737
autoUpdater.addListener("update-not-available", (event) => {
3838
notifyLaravel("events", {
39-
event: `\\Native\\Laravel\\Events\\AutoUpdater\\UpdateNotAvailable`,
39+
event: `\\Native\\Desktop\\Events\\AutoUpdater\\UpdateNotAvailable`,
4040
payload: {
4141
version: event.version,
4242
files: event.files,
@@ -50,7 +50,7 @@ autoUpdater.addListener("update-not-available", (event) => {
5050
});
5151
autoUpdater.addListener("error", (error) => {
5252
notifyLaravel("events", {
53-
event: `\\Native\\Laravel\\Events\\AutoUpdater\\Error`,
53+
event: `\\Native\\Desktop\\Events\\AutoUpdater\\Error`,
5454
payload: {
5555
name: error.name,
5656
message: error.message,
@@ -60,7 +60,7 @@ autoUpdater.addListener("error", (error) => {
6060
});
6161
autoUpdater.addListener("download-progress", (progressInfo) => {
6262
notifyLaravel("events", {
63-
event: `\\Native\\Laravel\\Events\\AutoUpdater\\DownloadProgress`,
63+
event: `\\Native\\Desktop\\Events\\AutoUpdater\\DownloadProgress`,
6464
payload: {
6565
total: progressInfo.total,
6666
delta: progressInfo.delta,
@@ -72,7 +72,7 @@ autoUpdater.addListener("download-progress", (progressInfo) => {
7272
});
7373
autoUpdater.addListener("update-downloaded", (event) => {
7474
notifyLaravel("events", {
75-
event: `\\Native\\Laravel\\Events\\AutoUpdater\\UpdateDownloaded`,
75+
event: `\\Native\\Desktop\\Events\\AutoUpdater\\UpdateDownloaded`,
7676
payload: {
7777
downloadedFile: event.downloadedFile,
7878
version: event.version,
@@ -87,7 +87,7 @@ autoUpdater.addListener("update-downloaded", (event) => {
8787
});
8888
autoUpdater.addListener("update-cancelled", (event) => {
8989
notifyLaravel("events", {
90-
event: `\\Native\\Laravel\\Events\\AutoUpdater\\UpdateCancelled`,
90+
event: `\\Native\\Desktop\\Events\\AutoUpdater\\UpdateCancelled`,
9191
payload: {
9292
version: event.version,
9393
files: event.files,

resources/electron/electron-plugin/dist/server/api/childProcess.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function startProcess(settings) {
3737
catch (e) {
3838
}
3939
notifyLaravel('events', {
40-
event: 'Native\\Laravel\\Events\\ChildProcess\\StartupError',
40+
event: 'Native\\Desktop\\Events\\ChildProcess\\StartupError',
4141
payload: {
4242
alias,
4343
error: 'Startup timeout exceeded',
@@ -47,7 +47,7 @@ function startProcess(settings) {
4747
}, spawnTimeout);
4848
proc.stdout.on('data', (data) => {
4949
notifyLaravel('events', {
50-
event: 'Native\\Laravel\\Events\\ChildProcess\\MessageReceived',
50+
event: 'Native\\Desktop\\Events\\ChildProcess\\MessageReceived',
5151
payload: {
5252
alias,
5353
data: data.toString(),
@@ -57,7 +57,7 @@ function startProcess(settings) {
5757
proc.stderr.on('data', (data) => {
5858
console.error('Process [' + alias + '] ERROR:', data.toString().trim());
5959
notifyLaravel('events', {
60-
event: 'Native\\Laravel\\Events\\ChildProcess\\ErrorReceived',
60+
event: 'Native\\Desktop\\Events\\ChildProcess\\ErrorReceived',
6161
payload: {
6262
alias,
6363
data: data.toString(),
@@ -73,15 +73,15 @@ function startProcess(settings) {
7373
settings
7474
};
7575
notifyLaravel('events', {
76-
event: 'Native\\Laravel\\Events\\ChildProcess\\ProcessSpawned',
76+
event: 'Native\\Desktop\\Events\\ChildProcess\\ProcessSpawned',
7777
payload: [alias, proc.pid]
7878
});
7979
});
8080
proc.on('exit', (code) => {
8181
clearTimeout(startTimeout);
8282
console.log(`Process [${alias}] exited with code [${code}].`);
8383
notifyLaravel('events', {
84-
event: 'Native\\Laravel\\Events\\ChildProcess\\ProcessExited',
84+
event: 'Native\\Desktop\\Events\\ChildProcess\\ProcessExited',
8585
payload: {
8686
alias,
8787
code,
@@ -103,7 +103,7 @@ function startProcess(settings) {
103103
catch (error) {
104104
console.error(`Failed to create process [${alias}]: ${error.message}`);
105105
notifyLaravel('events', {
106-
event: 'Native\\Laravel\\Events\\ChildProcess\\StartupError',
106+
event: 'Native\\Desktop\\Events\\ChildProcess\\StartupError',
107107
payload: {
108108
alias,
109109
error: error.toString(),

resources/electron/electron-plugin/dist/server/api/helper/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { notifyLaravel, goToUrl } from '../../utils.js';
33
import state from '../../state.js';
44
function triggerMenuItemEvent(menuItem, combo) {
55
notifyLaravel('events', {
6-
event: menuItem.event || '\\Native\\Laravel\\Events\\Menu\\MenuItemClicked',
6+
event: menuItem.event || '\\Native\\Desktop\\Events\\Menu\\MenuItemClicked',
77
payload: {
88
item: {
99
id: menuItem.id,

resources/electron/electron-plugin/dist/server/api/menuBar.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ router.post("/create", (req, res) => {
9393
state.tray.setTitle(label);
9494
state.activeMenuBar.on("hide", () => {
9595
notifyLaravel("events", {
96-
event: "\\Native\\Laravel\\Events\\MenuBar\\MenuBarHidden"
96+
event: "\\Native\\Desktop\\Events\\MenuBar\\MenuBarHidden"
9797
});
9898
});
9999
state.activeMenuBar.on("show", () => {
100100
notifyLaravel("events", {
101-
event: "\\Native\\Laravel\\Events\\MenuBar\\MenuBarShown"
101+
event: "\\Native\\Desktop\\Events\\MenuBar\\MenuBarShown"
102102
});
103103
});
104104
});
@@ -107,20 +107,20 @@ router.post("/create", (req, res) => {
107107
function eventsForTray(tray, onlyShowContextMenu, contextMenu, shouldSendCreatedEvent) {
108108
if (shouldSendCreatedEvent) {
109109
notifyLaravel("events", {
110-
event: "\\Native\\Laravel\\Events\\MenuBar\\MenuBarCreated"
110+
event: "\\Native\\Desktop\\Events\\MenuBar\\MenuBarCreated"
111111
});
112112
}
113113
tray.on("drop-files", (event, files) => {
114114
notifyLaravel("events", {
115-
event: "\\Native\\Laravel\\Events\\MenuBar\\MenuBarDroppedFiles",
115+
event: "\\Native\\Desktop\\Events\\MenuBar\\MenuBarDroppedFiles",
116116
payload: [
117117
files
118118
]
119119
});
120120
});
121121
tray.on('click', (combo, bounds, position) => {
122122
notifyLaravel('events', {
123-
event: "\\Native\\Laravel\\Events\\MenuBar\\MenuBarClicked",
123+
event: "\\Native\\Desktop\\Events\\MenuBar\\MenuBarClicked",
124124
payload: {
125125
combo,
126126
bounds,
@@ -130,7 +130,7 @@ function eventsForTray(tray, onlyShowContextMenu, contextMenu, shouldSendCreated
130130
});
131131
tray.on("right-click", (combo, bounds) => {
132132
notifyLaravel("events", {
133-
event: "\\Native\\Laravel\\Events\\MenuBar\\MenuBarRightClicked",
133+
event: "\\Native\\Desktop\\Events\\MenuBar\\MenuBarRightClicked",
134134
payload: {
135135
combo,
136136
bounds,
@@ -143,7 +143,7 @@ function eventsForTray(tray, onlyShowContextMenu, contextMenu, shouldSendCreated
143143
});
144144
tray.on('double-click', (combo, bounds) => {
145145
notifyLaravel('events', {
146-
event: "\\Native\\Laravel\\Events\\MenuBar\\MenuBarDoubleClicked",
146+
event: "\\Native\\Desktop\\Events\\MenuBar\\MenuBarDoubleClicked",
147147
payload: {
148148
combo,
149149
bounds,

resources/electron/electron-plugin/dist/server/api/notification.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { notifyLaravel } from "../utils.js";
44
const router = express.Router();
55
router.post('/', (req, res) => {
66
const { title, body, subtitle, silent, icon, hasReply, timeoutType, replyPlaceholder, sound, urgency, actions, closeButtonText, toastXml, event: customEvent, reference, } = req.body;
7-
const eventName = customEvent !== null && customEvent !== void 0 ? customEvent : '\\Native\\Laravel\\Events\\Notifications\\NotificationClicked';
7+
const eventName = customEvent !== null && customEvent !== void 0 ? customEvent : '\\Native\\Desktop\\Events\\Notifications\\NotificationClicked';
88
const notificationReference = reference !== null && reference !== void 0 ? reference : (Date.now() + '.' + Math.random().toString(36).slice(2, 9));
99
const notification = new Notification({
1010
title,
@@ -23,7 +23,7 @@ router.post('/', (req, res) => {
2323
});
2424
notification.on("click", (event) => {
2525
notifyLaravel('events', {
26-
event: eventName || '\\Native\\Laravel\\Events\\Notifications\\NotificationClicked',
26+
event: eventName || '\\Native\\Desktop\\Events\\Notifications\\NotificationClicked',
2727
payload: {
2828
reference: notificationReference,
2929
event: JSON.stringify(event),
@@ -32,7 +32,7 @@ router.post('/', (req, res) => {
3232
});
3333
notification.on("action", (event, index) => {
3434
notifyLaravel('events', {
35-
event: '\\Native\\Laravel\\Events\\Notifications\\NotificationActionClicked',
35+
event: '\\Native\\Desktop\\Events\\Notifications\\NotificationActionClicked',
3636
payload: {
3737
reference: notificationReference,
3838
index,
@@ -42,7 +42,7 @@ router.post('/', (req, res) => {
4242
});
4343
notification.on("reply", (event, reply) => {
4444
notifyLaravel('events', {
45-
event: '\\Native\\Laravel\\Events\\Notifications\\NotificationReply',
45+
event: '\\Native\\Desktop\\Events\\Notifications\\NotificationReply',
4646
payload: {
4747
reference: notificationReference,
4848
reply,
@@ -52,7 +52,7 @@ router.post('/', (req, res) => {
5252
});
5353
notification.on("close", (event) => {
5454
notifyLaravel('events', {
55-
event: '\\Native\\Laravel\\Events\\Notifications\\NotificationClosed',
55+
event: '\\Native\\Desktop\\Events\\Notifications\\NotificationClosed',
5656
payload: {
5757
reference: notificationReference,
5858
event: JSON.stringify(event),

resources/electron/electron-plugin/dist/server/api/powerMonitor.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,59 +25,59 @@ router.get('/is-on-battery-power', (req, res) => {
2525
});
2626
powerMonitor.addListener('on-ac', () => {
2727
notifyLaravel("events", {
28-
event: `\\Native\\Laravel\\Events\\PowerMonitor\\PowerStateChanged`,
28+
event: `\\Native\\Desktop\\Events\\PowerMonitor\\PowerStateChanged`,
2929
payload: {
3030
state: 'on-ac'
3131
}
3232
});
3333
});
3434
powerMonitor.addListener('on-battery', () => {
3535
notifyLaravel("events", {
36-
event: `\\Native\\Laravel\\Events\\PowerMonitor\\PowerStateChanged`,
36+
event: `\\Native\\Desktop\\Events\\PowerMonitor\\PowerStateChanged`,
3737
payload: {
3838
state: 'on-battery'
3939
}
4040
});
4141
});
4242
powerMonitor.addListener('thermal-state-change', (details) => {
4343
notifyLaravel("events", {
44-
event: `\\Native\\Laravel\\Events\\PowerMonitor\\ThermalStateChanged`,
44+
event: `\\Native\\Desktop\\Events\\PowerMonitor\\ThermalStateChanged`,
4545
payload: {
4646
state: details.state,
4747
},
4848
});
4949
});
5050
powerMonitor.addListener('speed-limit-change', (details) => {
5151
notifyLaravel("events", {
52-
event: `\\Native\\Laravel\\Events\\PowerMonitor\\SpeedLimitChanged`,
52+
event: `\\Native\\Desktop\\Events\\PowerMonitor\\SpeedLimitChanged`,
5353
payload: {
5454
limit: details.limit,
5555
},
5656
});
5757
});
5858
powerMonitor.addListener('lock-screen', () => {
5959
notifyLaravel("events", {
60-
event: `\\Native\\Laravel\\Events\\PowerMonitor\\ScreenLocked`,
60+
event: `\\Native\\Desktop\\Events\\PowerMonitor\\ScreenLocked`,
6161
});
6262
});
6363
powerMonitor.addListener('unlock-screen', () => {
6464
notifyLaravel("events", {
65-
event: `\\Native\\Laravel\\Events\\PowerMonitor\\ScreenUnlocked`,
65+
event: `\\Native\\Desktop\\Events\\PowerMonitor\\ScreenUnlocked`,
6666
});
6767
});
6868
powerMonitor.addListener('shutdown', () => {
6969
notifyLaravel("events", {
70-
event: `\\Native\\Laravel\\Events\\PowerMonitor\\Shutdown`,
70+
event: `\\Native\\Desktop\\Events\\PowerMonitor\\Shutdown`,
7171
});
7272
});
7373
powerMonitor.addListener('user-did-become-active', () => {
7474
notifyLaravel("events", {
75-
event: `\\Native\\Laravel\\Events\\PowerMonitor\\UserDidBecomeActive`,
75+
event: `\\Native\\Desktop\\Events\\PowerMonitor\\UserDidBecomeActive`,
7676
});
7777
});
7878
powerMonitor.addListener('user-did-resign-active', () => {
7979
notifyLaravel("events", {
80-
event: `\\Native\\Laravel\\Events\\PowerMonitor\\UserDidResignActive`,
80+
event: `\\Native\\Desktop\\Events\\PowerMonitor\\UserDidResignActive`,
8181
});
8282
});
8383
export default router;

resources/electron/electron-plugin/dist/server/api/window.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,37 +195,37 @@ router.post('/open', (req, res) => {
195195
}
196196
window.on('blur', () => {
197197
notifyLaravel('events', {
198-
event: 'Native\\Laravel\\Events\\Windows\\WindowBlurred',
198+
event: 'Native\\Desktop\\Events\\Windows\\WindowBlurred',
199199
payload: [id]
200200
});
201201
});
202202
window.on('focus', () => {
203203
notifyLaravel('events', {
204-
event: 'Native\\Laravel\\Events\\Windows\\WindowFocused',
204+
event: 'Native\\Desktop\\Events\\Windows\\WindowFocused',
205205
payload: [id]
206206
});
207207
});
208208
window.on('minimize', () => {
209209
notifyLaravel('events', {
210-
event: 'Native\\Laravel\\Events\\Windows\\WindowMinimized',
210+
event: 'Native\\Desktop\\Events\\Windows\\WindowMinimized',
211211
payload: [id]
212212
});
213213
});
214214
window.on('maximize', () => {
215215
notifyLaravel('events', {
216-
event: 'Native\\Laravel\\Events\\Windows\\WindowMaximized',
216+
event: 'Native\\Desktop\\Events\\Windows\\WindowMaximized',
217217
payload: [id]
218218
});
219219
});
220220
window.on('show', () => {
221221
notifyLaravel('events', {
222-
event: 'Native\\Laravel\\Events\\Windows\\WindowShown',
222+
event: 'Native\\Desktop\\Events\\Windows\\WindowShown',
223223
payload: [id]
224224
});
225225
});
226226
window.on('resized', () => {
227227
notifyLaravel('events', {
228-
event: 'Native\\Laravel\\Events\\Windows\\WindowResized',
228+
event: 'Native\\Desktop\\Events\\Windows\\WindowResized',
229229
payload: [id, window.getSize()[0], window.getSize()[1]]
230230
});
231231
});
@@ -237,13 +237,13 @@ router.post('/open', (req, res) => {
237237
delete state.windows[id];
238238
}
239239
notifyLaravel('events', {
240-
event: 'Native\\Laravel\\Events\\Windows\\WindowClosed',
240+
event: 'Native\\Desktop\\Events\\Windows\\WindowClosed',
241241
payload: [id]
242242
});
243243
});
244244
window.on('hide', (evt) => {
245245
notifyLaravel('events', {
246-
event: 'Native\\Laravel\\Events\\Windows\\WindowHidden',
246+
event: 'Native\\Desktop\\Events\\Windows\\WindowHidden',
247247
payload: [id]
248248
});
249249
});

resources/electron/electron-plugin/dist/server/state.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ settingsStore.onDidAnyChange((newValue, oldValue) => {
55
const changedKeys = Object.keys(newValue).filter((key) => newValue[key] !== oldValue[key]);
66
changedKeys.forEach((key) => {
77
notifyLaravel("events", {
8-
event: "Native\\Laravel\\Events\\Settings\\SettingChanged",
8+
event: "Native\\Desktop\\Events\\Settings\\SettingChanged",
99
payload: {
1010
key,
1111
value: newValue[key] || null,

0 commit comments

Comments
 (0)