@webqit/webflo 0.20.7-next.1 → 0.20.8

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/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "vanila-javascript"
13
13
  ],
14
14
  "homepage": "https://webqit.io/tooling/webflo",
15
- "version": "0.20.7-next.1",
15
+ "version": "0.20.8",
16
16
  "license": "MIT",
17
17
  "repository": {
18
18
  "type": "git",
@@ -51,13 +51,13 @@
51
51
  "esbuild": "^0.14.38",
52
52
  "mime-types": "^2.1.33",
53
53
  "simple-git": "^2.20.1",
54
- "urlpattern-polyfill": "^4.0.3"
54
+ "urlpattern-polyfill": "^4.0.3",
55
+ "fast-glob": "^3.3.3"
55
56
  },
56
57
  "devDependencies": {
57
58
  "chai": "^4.3.6",
58
59
  "chokidar": "^4.0.3",
59
60
  "coveralls": "^3.1.1",
60
- "fast-glob": "^3.3.3",
61
61
  "jsdom": "^27.0.1",
62
62
  "markdown-it-mathjax3": "^4.3.2",
63
63
  "mocha": "^10.0.0",
@@ -128,7 +128,7 @@ export class WebfloRuntime {
128
128
  : responseShim.from.value(response);
129
129
  }
130
130
  // Any "carry" data?
131
- //await this.handleCarries(httpEvent, response);
131
+ await this.handleCarries(httpEvent, response);
132
132
  // Resolve now...
133
133
  if (autoLiveResponse) {
134
134
  await autoLiveResponse.replaceWith(response, { done: true });
@@ -219,7 +219,7 @@ export class WebfloRuntime {
219
219
  }
220
220
  } else {
221
221
  // Fire redirect message?
222
- const flashResponses = requestMeta.get('carries')?.map((c) => c.response).filter((r) => r);
222
+ const flashResponses = requestMeta.get('carries')?.filter((c) => ['message', 'error', 'success', 'alert', 'info', 'tip', 'warning'].includes(c.type));
223
223
  if (flashResponses?.length) {
224
224
  httpEvent.waitUntil(new Promise((resolve) => {
225
225
  httpEvent.client.wqLifecycle.open.then(() => {
@@ -87,7 +87,11 @@ export const request = {
87
87
  }
88
88
  },
89
89
  prototype: {
90
- carries: { get: function () { return new Set(_wq(this, 'meta').get('carries') || []); } },
90
+ carries: {
91
+ get: function () {
92
+ return _wq(this, 'meta').get('carries') || [];
93
+ }
94
+ },
91
95
  parse: { value: async function () { return await parseHttpMessage(this); } },
92
96
  clone: {
93
97
  value: function (init = {}) {
@@ -17,6 +17,7 @@ export class WQStarPort extends WQMessagePort {
17
17
 
18
18
  #startWQLifecycle() {
19
19
  const meta = _wq(this, 'meta');
20
+ let isMessaging = false;
20
21
  Object.defineProperty(this, 'wqLifecycle', {
21
22
  value: {
22
23
  open: new Promise((resolve) => {
@@ -28,9 +29,16 @@ export class WQStarPort extends WQMessagePort {
28
29
  meta.set('offlineCallback', resolve);
29
30
  }),
30
31
  messaging: new Promise((resolve) => {
31
- if (meta.get('messaging')) return resolve();
32
- meta.set('messagingCallback', resolve);
32
+ if (meta.get('messaging')) {
33
+ isMessaging = true;
34
+ return resolve();
35
+ }
36
+ meta.set('messagingCallback', () => {
37
+ isMessaging = true;
38
+ resolve()
39
+ });
33
40
  }),
41
+ isMessaging: (() => isMessaging),
34
42
  },
35
43
  configurable: true
36
44
  });
@@ -261,6 +261,7 @@ export function toWQPort(port) {
261
261
  port.addEventListener('message', messageHandler);
262
262
  portMeta.set('messageHandler', messageHandler);
263
263
  // Only after the above native methods usages...
264
+ let isMessaging = false;
264
265
  Object.defineProperty(port, 'wqLifecycle', {
265
266
  value: {
266
267
  open: new Promise((resolve) => {
@@ -272,9 +273,16 @@ export function toWQPort(port) {
272
273
  portMeta.set('offlineCallback', resolve);
273
274
  }),
274
275
  messaging: new Promise((resolve) => {
275
- if (portMeta.get('messaging')) return resolve();
276
- portMeta.set('messagingCallback', resolve);
276
+ if (portMeta.get('messaging')) {
277
+ isMessaging = true;
278
+ return resolve();
279
+ }
280
+ portMeta.set('messagingCallback', () => {
281
+ isMessaging = true;
282
+ resolve()
283
+ });
277
284
  }),
285
+ isMessaging: (() => isMessaging),
278
286
  }
279
287
  });
280
288
  Object.defineProperties(port, prototypeExtensions);