@rimori/client 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -1122
- package/dist/{rimori-client/src/cli → cli}/scripts/init/main.js +0 -0
- package/dist/{rimori-client/src/cli → cli}/scripts/release/release.js +0 -0
- package/dist/{rimori-client/src/index.d.ts → index.d.ts} +7 -1
- package/dist/{rimori-client/src/index.js → index.js} +1 -0
- package/dist/{rimori-client/src/plugin → plugin}/CommunicationHandler.d.ts +1 -0
- package/dist/{rimori-client/src/plugin → plugin}/CommunicationHandler.js +19 -2
- package/dist/{rimori-client/src/plugin → plugin}/RimoriClient.d.ts +1 -1
- package/dist/{rimori-client/src/worker → worker}/WorkerSetup.js +1 -1
- package/package.json +2 -1
- package/src/index.ts +7 -1
- package/src/plugin/CommunicationHandler.ts +22 -6
- package/src/plugin/RimoriClient.ts +5 -3
- package/src/worker/WorkerSetup.ts +1 -1
- package/tsconfig.json +1 -0
- package/dist/react-client/plugin/ThemeSetter.d.ts +0 -2
- package/dist/react-client/plugin/ThemeSetter.js +0 -19
- package/dist/react-client/src/plugin/ThemeSetter.d.ts +0 -2
- package/dist/react-client/src/plugin/ThemeSetter.js +0 -19
- package/dist/react-client/src/utils/FullscreenUtils.d.ts +0 -2
- package/dist/react-client/src/utils/FullscreenUtils.js +0 -23
- package/dist/react-client/src/utils/PluginUtils.d.ts +0 -2
- package/dist/react-client/src/utils/PluginUtils.js +0 -23
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/dev-registration.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/dev-registration.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/env-setup.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/env-setup.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/file-operations.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/file-operations.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/html-cleaner.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/html-cleaner.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/main.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/package-setup.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/package-setup.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/router-transformer.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/router-transformer.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/tailwind-config.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/tailwind-config.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/vite-config.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/init/vite-config.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/release/detect-translation-languages.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/release/detect-translation-languages.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/release/release-config-upload.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/release/release-config-upload.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/release/release-db-update.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/release/release-db-update.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/release/release-file-upload.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/release/release-file-upload.js +0 -0
- /package/dist/{rimori-client/src/cli → cli}/scripts/release/release.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/types/DatabaseTypes.d.ts +0 -0
- /package/dist/{rimori-client/src/cli → cli}/types/DatabaseTypes.js +0 -0
- /package/dist/{rimori-client/src/controller → controller}/AIController.d.ts +0 -0
- /package/dist/{rimori-client/src/controller → controller}/AIController.js +0 -0
- /package/dist/{rimori-client/src/controller → controller}/AccomplishmentController.d.ts +0 -0
- /package/dist/{rimori-client/src/controller → controller}/AccomplishmentController.js +0 -0
- /package/dist/{rimori-client/src/controller → controller}/AudioController.d.ts +0 -0
- /package/dist/{rimori-client/src/controller → controller}/AudioController.js +0 -0
- /package/dist/{rimori-client/src/controller → controller}/ExerciseController.d.ts +0 -0
- /package/dist/{rimori-client/src/controller → controller}/ExerciseController.js +0 -0
- /package/dist/{rimori-client/src/controller → controller}/ObjectController.d.ts +0 -0
- /package/dist/{rimori-client/src/controller → controller}/ObjectController.js +0 -0
- /package/dist/{rimori-client/src/controller → controller}/SettingsController.d.ts +0 -0
- /package/dist/{rimori-client/src/controller → controller}/SettingsController.js +0 -0
- /package/dist/{rimori-client/src/controller → controller}/SharedContentController.d.ts +0 -0
- /package/dist/{rimori-client/src/controller → controller}/SharedContentController.js +0 -0
- /package/dist/{rimori-client/src/controller → controller}/TranslationController.d.ts +0 -0
- /package/dist/{rimori-client/src/controller → controller}/TranslationController.js +0 -0
- /package/dist/{rimori-client/src/controller → controller}/VoiceController.d.ts +0 -0
- /package/dist/{rimori-client/src/controller → controller}/VoiceController.js +0 -0
- /package/dist/{rimori-client/src/fromRimori → fromRimori}/EventBus.d.ts +0 -0
- /package/dist/{rimori-client/src/fromRimori → fromRimori}/EventBus.js +0 -0
- /package/dist/{rimori-client/src/fromRimori → fromRimori}/PluginTypes.d.ts +0 -0
- /package/dist/{rimori-client/src/fromRimori → fromRimori}/PluginTypes.js +0 -0
- /package/dist/{rimori-client/src/plugin → plugin}/Logger.d.ts +0 -0
- /package/dist/{rimori-client/src/plugin → plugin}/Logger.js +0 -0
- /package/dist/{rimori-client/src/plugin → plugin}/RimoriClient.js +0 -0
- /package/dist/{rimori-client/src/plugin → plugin}/StandaloneClient.d.ts +0 -0
- /package/dist/{rimori-client/src/plugin → plugin}/StandaloneClient.js +0 -0
- /package/dist/{rimori-client/src/utils → utils}/difficultyConverter.d.ts +0 -0
- /package/dist/{rimori-client/src/utils → utils}/difficultyConverter.js +0 -0
- /package/dist/{rimori-client/src/utils → utils}/endpoint.d.ts +0 -0
- /package/dist/{rimori-client/src/utils → utils}/endpoint.js +0 -0
- /package/dist/{rimori-client/src/worker → worker}/WorkerSetup.d.ts +0 -0
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,13 @@ export * from './fromRimori/PluginTypes';
|
|
|
5
5
|
export * from './fromRimori/EventBus';
|
|
6
6
|
export * from './plugin/RimoriClient';
|
|
7
7
|
export * from './plugin/StandaloneClient';
|
|
8
|
+
export { setupWorker } from './worker/WorkerSetup';
|
|
8
9
|
export { AudioController } from './controller/AudioController';
|
|
9
10
|
export { Translator } from './controller/TranslationController';
|
|
10
|
-
export type { Message, ToolInvocation } from './controller/AIController';
|
|
11
11
|
export type { TOptions } from 'i18next';
|
|
12
|
+
export type { SharedContent, SharedContentObjectRequest } from './controller/SharedContentController';
|
|
13
|
+
export type { Exercise } from './controller/ExerciseController';
|
|
14
|
+
export type { UserInfo, Language } from './controller/SettingsController';
|
|
15
|
+
export type { Message, ToolInvocation } from './controller/AIController';
|
|
16
|
+
export type { TriggerAction } from './controller/ExerciseController';
|
|
17
|
+
export type { MacroAccomplishmentPayload, MicroAccomplishmentPayload } from './controller/AccomplishmentController';
|
|
@@ -6,5 +6,6 @@ export * from './fromRimori/PluginTypes';
|
|
|
6
6
|
export * from './fromRimori/EventBus';
|
|
7
7
|
export * from './plugin/RimoriClient';
|
|
8
8
|
export * from './plugin/StandaloneClient';
|
|
9
|
+
export { setupWorker } from './worker/WorkerSetup';
|
|
9
10
|
export { AudioController } from './controller/AudioController';
|
|
10
11
|
export { Translator } from './controller/TranslationController';
|
|
@@ -31,6 +31,7 @@ export declare class RimoriCommunicationHandler {
|
|
|
31
31
|
constructor(pluginId: string, standalone: boolean);
|
|
32
32
|
private initMessageChannel;
|
|
33
33
|
private sendHello;
|
|
34
|
+
private sendFinishedInit;
|
|
34
35
|
getQueryParam(key: string): string | null;
|
|
35
36
|
getClient(): Promise<{
|
|
36
37
|
supabase: SupabaseClient;
|
|
@@ -65,9 +65,9 @@ export class RimoriCommunicationHandler {
|
|
|
65
65
|
};
|
|
66
66
|
// Set theme from MessageChannel query params
|
|
67
67
|
if (!worker) {
|
|
68
|
-
const theme = this.queryParams['rm_theme'];
|
|
68
|
+
// const theme = this.queryParams['rm_theme'];
|
|
69
69
|
// setTheme(theme);
|
|
70
|
-
console.log('TODO: set theme from MessageChannel query params');
|
|
70
|
+
// console.log('TODO: set theme from MessageChannel query params');
|
|
71
71
|
}
|
|
72
72
|
// Forward plugin events to parent (only after MessageChannel is ready)
|
|
73
73
|
EventBus.on('*', (ev) => {
|
|
@@ -89,6 +89,9 @@ export class RimoriCommunicationHandler {
|
|
|
89
89
|
window.addEventListener('message', listener);
|
|
90
90
|
}
|
|
91
91
|
this.sendHello(worker);
|
|
92
|
+
EventBus.on('self.rimori.triggerInitFinished', () => {
|
|
93
|
+
this.sendFinishedInit(worker);
|
|
94
|
+
});
|
|
92
95
|
}
|
|
93
96
|
sendHello(isWorker = false) {
|
|
94
97
|
try {
|
|
@@ -104,6 +107,20 @@ export class RimoriCommunicationHandler {
|
|
|
104
107
|
console.error('[PluginController] Error sending hello:', e);
|
|
105
108
|
}
|
|
106
109
|
}
|
|
110
|
+
sendFinishedInit(isWorker = false) {
|
|
111
|
+
try {
|
|
112
|
+
const payload = { type: 'rimori:acknowledged', pluginId: this.pluginId };
|
|
113
|
+
if (isWorker) {
|
|
114
|
+
self.postMessage(payload);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
window.parent.postMessage(payload, '*');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (e) {
|
|
121
|
+
console.error('[PluginController] Error sending finished init:', e);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
107
124
|
getQueryParam(key) {
|
|
108
125
|
return this.queryParams[key] || null;
|
|
109
126
|
}
|
|
@@ -62,7 +62,7 @@ export declare class RimoriClient {
|
|
|
62
62
|
getTranslator: () => Promise<Translator>;
|
|
63
63
|
};
|
|
64
64
|
get db(): {
|
|
65
|
-
from: (relation: string) => PostgrestQueryBuilder<GenericSchema,
|
|
65
|
+
from: <ViewName extends string & keyof GenericSchema["Views"], View extends GenericSchema["Views"][ViewName]>(relation: string) => PostgrestQueryBuilder<GenericSchema, View, ViewName>;
|
|
66
66
|
/**
|
|
67
67
|
* The table prefix for of database tables of the plugin.
|
|
68
68
|
*/
|
|
@@ -32,6 +32,6 @@ export function setupWorker(pluginId, init) {
|
|
|
32
32
|
console.debug('[Worker] RimoriClient initialized.');
|
|
33
33
|
yield init(rimoriClient);
|
|
34
34
|
console.debug('[Worker] Worker initialized.');
|
|
35
|
-
|
|
35
|
+
rimoriClient.event.emit('self.rimori.triggerInitFinished');
|
|
36
36
|
});
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimori/client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
14
15
|
"default": "./dist/index.js"
|
|
15
16
|
}
|
|
16
17
|
},
|
package/src/index.ts
CHANGED
|
@@ -6,7 +6,13 @@ export * from './fromRimori/PluginTypes';
|
|
|
6
6
|
export * from './fromRimori/EventBus';
|
|
7
7
|
export * from './plugin/RimoriClient';
|
|
8
8
|
export * from './plugin/StandaloneClient';
|
|
9
|
+
export { setupWorker } from './worker/WorkerSetup';
|
|
9
10
|
export { AudioController } from './controller/AudioController';
|
|
10
11
|
export { Translator } from './controller/TranslationController';
|
|
11
|
-
export type { Message, ToolInvocation } from './controller/AIController';
|
|
12
12
|
export type { TOptions } from 'i18next';
|
|
13
|
+
export type { SharedContent, SharedContentObjectRequest } from './controller/SharedContentController';
|
|
14
|
+
export type { Exercise } from './controller/ExerciseController';
|
|
15
|
+
export type { UserInfo, Language } from './controller/SettingsController';
|
|
16
|
+
export type { Message, ToolInvocation } from './controller/AIController';
|
|
17
|
+
export type { TriggerAction } from './controller/ExerciseController';
|
|
18
|
+
export type { MacroAccomplishmentPayload, MicroAccomplishmentPayload } from './controller/AccomplishmentController';
|
|
@@ -46,7 +46,7 @@ export class RimoriCommunicationHandler {
|
|
|
46
46
|
this.initMessageChannel(typeof WorkerGlobalScope !== 'undefined');
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
private initMessageChannel(worker = false) {
|
|
49
|
+
private initMessageChannel(worker = false): void {
|
|
50
50
|
const listener = (event: MessageEvent) => {
|
|
51
51
|
console.log('[PluginController] window message', { origin: event.origin, data: event.data });
|
|
52
52
|
const { type, pluginId, queryParams, rimoriInfo } = event.data || {};
|
|
@@ -91,9 +91,9 @@ export class RimoriCommunicationHandler {
|
|
|
91
91
|
|
|
92
92
|
// Set theme from MessageChannel query params
|
|
93
93
|
if (!worker) {
|
|
94
|
-
const theme = this.queryParams['rm_theme'];
|
|
94
|
+
// const theme = this.queryParams['rm_theme'];
|
|
95
95
|
// setTheme(theme);
|
|
96
|
-
console.log('TODO: set theme from MessageChannel query params');
|
|
96
|
+
// console.log('TODO: set theme from MessageChannel query params');
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// Forward plugin events to parent (only after MessageChannel is ready)
|
|
@@ -116,6 +116,9 @@ export class RimoriCommunicationHandler {
|
|
|
116
116
|
window.addEventListener('message', listener);
|
|
117
117
|
}
|
|
118
118
|
this.sendHello(worker);
|
|
119
|
+
EventBus.on('self.rimori.triggerInitFinished', () => {
|
|
120
|
+
this.sendFinishedInit(worker);
|
|
121
|
+
});
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
private sendHello(isWorker = false): void {
|
|
@@ -131,6 +134,19 @@ export class RimoriCommunicationHandler {
|
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
136
|
|
|
137
|
+
private sendFinishedInit(isWorker = false): void {
|
|
138
|
+
try {
|
|
139
|
+
const payload = { type: 'rimori:acknowledged', pluginId: this.pluginId };
|
|
140
|
+
if (isWorker) {
|
|
141
|
+
self.postMessage(payload);
|
|
142
|
+
} else {
|
|
143
|
+
window.parent.postMessage(payload, '*');
|
|
144
|
+
}
|
|
145
|
+
} catch (e) {
|
|
146
|
+
console.error('[PluginController] Error sending finished init:', e);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
134
150
|
public getQueryParam(key: string): string | null {
|
|
135
151
|
return this.queryParams[key] || null;
|
|
136
152
|
}
|
|
@@ -233,7 +249,7 @@ export class RimoriCommunicationHandler {
|
|
|
233
249
|
* @returns The Supabase URL.
|
|
234
250
|
* @deprecated All endpoints should use the backend URL instead.
|
|
235
251
|
*/
|
|
236
|
-
public getSupabaseUrl() {
|
|
252
|
+
public getSupabaseUrl(): string {
|
|
237
253
|
if (!this.rimoriInfo) {
|
|
238
254
|
throw new Error('Supabase info not found');
|
|
239
255
|
}
|
|
@@ -241,14 +257,14 @@ export class RimoriCommunicationHandler {
|
|
|
241
257
|
return this.rimoriInfo.url;
|
|
242
258
|
}
|
|
243
259
|
|
|
244
|
-
public getBackendUrl() {
|
|
260
|
+
public getBackendUrl(): string {
|
|
245
261
|
if (!this.rimoriInfo) {
|
|
246
262
|
throw new Error('Rimori info not found');
|
|
247
263
|
}
|
|
248
264
|
return this.rimoriInfo.backendUrl;
|
|
249
265
|
}
|
|
250
266
|
|
|
251
|
-
public getGlobalEventTopic(preliminaryTopic: string) {
|
|
267
|
+
public getGlobalEventTopic(preliminaryTopic: string): string {
|
|
252
268
|
if (preliminaryTopic.startsWith('global.')) {
|
|
253
269
|
return preliminaryTopic;
|
|
254
270
|
}
|
|
@@ -18,8 +18,8 @@ import { AccomplishmentController, AccomplishmentPayload } from '../controller/A
|
|
|
18
18
|
import { RimoriCommunicationHandler, RimoriInfo } from './CommunicationHandler';
|
|
19
19
|
import { Translator } from '../controller/TranslationController';
|
|
20
20
|
import { Logger } from './Logger';
|
|
21
|
-
import { setTheme } from '../../../react-client/src/plugin/ThemeSetter';
|
|
22
|
-
import { StandaloneClient } from './StandaloneClient';
|
|
21
|
+
// import { setTheme } from '../../../react-client/src/plugin/ThemeSetter';
|
|
22
|
+
// import { StandaloneClient } from './StandaloneClient';
|
|
23
23
|
|
|
24
24
|
// Add declaration for WorkerGlobalScope
|
|
25
25
|
declare const WorkerGlobalScope: any;
|
|
@@ -119,7 +119,9 @@ export class RimoriClient {
|
|
|
119
119
|
// private from<ViewName extends string & keyof GenericSchema['Views'], View extends GenericSchema['Views'][ViewName]>(
|
|
120
120
|
// relation: ViewName,
|
|
121
121
|
// ): PostgrestQueryBuilder<GenericSchema, View, ViewName>;
|
|
122
|
-
from:
|
|
122
|
+
from: <ViewName extends string & keyof GenericSchema['Views'], View extends GenericSchema['Views'][ViewName]>(
|
|
123
|
+
relation: string,
|
|
124
|
+
): PostgrestQueryBuilder<GenericSchema, View, ViewName> => {
|
|
123
125
|
return this.superbase.from(this.db.getTableName(relation));
|
|
124
126
|
},
|
|
125
127
|
// storage: this.superbase.storage,
|
package/tsconfig.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function setTheme(theme) {
|
|
2
|
-
document.documentElement.classList.add('dark:text-gray-200');
|
|
3
|
-
if (isDarkTheme(theme)) {
|
|
4
|
-
document.documentElement.setAttribute('data-theme', 'dark');
|
|
5
|
-
document.documentElement.classList.add('dark', 'dark:bg-gray-950');
|
|
6
|
-
document.documentElement.style.background = 'hsl(var(--background))';
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export function isDarkTheme(theme) {
|
|
10
|
-
// If no theme provided, try to get from URL as fallback (for standalone mode)
|
|
11
|
-
if (!theme) {
|
|
12
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
13
|
-
theme = urlParams.get('theme');
|
|
14
|
-
}
|
|
15
|
-
if (!theme || theme === 'system') {
|
|
16
|
-
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
17
|
-
}
|
|
18
|
-
return theme === 'dark';
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function setTheme(theme) {
|
|
2
|
-
document.documentElement.classList.add('dark:text-gray-200');
|
|
3
|
-
if (isDarkTheme(theme)) {
|
|
4
|
-
document.documentElement.setAttribute('data-theme', 'dark');
|
|
5
|
-
document.documentElement.classList.add('dark', 'dark:bg-gray-950');
|
|
6
|
-
document.documentElement.style.background = 'hsl(var(--background))';
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export function isDarkTheme(theme) {
|
|
10
|
-
// If no theme provided, try to get from URL as fallback (for standalone mode)
|
|
11
|
-
if (!theme) {
|
|
12
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
13
|
-
theme = urlParams.get('theme');
|
|
14
|
-
}
|
|
15
|
-
if (!theme || theme === 'system') {
|
|
16
|
-
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
17
|
-
}
|
|
18
|
-
return theme === 'dark';
|
|
19
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export function isFullscreen() {
|
|
2
|
-
return !!document.fullscreenElement;
|
|
3
|
-
}
|
|
4
|
-
export function triggerFullscreen(onStateChange, selector) {
|
|
5
|
-
document.addEventListener('fullscreenchange', () => {
|
|
6
|
-
onStateChange(isFullscreen());
|
|
7
|
-
});
|
|
8
|
-
try {
|
|
9
|
-
const ref = document.querySelector(selector || '#root');
|
|
10
|
-
if (!isFullscreen()) {
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
ref.requestFullscreen() || ref.webkitRequestFullscreen();
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
document.exitFullscreen() || document.webkitExitFullscreen();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
console.error('Failed to enter fullscreen', error.message);
|
|
21
|
-
}
|
|
22
|
-
onStateChange(isFullscreen());
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export function isFullscreen() {
|
|
2
|
-
return !!document.fullscreenElement;
|
|
3
|
-
}
|
|
4
|
-
export function triggerFullscreen(onStateChange, selector) {
|
|
5
|
-
document.addEventListener('fullscreenchange', () => {
|
|
6
|
-
onStateChange(isFullscreen());
|
|
7
|
-
});
|
|
8
|
-
try {
|
|
9
|
-
const ref = document.querySelector(selector || '#root');
|
|
10
|
-
if (!isFullscreen()) {
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
ref.requestFullscreen() || ref.webkitRequestFullscreen();
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
document.exitFullscreen() || document.webkitExitFullscreen();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
console.error('Failed to enter fullscreen', error.message);
|
|
21
|
-
}
|
|
22
|
-
onStateChange(isFullscreen());
|
|
23
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{rimori-client/src/cli → cli}/scripts/release/detect-translation-languages.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|