@whitesev/pops 2.5.3 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "弹窗库",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/WhiteSevs/TamperMonkeyScript/tree/master/lib/pops#readme",
@@ -490,42 +490,7 @@ export const PopsPanelConfig = (): DeepRequired<PopsPanelDetails> => {
490
490
  },
491
491
  },
492
492
  ],
493
- bottomContentConfig: [
494
- {
495
- text: "Github",
496
- position: "left",
497
- className: "user-home",
498
- attributes: {
499
- "data-url": "https://github.com/whitesevs",
500
- },
501
- props: {
502
- "data-test": 1,
503
- },
504
- disableHoverCSS: false,
505
- clickCallback() {
506
- const userHomeUrl = (this.attributes as { [key: string]: any })["data-url"];
507
- console.log("打开个人主页:" + userHomeUrl);
508
- window.open(userHomeUrl, "_blank");
509
- },
510
- afterRender(config) {
511
- console.log(config);
512
- },
513
- },
514
- {
515
- text: "0.0.1",
516
- position: "right",
517
- className: "script-version",
518
- attributes: {},
519
- props: {},
520
- disableHoverCSS: true,
521
- clickCallback() {
522
- console.log("当前版本:" + this.text);
523
- },
524
- afterRender(config) {
525
- console.log(config);
526
- },
527
- },
528
- ],
493
+ bottomContentConfig: [],
529
494
  btn: {
530
495
  close: {
531
496
  enable: true,
@@ -19,8 +19,18 @@ export const PopsPanel = {
19
19
  let config: Required<PopsPanelDetails> = PopsPanelConfig();
20
20
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
21
21
  config = popsUtils.assign(config, details);
22
- if (details && Array.isArray(details.content)) {
23
- config.content = details.content;
22
+ if (details) {
23
+ if (Array.isArray(details.content)) {
24
+ // 存在内容配置
25
+ config.content = details.content;
26
+ }
27
+ if (Array.isArray(details.bottomContentConfig)) {
28
+ // 存在底部配置
29
+ config.bottomContentConfig = details.bottomContentConfig;
30
+ } else {
31
+ // 不存在底部配置 清空默认的
32
+ config.bottomContentConfig = [];
33
+ }
24
34
  }
25
35
  config = PopsHandler.handleOnly(popsType, config);
26
36