@dxos/plugin-pwa 0.7.5-main.9d2a38b → 0.7.5-main.e9bb01b
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.
|
@@ -17,8 +17,8 @@ var PwaPlugin = () => definePlugin(meta, [
|
|
|
17
17
|
activate: (context) => {
|
|
18
18
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
19
19
|
const updateSW = registerSW({
|
|
20
|
-
onNeedRefresh: () => dispatch?.(createIntent(LayoutAction.
|
|
21
|
-
|
|
20
|
+
onNeedRefresh: () => dispatch?.(createIntent(LayoutAction.AddToast, {
|
|
21
|
+
part: "toast",
|
|
22
22
|
subject: {
|
|
23
23
|
id: `${PWA_PLUGIN}/need-refresh`,
|
|
24
24
|
title: [
|
|
@@ -49,8 +49,8 @@ var PwaPlugin = () => definePlugin(meta, [
|
|
|
49
49
|
onAction: () => updateSW(true)
|
|
50
50
|
}
|
|
51
51
|
})),
|
|
52
|
-
onOfflineReady: () => dispatch?.(createIntent(LayoutAction.
|
|
53
|
-
|
|
52
|
+
onOfflineReady: () => dispatch?.(createIntent(LayoutAction.AddToast, {
|
|
53
|
+
part: "toast",
|
|
54
54
|
subject: {
|
|
55
55
|
id: `${PWA_PLUGIN}/offline-ready`,
|
|
56
56
|
title: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
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.
|
|
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,
|
|
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", "
|
|
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":875,"imports":[],"format":"esm"},"packages/plugins/plugin-pwa/src/PwaPlugin.tsx":{"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}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-pwa",
|
|
3
|
-
"version": "0.7.5-main.
|
|
3
|
+
"version": "0.7.5-main.e9bb01b",
|
|
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",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"src"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dxos/app-framework": "0.7.5-main.
|
|
26
|
-
"@dxos/observability": "0.7.5-main.
|
|
27
|
-
"@dxos/log": "0.7.5-main.
|
|
25
|
+
"@dxos/app-framework": "0.7.5-main.e9bb01b",
|
|
26
|
+
"@dxos/observability": "0.7.5-main.e9bb01b",
|
|
27
|
+
"@dxos/log": "0.7.5-main.e9bb01b"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"vite": "5.4.7",
|
|
36
36
|
"vite-plugin-pwa": "^0.18.2",
|
|
37
37
|
"workbox-window": "^7.0.0",
|
|
38
|
-
"@dxos/react-ui": "0.7.5-main.
|
|
39
|
-
"@dxos/storybook-utils": "0.7.5-main.
|
|
40
|
-
"@dxos/react-ui
|
|
38
|
+
"@dxos/react-ui-theme": "0.7.5-main.e9bb01b",
|
|
39
|
+
"@dxos/storybook-utils": "0.7.5-main.e9bb01b",
|
|
40
|
+
"@dxos/react-ui": "0.7.5-main.e9bb01b"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@phosphor-icons/react": "^2.1.5",
|
|
44
44
|
"react": "~18.2.0",
|
|
45
|
-
"@dxos/react-ui": "0.7.5-main.
|
|
46
|
-
"@dxos/react-ui-theme": "0.7.5-main.
|
|
45
|
+
"@dxos/react-ui": "0.7.5-main.e9bb01b",
|
|
46
|
+
"@dxos/react-ui-theme": "0.7.5-main.e9bb01b"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
package/src/PwaPlugin.tsx
CHANGED
|
@@ -29,8 +29,8 @@ export const PwaPlugin = () =>
|
|
|
29
29
|
const updateSW = registerSW({
|
|
30
30
|
onNeedRefresh: () =>
|
|
31
31
|
dispatch?.(
|
|
32
|
-
createIntent(LayoutAction.
|
|
33
|
-
|
|
32
|
+
createIntent(LayoutAction.AddToast, {
|
|
33
|
+
part: 'toast',
|
|
34
34
|
subject: {
|
|
35
35
|
id: `${PWA_PLUGIN}/need-refresh`,
|
|
36
36
|
title: ['need refresh label', { ns: PWA_PLUGIN }],
|
|
@@ -44,8 +44,8 @@ export const PwaPlugin = () =>
|
|
|
44
44
|
),
|
|
45
45
|
onOfflineReady: () =>
|
|
46
46
|
dispatch?.(
|
|
47
|
-
createIntent(LayoutAction.
|
|
48
|
-
|
|
47
|
+
createIntent(LayoutAction.AddToast, {
|
|
48
|
+
part: 'toast',
|
|
49
49
|
subject: {
|
|
50
50
|
id: `${PWA_PLUGIN}/offline-ready`,
|
|
51
51
|
title: ['offline ready label', { ns: PWA_PLUGIN }],
|