enr 2.0.5 → 2.0.7

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 (30) hide show
  1. package/components/ThemeContext/index.cjs.js +12 -14
  2. package/components/ThemeContext/index.es.js +1 -3
  3. package/customHooks/useRipples/class-event-action.cjs.js +1 -1
  4. package/customHooks/useRipples/class-event-action.d.ts +1 -1
  5. package/customHooks/useRipples/class-event-action.es.js +1 -1
  6. package/customHooks/useRipples/class-render-action.cjs.js +31 -26
  7. package/customHooks/useRipples/class-render-action.d.ts +3 -1
  8. package/customHooks/useRipples/class-render-action.es.js +31 -26
  9. package/customHooks/useRipples/class-render-data.cjs.js +49 -2
  10. package/customHooks/useRipples/class-render-data.d.ts +23 -2
  11. package/customHooks/useRipples/class-render-data.es.js +49 -2
  12. package/customHooks/useRipples/class-ripple.cjs.js +2 -2
  13. package/customHooks/useRipples/class-ripple.d.ts +1 -1
  14. package/customHooks/useRipples/class-ripple.es.js +2 -2
  15. package/customHooks/useRipples/types.d.ts +1 -1
  16. package/package.json +5 -5
  17. package/shared/dist/es/index.cjs.js +288 -0
  18. package/shared/dist/es/index.es.js +275 -0
  19. package/shared/dist/es/log-production.cjs.js +49 -2
  20. package/shared/dist/es/log-production.es.js +48 -1
  21. package/shared/dist/es/cookie.cjs.js +0 -80
  22. package/shared/dist/es/cookie.es.js +0 -78
  23. package/shared/dist/es/node_modules/.pnpm/@qqi_log@1.1.4/node_modules/@qqi/log/es/virtual-dog.cjs.js +0 -52
  24. package/shared/dist/es/node_modules/.pnpm/@qqi_log@1.1.4/node_modules/@qqi/log/es/virtual-dog.es.js +0 -50
  25. package/shared/dist/es/storage-store.cjs.js +0 -32
  26. package/shared/dist/es/storage-store.es.js +0 -30
  27. package/shared/dist/es/storage.cjs.js +0 -102
  28. package/shared/dist/es/storage.es.js +0 -92
  29. package/shared/dist/es/sys.cjs.js +0 -84
  30. package/shared/dist/es/sys.es.js +0 -82
@@ -1,80 +0,0 @@
1
- 'use strict';
2
-
3
- var aTypeOfJs = require('a-type-of-js');
4
-
5
- /**
6
- * @module @zza/cookie
7
- * @file cookie.ts
8
- * @description cookie 管理
9
- * @author Mr.MudBean <Mr.MudBean@outlook.com>
10
- * @copyright 2026 ©️ Mr.MudBean
11
- * @since 01/10/2025
12
- * @version 0.0.0
13
- * @lastModified 2026-03-25 16:10
14
- */
15
- const manageCookie = {
16
- getItem(keyItem) {
17
- return (decodeURIComponent(document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' +
18
- encodeURIComponent(keyItem).replace(/[-.+*]/g, '\\$&') +
19
- '\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1')) || null);
20
- },
21
- setItem(option) {
22
- const { keyItem, value, end, path, domain, secure } = option;
23
- if (!keyItem || /^(?:expires|max-age|path|domain|secure)$/i.test(keyItem)) {
24
- return false;
25
- }
26
- let expires = '';
27
- switch (aTypeOfJs.typeOf(end)) {
28
- case 'undefined':
29
- expires = '; expires=Fri, 31 Dec 9999 23:59:59 GMT';
30
- break;
31
- case 'number':
32
- expires =
33
- end === Infinity
34
- ? '; expires=Fri, 31 Dec 9999 23:59:59 GMT'
35
- : '; max-age=' + end;
36
- break;
37
- case 'string':
38
- expires = '; expires=' + end;
39
- break;
40
- case 'date':
41
- expires = '; expires=' + end.toUTCString();
42
- break;
43
- }
44
- document.cookie = encodeURIComponent(keyItem)
45
- .concat('=')
46
- .concat(encodeURIComponent(value))
47
- .concat(expires)
48
- .concat(domain ? '; domain='.concat(domain) : '')
49
- .concat(path ? '; path='.concat(path) : '')
50
- .concat(secure ? '; secure' : '');
51
- return true;
52
- },
53
- deleteItem(key, path, domain) {
54
- if (!key || !this.exist(key))
55
- return false;
56
- document.cookie = encodeURIComponent(key)
57
- .concat('=; expires=Thu, 01 Jan 1970 00:00:00 GMT')
58
- .concat(domain ? '; domain='.concat(domain) : '')
59
- .concat(path ? '; path='.concat(path) : '');
60
- return true;
61
- },
62
- /** 校验当前 key 是否存在 */
63
- exist(key) {
64
- const result = new RegExp('(?:^|;\\s*)' +
65
- encodeURIComponent(key).replace(/[-.+*]/g, '\\$&') +
66
- '\\s*\\=').test(document.cookie);
67
- return result;
68
- },
69
- keys() {
70
- const keyList = document.cookie
71
- .replace(/((?:^|\s*;)[^=]+)(?=;|$)|^\s*|\s*(?:=[^;]*)?(?:1|$)/g, '')
72
- .split(/\s*(?:=[^;]*)?;\s*/);
73
- for (let i = 0; i < keyList.length; i++) {
74
- keyList[i] = decodeURIComponent(keyList[i]);
75
- }
76
- return keyList;
77
- },
78
- };
79
-
80
- exports.manageCookie = manageCookie;
@@ -1,78 +0,0 @@
1
- import { typeOf } from 'a-type-of-js';
2
-
3
- /**
4
- * @module @zza/cookie
5
- * @file cookie.ts
6
- * @description cookie 管理
7
- * @author Mr.MudBean <Mr.MudBean@outlook.com>
8
- * @copyright 2026 ©️ Mr.MudBean
9
- * @since 01/10/2025
10
- * @version 0.0.0
11
- * @lastModified 2026-03-25 16:10
12
- */
13
- const manageCookie = {
14
- getItem(keyItem) {
15
- return (decodeURIComponent(document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' +
16
- encodeURIComponent(keyItem).replace(/[-.+*]/g, '\\$&') +
17
- '\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1')) || null);
18
- },
19
- setItem(option) {
20
- const { keyItem, value, end, path, domain, secure } = option;
21
- if (!keyItem || /^(?:expires|max-age|path|domain|secure)$/i.test(keyItem)) {
22
- return false;
23
- }
24
- let expires = '';
25
- switch (typeOf(end)) {
26
- case 'undefined':
27
- expires = '; expires=Fri, 31 Dec 9999 23:59:59 GMT';
28
- break;
29
- case 'number':
30
- expires =
31
- end === Infinity
32
- ? '; expires=Fri, 31 Dec 9999 23:59:59 GMT'
33
- : '; max-age=' + end;
34
- break;
35
- case 'string':
36
- expires = '; expires=' + end;
37
- break;
38
- case 'date':
39
- expires = '; expires=' + end.toUTCString();
40
- break;
41
- }
42
- document.cookie = encodeURIComponent(keyItem)
43
- .concat('=')
44
- .concat(encodeURIComponent(value))
45
- .concat(expires)
46
- .concat(domain ? '; domain='.concat(domain) : '')
47
- .concat(path ? '; path='.concat(path) : '')
48
- .concat(secure ? '; secure' : '');
49
- return true;
50
- },
51
- deleteItem(key, path, domain) {
52
- if (!key || !this.exist(key))
53
- return false;
54
- document.cookie = encodeURIComponent(key)
55
- .concat('=; expires=Thu, 01 Jan 1970 00:00:00 GMT')
56
- .concat(domain ? '; domain='.concat(domain) : '')
57
- .concat(path ? '; path='.concat(path) : '');
58
- return true;
59
- },
60
- /** 校验当前 key 是否存在 */
61
- exist(key) {
62
- const result = new RegExp('(?:^|;\\s*)' +
63
- encodeURIComponent(key).replace(/[-.+*]/g, '\\$&') +
64
- '\\s*\\=').test(document.cookie);
65
- return result;
66
- },
67
- keys() {
68
- const keyList = document.cookie
69
- .replace(/((?:^|\s*;)[^=]+)(?=;|$)|^\s*|\s*(?:=[^;]*)?(?:1|$)/g, '')
70
- .split(/\s*(?:=[^;]*)?;\s*/);
71
- for (let i = 0; i < keyList.length; i++) {
72
- keyList[i] = decodeURIComponent(keyList[i]);
73
- }
74
- return keyList;
75
- },
76
- };
77
-
78
- export { manageCookie };
@@ -1,52 +0,0 @@
1
- 'use strict';
2
-
3
- var aJsTools = require('a-js-tools');
4
-
5
- /**
6
- * @packageDocumentation
7
- * @module @qqi/log/virtual-dog
8
- * @file virtual-dog.ts
9
- * @description _
10
- * @author MrMudBean <Mr.MudBean@outlook.com>
11
- * @license MIT
12
- * @copyright 2026 ©️ MrMudBean
13
- * @since 2026-01-28 04:52
14
- * @version 1.1.0
15
- * @lastModified 2026-01-28 04:53
16
- */
17
- function DogVirtualImt() {
18
- var _dev = function () {
19
- };
20
- Object.setPrototypeOf(_dev, this);
21
- Object.defineProperties(this, {
22
- info: {
23
- value: function () {
24
- },
25
- configurable: false,
26
- writable: false,
27
- },
28
- warn: {
29
- value: function () {
30
- },
31
- configurable: false,
32
- writable: false,
33
- },
34
- error: {
35
- value: function () {
36
- },
37
- configurable: false,
38
- writable: false,
39
- },
40
- type: {
41
- get: function () {
42
- return false;
43
- },
44
- set: function (_) { },
45
- },
46
- });
47
- return _dev;
48
- }
49
- DogVirtualImt.prototype.clear = console.clear;
50
- var DogVirtualConstructor = aJsTools.createConstructor(DogVirtualImt);
51
-
52
- exports.DogVirtual = DogVirtualConstructor;
@@ -1,50 +0,0 @@
1
- import { createConstructor } from 'a-js-tools';
2
-
3
- /**
4
- * @packageDocumentation
5
- * @module @qqi/log/virtual-dog
6
- * @file virtual-dog.ts
7
- * @description _
8
- * @author MrMudBean <Mr.MudBean@outlook.com>
9
- * @license MIT
10
- * @copyright 2026 ©️ MrMudBean
11
- * @since 2026-01-28 04:52
12
- * @version 1.1.0
13
- * @lastModified 2026-01-28 04:53
14
- */
15
- function DogVirtualImt() {
16
- var _dev = function () {
17
- };
18
- Object.setPrototypeOf(_dev, this);
19
- Object.defineProperties(this, {
20
- info: {
21
- value: function () {
22
- },
23
- configurable: false,
24
- writable: false,
25
- },
26
- warn: {
27
- value: function () {
28
- },
29
- configurable: false,
30
- writable: false,
31
- },
32
- error: {
33
- value: function () {
34
- },
35
- configurable: false,
36
- writable: false,
37
- },
38
- type: {
39
- get: function () {
40
- return false;
41
- },
42
- set: function (_) { },
43
- },
44
- });
45
- return _dev;
46
- }
47
- DogVirtualImt.prototype.clear = console.clear;
48
- var DogVirtualConstructor = createConstructor(DogVirtualImt);
49
-
50
- export { DogVirtualConstructor as DogVirtual };
@@ -1,32 +0,0 @@
1
- 'use strict';
2
-
3
- var aTypeOfJs = require('a-type-of-js');
4
- var storage = require('./storage.cjs.js');
5
-
6
- /**
7
- * @packageDocumentation
8
- * @module @zza/storage-store
9
- * @file storage-store.ts
10
- * @description 共用的 storage 数仓
11
- * @author MrMudBean <Mr.MudBean@outlook.com>
12
- * @license MIT
13
- * @copyright 2026 ©️ MrMudBean
14
- * @since 2026-01-20 12:41
15
- * @version 0.0.0
16
- * @lastModified 2026-01-20 12:41
17
- */
18
- /** storage 的数据仓库 */
19
- const storageStore = {
20
- /** 获取本地的数据中的主题值 */
21
- get theme() {
22
- return storage.storageMainLogic.get('theme');
23
- },
24
- /** 设置本地的数据的主题值 */
25
- set theme(newTheme) {
26
- if (['light', 'dark'].includes(newTheme))
27
- storage.storageMainLogic.set('theme', newTheme);
28
- else if (aTypeOfJs.isBusinessEmptyString(newTheme))
29
- storage.storageMainLogic.del('theme');
30
- }};
31
-
32
- exports.storageStore = storageStore;
@@ -1,30 +0,0 @@
1
- import { isBusinessEmptyString } from 'a-type-of-js';
2
- import { storageMainLogic } from './storage.es.js';
3
-
4
- /**
5
- * @packageDocumentation
6
- * @module @zza/storage-store
7
- * @file storage-store.ts
8
- * @description 共用的 storage 数仓
9
- * @author MrMudBean <Mr.MudBean@outlook.com>
10
- * @license MIT
11
- * @copyright 2026 ©️ MrMudBean
12
- * @since 2026-01-20 12:41
13
- * @version 0.0.0
14
- * @lastModified 2026-01-20 12:41
15
- */
16
- /** storage 的数据仓库 */
17
- const storageStore = {
18
- /** 获取本地的数据中的主题值 */
19
- get theme() {
20
- return storageMainLogic.get('theme');
21
- },
22
- /** 设置本地的数据的主题值 */
23
- set theme(newTheme) {
24
- if (['light', 'dark'].includes(newTheme))
25
- storageMainLogic.set('theme', newTheme);
26
- else if (isBusinessEmptyString(newTheme))
27
- storageMainLogic.del('theme');
28
- }};
29
-
30
- export { storageStore };
@@ -1,102 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- /**
5
- * @packageDocumentation
6
- * @module @zza/storage
7
- * @file storage.ts
8
- * @description 本地存储
9
- * @author MrMudBean <Mr.MudBean@outlook.com>
10
- * @license MIT
11
- * @copyright 2026 ©️ MrMudBean
12
- * @since 2026-01-20 12:25
13
- * @version 0.0.0
14
- * @lastModified 2026-01-20 12:40
15
- */
16
- /**
17
- *
18
- * @param key
19
- * @param value
20
- */
21
- function set(key, value) {
22
- localStorage.setItem(key, JSON.stringify(value));
23
- }
24
- /**
25
- *
26
- * @param key
27
- */
28
- function get(key) {
29
- const value = localStorage.getItem(key);
30
- try {
31
- return (value != null && JSON.parse(value)) || '';
32
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
33
- }
34
- catch (error) {
35
- return (value || '');
36
- }
37
- }
38
- /**
39
- *
40
- * @param key
41
- */
42
- function getAndDel(key) {
43
- const value = get(key);
44
- del(key);
45
- return value;
46
- }
47
- /**
48
- *
49
- * @param key
50
- */
51
- function del(key) {
52
- return localStorage.removeItem(key);
53
- }
54
- /**
55
- *
56
- */
57
- function clear() {
58
- localStorage.clear();
59
- }
60
- /**
61
- *
62
- * @param key
63
- * @param value
64
- */
65
- function setSession(key, value) {
66
- sessionStorage.setItem(key, JSON.stringify(value));
67
- }
68
- /**
69
- *
70
- * @param key
71
- */
72
- function getSession(key) {
73
- const value = sessionStorage.getItem(key);
74
- return (value != null && JSON.parse(value)) || '';
75
- }
76
- /**
77
- *
78
- * @param key
79
- */
80
- function delSession(key) {
81
- return sessionStorage.removeItem(key);
82
- }
83
- const storageMainLogic = {
84
- del,
85
- set,
86
- get,
87
- getAndDel,
88
- clear,
89
- setSession,
90
- getSession,
91
- delSession,
92
- };
93
-
94
- exports.clearStorage = clear;
95
- exports.delSessionStorage = delSession;
96
- exports.delStorage = del;
97
- exports.getSessionStorage = getSession;
98
- exports.getStorage = get;
99
- exports.getStorageAndDel = getAndDel;
100
- exports.setSessionStorage = setSession;
101
- exports.setStorage = set;
102
- exports.storageMainLogic = storageMainLogic;
@@ -1,92 +0,0 @@
1
- 'use client';
2
- /**
3
- * @packageDocumentation
4
- * @module @zza/storage
5
- * @file storage.ts
6
- * @description 本地存储
7
- * @author MrMudBean <Mr.MudBean@outlook.com>
8
- * @license MIT
9
- * @copyright 2026 ©️ MrMudBean
10
- * @since 2026-01-20 12:25
11
- * @version 0.0.0
12
- * @lastModified 2026-01-20 12:40
13
- */
14
- /**
15
- *
16
- * @param key
17
- * @param value
18
- */
19
- function set(key, value) {
20
- localStorage.setItem(key, JSON.stringify(value));
21
- }
22
- /**
23
- *
24
- * @param key
25
- */
26
- function get(key) {
27
- const value = localStorage.getItem(key);
28
- try {
29
- return (value != null && JSON.parse(value)) || '';
30
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
31
- }
32
- catch (error) {
33
- return (value || '');
34
- }
35
- }
36
- /**
37
- *
38
- * @param key
39
- */
40
- function getAndDel(key) {
41
- const value = get(key);
42
- del(key);
43
- return value;
44
- }
45
- /**
46
- *
47
- * @param key
48
- */
49
- function del(key) {
50
- return localStorage.removeItem(key);
51
- }
52
- /**
53
- *
54
- */
55
- function clear() {
56
- localStorage.clear();
57
- }
58
- /**
59
- *
60
- * @param key
61
- * @param value
62
- */
63
- function setSession(key, value) {
64
- sessionStorage.setItem(key, JSON.stringify(value));
65
- }
66
- /**
67
- *
68
- * @param key
69
- */
70
- function getSession(key) {
71
- const value = sessionStorage.getItem(key);
72
- return (value != null && JSON.parse(value)) || '';
73
- }
74
- /**
75
- *
76
- * @param key
77
- */
78
- function delSession(key) {
79
- return sessionStorage.removeItem(key);
80
- }
81
- const storageMainLogic = {
82
- del,
83
- set,
84
- get,
85
- getAndDel,
86
- clear,
87
- setSession,
88
- getSession,
89
- delSession,
90
- };
91
-
92
- export { clear as clearStorage, delSession as delSessionStorage, del as delStorage, getSession as getSessionStorage, get as getStorage, getAndDel as getStorageAndDel, setSession as setSessionStorage, set as setStorage, storageMainLogic };
@@ -1,84 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- *
5
- */
6
- class SysInfo {
7
- /**
8
- *
9
- */
10
- #getMedia(str) {
11
- return (window?.matchMedia(/:/.test(str) && !/\(|\)/.test(str) ? `(${str})` : str)
12
- .matches ?? false);
13
- }
14
- /**
15
- * 设备振动
16
- **/
17
- vibrate() {
18
- if (window?.navigator?.vibrate)
19
- window.navigator.vibrate(200);
20
- }
21
- /**
22
- * 分享网站
23
- * @param [url='https://letmiseesee.pages.dev'] 网页地址 默认值 https://letmiseesee.pages.dev
24
- * @param [text=''] text 文本
25
- * @param [title='随笔记余生'] title 网站标题,缺省值
26
- * @description
27
- **/
28
- share(url = 'https://letmiseesee.pages.dev', text = '', title = '慧土灵核') {
29
- if (window?.navigator?.share)
30
- window.navigator.share({ url, text, title });
31
- }
32
- /**
33
- * 当前是否为手机设备
34
- **/
35
- isPhone() {
36
- return (!this.#getMedia('any-hover: hover') &&
37
- !this.#getMedia('any-pointer: fine') &&
38
- window?.navigator?.maxTouchPoints > 0);
39
- }
40
- /**
41
- * 当前设备是否为小平设备
42
- **/
43
- get isSmallScreen() {
44
- return this.#getMedia('max-width: 576px')
45
- ? 'small'
46
- : this.#getMedia('max-width: 996px')
47
- ? 'middle'
48
- : 'large';
49
- }
50
- /**
51
- * 是否为暗黑模式
52
- **/
53
- get isDark() {
54
- return this.#getMedia('prefers-color-scheme: dark');
55
- }
56
- /**
57
- * 设备当前的旋转状态
58
- *
59
- * 只返回是否旋转
60
- **/
61
- get isOrientation() {
62
- const orientation = (screen.orientation || {}).type ||
63
- /** @ts-expect-error: 兼容 moz 浏览器 */
64
- screen.mozOrientation ||
65
- /** @ts-expect-error: 兼容 ms 浏览器 */
66
- screen.msOrientation;
67
- /**
68
- *
69
- * - portrait-primary 旋转 360
70
- * - portrait-secondary 旋转 180
71
- * - landscape-primary 旋转 90
72
- * - landscape-secondary 旋转 270
73
- *
74
- *
75
- */
76
- if (orientation === 'landscape-primary' ||
77
- orientation === 'landscape-secondary')
78
- return false;
79
- return true;
80
- }
81
- }
82
- const sysInfo = new SysInfo();
83
-
84
- exports.sysInfo = sysInfo;
@@ -1,82 +0,0 @@
1
- /**
2
- *
3
- */
4
- class SysInfo {
5
- /**
6
- *
7
- */
8
- #getMedia(str) {
9
- return (window?.matchMedia(/:/.test(str) && !/\(|\)/.test(str) ? `(${str})` : str)
10
- .matches ?? false);
11
- }
12
- /**
13
- * 设备振动
14
- **/
15
- vibrate() {
16
- if (window?.navigator?.vibrate)
17
- window.navigator.vibrate(200);
18
- }
19
- /**
20
- * 分享网站
21
- * @param [url='https://letmiseesee.pages.dev'] 网页地址 默认值 https://letmiseesee.pages.dev
22
- * @param [text=''] text 文本
23
- * @param [title='随笔记余生'] title 网站标题,缺省值
24
- * @description
25
- **/
26
- share(url = 'https://letmiseesee.pages.dev', text = '', title = '慧土灵核') {
27
- if (window?.navigator?.share)
28
- window.navigator.share({ url, text, title });
29
- }
30
- /**
31
- * 当前是否为手机设备
32
- **/
33
- isPhone() {
34
- return (!this.#getMedia('any-hover: hover') &&
35
- !this.#getMedia('any-pointer: fine') &&
36
- window?.navigator?.maxTouchPoints > 0);
37
- }
38
- /**
39
- * 当前设备是否为小平设备
40
- **/
41
- get isSmallScreen() {
42
- return this.#getMedia('max-width: 576px')
43
- ? 'small'
44
- : this.#getMedia('max-width: 996px')
45
- ? 'middle'
46
- : 'large';
47
- }
48
- /**
49
- * 是否为暗黑模式
50
- **/
51
- get isDark() {
52
- return this.#getMedia('prefers-color-scheme: dark');
53
- }
54
- /**
55
- * 设备当前的旋转状态
56
- *
57
- * 只返回是否旋转
58
- **/
59
- get isOrientation() {
60
- const orientation = (screen.orientation || {}).type ||
61
- /** @ts-expect-error: 兼容 moz 浏览器 */
62
- screen.mozOrientation ||
63
- /** @ts-expect-error: 兼容 ms 浏览器 */
64
- screen.msOrientation;
65
- /**
66
- *
67
- * - portrait-primary 旋转 360
68
- * - portrait-secondary 旋转 180
69
- * - landscape-primary 旋转 90
70
- * - landscape-secondary 旋转 270
71
- *
72
- *
73
- */
74
- if (orientation === 'landscape-primary' ||
75
- orientation === 'landscape-secondary')
76
- return false;
77
- return true;
78
- }
79
- }
80
- const sysInfo = new SysInfo();
81
-
82
- export { sysInfo };