hortimagic 1.0.1 → 1.0.3

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.d.ts CHANGED
@@ -24,10 +24,20 @@ declare function afterOnmessage(message: string): Promise<string>;
24
24
 
25
25
  declare function afterSend(message: string): string;
26
26
 
27
+ export declare namespace app_tools {
28
+ export {
29
+ notice,
30
+ confirm_2 as confirm
31
+ }
32
+ }
33
+
27
34
  declare namespace apps {
28
35
  export {
29
36
  main_app,
30
- example_app
37
+ example_app,
38
+ dialog_app,
39
+ script_app,
40
+ app_tools
31
41
  }
32
42
  }
33
43
  export { apps }
@@ -73,11 +83,23 @@ declare function compressCSS(css: string): string;
73
83
  */
74
84
  declare function compressHTML(html: string): string;
75
85
 
86
+ /**
87
+ * 确认弹窗函数
88
+ * @param message 消息提示
89
+ * @param confirmCallback 选择确认时的回调函数
90
+ * @param cancelCallback 选择取消时的回调函数
91
+ * @param closeCallback 关闭弹窗时的回调函数
92
+ * @example ```javascript
93
+ * hortimagic.apps.app_tools.confirm('hhhhhhhhhhhhhh',()=>{console.log('qqqqqqqqqqq')},()=>{console.log('cccccccccccc')})
94
+ * ```
95
+ */
96
+ declare function confirm_2(message: string, confirmCallback?: Function, cancelCallback?: Function, closeCallback?: Function): void;
97
+
76
98
  declare namespace core {
77
99
  export {
78
100
  tools,
79
101
  iirose_socket,
80
- eventEmitter,
102
+ event_emitter,
81
103
  Message,
82
104
  encoder,
83
105
  decoder,
@@ -131,6 +153,15 @@ export declare namespace dialog {
131
153
  }
132
154
  }
133
155
 
156
+ export declare namespace dialog_app {
157
+ export {
158
+ dialogApp,
159
+ initDialogApp
160
+ }
161
+ }
162
+
163
+ declare let dialogApp: HmDialogApp;
164
+
134
165
  /** 移动面板容器 */
135
166
  declare let dialogHolder: HTMLDivElement;
136
167
 
@@ -186,7 +217,7 @@ declare namespace encoder {
186
217
  }
187
218
  }
188
219
 
189
- declare namespace eventEmitter {
220
+ declare namespace event_emitter {
190
221
  export {
191
222
  TinyEmitter,
192
223
  emitter
@@ -286,11 +317,11 @@ declare function getUserProfilePictureUrl(): string | null;
286
317
  declare function getUserUid(): string | null;
287
318
 
288
319
  declare class Hidden {
289
- /** */
320
+ /** 消息的标题,名字?主题 */
290
321
  messageName: string;
291
- /** */
322
+ /** 发送过来的唯一标识 */
292
323
  uid: string;
293
- /** */
324
+ /** 数据 */
294
325
  data: string;
295
326
  /** 消息类型 */
296
327
  readonly messageClass = "hidden";
@@ -535,6 +566,18 @@ declare class HmDialog extends LitElement {
535
566
  render(): TemplateResult<1>;
536
567
  }
537
568
 
569
+ declare class HmDialogApp extends LitElement {
570
+ dialogOpen: boolean;
571
+ message: string;
572
+ closeCallback: Function | null;
573
+ cancelCallback: Function | null;
574
+ confirmCallback: Function | null;
575
+ /** 触发点击事件 */
576
+ handelClick(): void;
577
+ static styles: CSSResult;
578
+ render(): TemplateResult<1>;
579
+ }
580
+
538
581
  declare class HmIcon extends LitElement {
539
582
  icon: string;
540
583
  size: string;
@@ -852,6 +895,8 @@ export declare const information: {
852
895
  name: string;
853
896
  /** 项目版本 */
854
897
  version: string;
898
+ /** 项目更新日志 */
899
+ changelog: string;
855
900
  /** 项目描述 */
856
901
  description: string;
857
902
  /** 项目作者 */
@@ -865,6 +910,8 @@ export declare const information: {
865
910
  };
866
911
  /** 项目构建时间 */
867
912
  buildTime: string;
913
+ /** 项目是否注入完成 */
914
+ ingected: boolean;
868
915
  };
869
916
 
870
917
  /**
@@ -874,6 +921,9 @@ declare function ingectlocalScript(): void;
874
921
 
875
922
  declare function init(): Promise<void>;
876
923
 
924
+ /** 初始化对话框模块 */
925
+ declare function initDialogApp(): Promise<void>;
926
+
877
927
  /** 初始化移动面板容器 */
878
928
  declare function initDialogHolder(): void;
879
929
 
@@ -892,6 +942,8 @@ declare function initMovePanelHolder(): void;
892
942
  /** 初始化通知容器 */
893
943
  declare function initNotificationHolder(): void;
894
944
 
945
+ declare function initScriptApp(): Promise<HmMenu>;
946
+
895
947
  declare function initSocket(): Promise<void>;
896
948
 
897
949
  /**
@@ -972,6 +1024,9 @@ declare let movePanelItemMaxZindex: number;
972
1024
  */
973
1025
  declare function musicCard(typeId: string, title: string, singerName: string, coverUrl: string, color: string, resolutionRatio: string): string;
974
1026
 
1027
+ /**
1028
+ * 消失通知函数
1029
+ */
975
1030
  declare let notice: {
976
1031
  success(title: string, content: string, displayTime?: number): void;
977
1032
  warning(title: string, content: string, displayTime?: number): void;
@@ -982,8 +1037,7 @@ declare let notice: {
982
1037
  export declare namespace notification {
983
1038
  export {
984
1039
  initNotificationHolder,
985
- notificationHolder,
986
- notice
1040
+ notificationHolder
987
1041
  }
988
1042
  }
989
1043
 
@@ -1094,6 +1148,12 @@ declare class Script {
1094
1148
  constructor(name: string, url: string, enable?: boolean, ingected?: boolean);
1095
1149
  }
1096
1150
 
1151
+ export declare namespace script_app {
1152
+ export {
1153
+ initScriptApp
1154
+ }
1155
+ }
1156
+
1097
1157
  declare namespace script_tools {
1098
1158
  export {
1099
1159
  Script,
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "hortimagic",
3
3
  "private": false,
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
+ "changelog": "修复了对话框注册较晚的bug,增加了初始化完成的标志",
5
6
  "author": "Narlen",
6
7
  "description": "园艺魔法,花园插件",
7
8
  "keywords": [
@@ -28,7 +28,7 @@ export class HmDialog extends LitElement {
28
28
  left: 0;
29
29
  width: 100%;
30
30
  height: 100%;
31
- z-index: 1000;
31
+ z-index: 999999;
32
32
  }
33
33
  :host([isopen]) {
34
34
  display: block;
@@ -52,6 +52,7 @@ export class HmDialog extends LitElement {
52
52
  min-width: 300px;
53
53
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
54
54
  padding: 20px;
55
+ color:rgb(0,0,0)
55
56
  }
56
57
 
57
58
  .footer {
@@ -82,20 +83,20 @@ export class HmDialog extends LitElement {
82
83
  this.isOpen = false;
83
84
  this.dispatchEvent(new CustomEvent('hm-dialog-close'));
84
85
  }
85
-
86
+
86
87
  /** 确认,触发 dialog-close dialog-confirm事件*/
87
88
  confirm() {
88
89
  // console.debug("确认对话框事件");
89
90
  this.close();
90
91
  this.dispatchEvent(new CustomEvent('hm-dialog-confirm'));
91
92
  }
92
-
93
+
93
94
  /** 取消,触发 dialog-close dialog-cancel事件*/
94
95
  cancel() {
95
96
  this.close();
96
97
  this.dispatchEvent(new CustomEvent('hm-dialog-cancel'));
97
98
  }
98
-
99
+
99
100
  updated(changedProperties: Map<string, unknown>) {
100
101
  if (changedProperties.has('isOpen')) {
101
102
  if (this.isOpen) {
@@ -105,7 +106,7 @@ export class HmDialog extends LitElement {
105
106
  }
106
107
  }
107
108
  }
108
-
109
+
109
110
  render() {
110
111
  return html`
111
112
  <div class="overlay"
@@ -13,7 +13,8 @@ const iconMap = new Map([
13
13
  ['js', '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M10.77 7.3h.002c1.045.393 2.479.93 2.479 2.45a2.5 2.5 0 0 1-.224 1.02a2.5 2.5 0 0 1-1.515 1.364a2.5 2.5 0 0 1-1.035.115a2 2 0 0 1-.214.012a2.5 2.5 0 0 1-1.673-.65a2.52 2.52 0 0 1-.838-1.859c0-.202.078-.39.22-.532a.77.77 0 0 1 1.06 0a.74.74 0 0 1 .221.53c0 .952 1.041 1 1.25 1s1.25-.048 1.25-1c0-.413-.447-.648-1.514-1.048h-.003C9.19 8.307 7.753 7.77 7.753 6.25q.005-.537.224-1.02a2.5 2.5 0 0 1 .614-.842a2.5 2.5 0 0 1 .9-.52a3.5 3.5 0 0 1 2.023 0a2.52 2.52 0 0 1 1.738 2.381c0 .201-.078.39-.22.531a.77.77 0 0 1-1.061 0a.74.74 0 0 1-.22-.53c0-.952-1.041-1-1.25-1s-1.25.048-1.25 1c0 .413.447.648 1.514 1.048zM5.751 4.5c0-.2.078-.388.22-.53a.77.77 0 0 1 1.06 0c.142.141.22.33.22.53v5a2.75 2.75 0 0 1-4.695 1.945A2.73 2.73 0 0 1 1.75 9.5V9c0-.2.078-.388.22-.53a.77.77 0 0 1 1.061 0c.142.141.22.33.22.53v.5c0 .33.134.652.366.884c.465.465 1.303.465 1.768 0c.232-.233.366-.555.366-.884z"/></svg>'],
14
14
  ['filter', '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M3 4c2.01 2.59 7 9 7 9v7h4v-7s4.98-6.41 7-9z"/></svg>'],
15
15
  ['filter-off', '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M3.004 1.59L3 1.586L1.586 3l4.928 4.928L10 12.818V21h4v-5.585l7 7l1.41-1.41L3 1.595zm12.266 9.446L21 3H7.234z"/></svg>'],
16
-
16
+ ['eye', '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M16 11v2h-1v1h-1v1h-1v1h-2v-1h-1v-1H9v-1H8v-2h2v-1h1V8h2v1h1v1h1v1z"/><path fill="currentColor" d="M22 11V9h-1V8h-1V7h-1V6h-2V5H7v1H5v1H4v1H3v1H2v2H1v2h1v2h1v1h1v1h1v1h2v1h10v-1h2v-1h1v-1h1v-1h1v-2h1v-2zm-4 2h-1v2h-1v1h-1v1h-2v1h-2v-1H9v-1H8v-1H7v-2H6v-2h1V9h1V8h1V7h2V6h2v1h2v1h1v1h1v2h1z"/></svg>'],
17
+ ['eye-off', '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M2 13H1v-2h1V9h1V8h1V7h1V6h2V5h8v1h-1v1h-1V6h-2v1H9v1H8v1H7v2H6v2h1v1H6v1H5v1H3v-1H2z"/><path fill="currentColor" d="M8 11h1v1H8zm3-3h1v1h-1zm-2 9H8v1H7v1H6v1H5v1H4v1H3v-1H2v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1V9h1V8h1V7h1V6h1V5h1V4h1V3h1V2h1v1h1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1H9zm3-2h1v1h-1zm1-1h1v1h-1zm2-2h1v1h-1zm-1 1h1v1h-1z"/><path fill="currentColor" d="M23 11v2h-1v2h-1v1h-1v1h-1v1h-2v1H9v-1h1v-1h1v1h2v-1h2v-1h1v-1h1v-2h1v-2h-1v-1h1V9h1V8h2v1h1v2z"/></svg>'],
17
18
  ]);
18
19
 
19
20
  // 提供静态方法用于外部注册图标
@@ -45,4 +45,6 @@ declare global {
45
45
  // render() {
46
46
  // return html``;
47
47
  // }
48
- // }
48
+ // }
49
+
50
+ // customElements.define('hm-', Hm);