@valbuild/react 0.41.0 → 0.42.0
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/{ValProvider-396d7da7.cjs.dev.js → ValProvider-387a3070.cjs.dev.js} +46 -23
- package/dist/{ValProvider-05e0ada2.esm.js → ValProvider-52a0ce49.esm.js} +46 -23
- package/dist/ValProvider-8d8e3678.cjs.js +7 -0
- package/dist/{ValProvider-d9e0b778.cjs.prod.js → ValProvider-8d8e3678.cjs.prod.js} +46 -23
- package/dist/{ValProvider-9be9362b.browser.esm.js → ValProvider-9a2431d9.browser.esm.js} +46 -23
- package/dist/{ValProvider-e745414d.worker.esm.js → ValProvider-e21d3e7d.worker.esm.js} +46 -23
- package/dist/ValUI-0f2e6b7d.cjs.js +7 -0
- package/dist/{ValUI-41cd1ce0.cjs.prod.js → ValUI-0f2e6b7d.cjs.prod.js} +2 -2
- package/dist/{ValUI-400cffb5.worker.esm.js → ValUI-3fac1b71.worker.esm.js} +2 -2
- package/dist/{ValUI-053ef45d.browser.esm.js → ValUI-4d8bf402.browser.esm.js} +2 -2
- package/dist/{ValUI-0091169b.esm.js → ValUI-d0e6ed41.esm.js} +2 -2
- package/dist/{ValUI-3a6c5666.cjs.dev.js → ValUI-ec9857f2.cjs.dev.js} +2 -2
- package/dist/declarations/src/internal/ValStore.d.ts +1 -0
- package/internal/dist/valbuild-react-internal.browser.esm.js +1 -1
- package/internal/dist/valbuild-react-internal.cjs.dev.js +1 -1
- package/internal/dist/valbuild-react-internal.cjs.prod.js +1 -1
- package/internal/dist/valbuild-react-internal.esm.js +1 -1
- package/internal/dist/valbuild-react-internal.worker.esm.js +1 -1
- package/package.json +4 -4
- package/dist/ValProvider-d9e0b778.cjs.js +0 -7
- package/dist/ValUI-41cd1ce0.cjs.js +0 -7
@@ -478,21 +478,23 @@ var ValStore = /*#__PURE__*/function () {
|
|
478
478
|
this.subscribers = new Map();
|
479
479
|
this.listeners = {};
|
480
480
|
}
|
481
|
-
|
482
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
483
481
|
_createClass(ValStore, [{
|
484
482
|
key: "update",
|
485
483
|
value: function () {
|
486
484
|
var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(moduleIds) {
|
485
|
+
var _this2 = this;
|
487
486
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
488
487
|
while (1) switch (_context.prev = _context.next) {
|
489
488
|
case 0:
|
490
|
-
|
491
|
-
|
489
|
+
_context.next = 2;
|
490
|
+
return Promise.all(moduleIds.map(function (moduleId) {
|
491
|
+
return _this2.updateTree(moduleId);
|
492
|
+
}));
|
493
|
+
case 2:
|
492
494
|
case "end":
|
493
495
|
return _context.stop();
|
494
496
|
}
|
495
|
-
}, _callee
|
497
|
+
}, _callee);
|
496
498
|
}));
|
497
499
|
function update(_x) {
|
498
500
|
return _update.apply(this, arguments);
|
@@ -503,27 +505,48 @@ var ValStore = /*#__PURE__*/function () {
|
|
503
505
|
key: "updateAll",
|
504
506
|
value: function () {
|
505
507
|
var _updateAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
508
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
509
|
+
while (1) switch (_context2.prev = _context2.next) {
|
510
|
+
case 0:
|
511
|
+
_context2.next = 2;
|
512
|
+
return this.updateTree();
|
513
|
+
case 2:
|
514
|
+
case "end":
|
515
|
+
return _context2.stop();
|
516
|
+
}
|
517
|
+
}, _callee2, this);
|
518
|
+
}));
|
519
|
+
function updateAll() {
|
520
|
+
return _updateAll.apply(this, arguments);
|
521
|
+
}
|
522
|
+
return updateAll;
|
523
|
+
}()
|
524
|
+
}, {
|
525
|
+
key: "updateTree",
|
526
|
+
value: function () {
|
527
|
+
var _updateTree = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(treePath) {
|
506
528
|
var data, updatedSubscriberIds, subscriberIds, _loop, _i, _arr, _i2, _Array$from, _Array$from$_i, updatedSubscriberId, moduleIds, subscriberModules;
|
507
|
-
return _regeneratorRuntime().wrap(function
|
508
|
-
while (1) switch (
|
529
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context4) {
|
530
|
+
while (1) switch (_context4.prev = _context4.next) {
|
509
531
|
case 0:
|
510
|
-
|
532
|
+
_context4.next = 2;
|
511
533
|
return this.api.getTree({
|
534
|
+
treePath: treePath,
|
512
535
|
patch: true,
|
513
536
|
includeSource: true
|
514
537
|
});
|
515
538
|
case 2:
|
516
|
-
data =
|
539
|
+
data = _context4.sent;
|
517
540
|
if (!fp.result.isOk(data)) {
|
518
|
-
|
541
|
+
_context4.next = 16;
|
519
542
|
break;
|
520
543
|
}
|
521
544
|
updatedSubscriberIds = new Map();
|
522
545
|
subscriberIds = Array.from(this.subscribers.keys()); // Figure out which modules have been updated and map to updated subscribed id
|
523
546
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
524
547
|
var moduleId, source, updatedSubscriberId;
|
525
|
-
return _regeneratorRuntime().wrap(function _loop$(
|
526
|
-
while (1) switch (
|
548
|
+
return _regeneratorRuntime().wrap(function _loop$(_context3) {
|
549
|
+
while (1) switch (_context3.prev = _context3.next) {
|
527
550
|
case 0:
|
528
551
|
moduleId = _arr[_i];
|
529
552
|
source = data.value.modules[moduleId].source;
|
@@ -539,20 +562,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
539
562
|
}
|
540
563
|
case 3:
|
541
564
|
case "end":
|
542
|
-
return
|
565
|
+
return _context3.stop();
|
543
566
|
}
|
544
567
|
}, _loop);
|
545
568
|
});
|
546
569
|
_i = 0, _arr = Object.keys(data.value.modules);
|
547
570
|
case 8:
|
548
571
|
if (!(_i < _arr.length)) {
|
549
|
-
|
572
|
+
_context4.next = 13;
|
550
573
|
break;
|
551
574
|
}
|
552
|
-
return
|
575
|
+
return _context4.delegateYield(_loop(), "t0", 10);
|
553
576
|
case 10:
|
554
577
|
_i++;
|
555
|
-
|
578
|
+
_context4.next = 8;
|
556
579
|
break;
|
557
580
|
case 13:
|
558
581
|
// For all updated subscribers: set new module data and emit change
|
@@ -568,20 +591,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
568
591
|
this.subscribers.set(updatedSubscriberId, subscriberModules);
|
569
592
|
this.emitChange(updatedSubscriberId);
|
570
593
|
}
|
571
|
-
|
594
|
+
_context4.next = 17;
|
572
595
|
break;
|
573
596
|
case 16:
|
574
597
|
console.error("Val: failed to update modules", data.error);
|
575
598
|
case 17:
|
576
599
|
case "end":
|
577
|
-
return
|
600
|
+
return _context4.stop();
|
578
601
|
}
|
579
|
-
},
|
602
|
+
}, _callee3, this);
|
580
603
|
}));
|
581
|
-
function
|
582
|
-
return
|
604
|
+
function updateTree(_x2) {
|
605
|
+
return _updateTree.apply(this, arguments);
|
583
606
|
}
|
584
|
-
return
|
607
|
+
return updateTree;
|
585
608
|
}()
|
586
609
|
}, {
|
587
610
|
key: "emitChange",
|
@@ -623,7 +646,7 @@ var ValContext = typeof window !== "undefined" ? /*#__PURE__*/React__default["de
|
|
623
646
|
valApi: undefined
|
624
647
|
}) : undefined;
|
625
648
|
var ValUI = /*#__PURE__*/React.lazy(function () {
|
626
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./ValUI-
|
649
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./ValUI-ec9857f2.cjs.dev.js')); });
|
627
650
|
});
|
628
651
|
function ValProvider(_ref) {
|
629
652
|
var children = _ref.children,
|
@@ -452,21 +452,23 @@ var ValStore = /*#__PURE__*/function () {
|
|
452
452
|
this.subscribers = new Map();
|
453
453
|
this.listeners = {};
|
454
454
|
}
|
455
|
-
|
456
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
457
455
|
_createClass(ValStore, [{
|
458
456
|
key: "update",
|
459
457
|
value: function () {
|
460
458
|
var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(moduleIds) {
|
459
|
+
var _this2 = this;
|
461
460
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
462
461
|
while (1) switch (_context.prev = _context.next) {
|
463
462
|
case 0:
|
464
|
-
|
465
|
-
|
463
|
+
_context.next = 2;
|
464
|
+
return Promise.all(moduleIds.map(function (moduleId) {
|
465
|
+
return _this2.updateTree(moduleId);
|
466
|
+
}));
|
467
|
+
case 2:
|
466
468
|
case "end":
|
467
469
|
return _context.stop();
|
468
470
|
}
|
469
|
-
}, _callee
|
471
|
+
}, _callee);
|
470
472
|
}));
|
471
473
|
function update(_x) {
|
472
474
|
return _update.apply(this, arguments);
|
@@ -477,27 +479,48 @@ var ValStore = /*#__PURE__*/function () {
|
|
477
479
|
key: "updateAll",
|
478
480
|
value: function () {
|
479
481
|
var _updateAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
482
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
483
|
+
while (1) switch (_context2.prev = _context2.next) {
|
484
|
+
case 0:
|
485
|
+
_context2.next = 2;
|
486
|
+
return this.updateTree();
|
487
|
+
case 2:
|
488
|
+
case "end":
|
489
|
+
return _context2.stop();
|
490
|
+
}
|
491
|
+
}, _callee2, this);
|
492
|
+
}));
|
493
|
+
function updateAll() {
|
494
|
+
return _updateAll.apply(this, arguments);
|
495
|
+
}
|
496
|
+
return updateAll;
|
497
|
+
}()
|
498
|
+
}, {
|
499
|
+
key: "updateTree",
|
500
|
+
value: function () {
|
501
|
+
var _updateTree = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(treePath) {
|
480
502
|
var data, updatedSubscriberIds, subscriberIds, _loop, _i, _arr, _i2, _Array$from, _Array$from$_i, updatedSubscriberId, moduleIds, subscriberModules;
|
481
|
-
return _regeneratorRuntime().wrap(function
|
482
|
-
while (1) switch (
|
503
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context4) {
|
504
|
+
while (1) switch (_context4.prev = _context4.next) {
|
483
505
|
case 0:
|
484
|
-
|
506
|
+
_context4.next = 2;
|
485
507
|
return this.api.getTree({
|
508
|
+
treePath: treePath,
|
486
509
|
patch: true,
|
487
510
|
includeSource: true
|
488
511
|
});
|
489
512
|
case 2:
|
490
|
-
data =
|
513
|
+
data = _context4.sent;
|
491
514
|
if (!result.isOk(data)) {
|
492
|
-
|
515
|
+
_context4.next = 16;
|
493
516
|
break;
|
494
517
|
}
|
495
518
|
updatedSubscriberIds = new Map();
|
496
519
|
subscriberIds = Array.from(this.subscribers.keys()); // Figure out which modules have been updated and map to updated subscribed id
|
497
520
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
498
521
|
var moduleId, source, updatedSubscriberId;
|
499
|
-
return _regeneratorRuntime().wrap(function _loop$(
|
500
|
-
while (1) switch (
|
522
|
+
return _regeneratorRuntime().wrap(function _loop$(_context3) {
|
523
|
+
while (1) switch (_context3.prev = _context3.next) {
|
501
524
|
case 0:
|
502
525
|
moduleId = _arr[_i];
|
503
526
|
source = data.value.modules[moduleId].source;
|
@@ -513,20 +536,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
513
536
|
}
|
514
537
|
case 3:
|
515
538
|
case "end":
|
516
|
-
return
|
539
|
+
return _context3.stop();
|
517
540
|
}
|
518
541
|
}, _loop);
|
519
542
|
});
|
520
543
|
_i = 0, _arr = Object.keys(data.value.modules);
|
521
544
|
case 8:
|
522
545
|
if (!(_i < _arr.length)) {
|
523
|
-
|
546
|
+
_context4.next = 13;
|
524
547
|
break;
|
525
548
|
}
|
526
|
-
return
|
549
|
+
return _context4.delegateYield(_loop(), "t0", 10);
|
527
550
|
case 10:
|
528
551
|
_i++;
|
529
|
-
|
552
|
+
_context4.next = 8;
|
530
553
|
break;
|
531
554
|
case 13:
|
532
555
|
// For all updated subscribers: set new module data and emit change
|
@@ -542,20 +565,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
542
565
|
this.subscribers.set(updatedSubscriberId, subscriberModules);
|
543
566
|
this.emitChange(updatedSubscriberId);
|
544
567
|
}
|
545
|
-
|
568
|
+
_context4.next = 17;
|
546
569
|
break;
|
547
570
|
case 16:
|
548
571
|
console.error("Val: failed to update modules", data.error);
|
549
572
|
case 17:
|
550
573
|
case "end":
|
551
|
-
return
|
574
|
+
return _context4.stop();
|
552
575
|
}
|
553
|
-
},
|
576
|
+
}, _callee3, this);
|
554
577
|
}));
|
555
|
-
function
|
556
|
-
return
|
578
|
+
function updateTree(_x2) {
|
579
|
+
return _updateTree.apply(this, arguments);
|
557
580
|
}
|
558
|
-
return
|
581
|
+
return updateTree;
|
559
582
|
}()
|
560
583
|
}, {
|
561
584
|
key: "emitChange",
|
@@ -597,7 +620,7 @@ var ValContext = typeof window !== "undefined" ? /*#__PURE__*/React.createContex
|
|
597
620
|
valApi: undefined
|
598
621
|
}) : undefined;
|
599
622
|
var ValUI = /*#__PURE__*/lazy(function () {
|
600
|
-
return import('./ValUI-
|
623
|
+
return import('./ValUI-d0e6ed41.esm.js');
|
601
624
|
});
|
602
625
|
function ValProvider(_ref) {
|
603
626
|
var children = _ref.children,
|
@@ -478,21 +478,23 @@ var ValStore = /*#__PURE__*/function () {
|
|
478
478
|
this.subscribers = new Map();
|
479
479
|
this.listeners = {};
|
480
480
|
}
|
481
|
-
|
482
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
483
481
|
_createClass(ValStore, [{
|
484
482
|
key: "update",
|
485
483
|
value: function () {
|
486
484
|
var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(moduleIds) {
|
485
|
+
var _this2 = this;
|
487
486
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
488
487
|
while (1) switch (_context.prev = _context.next) {
|
489
488
|
case 0:
|
490
|
-
|
491
|
-
|
489
|
+
_context.next = 2;
|
490
|
+
return Promise.all(moduleIds.map(function (moduleId) {
|
491
|
+
return _this2.updateTree(moduleId);
|
492
|
+
}));
|
493
|
+
case 2:
|
492
494
|
case "end":
|
493
495
|
return _context.stop();
|
494
496
|
}
|
495
|
-
}, _callee
|
497
|
+
}, _callee);
|
496
498
|
}));
|
497
499
|
function update(_x) {
|
498
500
|
return _update.apply(this, arguments);
|
@@ -503,27 +505,48 @@ var ValStore = /*#__PURE__*/function () {
|
|
503
505
|
key: "updateAll",
|
504
506
|
value: function () {
|
505
507
|
var _updateAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
508
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
509
|
+
while (1) switch (_context2.prev = _context2.next) {
|
510
|
+
case 0:
|
511
|
+
_context2.next = 2;
|
512
|
+
return this.updateTree();
|
513
|
+
case 2:
|
514
|
+
case "end":
|
515
|
+
return _context2.stop();
|
516
|
+
}
|
517
|
+
}, _callee2, this);
|
518
|
+
}));
|
519
|
+
function updateAll() {
|
520
|
+
return _updateAll.apply(this, arguments);
|
521
|
+
}
|
522
|
+
return updateAll;
|
523
|
+
}()
|
524
|
+
}, {
|
525
|
+
key: "updateTree",
|
526
|
+
value: function () {
|
527
|
+
var _updateTree = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(treePath) {
|
506
528
|
var data, updatedSubscriberIds, subscriberIds, _loop, _i, _arr, _i2, _Array$from, _Array$from$_i, updatedSubscriberId, moduleIds, subscriberModules;
|
507
|
-
return _regeneratorRuntime().wrap(function
|
508
|
-
while (1) switch (
|
529
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context4) {
|
530
|
+
while (1) switch (_context4.prev = _context4.next) {
|
509
531
|
case 0:
|
510
|
-
|
532
|
+
_context4.next = 2;
|
511
533
|
return this.api.getTree({
|
534
|
+
treePath: treePath,
|
512
535
|
patch: true,
|
513
536
|
includeSource: true
|
514
537
|
});
|
515
538
|
case 2:
|
516
|
-
data =
|
539
|
+
data = _context4.sent;
|
517
540
|
if (!fp.result.isOk(data)) {
|
518
|
-
|
541
|
+
_context4.next = 16;
|
519
542
|
break;
|
520
543
|
}
|
521
544
|
updatedSubscriberIds = new Map();
|
522
545
|
subscriberIds = Array.from(this.subscribers.keys()); // Figure out which modules have been updated and map to updated subscribed id
|
523
546
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
524
547
|
var moduleId, source, updatedSubscriberId;
|
525
|
-
return _regeneratorRuntime().wrap(function _loop$(
|
526
|
-
while (1) switch (
|
548
|
+
return _regeneratorRuntime().wrap(function _loop$(_context3) {
|
549
|
+
while (1) switch (_context3.prev = _context3.next) {
|
527
550
|
case 0:
|
528
551
|
moduleId = _arr[_i];
|
529
552
|
source = data.value.modules[moduleId].source;
|
@@ -539,20 +562,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
539
562
|
}
|
540
563
|
case 3:
|
541
564
|
case "end":
|
542
|
-
return
|
565
|
+
return _context3.stop();
|
543
566
|
}
|
544
567
|
}, _loop);
|
545
568
|
});
|
546
569
|
_i = 0, _arr = Object.keys(data.value.modules);
|
547
570
|
case 8:
|
548
571
|
if (!(_i < _arr.length)) {
|
549
|
-
|
572
|
+
_context4.next = 13;
|
550
573
|
break;
|
551
574
|
}
|
552
|
-
return
|
575
|
+
return _context4.delegateYield(_loop(), "t0", 10);
|
553
576
|
case 10:
|
554
577
|
_i++;
|
555
|
-
|
578
|
+
_context4.next = 8;
|
556
579
|
break;
|
557
580
|
case 13:
|
558
581
|
// For all updated subscribers: set new module data and emit change
|
@@ -568,20 +591,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
568
591
|
this.subscribers.set(updatedSubscriberId, subscriberModules);
|
569
592
|
this.emitChange(updatedSubscriberId);
|
570
593
|
}
|
571
|
-
|
594
|
+
_context4.next = 17;
|
572
595
|
break;
|
573
596
|
case 16:
|
574
597
|
console.error("Val: failed to update modules", data.error);
|
575
598
|
case 17:
|
576
599
|
case "end":
|
577
|
-
return
|
600
|
+
return _context4.stop();
|
578
601
|
}
|
579
|
-
},
|
602
|
+
}, _callee3, this);
|
580
603
|
}));
|
581
|
-
function
|
582
|
-
return
|
604
|
+
function updateTree(_x2) {
|
605
|
+
return _updateTree.apply(this, arguments);
|
583
606
|
}
|
584
|
-
return
|
607
|
+
return updateTree;
|
585
608
|
}()
|
586
609
|
}, {
|
587
610
|
key: "emitChange",
|
@@ -623,7 +646,7 @@ var ValContext = typeof window !== "undefined" ? /*#__PURE__*/React__default["de
|
|
623
646
|
valApi: undefined
|
624
647
|
}) : undefined;
|
625
648
|
var ValUI = /*#__PURE__*/React.lazy(function () {
|
626
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./ValUI-
|
649
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./ValUI-0f2e6b7d.cjs.prod.js')); });
|
627
650
|
});
|
628
651
|
function ValProvider(_ref) {
|
629
652
|
var children = _ref.children,
|
@@ -452,21 +452,23 @@ var ValStore = /*#__PURE__*/function () {
|
|
452
452
|
this.subscribers = new Map();
|
453
453
|
this.listeners = {};
|
454
454
|
}
|
455
|
-
|
456
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
457
455
|
_createClass(ValStore, [{
|
458
456
|
key: "update",
|
459
457
|
value: function () {
|
460
458
|
var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(moduleIds) {
|
459
|
+
var _this2 = this;
|
461
460
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
462
461
|
while (1) switch (_context.prev = _context.next) {
|
463
462
|
case 0:
|
464
|
-
|
465
|
-
|
463
|
+
_context.next = 2;
|
464
|
+
return Promise.all(moduleIds.map(function (moduleId) {
|
465
|
+
return _this2.updateTree(moduleId);
|
466
|
+
}));
|
467
|
+
case 2:
|
466
468
|
case "end":
|
467
469
|
return _context.stop();
|
468
470
|
}
|
469
|
-
}, _callee
|
471
|
+
}, _callee);
|
470
472
|
}));
|
471
473
|
function update(_x) {
|
472
474
|
return _update.apply(this, arguments);
|
@@ -477,27 +479,48 @@ var ValStore = /*#__PURE__*/function () {
|
|
477
479
|
key: "updateAll",
|
478
480
|
value: function () {
|
479
481
|
var _updateAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
482
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
483
|
+
while (1) switch (_context2.prev = _context2.next) {
|
484
|
+
case 0:
|
485
|
+
_context2.next = 2;
|
486
|
+
return this.updateTree();
|
487
|
+
case 2:
|
488
|
+
case "end":
|
489
|
+
return _context2.stop();
|
490
|
+
}
|
491
|
+
}, _callee2, this);
|
492
|
+
}));
|
493
|
+
function updateAll() {
|
494
|
+
return _updateAll.apply(this, arguments);
|
495
|
+
}
|
496
|
+
return updateAll;
|
497
|
+
}()
|
498
|
+
}, {
|
499
|
+
key: "updateTree",
|
500
|
+
value: function () {
|
501
|
+
var _updateTree = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(treePath) {
|
480
502
|
var data, updatedSubscriberIds, subscriberIds, _loop, _i, _arr, _i2, _Array$from, _Array$from$_i, updatedSubscriberId, moduleIds, subscriberModules;
|
481
|
-
return _regeneratorRuntime().wrap(function
|
482
|
-
while (1) switch (
|
503
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context4) {
|
504
|
+
while (1) switch (_context4.prev = _context4.next) {
|
483
505
|
case 0:
|
484
|
-
|
506
|
+
_context4.next = 2;
|
485
507
|
return this.api.getTree({
|
508
|
+
treePath: treePath,
|
486
509
|
patch: true,
|
487
510
|
includeSource: true
|
488
511
|
});
|
489
512
|
case 2:
|
490
|
-
data =
|
513
|
+
data = _context4.sent;
|
491
514
|
if (!result.isOk(data)) {
|
492
|
-
|
515
|
+
_context4.next = 16;
|
493
516
|
break;
|
494
517
|
}
|
495
518
|
updatedSubscriberIds = new Map();
|
496
519
|
subscriberIds = Array.from(this.subscribers.keys()); // Figure out which modules have been updated and map to updated subscribed id
|
497
520
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
498
521
|
var moduleId, source, updatedSubscriberId;
|
499
|
-
return _regeneratorRuntime().wrap(function _loop$(
|
500
|
-
while (1) switch (
|
522
|
+
return _regeneratorRuntime().wrap(function _loop$(_context3) {
|
523
|
+
while (1) switch (_context3.prev = _context3.next) {
|
501
524
|
case 0:
|
502
525
|
moduleId = _arr[_i];
|
503
526
|
source = data.value.modules[moduleId].source;
|
@@ -513,20 +536,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
513
536
|
}
|
514
537
|
case 3:
|
515
538
|
case "end":
|
516
|
-
return
|
539
|
+
return _context3.stop();
|
517
540
|
}
|
518
541
|
}, _loop);
|
519
542
|
});
|
520
543
|
_i = 0, _arr = Object.keys(data.value.modules);
|
521
544
|
case 8:
|
522
545
|
if (!(_i < _arr.length)) {
|
523
|
-
|
546
|
+
_context4.next = 13;
|
524
547
|
break;
|
525
548
|
}
|
526
|
-
return
|
549
|
+
return _context4.delegateYield(_loop(), "t0", 10);
|
527
550
|
case 10:
|
528
551
|
_i++;
|
529
|
-
|
552
|
+
_context4.next = 8;
|
530
553
|
break;
|
531
554
|
case 13:
|
532
555
|
// For all updated subscribers: set new module data and emit change
|
@@ -542,20 +565,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
542
565
|
this.subscribers.set(updatedSubscriberId, subscriberModules);
|
543
566
|
this.emitChange(updatedSubscriberId);
|
544
567
|
}
|
545
|
-
|
568
|
+
_context4.next = 17;
|
546
569
|
break;
|
547
570
|
case 16:
|
548
571
|
console.error("Val: failed to update modules", data.error);
|
549
572
|
case 17:
|
550
573
|
case "end":
|
551
|
-
return
|
574
|
+
return _context4.stop();
|
552
575
|
}
|
553
|
-
},
|
576
|
+
}, _callee3, this);
|
554
577
|
}));
|
555
|
-
function
|
556
|
-
return
|
578
|
+
function updateTree(_x2) {
|
579
|
+
return _updateTree.apply(this, arguments);
|
557
580
|
}
|
558
|
-
return
|
581
|
+
return updateTree;
|
559
582
|
}()
|
560
583
|
}, {
|
561
584
|
key: "emitChange",
|
@@ -597,7 +620,7 @@ var ValContext = /*#__PURE__*/React.createContext({
|
|
597
620
|
valApi: undefined
|
598
621
|
}) ;
|
599
622
|
var ValUI = /*#__PURE__*/lazy(function () {
|
600
|
-
return import('./ValUI-
|
623
|
+
return import('./ValUI-4d8bf402.browser.esm.js');
|
601
624
|
});
|
602
625
|
function ValProvider(_ref) {
|
603
626
|
var children = _ref.children,
|
@@ -452,21 +452,23 @@ var ValStore = /*#__PURE__*/function () {
|
|
452
452
|
this.subscribers = new Map();
|
453
453
|
this.listeners = {};
|
454
454
|
}
|
455
|
-
|
456
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
457
455
|
_createClass(ValStore, [{
|
458
456
|
key: "update",
|
459
457
|
value: function () {
|
460
458
|
var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(moduleIds) {
|
459
|
+
var _this2 = this;
|
461
460
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
462
461
|
while (1) switch (_context.prev = _context.next) {
|
463
462
|
case 0:
|
464
|
-
|
465
|
-
|
463
|
+
_context.next = 2;
|
464
|
+
return Promise.all(moduleIds.map(function (moduleId) {
|
465
|
+
return _this2.updateTree(moduleId);
|
466
|
+
}));
|
467
|
+
case 2:
|
466
468
|
case "end":
|
467
469
|
return _context.stop();
|
468
470
|
}
|
469
|
-
}, _callee
|
471
|
+
}, _callee);
|
470
472
|
}));
|
471
473
|
function update(_x) {
|
472
474
|
return _update.apply(this, arguments);
|
@@ -477,27 +479,48 @@ var ValStore = /*#__PURE__*/function () {
|
|
477
479
|
key: "updateAll",
|
478
480
|
value: function () {
|
479
481
|
var _updateAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
482
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
483
|
+
while (1) switch (_context2.prev = _context2.next) {
|
484
|
+
case 0:
|
485
|
+
_context2.next = 2;
|
486
|
+
return this.updateTree();
|
487
|
+
case 2:
|
488
|
+
case "end":
|
489
|
+
return _context2.stop();
|
490
|
+
}
|
491
|
+
}, _callee2, this);
|
492
|
+
}));
|
493
|
+
function updateAll() {
|
494
|
+
return _updateAll.apply(this, arguments);
|
495
|
+
}
|
496
|
+
return updateAll;
|
497
|
+
}()
|
498
|
+
}, {
|
499
|
+
key: "updateTree",
|
500
|
+
value: function () {
|
501
|
+
var _updateTree = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(treePath) {
|
480
502
|
var data, updatedSubscriberIds, subscriberIds, _loop, _i, _arr, _i2, _Array$from, _Array$from$_i, updatedSubscriberId, moduleIds, subscriberModules;
|
481
|
-
return _regeneratorRuntime().wrap(function
|
482
|
-
while (1) switch (
|
503
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context4) {
|
504
|
+
while (1) switch (_context4.prev = _context4.next) {
|
483
505
|
case 0:
|
484
|
-
|
506
|
+
_context4.next = 2;
|
485
507
|
return this.api.getTree({
|
508
|
+
treePath: treePath,
|
486
509
|
patch: true,
|
487
510
|
includeSource: true
|
488
511
|
});
|
489
512
|
case 2:
|
490
|
-
data =
|
513
|
+
data = _context4.sent;
|
491
514
|
if (!result.isOk(data)) {
|
492
|
-
|
515
|
+
_context4.next = 16;
|
493
516
|
break;
|
494
517
|
}
|
495
518
|
updatedSubscriberIds = new Map();
|
496
519
|
subscriberIds = Array.from(this.subscribers.keys()); // Figure out which modules have been updated and map to updated subscribed id
|
497
520
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
498
521
|
var moduleId, source, updatedSubscriberId;
|
499
|
-
return _regeneratorRuntime().wrap(function _loop$(
|
500
|
-
while (1) switch (
|
522
|
+
return _regeneratorRuntime().wrap(function _loop$(_context3) {
|
523
|
+
while (1) switch (_context3.prev = _context3.next) {
|
501
524
|
case 0:
|
502
525
|
moduleId = _arr[_i];
|
503
526
|
source = data.value.modules[moduleId].source;
|
@@ -513,20 +536,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
513
536
|
}
|
514
537
|
case 3:
|
515
538
|
case "end":
|
516
|
-
return
|
539
|
+
return _context3.stop();
|
517
540
|
}
|
518
541
|
}, _loop);
|
519
542
|
});
|
520
543
|
_i = 0, _arr = Object.keys(data.value.modules);
|
521
544
|
case 8:
|
522
545
|
if (!(_i < _arr.length)) {
|
523
|
-
|
546
|
+
_context4.next = 13;
|
524
547
|
break;
|
525
548
|
}
|
526
|
-
return
|
549
|
+
return _context4.delegateYield(_loop(), "t0", 10);
|
527
550
|
case 10:
|
528
551
|
_i++;
|
529
|
-
|
552
|
+
_context4.next = 8;
|
530
553
|
break;
|
531
554
|
case 13:
|
532
555
|
// For all updated subscribers: set new module data and emit change
|
@@ -542,20 +565,20 @@ var ValStore = /*#__PURE__*/function () {
|
|
542
565
|
this.subscribers.set(updatedSubscriberId, subscriberModules);
|
543
566
|
this.emitChange(updatedSubscriberId);
|
544
567
|
}
|
545
|
-
|
568
|
+
_context4.next = 17;
|
546
569
|
break;
|
547
570
|
case 16:
|
548
571
|
console.error("Val: failed to update modules", data.error);
|
549
572
|
case 17:
|
550
573
|
case "end":
|
551
|
-
return
|
574
|
+
return _context4.stop();
|
552
575
|
}
|
553
|
-
},
|
576
|
+
}, _callee3, this);
|
554
577
|
}));
|
555
|
-
function
|
556
|
-
return
|
578
|
+
function updateTree(_x2) {
|
579
|
+
return _updateTree.apply(this, arguments);
|
557
580
|
}
|
558
|
-
return
|
581
|
+
return updateTree;
|
559
582
|
}()
|
560
583
|
}, {
|
561
584
|
key: "emitChange",
|
@@ -592,7 +615,7 @@ var useValApi = function useValApi() {
|
|
592
615
|
};
|
593
616
|
var ValContext = undefined;
|
594
617
|
var ValUI = /*#__PURE__*/lazy(function () {
|
595
|
-
return import('./ValUI-
|
618
|
+
return import('./ValUI-3fac1b71.worker.esm.js');
|
596
619
|
});
|
597
620
|
function ValProvider(_ref) {
|
598
621
|
var children = _ref.children,
|
@@ -8,7 +8,7 @@ var slicedToArray = require('./slicedToArray-a2a426c7.cjs.prod.js');
|
|
8
8
|
var React = require('react');
|
9
9
|
var reactDom = require('react-dom');
|
10
10
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
11
|
-
var ValProvider = require('./ValProvider-
|
11
|
+
var ValProvider = require('./ValProvider-8d8e3678.cjs.prod.js');
|
12
12
|
|
13
13
|
function ShadowContent(_ref) {
|
14
14
|
var root = _ref.root,
|
@@ -74,7 +74,7 @@ function ValUI(props) {
|
|
74
74
|
href: "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",
|
75
75
|
rel: "stylesheet"
|
76
76
|
}), /*#__PURE__*/ReactJSXRuntime.jsx(ui.Style, {
|
77
|
-
route: props
|
77
|
+
route: props.host
|
78
78
|
}), /*#__PURE__*/ReactJSXRuntime.jsx(ui.ValOverlay, {
|
79
79
|
api: api,
|
80
80
|
store: store,
|
@@ -4,7 +4,7 @@ import { _ as _slicedToArray } from './slicedToArray-d4c4a4ed.worker.esm.js';
|
|
4
4
|
import { useRef, useState, useLayoutEffect } from 'react';
|
5
5
|
import { createPortal } from 'react-dom';
|
6
6
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
7
|
-
import { useValApi, useValStore } from './ValProvider-
|
7
|
+
import { useValApi, useValStore } from './ValProvider-e21d3e7d.worker.esm.js';
|
8
8
|
|
9
9
|
function ShadowContent(_ref) {
|
10
10
|
var root = _ref.root,
|
@@ -70,7 +70,7 @@ function ValUI(props) {
|
|
70
70
|
href: "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",
|
71
71
|
rel: "stylesheet"
|
72
72
|
}), /*#__PURE__*/jsx(Style, {
|
73
|
-
route: props
|
73
|
+
route: props.host
|
74
74
|
}), /*#__PURE__*/jsx(ValOverlay, {
|
75
75
|
api: api,
|
76
76
|
store: store,
|
@@ -4,7 +4,7 @@ import { _ as _slicedToArray } from './slicedToArray-85f6bb43.browser.esm.js';
|
|
4
4
|
import { useRef, useState, useLayoutEffect } from 'react';
|
5
5
|
import { createPortal } from 'react-dom';
|
6
6
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
7
|
-
import { useValApi, useValStore } from './ValProvider-
|
7
|
+
import { useValApi, useValStore } from './ValProvider-9a2431d9.browser.esm.js';
|
8
8
|
|
9
9
|
function ShadowContent(_ref) {
|
10
10
|
var root = _ref.root,
|
@@ -70,7 +70,7 @@ function ValUI(props) {
|
|
70
70
|
href: "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",
|
71
71
|
rel: "stylesheet"
|
72
72
|
}), /*#__PURE__*/jsx(Style, {
|
73
|
-
route: props
|
73
|
+
route: props.host
|
74
74
|
}), /*#__PURE__*/jsx(ValOverlay, {
|
75
75
|
api: api,
|
76
76
|
store: store,
|
@@ -4,7 +4,7 @@ import { _ as _slicedToArray } from './slicedToArray-331bebbb.esm.js';
|
|
4
4
|
import { useRef, useState, useLayoutEffect } from 'react';
|
5
5
|
import { createPortal } from 'react-dom';
|
6
6
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
7
|
-
import { useValApi, useValStore } from './ValProvider-
|
7
|
+
import { useValApi, useValStore } from './ValProvider-52a0ce49.esm.js';
|
8
8
|
|
9
9
|
function ShadowContent(_ref) {
|
10
10
|
var root = _ref.root,
|
@@ -70,7 +70,7 @@ function ValUI(props) {
|
|
70
70
|
href: "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",
|
71
71
|
rel: "stylesheet"
|
72
72
|
}), /*#__PURE__*/jsx(Style, {
|
73
|
-
route: props
|
73
|
+
route: props.host
|
74
74
|
}), /*#__PURE__*/jsx(ValOverlay, {
|
75
75
|
api: api,
|
76
76
|
store: store,
|
@@ -8,7 +8,7 @@ var slicedToArray = require('./slicedToArray-a9d0d9cd.cjs.dev.js');
|
|
8
8
|
var React = require('react');
|
9
9
|
var reactDom = require('react-dom');
|
10
10
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
11
|
-
var ValProvider = require('./ValProvider-
|
11
|
+
var ValProvider = require('./ValProvider-387a3070.cjs.dev.js');
|
12
12
|
|
13
13
|
function ShadowContent(_ref) {
|
14
14
|
var root = _ref.root,
|
@@ -74,7 +74,7 @@ function ValUI(props) {
|
|
74
74
|
href: "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap",
|
75
75
|
rel: "stylesheet"
|
76
76
|
}), /*#__PURE__*/ReactJSXRuntime.jsx(ui.Style, {
|
77
|
-
route: props
|
77
|
+
route: props.host
|
78
78
|
}), /*#__PURE__*/ReactJSXRuntime.jsx(ui.ValOverlay, {
|
79
79
|
api: api,
|
80
80
|
store: store,
|
@@ -7,6 +7,7 @@ export declare class ValStore implements IValStore {
|
|
7
7
|
constructor(api: ValApi);
|
8
8
|
update(moduleIds: ModuleId[]): Promise<void>;
|
9
9
|
updateAll(): Promise<void>;
|
10
|
+
updateTree(treePath?: string): Promise<void>;
|
10
11
|
subscribe: (moduleIds: ModuleId[]) => (listener: () => void) => () => void;
|
11
12
|
private emitChange;
|
12
13
|
getSnapshot: (moduleIds: ModuleId[]) => () => Record<ModuleId, Json> | undefined;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-
|
1
|
+
export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-9a2431d9.browser.esm.js';
|
2
2
|
import React from 'react';
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
4
4
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var ValProvider = require('../../dist/ValProvider-
|
5
|
+
var ValProvider = require('../../dist/ValProvider-387a3070.cjs.dev.js');
|
6
6
|
var React = require('react');
|
7
7
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
8
8
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var ValProvider = require('../../dist/ValProvider-
|
5
|
+
var ValProvider = require('../../dist/ValProvider-8d8e3678.cjs.prod.js');
|
6
6
|
var React = require('react');
|
7
7
|
var ReactJSXRuntime = require('react/jsx-runtime');
|
8
8
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-
|
1
|
+
export { ValProvider, useValApi, useValStore } from '../../dist/ValProvider-e21d3e7d.worker.esm.js';
|
2
2
|
import React from 'react';
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
4
4
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@valbuild/react",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.42.0",
|
4
4
|
"private": false,
|
5
5
|
"description": "Val - React internal helpers",
|
6
6
|
"sideEffects": false,
|
@@ -9,9 +9,9 @@
|
|
9
9
|
"test": "jest"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
|
-
"@valbuild/core": "~0.
|
13
|
-
"@valbuild/shared": "~0.
|
14
|
-
"@valbuild/ui": "~0.
|
12
|
+
"@valbuild/core": "~0.42.0",
|
13
|
+
"@valbuild/shared": "~0.42.0",
|
14
|
+
"@valbuild/ui": "~0.42.0",
|
15
15
|
"@vercel/stega": "^0.1.0",
|
16
16
|
"base64-arraybuffer": "^1.0.2",
|
17
17
|
"style-to-object": "^0.4.1"
|