@dxos/plugin-pwa 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a
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/dist/lib/browser/index.mjs +11 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/PwaPlugin.d.ts +1 -1
- package/dist/types/src/PwaPlugin.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/src/PwaPlugin.tsx +48 -49
- package/src/meta.ts +1 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-pwa",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.ead640a",
|
|
4
4
|
"description": "DXOS Surface plugin for PWA registration and update handling.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -25,29 +25,29 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@preact-signals/safe-react": "^0.9.0",
|
|
28
|
-
"effect": "3.
|
|
29
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
28
|
+
"effect": "3.18.3",
|
|
29
|
+
"@dxos/app-framework": "0.8.4-main.ead640a",
|
|
30
|
+
"@dxos/log": "0.8.4-main.ead640a",
|
|
31
|
+
"@dxos/observability": "0.8.4-main.ead640a"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/react": "~
|
|
35
|
-
"@types/react-dom": "~
|
|
36
|
-
"react": "~
|
|
37
|
-
"react-dom": "~
|
|
38
|
-
"vite": "7.1.
|
|
34
|
+
"@types/react": "~19.2.2",
|
|
35
|
+
"@types/react-dom": "~19.2.1",
|
|
36
|
+
"react": "~19.2.0",
|
|
37
|
+
"react-dom": "~19.2.0",
|
|
38
|
+
"vite": "7.1.9",
|
|
39
39
|
"vite-plugin-pwa": "^1.0.2",
|
|
40
40
|
"workbox-window": "^7.3.0",
|
|
41
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
42
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
43
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
41
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
42
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a",
|
|
43
|
+
"@dxos/storybook-utils": "0.8.4-main.ead640a"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"effect": "^3.13.3",
|
|
47
|
-
"react": "
|
|
48
|
-
"react-dom": "
|
|
49
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
50
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
47
|
+
"react": "^19.0.0",
|
|
48
|
+
"react-dom": "^19.0.0",
|
|
49
|
+
"@dxos/react-ui": "0.8.4-main.ead640a",
|
|
50
|
+
"@dxos/react-ui-theme": "0.8.4-main.ead640a"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
package/src/PwaPlugin.tsx
CHANGED
|
@@ -16,56 +16,55 @@ import {
|
|
|
16
16
|
import { log } from '@dxos/log';
|
|
17
17
|
import { captureException } from '@dxos/observability/sentry';
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import { meta } from './meta';
|
|
20
20
|
import { translations } from './translations';
|
|
21
21
|
|
|
22
|
-
export const PwaPlugin = () =>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
22
|
+
export const PwaPlugin = definePlugin(meta, () => [
|
|
23
|
+
defineModule({
|
|
24
|
+
id: `${meta.id}/module/translations`,
|
|
25
|
+
activatesOn: Events.SetupTranslations,
|
|
26
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
27
|
+
}),
|
|
28
|
+
defineModule({
|
|
29
|
+
id: `${meta.id}/module/register-pwa`,
|
|
30
|
+
activatesOn: Events.DispatcherReady,
|
|
31
|
+
activate: (context) => {
|
|
32
|
+
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
34
|
+
const updateSW = registerSW({
|
|
35
|
+
onNeedRefresh: () =>
|
|
36
|
+
dispatch?.(
|
|
37
|
+
createIntent(LayoutAction.AddToast, {
|
|
38
|
+
part: 'toast',
|
|
39
|
+
subject: {
|
|
40
|
+
id: `${meta.id}/need-refresh`,
|
|
41
|
+
title: ['need refresh label', { ns: meta.id }],
|
|
42
|
+
description: ['need refresh description', { ns: meta.id }],
|
|
43
|
+
duration: 4 * 60 * 1000, // 4m
|
|
44
|
+
actionLabel: ['refresh label', { ns: meta.id }],
|
|
45
|
+
actionAlt: ['refresh alt', { ns: meta.id }],
|
|
46
|
+
onAction: () => updateSW(true),
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
),
|
|
50
|
+
onOfflineReady: () =>
|
|
51
|
+
dispatch?.(
|
|
52
|
+
createIntent(LayoutAction.AddToast, {
|
|
53
|
+
part: 'toast',
|
|
54
|
+
subject: {
|
|
55
|
+
id: `${meta.id}/offline-ready`,
|
|
56
|
+
title: ['offline ready label', { ns: meta.id }],
|
|
57
|
+
closeLabel: ['confirm label', { ns: meta.id }],
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
),
|
|
61
|
+
onRegisterError: (err) => {
|
|
62
|
+
captureException(err);
|
|
63
|
+
log.error(err);
|
|
64
|
+
},
|
|
65
|
+
});
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
return contributes(Capabilities.Null, null);
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
70
|
+
]);
|