piral-core 1.8.0-beta.7667 → 1.8.0-beta.7721
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/lib/codegen.js +100 -86
- package/lib/hooks/piletApi.js +2 -2
- package/lib/setters/SetProvider.js.map +1 -1
- package/lib/tools/codegen.js.map +1 -1
- package/lib/tools/emulator.js.map +1 -1
- package/lib/utils/media.js.map +1 -1
- package/package.json +4 -4
- package/src/actions/app.test.ts +1 -1
- package/src/actions/components.test.ts +1 -1
- package/src/components/ExtensionSlot.test.tsx +22 -22
- package/src/components/PiralRoutes.test.tsx +1 -1
- package/src/components/PiralView.test.tsx +16 -16
- package/src/components/SwitchErrorInfo.test.tsx +2 -2
- package/src/createInstance.test.tsx +3 -3
- package/src/defaults/DefaultErrorInfo.test.tsx +9 -12
- package/src/hooks/piletApi.ts +2 -2
- package/src/modules/element-server.test.ts +1 -1
- package/src/modules/element.test.ts +2 -2
- package/src/setters/SetError.test.tsx +1 -1
- package/src/setters/SetProvider.tsx +1 -1
- package/src/state/createActions.test.ts +13 -2
- package/src/tools/codegen.ts +1 -1
- package/src/tools/emulator.ts +5 -1
- package/src/types/components.ts +1 -1
- package/src/utils/media.test.ts +6 -6
- package/src/utils/media.ts +5 -1
package/lib/codegen.js
CHANGED
|
@@ -806,9 +806,9 @@ var require_graceful_fs = __commonJS({
|
|
|
806
806
|
}
|
|
807
807
|
});
|
|
808
808
|
|
|
809
|
-
//
|
|
809
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js
|
|
810
810
|
var require_CachedInputFileSystem = __commonJS({
|
|
811
|
-
"
|
|
811
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"(exports2, module2) {
|
|
812
812
|
"use strict";
|
|
813
813
|
var nextTick = require("process").nextTick;
|
|
814
814
|
var dirname2 = (path) => {
|
|
@@ -2535,9 +2535,9 @@ var require_lib = __commonJS({
|
|
|
2535
2535
|
}
|
|
2536
2536
|
});
|
|
2537
2537
|
|
|
2538
|
-
//
|
|
2538
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/createInnerContext.js
|
|
2539
2539
|
var require_createInnerContext = __commonJS({
|
|
2540
|
-
"
|
|
2540
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/createInnerContext.js"(exports2, module2) {
|
|
2541
2541
|
"use strict";
|
|
2542
2542
|
module2.exports = function createInnerContext(options, message) {
|
|
2543
2543
|
let messageReported = false;
|
|
@@ -2567,9 +2567,9 @@ var require_createInnerContext = __commonJS({
|
|
|
2567
2567
|
}
|
|
2568
2568
|
});
|
|
2569
2569
|
|
|
2570
|
-
//
|
|
2570
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/util/identifier.js
|
|
2571
2571
|
var require_identifier = __commonJS({
|
|
2572
|
-
"
|
|
2572
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/util/identifier.js"(exports2, module2) {
|
|
2573
2573
|
"use strict";
|
|
2574
2574
|
var PATH_QUERY_FRAGMENT_REGEXP = /^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/;
|
|
2575
2575
|
function parseIdentifier(identifier) {
|
|
@@ -2585,9 +2585,9 @@ var require_identifier = __commonJS({
|
|
|
2585
2585
|
}
|
|
2586
2586
|
});
|
|
2587
2587
|
|
|
2588
|
-
//
|
|
2588
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/util/path.js
|
|
2589
2589
|
var require_path = __commonJS({
|
|
2590
|
-
"
|
|
2590
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/util/path.js"(exports2) {
|
|
2591
2591
|
"use strict";
|
|
2592
2592
|
var path = require("path");
|
|
2593
2593
|
var CHAR_HASH = "#".charCodeAt(0);
|
|
@@ -2746,9 +2746,9 @@ var require_path = __commonJS({
|
|
|
2746
2746
|
}
|
|
2747
2747
|
});
|
|
2748
2748
|
|
|
2749
|
-
//
|
|
2749
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/Resolver.js
|
|
2750
2750
|
var require_Resolver = __commonJS({
|
|
2751
|
-
"
|
|
2751
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/Resolver.js"(exports2, module2) {
|
|
2752
2752
|
"use strict";
|
|
2753
2753
|
var { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = require_lib();
|
|
2754
2754
|
var createInnerContext = require_createInnerContext();
|
|
@@ -3142,9 +3142,9 @@ var require_Resolver = __commonJS({
|
|
|
3142
3142
|
}
|
|
3143
3143
|
});
|
|
3144
3144
|
|
|
3145
|
-
//
|
|
3145
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js
|
|
3146
3146
|
var require_SyncAsyncFileSystemDecorator = __commonJS({
|
|
3147
|
-
"
|
|
3147
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.js"(exports2, module2) {
|
|
3148
3148
|
"use strict";
|
|
3149
3149
|
function SyncAsyncFileSystemDecorator(fs2) {
|
|
3150
3150
|
this.fs = fs2;
|
|
@@ -3329,9 +3329,9 @@ var require_SyncAsyncFileSystemDecorator = __commonJS({
|
|
|
3329
3329
|
}
|
|
3330
3330
|
});
|
|
3331
3331
|
|
|
3332
|
-
//
|
|
3332
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/forEachBail.js
|
|
3333
3333
|
var require_forEachBail = __commonJS({
|
|
3334
|
-
"
|
|
3334
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/forEachBail.js"(exports2, module2) {
|
|
3335
3335
|
"use strict";
|
|
3336
3336
|
module2.exports = function forEachBail(array, iterator, callback) {
|
|
3337
3337
|
if (array.length === 0) return callback();
|
|
@@ -3357,9 +3357,9 @@ var require_forEachBail = __commonJS({
|
|
|
3357
3357
|
}
|
|
3358
3358
|
});
|
|
3359
3359
|
|
|
3360
|
-
//
|
|
3360
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js
|
|
3361
3361
|
var require_DescriptionFileUtils = __commonJS({
|
|
3362
|
-
"
|
|
3362
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js"(exports2) {
|
|
3363
3363
|
"use strict";
|
|
3364
3364
|
var forEachBail = require_forEachBail();
|
|
3365
3365
|
function loadDescriptionFile(resolver, directory, filenames, oldInfo, resolveContext, callback) {
|
|
@@ -3495,9 +3495,9 @@ var require_DescriptionFileUtils = __commonJS({
|
|
|
3495
3495
|
}
|
|
3496
3496
|
});
|
|
3497
3497
|
|
|
3498
|
-
//
|
|
3498
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/getInnerRequest.js
|
|
3499
3499
|
var require_getInnerRequest = __commonJS({
|
|
3500
|
-
"
|
|
3500
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/getInnerRequest.js"(exports2, module2) {
|
|
3501
3501
|
"use strict";
|
|
3502
3502
|
module2.exports = function getInnerRequest(resolver, request) {
|
|
3503
3503
|
if (typeof request.__innerRequest === "string" && request.__innerRequest_request === request.request && request.__innerRequest_relativePath === request.relativePath)
|
|
@@ -3519,9 +3519,9 @@ var require_getInnerRequest = __commonJS({
|
|
|
3519
3519
|
}
|
|
3520
3520
|
});
|
|
3521
3521
|
|
|
3522
|
-
//
|
|
3522
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js
|
|
3523
3523
|
var require_AliasFieldPlugin = __commonJS({
|
|
3524
|
-
"
|
|
3524
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js"(exports2, module2) {
|
|
3525
3525
|
"use strict";
|
|
3526
3526
|
var DescriptionFileUtils = require_DescriptionFileUtils();
|
|
3527
3527
|
var getInnerRequest = require_getInnerRequest();
|
|
@@ -3610,9 +3610,9 @@ var require_AliasFieldPlugin = __commonJS({
|
|
|
3610
3610
|
}
|
|
3611
3611
|
});
|
|
3612
3612
|
|
|
3613
|
-
//
|
|
3613
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/AliasPlugin.js
|
|
3614
3614
|
var require_AliasPlugin = __commonJS({
|
|
3615
|
-
"
|
|
3615
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/AliasPlugin.js"(exports2, module2) {
|
|
3616
3616
|
"use strict";
|
|
3617
3617
|
var forEachBail = require_forEachBail();
|
|
3618
3618
|
var { PathType, getType } = require_path();
|
|
@@ -3652,8 +3652,10 @@ var require_AliasPlugin = __commonJS({
|
|
|
3652
3652
|
this.options,
|
|
3653
3653
|
(item, callback2) => {
|
|
3654
3654
|
let shouldStop = false;
|
|
3655
|
-
|
|
3656
|
-
|
|
3655
|
+
const matchRequest = innerRequest === item.name || !item.onlyModule && (request.request ? innerRequest.startsWith(`${item.name}/`) : isSubPath(innerRequest, item.name));
|
|
3656
|
+
const splitName = item.name.split("*");
|
|
3657
|
+
const matchWildcard = !item.onlyModule && splitName.length === 2;
|
|
3658
|
+
if (matchRequest || matchWildcard) {
|
|
3657
3659
|
const resolveWithAlias = (alias, callback3) => {
|
|
3658
3660
|
if (alias === false) {
|
|
3659
3661
|
const ignoreObj = {
|
|
@@ -3666,9 +3668,21 @@ var require_AliasPlugin = __commonJS({
|
|
|
3666
3668
|
}
|
|
3667
3669
|
return callback3(null, ignoreObj);
|
|
3668
3670
|
}
|
|
3669
|
-
|
|
3671
|
+
let newRequestStr;
|
|
3672
|
+
const [prefix, suffix] = splitName;
|
|
3673
|
+
if (matchWildcard && innerRequest.startsWith(prefix) && innerRequest.endsWith(suffix)) {
|
|
3674
|
+
const match = innerRequest.slice(
|
|
3675
|
+
prefix.length,
|
|
3676
|
+
innerRequest.length - suffix.length
|
|
3677
|
+
);
|
|
3678
|
+
newRequestStr = item.alias.toString().replace("*", match);
|
|
3679
|
+
}
|
|
3680
|
+
if (matchRequest && innerRequest !== alias && !innerRequest.startsWith(alias + "/")) {
|
|
3681
|
+
const remainingRequest = innerRequest.slice(item.name.length);
|
|
3682
|
+
newRequestStr = alias + remainingRequest;
|
|
3683
|
+
}
|
|
3684
|
+
if (newRequestStr !== void 0) {
|
|
3670
3685
|
shouldStop = true;
|
|
3671
|
-
const newRequestStr = alias + remainingRequest;
|
|
3672
3686
|
const obj = {
|
|
3673
3687
|
...request,
|
|
3674
3688
|
request: newRequestStr,
|
|
@@ -3714,9 +3728,9 @@ var require_AliasPlugin = __commonJS({
|
|
|
3714
3728
|
}
|
|
3715
3729
|
});
|
|
3716
3730
|
|
|
3717
|
-
//
|
|
3731
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/AppendPlugin.js
|
|
3718
3732
|
var require_AppendPlugin = __commonJS({
|
|
3719
|
-
"
|
|
3733
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/AppendPlugin.js"(exports2, module2) {
|
|
3720
3734
|
"use strict";
|
|
3721
3735
|
module2.exports = class AppendPlugin {
|
|
3722
3736
|
/**
|
|
@@ -3754,9 +3768,9 @@ var require_AppendPlugin = __commonJS({
|
|
|
3754
3768
|
}
|
|
3755
3769
|
});
|
|
3756
3770
|
|
|
3757
|
-
//
|
|
3771
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ConditionalPlugin.js
|
|
3758
3772
|
var require_ConditionalPlugin = __commonJS({
|
|
3759
|
-
"
|
|
3773
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ConditionalPlugin.js"(exports2, module2) {
|
|
3760
3774
|
"use strict";
|
|
3761
3775
|
module2.exports = class ConditionalPlugin {
|
|
3762
3776
|
/**
|
|
@@ -3805,9 +3819,9 @@ var require_ConditionalPlugin = __commonJS({
|
|
|
3805
3819
|
}
|
|
3806
3820
|
});
|
|
3807
3821
|
|
|
3808
|
-
//
|
|
3822
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js
|
|
3809
3823
|
var require_DescriptionFilePlugin = __commonJS({
|
|
3810
|
-
"
|
|
3824
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js"(exports2, module2) {
|
|
3811
3825
|
"use strict";
|
|
3812
3826
|
var DescriptionFileUtils = require_DescriptionFileUtils();
|
|
3813
3827
|
module2.exports = class DescriptionFilePlugin {
|
|
@@ -3886,9 +3900,9 @@ var require_DescriptionFilePlugin = __commonJS({
|
|
|
3886
3900
|
}
|
|
3887
3901
|
});
|
|
3888
3902
|
|
|
3889
|
-
//
|
|
3903
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js
|
|
3890
3904
|
var require_DirectoryExistsPlugin = __commonJS({
|
|
3891
|
-
"
|
|
3905
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js"(exports2, module2) {
|
|
3892
3906
|
"use strict";
|
|
3893
3907
|
module2.exports = class DirectoryExistsPlugin {
|
|
3894
3908
|
/**
|
|
@@ -3943,9 +3957,9 @@ var require_DirectoryExistsPlugin = __commonJS({
|
|
|
3943
3957
|
}
|
|
3944
3958
|
});
|
|
3945
3959
|
|
|
3946
|
-
//
|
|
3960
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/util/entrypoints.js
|
|
3947
3961
|
var require_entrypoints = __commonJS({
|
|
3948
|
-
"
|
|
3962
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/util/entrypoints.js"(exports2, module2) {
|
|
3949
3963
|
"use strict";
|
|
3950
3964
|
var { parseIdentifier } = require_identifier();
|
|
3951
3965
|
var slashCode = "/".charCodeAt(0);
|
|
@@ -4270,9 +4284,9 @@ var require_entrypoints = __commonJS({
|
|
|
4270
4284
|
}
|
|
4271
4285
|
});
|
|
4272
4286
|
|
|
4273
|
-
//
|
|
4287
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js
|
|
4274
4288
|
var require_ExportsFieldPlugin = __commonJS({
|
|
4275
|
-
"
|
|
4289
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ExportsFieldPlugin.js"(exports2, module2) {
|
|
4276
4290
|
"use strict";
|
|
4277
4291
|
var DescriptionFileUtils = require_DescriptionFileUtils();
|
|
4278
4292
|
var forEachBail = require_forEachBail();
|
|
@@ -4433,9 +4447,9 @@ var require_ExportsFieldPlugin = __commonJS({
|
|
|
4433
4447
|
}
|
|
4434
4448
|
});
|
|
4435
4449
|
|
|
4436
|
-
//
|
|
4450
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js
|
|
4437
4451
|
var require_ExtensionAliasPlugin = __commonJS({
|
|
4438
|
-
"
|
|
4452
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ExtensionAliasPlugin.js"(exports2, module2) {
|
|
4439
4453
|
"use strict";
|
|
4440
4454
|
var forEachBail = require_forEachBail();
|
|
4441
4455
|
module2.exports = class ExtensionAliasPlugin {
|
|
@@ -4509,9 +4523,9 @@ var require_ExtensionAliasPlugin = __commonJS({
|
|
|
4509
4523
|
}
|
|
4510
4524
|
});
|
|
4511
4525
|
|
|
4512
|
-
//
|
|
4526
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/FileExistsPlugin.js
|
|
4513
4527
|
var require_FileExistsPlugin = __commonJS({
|
|
4514
|
-
"
|
|
4528
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/FileExistsPlugin.js"(exports2, module2) {
|
|
4515
4529
|
"use strict";
|
|
4516
4530
|
module2.exports = class FileExistsPlugin {
|
|
4517
4531
|
/**
|
|
@@ -4561,9 +4575,9 @@ var require_FileExistsPlugin = __commonJS({
|
|
|
4561
4575
|
}
|
|
4562
4576
|
});
|
|
4563
4577
|
|
|
4564
|
-
//
|
|
4578
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js
|
|
4565
4579
|
var require_ImportsFieldPlugin = __commonJS({
|
|
4566
|
-
"
|
|
4580
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ImportsFieldPlugin.js"(exports2, module2) {
|
|
4567
4581
|
"use strict";
|
|
4568
4582
|
var DescriptionFileUtils = require_DescriptionFileUtils();
|
|
4569
4583
|
var forEachBail = require_forEachBail();
|
|
@@ -4742,9 +4756,9 @@ var require_ImportsFieldPlugin = __commonJS({
|
|
|
4742
4756
|
}
|
|
4743
4757
|
});
|
|
4744
4758
|
|
|
4745
|
-
//
|
|
4759
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js
|
|
4746
4760
|
var require_JoinRequestPartPlugin = __commonJS({
|
|
4747
|
-
"
|
|
4761
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/JoinRequestPartPlugin.js"(exports2, module2) {
|
|
4748
4762
|
"use strict";
|
|
4749
4763
|
var namespaceStartCharCode = "@".charCodeAt(0);
|
|
4750
4764
|
module2.exports = class JoinRequestPartPlugin {
|
|
@@ -4802,9 +4816,9 @@ var require_JoinRequestPartPlugin = __commonJS({
|
|
|
4802
4816
|
}
|
|
4803
4817
|
});
|
|
4804
4818
|
|
|
4805
|
-
//
|
|
4819
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js
|
|
4806
4820
|
var require_JoinRequestPlugin = __commonJS({
|
|
4807
|
-
"
|
|
4821
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/JoinRequestPlugin.js"(exports2, module2) {
|
|
4808
4822
|
"use strict";
|
|
4809
4823
|
module2.exports = class JoinRequestPlugin {
|
|
4810
4824
|
/**
|
|
@@ -4843,9 +4857,9 @@ var require_JoinRequestPlugin = __commonJS({
|
|
|
4843
4857
|
}
|
|
4844
4858
|
});
|
|
4845
4859
|
|
|
4846
|
-
//
|
|
4860
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/MainFieldPlugin.js
|
|
4847
4861
|
var require_MainFieldPlugin = __commonJS({
|
|
4848
|
-
"
|
|
4862
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/MainFieldPlugin.js"(exports2, module2) {
|
|
4849
4863
|
"use strict";
|
|
4850
4864
|
var path = require("path");
|
|
4851
4865
|
var DescriptionFileUtils = require_DescriptionFileUtils();
|
|
@@ -4905,9 +4919,9 @@ var require_MainFieldPlugin = __commonJS({
|
|
|
4905
4919
|
}
|
|
4906
4920
|
});
|
|
4907
4921
|
|
|
4908
|
-
//
|
|
4922
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/getPaths.js
|
|
4909
4923
|
var require_getPaths = __commonJS({
|
|
4910
|
-
"
|
|
4924
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/getPaths.js"(exports2, module2) {
|
|
4911
4925
|
"use strict";
|
|
4912
4926
|
module2.exports = function getPaths(path) {
|
|
4913
4927
|
if (path === "/") return { paths: ["/"], segments: [""] };
|
|
@@ -4940,9 +4954,9 @@ var require_getPaths = __commonJS({
|
|
|
4940
4954
|
}
|
|
4941
4955
|
});
|
|
4942
4956
|
|
|
4943
|
-
//
|
|
4957
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js
|
|
4944
4958
|
var require_ModulesInHierarchicalDirectoriesPlugin = __commonJS({
|
|
4945
|
-
"
|
|
4959
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ModulesInHierarchicalDirectoriesPlugin.js"(exports2, module2) {
|
|
4946
4960
|
"use strict";
|
|
4947
4961
|
var forEachBail = require_forEachBail();
|
|
4948
4962
|
var getPaths = require_getPaths();
|
|
@@ -5020,9 +5034,9 @@ var require_ModulesInHierarchicalDirectoriesPlugin = __commonJS({
|
|
|
5020
5034
|
}
|
|
5021
5035
|
});
|
|
5022
5036
|
|
|
5023
|
-
//
|
|
5037
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js
|
|
5024
5038
|
var require_ModulesInRootPlugin = __commonJS({
|
|
5025
|
-
"
|
|
5039
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js"(exports2, module2) {
|
|
5026
5040
|
"use strict";
|
|
5027
5041
|
module2.exports = class ModulesInRootPlugin {
|
|
5028
5042
|
/**
|
|
@@ -5061,9 +5075,9 @@ var require_ModulesInRootPlugin = __commonJS({
|
|
|
5061
5075
|
}
|
|
5062
5076
|
});
|
|
5063
5077
|
|
|
5064
|
-
//
|
|
5078
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/NextPlugin.js
|
|
5065
5079
|
var require_NextPlugin = __commonJS({
|
|
5066
|
-
"
|
|
5080
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/NextPlugin.js"(exports2, module2) {
|
|
5067
5081
|
"use strict";
|
|
5068
5082
|
module2.exports = class NextPlugin {
|
|
5069
5083
|
/**
|
|
@@ -5088,9 +5102,9 @@ var require_NextPlugin = __commonJS({
|
|
|
5088
5102
|
}
|
|
5089
5103
|
});
|
|
5090
5104
|
|
|
5091
|
-
//
|
|
5105
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ParsePlugin.js
|
|
5092
5106
|
var require_ParsePlugin = __commonJS({
|
|
5093
|
-
"
|
|
5107
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ParsePlugin.js"(exports2, module2) {
|
|
5094
5108
|
"use strict";
|
|
5095
5109
|
module2.exports = class ParsePlugin {
|
|
5096
5110
|
/**
|
|
@@ -5154,9 +5168,9 @@ var require_ParsePlugin = __commonJS({
|
|
|
5154
5168
|
}
|
|
5155
5169
|
});
|
|
5156
5170
|
|
|
5157
|
-
//
|
|
5171
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/PnpPlugin.js
|
|
5158
5172
|
var require_PnpPlugin = __commonJS({
|
|
5159
|
-
"
|
|
5173
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/PnpPlugin.js"(exports2, module2) {
|
|
5160
5174
|
"use strict";
|
|
5161
5175
|
module2.exports = class PnpPlugin {
|
|
5162
5176
|
/**
|
|
@@ -5261,9 +5275,9 @@ var require_PnpPlugin = __commonJS({
|
|
|
5261
5275
|
}
|
|
5262
5276
|
});
|
|
5263
5277
|
|
|
5264
|
-
//
|
|
5278
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js
|
|
5265
5279
|
var require_RestrictionsPlugin = __commonJS({
|
|
5266
|
-
"
|
|
5280
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/RestrictionsPlugin.js"(exports2, module2) {
|
|
5267
5281
|
"use strict";
|
|
5268
5282
|
var slashCode = "/".charCodeAt(0);
|
|
5269
5283
|
var backslashCode = "\\".charCodeAt(0);
|
|
@@ -5317,9 +5331,9 @@ var require_RestrictionsPlugin = __commonJS({
|
|
|
5317
5331
|
}
|
|
5318
5332
|
});
|
|
5319
5333
|
|
|
5320
|
-
//
|
|
5334
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ResultPlugin.js
|
|
5321
5335
|
var require_ResultPlugin = __commonJS({
|
|
5322
|
-
"
|
|
5336
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ResultPlugin.js"(exports2, module2) {
|
|
5323
5337
|
"use strict";
|
|
5324
5338
|
module2.exports = class ResultPlugin {
|
|
5325
5339
|
/**
|
|
@@ -5355,9 +5369,9 @@ var require_ResultPlugin = __commonJS({
|
|
|
5355
5369
|
}
|
|
5356
5370
|
});
|
|
5357
5371
|
|
|
5358
|
-
//
|
|
5372
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/RootsPlugin.js
|
|
5359
5373
|
var require_RootsPlugin = __commonJS({
|
|
5360
|
-
"
|
|
5374
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/RootsPlugin.js"(exports2, module2) {
|
|
5361
5375
|
"use strict";
|
|
5362
5376
|
var forEachBail = require_forEachBail();
|
|
5363
5377
|
var RootsPlugin = class {
|
|
@@ -5412,9 +5426,9 @@ var require_RootsPlugin = __commonJS({
|
|
|
5412
5426
|
}
|
|
5413
5427
|
});
|
|
5414
5428
|
|
|
5415
|
-
//
|
|
5429
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js
|
|
5416
5430
|
var require_SelfReferencePlugin = __commonJS({
|
|
5417
|
-
"
|
|
5431
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/SelfReferencePlugin.js"(exports2, module2) {
|
|
5418
5432
|
"use strict";
|
|
5419
5433
|
var DescriptionFileUtils = require_DescriptionFileUtils();
|
|
5420
5434
|
var slashCode = "/".charCodeAt(0);
|
|
@@ -5478,9 +5492,9 @@ var require_SelfReferencePlugin = __commonJS({
|
|
|
5478
5492
|
}
|
|
5479
5493
|
});
|
|
5480
5494
|
|
|
5481
|
-
//
|
|
5495
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/SymlinkPlugin.js
|
|
5482
5496
|
var require_SymlinkPlugin = __commonJS({
|
|
5483
|
-
"
|
|
5497
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/SymlinkPlugin.js"(exports2, module2) {
|
|
5484
5498
|
"use strict";
|
|
5485
5499
|
var forEachBail = require_forEachBail();
|
|
5486
5500
|
var getPaths = require_getPaths();
|
|
@@ -5565,9 +5579,9 @@ var require_SymlinkPlugin = __commonJS({
|
|
|
5565
5579
|
}
|
|
5566
5580
|
});
|
|
5567
5581
|
|
|
5568
|
-
//
|
|
5582
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/TryNextPlugin.js
|
|
5569
5583
|
var require_TryNextPlugin = __commonJS({
|
|
5570
|
-
"
|
|
5584
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/TryNextPlugin.js"(exports2, module2) {
|
|
5571
5585
|
"use strict";
|
|
5572
5586
|
module2.exports = class TryNextPlugin {
|
|
5573
5587
|
/**
|
|
@@ -5600,9 +5614,9 @@ var require_TryNextPlugin = __commonJS({
|
|
|
5600
5614
|
}
|
|
5601
5615
|
});
|
|
5602
5616
|
|
|
5603
|
-
//
|
|
5617
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js
|
|
5604
5618
|
var require_UnsafeCachePlugin = __commonJS({
|
|
5605
|
-
"
|
|
5619
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js"(exports2, module2) {
|
|
5606
5620
|
"use strict";
|
|
5607
5621
|
function getCacheId(type, request, withContext) {
|
|
5608
5622
|
return JSON.stringify({
|
|
@@ -5697,9 +5711,9 @@ var require_UnsafeCachePlugin = __commonJS({
|
|
|
5697
5711
|
}
|
|
5698
5712
|
});
|
|
5699
5713
|
|
|
5700
|
-
//
|
|
5714
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/UseFilePlugin.js
|
|
5701
5715
|
var require_UseFilePlugin = __commonJS({
|
|
5702
|
-
"
|
|
5716
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/UseFilePlugin.js"(exports2, module2) {
|
|
5703
5717
|
"use strict";
|
|
5704
5718
|
module2.exports = class UseFilePlugin {
|
|
5705
5719
|
/**
|
|
@@ -5742,9 +5756,9 @@ var require_UseFilePlugin = __commonJS({
|
|
|
5742
5756
|
}
|
|
5743
5757
|
});
|
|
5744
5758
|
|
|
5745
|
-
//
|
|
5759
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ResolverFactory.js
|
|
5746
5760
|
var require_ResolverFactory = __commonJS({
|
|
5747
|
-
"
|
|
5761
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/ResolverFactory.js"(exports2) {
|
|
5748
5762
|
"use strict";
|
|
5749
5763
|
var versions = require("process").versions;
|
|
5750
5764
|
var Resolver = require_Resolver();
|
|
@@ -6260,9 +6274,9 @@ var require_ResolverFactory = __commonJS({
|
|
|
6260
6274
|
}
|
|
6261
6275
|
});
|
|
6262
6276
|
|
|
6263
|
-
//
|
|
6277
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js
|
|
6264
6278
|
var require_CloneBasenamePlugin = __commonJS({
|
|
6265
|
-
"
|
|
6279
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/CloneBasenamePlugin.js"(exports2, module2) {
|
|
6266
6280
|
"use strict";
|
|
6267
6281
|
var basename = require_getPaths().basename;
|
|
6268
6282
|
module2.exports = class CloneBasenamePlugin {
|
|
@@ -6308,9 +6322,9 @@ var require_CloneBasenamePlugin = __commonJS({
|
|
|
6308
6322
|
}
|
|
6309
6323
|
});
|
|
6310
6324
|
|
|
6311
|
-
//
|
|
6325
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/LogInfoPlugin.js
|
|
6312
6326
|
var require_LogInfoPlugin = __commonJS({
|
|
6313
|
-
"
|
|
6327
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/LogInfoPlugin.js"(exports2, module2) {
|
|
6314
6328
|
"use strict";
|
|
6315
6329
|
module2.exports = class LogInfoPlugin {
|
|
6316
6330
|
/**
|
|
@@ -6354,9 +6368,9 @@ var require_LogInfoPlugin = __commonJS({
|
|
|
6354
6368
|
}
|
|
6355
6369
|
});
|
|
6356
6370
|
|
|
6357
|
-
//
|
|
6371
|
+
// ../../tooling/piral-cli/node_modules/enhanced-resolve/lib/index.js
|
|
6358
6372
|
var require_lib2 = __commonJS({
|
|
6359
|
-
"
|
|
6373
|
+
"../../tooling/piral-cli/node_modules/enhanced-resolve/lib/index.js"(exports2, module2) {
|
|
6360
6374
|
"use strict";
|
|
6361
6375
|
var fs2 = require_graceful_fs();
|
|
6362
6376
|
var CachedInputFileSystem2 = require_CachedInputFileSystem();
|
package/lib/hooks/piletApi.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState } from
|
|
2
|
-
import { useGlobalStateContext } from
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useGlobalStateContext } from './globalState';
|
|
3
3
|
/**
|
|
4
4
|
* Uses the global state context to retrieve the pilet API stored
|
|
5
5
|
* for the root pilet. This allows interaction with the pilet API
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetProvider.js","sourceRoot":"","sources":["../../src/setters/SetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAY5D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAoB;IACxD,MAAM,
|
|
1
|
+
{"version":3,"file":"SetProvider.js","sourceRoot":"","sources":["../../src/setters/SetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAY5D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAoB;IACxD,MAAM,EAAE,eAAe,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACpD,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvD,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/lib/tools/codegen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/tools/codegen.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE9D,SAAS,eAAe,CAAC,SAAiB;IACx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,WAAW,CAAC,IAAI,CAAC;;GAEhB,CAAC,CAAC;IAEH,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;QACzE,WAAW,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;IACzD,CAAC;SAAM,CAAC;QACN,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,CAAC,IAAI,CAAC;;QAEP,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;;GAE3B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emulator.js","sourceRoot":"","sources":["../../src/tools/emulator.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGnF,MAAM,UAAU,iBAAiB,
|
|
1
|
+
{"version":3,"file":"emulator.js","sourceRoot":"","sources":["../../src/tools/emulator.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGnF,MAAM,UAAU,iBAAiB,CAC/B,OAA2B,EAC3B,OAA0B,EAC1B,QAAkC,EAAE;IAEpC,oBAAoB,CAAC,OAAO,CAAC,WAAW,EAAE;QACxC,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,CAAC,SAAS;YACjB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;QAClC,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/lib/utils/media.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/utils/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,MAAM,CAAC,MAAM,cAAc,GAAgB,CAAC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AG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC;AACvD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-core",
|
|
3
|
-
"version": "1.8.0-beta.
|
|
3
|
+
"version": "1.8.0-beta.7721",
|
|
4
4
|
"description": "The core library for creating a Piral instance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"piral-base": "1.8.0-beta.
|
|
67
|
-
"piral-debug-utils": "1.8.0-beta.
|
|
66
|
+
"piral-base": "1.8.0-beta.7721",
|
|
67
|
+
"piral-debug-utils": "1.8.0-beta.7721",
|
|
68
68
|
"zustand": "^3.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"react-router-dom",
|
|
85
85
|
"tslib"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "68a3bc176511f7a36b453f0addac97f3e5621e72"
|
|
88
88
|
}
|
package/src/actions/app.test.ts
CHANGED
|
@@ -19,7 +19,7 @@ import { createActions } from '../state';
|
|
|
19
19
|
import { RootListener } from '../RootListener';
|
|
20
20
|
|
|
21
21
|
vitest.mock('../../app.codegen', () => ({
|
|
22
|
-
createNavigation: vitest.fn(publicPath => ({
|
|
22
|
+
createNavigation: vitest.fn((publicPath) => ({
|
|
23
23
|
publicPath,
|
|
24
24
|
})),
|
|
25
25
|
fillDependencies: vitest.fn(),
|
|
@@ -8,7 +8,7 @@ import { registerExtension, registerPage, unregisterExtension, unregisterPage }
|
|
|
8
8
|
import { createActions } from '../state';
|
|
9
9
|
|
|
10
10
|
vitest.mock('../../app.codegen', () => ({
|
|
11
|
-
createNavigation: vitest.fn(publicPath => ({
|
|
11
|
+
createNavigation: vitest.fn((publicPath) => ({
|
|
12
12
|
publicPath,
|
|
13
13
|
})),
|
|
14
14
|
publicPath: '/',
|
|
@@ -30,7 +30,7 @@ vitest.mock('../hooks/globalState', () => ({
|
|
|
30
30
|
}));
|
|
31
31
|
|
|
32
32
|
vitest.mock('react', async () => ({
|
|
33
|
-
...(await vitest.importActual('react') as any),
|
|
33
|
+
...((await vitest.importActual('react')) as any),
|
|
34
34
|
useMemo(cb) {
|
|
35
35
|
return cb();
|
|
36
36
|
},
|
|
@@ -80,51 +80,51 @@ describe('Extension Module', () => {
|
|
|
80
80
|
afterEach(() => {
|
|
81
81
|
cleanup();
|
|
82
82
|
});
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
it('is able to default render not available extension', () => {
|
|
85
85
|
const node = render(<ExtensionSlot name="qxz" />);
|
|
86
|
-
expect(node.queryAllByRole(
|
|
86
|
+
expect(node.queryAllByRole('stub1').length).toBe(0);
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
it('is able to (default) render empty extension', () => {
|
|
90
90
|
const node = render(<ExtensionSlot name="foo" />);
|
|
91
|
-
expect(node.queryAllByRole(
|
|
91
|
+
expect(node.queryAllByRole('stub1').length).toBe(0);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
it('is able to custom render not available extension', () => {
|
|
95
95
|
const node = render(<ExtensionSlot name="qxz" render={() => <StubComponent1 />} />);
|
|
96
|
-
expect(node.queryAllByRole(
|
|
96
|
+
expect(node.queryAllByRole('stub1').length).toBe(1);
|
|
97
97
|
});
|
|
98
98
|
|
|
99
99
|
it('is able to (custom) render empty extension', () => {
|
|
100
100
|
const node = render(<ExtensionSlot name="foo" render={() => <StubComponent1 />} />);
|
|
101
|
-
expect(node.queryAllByRole(
|
|
101
|
+
expect(node.queryAllByRole('stub1').length).toBe(1);
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
it('is able to render extension with multiple entries', () => {
|
|
105
105
|
const node = render(<ExtensionSlot name="bar" />);
|
|
106
|
-
expect(node.queryAllByRole(
|
|
107
|
-
expect(node.queryAllByRole(
|
|
108
|
-
expect(node.queryAllByRole(
|
|
106
|
+
expect(node.queryAllByRole('stub1').length).toBe(2);
|
|
107
|
+
expect(node.queryAllByRole('stub2').length).toBe(1);
|
|
108
|
+
expect(node.queryAllByRole('stub3').length).toBe(0);
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
it('is able to render extension without displayName', () => {
|
|
112
112
|
const node = render(<ExtensionSlot name="bla" />);
|
|
113
|
-
expect(node.queryAllByRole(
|
|
114
|
-
expect(node.queryAllByRole(
|
|
115
|
-
expect(node.queryAllByRole(
|
|
113
|
+
expect(node.queryAllByRole('stub1').length).toBe(0);
|
|
114
|
+
expect(node.queryAllByRole('stub2').length).toBe(0);
|
|
115
|
+
expect(node.queryAllByRole('stub3').length).toBe(1);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
it('overrides the empty renderer on not available extension', () => {
|
|
119
119
|
const node = render(<ExtensionSlot name="qxz" empty={() => <StubComponent1 key="empty" />} />);
|
|
120
|
-
expect(node.queryAllByRole(
|
|
121
|
-
expect(node.queryAllByRole(
|
|
120
|
+
expect(node.queryAllByRole('stub1').length).toBe(1);
|
|
121
|
+
expect(node.queryAllByRole('stub2').length).toBe(0);
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
it('overrides the empty renderer on an available extension', () => {
|
|
125
125
|
const node = render(<ExtensionSlot name="foo" empty={() => <StubComponent2 key="empty" />} />);
|
|
126
|
-
expect(node.queryAllByRole(
|
|
127
|
-
expect(node.queryAllByRole(
|
|
126
|
+
expect(node.queryAllByRole('stub1').length).toBe(0);
|
|
127
|
+
expect(node.queryAllByRole('stub2').length).toBe(1);
|
|
128
128
|
});
|
|
129
129
|
|
|
130
130
|
it('overrides the empty and default renderer on an available extension', () => {
|
|
@@ -135,8 +135,8 @@ describe('Extension Module', () => {
|
|
|
135
135
|
render={(nodes) => <StubComponent1 children={nodes} />}
|
|
136
136
|
/>,
|
|
137
137
|
);
|
|
138
|
-
expect(node.queryAllByRole(
|
|
139
|
-
expect(node.queryAllByRole(
|
|
138
|
+
expect(node.queryAllByRole('stub1').length).toBe(1);
|
|
139
|
+
expect(node.queryAllByRole('stub2').length).toBe(1);
|
|
140
140
|
});
|
|
141
141
|
|
|
142
142
|
it('does not use the render function with empty when emptySkipsRender is set', () => {
|
|
@@ -148,8 +148,8 @@ describe('Extension Module', () => {
|
|
|
148
148
|
render={(nodes) => <StubComponent1 children={nodes} />}
|
|
149
149
|
/>,
|
|
150
150
|
);
|
|
151
|
-
expect(node.queryAllByRole(
|
|
152
|
-
expect(node.queryAllByRole(
|
|
151
|
+
expect(node.queryAllByRole('stub1').length).toBe(0);
|
|
152
|
+
expect(node.queryAllByRole('stub2').length).toBe(1);
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
it('does use the render function without empty independent if emptySkipsRender is set', () => {
|
|
@@ -161,7 +161,7 @@ describe('Extension Module', () => {
|
|
|
161
161
|
render={(nodes) => <StubComponent1 children={nodes} />}
|
|
162
162
|
/>,
|
|
163
163
|
);
|
|
164
|
-
expect(node.queryAllByRole(
|
|
165
|
-
expect(node.queryAllByRole(
|
|
164
|
+
expect(node.queryAllByRole('stub1').length).toBe(2);
|
|
165
|
+
expect(node.queryAllByRole('stub2').length).toBe(0);
|
|
166
166
|
});
|
|
167
167
|
});
|
|
@@ -63,7 +63,7 @@ describe('Routes Module', () => {
|
|
|
63
63
|
afterEach(() => {
|
|
64
64
|
cleanup();
|
|
65
65
|
});
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
it('always goes to the given home on "/"', () => {
|
|
68
68
|
const node = mountWithRouter(<PiralRoutes NotFound={StubNotFound} RouteSwitch={DefaultRouteSwitch} />, '/');
|
|
69
69
|
expect(node.queryAllByRole('home').length).toBe(1);
|
|
@@ -48,39 +48,39 @@ const state = {
|
|
|
48
48
|
|
|
49
49
|
(hooks as any).useGlobalState = (select: any) => select(state);
|
|
50
50
|
|
|
51
|
-
(routes as any).PiralRoutes = ({
|
|
51
|
+
(routes as any).PiralRoutes = ({}) => <StubDashboard />;
|
|
52
52
|
|
|
53
53
|
describe('Portal Module', () => {
|
|
54
54
|
afterEach(() => {
|
|
55
55
|
cleanup();
|
|
56
56
|
});
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
it('renders the dashboard / content in layout if loaded without error', () => {
|
|
59
59
|
state.app.loading = false;
|
|
60
60
|
state.app.error = undefined;
|
|
61
61
|
const node = render(<PiralView />);
|
|
62
|
-
expect(node.queryAllByRole(
|
|
63
|
-
expect(node.queryAllByRole(
|
|
64
|
-
expect(node.queryAllByRole(
|
|
62
|
+
expect(node.queryAllByRole('loader').length).toBe(0);
|
|
63
|
+
expect(node.queryAllByRole('error').length).toBe(0);
|
|
64
|
+
expect(node.queryAllByRole('dashboard').length).toBe(1);
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
it('just renders the loader if not loaded yet', () => {
|
|
68
68
|
state.app.loading = true;
|
|
69
69
|
state.app.error = undefined;
|
|
70
70
|
const node = render(<PiralView />);
|
|
71
|
-
expect(node.queryAllByRole(
|
|
72
|
-
expect(node.queryAllByRole(
|
|
73
|
-
expect(node.queryAllByRole(
|
|
71
|
+
expect(node.queryAllByRole('loader').length).toBe(1);
|
|
72
|
+
expect(node.queryAllByRole('error').length).toBe(0);
|
|
73
|
+
expect(node.queryAllByRole('dashboard').length).toBe(0);
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
it('renders the error outside layout if errored when loading', () => {
|
|
77
77
|
state.app.loading = false;
|
|
78
78
|
state.app.error = new Error('Test');
|
|
79
79
|
const node = render(<PiralView />);
|
|
80
|
-
expect(node.queryAllByRole(
|
|
81
|
-
expect(node.queryAllByRole(
|
|
82
|
-
expect(node.getByRole(
|
|
83
|
-
expect(node.queryAllByRole(
|
|
80
|
+
expect(node.queryAllByRole('loader').length).toBe(0);
|
|
81
|
+
expect(node.queryAllByRole('error').length).toBe(1);
|
|
82
|
+
expect(node.getByRole('error').textContent).toBe('loading');
|
|
83
|
+
expect(node.queryAllByRole('dashboard').length).toBe(0);
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
it('renders the not found error in layout', () => {
|
|
@@ -88,9 +88,9 @@ describe('Portal Module', () => {
|
|
|
88
88
|
state.app.error = undefined;
|
|
89
89
|
(routes as any).PiralRoutes = ({ NotFound }) => <NotFound />;
|
|
90
90
|
const node = render(<PiralView />);
|
|
91
|
-
expect(node.queryAllByRole(
|
|
92
|
-
expect(node.queryAllByRole(
|
|
93
|
-
expect(node.getByRole(
|
|
94
|
-
expect(node.queryAllByRole(
|
|
91
|
+
expect(node.queryAllByRole('loader').length).toBe(0);
|
|
92
|
+
expect(node.queryAllByRole('error').length).toBe(1);
|
|
93
|
+
expect(node.getByRole('error').textContent).toBe('not_found');
|
|
94
|
+
expect(node.queryAllByRole('dashboard').length).toBe(0);
|
|
95
95
|
});
|
|
96
96
|
});
|
|
@@ -13,7 +13,7 @@ vitest.mock('../hooks/globalState', () => ({
|
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
15
|
vitest.mock('react', async () => ({
|
|
16
|
-
...(await vitest.importActual('react') as any),
|
|
16
|
+
...((await vitest.importActual('react')) as any),
|
|
17
17
|
useMemo: (cb) => cb(),
|
|
18
18
|
}));
|
|
19
19
|
|
|
@@ -34,7 +34,7 @@ describe('SwitchErrorInfo Module', () => {
|
|
|
34
34
|
afterEach(() => {
|
|
35
35
|
cleanup();
|
|
36
36
|
});
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
it('is able to render StubComponent1 component', () => {
|
|
39
39
|
const node = render(<SwitchErrorInfo type="stubComponent1" />);
|
|
40
40
|
expect(node.queryAllByRole('stub').length).toBe(1);
|
|
@@ -29,10 +29,10 @@ describe('Piral-Core createInstance module', () => {
|
|
|
29
29
|
it('createInstance with empty actions and plugins uses the standard strategy', () => {
|
|
30
30
|
const instance = createInstance({ plugins: {}, actions: {} });
|
|
31
31
|
expect(instance.options.strategy).toBe(standardStrategy);
|
|
32
|
-
})
|
|
32
|
+
});
|
|
33
33
|
|
|
34
34
|
it('createInstance with async function uses the blazing strategy', () => {
|
|
35
|
-
const instance = createInstance({ async: () => {
|
|
35
|
+
const instance = createInstance({ async: () => {} });
|
|
36
36
|
expect(instance.options.strategy).not.toBe(blazingStrategy);
|
|
37
|
-
})
|
|
37
|
+
});
|
|
38
38
|
});
|
|
@@ -26,19 +26,16 @@ StubErrorInfo.displayName = 'StubErrorInfo';
|
|
|
26
26
|
describe('Default Error Info Component', () => {
|
|
27
27
|
it('renders the switch-case in the loading error case', () => {
|
|
28
28
|
const node = render(<DefaultErrorInfo type="loading" error="foo" />);
|
|
29
|
-
expect(node.queryAllByRole(
|
|
30
|
-
expect(node.queryAllByText(
|
|
29
|
+
expect(node.queryAllByRole('stub').length).toBe(0);
|
|
30
|
+
expect(node.queryAllByText('Error: loading').length).toBe(1);
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
it('renders the switch-case in the not_found error case', () => {
|
|
34
34
|
const node = render(
|
|
35
|
-
<DefaultErrorInfo
|
|
36
|
-
type="not_found"
|
|
37
|
-
location={{ pathname: 'foo', hash: '', key: '', search: '', state: '' }}
|
|
38
|
-
/>,
|
|
35
|
+
<DefaultErrorInfo type="not_found" location={{ pathname: 'foo', hash: '', key: '', search: '', state: '' }} />,
|
|
39
36
|
);
|
|
40
|
-
expect(node.queryAllByRole(
|
|
41
|
-
expect(node.queryAllByText(
|
|
37
|
+
expect(node.queryAllByRole('stub').length).toBe(0);
|
|
38
|
+
expect(node.queryAllByText('Error: not_found').length).toBe(1);
|
|
42
39
|
});
|
|
43
40
|
|
|
44
41
|
it('renders the switch-case in the page error case', () => {
|
|
@@ -49,8 +46,8 @@ describe('Default Error Info Component', () => {
|
|
|
49
46
|
location={{ pathname: 'bar', hash: '', key: '', search: '', state: '' }}
|
|
50
47
|
/>,
|
|
51
48
|
);
|
|
52
|
-
expect(node.queryAllByRole(
|
|
53
|
-
expect(node.queryAllByText(
|
|
49
|
+
expect(node.queryAllByRole('stub').length).toBe(0);
|
|
50
|
+
expect(node.queryAllByText('Error: page').length).toBe(1);
|
|
54
51
|
});
|
|
55
52
|
|
|
56
53
|
it('renders the react fragment in the default case', () => {
|
|
@@ -60,7 +57,7 @@ describe('Default Error Info Component', () => {
|
|
|
60
57
|
},
|
|
61
58
|
];
|
|
62
59
|
const node = render(<DefaultErrorInfo type="extension" error="foo" />);
|
|
63
|
-
expect(node.queryAllByRole(
|
|
64
|
-
expect(node.queryAllByText(
|
|
60
|
+
expect(node.queryAllByRole('stub').length).toBe(1);
|
|
61
|
+
expect(node.queryAllByText('Error: extension').length).toBe(0);
|
|
65
62
|
});
|
|
66
63
|
});
|
package/src/hooks/piletApi.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { createActions } from '../state';
|
|
|
9
9
|
import { renderElement } from './element';
|
|
10
10
|
|
|
11
11
|
vitest.mock('../../app.codegen', () => ({
|
|
12
|
-
createNavigation: vitest.fn(publicPath => ({
|
|
12
|
+
createNavigation: vitest.fn((publicPath) => ({
|
|
13
13
|
publicPath,
|
|
14
14
|
})),
|
|
15
15
|
publicPath: '/',
|
|
@@ -8,10 +8,10 @@ import { createActions } from '../state';
|
|
|
8
8
|
import { renderElement } from './element';
|
|
9
9
|
|
|
10
10
|
vitest.mock('../../app.codegen', () => ({
|
|
11
|
-
applyStyle: vitest.fn(element => {
|
|
11
|
+
applyStyle: vitest.fn((element) => {
|
|
12
12
|
element.style.display = 'contents';
|
|
13
13
|
}),
|
|
14
|
-
createNavigation: vitest.fn(publicPath => ({
|
|
14
|
+
createNavigation: vitest.fn((publicPath) => ({
|
|
15
15
|
publicPath,
|
|
16
16
|
})),
|
|
17
17
|
publicPath: '/',
|
|
@@ -43,7 +43,7 @@ describe('Piral-Core SetError component', () => {
|
|
|
43
43
|
<SetError type="loading" component={FakeError} />
|
|
44
44
|
</StateContext.Provider>,
|
|
45
45
|
);
|
|
46
|
-
expect(
|
|
46
|
+
expect(context.state.getState().errorComponents).toEqual({
|
|
47
47
|
loading: FakeError,
|
|
48
48
|
});
|
|
49
49
|
});
|
|
@@ -15,7 +15,7 @@ export interface SetProviderProps {
|
|
|
15
15
|
* The component capable of setting a global provider at mounting.
|
|
16
16
|
*/
|
|
17
17
|
export function SetProvider({ provider }: SetProviderProps): React.ReactElement {
|
|
18
|
-
const {includeProvider} = useGlobalStateContext();
|
|
18
|
+
const { includeProvider } = useGlobalStateContext();
|
|
19
19
|
useSetter(() => provider && includeProvider(provider));
|
|
20
20
|
// tslint:disable-next-line:no-null-keyword
|
|
21
21
|
return null;
|
|
@@ -15,7 +15,7 @@ vitest.mock('../actions', () => ({
|
|
|
15
15
|
}));
|
|
16
16
|
|
|
17
17
|
vitest.mock('../../app.codegen', () => ({
|
|
18
|
-
createNavigation: vitest.fn(publicPath => ({
|
|
18
|
+
createNavigation: vitest.fn((publicPath) => ({
|
|
19
19
|
publicPath,
|
|
20
20
|
})),
|
|
21
21
|
publicPath: '/',
|
|
@@ -25,7 +25,18 @@ describe('Create Actions Module', () => {
|
|
|
25
25
|
it('createActions works with all actions', () => {
|
|
26
26
|
const events = createListener(undefined);
|
|
27
27
|
const actions = createActions('abc' as any, events);
|
|
28
|
-
expect(Object.keys(actions)).toEqual([
|
|
28
|
+
expect(Object.keys(actions)).toEqual([
|
|
29
|
+
'on',
|
|
30
|
+
'once',
|
|
31
|
+
'off',
|
|
32
|
+
'emit',
|
|
33
|
+
'apis',
|
|
34
|
+
'converters',
|
|
35
|
+
'navigation',
|
|
36
|
+
'state',
|
|
37
|
+
'a',
|
|
38
|
+
'b',
|
|
39
|
+
]);
|
|
29
40
|
});
|
|
30
41
|
|
|
31
42
|
it('createActions binds against given context', () => {
|
package/src/tools/codegen.ts
CHANGED
|
@@ -102,7 +102,7 @@ export function createBasicAppFunc(imports: Array<string>, exports: Array<string
|
|
|
102
102
|
switch (opts.internalStyles) {
|
|
103
103
|
case 'sheet':
|
|
104
104
|
imports.push(`import 'piral-core/styles/sheet.css';`);
|
|
105
|
-
|
|
105
|
+
// no return - we fall through and also include the dummy applyStyle for "none"
|
|
106
106
|
case 'none':
|
|
107
107
|
exports.push(`
|
|
108
108
|
export function applyStyle(element) {}
|
package/src/tools/emulator.ts
CHANGED
|
@@ -2,7 +2,11 @@ import { LoadPiletsOptions } from 'piral-base';
|
|
|
2
2
|
import { DebuggerExtensionOptions, installPiletEmulator } from 'piral-debug-utils';
|
|
3
3
|
import { GlobalStateContext } from '../types';
|
|
4
4
|
|
|
5
|
-
export function integrateEmulator(
|
|
5
|
+
export function integrateEmulator(
|
|
6
|
+
context: GlobalStateContext,
|
|
7
|
+
options: LoadPiletsOptions,
|
|
8
|
+
debug: DebuggerExtensionOptions = {},
|
|
9
|
+
) {
|
|
6
10
|
installPiletEmulator(options.fetchPilets, {
|
|
7
11
|
defaultFeedUrl: debug.defaultFeedUrl,
|
|
8
12
|
addPilet: context.addPilet,
|
package/src/types/components.ts
CHANGED
package/src/utils/media.test.ts
CHANGED
|
@@ -7,7 +7,7 @@ describe('Media Module', () => {
|
|
|
7
7
|
it('getCurrentLayout correctly takes matched first layout', async () => {
|
|
8
8
|
const breakpoints = ['min-width: 200px', 'max-width: 199px'];
|
|
9
9
|
window.matchMedia = vitest.fn((q) => ({ matches: q === breakpoints[0] })) as any;
|
|
10
|
-
const { getCurrentLayout
|
|
10
|
+
const { getCurrentLayout } = await import('./media');
|
|
11
11
|
const result = getCurrentLayout(breakpoints, ['foo', 'bar'], 'foo');
|
|
12
12
|
expect(window.matchMedia).toHaveBeenCalledTimes(1);
|
|
13
13
|
expect(result).toBe('foo');
|
|
@@ -15,8 +15,8 @@ describe('Media Module', () => {
|
|
|
15
15
|
|
|
16
16
|
it('getCurrentLayout correctly takes matched second layout', async () => {
|
|
17
17
|
const breakpoints = ['min-width: 200px', 'max-width: 199px'];
|
|
18
|
-
window.matchMedia = vitest.fn((q) => ({ matches: q === breakpoints[1] }
|
|
19
|
-
const { getCurrentLayout
|
|
18
|
+
window.matchMedia = vitest.fn((q) => ({ matches: q === breakpoints[1] } as any));
|
|
19
|
+
const { getCurrentLayout } = await import('./media');
|
|
20
20
|
const result = getCurrentLayout(breakpoints, ['foo', 'bar'], 'foo');
|
|
21
21
|
expect(window.matchMedia).toHaveBeenCalledTimes(2);
|
|
22
22
|
expect(result).toBe('bar');
|
|
@@ -25,7 +25,7 @@ describe('Media Module', () => {
|
|
|
25
25
|
it('getCurrentLayout uses default layout if nothing matches', async () => {
|
|
26
26
|
const breakpoints = ['min-width: 200px', 'max-width: 199px'];
|
|
27
27
|
window.matchMedia = vitest.fn((q) => ({ matches: false })) as any;
|
|
28
|
-
const { getCurrentLayout
|
|
28
|
+
const { getCurrentLayout } = await import('./media');
|
|
29
29
|
const result = getCurrentLayout(breakpoints, ['foo', 'bar'], 'foo');
|
|
30
30
|
expect(window.matchMedia).toHaveBeenCalledTimes(2);
|
|
31
31
|
expect(result).toBe('foo');
|
|
@@ -34,7 +34,7 @@ describe('Media Module', () => {
|
|
|
34
34
|
it('getCurrentLayout uses default layout which not be a given layoput', async () => {
|
|
35
35
|
const breakpoints = ['min-width: 200px', 'max-width: 199px'];
|
|
36
36
|
window.matchMedia = vitest.fn((q) => ({ matches: false })) as any;
|
|
37
|
-
const { getCurrentLayout
|
|
37
|
+
const { getCurrentLayout } = await import('./media');
|
|
38
38
|
const result = getCurrentLayout(breakpoints, ['foo', 'bar'], 'qxz');
|
|
39
39
|
expect(window.matchMedia).toHaveBeenCalledTimes(2);
|
|
40
40
|
expect(result).toBe('qxz');
|
|
@@ -42,7 +42,7 @@ describe('Media Module', () => {
|
|
|
42
42
|
|
|
43
43
|
it('getCurrentLayout uses default layout if no breakpoint given', async () => {
|
|
44
44
|
window.matchMedia = vitest.fn((q) => ({ matches: true })) as any;
|
|
45
|
-
const { getCurrentLayout
|
|
45
|
+
const { getCurrentLayout } = await import('./media');
|
|
46
46
|
const result = getCurrentLayout([], ['foo', 'bar'], 'qxz');
|
|
47
47
|
expect(window.matchMedia).toHaveBeenCalledTimes(0);
|
|
48
48
|
expect(result).toBe('qxz');
|
package/src/utils/media.ts
CHANGED
|
@@ -10,7 +10,11 @@ const mm =
|
|
|
10
10
|
? () => ({ matches: undefined })
|
|
11
11
|
: (q: string) => window.matchMedia(q);
|
|
12
12
|
|
|
13
|
-
export function getCurrentLayout<T>(
|
|
13
|
+
export function getCurrentLayout<T>(
|
|
14
|
+
breakpoints: Array<string> = defaultBreakpoints,
|
|
15
|
+
layouts: Array<T>,
|
|
16
|
+
defaultLayout: T,
|
|
17
|
+
) {
|
|
14
18
|
const query = breakpoints.findIndex((q) => mm(q).matches);
|
|
15
19
|
const layout = layouts[query];
|
|
16
20
|
return layout !== undefined ? layout : defaultLayout;
|