@dxos/plugin-pwa 0.7.4 → 0.7.5-labs.071a3e2
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 +70 -63
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/PwaPlugin.d.ts +1 -2
- package/dist/types/src/PwaPlugin.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +10 -18
- package/src/PwaPlugin.tsx +52 -41
- package/src/index.ts +1 -4
- package/src/meta.ts +1 -1
- package/dist/lib/browser/chunk-WYTLXSAY.mjs +0 -11
- package/dist/lib/browser/chunk-WYTLXSAY.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
|
@@ -1,82 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// packages/plugins/plugin-pwa/src/meta.ts
|
|
2
|
+
var PWA_PLUGIN = "dxos.org/plugin/pwa";
|
|
3
|
+
var meta = {
|
|
4
|
+
id: PWA_PLUGIN
|
|
5
|
+
};
|
|
5
6
|
|
|
6
7
|
// packages/plugins/plugin-pwa/src/PwaPlugin.tsx
|
|
7
8
|
import { registerSW } from "virtual:pwa-register";
|
|
8
|
-
import {
|
|
9
|
+
import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events, LayoutAction } from "@dxos/app-framework";
|
|
9
10
|
import { log } from "@dxos/log";
|
|
10
11
|
import { captureException } from "@dxos/observability/sentry";
|
|
11
|
-
|
|
12
|
-
// packages/plugins/plugin-pwa/src/translations.ts
|
|
13
|
-
var translations_default = [
|
|
14
|
-
{
|
|
15
|
-
"en-US": {
|
|
16
|
-
[PWA_PLUGIN]: {
|
|
17
|
-
"need refresh label": "Refresh now to get app updates",
|
|
18
|
-
"need refresh description": "You\u2019ll need these updates to continue without interruption.",
|
|
19
|
-
"refresh label": "Refresh",
|
|
20
|
-
"refresh alt": "Click your browser\u2019s refresh button or use the refresh keyboard shortcut.",
|
|
21
|
-
// TODO(wittjosiah): Non-react translation utils.
|
|
22
|
-
// 'offline ready label': '{{appName}} is ready to use offline.',
|
|
23
|
-
"offline ready label": "Ready to use offline.",
|
|
24
|
-
"confirm label": "Okay"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
// packages/plugins/plugin-pwa/src/PwaPlugin.tsx
|
|
31
12
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-pwa/src/PwaPlugin.tsx";
|
|
32
|
-
var PwaPlugin = () => (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
var PwaPlugin = () => definePlugin(meta, [
|
|
14
|
+
defineModule({
|
|
15
|
+
id: `${meta.id}/module/register-pwa`,
|
|
16
|
+
activatesOn: Events.DispatcherReady,
|
|
17
|
+
activate: (context) => {
|
|
18
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
19
|
+
const updateSW = registerSW({
|
|
20
|
+
onNeedRefresh: () => dispatch?.(createIntent(LayoutAction.AddToast, {
|
|
21
|
+
part: "toast",
|
|
41
22
|
subject: {
|
|
42
23
|
id: `${PWA_PLUGIN}/need-refresh`,
|
|
43
|
-
title:
|
|
44
|
-
|
|
24
|
+
title: [
|
|
25
|
+
"need refresh label",
|
|
26
|
+
{
|
|
27
|
+
ns: PWA_PLUGIN
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
description: [
|
|
31
|
+
"need refresh description",
|
|
32
|
+
{
|
|
33
|
+
ns: PWA_PLUGIN
|
|
34
|
+
}
|
|
35
|
+
],
|
|
45
36
|
duration: 4 * 60 * 1e3,
|
|
46
|
-
actionLabel:
|
|
47
|
-
|
|
37
|
+
actionLabel: [
|
|
38
|
+
"refresh label",
|
|
39
|
+
{
|
|
40
|
+
ns: PWA_PLUGIN
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
actionAlt: [
|
|
44
|
+
"refresh alt",
|
|
45
|
+
{
|
|
46
|
+
ns: PWA_PLUGIN
|
|
47
|
+
}
|
|
48
|
+
],
|
|
48
49
|
onAction: () => updateSW(true)
|
|
49
50
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
action: LayoutAction.SET_LAYOUT,
|
|
54
|
-
data: {
|
|
55
|
-
element: "toast",
|
|
51
|
+
})),
|
|
52
|
+
onOfflineReady: () => dispatch?.(createIntent(LayoutAction.AddToast, {
|
|
53
|
+
part: "toast",
|
|
56
54
|
subject: {
|
|
57
55
|
id: `${PWA_PLUGIN}/offline-ready`,
|
|
58
|
-
title:
|
|
59
|
-
|
|
56
|
+
title: [
|
|
57
|
+
"offline ready label",
|
|
58
|
+
{
|
|
59
|
+
ns: PWA_PLUGIN
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
closeLabel: [
|
|
63
|
+
"confirm label",
|
|
64
|
+
{
|
|
65
|
+
ns: PWA_PLUGIN
|
|
66
|
+
}
|
|
67
|
+
]
|
|
60
68
|
}
|
|
69
|
+
})),
|
|
70
|
+
onRegisterError: (err) => {
|
|
71
|
+
captureException(err);
|
|
72
|
+
log.error(err, void 0, {
|
|
73
|
+
F: __dxlog_file,
|
|
74
|
+
L: 58,
|
|
75
|
+
S: void 0,
|
|
76
|
+
C: (f, a) => f(...a)
|
|
77
|
+
});
|
|
61
78
|
}
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
L: 50,
|
|
68
|
-
S: void 0,
|
|
69
|
-
C: (f, a) => f(...a)
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// packages/plugins/plugin-pwa/src/index.ts
|
|
77
|
-
var src_default = PwaPlugin;
|
|
79
|
+
});
|
|
80
|
+
return contributes(Capabilities.Null, null);
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
]);
|
|
78
84
|
export {
|
|
85
|
+
PWA_PLUGIN,
|
|
79
86
|
PwaPlugin,
|
|
80
|
-
|
|
87
|
+
meta
|
|
81
88
|
};
|
|
82
89
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["registerSW", "
|
|
3
|
+
"sources": ["../../../src/meta.ts", "../../../src/PwaPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const PWA_PLUGIN = 'dxos.org/plugin/pwa';\n\nexport const meta = {\n id: PWA_PLUGIN,\n} satisfies PluginMeta;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { registerSW } from 'virtual:pwa-register';\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n defineModule,\n definePlugin,\n Events,\n LayoutAction,\n} from '@dxos/app-framework';\nimport { log } from '@dxos/log';\nimport { captureException } from '@dxos/observability/sentry';\n\nimport { meta, PWA_PLUGIN } from './meta';\n\nexport const PwaPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/register-pwa`,\n activatesOn: Events.DispatcherReady,\n activate: (context) => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n\n const updateSW = registerSW({\n onNeedRefresh: () =>\n dispatch?.(\n createIntent(LayoutAction.AddToast, {\n part: 'toast',\n subject: {\n id: `${PWA_PLUGIN}/need-refresh`,\n title: ['need refresh label', { ns: PWA_PLUGIN }],\n description: ['need refresh description', { ns: PWA_PLUGIN }],\n duration: 4 * 60 * 1000, // 4m\n actionLabel: ['refresh label', { ns: PWA_PLUGIN }],\n actionAlt: ['refresh alt', { ns: PWA_PLUGIN }],\n onAction: () => updateSW(true),\n },\n }),\n ),\n onOfflineReady: () =>\n dispatch?.(\n createIntent(LayoutAction.AddToast, {\n part: 'toast',\n subject: {\n id: `${PWA_PLUGIN}/offline-ready`,\n title: ['offline ready label', { ns: PWA_PLUGIN }],\n closeLabel: ['confirm label', { ns: PWA_PLUGIN }],\n },\n }),\n ),\n onRegisterError: (err) => {\n captureException(err);\n log.error(err);\n },\n });\n\n return contributes(Capabilities.Null, null);\n },\n }),\n ]);\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,aAAa;AAEnB,IAAMC,OAAO;EAClBC,IAAIF;AACN;;;ACNA,SAASG,kBAAkB;AAE3B,SACEC,cACAC,aACAC,cACAC,cACAC,cACAC,QACAC,oBACK;AACP,SAASC,WAAW;AACpB,SAASC,wBAAwB;;AAI1B,IAAMC,YAAY,MACvBC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,CAACC,YAAAA;AACT,YAAM,EAAEC,iBAAiBC,SAAQ,IAAKF,QAAQG,kBAAkBC,aAAaC,gBAAgB;AAE7F,YAAMC,WAAWC,WAAW;QAC1BC,eAAe,MACbN,WACEO,aAAaC,aAAaC,UAAU;UAClCC,MAAM;UACNC,SAAS;YACPlB,IAAI,GAAGmB,UAAAA;YACPC,OAAO;cAAC;cAAsB;gBAAEC,IAAIF;cAAW;;YAC/CG,aAAa;cAAC;cAA4B;gBAAED,IAAIF;cAAW;;YAC3DI,UAAU,IAAI,KAAK;YACnBC,aAAa;cAAC;cAAiB;gBAAEH,IAAIF;cAAW;;YAChDM,WAAW;cAAC;cAAe;gBAAEJ,IAAIF;cAAW;;YAC5CO,UAAU,MAAMf,SAAS,IAAA;UAC3B;QACF,CAAA,CAAA;QAEJgB,gBAAgB,MACdpB,WACEO,aAAaC,aAAaC,UAAU;UAClCC,MAAM;UACNC,SAAS;YACPlB,IAAI,GAAGmB,UAAAA;YACPC,OAAO;cAAC;cAAuB;gBAAEC,IAAIF;cAAW;;YAChDS,YAAY;cAAC;cAAiB;gBAAEP,IAAIF;cAAW;;UACjD;QACF,CAAA,CAAA;QAEJU,iBAAiB,CAACC,QAAAA;AAChBC,2BAAiBD,GAAAA;AACjBE,cAAIC,MAAMH,KAAAA,QAAAA;;;;;;QACZ;MACF,CAAA;AAEA,aAAOI,YAAYzB,aAAa0B,MAAM,IAAA;IACxC;EACF,CAAA;CACD;",
|
|
6
|
+
"names": ["PWA_PLUGIN", "meta", "id", "registerSW", "Capabilities", "contributes", "createIntent", "defineModule", "definePlugin", "Events", "LayoutAction", "log", "captureException", "PwaPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "DispatcherReady", "activate", "context", "dispatchPromise", "dispatch", "requestCapability", "Capabilities", "IntentDispatcher", "updateSW", "registerSW", "onNeedRefresh", "createIntent", "LayoutAction", "AddToast", "part", "subject", "PWA_PLUGIN", "title", "ns", "description", "duration", "actionLabel", "actionAlt", "onAction", "onOfflineReady", "closeLabel", "onRegisterError", "err", "captureException", "log", "error", "contributes", "Null"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-pwa/src/meta.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-pwa/src/meta.ts":{"bytes":875,"imports":[],"format":"esm"},"packages/plugins/plugin-pwa/src/PwaPlugin.tsx":{"bytes":8936,"imports":[{"path":"virtual:pwa-register","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/observability/sentry","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-pwa/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-pwa/src/index.ts":{"bytes":580,"imports":[{"path":"packages/plugins/plugin-pwa/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-pwa/src/PwaPlugin.tsx","kind":"import-statement","original":"./PwaPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-pwa/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4147},"packages/plugins/plugin-pwa/dist/lib/browser/index.mjs":{"imports":[{"path":"virtual:pwa-register","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/observability/sentry","kind":"import-statement","external":true}],"exports":["PWA_PLUGIN","PwaPlugin","meta"],"entryPoint":"packages/plugins/plugin-pwa/src/index.ts","inputs":{"packages/plugins/plugin-pwa/src/meta.ts":{"bytesInOutput":73},"packages/plugins/plugin-pwa/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-pwa/src/PwaPlugin.tsx":{"bytesInOutput":2281}},"bytes":2528}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PwaPlugin.d.ts","sourceRoot":"","sources":["../../../src/PwaPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PwaPlugin.d.ts","sourceRoot":"","sources":["../../../src/PwaPlugin.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,SAAS,4CA4ClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU,wBAAwB,CAAC
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU,wBAAwB,CAAC;AAEhD,eAAO,MAAM,IAAI;;CAEK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-pwa",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5-labs.071a3e2",
|
|
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",
|
|
@@ -11,28 +11,20 @@
|
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/types/src/index.d.ts",
|
|
13
13
|
"browser": "./dist/lib/browser/index.mjs"
|
|
14
|
-
},
|
|
15
|
-
"./meta": {
|
|
16
|
-
"types": "./dist/types/src/meta.d.ts",
|
|
17
|
-
"browser": "./dist/lib/browser/meta.mjs"
|
|
18
14
|
}
|
|
19
15
|
},
|
|
20
16
|
"types": "dist/types/src/index.d.ts",
|
|
21
17
|
"typesVersions": {
|
|
22
|
-
"*": {
|
|
23
|
-
"meta": [
|
|
24
|
-
"dist/types/src/meta.d.ts"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
18
|
+
"*": {}
|
|
27
19
|
},
|
|
28
20
|
"files": [
|
|
29
21
|
"dist",
|
|
30
22
|
"src"
|
|
31
23
|
],
|
|
32
24
|
"dependencies": {
|
|
33
|
-
"@dxos/app-framework": "0.7.
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
25
|
+
"@dxos/app-framework": "0.7.5-labs.071a3e2",
|
|
26
|
+
"@dxos/observability": "0.7.5-labs.071a3e2",
|
|
27
|
+
"@dxos/log": "0.7.5-labs.071a3e2"
|
|
36
28
|
},
|
|
37
29
|
"devDependencies": {
|
|
38
30
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -43,15 +35,15 @@
|
|
|
43
35
|
"vite": "5.4.7",
|
|
44
36
|
"vite-plugin-pwa": "^0.18.2",
|
|
45
37
|
"workbox-window": "^7.0.0",
|
|
46
|
-
"@dxos/react-ui": "0.7.
|
|
47
|
-
"@dxos/react-ui-theme": "0.7.
|
|
48
|
-
"@dxos/storybook-utils": "0.7.
|
|
38
|
+
"@dxos/react-ui": "0.7.5-labs.071a3e2",
|
|
39
|
+
"@dxos/react-ui-theme": "0.7.5-labs.071a3e2",
|
|
40
|
+
"@dxos/storybook-utils": "0.7.5-labs.071a3e2"
|
|
49
41
|
},
|
|
50
42
|
"peerDependencies": {
|
|
51
43
|
"@phosphor-icons/react": "^2.1.5",
|
|
52
44
|
"react": "~18.2.0",
|
|
53
|
-
"@dxos/react-ui": "0.7.
|
|
54
|
-
"@dxos/react-ui-theme": "0.7.
|
|
45
|
+
"@dxos/react-ui": "0.7.5-labs.071a3e2",
|
|
46
|
+
"@dxos/react-ui-theme": "0.7.5-labs.071a3e2"
|
|
55
47
|
},
|
|
56
48
|
"publishConfig": {
|
|
57
49
|
"access": "public"
|
package/src/PwaPlugin.tsx
CHANGED
|
@@ -4,51 +4,62 @@
|
|
|
4
4
|
|
|
5
5
|
import { registerSW } from 'virtual:pwa-register';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
Capabilities,
|
|
9
|
+
contributes,
|
|
10
|
+
createIntent,
|
|
11
|
+
defineModule,
|
|
12
|
+
definePlugin,
|
|
13
|
+
Events,
|
|
14
|
+
LayoutAction,
|
|
15
|
+
} from '@dxos/app-framework';
|
|
8
16
|
import { log } from '@dxos/log';
|
|
9
17
|
import { captureException } from '@dxos/observability/sentry';
|
|
10
18
|
|
|
11
|
-
import meta,
|
|
12
|
-
import translations from './translations';
|
|
19
|
+
import { meta, PWA_PLUGIN } from './meta';
|
|
13
20
|
|
|
14
|
-
export const PwaPlugin = ()
|
|
15
|
-
meta,
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
export const PwaPlugin = () =>
|
|
22
|
+
definePlugin(meta, [
|
|
23
|
+
defineModule({
|
|
24
|
+
id: `${meta.id}/module/register-pwa`,
|
|
25
|
+
activatesOn: Events.DispatcherReady,
|
|
26
|
+
activate: (context) => {
|
|
27
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
18
28
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const updateSW = registerSW({
|
|
30
|
+
onNeedRefresh: () =>
|
|
31
|
+
dispatch?.(
|
|
32
|
+
createIntent(LayoutAction.AddToast, {
|
|
33
|
+
part: 'toast',
|
|
34
|
+
subject: {
|
|
35
|
+
id: `${PWA_PLUGIN}/need-refresh`,
|
|
36
|
+
title: ['need refresh label', { ns: PWA_PLUGIN }],
|
|
37
|
+
description: ['need refresh description', { ns: PWA_PLUGIN }],
|
|
38
|
+
duration: 4 * 60 * 1000, // 4m
|
|
39
|
+
actionLabel: ['refresh label', { ns: PWA_PLUGIN }],
|
|
40
|
+
actionAlt: ['refresh alt', { ns: PWA_PLUGIN }],
|
|
41
|
+
onAction: () => updateSW(true),
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
),
|
|
45
|
+
onOfflineReady: () =>
|
|
46
|
+
dispatch?.(
|
|
47
|
+
createIntent(LayoutAction.AddToast, {
|
|
48
|
+
part: 'toast',
|
|
49
|
+
subject: {
|
|
50
|
+
id: `${PWA_PLUGIN}/offline-ready`,
|
|
51
|
+
title: ['offline ready label', { ns: PWA_PLUGIN }],
|
|
52
|
+
closeLabel: ['confirm label', { ns: PWA_PLUGIN }],
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
),
|
|
56
|
+
onRegisterError: (err) => {
|
|
57
|
+
captureException(err);
|
|
58
|
+
log.error(err);
|
|
34
59
|
},
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
action: LayoutAction.SET_LAYOUT,
|
|
39
|
-
data: {
|
|
40
|
-
element: 'toast',
|
|
41
|
-
subject: {
|
|
42
|
-
id: `${PWA_PLUGIN}/offline-ready`,
|
|
43
|
-
title: translations[0]['en-US'][PWA_PLUGIN]['offline ready label'],
|
|
44
|
-
closeLabel: translations[0]['en-US'][PWA_PLUGIN]['confirm label'],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
}),
|
|
48
|
-
onRegisterError: (err) => {
|
|
49
|
-
captureException(err);
|
|
50
|
-
log.error(err);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return contributes(Capabilities.Null, null);
|
|
51
63
|
},
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
});
|
|
64
|
+
}),
|
|
65
|
+
]);
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const PWA_PLUGIN = 'dxos.org/plugin/pwa';\n\nexport default {\n id: PWA_PLUGIN,\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,aAAa;AAE1B,IAAA,eAAe;EACbC,IAAID;AACN;",
|
|
6
|
-
"names": ["PWA_PLUGIN", "id"]
|
|
7
|
-
}
|