@jay-framework/stack-client-runtime 0.23.0 → 0.23.1
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/index.cjs +37 -78
- package/dist/index.js +37 -78
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
-
var __publicField = (obj, key, value) =>
|
|
5
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
-
return value;
|
|
7
|
-
};
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
6
|
const component = require("@jay-framework/component");
|
|
10
7
|
const runtime = require("@jay-framework/runtime");
|
|
11
8
|
function deepMergeViewStates$1(base, overlay, trackByMap, path = "") {
|
|
12
|
-
if (!base && !overlay)
|
|
13
|
-
|
|
14
|
-
if (!base
|
|
15
|
-
return overlay || {};
|
|
16
|
-
if (!overlay)
|
|
17
|
-
return base || {};
|
|
9
|
+
if (!base && !overlay) return {};
|
|
10
|
+
if (!base) return overlay || {};
|
|
11
|
+
if (!overlay) return base || {};
|
|
18
12
|
const result = {};
|
|
19
13
|
const allKeys = /* @__PURE__ */ new Set([...Object.keys(base), ...Object.keys(overlay)]);
|
|
20
14
|
for (const key of allKeys) {
|
|
@@ -141,8 +135,7 @@ function makeHeadlessInstanceComponent(preRender, componentDef, coordinateKey) {
|
|
|
141
135
|
} else {
|
|
142
136
|
compCore.render = () => {
|
|
143
137
|
const vs = { ...resolvedFastVS, ...originalRender() };
|
|
144
|
-
if (instanceData)
|
|
145
|
-
instanceData.viewStates[resolvedKey] = component.materializeViewState(vs);
|
|
138
|
+
if (instanceData) instanceData.viewStates[resolvedKey] = component.materializeViewState(vs);
|
|
146
139
|
return vs;
|
|
147
140
|
};
|
|
148
141
|
}
|
|
@@ -161,10 +154,8 @@ function makeCompositeJayComponent(preRender, defaultViewState, fastCarryForward
|
|
|
161
154
|
const hasFastRendering = defaultViewState !== null && defaultViewState !== void 0;
|
|
162
155
|
const headlessInstanceViewStates = defaultViewState?.__headlessInstances;
|
|
163
156
|
const headlessInstanceCarryForwards = fastCarryForward?.__headlessInstances;
|
|
164
|
-
if (headlessInstanceViewStates)
|
|
165
|
-
|
|
166
|
-
if (headlessInstanceCarryForwards)
|
|
167
|
-
delete fastCarryForward.__headlessInstances;
|
|
157
|
+
if (headlessInstanceViewStates) delete defaultViewState.__headlessInstances;
|
|
158
|
+
if (headlessInstanceCarryForwards) delete fastCarryForward.__headlessInstances;
|
|
168
159
|
const comp = (props, refs, ...contexts) => {
|
|
169
160
|
const componentContext = runtime.useContext(component.COMPONENT_CONTEXT);
|
|
170
161
|
const instancesData = {
|
|
@@ -239,10 +230,8 @@ function hydrateCompositeJayComponent(hydratePreRender, defaultViewState, fastCa
|
|
|
239
230
|
const hasFastRendering = defaultViewState !== null && defaultViewState !== void 0;
|
|
240
231
|
const headlessInstanceViewStates = defaultViewState?.__headlessInstances;
|
|
241
232
|
const headlessInstanceCarryForwards = fastCarryForward?.__headlessInstances;
|
|
242
|
-
if (headlessInstanceViewStates)
|
|
243
|
-
|
|
244
|
-
if (headlessInstanceCarryForwards)
|
|
245
|
-
delete fastCarryForward.__headlessInstances;
|
|
233
|
+
if (headlessInstanceViewStates) delete defaultViewState.__headlessInstances;
|
|
234
|
+
if (headlessInstanceCarryForwards) delete fastCarryForward.__headlessInstances;
|
|
246
235
|
const comp = (props, refs, ...contexts) => {
|
|
247
236
|
const componentContext = runtime.useContext(component.COMPONENT_CONTEXT);
|
|
248
237
|
const instancesData = {
|
|
@@ -333,10 +322,8 @@ function setActionCallerOptions(options) {
|
|
|
333
322
|
globalOptions = { ...globalOptions, ...options };
|
|
334
323
|
}
|
|
335
324
|
function isBlobLike(value) {
|
|
336
|
-
if (typeof value !== "object" || value === null)
|
|
337
|
-
|
|
338
|
-
if (typeof Blob !== "undefined" && value instanceof Blob)
|
|
339
|
-
return true;
|
|
325
|
+
if (typeof value !== "object" || value === null) return false;
|
|
326
|
+
if (typeof Blob !== "undefined" && value instanceof Blob) return true;
|
|
340
327
|
const b = value;
|
|
341
328
|
return typeof b.size === "number" && !Number.isNaN(b.size) && typeof b.arrayBuffer === "function" && typeof b.slice === "function";
|
|
342
329
|
}
|
|
@@ -344,19 +331,15 @@ function isPlainRecord(value) {
|
|
|
344
331
|
return typeof value === "object" && value !== null && !Array.isArray(value) && !isBlobLike(value);
|
|
345
332
|
}
|
|
346
333
|
function blobPartFilename(blob, fallback) {
|
|
347
|
-
if (typeof File !== "undefined" && blob instanceof File && blob.name)
|
|
348
|
-
return blob.name;
|
|
334
|
+
if (typeof File !== "undefined" && blob instanceof File && blob.name) return blob.name;
|
|
349
335
|
return fallback;
|
|
350
336
|
}
|
|
351
337
|
function isRecordOfBlobs(value) {
|
|
352
|
-
if (!isPlainRecord(value))
|
|
353
|
-
return false;
|
|
338
|
+
if (!isPlainRecord(value)) return false;
|
|
354
339
|
const vals = Object.values(value);
|
|
355
|
-
if (vals.length === 0)
|
|
356
|
-
return false;
|
|
340
|
+
if (vals.length === 0) return false;
|
|
357
341
|
for (const v of vals) {
|
|
358
|
-
if (!isBlobLike(v))
|
|
359
|
-
return false;
|
|
342
|
+
if (!isBlobLike(v)) return false;
|
|
360
343
|
}
|
|
361
344
|
return true;
|
|
362
345
|
}
|
|
@@ -395,15 +378,11 @@ function buildFormData(input) {
|
|
|
395
378
|
return formData;
|
|
396
379
|
}
|
|
397
380
|
function hasFiles(input) {
|
|
398
|
-
if (typeof input !== "object" || input === null)
|
|
399
|
-
return false;
|
|
381
|
+
if (typeof input !== "object" || input === null) return false;
|
|
400
382
|
for (const value of Object.values(input)) {
|
|
401
|
-
if (isBlobLike(value))
|
|
402
|
-
|
|
403
|
-
if (
|
|
404
|
-
return true;
|
|
405
|
-
if (isRecordOfBlobs(value))
|
|
406
|
-
return true;
|
|
383
|
+
if (isBlobLike(value)) return true;
|
|
384
|
+
if (Array.isArray(value) && value.some((v) => isBlobLike(v))) return true;
|
|
385
|
+
if (isRecordOfBlobs(value)) return true;
|
|
407
386
|
}
|
|
408
387
|
return false;
|
|
409
388
|
}
|
|
@@ -512,8 +491,7 @@ function createStreamCaller(actionName, options) {
|
|
|
512
491
|
"NETWORK_ERROR",
|
|
513
492
|
`Network error streaming '${actionName}': ${err.message}`
|
|
514
493
|
);
|
|
515
|
-
if (resolveNext)
|
|
516
|
-
resolveNext();
|
|
494
|
+
if (resolveNext) resolveNext();
|
|
517
495
|
});
|
|
518
496
|
const decoder = new TextDecoder();
|
|
519
497
|
function pump() {
|
|
@@ -523,39 +501,33 @@ function createStreamCaller(actionName, options) {
|
|
|
523
501
|
const lines = buffer.split("\n");
|
|
524
502
|
buffer = lines.pop();
|
|
525
503
|
for (const line of lines) {
|
|
526
|
-
if (!line.trim())
|
|
527
|
-
continue;
|
|
504
|
+
if (!line.trim()) continue;
|
|
528
505
|
const parsed = JSON.parse(line);
|
|
529
506
|
if (parsed.error) {
|
|
530
507
|
error = new ActionError("STREAM_ERROR", parsed.error);
|
|
531
|
-
if (resolveNext)
|
|
532
|
-
resolveNext();
|
|
508
|
+
if (resolveNext) resolveNext();
|
|
533
509
|
return;
|
|
534
510
|
}
|
|
535
511
|
if (parsed.done) {
|
|
536
512
|
done = true;
|
|
537
|
-
if (resolveNext)
|
|
538
|
-
resolveNext();
|
|
513
|
+
if (resolveNext) resolveNext();
|
|
539
514
|
return;
|
|
540
515
|
}
|
|
541
516
|
if ("chunk" in parsed) {
|
|
542
517
|
chunks.push(parsed.chunk);
|
|
543
|
-
if (resolveNext)
|
|
544
|
-
resolveNext();
|
|
518
|
+
if (resolveNext) resolveNext();
|
|
545
519
|
}
|
|
546
520
|
}
|
|
547
521
|
}
|
|
548
522
|
if (readerDone) {
|
|
549
523
|
done = true;
|
|
550
|
-
if (resolveNext)
|
|
551
|
-
resolveNext();
|
|
524
|
+
if (resolveNext) resolveNext();
|
|
552
525
|
return;
|
|
553
526
|
}
|
|
554
527
|
pump();
|
|
555
528
|
}).catch((err) => {
|
|
556
529
|
error = new ActionError("STREAM_ERROR", err.message);
|
|
557
|
-
if (resolveNext)
|
|
558
|
-
resolveNext();
|
|
530
|
+
if (resolveNext) resolveNext();
|
|
559
531
|
});
|
|
560
532
|
}
|
|
561
533
|
return {
|
|
@@ -598,17 +570,11 @@ function isSimpleObject(obj) {
|
|
|
598
570
|
}
|
|
599
571
|
var __defProp2 = Object.defineProperty;
|
|
600
572
|
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
601
|
-
var __publicField2 = (obj, key, value) =>
|
|
602
|
-
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
603
|
-
return value;
|
|
604
|
-
};
|
|
573
|
+
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
605
574
|
function deepMergeViewStates(base, overlay, trackByMap, path = "") {
|
|
606
|
-
if (!base && !overlay)
|
|
607
|
-
|
|
608
|
-
if (!base
|
|
609
|
-
return overlay || {};
|
|
610
|
-
if (!overlay)
|
|
611
|
-
return base || {};
|
|
575
|
+
if (!base && !overlay) return {};
|
|
576
|
+
if (!base) return overlay || {};
|
|
577
|
+
if (!overlay) return base || {};
|
|
612
578
|
const result = {};
|
|
613
579
|
const allKeys = /* @__PURE__ */ new Set([...Object.keys(base), ...Object.keys(overlay)]);
|
|
614
580
|
for (const key of allKeys) {
|
|
@@ -675,17 +641,14 @@ function mergeArraysByTrackBy(baseArray, overlayArray, trackByField, trackByMap,
|
|
|
675
641
|
}
|
|
676
642
|
function collectInteractions(refs) {
|
|
677
643
|
const interactions = [];
|
|
678
|
-
if (!refs)
|
|
679
|
-
return interactions;
|
|
644
|
+
if (!refs) return interactions;
|
|
680
645
|
collectInteractionsRecursive(refs, interactions);
|
|
681
646
|
return interactions;
|
|
682
647
|
}
|
|
683
648
|
function collectInteractionsRecursive(refs, interactions) {
|
|
684
|
-
if (!refs)
|
|
685
|
-
return;
|
|
649
|
+
if (!refs) return;
|
|
686
650
|
for (const [refName, refImpl] of Object.entries(refs)) {
|
|
687
|
-
if (!refImpl)
|
|
688
|
-
continue;
|
|
651
|
+
if (!refImpl) continue;
|
|
689
652
|
if (refImpl.elements && refImpl.elements instanceof Set) {
|
|
690
653
|
for (const elem of refImpl.elements) {
|
|
691
654
|
if (elem.element && !isDisabled(elem.element)) {
|
|
@@ -704,13 +667,10 @@ function collectInteractionsRecursive(refs, interactions) {
|
|
|
704
667
|
}
|
|
705
668
|
}
|
|
706
669
|
function isNestedRefsObject(obj) {
|
|
707
|
-
if (!obj || typeof obj !== "object")
|
|
708
|
-
|
|
709
|
-
if (obj.elements instanceof Set)
|
|
710
|
-
return false;
|
|
670
|
+
if (!obj || typeof obj !== "object") return false;
|
|
671
|
+
if (obj.elements instanceof Set) return false;
|
|
711
672
|
const proto = Object.getPrototypeOf(obj);
|
|
712
|
-
if (proto !== Object.prototype && proto !== null)
|
|
713
|
-
return false;
|
|
673
|
+
if (proto !== Object.prototype && proto !== null) return false;
|
|
714
674
|
return true;
|
|
715
675
|
}
|
|
716
676
|
function isDisabled(element) {
|
|
@@ -802,8 +762,7 @@ class AutomationAgent {
|
|
|
802
762
|
this.component.addEventListener(VIEW_STATE_CHANGE, this.viewStateHandler);
|
|
803
763
|
}
|
|
804
764
|
notifyListeners() {
|
|
805
|
-
if (this.stateListeners.size === 0)
|
|
806
|
-
return;
|
|
765
|
+
if (this.stateListeners.size === 0) return;
|
|
807
766
|
const state = this.getPageState();
|
|
808
767
|
this.stateListeners.forEach((callback) => callback(state));
|
|
809
768
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) =>
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
4
|
import { makeJayComponent, createSignal, materializeViewState, COMPONENT_CONTEXT } from "@jay-framework/component";
|
|
8
5
|
import { createJayContext, useContext, currentConstructionContext } from "@jay-framework/runtime";
|
|
9
6
|
function deepMergeViewStates$1(base, overlay, trackByMap, path = "") {
|
|
10
|
-
if (!base && !overlay)
|
|
11
|
-
|
|
12
|
-
if (!base
|
|
13
|
-
return overlay || {};
|
|
14
|
-
if (!overlay)
|
|
15
|
-
return base || {};
|
|
7
|
+
if (!base && !overlay) return {};
|
|
8
|
+
if (!base) return overlay || {};
|
|
9
|
+
if (!overlay) return base || {};
|
|
16
10
|
const result = {};
|
|
17
11
|
const allKeys = /* @__PURE__ */ new Set([...Object.keys(base), ...Object.keys(overlay)]);
|
|
18
12
|
for (const key of allKeys) {
|
|
@@ -139,8 +133,7 @@ function makeHeadlessInstanceComponent(preRender, componentDef, coordinateKey) {
|
|
|
139
133
|
} else {
|
|
140
134
|
compCore.render = () => {
|
|
141
135
|
const vs = { ...resolvedFastVS, ...originalRender() };
|
|
142
|
-
if (instanceData)
|
|
143
|
-
instanceData.viewStates[resolvedKey] = materializeViewState(vs);
|
|
136
|
+
if (instanceData) instanceData.viewStates[resolvedKey] = materializeViewState(vs);
|
|
144
137
|
return vs;
|
|
145
138
|
};
|
|
146
139
|
}
|
|
@@ -159,10 +152,8 @@ function makeCompositeJayComponent(preRender, defaultViewState, fastCarryForward
|
|
|
159
152
|
const hasFastRendering = defaultViewState !== null && defaultViewState !== void 0;
|
|
160
153
|
const headlessInstanceViewStates = defaultViewState?.__headlessInstances;
|
|
161
154
|
const headlessInstanceCarryForwards = fastCarryForward?.__headlessInstances;
|
|
162
|
-
if (headlessInstanceViewStates)
|
|
163
|
-
|
|
164
|
-
if (headlessInstanceCarryForwards)
|
|
165
|
-
delete fastCarryForward.__headlessInstances;
|
|
155
|
+
if (headlessInstanceViewStates) delete defaultViewState.__headlessInstances;
|
|
156
|
+
if (headlessInstanceCarryForwards) delete fastCarryForward.__headlessInstances;
|
|
166
157
|
const comp = (props, refs, ...contexts) => {
|
|
167
158
|
const componentContext = useContext(COMPONENT_CONTEXT);
|
|
168
159
|
const instancesData = {
|
|
@@ -237,10 +228,8 @@ function hydrateCompositeJayComponent(hydratePreRender, defaultViewState, fastCa
|
|
|
237
228
|
const hasFastRendering = defaultViewState !== null && defaultViewState !== void 0;
|
|
238
229
|
const headlessInstanceViewStates = defaultViewState?.__headlessInstances;
|
|
239
230
|
const headlessInstanceCarryForwards = fastCarryForward?.__headlessInstances;
|
|
240
|
-
if (headlessInstanceViewStates)
|
|
241
|
-
|
|
242
|
-
if (headlessInstanceCarryForwards)
|
|
243
|
-
delete fastCarryForward.__headlessInstances;
|
|
231
|
+
if (headlessInstanceViewStates) delete defaultViewState.__headlessInstances;
|
|
232
|
+
if (headlessInstanceCarryForwards) delete fastCarryForward.__headlessInstances;
|
|
244
233
|
const comp = (props, refs, ...contexts) => {
|
|
245
234
|
const componentContext = useContext(COMPONENT_CONTEXT);
|
|
246
235
|
const instancesData = {
|
|
@@ -331,10 +320,8 @@ function setActionCallerOptions(options) {
|
|
|
331
320
|
globalOptions = { ...globalOptions, ...options };
|
|
332
321
|
}
|
|
333
322
|
function isBlobLike(value) {
|
|
334
|
-
if (typeof value !== "object" || value === null)
|
|
335
|
-
|
|
336
|
-
if (typeof Blob !== "undefined" && value instanceof Blob)
|
|
337
|
-
return true;
|
|
323
|
+
if (typeof value !== "object" || value === null) return false;
|
|
324
|
+
if (typeof Blob !== "undefined" && value instanceof Blob) return true;
|
|
338
325
|
const b = value;
|
|
339
326
|
return typeof b.size === "number" && !Number.isNaN(b.size) && typeof b.arrayBuffer === "function" && typeof b.slice === "function";
|
|
340
327
|
}
|
|
@@ -342,19 +329,15 @@ function isPlainRecord(value) {
|
|
|
342
329
|
return typeof value === "object" && value !== null && !Array.isArray(value) && !isBlobLike(value);
|
|
343
330
|
}
|
|
344
331
|
function blobPartFilename(blob, fallback) {
|
|
345
|
-
if (typeof File !== "undefined" && blob instanceof File && blob.name)
|
|
346
|
-
return blob.name;
|
|
332
|
+
if (typeof File !== "undefined" && blob instanceof File && blob.name) return blob.name;
|
|
347
333
|
return fallback;
|
|
348
334
|
}
|
|
349
335
|
function isRecordOfBlobs(value) {
|
|
350
|
-
if (!isPlainRecord(value))
|
|
351
|
-
return false;
|
|
336
|
+
if (!isPlainRecord(value)) return false;
|
|
352
337
|
const vals = Object.values(value);
|
|
353
|
-
if (vals.length === 0)
|
|
354
|
-
return false;
|
|
338
|
+
if (vals.length === 0) return false;
|
|
355
339
|
for (const v of vals) {
|
|
356
|
-
if (!isBlobLike(v))
|
|
357
|
-
return false;
|
|
340
|
+
if (!isBlobLike(v)) return false;
|
|
358
341
|
}
|
|
359
342
|
return true;
|
|
360
343
|
}
|
|
@@ -393,15 +376,11 @@ function buildFormData(input) {
|
|
|
393
376
|
return formData;
|
|
394
377
|
}
|
|
395
378
|
function hasFiles(input) {
|
|
396
|
-
if (typeof input !== "object" || input === null)
|
|
397
|
-
return false;
|
|
379
|
+
if (typeof input !== "object" || input === null) return false;
|
|
398
380
|
for (const value of Object.values(input)) {
|
|
399
|
-
if (isBlobLike(value))
|
|
400
|
-
|
|
401
|
-
if (
|
|
402
|
-
return true;
|
|
403
|
-
if (isRecordOfBlobs(value))
|
|
404
|
-
return true;
|
|
381
|
+
if (isBlobLike(value)) return true;
|
|
382
|
+
if (Array.isArray(value) && value.some((v) => isBlobLike(v))) return true;
|
|
383
|
+
if (isRecordOfBlobs(value)) return true;
|
|
405
384
|
}
|
|
406
385
|
return false;
|
|
407
386
|
}
|
|
@@ -510,8 +489,7 @@ function createStreamCaller(actionName, options) {
|
|
|
510
489
|
"NETWORK_ERROR",
|
|
511
490
|
`Network error streaming '${actionName}': ${err.message}`
|
|
512
491
|
);
|
|
513
|
-
if (resolveNext)
|
|
514
|
-
resolveNext();
|
|
492
|
+
if (resolveNext) resolveNext();
|
|
515
493
|
});
|
|
516
494
|
const decoder = new TextDecoder();
|
|
517
495
|
function pump() {
|
|
@@ -521,39 +499,33 @@ function createStreamCaller(actionName, options) {
|
|
|
521
499
|
const lines = buffer.split("\n");
|
|
522
500
|
buffer = lines.pop();
|
|
523
501
|
for (const line of lines) {
|
|
524
|
-
if (!line.trim())
|
|
525
|
-
continue;
|
|
502
|
+
if (!line.trim()) continue;
|
|
526
503
|
const parsed = JSON.parse(line);
|
|
527
504
|
if (parsed.error) {
|
|
528
505
|
error = new ActionError("STREAM_ERROR", parsed.error);
|
|
529
|
-
if (resolveNext)
|
|
530
|
-
resolveNext();
|
|
506
|
+
if (resolveNext) resolveNext();
|
|
531
507
|
return;
|
|
532
508
|
}
|
|
533
509
|
if (parsed.done) {
|
|
534
510
|
done = true;
|
|
535
|
-
if (resolveNext)
|
|
536
|
-
resolveNext();
|
|
511
|
+
if (resolveNext) resolveNext();
|
|
537
512
|
return;
|
|
538
513
|
}
|
|
539
514
|
if ("chunk" in parsed) {
|
|
540
515
|
chunks.push(parsed.chunk);
|
|
541
|
-
if (resolveNext)
|
|
542
|
-
resolveNext();
|
|
516
|
+
if (resolveNext) resolveNext();
|
|
543
517
|
}
|
|
544
518
|
}
|
|
545
519
|
}
|
|
546
520
|
if (readerDone) {
|
|
547
521
|
done = true;
|
|
548
|
-
if (resolveNext)
|
|
549
|
-
resolveNext();
|
|
522
|
+
if (resolveNext) resolveNext();
|
|
550
523
|
return;
|
|
551
524
|
}
|
|
552
525
|
pump();
|
|
553
526
|
}).catch((err) => {
|
|
554
527
|
error = new ActionError("STREAM_ERROR", err.message);
|
|
555
|
-
if (resolveNext)
|
|
556
|
-
resolveNext();
|
|
528
|
+
if (resolveNext) resolveNext();
|
|
557
529
|
});
|
|
558
530
|
}
|
|
559
531
|
return {
|
|
@@ -596,17 +568,11 @@ function isSimpleObject(obj) {
|
|
|
596
568
|
}
|
|
597
569
|
var __defProp2 = Object.defineProperty;
|
|
598
570
|
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
599
|
-
var __publicField2 = (obj, key, value) =>
|
|
600
|
-
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
601
|
-
return value;
|
|
602
|
-
};
|
|
571
|
+
var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
603
572
|
function deepMergeViewStates(base, overlay, trackByMap, path = "") {
|
|
604
|
-
if (!base && !overlay)
|
|
605
|
-
|
|
606
|
-
if (!base
|
|
607
|
-
return overlay || {};
|
|
608
|
-
if (!overlay)
|
|
609
|
-
return base || {};
|
|
573
|
+
if (!base && !overlay) return {};
|
|
574
|
+
if (!base) return overlay || {};
|
|
575
|
+
if (!overlay) return base || {};
|
|
610
576
|
const result = {};
|
|
611
577
|
const allKeys = /* @__PURE__ */ new Set([...Object.keys(base), ...Object.keys(overlay)]);
|
|
612
578
|
for (const key of allKeys) {
|
|
@@ -673,17 +639,14 @@ function mergeArraysByTrackBy(baseArray, overlayArray, trackByField, trackByMap,
|
|
|
673
639
|
}
|
|
674
640
|
function collectInteractions(refs) {
|
|
675
641
|
const interactions = [];
|
|
676
|
-
if (!refs)
|
|
677
|
-
return interactions;
|
|
642
|
+
if (!refs) return interactions;
|
|
678
643
|
collectInteractionsRecursive(refs, interactions);
|
|
679
644
|
return interactions;
|
|
680
645
|
}
|
|
681
646
|
function collectInteractionsRecursive(refs, interactions) {
|
|
682
|
-
if (!refs)
|
|
683
|
-
return;
|
|
647
|
+
if (!refs) return;
|
|
684
648
|
for (const [refName, refImpl] of Object.entries(refs)) {
|
|
685
|
-
if (!refImpl)
|
|
686
|
-
continue;
|
|
649
|
+
if (!refImpl) continue;
|
|
687
650
|
if (refImpl.elements && refImpl.elements instanceof Set) {
|
|
688
651
|
for (const elem of refImpl.elements) {
|
|
689
652
|
if (elem.element && !isDisabled(elem.element)) {
|
|
@@ -702,13 +665,10 @@ function collectInteractionsRecursive(refs, interactions) {
|
|
|
702
665
|
}
|
|
703
666
|
}
|
|
704
667
|
function isNestedRefsObject(obj) {
|
|
705
|
-
if (!obj || typeof obj !== "object")
|
|
706
|
-
|
|
707
|
-
if (obj.elements instanceof Set)
|
|
708
|
-
return false;
|
|
668
|
+
if (!obj || typeof obj !== "object") return false;
|
|
669
|
+
if (obj.elements instanceof Set) return false;
|
|
709
670
|
const proto = Object.getPrototypeOf(obj);
|
|
710
|
-
if (proto !== Object.prototype && proto !== null)
|
|
711
|
-
return false;
|
|
671
|
+
if (proto !== Object.prototype && proto !== null) return false;
|
|
712
672
|
return true;
|
|
713
673
|
}
|
|
714
674
|
function isDisabled(element) {
|
|
@@ -800,8 +760,7 @@ class AutomationAgent {
|
|
|
800
760
|
this.component.addEventListener(VIEW_STATE_CHANGE, this.viewStateHandler);
|
|
801
761
|
}
|
|
802
762
|
notifyListeners() {
|
|
803
|
-
if (this.stateListeners.size === 0)
|
|
804
|
-
return;
|
|
763
|
+
if (this.stateListeners.size === 0) return;
|
|
805
764
|
const state = this.getPageState();
|
|
806
765
|
this.stateListeners.forEach((callback) => callback(state));
|
|
807
766
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/stack-client-runtime",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"test:watch": "vitest"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@jay-framework/component": "^0.23.
|
|
31
|
-
"@jay-framework/fullstack-component": "^0.23.
|
|
32
|
-
"@jay-framework/runtime": "^0.23.
|
|
33
|
-
"@jay-framework/runtime-automation": "^0.23.
|
|
34
|
-
"@jay-framework/view-state-merge": "^0.23.
|
|
30
|
+
"@jay-framework/component": "^0.23.1",
|
|
31
|
+
"@jay-framework/fullstack-component": "^0.23.1",
|
|
32
|
+
"@jay-framework/runtime": "^0.23.1",
|
|
33
|
+
"@jay-framework/runtime-automation": "^0.23.1",
|
|
34
|
+
"@jay-framework/view-state-merge": "^0.23.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@jay-framework/dev-environment": "^0.23.
|
|
38
|
-
"@jay-framework/jay-cli": "^0.23.
|
|
37
|
+
"@jay-framework/dev-environment": "^0.23.1",
|
|
38
|
+
"@jay-framework/jay-cli": "^0.23.1",
|
|
39
39
|
"@types/express": "^5.0.2",
|
|
40
40
|
"@types/node": "^22.15.21",
|
|
41
41
|
"nodemon": "^3.0.3",
|