@dxos/plugin-pwa 0.8.4-main.a4bbb77 → 0.8.4-main.abd8ff62ef

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.
@@ -0,0 +1,77 @@
1
+ // src/PwaPlugin.tsx
2
+ import * as Effect from "effect/Effect";
3
+ import { registerSW } from "virtual:pwa-register";
4
+ import { ActivationEvents, Capabilities, Capability, Plugin } from "@dxos/app-framework";
5
+ import { AppPlugin, LayoutOperation } from "@dxos/app-toolkit";
6
+ import { log } from "@dxos/log";
7
+ import { meta } from "#meta";
8
+ import { translations } from "#translations";
9
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-pwa/src/PwaPlugin.tsx";
10
+ var PwaPlugin = Plugin.define(meta).pipe(AppPlugin.addTranslationsModule({
11
+ translations
12
+ }), Plugin.addModule({
13
+ id: "register-pwa",
14
+ activatesOn: ActivationEvents.OperationInvokerReady,
15
+ activate: Effect.fnUntraced(function* () {
16
+ const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);
17
+ const updateSW = registerSW({
18
+ onNeedRefresh: () => {
19
+ void invokePromise(LayoutOperation.AddToast, {
20
+ id: `${meta.id}.need-refresh`,
21
+ title: [
22
+ "need-refresh.label",
23
+ {
24
+ ns: meta.id
25
+ }
26
+ ],
27
+ description: [
28
+ "need-refresh.description",
29
+ {
30
+ ns: meta.id
31
+ }
32
+ ],
33
+ duration: 4 * 60 * 1e3,
34
+ actionLabel: [
35
+ "refresh.label",
36
+ {
37
+ ns: meta.id
38
+ }
39
+ ],
40
+ actionAlt: [
41
+ "refresh.alt",
42
+ {
43
+ ns: meta.id
44
+ }
45
+ ],
46
+ onAction: () => updateSW(true)
47
+ });
48
+ },
49
+ onOfflineReady: () => {
50
+ void invokePromise(LayoutOperation.AddToast, {
51
+ id: `${meta.id}.offline-ready`,
52
+ title: [
53
+ "offline-ready.label",
54
+ {
55
+ ns: meta.id
56
+ }
57
+ ],
58
+ closeLabel: [
59
+ "confirm.label",
60
+ {
61
+ ns: meta.id
62
+ }
63
+ ]
64
+ });
65
+ },
66
+ onRegisterError: (err) => {
67
+ log.error(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 68, S: this });
68
+ }
69
+ });
70
+ })
71
+ }), Plugin.make);
72
+ var PwaPlugin_default = PwaPlugin;
73
+ export {
74
+ PwaPlugin,
75
+ PwaPlugin_default as default
76
+ };
77
+ //# sourceMappingURL=PwaPlugin-IEM6AA5A.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/PwaPlugin.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport { registerSW } from 'virtual:pwa-register';\n\nimport { ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';\nimport { AppPlugin, LayoutOperation } from '@dxos/app-toolkit';\nimport { log } from '@dxos/log';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\nexport const PwaPlugin = Plugin.define(meta).pipe(\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n id: 'register-pwa',\n activatesOn: ActivationEvents.OperationInvokerReady,\n activate: Effect.fnUntraced(function* () {\n const { invokePromise } = yield* Capability.get(Capabilities.OperationInvoker);\n\n const updateSW = registerSW({\n onNeedRefresh: () => {\n void invokePromise(LayoutOperation.AddToast, {\n id: `${meta.id}.need-refresh`,\n title: ['need-refresh.label', { ns: meta.id }],\n description: ['need-refresh.description', { ns: meta.id }],\n duration: 4 * 60 * 1000, // 4m\n actionLabel: ['refresh.label', { ns: meta.id }],\n actionAlt: ['refresh.alt', { ns: meta.id }],\n onAction: () => updateSW(true),\n });\n },\n onOfflineReady: () => {\n void invokePromise(LayoutOperation.AddToast, {\n id: `${meta.id}.offline-ready`,\n title: ['offline-ready.label', { ns: meta.id }],\n closeLabel: ['confirm.label', { ns: meta.id }],\n });\n },\n onRegisterError: (err) => {\n log.error(err);\n },\n });\n }),\n }),\n Plugin.make,\n);\n\nexport default PwaPlugin;\n"],
5
+ "mappings": ";AAIA,YAAYA,YAAY;AACxB,SAASC,kBAAkB;AAE3B,SAASC,kBAAkBC,cAAcC,YAAYC,cAAc;AACnE,SAASC,WAAWC,uBAAuB;AAC3C,SAASC,WAAW;AAEpB,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAE7B,IAAA,eAAaC;AAEXN,IAAOO,YAAU,OAAA,OAAA,IAAA,EAAA,KAAA,UAAA,sBAAA;EACfC;IACAC,OAAAA,UAAaZ;EACba,IAAAA;eACUC,iBAAkB;YAEpBC,kBAAWhB,aAAW;UAC1BiB,EAAAA,cAAe,IAAA,OAAA,WAAA,IAAA,aAAA,gBAAA;qBACRF,WAAcT;qBACVE,MAAAA;aACPU,cAAO,gBAAA,UAAA;cAAC,GAAA,KAAA,EAAA;iBAAsB;;YAAc;cAAE,IAAA,KAAA;YAC9CC;;uBAA0C;;YAAc;cAAE,IAAA,KAAA;YAC1DC;UACAC;oBAAc,IAAA,KAAA;uBAAiB;;YAAc;cAAE,IAAA,KAAA;YAC/CC;;qBAA2B;;YAAc;cAAE,IAAA,KAAA;YAC3CC;UACF;UACF,UAAA,MAAA,SAAA,IAAA;QACAC,CAAAA;;sBAEWhB,MAAKI;aACZM,cAAO,gBAAA,UAAA;cAAC,GAAA,KAAA,EAAA;iBAAuB;;YAAc;cAAE,IAAA,KAAA;YAC/CO;;sBAA8B;;YAAc;cAAE,IAAA,KAAA;YAChD;UACF;QACAC,CAAAA;;MAEA,iBAAA,CAAA,QAAA;AACF,YAAA,MAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA;MACF;IAEFtB,CAAAA;EAGF,CAAA;;;",
6
+ "names": ["Effect", "registerSW", "ActivationEvents", "Capabilities", "Capability", "Plugin", "AppPlugin", "LayoutOperation", "log", "meta", "translations", "PwaPlugin", "addModule", "id", "activatesOn", "activate", "invokePromise", "updateSW", "onNeedRefresh", "title", "description", "duration", "actionLabel", "actionAlt", "onAction", "onOfflineReady", "closeLabel", "onRegisterError"]
7
+ }
@@ -1,111 +1,19 @@
1
+ // src/index.ts
2
+ import { Plugin } from "@dxos/app-framework";
3
+
1
4
  // src/meta.ts
5
+ import { trim } from "@dxos/util";
2
6
  var meta = {
3
- id: "dxos.org/plugin/pwa",
4
- name: "PWA"
7
+ id: "org.dxos.plugin.pwa",
8
+ name: "PWA",
9
+ description: trim`
10
+ Progressive Web App capabilities enabling offline functionality and app-like experience.
11
+ Install to home screen and use the workspace without internet connection.
12
+ `
5
13
  };
6
14
 
7
- // src/PwaPlugin.tsx
8
- import { registerSW } from "virtual:pwa-register";
9
- import { Capabilities, Events, LayoutAction, contributes, createIntent, defineModule, definePlugin } from "@dxos/app-framework";
10
- import { log } from "@dxos/log";
11
- import { captureException } from "@dxos/observability/sentry";
12
-
13
- // src/translations.ts
14
- var translations = [
15
- {
16
- "en-US": {
17
- [meta.id]: {
18
- "need refresh label": "Refresh now to get app updates",
19
- "need refresh description": "You\u2019ll need these updates to continue without interruption.",
20
- "refresh label": "Refresh",
21
- "refresh alt": "Click your browser\u2019s refresh button or use the refresh keyboard shortcut.",
22
- // TODO(wittjosiah): Non-react translation utils.
23
- // 'offline ready label': '{{appName}} is ready to use offline.',
24
- "offline ready label": "Ready to use offline.",
25
- "confirm label": "Okay"
26
- }
27
- }
28
- }
29
- ];
30
-
31
- // src/PwaPlugin.tsx
32
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-pwa/src/PwaPlugin.tsx";
33
- var PwaPlugin = definePlugin(meta, () => [
34
- defineModule({
35
- id: `${meta.id}/module/translations`,
36
- activatesOn: Events.SetupTranslations,
37
- activate: () => contributes(Capabilities.Translations, translations)
38
- }),
39
- defineModule({
40
- id: `${meta.id}/module/register-pwa`,
41
- activatesOn: Events.DispatcherReady,
42
- activate: (context) => {
43
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
44
- const updateSW = registerSW({
45
- onNeedRefresh: () => dispatch?.(createIntent(LayoutAction.AddToast, {
46
- part: "toast",
47
- subject: {
48
- id: `${meta.id}/need-refresh`,
49
- title: [
50
- "need refresh label",
51
- {
52
- ns: meta.id
53
- }
54
- ],
55
- description: [
56
- "need refresh description",
57
- {
58
- ns: meta.id
59
- }
60
- ],
61
- duration: 4 * 60 * 1e3,
62
- actionLabel: [
63
- "refresh label",
64
- {
65
- ns: meta.id
66
- }
67
- ],
68
- actionAlt: [
69
- "refresh alt",
70
- {
71
- ns: meta.id
72
- }
73
- ],
74
- onAction: () => updateSW(true)
75
- }
76
- })),
77
- onOfflineReady: () => dispatch?.(createIntent(LayoutAction.AddToast, {
78
- part: "toast",
79
- subject: {
80
- id: `${meta.id}/offline-ready`,
81
- title: [
82
- "offline ready label",
83
- {
84
- ns: meta.id
85
- }
86
- ],
87
- closeLabel: [
88
- "confirm label",
89
- {
90
- ns: meta.id
91
- }
92
- ]
93
- }
94
- })),
95
- onRegisterError: (err) => {
96
- captureException(err);
97
- log.error(err, void 0, {
98
- F: __dxlog_file,
99
- L: 63,
100
- S: void 0,
101
- C: (f, a) => f(...a)
102
- });
103
- }
104
- });
105
- return contributes(Capabilities.Null, null);
106
- }
107
- })
108
- ]);
15
+ // src/index.ts
16
+ var PwaPlugin = Plugin.lazy(meta, () => import("./PwaPlugin-IEM6AA5A.mjs"));
109
17
  export {
110
18
  PwaPlugin,
111
19
  meta
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/meta.ts", "../../../src/PwaPlugin.tsx", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/pwa',\n name: 'PWA',\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { registerSW } from 'virtual:pwa-register';\n\nimport {\n Capabilities,\n Events,\n LayoutAction,\n contributes,\n createIntent,\n defineModule,\n definePlugin,\n} from '@dxos/app-framework';\nimport { log } from '@dxos/log';\nimport { captureException } from '@dxos/observability/sentry';\n\nimport { meta } from './meta';\nimport { translations } from './translations';\n\nexport const PwaPlugin = definePlugin(meta, () => [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/register-pwa`,\n activatesOn: Events.DispatcherReady,\n activate: (context) => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n\n const updateSW = registerSW({\n onNeedRefresh: () =>\n dispatch?.(\n createIntent(LayoutAction.AddToast, {\n part: 'toast',\n subject: {\n id: `${meta.id}/need-refresh`,\n title: ['need refresh label', { ns: meta.id }],\n description: ['need refresh description', { ns: meta.id }],\n duration: 4 * 60 * 1000, // 4m\n actionLabel: ['refresh label', { ns: meta.id }],\n actionAlt: ['refresh alt', { ns: meta.id }],\n onAction: () => updateSW(true),\n },\n }),\n ),\n onOfflineReady: () =>\n dispatch?.(\n createIntent(LayoutAction.AddToast, {\n part: 'toast',\n subject: {\n id: `${meta.id}/offline-ready`,\n title: ['offline ready label', { ns: meta.id }],\n closeLabel: ['confirm label', { ns: meta.id }],\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", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'need refresh label': 'Refresh now to get app updates',\n 'need refresh description': 'You’ll need these updates to continue without interruption.',\n 'refresh label': 'Refresh',\n 'refresh alt': 'Click your browser’s refresh button or use the refresh keyboard shortcut.',\n // TODO(wittjosiah): Non-react translation utils.\n // 'offline ready label': '{{appName}} is ready to use offline.',\n 'offline ready label': 'Ready to use offline.',\n 'confirm label': 'Okay',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
- "mappings": ";AAMO,IAAMA,OAAmB;EAC9BC,IAAI;EACJC,MAAM;AACR;;;ACLA,SAASC,kBAAkB;AAE3B,SACEC,cACAC,QACAC,cACAC,aACAC,cACAC,cACAC,oBACK;AACP,SAASC,WAAW;AACpB,SAASC,wBAAwB;;;ACR1B,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,sBAAsB;QACtB,4BAA4B;QAC5B,iBAAiB;QACjB,eAAe;;;QAGf,uBAAuB;QACvB,iBAAiB;MACnB;IACF;EACF;;;;;ADDK,IAAMC,YAAYC,aAAaC,MAAM,MAAM;EAChDC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,CAACM,YAAAA;AACT,YAAM,EAAEC,iBAAiBC,SAAQ,IAAKF,QAAQG,cAAcP,aAAaQ,gBAAgB;AAEzF,YAAMC,WAAWC,WAAW;QAC1BC,eAAe,MACbL,WACEM,aAAaC,aAAaC,UAAU;UAClCC,MAAM;UACNC,SAAS;YACPtB,IAAI,GAAGF,KAAKE,EAAE;YACduB,OAAO;cAAC;cAAsB;gBAAEC,IAAI1B,KAAKE;cAAG;;YAC5CyB,aAAa;cAAC;cAA4B;gBAAED,IAAI1B,KAAKE;cAAG;;YACxD0B,UAAU,IAAI,KAAK;YACnBC,aAAa;cAAC;cAAiB;gBAAEH,IAAI1B,KAAKE;cAAG;;YAC7C4B,WAAW;cAAC;cAAe;gBAAEJ,IAAI1B,KAAKE;cAAG;;YACzC6B,UAAU,MAAMd,SAAS,IAAA;UAC3B;QACF,CAAA,CAAA;QAEJe,gBAAgB,MACdlB,WACEM,aAAaC,aAAaC,UAAU;UAClCC,MAAM;UACNC,SAAS;YACPtB,IAAI,GAAGF,KAAKE,EAAE;YACduB,OAAO;cAAC;cAAuB;gBAAEC,IAAI1B,KAAKE;cAAG;;YAC7C+B,YAAY;cAAC;cAAiB;gBAAEP,IAAI1B,KAAKE;cAAG;;UAC9C;QACF,CAAA,CAAA;QAEJgC,iBAAiB,CAACC,QAAAA;AAChBC,2BAAiBD,GAAAA;AACjBE,cAAIC,MAAMH,KAAAA,QAAAA;;;;;;QACZ;MACF,CAAA;AAEA,aAAO5B,YAAYC,aAAa+B,MAAM,IAAA;IACxC;EACF,CAAA;CACD;",
6
- "names": ["meta", "id", "name", "registerSW", "Capabilities", "Events", "LayoutAction", "contributes", "createIntent", "defineModule", "definePlugin", "log", "captureException", "translations", "meta", "id", "PwaPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "DispatcherReady", "context", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "updateSW", "registerSW", "onNeedRefresh", "createIntent", "LayoutAction", "AddToast", "part", "subject", "title", "ns", "description", "duration", "actionLabel", "actionAlt", "onAction", "onOfflineReady", "closeLabel", "onRegisterError", "err", "captureException", "log", "error", "Null"]
3
+ "sources": ["../../../src/index.ts", "../../../src/meta.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const PwaPlugin = Plugin.lazy(meta, () => import('./PwaPlugin'));\n\nexport * from './meta';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.pwa',\n name: 'PWA',\n description: trim`\n Progressive Web App capabilities enabling offline functionality and app-like experience.\n Install to home screen and use the workspace without internet connection.\n `,\n};\n"],
5
+ "mappings": ";AAIA,SAASA,cAAc;;;ACCvB,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;AAIf;;;ADNO,IAAMK,YAAYC,OAAOC,KAAKC,MAAM,MAAM,OAAO,0BAAA,CAAA;",
6
+ "names": ["Plugin", "trim", "meta", "id", "name", "description", "PwaPlugin", "Plugin", "lazy", "meta"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/meta.ts":{"bytes":725,"imports":[],"format":"esm"},"src/translations.ts":{"bytes":2456,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/PwaPlugin.tsx":{"bytes":9497,"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":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/index.ts":{"bytes":535,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/PwaPlugin.tsx","kind":"import-statement","original":"./PwaPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5417},"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":["PwaPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/meta.ts":{"bytesInOutput":59},"src/index.ts":{"bytesInOutput":0},"src/PwaPlugin.tsx":{"bytesInOutput":2421},"src/translations.ts":{"bytesInOutput":609}},"bytes":3239}}}
1
+ {"inputs":{"src/meta.ts":{"bytes":1306,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/PwaPlugin.tsx":{"bytes":7521,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"virtual:pwa-register","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":936,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/PwaPlugin.tsx","kind":"dynamic-import","original":"./PwaPlugin"}],"format":"esm"},"src/translations.ts":{"bytes":2366,"imports":[{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1028},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"dist/lib/browser/PwaPlugin-IEM6AA5A.mjs","kind":"dynamic-import"}],"exports":["PwaPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":123},"src/meta.ts":{"bytesInOutput":291}},"bytes":530},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1106},"dist/lib/browser/translations.mjs":{"imports":[{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":639}},"bytes":731},"dist/lib/browser/PwaPlugin-IEM6AA5A.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3118},"dist/lib/browser/PwaPlugin-IEM6AA5A.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"virtual:pwa-register","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true}],"exports":["PwaPlugin","default"],"entryPoint":"src/PwaPlugin.tsx","inputs":{"src/PwaPlugin.tsx":{"bytesInOutput":2091}},"bytes":2216}}}
@@ -0,0 +1,22 @@
1
+ // src/translations.ts
2
+ import { meta } from "#meta";
3
+ var translations = [
4
+ {
5
+ "en-US": {
6
+ [meta.id]: {
7
+ "need-refresh.label": "Refresh now to get app updates",
8
+ "need-refresh.description": "You\u2019ll need these updates to continue without interruption.",
9
+ "refresh.label": "Refresh",
10
+ "refresh.alt": "Click your browser\u2019s refresh button or use the refresh keyboard shortcut.",
11
+ // TODO(wittjosiah): Non-react translation utils.
12
+ // 'offline ready label': '{{appName}} is ready to use offline.',
13
+ "offline-ready.label": "Ready to use offline.",
14
+ "confirm.label": "Okay"
15
+ }
16
+ }
17
+ }
18
+ ];
19
+ export {
20
+ translations
21
+ };
22
+ //# sourceMappingURL=translations.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/translations.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'need-refresh.label': 'Refresh now to get app updates',\n 'need-refresh.description': 'You’ll need these updates to continue without interruption.',\n 'refresh.label': 'Refresh',\n 'refresh.alt': 'Click your browser’s refresh button or use the refresh keyboard shortcut.',\n // TODO(wittjosiah): Non-react translation utils.\n // 'offline ready label': '{{appName}} is ready to use offline.',\n 'offline-ready.label': 'Ready to use offline.',\n 'confirm.label': 'Okay',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";AAMA,SAASA,YAAY;AAEd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACD,KAAKE,EAAE,GAAG;QACT,sBAAsB;QACtB,4BAA4B;QAC5B,iBAAiB;QACjB,eAAe;;;QAGf,uBAAuB;QACvB,iBAAiB;MACnB;IACF;EACF;;",
6
+ "names": ["meta", "translations", "id"]
7
+ }
@@ -1,2 +1,4 @@
1
- export declare const PwaPlugin: import("@dxos/app-framework").PluginFactory<void>;
1
+ import { Plugin } from '@dxos/app-framework';
2
+ export declare const PwaPlugin: Plugin.PluginFactory<void>;
3
+ export default PwaPlugin;
2
4
  //# sourceMappingURL=PwaPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PwaPlugin.d.ts","sourceRoot":"","sources":["../../../src/PwaPlugin.tsx"],"names":[],"mappings":"AAqBA,eAAO,MAAM,SAAS,mDAgDpB,CAAC"}
1
+ {"version":3,"file":"PwaPlugin.d.ts","sourceRoot":"","sources":["../../../src/PwaPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAA8C,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAOzF,eAAO,MAAM,SAAS,4BAkCrB,CAAC;eAEa,SAAS"}
@@ -1,3 +1,4 @@
1
+ import { Plugin } from '@dxos/app-framework';
2
+ export declare const PwaPlugin: Plugin.PluginFactory<void>;
1
3
  export * from './meta';
2
- export * from './PwaPlugin';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,eAAO,MAAM,SAAS,4BAAiD,CAAC;AAExE,cAAc,QAAQ,CAAC"}
@@ -1,3 +1,3 @@
1
- import { type PluginMeta } from '@dxos/app-framework';
2
- export declare const meta: PluginMeta;
1
+ import { type Plugin } from '@dxos/app-framework';
2
+ export declare const meta: Plugin.Meta;
3
3
  //# sourceMappingURL=meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,IAAI,EAAE,UAGlB,CAAC"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,IAOzB,CAAC"}
@@ -1,13 +1,12 @@
1
- import { meta } from './meta';
2
1
  export declare const translations: [{
3
2
  readonly 'en-US': {
4
- readonly [meta.id]: {
5
- readonly 'need refresh label': "Refresh now to get app updates";
6
- readonly 'need refresh description': "You’ll need these updates to continue without interruption.";
7
- readonly 'refresh label': "Refresh";
8
- readonly 'refresh alt': "Click your browser’s refresh button or use the refresh keyboard shortcut.";
9
- readonly 'offline ready label': "Ready to use offline.";
10
- readonly 'confirm label': "Okay";
3
+ readonly [x: string]: {
4
+ readonly 'need-refresh.label': 'Refresh now to get app updates';
5
+ readonly 'need-refresh.description': 'You\u2019ll need these updates to continue without interruption.';
6
+ readonly 'refresh.label': 'Refresh';
7
+ readonly 'refresh.alt': 'Click your browser\u2019s refresh button or use the refresh keyboard shortcut.';
8
+ readonly 'offline-ready.label': 'Ready to use offline.';
9
+ readonly 'confirm.label': 'Okay';
11
10
  };
12
11
  };
13
12
  }];
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,IAAI,CAAC,EAAE,CAAC;;;;;;;UASR;;EAGwB,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY;;;2CAIK,gCAAgC;iDAC1B,kEAA6D;sCACxE,SAAS;oCACX,gFAA2E;4CAGnE,uBAAuB;sCAC7B,MAAM;;;EAIA,CAAC"}