vite-uni-dev-tool 0.0.48 → 1.0.0
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/README.md +20 -0
- package/dist/const.cjs +1 -0
- package/dist/const.d.ts +78 -161
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +1 -47
- package/dist/core-shared.d.ts +44 -0
- package/dist/core-shared.d.ts.map +1 -0
- package/dist/core-shared.js +1 -0
- package/dist/core.d.ts +2 -40
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +4 -159
- package/dist/i18n/index.cjs +1 -0
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/instance.cjs +1 -0
- package/dist/i18n/instance.d.ts +15 -0
- package/dist/i18n/instance.d.ts.map +1 -0
- package/dist/i18n/instance.js +1 -0
- package/dist/i18n/locales/en.cjs +1 -0
- package/dist/i18n/locales/en.d.ts +470 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/zh-Hans.cjs +1 -0
- package/dist/i18n/locales/zh-Hans.d.ts +476 -0
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -0
- package/dist/i18n/locales/zh-Hans.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/devConsole/index.cjs +4 -0
- package/dist/{devConsole → modules/devConsole}/index.d.ts +1 -1
- package/dist/modules/devConsole/index.d.ts.map +1 -0
- package/dist/modules/devConsole/index.js +4 -0
- package/dist/modules/devEvent/index.cjs +5 -0
- package/dist/modules/devEvent/index.d.ts +115 -0
- package/dist/modules/devEvent/index.d.ts.map +1 -0
- package/dist/modules/devEvent/index.js +5 -0
- package/dist/modules/devIntercept/index.cjs +13 -0
- package/dist/modules/devIntercept/index.d.ts +71 -0
- package/dist/modules/devIntercept/index.d.ts.map +1 -0
- package/dist/modules/devIntercept/index.js +13 -0
- package/dist/modules/devStore/index.cjs +1 -0
- package/dist/modules/devStore/index.d.ts +159 -0
- package/dist/modules/devStore/index.d.ts.map +1 -0
- package/dist/modules/devStore/index.js +1 -0
- package/dist/modules/devToolInfo/index.cjs +1 -0
- package/dist/modules/devToolInfo/index.d.ts +27 -0
- package/dist/modules/devToolInfo/index.d.ts.map +1 -0
- package/dist/modules/devToolInfo/index.js +1 -0
- package/dist/plugins/uniDevTool/transform/transformApp.cjs +44 -0
- package/dist/plugins/uniDevTool/transform/transformApp.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformApp.js +17 -17
- package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -0
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.js +3 -3
- package/dist/plugins/uniDevTool/transform/transformVue.cjs +41 -0
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts +1 -2
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformVue.js +32 -19
- package/dist/plugins/uniDevTool/uniDevTool.cjs +5 -0
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -11
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.cjs +19 -0
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +1 -1
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.js +11 -19
- package/dist/plugins/uniParseStock/index.d.ts +10 -0
- package/dist/plugins/uniParseStock/index.d.ts.map +1 -0
- package/dist/plugins/utils/index.cjs +2 -0
- package/dist/plugins/utils/index.d.ts +1 -3
- package/dist/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +2 -2
- package/dist/shims-uni.d.ts +140 -0
- package/dist/type.d.ts +174 -16
- package/dist/type.d.ts.map +1 -1
- package/dist/utils/array.cjs +1 -0
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js +1 -12
- package/dist/utils/date.cjs +1 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +1 -59
- package/dist/utils/file.cjs +1 -0
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +1 -85
- package/dist/utils/function.cjs +1 -0
- package/dist/utils/function.d.ts +13 -0
- package/dist/utils/function.d.ts.map +1 -1
- package/dist/utils/function.js +1 -68
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -63
- package/dist/utils/ip.cjs +1 -0
- package/dist/utils/ip.d.ts +1 -1
- package/dist/utils/ip.d.ts.map +1 -1
- package/dist/utils/ip.js +1 -45
- package/dist/utils/language.cjs +1 -0
- package/dist/utils/language.d.ts +2 -1
- package/dist/utils/language.d.ts.map +1 -1
- package/dist/utils/language.js +1 -63
- package/dist/utils/object.cjs +1 -0
- package/dist/utils/object.d.ts +4 -5
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +1 -136
- package/dist/utils/openLink.cjs +1 -0
- package/dist/utils/openLink.d.ts.map +1 -1
- package/dist/utils/openLink.js +1 -28
- package/dist/utils/page.cjs +1 -0
- package/dist/utils/page.d.ts.map +1 -1
- package/dist/utils/page.js +1 -7
- package/dist/utils/platform.cjs +1 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +1 -17
- package/dist/utils/string.cjs +1 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +1 -114
- package/dist/utils/utils.cjs +1 -0
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +1 -126
- package/dist/v3/AppTransition/index.vue +170 -0
- package/dist/v3/AutoSizer/index.vue +4 -5
- package/dist/v3/AutoSizer/index1.vue +4 -6
- package/dist/v3/AutoSizer/utils.ts +1 -1
- package/dist/v3/CaptureScreen/index.vue +19 -8
- package/dist/v3/CircularButton/index.vue +64 -13
- package/dist/v3/ConsoleList/ConsoleItem.vue +56 -5
- package/dist/v3/ConsoleList/RunJSInput.vue +10 -6
- package/dist/v3/ConsoleList/index.vue +51 -35
- package/dist/v3/CustomSwiper/CustomSwiperItem.vue +49 -0
- package/dist/v3/CustomSwiper/index.vue +104 -0
- package/dist/v3/DevTool/fps-collector.render.ts +148 -0
- package/dist/v3/DevTool/index.vue +209 -102
- package/dist/v3/DevToolButton/index.vue +40 -59
- package/dist/v3/DevToolTitle/index.vue +4 -1
- package/dist/v3/DevToolWindow/DevToolOverlay.vue +182 -0
- package/dist/v3/DevToolWindow/const.ts +47 -69
- package/dist/v3/DevToolWindow/hooks/dataUtils.ts +48 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolData.ts +338 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolHandlers.ts +549 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolOverlay.ts +184 -0
- package/dist/v3/DevToolWindow/index.css +89 -0
- package/dist/v3/DevToolWindow/index.vue +800 -1450
- package/dist/v3/DraggableContainer/index.vue +456 -0
- package/dist/v3/ElEvent/ElEventItem.vue +4 -3
- package/dist/v3/ElEvent/index.vue +26 -9
- package/dist/v3/Empty/index.vue +1 -0
- package/dist/v3/FilterInput/index.vue +8 -22
- package/dist/v3/FilterSelect/index.vue +37 -24
- package/dist/v3/Instance/components/InstanceTreeNode.vue +265 -0
- package/dist/v3/Instance/flatten.ts +226 -0
- package/dist/v3/Instance/index.vue +94 -0
- package/dist/v3/Instance/registry.ts +49 -0
- package/dist/v3/Instance/transformTree.ts +375 -0
- package/dist/v3/Instance/transformTreeCtx.ts +268 -0
- package/dist/v3/{InstanceTree → Instance}/typing.d.ts +15 -2
- package/dist/v3/InstanceDetail/index.vue +433 -44
- package/dist/v3/JsonDetail/index.vue +12 -8
- package/dist/v3/JsonPretty/components/Brackets/index.vue +1 -0
- package/dist/v3/JsonPretty/components/Carets/index.vue +2 -1
- package/dist/v3/JsonPretty/components/CheckController/index.vue +26 -15
- package/dist/v3/JsonPretty/components/TreeNode/index.vue +42 -20
- package/dist/v3/JsonPretty/index.vue +60 -37
- package/dist/v3/JsonPretty/utils/index.ts +41 -44
- package/dist/v3/MovableContainer/index.vue +89 -0
- package/dist/v3/NFCList/NFCItem.vue +14 -14
- package/dist/v3/NFCList/NFCTool.vue +99 -81
- package/dist/v3/NFCList/index.vue +14 -10
- package/dist/v3/NetworkList/InterceptConfig.vue +154 -364
- package/dist/v3/NetworkList/InterceptItem.vue +14 -6
- package/dist/v3/NetworkList/NetworkDetail.vue +34 -29
- package/dist/v3/NetworkList/NetworkIntercept.vue +11 -8
- package/dist/v3/NetworkList/NetworkItem.vue +27 -11
- package/dist/v3/NetworkList/NetworkSend.vue +132 -290
- package/dist/v3/NetworkList/hooks/useNetworkForm.ts +86 -0
- package/dist/v3/NetworkList/index.vue +32 -24
- package/dist/v3/NetworkList/utils.ts +101 -0
- package/dist/v3/Performance/index.vue +495 -0
- package/dist/v3/Performance/modules/PerformanceMetrics.vue +153 -0
- package/dist/v3/Performance/modules/PerformanceWidget.vue +249 -0
- package/dist/v3/Performance/modules/usePerformanceChart.ts +460 -0
- package/dist/v3/Performance/modules/usePerformanceData.ts +258 -0
- package/dist/v3/Pick/index.vue +322 -0
- package/dist/v3/PiniaList/index.vue +38 -17
- package/dist/v3/RouteList/index.vue +32 -15
- package/dist/v3/RunJS/index.vue +30 -10
- package/dist/v3/ScanCodeList/ScanCodeItem.vue +2 -9
- package/dist/v3/ScanCodeList/index.vue +12 -9
- package/dist/v3/SettingButton/index.vue +45 -0
- package/dist/v3/SettingList/index.css +120 -0
- package/dist/v3/SettingList/index.vue +96 -537
- package/dist/v3/SettingList/modules/SettingDevTool.vue +208 -0
- package/dist/v3/SettingList/modules/SettingInfo.vue +119 -0
- package/dist/v3/SettingList/modules/SettingLanguage.vue +74 -0
- package/dist/v3/SettingList/modules/SettingLog.vue +230 -0
- package/dist/v3/SettingList/modules/SettingNetwork.vue +120 -0
- package/dist/v3/SettingList/modules/SettingTheme.vue +312 -0
- package/dist/v3/SourceCode/Line.vue +15 -2
- package/dist/v3/SourceCode/index.vue +25 -24
- package/dist/v3/SourceCode/parseCode.ts +114 -56
- package/dist/v3/StorageList/index.vue +33 -33
- package/dist/v3/Tabs/index.vue +31 -28
- package/dist/v3/Tag/index.vue +39 -20
- package/dist/v3/TransferList/TransferDetail.vue +268 -0
- package/dist/v3/TransferList/TransferItem.vue +125 -0
- package/dist/v3/TransferList/index.vue +181 -0
- package/dist/v3/UniEvent/UniEventItem.vue +1 -0
- package/dist/v3/UniEvent/index.vue +28 -29
- package/dist/v3/{VirtualListPro → VirtualList}/AutoSize.vue +1 -1
- package/dist/v3/VirtualList/index.vue +382 -82
- package/dist/v3/VuexList/index.vue +38 -17
- package/dist/v3/WebSocket/WebSocketDetail.vue +142 -80
- package/dist/v3/WebSocket/WebSocketItem.vue +10 -4
- package/dist/v3/WebSocket/index.vue +44 -30
- package/dist/v3/hooks/useNFC/index.ts +6 -6
- package/dist/v3/hooks/useNFC/typing.d.ts +2 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.ts +215 -626
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.ts +54 -85
- package/dist/v3/hooks/useNFC/utils.ts +3 -3
- package/dist/v3/hooks/useRequest/index.ts +2 -2
- package/dist/v3/hooks/useScanCode/index.ts +10 -8
- package/dist/v3/styles/theme.css +290 -0
- package/dist/v3/styles/theme.ts +12 -0
- package/package.json +25 -5
- package/dist/devConsole/index.d.ts.map +0 -1
- package/dist/devConsole/index.js +0 -273
- package/dist/devEvent/index.d.ts +0 -328
- package/dist/devEvent/index.d.ts.map +0 -1
- package/dist/devEvent/index.js +0 -697
- package/dist/devEventBus/index.d.ts +0 -42
- package/dist/devEventBus/index.d.ts.map +0 -1
- package/dist/devEventBus/index.js +0 -70
- package/dist/devIntercept/index.d.ts +0 -281
- package/dist/devIntercept/index.d.ts.map +0 -1
- package/dist/devIntercept/index.js +0 -949
- package/dist/devRunJS/index.d.ts +0 -67
- package/dist/devRunJS/index.d.ts.map +0 -1
- package/dist/devStore/index.d.ts +0 -199
- package/dist/devStore/index.d.ts.map +0 -1
- package/dist/devStore/index.js +0 -562
- package/dist/devToolInfo/index.d.ts +0 -17
- package/dist/devToolInfo/index.d.ts.map +0 -1
- package/dist/devToolInfo/index.js +0 -15
- package/dist/v3/AutoSizer/utils.d.ts +0 -5
- package/dist/v3/AutoSizer/utils.d.ts.map +0 -1
- package/dist/v3/ConsoleList/staticTips.d.ts +0 -13
- package/dist/v3/ConsoleList/staticTips.d.ts.map +0 -1
- package/dist/v3/DevToolWindow/const.d.ts +0 -46
- package/dist/v3/DevToolWindow/const.d.ts.map +0 -1
- package/dist/v3/InstanceTree/components/InstanceTreeNode.vue +0 -81
- package/dist/v3/InstanceTree/flatten.d.ts +0 -10
- package/dist/v3/InstanceTree/flatten.d.ts.map +0 -1
- package/dist/v3/InstanceTree/flatten.ts +0 -75
- package/dist/v3/InstanceTree/index.vue +0 -51
- package/dist/v3/InstanceTree/transformTree.d.ts +0 -17
- package/dist/v3/InstanceTree/transformTree.d.ts.map +0 -1
- package/dist/v3/InstanceTree/transformTree.ts +0 -237
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +0 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +0 -1
- package/dist/v3/JsonPretty/hooks/useError.d.ts +0 -8
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +0 -1
- package/dist/v3/JsonPretty/type.d.ts +0 -94
- package/dist/v3/JsonPretty/type.d.ts.map +0 -1
- package/dist/v3/JsonPretty/utils/index.d.ts +0 -10
- package/dist/v3/JsonPretty/utils/index.d.ts.map +0 -1
- package/dist/v3/NFCList/const.d.ts +0 -13
- package/dist/v3/NFCList/const.d.ts.map +0 -1
- package/dist/v3/NetworkList/const.d.ts +0 -5
- package/dist/v3/NetworkList/const.d.ts.map +0 -1
- package/dist/v3/SourceCode/parseCode.d.ts +0 -27
- package/dist/v3/SourceCode/parseCode.d.ts.map +0 -1
- package/dist/v3/UploadList/UploadDetail.vue +0 -255
- package/dist/v3/UploadList/UploadItem.vue +0 -122
- package/dist/v3/UploadList/index.vue +0 -125
- package/dist/v3/VirtualListPro/index.vue +0 -229
- package/dist/v3/hooks/useContainerStyle.d.ts +0 -15
- package/dist/v3/hooks/useContainerStyle.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/index.d.ts +0 -5
- package/dist/v3/hooks/useNFC/index.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/utils.d.ts +0 -95
- package/dist/v3/hooks/useNFC/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/index.d.ts +0 -126
- package/dist/v3/hooks/useRequest/index.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/utils.d.ts +0 -35
- package/dist/v3/hooks/useRequest/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useScanCode/index.d.ts +0 -36
- package/dist/v3/hooks/useScanCode/index.d.ts.map +0 -1
- /package/dist/v3/{VirtualListPro → VirtualList}/readme.md +0 -0
package/dist/utils/openLink.js
CHANGED
|
@@ -1,28 +1 @@
|
|
|
1
|
-
function e(t)
|
|
2
|
-
if (t)
|
|
3
|
-
switch (uni.__dev_tool_platform__) {
|
|
4
|
-
case "web":
|
|
5
|
-
window.open(t);
|
|
6
|
-
return;
|
|
7
|
-
case "app":
|
|
8
|
-
uni.setClipboardData({
|
|
9
|
-
data: t
|
|
10
|
-
}), plus.runtime.openURL(t);
|
|
11
|
-
return;
|
|
12
|
-
default:
|
|
13
|
-
uni.showModal({
|
|
14
|
-
title: "提示",
|
|
15
|
-
content: `请自行打开链接: ${t}`,
|
|
16
|
-
confirmText: "复制",
|
|
17
|
-
success: function(n) {
|
|
18
|
-
n.confirm && uni.setClipboardData({
|
|
19
|
-
data: t
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
e as openOutLink
|
|
28
|
-
};
|
|
1
|
+
function e(t){if(t)switch(uni.__dev_tool_platform__){case"web":window.open(t);return;case"app":uni.setClipboardData({data:t}),plus.runtime.openURL(t);return;default:uni.showModal({title:"提示",content:`请自行打开链接: ${t}`,confirmText:"复制",success:function(n){n.confirm&&uni.setClipboardData({data:t})}});return}}export{e as openOutLink};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(){const t=getCurrentPages(),e=t[t.length-1];return e&&e.route?e.route:""}exports.getCurrentPagePath=r;
|
package/dist/utils/page.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/utils/page.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,kBAAkB,WAOjC"}
|
package/dist/utils/page.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i={};function e(){return i.UNI_PLATFORM==="h5"}function n(){return i.UNI_PLATFORM==="mp-weixin"}function r(){return i.UNI_PLATFORM==="app"||i.UNI_PLATFORM==="app-plus"}exports.isAndroid=r;exports.isH5=e;exports.isWX=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/utils/platform.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,IAAI,OAAO,CAG9B;AAED,wBAAgB,IAAI,YAGnB;AAED,wBAAgB,SAAS,YAOxB"}
|
package/dist/utils/platform.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
function n() {
|
|
2
|
-
return !0;
|
|
3
|
-
}
|
|
4
|
-
function r() {
|
|
5
|
-
return !1;
|
|
6
|
-
}
|
|
7
|
-
function t() {
|
|
8
|
-
return (
|
|
9
|
-
//@ts-ignore
|
|
10
|
-
!1
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
t as isAndroid,
|
|
15
|
-
n as isH5,
|
|
16
|
-
r as isWX
|
|
17
|
-
};
|
|
1
|
+
var n={};function e(){return n.UNI_PLATFORM==="h5"}function i(){return n.UNI_PLATFORM==="mp-weixin"}function r(){return n.UNI_PLATFORM==="app"||n.UNI_PLATFORM==="app-plus"}export{r as isAndroid,e as isH5,i as isWX};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(e="",t=""){if(!e)return"";if(!t)return e;const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(n,"gi");return e.replace(o,l=>`<span style="color:#fff; background-color: var(--dev-tool-main-color);">${l}</span>`)}function s(e){if(!e)return"";const t={"&":"&",'"':""","'":"'",">":">","<":"<","=":"=","+":"+","-":"-","(":"(",")":")","[":"[","]":"]","{":"{","}":"}",".":".","?":"?","/":"/",":":":"};return e.replace(/[&"'><=+\-().?/:[\]{}]/g,n=>t[n]||n)}const c=/https?:\/\/[^\s/$.?#](?:(?!\s|\)).)*/g;function i(e){const t=e.match(c);return t?t[0]:""}const p=/:(\d+)(?::(\d+))?\)?$/;function a(e){const t=e.match(p);if(t){const n=t[1],o=t[2];return{row:parseInt(n)-1,col:parseInt(o)-1}}return{row:-1,col:-1}}const g=/at\s+(?:([^(]+)\s+\()?((?:[^:/\s]+(?:\/[^:/\s]+)*\.[^:/\s]+)|(?:[^:]+:\/\/[^:/\s]+(?::\d+)?(?:\/[^:\s]*)*)):(\d+)(?::(\d+))?(?:\s*\)?)?$/;function f(e){const t=e==null?void 0:e.match(g);return{info:(t==null?void 0:t[1])??"",path:(t==null?void 0:t[2])??"",row:t!=null&&t[3]?parseInt(t==null?void 0:t[3])-1:-1,col:t!=null&&t[4]?parseInt(t==null?void 0:t[4])-1:-1}}const d=/https?:\/\/usr/;function h(e){return d.test(e)}function x(e="",t=16,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){let o="";for(let r=0;r<t;r++)o+=n.charAt(Math.floor(Math.random()*n.length));return e+o}const w=/(https?:\/\/|www\.)([^\s<>"'`)]*)/g;function v(e){let t=[],n=0,o;for(;(o=w.exec(e))!==null;){if(o.index>n){const l=e.slice(n,o.index);l&&t.push({type:"string",value:l})}const r=o[0];t.push({type:"link",value:r}),n=o.index+r.length}if(n<e.length){const r=e.slice(n);r&&t.push({type:"string",value:r})}return t=t.map(r=>({...r,value:r.type==="string"?s(r.value):r.value})),t}const y=/(https?:\/\/|www\.)/;function M(e){return y.test(e)}exports.escapeHTML=s;exports.extractRowAndCol=a;exports.extractUrl=i;exports.hasUrl=M;exports.hightLight=u;exports.isMockWX=h;exports.parseStock=f;exports.splitStrByUrl=v;exports.uniqueId=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/utils/string.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAW,EAAE,MAAM,GAAE,MAAW,UAgB/D;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,UA4BxC;AAGD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,UAGtC;AAGD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM;;;EAe3C;AAUD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM;;;;;EAQvC;AAGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,WAErC;AAED,wBAAgB,QAAQ,CACtB,GAAG,GAAE,MAAW,EAChB,MAAM,SAAK,EACX,KAAK,SAAmE,GACvE,MAAM,CAMR;AAGD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GACV;IAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAqC9C;AAGD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,WAEjC"}
|
package/dist/utils/string.js
CHANGED
|
@@ -1,114 +1 @@
|
|
|
1
|
-
function g(e = "", t = "") {
|
|
2
|
-
if (!e)
|
|
3
|
-
return "";
|
|
4
|
-
if (!t)
|
|
5
|
-
return e;
|
|
6
|
-
const n = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(n, "g");
|
|
7
|
-
return e.replace(
|
|
8
|
-
o,
|
|
9
|
-
`<span style="color:#fff; background-color: var(--dev-tool-main-color);">${t}</span>`
|
|
10
|
-
);
|
|
11
|
-
}
|
|
12
|
-
function s(e) {
|
|
13
|
-
if (!e)
|
|
14
|
-
return "";
|
|
15
|
-
const t = {
|
|
16
|
-
"&": "&",
|
|
17
|
-
'"': """,
|
|
18
|
-
"'": "'",
|
|
19
|
-
">": ">",
|
|
20
|
-
"<": "<",
|
|
21
|
-
"=": "=",
|
|
22
|
-
"+": "+",
|
|
23
|
-
"-": "-",
|
|
24
|
-
"(": "(",
|
|
25
|
-
")": ")",
|
|
26
|
-
"[": "[",
|
|
27
|
-
"]": "]",
|
|
28
|
-
"{": "{",
|
|
29
|
-
"}": "}",
|
|
30
|
-
".": ".",
|
|
31
|
-
"?": "?",
|
|
32
|
-
"/": "/",
|
|
33
|
-
":": ":"
|
|
34
|
-
};
|
|
35
|
-
return e.replace(
|
|
36
|
-
/[&"'><=+\-().?\/:[\]{}]/g,
|
|
37
|
-
(n) => t[n] || n
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
const u = /https?:\/\/[^\s/$.?#](?:(?!\s|\)).)*/g;
|
|
41
|
-
function d(e) {
|
|
42
|
-
const t = e.match(u);
|
|
43
|
-
return t ? t[0] : "";
|
|
44
|
-
}
|
|
45
|
-
const c = /:(\d+)(?::(\d+))?\)?$/;
|
|
46
|
-
function x(e) {
|
|
47
|
-
const t = e.match(c);
|
|
48
|
-
if (t) {
|
|
49
|
-
const n = t[1], o = t[2];
|
|
50
|
-
return {
|
|
51
|
-
row: parseInt(n) - 1,
|
|
52
|
-
col: parseInt(o) - 1
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
row: -1,
|
|
57
|
-
col: -1
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
const i = /at\s+(?:([^(]+)\s+\()?((?:[^:\/\s]+(?:\/[^:\/\s]+)*\.[^:\/\s]+)|(?:[^:]+:\/\/[^:\/\s]+(?::\d+)?(?:\/[^:\s]*)*)):(\d+)(?::(\d+))?(?:\s*\)?)?$/;
|
|
61
|
-
function h(e) {
|
|
62
|
-
const t = e == null ? void 0 : e.match(i);
|
|
63
|
-
return {
|
|
64
|
-
info: (t == null ? void 0 : t[1]) ?? "",
|
|
65
|
-
path: (t == null ? void 0 : t[2]) ?? "",
|
|
66
|
-
row: t != null && t[3] ? parseInt(t == null ? void 0 : t[3]) - 1 : -1,
|
|
67
|
-
col: t != null && t[4] ? parseInt(t == null ? void 0 : t[4]) - 1 : -1
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
const p = /https?:\/\/usr/;
|
|
71
|
-
function w(e) {
|
|
72
|
-
return p.test(e);
|
|
73
|
-
}
|
|
74
|
-
function v(e = "", t = 16, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
|
|
75
|
-
let o = "";
|
|
76
|
-
for (let r = 0; r < t; r++)
|
|
77
|
-
o += n.charAt(Math.floor(Math.random() * n.length));
|
|
78
|
-
return e + o;
|
|
79
|
-
}
|
|
80
|
-
const a = /(https?:\/\/|www\.)([^\s<>"'`)]*)/g;
|
|
81
|
-
function y(e) {
|
|
82
|
-
let t = [], n = 0, o;
|
|
83
|
-
for (; (o = a.exec(e)) !== null; ) {
|
|
84
|
-
if (o.index > n) {
|
|
85
|
-
const l = e.slice(n, o.index);
|
|
86
|
-
l && t.push({ type: "string", value: l });
|
|
87
|
-
}
|
|
88
|
-
const r = o[0];
|
|
89
|
-
t.push({ type: "link", value: r }), n = o.index + r.length;
|
|
90
|
-
}
|
|
91
|
-
if (n < e.length) {
|
|
92
|
-
const r = e.slice(n);
|
|
93
|
-
r && t.push({ type: "string", value: r });
|
|
94
|
-
}
|
|
95
|
-
return t = t.map((r) => ({
|
|
96
|
-
...r,
|
|
97
|
-
value: r.type === "string" ? s(r.value) : r.value
|
|
98
|
-
})), t;
|
|
99
|
-
}
|
|
100
|
-
const f = /(https?:\/\/|www\.)/;
|
|
101
|
-
function I(e) {
|
|
102
|
-
return f.test(e);
|
|
103
|
-
}
|
|
104
|
-
export {
|
|
105
|
-
s as escapeHTML,
|
|
106
|
-
x as extractRowAndCol,
|
|
107
|
-
d as extractUrl,
|
|
108
|
-
I as hasUrl,
|
|
109
|
-
g as hightLight,
|
|
110
|
-
w as isMockWX,
|
|
111
|
-
h as parseStock,
|
|
112
|
-
y as splitStrByUrl,
|
|
113
|
-
v as uniqueId
|
|
114
|
-
};
|
|
1
|
+
function g(e="",t=""){if(!e)return"";if(!t)return e;const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(n,"gi");return e.replace(o,l=>`<span style="color:#fff; background-color: var(--dev-tool-main-color);">${l}</span>`)}function s(e){if(!e)return"";const t={"&":"&",'"':""","'":"'",">":">","<":"<","=":"=","+":"+","-":"-","(":"(",")":")","[":"[","]":"]","{":"{","}":"}",".":".","?":"?","/":"/",":":":"};return e.replace(/[&"'><=+\-().?/:[\]{}]/g,n=>t[n]||n)}const u=/https?:\/\/[^\s/$.?#](?:(?!\s|\)).)*/g;function d(e){const t=e.match(u);return t?t[0]:""}const c=/:(\d+)(?::(\d+))?\)?$/;function h(e){const t=e.match(c);if(t){const n=t[1],o=t[2];return{row:parseInt(n)-1,col:parseInt(o)-1}}return{row:-1,col:-1}}const i=/at\s+(?:([^(]+)\s+\()?((?:[^:/\s]+(?:\/[^:/\s]+)*\.[^:/\s]+)|(?:[^:]+:\/\/[^:/\s]+(?::\d+)?(?:\/[^:\s]*)*)):(\d+)(?::(\d+))?(?:\s*\)?)?$/;function x(e){const t=e==null?void 0:e.match(i);return{info:(t==null?void 0:t[1])??"",path:(t==null?void 0:t[2])??"",row:t!=null&&t[3]?parseInt(t==null?void 0:t[3])-1:-1,col:t!=null&&t[4]?parseInt(t==null?void 0:t[4])-1:-1}}const p=/https?:\/\/usr/;function w(e){return p.test(e)}function v(e="",t=16,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){let o="";for(let r=0;r<t;r++)o+=n.charAt(Math.floor(Math.random()*n.length));return e+o}const a=/(https?:\/\/|www\.)([^\s<>"'`)]*)/g;function y(e){let t=[],n=0,o;for(;(o=a.exec(e))!==null;){if(o.index>n){const l=e.slice(n,o.index);l&&t.push({type:"string",value:l})}const r=o[0];t.push({type:"link",value:r}),n=o.index+r.length}if(n<e.length){const r=e.slice(n);r&&t.push({type:"string",value:r})}return t=t.map(r=>({...r,value:r.type==="string"?s(r.value):r.value})),t}const f=/(https?:\/\/|www\.)/;function I(e){return f.test(e)}export{s as escapeHTML,h as extractRowAndCol,d as extractUrl,I as hasUrl,g as hightLight,w as isMockWX,x as parseStock,y as splitStrByUrl,v as uniqueId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function d(){const e=getCurrentPages(),t=e[e.length-1];return t&&t.route?t.route:""}function m(){var r;if(!plus||!plus.nativeObj||!plus.nativeObj.Bitmap)return;const e=getCurrentPages(),t=e[e.length-1],n=(r=t.$getAppWebview)==null?void 0:r.call(t),o=new plus.nativeObj.Bitmap("drawScreen");n==null||n.draw(o,()=>{o.save(`pictures/${Date.now()}.jpg`,{overwrite:!0},i=>{console.log("res.target"+i.target),uni.showToast({title:"截图成功:"+i.target,icon:"none",duration:60*1e3}),o.clear()},i=>{console.log("[DevTool] 截图失败:"+JSON.stringify(i)),uni.showToast({title:"[DevTool] 截图失败:"+JSON.stringify(i),icon:"none",duration:60*1e3}),o.clear()})},i=>{console.log("[DevTool] 绘制失败:"+JSON.stringify(i)),uni.showToast({title:"绘制失败:"+JSON.stringify(i),icon:"none",duration:60*1e3})},{check:!0})}function y(e){const t=uni.createCanvasContext("fullscreenCanvas"),{windowWidth:n,windowHeight:o}=uni.getWindowInfo();t.setFillStyle("#ffffff"),t.fillRect(0,0,n,o),t.setFillStyle("#000000"),t.setFontSize(20),t.fillText("这是截屏内容",100,100),t.draw(!1,()=>{uni.canvasToTempFilePath({canvasId:"fullscreenCanvas",width:n,height:o,destWidth:n*2,destHeight:o*2,fileType:"png",success:r=>{console.log("res: ",r),console.log("全屏截屏成功:",r.tempFilePath)},fail:r=>{console.error("全屏截屏失败:",r)}})})}function g(e){return e===null||typeof e!="object"&&typeof e!="function"}function h(e,t,n={maxDepth:10}){const{maxDepth:o=10}=n,r=new WeakMap;let i=1;return p(e,t,r,()=>i++,1,o)}function p(e,t,n,o,r,i){if(r>i)return!1;if(g(e)||g(t))return typeof e=="number"&&typeof t=="number"&&isNaN(e)&&isNaN(t)?!0:e===t;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.toString()===t.toString();if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;const u=n.get(e),l=n.get(t);if(u!==void 0||l!==void 0)return u===l;const c=o();n.set(e,c),n.set(t,c);const f=Object.getOwnPropertyNames(e),a=Object.getOwnPropertyNames(t);if(f.length!==a.length)return!1;for(const s of f)if(!a.includes(s)||!p(e==null?void 0:e[s],t==null?void 0:t[s],n,o,r+1,i))return!1;return!0}function w(){if(!uni.getWindowInfo){const{uniPlatform:e}=uni.getSystemInfoSync();return e}if(uni!=null&&uni.getAuthCode)return"mp-alipay";if(uni!=null&&uni.getMenuButtonBoundingClientRect)return"mp-weixin";{const{uniPlatform:e}=uni.getSystemInfoSync();return e}}exports.captureScreen=y;exports.deepEqual=h;exports.getCurrentPagePath=d;exports.getPlatform=w;exports.screenshot=m;
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export declare function getCurrentPagePath(): string;
|
|
7
7
|
/** 截图 */
|
|
8
8
|
export declare function screenshot(): void;
|
|
9
|
-
export declare function captureScreen(
|
|
9
|
+
export declare function captureScreen(_option: {
|
|
10
10
|
success?: () => void;
|
|
11
11
|
}): void;
|
|
12
12
|
export interface DeepEqualOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,kBAAkB,WAOjC;AAED,SAAS;AACT,wBAAgB,UAAU,SAsDzB;AAGD,wBAAgB,aAAa,CAAC,OAAO,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,QA4B9D;AAUD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,SAAS,CACvB,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,EACV,OAAO,GAAE,gBAAmC,GAC3C,OAAO,CAKT;AA4ED;;;;;GAKG;AACH,wBAAgB,WAAW,WAqB1B"}
|
package/dist/utils/utils.js
CHANGED
|
@@ -1,126 +1 @@
|
|
|
1
|
-
function m() {
|
|
2
|
-
let e = getCurrentPages(), t = e[e.length - 1];
|
|
3
|
-
return t && t.route ? t.route : "";
|
|
4
|
-
}
|
|
5
|
-
function d() {
|
|
6
|
-
var r;
|
|
7
|
-
if (!plus || !plus.nativeObj || !plus.nativeObj.Bitmap)
|
|
8
|
-
return;
|
|
9
|
-
let e = getCurrentPages(), t = e[e.length - 1], n = (r = t.$getAppWebview) == null ? void 0 : r.call(t), i = new plus.nativeObj.Bitmap("drawScreen");
|
|
10
|
-
n == null || n.draw(
|
|
11
|
-
i,
|
|
12
|
-
() => {
|
|
13
|
-
i.save(
|
|
14
|
-
`pictures/${Date.now()}.jpg`,
|
|
15
|
-
{
|
|
16
|
-
overwrite: !0
|
|
17
|
-
},
|
|
18
|
-
(o) => {
|
|
19
|
-
console.log("res.target" + o.target), uni.showToast({
|
|
20
|
-
title: "截图成功:" + o.target,
|
|
21
|
-
icon: "none",
|
|
22
|
-
duration: 60 * 1e3
|
|
23
|
-
}), i.clear();
|
|
24
|
-
},
|
|
25
|
-
(o) => {
|
|
26
|
-
console.log("[DevTool] 截图失败:" + JSON.stringify(o)), uni.showToast({
|
|
27
|
-
title: "[DevTool] 截图失败:" + JSON.stringify(o),
|
|
28
|
-
icon: "none",
|
|
29
|
-
duration: 60 * 1e3
|
|
30
|
-
}), i.clear();
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
},
|
|
34
|
-
(o) => {
|
|
35
|
-
console.log("[DevTool] 绘制失败:" + JSON.stringify(o)), uni.showToast({
|
|
36
|
-
title: "绘制失败:" + JSON.stringify(o),
|
|
37
|
-
icon: "none",
|
|
38
|
-
duration: 60 * 1e3
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
check: !0
|
|
43
|
-
// 设置为检测白屏
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
function y(e) {
|
|
48
|
-
const t = uni.createCanvasContext("fullscreenCanvas"), { windowWidth: n, windowHeight: i } = uni.getWindowInfo();
|
|
49
|
-
t.setFillStyle("#ffffff"), t.fillRect(0, 0, n, i), t.setFillStyle("#000000"), t.setFontSize(20), t.fillText("这是截屏内容", 100, 100), t.draw(!1, () => {
|
|
50
|
-
uni.canvasToTempFilePath({
|
|
51
|
-
canvasId: "fullscreenCanvas",
|
|
52
|
-
width: n,
|
|
53
|
-
height: i,
|
|
54
|
-
destWidth: n * 2,
|
|
55
|
-
// 提高清晰度
|
|
56
|
-
destHeight: i * 2,
|
|
57
|
-
fileType: "png",
|
|
58
|
-
success: (r) => {
|
|
59
|
-
console.log("res: ", r), console.log("全屏截屏成功:", r.tempFilePath);
|
|
60
|
-
},
|
|
61
|
-
fail: (r) => {
|
|
62
|
-
console.error("全屏截屏失败:", r);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function g(e) {
|
|
68
|
-
return e === null || typeof e != "object" && typeof e != "function";
|
|
69
|
-
}
|
|
70
|
-
function h(e, t, n = { maxDepth: 10 }) {
|
|
71
|
-
const { maxDepth: i = 10 } = n, r = /* @__PURE__ */ new WeakMap();
|
|
72
|
-
let o = 1;
|
|
73
|
-
return p(e, t, r, () => o++, 1, i);
|
|
74
|
-
}
|
|
75
|
-
function p(e, t, n, i, r, o) {
|
|
76
|
-
if (r > o)
|
|
77
|
-
return !1;
|
|
78
|
-
if (g(e) || g(t))
|
|
79
|
-
return typeof e == "number" && typeof t == "number" && isNaN(e) && isNaN(t) ? !0 : e === t;
|
|
80
|
-
if (e instanceof Date && t instanceof Date)
|
|
81
|
-
return e.getTime() === t.getTime();
|
|
82
|
-
if (e instanceof RegExp && t instanceof RegExp)
|
|
83
|
-
return e.toString() === t.toString();
|
|
84
|
-
if (typeof e != "object" || typeof t != "object" || e === null || t === null)
|
|
85
|
-
return !1;
|
|
86
|
-
const u = n.get(e), l = n.get(t);
|
|
87
|
-
if (u !== void 0 || l !== void 0)
|
|
88
|
-
return u === l;
|
|
89
|
-
const f = i();
|
|
90
|
-
n.set(e, f), n.set(t, f);
|
|
91
|
-
const c = Object.getOwnPropertyNames(e), a = Object.getOwnPropertyNames(t);
|
|
92
|
-
if (c.length !== a.length)
|
|
93
|
-
return !1;
|
|
94
|
-
for (const s of c)
|
|
95
|
-
if (!a.includes(s) || !p(
|
|
96
|
-
e == null ? void 0 : e[s],
|
|
97
|
-
t == null ? void 0 : t[s],
|
|
98
|
-
n,
|
|
99
|
-
i,
|
|
100
|
-
r + 1,
|
|
101
|
-
o
|
|
102
|
-
))
|
|
103
|
-
return !1;
|
|
104
|
-
return !0;
|
|
105
|
-
}
|
|
106
|
-
function w() {
|
|
107
|
-
if (!uni.getWindowInfo) {
|
|
108
|
-
const { uniPlatform: e } = uni.getSystemInfoSync();
|
|
109
|
-
return e;
|
|
110
|
-
}
|
|
111
|
-
if (uni != null && uni.getAuthCode)
|
|
112
|
-
return "mp-alipay";
|
|
113
|
-
if (uni != null && uni.getMenuButtonBoundingClientRect)
|
|
114
|
-
return "mp-weixin";
|
|
115
|
-
{
|
|
116
|
-
const { uniPlatform: e } = uni.getSystemInfoSync();
|
|
117
|
-
return e;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
export {
|
|
121
|
-
y as captureScreen,
|
|
122
|
-
h as deepEqual,
|
|
123
|
-
m as getCurrentPagePath,
|
|
124
|
-
w as getPlatform,
|
|
125
|
-
d as screenshot
|
|
126
|
-
};
|
|
1
|
+
function m(){const t=getCurrentPages(),e=t[t.length-1];return e&&e.route?e.route:""}function d(){var r;if(!plus||!plus.nativeObj||!plus.nativeObj.Bitmap)return;const t=getCurrentPages(),e=t[t.length-1],n=(r=e.$getAppWebview)==null?void 0:r.call(e),o=new plus.nativeObj.Bitmap("drawScreen");n==null||n.draw(o,()=>{o.save(`pictures/${Date.now()}.jpg`,{overwrite:!0},i=>{console.log("res.target"+i.target),uni.showToast({title:"截图成功:"+i.target,icon:"none",duration:60*1e3}),o.clear()},i=>{console.log("[DevTool] 截图失败:"+JSON.stringify(i)),uni.showToast({title:"[DevTool] 截图失败:"+JSON.stringify(i),icon:"none",duration:60*1e3}),o.clear()})},i=>{console.log("[DevTool] 绘制失败:"+JSON.stringify(i)),uni.showToast({title:"绘制失败:"+JSON.stringify(i),icon:"none",duration:60*1e3})},{check:!0})}function y(t){const e=uni.createCanvasContext("fullscreenCanvas"),{windowWidth:n,windowHeight:o}=uni.getWindowInfo();e.setFillStyle("#ffffff"),e.fillRect(0,0,n,o),e.setFillStyle("#000000"),e.setFontSize(20),e.fillText("这是截屏内容",100,100),e.draw(!1,()=>{uni.canvasToTempFilePath({canvasId:"fullscreenCanvas",width:n,height:o,destWidth:n*2,destHeight:o*2,fileType:"png",success:r=>{console.log("res: ",r),console.log("全屏截屏成功:",r.tempFilePath)},fail:r=>{console.error("全屏截屏失败:",r)}})})}function g(t){return t===null||typeof t!="object"&&typeof t!="function"}function h(t,e,n={maxDepth:10}){const{maxDepth:o=10}=n,r=new WeakMap;let i=1;return p(t,e,r,()=>i++,1,o)}function p(t,e,n,o,r,i){if(r>i)return!1;if(g(t)||g(e))return typeof t=="number"&&typeof e=="number"&&isNaN(t)&&isNaN(e)?!0:t===e;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp&&e instanceof RegExp)return t.toString()===e.toString();if(typeof t!="object"||typeof e!="object"||t===null||e===null)return!1;const u=n.get(t),f=n.get(e);if(u!==void 0||f!==void 0)return u===f;const l=o();n.set(t,l),n.set(e,l);const c=Object.getOwnPropertyNames(t),a=Object.getOwnPropertyNames(e);if(c.length!==a.length)return!1;for(const s of c)if(!a.includes(s)||!p(t==null?void 0:t[s],e==null?void 0:e[s],n,o,r+1,i))return!1;return!0}function w(){if(!uni.getWindowInfo){const{uniPlatform:t}=uni.getSystemInfoSync();return t}if(uni!=null&&uni.getAuthCode)return"mp-alipay";if(uni!=null&&uni.getMenuButtonBoundingClientRect)return"mp-weixin";{const{uniPlatform:t}=uni.getSystemInfoSync();return t}}export{y as captureScreen,h as deepEqual,m as getCurrentPagePath,w as getPlatform,d as screenshot};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view
|
|
3
|
+
v-if="renderShow"
|
|
4
|
+
:class="[showContainer ? 'transition-fixed' : '']"
|
|
5
|
+
:style="[showContainer ? { zIndex } : {}]">
|
|
6
|
+
<view
|
|
7
|
+
class="transition-container"
|
|
8
|
+
:class="customClass"
|
|
9
|
+
:style="[mergedStyle, transitionStyle, customStyle]">
|
|
10
|
+
<view
|
|
11
|
+
class="transition-content"
|
|
12
|
+
:class="{ 'pointer-events-auto': isActive && !isLeaving }">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</view>
|
|
15
|
+
</view>
|
|
16
|
+
</view>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ref, watch, computed, nextTick } from 'vue';
|
|
21
|
+
|
|
22
|
+
const props = withDefaults(
|
|
23
|
+
defineProps<{
|
|
24
|
+
show?: boolean;
|
|
25
|
+
name?:
|
|
26
|
+
| 'fade'
|
|
27
|
+
| 'slide-top'
|
|
28
|
+
| 'slide-bottom'
|
|
29
|
+
| 'slide-left'
|
|
30
|
+
| 'slide-right'
|
|
31
|
+
| 'zoom'
|
|
32
|
+
| 'reveal';
|
|
33
|
+
duration?: number;
|
|
34
|
+
customStyle?: Record<string, any> | string;
|
|
35
|
+
customClass?: string;
|
|
36
|
+
zIndex?: number;
|
|
37
|
+
showContainer?: boolean;
|
|
38
|
+
origin?: { x: number; y: number };
|
|
39
|
+
animated?: boolean;
|
|
40
|
+
}>(),
|
|
41
|
+
{
|
|
42
|
+
name: 'fade',
|
|
43
|
+
duration: 300,
|
|
44
|
+
showContainer: true,
|
|
45
|
+
animated: true,
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const emit = defineEmits<{
|
|
50
|
+
(e: 'after-enter'): void;
|
|
51
|
+
(e: 'after-leave'): void;
|
|
52
|
+
}>();
|
|
53
|
+
|
|
54
|
+
const renderShow = ref(props.show);
|
|
55
|
+
const isActive = ref(false);
|
|
56
|
+
const isLeaving = ref(false);
|
|
57
|
+
|
|
58
|
+
const mergedStyle = computed(() => {
|
|
59
|
+
return {
|
|
60
|
+
'--transition-duration': props.animated ? `${props.duration}ms` : '0ms',
|
|
61
|
+
'--transition-timing': 'cubic-bezier(0.4, 0, 0.2, 1)',
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const transitionStyle = computed(() => {
|
|
66
|
+
const styles: Record<string, string> = {
|
|
67
|
+
transition: props.animated
|
|
68
|
+
? 'transform var(--transition-duration) var(--transition-timing), opacity var(--transition-duration) var(--transition-timing), clip-path var(--transition-duration) var(--transition-timing)'
|
|
69
|
+
: 'none',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const active = isActive.value && !isLeaving.value;
|
|
73
|
+
const x = props.origin?.x || 0;
|
|
74
|
+
const y = props.origin?.y || 0;
|
|
75
|
+
|
|
76
|
+
if (props.origin) {
|
|
77
|
+
styles.transformOrigin = `${x}px ${y}px`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (props.name === 'fade') {
|
|
81
|
+
styles.opacity = active ? '1' : '0';
|
|
82
|
+
} else if (props.name === 'slide-bottom') {
|
|
83
|
+
styles.transform = active ? 'translateY(0)' : 'translateY(100%)';
|
|
84
|
+
} else if (props.name === 'slide-top') {
|
|
85
|
+
styles.transform = active ? 'translateY(0)' : 'translateY(-100%)';
|
|
86
|
+
} else if (props.name === 'slide-left') {
|
|
87
|
+
styles.transform = active ? 'translateX(0)' : 'translateX(-100%)';
|
|
88
|
+
} else if (props.name === 'slide-right') {
|
|
89
|
+
styles.transform = active ? 'translateX(0)' : 'translateX(100%)';
|
|
90
|
+
} else if (props.name === 'zoom') {
|
|
91
|
+
styles.transform = active ? 'scale(1)' : 'scale(0)';
|
|
92
|
+
styles.opacity = active ? '1' : '0';
|
|
93
|
+
} else if (props.name === 'reveal') {
|
|
94
|
+
styles.clipPath = active
|
|
95
|
+
? `circle(150% at ${x}px ${y}px)`
|
|
96
|
+
: `circle(0% at ${x}px ${y}px)`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return styles;
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
watch(
|
|
103
|
+
() => props.show,
|
|
104
|
+
(val, oldVal) => {
|
|
105
|
+
if (val) {
|
|
106
|
+
renderShow.value = true;
|
|
107
|
+
isLeaving.value = false;
|
|
108
|
+
|
|
109
|
+
if (!props.animated) {
|
|
110
|
+
isActive.value = true;
|
|
111
|
+
emit('after-enter');
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 必须分两步:1. 插入DOM 2. 触发Transition
|
|
116
|
+
nextTick(() => {
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
isActive.value = true;
|
|
119
|
+
const duration = props.animated ? props.duration : 0;
|
|
120
|
+
setTimeout(() => {
|
|
121
|
+
emit('after-enter');
|
|
122
|
+
}, duration);
|
|
123
|
+
}, 30);
|
|
124
|
+
});
|
|
125
|
+
} else if (oldVal !== undefined) {
|
|
126
|
+
isLeaving.value = true;
|
|
127
|
+
isActive.value = false;
|
|
128
|
+
|
|
129
|
+
const duration = props.animated ? props.duration : 0;
|
|
130
|
+
|
|
131
|
+
setTimeout(() => {
|
|
132
|
+
renderShow.value = false;
|
|
133
|
+
isLeaving.value = false;
|
|
134
|
+
emit('after-leave');
|
|
135
|
+
}, duration);
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{ immediate: true },
|
|
139
|
+
);
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<style scoped>
|
|
143
|
+
.transition-container {
|
|
144
|
+
display: block;
|
|
145
|
+
position: relative;
|
|
146
|
+
width: 100%;
|
|
147
|
+
height: 100%;
|
|
148
|
+
will-change: transform, opacity;
|
|
149
|
+
pointer-events: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.transition-content {
|
|
153
|
+
width: 100%;
|
|
154
|
+
height: 100%;
|
|
155
|
+
pointer-events: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.pointer-events-auto {
|
|
159
|
+
pointer-events: auto;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.transition-fixed {
|
|
163
|
+
position: fixed;
|
|
164
|
+
top: 0;
|
|
165
|
+
left: 0;
|
|
166
|
+
width: 100%;
|
|
167
|
+
height: 100%;
|
|
168
|
+
pointer-events: none;
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -94,7 +94,7 @@ const onSizeChange =
|
|
|
94
94
|
inject<(index: number, height: number) => void>('onSizeChange');
|
|
95
95
|
|
|
96
96
|
/** 外界记录的高度 */
|
|
97
|
-
const
|
|
97
|
+
const _itemsHeight = inject<number[]>('itemsHeight');
|
|
98
98
|
|
|
99
99
|
const debounceReact = debounce(
|
|
100
100
|
(rect: UniApp.NodeInfo | UniApp.NodeInfo[]) => {
|
|
@@ -127,19 +127,19 @@ const debounceReact = debounce(
|
|
|
127
127
|
isMounted = true;
|
|
128
128
|
},
|
|
129
129
|
100,
|
|
130
|
-
true,
|
|
130
|
+
{ leading: true },
|
|
131
131
|
);
|
|
132
132
|
function getSize() {
|
|
133
133
|
query.select('.listener-slot').boundingClientRect(debounceReact).exec();
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
const debounceGetSize = debounce(getSize, 100, true);
|
|
136
|
+
const debounceGetSize = debounce(getSize, 100, { leading: true });
|
|
137
137
|
|
|
138
138
|
let observer: UniNamespace.IntersectionObserver;
|
|
139
139
|
onMounted(() => {
|
|
140
140
|
// 防止重复获取
|
|
141
141
|
// TODO
|
|
142
|
-
// if (
|
|
142
|
+
// if (_itemsHeight && _itemsHeight?.[props.index]) return;
|
|
143
143
|
|
|
144
144
|
// 初始大小
|
|
145
145
|
debounceGetSize();
|
|
@@ -186,7 +186,6 @@ onUnmounted(() => {
|
|
|
186
186
|
position: absolute;
|
|
187
187
|
width: 1px;
|
|
188
188
|
height: 1px;
|
|
189
|
-
|
|
190
189
|
background-color: skyblue;
|
|
191
190
|
visibility: hidden;
|
|
192
191
|
}
|
|
@@ -156,29 +156,27 @@ onMounted(() => {
|
|
|
156
156
|
min-width: 1px;
|
|
157
157
|
min-height: 1px;
|
|
158
158
|
}
|
|
159
|
+
|
|
159
160
|
&-target,
|
|
160
161
|
&__wrapper {
|
|
161
162
|
background-color: aqua;
|
|
162
163
|
position: absolute;
|
|
163
|
-
|
|
164
|
-
bottom: 0;
|
|
165
|
-
left: 0;
|
|
166
|
-
right: 0;
|
|
164
|
+
inset: 0;
|
|
167
165
|
z-index: -9999;
|
|
168
166
|
overflow: hidden;
|
|
169
|
-
|
|
170
167
|
visibility: hidden;
|
|
171
168
|
}
|
|
169
|
+
|
|
172
170
|
&-target {
|
|
173
171
|
.l-resize__container {
|
|
174
172
|
width: 100%;
|
|
175
173
|
height: 100%;
|
|
176
174
|
}
|
|
177
175
|
}
|
|
176
|
+
|
|
178
177
|
&__wrapper {
|
|
179
178
|
&--placeholder {
|
|
180
179
|
transition: 0s;
|
|
181
|
-
|
|
182
180
|
animation: none;
|
|
183
181
|
}
|
|
184
182
|
}
|