lupine.web 1.0.14

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.
Files changed (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/jsx-runtime/index.js +14 -0
  4. package/jsx-runtime/package.json +16 -0
  5. package/jsx-runtime/src/index.d.ts +2 -0
  6. package/package.json +51 -0
  7. package/src/assets/themes/base-themes.ts +16 -0
  8. package/src/assets/themes/dark-themes.ts +85 -0
  9. package/src/assets/themes/index.ts +4 -0
  10. package/src/assets/themes/light-themes.ts +92 -0
  11. package/src/assets/themes/shared-themes.ts +50 -0
  12. package/src/components/button-push-animation.tsx +138 -0
  13. package/src/components/button.tsx +55 -0
  14. package/src/components/drag-refresh.tsx +110 -0
  15. package/src/components/editable-label.tsx +83 -0
  16. package/src/components/float-window.tsx +226 -0
  17. package/src/components/grid.tsx +18 -0
  18. package/src/components/html-var.tsx +41 -0
  19. package/src/components/index.ts +36 -0
  20. package/src/components/input-with-title.tsx +24 -0
  21. package/src/components/link-item.tsx +13 -0
  22. package/src/components/link-list.tsx +62 -0
  23. package/src/components/menu-bar.tsx +220 -0
  24. package/src/components/menu-item-props.tsx +10 -0
  25. package/src/components/menu-sidebar.tsx +289 -0
  26. package/src/components/message-box.tsx +44 -0
  27. package/src/components/meta-data.tsx +54 -0
  28. package/src/components/meta-description.tsx +19 -0
  29. package/src/components/meta-title.tsx +19 -0
  30. package/src/components/modal.tsx +29 -0
  31. package/src/components/notice-message.tsx +119 -0
  32. package/src/components/paging-link.tsx +100 -0
  33. package/src/components/panel.tsx +24 -0
  34. package/src/components/popup-menu.tsx +218 -0
  35. package/src/components/progress.tsx +91 -0
  36. package/src/components/redirect.tsx +19 -0
  37. package/src/components/resizable-splitter.tsx +129 -0
  38. package/src/components/select-with-title.tsx +37 -0
  39. package/src/components/spinner.tsx +100 -0
  40. package/src/components/svg.tsx +24 -0
  41. package/src/components/tabs.tsx +252 -0
  42. package/src/components/text-glow.tsx +36 -0
  43. package/src/components/text-wave.tsx +54 -0
  44. package/src/components/theme-selector.tsx +35 -0
  45. package/src/components/toggle-base.tsx +260 -0
  46. package/src/components/toggle-switch.tsx +156 -0
  47. package/src/core/bind-attributes.ts +58 -0
  48. package/src/core/bind-lang.ts +51 -0
  49. package/src/core/bind-links.ts +16 -0
  50. package/src/core/bind-ref.ts +33 -0
  51. package/src/core/bind-styles.ts +180 -0
  52. package/src/core/bind-theme.ts +51 -0
  53. package/src/core/camel-to-hyphens.ts +3 -0
  54. package/src/core/core.ts +179 -0
  55. package/src/core/index.ts +15 -0
  56. package/src/core/mount-components.ts +259 -0
  57. package/src/core/page-loaded-events.ts +16 -0
  58. package/src/core/page-router.ts +170 -0
  59. package/src/core/replace-innerhtml.ts +10 -0
  60. package/src/core/server-cookie.ts +22 -0
  61. package/src/core/web-version.ts +12 -0
  62. package/src/global.d.ts +66 -0
  63. package/src/index.ts +15 -0
  64. package/src/jsx.ts +1041 -0
  65. package/src/lib/date-utils.ts +317 -0
  66. package/src/lib/debug-watch.ts +31 -0
  67. package/src/lib/deep-merge.ts +37 -0
  68. package/src/lib/document-ready.ts +36 -0
  69. package/src/lib/dom/calculate-text-width.ts +13 -0
  70. package/src/lib/dom/cookie.ts +41 -0
  71. package/src/lib/dom/download-stream.ts +17 -0
  72. package/src/lib/dom/download.ts +12 -0
  73. package/src/lib/dom/index.ts +71 -0
  74. package/src/lib/dynamical-load.ts +138 -0
  75. package/src/lib/format-bytes.ts +11 -0
  76. package/src/lib/index.ts +17 -0
  77. package/src/lib/lite-dom.ts +227 -0
  78. package/src/lib/logger.ts +55 -0
  79. package/src/lib/message-hub.ts +105 -0
  80. package/src/lib/observable.ts +188 -0
  81. package/src/lib/promise-timeout.ts +1 -0
  82. package/src/lib/simple-storage.ts +40 -0
  83. package/src/lib/stop-propagation.ts +7 -0
  84. package/src/lib/unique-id.ts +39 -0
  85. package/src/lib/upload-file.ts +68 -0
  86. package/src/lib/web-env.ts +98 -0
  87. package/src/models/index.ts +2 -0
  88. package/src/models/simple-storage-props.ts +9 -0
  89. package/src/models/to-client-delivery-props.ts +8 -0
  90. package/src/types/css-styles.ts +814 -0
  91. package/src/types/css-types.ts +17 -0
  92. package/src/types/index.ts +6 -0
  93. package/src/types/media-query.ts +93 -0
  94. package/tsconfig.json +113 -0
@@ -0,0 +1,138 @@
1
+ /*
2
+ * for my-apps
3
+ */
4
+ export class DynamicalLoad {
5
+ constructor() {}
6
+
7
+ loadScript(url: string, idForReplace?: string, removeOnLoaded = false): Promise<string> {
8
+ return new Promise((resolve, reject) => {
9
+ if (this.existScript(url, idForReplace)) {
10
+ resolve(url);
11
+ return;
12
+ }
13
+ const scriptDom = document.createElement('script');
14
+ scriptDom.src = url;
15
+ if (idForReplace) {
16
+ scriptDom.id = idForReplace;
17
+ }
18
+
19
+ scriptDom.onload = () => {
20
+ resolve(url);
21
+ if (removeOnLoaded) {
22
+ scriptDom.remove();
23
+ }
24
+ };
25
+
26
+ scriptDom.onerror = () => {
27
+ reject(new Error('Failed to load module script with URL ' + url));
28
+ if (removeOnLoaded) {
29
+ scriptDom.remove();
30
+ }
31
+ };
32
+
33
+ const head = document.getElementsByTagName('head')[0];
34
+ head ? head.appendChild(scriptDom) : document.documentElement.appendChild(scriptDom);
35
+ });
36
+ }
37
+
38
+ // TODO: more accuracy
39
+ existScript(url: string, id?: string) {
40
+ if (id) {
41
+ const scriptDom = document.getElementById(id);
42
+ if (scriptDom && scriptDom.tagName === 'SCRIPT') {
43
+ const src = (scriptDom as HTMLScriptElement).src.split('?')[0];
44
+ if (src.substring(src.length - url.length) === url) {
45
+ return true;
46
+ }
47
+ }
48
+ }
49
+
50
+ const scripts = document.scripts;
51
+ for (let i = 0; i < scripts.length; i++) {
52
+ const src = scripts[i].src.split('?')[0];
53
+ if (src.substring(src.length - url.length) === url) {
54
+ return true;
55
+ }
56
+ }
57
+ }
58
+
59
+ loadCss(url: string, idForReplace?: string): Promise<string> {
60
+ return new Promise((resolve, reject) => {
61
+ if (this.existCss(url, idForReplace)) {
62
+ resolve(url);
63
+ return;
64
+ }
65
+ if (idForReplace) {
66
+ const sheet = document.getElementById(idForReplace);
67
+ if (sheet && sheet.tagName === 'LINK') {
68
+ sheet.parentNode!.removeChild(sheet);
69
+ }
70
+ }
71
+
72
+ const linkDom = document.createElement('link');
73
+ linkDom.rel = 'stylesheet';
74
+ linkDom.type = 'text/css';
75
+ linkDom.href = url;
76
+ linkDom.media = 'all';
77
+ if (idForReplace) {
78
+ linkDom.id = idForReplace;
79
+ }
80
+ linkDom.onload = () => {
81
+ resolve(url);
82
+ };
83
+
84
+ linkDom.onerror = () => {
85
+ reject(new Error('Failed to load css with URL ' + url));
86
+ };
87
+
88
+ document.getElementsByTagName('head')[0].appendChild(linkDom);
89
+ });
90
+ }
91
+
92
+ // TODO: more accuracy
93
+ existCss(url: string, id?: string) {
94
+ if (id) {
95
+ const linkDom = document.getElementById(id);
96
+ if (linkDom && linkDom.tagName === 'LINK') {
97
+ const href = (<any>linkDom).href.split('?')[0];
98
+ if (href.substring(href.length - url.length) === url) {
99
+ return true;
100
+ }
101
+ }
102
+ }
103
+
104
+ const styles = document.styleSheets;
105
+ for (let i = 0; i < styles.length; i++) {
106
+ const linkDom = styles[i] as any;
107
+ const href = linkDom.href.split('?')[0];
108
+ if (href.substring(href.length - url.length) === url) {
109
+ return true;
110
+ }
111
+ }
112
+ }
113
+
114
+ // removeCss(url: string, id?: string) {
115
+ // if (id) {
116
+ // const sheet = document.getElementById(id);
117
+ // if (sheet && sheet instanceof HTMLElement) {
118
+ // const href = (<any>sheet).href;
119
+ // if (href.substring(href.length - url.length) === url) {
120
+ // (<any>sheet).disabled = true;
121
+ // sheet.parentNode.removeChild(sheet);
122
+ // return;
123
+ // }
124
+ // }
125
+ // }
126
+ // const styles = document.styleSheets;
127
+ // for (const i = 0; i < styles.length; i++) {
128
+ // const sheet = styles[i] as any;
129
+ // if (sheet.href.substring(sheet.href.length - url.length) === url) {
130
+ // sheet.disabled = true;
131
+ // sheet.ownerNode.parentNode.removeChild(sheet.ownerNode);
132
+ // return;
133
+ // }
134
+ // }
135
+ // }
136
+ }
137
+
138
+ export default new DynamicalLoad();
@@ -0,0 +1,11 @@
1
+ export const formatBytes = (bytes: number, decimals = 2) => {
2
+ if (!+bytes) return '0 Bytes';
3
+
4
+ const k = 1024;
5
+ const dm = decimals < 0 ? 0 : decimals;
6
+ const sizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
7
+
8
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
9
+
10
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
11
+ };
@@ -0,0 +1,17 @@
1
+ export * from './dom';
2
+ export * from './date-utils';
3
+ export * from './debug-watch';
4
+ export * from './deep-merge';
5
+ export * from './document-ready';
6
+ export * from './dynamical-load';
7
+ export * from './format-bytes';
8
+ export * from './lite-dom';
9
+ export * from './logger';
10
+ export * from './message-hub';
11
+ export * from './observable';
12
+ export * from './promise-timeout';
13
+ export * from './simple-storage';
14
+ export * from './stop-propagation';
15
+ export * from './unique-id';
16
+ export * from './upload-file';
17
+ export * from './web-env';
@@ -0,0 +1,227 @@
1
+ // Lite Dom Utils
2
+ /*
3
+ Don't judge whether this.node is valid, so it throws error when this.node is not found or undefined
4
+ */
5
+ export class LiteDom {
6
+ private node: Element;
7
+
8
+ static queryOne(selector?: string | Element | LiteDom, docRoot?: Element): LiteDom | null {
9
+ if (!selector) {
10
+ return null;
11
+ }
12
+ if (selector instanceof LiteDom) {
13
+ return selector;
14
+ }
15
+ if (selector instanceof Element) {
16
+ return new LiteDom(selector);
17
+ }
18
+ const el = (docRoot || document).querySelector(selector) as Element;
19
+ return el ? new LiteDom(el) : null;
20
+ }
21
+
22
+ static queryAll(selector?: string | Element | LiteDom, docRoot?: Element): LiteDom[] {
23
+ if (!selector) {
24
+ return [];
25
+ }
26
+ if (selector instanceof LiteDom) {
27
+ return [selector];
28
+ }
29
+ if (selector instanceof Element) {
30
+ return [new LiteDom(selector)];
31
+ }
32
+ const el = (docRoot || document).querySelectorAll(selector);
33
+ const ret = [];
34
+ for (let i in el) {
35
+ ret.push(new LiteDom(el[i] as Element));
36
+ }
37
+ return ret;
38
+ }
39
+
40
+ static createElement(html: string, docRoot?: Document): LiteDom {
41
+ const dom = (docRoot || document).createElement(html);
42
+ const domLib = new LiteDom(dom);
43
+ return domLib;
44
+ }
45
+
46
+ constructor(selector?: string | Element | LiteDom, docRoot?: Element) {
47
+ if (selector instanceof LiteDom) {
48
+ this.node = selector.node;
49
+ } else if (selector instanceof Element) {
50
+ this.node = selector;
51
+ } else {
52
+ const el = selector && ((docRoot || document).querySelector(selector) as Element);
53
+ if (el) {
54
+ this.node = el;
55
+ } else {
56
+ throw new TypeError('Element is not defined for a new LibDom');
57
+ }
58
+ }
59
+ }
60
+
61
+ getElement(): Element {
62
+ return this.node;
63
+ }
64
+
65
+ // query children and set value or innerHTML
66
+ $(selector: string, value?: string | number | boolean | null): LiteDom | null {
67
+ const dom = LiteDom.queryOne(selector, this.node);
68
+ if (dom && typeof value !== 'undefined') {
69
+ if ('checked' in dom.node) {
70
+ dom.node.checked = !!value;
71
+ } else if ('value' in dom.node) {
72
+ dom.node.value = value;
73
+ } else if ('innerHTML' in dom.node) {
74
+ dom.node.innerHTML = '' + value;
75
+ }
76
+ }
77
+ return dom;
78
+ }
79
+
80
+ // query children
81
+ query(selector: string): LiteDom | null {
82
+ return LiteDom.queryOne(selector, this.node);
83
+ }
84
+
85
+ // query children
86
+ queryAll(selector: string): LiteDom[] {
87
+ return LiteDom.queryAll(selector, this.node);
88
+ }
89
+
90
+ on(eventName: string, eventHandler: (this: Element, ev: any) => any) {
91
+ this.node.addEventListener(eventName, eventHandler, false);
92
+ return this;
93
+ }
94
+
95
+ off(eventName: string, eventHandler: (this: Element, ev: any) => any) {
96
+ this.node.removeEventListener(eventName, eventHandler, false);
97
+ return this;
98
+ }
99
+
100
+ fire(event: Event) {
101
+ this.node.dispatchEvent(event);
102
+ return this;
103
+ }
104
+
105
+ isCheckbox(): boolean {
106
+ return this.tagName === 'INPUT' && (this.node as any).type === 'checkbox';
107
+ }
108
+ isRadio(): boolean {
109
+ return this.tagName === 'INPUT' && (this.node as any).type === 'radio';
110
+ }
111
+
112
+ val(value?: string): string | LiteDom {
113
+ if (typeof value === 'undefined') {
114
+ return (<any>this.node).value;
115
+ }
116
+ 'value' in this.node && (this.node.value = value);
117
+ return this;
118
+ }
119
+
120
+ checked(value?: boolean) {
121
+ if (typeof value === 'undefined') {
122
+ return (<any>this.node).checked;
123
+ }
124
+ 'checked' in this.node && (this.node.checked = !!value);
125
+ return this;
126
+ }
127
+
128
+ selectedIndex(value?: number) {
129
+ if (typeof value === 'undefined') {
130
+ return (<any>this.node).selectedIndex;
131
+ }
132
+ 'selectedIndex' in this.node && (this.node.selectedIndex = value);
133
+ return this;
134
+ }
135
+
136
+ html(value?: string): string | LiteDom {
137
+ if (typeof value === 'undefined') {
138
+ return this.node.innerHTML;
139
+ }
140
+ 'innerHTML' in this.node && (this.node.innerHTML = value);
141
+ return this;
142
+ }
143
+
144
+ /*
145
+ element.style.backgroundColor = 'blue' // works
146
+ element.style['backgroundColor'] = 'blue' // works
147
+ element.style['background-color'] = 'blue' // does not work
148
+
149
+ element.style.setProperty('background-color','blue') // works
150
+ element.style.setProperty('backgroundColor','blue') // does not work
151
+ */
152
+ css(propertyName: string, value?: string): string | false | LiteDom {
153
+ if (typeof value === 'undefined') {
154
+ return this.node instanceof HTMLElement && this.node.style.getPropertyValue(propertyName);
155
+ }
156
+ if (this.node instanceof HTMLElement) {
157
+ if (value === null) {
158
+ this.node.style.removeProperty(propertyName);
159
+ } else {
160
+ this.node.style.setProperty(propertyName, value);
161
+ }
162
+ }
163
+ return this;
164
+ }
165
+
166
+ attribute(attributeName: string, value?: string): string | null | LiteDom {
167
+ if (typeof value === 'undefined') {
168
+ return this.node.getAttribute(attributeName);
169
+ }
170
+ if (value === null) {
171
+ this.node.removeAttribute(attributeName);
172
+ } else {
173
+ this.node.setAttribute(attributeName, value);
174
+ }
175
+ return this;
176
+ }
177
+
178
+ class(addClass?: string | string[], removeClass?: string | string[]): string | LiteDom {
179
+ if (!addClass && !removeClass) {
180
+ return (<any>this.node).className;
181
+ }
182
+ const classList = this.node.classList;
183
+ if (addClass) {
184
+ addClass instanceof Array ? classList.add(...addClass) : classList.add(addClass);
185
+ }
186
+ if (removeClass) {
187
+ removeClass instanceof Array ? classList.remove(...removeClass) : classList.remove(removeClass);
188
+ }
189
+ return this;
190
+ }
191
+
192
+ appendChild(child: Element | LiteDom) {
193
+ const dom = child instanceof LiteDom ? child.getElement() : child;
194
+ dom && this.node.appendChild(dom);
195
+ return this;
196
+ }
197
+
198
+ removeChild(child: Element | LiteDom) {
199
+ const dom = child instanceof LiteDom ? child.getElement() : child;
200
+ dom && this.node.removeChild(dom);
201
+ return this;
202
+ }
203
+
204
+ removeSelf() {
205
+ // this.node.parentElement!.removeChild(this.node);
206
+ this.node.remove();
207
+ return this;
208
+ }
209
+
210
+ get children(): LiteDom[] {
211
+ if (!this.node.children) {
212
+ return [];
213
+ }
214
+ const ret = [];
215
+ for (let i = 0; i < this.node.children.length; i++) {
216
+ ret.push(new LiteDom(this.node.children[i]));
217
+ }
218
+ return ret;
219
+ }
220
+
221
+ // originally returns the HTML-uppercased qualified name.
222
+ get tagName(): string {
223
+ return this.node.tagName.toUpperCase();
224
+ }
225
+ }
226
+
227
+ export default LiteDom.queryOne;
@@ -0,0 +1,55 @@
1
+ // Colors for console
2
+ export const ConsoleColors = {
3
+ Red: '#f44336',
4
+ Pink: '#e81e63',
5
+ Purple: '#9c27b0',
6
+ DeepPurple: '#673ab7',
7
+ Indigo: '#3f51b5',
8
+ Blue: '#2196f3',
9
+ LightBlue: '#03a9f4',
10
+ Cyan: '#00bcd4',
11
+ Teal: '#009688',
12
+ Green: '#4caf50',
13
+ LightGreen: '#8bc34a',
14
+ Lime: '#cddc39',
15
+ DarkYellow: '#bfa40e',
16
+ Amber: '#ffc107',
17
+ Orange: '#ff9800',
18
+ DeepOrange: '#ff5722',
19
+ Silver: '#c0c0c0',
20
+ Gray: '#808080',
21
+ Black: '#000000',
22
+ };
23
+
24
+ export class Logger {
25
+ private static enabled = true;
26
+ private namespace = '';
27
+ private color = '';
28
+ constructor(namespace: string, color?: string) {
29
+ this.namespace = namespace ? `[${namespace}] ` : '';
30
+ if (color) {
31
+ this.color = 'color:' + color;
32
+ }
33
+ }
34
+
35
+ static setEnabled(enabled: boolean) {
36
+ enabled && !Logger.enabled && console.log(`Logger is enabled.`);
37
+ Logger.enabled = enabled;
38
+ }
39
+
40
+ log(message: string, ...data: (string | object | number | undefined)[]) {
41
+ Logger.enabled && console.log(`%c${this.timestamp()} ${this.namespace}${message}`, this.color, ...data);
42
+ }
43
+
44
+ timestamp(date?: Date) {
45
+ return (date || new Date()).toJSON().substring(11, 23);
46
+ }
47
+
48
+ warn(message: string, ...data: (string | object | number | undefined)[]) {
49
+ console.warn(`%c${this.timestamp()} ${this.namespace}${message}`, this.color, ...data);
50
+ }
51
+
52
+ error(message: string, ...data: (string | object | number | undefined)[]) {
53
+ console.error(`%c${this.timestamp()} ${this.namespace}${message}`, this.color, ...data);
54
+ }
55
+ }
@@ -0,0 +1,105 @@
1
+ export class MessageHubData<T> {
2
+ constructor(public actionId: string, public message: string, public extraData?: T) {}
3
+ }
4
+ export class MessageHub {
5
+ private subscriptions: { [key: string]: { [key: string]: Function } } = {};
6
+ private subscriptionValues: { [key: string]: any } = {};
7
+ private lastId = 0;
8
+ constructor(public passLastMsgWhenSubscribe = false) {}
9
+
10
+ // * for listening to all events
11
+ public subscribe(targetType: string, fn: Function, recessiveLassMsg = true) {
12
+ const id = this.lastId++;
13
+ if (!this.subscriptions[targetType]) {
14
+ this.subscriptions[targetType] = {};
15
+ }
16
+ this.subscriptions[targetType][id] = fn;
17
+ if (recessiveLassMsg && this.passLastMsgWhenSubscribe && this.subscriptionValues[targetType]) {
18
+ this.notify(fn, this.subscriptionValues[targetType]);
19
+ }
20
+
21
+ return () => {
22
+ delete this.subscriptions[targetType][id];
23
+ var needDestroy = true;
24
+ for (var key in this.subscriptions[targetType]) {
25
+ needDestroy = false;
26
+ break;
27
+ }
28
+ if (needDestroy) {
29
+ delete this.subscriptions[targetType];
30
+ }
31
+ };
32
+ }
33
+
34
+ public send(targetType: string, arg: any) {
35
+ if (targetType === '*') {
36
+ for (var groupKey in this.subscriptions) {
37
+ for (var key in this.subscriptions[groupKey]) {
38
+ this.notify(this.subscriptions[groupKey][key], arg);
39
+ }
40
+ }
41
+ return;
42
+ }
43
+
44
+ if (this.passLastMsgWhenSubscribe) {
45
+ this.subscriptionValues[targetType] = arg;
46
+ }
47
+
48
+ if (this.subscriptions[targetType]) {
49
+ for (var key in this.subscriptions[targetType]) {
50
+ this.notify(this.subscriptions[targetType][key], arg);
51
+ }
52
+ }
53
+ if (this.subscriptions['*']) {
54
+ for (var key in this.subscriptions['*']) {
55
+ this.notify(this.subscriptions['*'][key], arg);
56
+ }
57
+ }
58
+ }
59
+
60
+ public hasListener(targetType: string): boolean {
61
+ if (targetType === '*') {
62
+ // if has any subscriptions
63
+ for (var groupKey in this.subscriptions) {
64
+ return true;
65
+ }
66
+ } else {
67
+ // if has any subscriptions of eventType
68
+ for (var groupKey in this.subscriptions[targetType]) {
69
+ return true;
70
+ }
71
+ }
72
+ return false;
73
+ }
74
+
75
+ private notify(fn: Function, arg: any) {
76
+ setTimeout(() => {
77
+ fn(arg);
78
+ }, 0);
79
+ }
80
+ }
81
+
82
+ export const defaultMessageHub = new MessageHub();
83
+
84
+ // /*[TEST-START]*/
85
+ // function TEST_sample() {
86
+ // var mHub = new MessageHub(true);
87
+ // var unsubscribeA = mHub.subscribe('test', (msg: string) => {
88
+ // console.log('MessageHub test', msg);
89
+ // });
90
+ // var unsubscribeB = mHub.subscribe('*', (msg: string) => {
91
+ // console.log('MessageHub *', msg);
92
+ // });
93
+ // console.log(mHub.hasListener('test'));
94
+
95
+ // mHub.send('test', new MessageHubData('aa', 'bb'));
96
+ // mHub.send('*', new MessageHubData('aa*', 'bb*'));
97
+
98
+ // unsubscribeA();
99
+ // mHub.send('test', new MessageHubData('aa', 'bb'));
100
+ // unsubscribeB();
101
+ // mHub.send('*', new MessageHubData<string>('aa to * 2', 'bb', 'extra message'));
102
+ // console.log(mHub.hasListener('test'));
103
+ // }
104
+ // // TEST_sample();
105
+ // /*[TEST-END]*/