diff --git a/config.js b/config.js index cbd9a75..369c868 100644 --- a/config.js +++ b/config.js @@ -1,8 +1,8 @@ // 应用全局配置 module.exports = { // baseUrl: 'https://www.nuoyunr.com', - baseUrl: 'http://192.168.1.17:48080', - // baseUrl: "http://localhost:48080", + // baseUrl: 'http://192.168.1.17:48080', + baseUrl: "http://localhost:48080", imagesUrl: 'http://shequ.0315e.com/static/images/pages/', baseImageUrl: 'https://www.nuoyunr.com/minio/', shareUrl: 'https://www.lighting-it.cn/share?inviteId=', diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 index 882cecd..977b750 100644 --- a/node_modules/.bin/json5 +++ b/node_modules/.bin/json5 @@ -6,10 +6,7 @@ case `uname` in esac if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" - ret=$? + exec "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" else - node "$basedir/../json5/lib/cli.js" "$@" - ret=$? + exec node "$basedir/../json5/lib/cli.js" "$@" fi -exit $ret diff --git a/node_modules/.bin/json5.cmd b/node_modules/.bin/json5.cmd index b030d83..95c137f 100644 --- a/node_modules/.bin/json5.cmd +++ b/node_modules/.bin/json5.cmd @@ -1,4 +1,9 @@ @ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start SETLOCAL CALL :find_dp0 @@ -9,9 +14,4 @@ IF EXIST "%dp0%\node.exe" ( SET PATHEXT=%PATHEXT:;.JS;=;% ) -"%_prog%" "%dp0%\..\json5\lib\cli.js" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json5\lib\cli.js" %* diff --git a/node_modules/.bin/json5.ps1 b/node_modules/.bin/json5.ps1 new file mode 100644 index 0000000..8700ddb --- /dev/null +++ b/node_modules/.bin/json5.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/sass b/node_modules/.bin/sass index bc62374..44ba6e9 100644 --- a/node_modules/.bin/sass +++ b/node_modules/.bin/sass @@ -6,10 +6,7 @@ case `uname` in esac if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../sass/sass.js" "$@" - ret=$? + exec "$basedir/node" "$basedir/../sass/sass.js" "$@" else - node "$basedir/../sass/sass.js" "$@" - ret=$? + exec node "$basedir/../sass/sass.js" "$@" fi -exit $ret diff --git a/node_modules/.bin/sass.cmd b/node_modules/.bin/sass.cmd index 3569bb9..0cf95f6 100644 --- a/node_modules/.bin/sass.cmd +++ b/node_modules/.bin/sass.cmd @@ -1,4 +1,9 @@ @ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start SETLOCAL CALL :find_dp0 @@ -9,9 +14,4 @@ IF EXIST "%dp0%\node.exe" ( SET PATHEXT=%PATHEXT:;.JS;=;% ) -"%_prog%" "%dp0%\..\sass\sass.js" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sass\sass.js" %* diff --git a/node_modules/.bin/sass.ps1 b/node_modules/.bin/sass.ps1 new file mode 100644 index 0000000..715ffd5 --- /dev/null +++ b/node_modules/.bin/sass.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../sass/sass.js" $args + } else { + & "$basedir/node$exe" "$basedir/../sass/sass.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../sass/sass.js" $args + } else { + & "node$exe" "$basedir/../sass/sass.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver index 7e36527..77443e7 100644 --- a/node_modules/.bin/semver +++ b/node_modules/.bin/semver @@ -6,10 +6,7 @@ case `uname` in esac if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" - ret=$? + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" else - node "$basedir/../semver/bin/semver.js" "$@" - ret=$? + exec node "$basedir/../semver/bin/semver.js" "$@" fi -exit $ret diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd index 164cdea..9913fa9 100644 --- a/node_modules/.bin/semver.cmd +++ b/node_modules/.bin/semver.cmd @@ -1,4 +1,9 @@ @ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start SETLOCAL CALL :find_dp0 @@ -9,9 +14,4 @@ IF EXIST "%dp0%\node.exe" ( SET PATHEXT=%PATHEXT:;.JS;=;% ) -"%_prog%" "%dp0%\..\semver\bin\semver.js" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/.bin/semver.ps1 b/node_modules/.bin/semver.ps1 new file mode 100644 index 0000000..314717a --- /dev/null +++ b/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..8b8bba5 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,292 @@ +{ + "name": "lanan-repair-app", + "lockfileVersion": 2, + "requires": true, + "packages": { + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmmirror.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", + "dev": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/immutable": { + "version": "4.3.7", + "resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/klona": { + "version": "2.0.6", + "resolved": "https://registry.npmmirror.com/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmmirror.com/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/readdirp": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-4.0.1.tgz", + "integrity": "sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==", + "dev": true, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/rich-text-parser": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/rich-text-parser/-/rich-text-parser-1.0.2.tgz", + "integrity": "sha512-fv6Piuikqf0PCuFGfFMtfOdc9fWE/HoSxi4gkDawco/NDKHfR6W5t1/t7Lh0pySf3GkV/rVcgAp/LKx8ZMwjuw==", + "dev": true + }, + "node_modules/sass": { + "version": "1.79.3", + "resolved": "https://registry.npmmirror.com/sass/-/sass-1.79.3.tgz", + "integrity": "sha512-m7dZxh0W9EZ3cw50Me5GOuYm/tVAJAn91SUnohLRo9cXBixGUOdvmryN+dXpwR831bhoY3Zv7rEFt85PUwTmzA==", + "dev": true, + "dependencies": { + "chokidar": "^4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-loader": { + "version": "10.5.2", + "resolved": "https://registry.npmmirror.com/sass-loader/-/sass-loader-10.5.2.tgz", + "integrity": "sha512-vMUoSNOUKJILHpcNCCyD23X34gve1TS7Rjd9uXHeKqhvBG39x6XbswFDtpbTElj6XdMFezoWhkh5vtKudf2cgQ==", + "dev": true, + "dependencies": { + "klona": "^2.0.4", + "loader-utils": "^2.0.0", + "neo-async": "^2.6.2", + "schema-utils": "^3.0.0", + "semver": "^7.3.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "sass": "^1.3.0", + "webpack": "^4.36.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "fibers": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/uqrcodejs": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/uqrcodejs/-/uqrcodejs-4.0.7.tgz", + "integrity": "sha512-84+aZmD2godCVI+93lxE3YUAPNY8zAJvNA7xRS7R7U+q57KzMDepBSfNCwoRUhWOfR6eHFoAOcHRPwsP6ka1cA==" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmmirror.com/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/uview-ui": { + "version": "2.0.37", + "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.37.tgz", + "integrity": "sha512-iBcWNmQa01Wr+z004G6XIVPDctOrJIAx7LObQceUAPxZh6kJYjIOAMp5JE1K4VpoMV5bKYDpCd0gmX+M4nTEQQ==", + "engines": { + "HBuilderX": "^3.1.0" + } + }, + "node_modules/weapp-qrcode": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/weapp-qrcode/-/weapp-qrcode-1.0.0.tgz", + "integrity": "sha512-4sa3W0rGDVJ9QaeZpAKlAuUxVyjhDwiUqHyGK/jJMsRMXnhb4yO8qWU/pZruMo+iT5J6CraS67lDMFb1VY+RaA==", + "dependencies": { + "extend": "^3.0.2" + } + } + } +} diff --git a/node_modules/json5/package.json b/node_modules/json5/package.json index 2c9bf86..60c51d9 100644 --- a/node_modules/json5/package.json +++ b/node_modules/json5/package.json @@ -1,59 +1,55 @@ { - "_args": [ - [ - "json5@2.2.3", - "D:\\my_project\\lanan\\lanan-repair-app" - ] - ], - "_development": true, - "_from": "json5@2.2.3", - "_id": "json5@2.2.3", - "_inBundle": false, - "_integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "_location": "/json5", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "json5@2.2.3", - "name": "json5", - "escapedName": "json5", - "rawSpec": "2.2.3", - "saveSpec": null, - "fetchSpec": "2.2.3" - }, - "_requiredBy": [ - "/loader-utils" - ], - "_resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz", - "_spec": "2.2.3", - "_where": "D:\\my_project\\lanan\\lanan-repair-app", - "author": { - "name": "Aseem Kishore", - "email": "aseem.kishore@gmail.com" - }, - "bin": { - "json5": "lib/cli.js" - }, + "name": "json5", + "version": "2.2.3", + "description": "JSON for Humans", + "main": "lib/index.js", + "module": "dist/index.mjs", + "bin": "lib/cli.js", "browser": "dist/index.js", + "types": "lib/index.d.ts", + "files": [ + "lib/", + "dist/" + ], + "engines": { + "node": ">=6" + }, + "scripts": { + "build": "rollup -c", + "build-package": "node build/package.js", + "build-unicode": "node build/unicode.js", + "coverage": "tap --coverage-report html test", + "lint": "eslint --fix .", + "lint-report": "eslint .", + "prepublishOnly": "npm run production", + "preversion": "npm run production", + "production": "run-s test build", + "tap": "tap -Rspec --100 test", + "test": "run-s lint-report tap", + "version": "npm run build-package && git add package.json5" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/json5/json5.git" + }, + "keywords": [ + "json", + "json5", + "es5", + "es2015", + "ecmascript" + ], + "author": "Aseem Kishore ", + "contributors": [ + "Max Nanasy ", + "Andrew Eisenberg ", + "Jordan Tucker " + ], + "license": "MIT", "bugs": { "url": "https://github.com/json5/json5/issues" }, - "contributors": [ - { - "name": "Max Nanasy", - "email": "max.nanasy@gmail.com" - }, - { - "name": "Andrew Eisenberg", - "email": "andrew@eisenberg.as" - }, - { - "name": "Jordan Tucker", - "email": "jordanbtucker@gmail.com" - } - ], - "description": "JSON for Humans", + "homepage": "http://json5.org/", "devDependencies": { "core-js": "^2.6.5", "eslint": "^5.15.3", @@ -72,44 +68,5 @@ "sinon": "^6.3.5", "tap": "^12.6.0", "unicode-10.0.0": "^0.7.5" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "lib/", - "dist/" - ], - "homepage": "http://json5.org/", - "keywords": [ - "json", - "json5", - "es5", - "es2015", - "ecmascript" - ], - "license": "MIT", - "main": "lib/index.js", - "module": "dist/index.mjs", - "name": "json5", - "repository": { - "type": "git", - "url": "git+https://github.com/json5/json5.git" - }, - "scripts": { - "build": "rollup -c", - "build-package": "node build/package.js", - "build-unicode": "node build/unicode.js", - "coverage": "tap --coverage-report html test", - "lint": "eslint --fix .", - "lint-report": "eslint .", - "prepublishOnly": "npm run production", - "preversion": "npm run production", - "production": "run-s test build", - "tap": "tap -Rspec --100 test", - "test": "run-s lint-report tap", - "version": "npm run build-package && git add package.json5" - }, - "types": "lib/index.d.ts", - "version": "2.2.3" + } } diff --git a/node_modules/rich-text-parser/.npmignore b/node_modules/rich-text-parser/.npmignore new file mode 100644 index 0000000..18ff1d0 --- /dev/null +++ b/node_modules/rich-text-parser/.npmignore @@ -0,0 +1,2 @@ +.DS_Store +npm-debug.log diff --git a/node_modules/rich-text-parser/README.md b/node_modules/rich-text-parser/README.md new file mode 100644 index 0000000..368b55e --- /dev/null +++ b/node_modules/rich-text-parser/README.md @@ -0,0 +1,28 @@ +# 在项目中使用该rich-text-parser + + +**安装** + +```bash +$ npm i rich-text-parser -S --production +``` + +**使用** + +```html + +``` + +```bash + import parser from 'rich-text-parser' + + parser.definedCustomTag({figure: 'p', figcaption: ''}) + const nodes = parser.getRichTextJson(html) +``` +### Api + +| 参数 | 说明 | 参数 | 参数类型 | 返回值类型 | +|-----------|----------------------------------|-----------|---------|--------| +| getRichTextJson | 解析html | `html` | `String` | `Object` | +| definedCustomTag | 定义需要解析的特殊标签,value不填默认是div | `options` | `Object` | `-` | + diff --git a/node_modules/rich-text-parser/lib/discode.js b/node_modules/rich-text-parser/lib/discode.js new file mode 100644 index 0000000..16a2c4f --- /dev/null +++ b/node_modules/rich-text-parser/lib/discode.js @@ -0,0 +1,218 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Discode = function () { + function Discode() { + _classCallCheck(this, Discode); + } + + _createClass(Discode, [{ + key: 'strNumDiscode', + value: function strNumDiscode(str) { + str = str.replace(/∀/g, '∀'); + str = str.replace(/∂/g, '∂'); + str = str.replace(/&exists;/g, '∃'); + str = str.replace(/∅/g, '∅'); + str = str.replace(/∇/g, '∇'); + str = str.replace(/∈/g, '∈'); + str = str.replace(/∉/g, '∉'); + str = str.replace(/∋/g, '∋'); + str = str.replace(/∏/g, '∏'); + str = str.replace(/∑/g, '∑'); + str = str.replace(/−/g, '−'); + str = str.replace(/∗/g, '∗'); + str = str.replace(/√/g, '√'); + str = str.replace(/∝/g, '∝'); + str = str.replace(/∞/g, '∞'); + str = str.replace(/∠/g, '∠'); + str = str.replace(/∧/g, '∧'); + str = str.replace(/∨/g, '∨'); + str = str.replace(/∩/g, '∩'); + str = str.replace(/∩/g, '∪'); + str = str.replace(/∫/g, '∫'); + str = str.replace(/∴/g, '∴'); + str = str.replace(/∼/g, '∼'); + str = str.replace(/≅/g, '≅'); + str = str.replace(/≈/g, '≈'); + str = str.replace(/≠/g, '≠'); + str = str.replace(/≤/g, '≤'); + str = str.replace(/≥/g, '≥'); + str = str.replace(/⊂/g, '⊂'); + str = str.replace(/⊃/g, '⊃'); + str = str.replace(/⊄/g, '⊄'); + str = str.replace(/⊆/g, '⊆'); + str = str.replace(/⊇/g, '⊇'); + str = str.replace(/⊕/g, '⊕'); + str = str.replace(/⊗/g, '⊗'); + str = str.replace(/⊥/g, '⊥'); + str = str.replace(/⋅/g, '⋅'); + return str; + } + }, { + key: 'strGreeceDiscode', + value: function strGreeceDiscode(str) { + str = str.replace(/Α/g, 'Α'); + str = str.replace(/Β/g, 'Β'); + str = str.replace(/Γ/g, 'Γ'); + str = str.replace(/Δ/g, 'Δ'); + str = str.replace(/Ε/g, 'Ε'); + str = str.replace(/Ζ/g, 'Ζ'); + str = str.replace(/Η/g, 'Η'); + str = str.replace(/Θ/g, 'Θ'); + str = str.replace(/Ι/g, 'Ι'); + str = str.replace(/Κ/g, 'Κ'); + str = str.replace(/Λ/g, 'Λ'); + str = str.replace(/Μ/g, 'Μ'); + str = str.replace(/Ν/g, 'Ν'); + str = str.replace(/Ξ/g, 'Ν'); + str = str.replace(/Ο/g, 'Ο'); + str = str.replace(/Π/g, 'Π'); + str = str.replace(/Ρ/g, 'Ρ'); + str = str.replace(/Σ/g, 'Σ'); + str = str.replace(/Τ/g, 'Τ'); + str = str.replace(/Υ/g, 'Υ'); + str = str.replace(/Φ/g, 'Φ'); + str = str.replace(/Χ/g, 'Χ'); + str = str.replace(/Ψ/g, 'Ψ'); + str = str.replace(/Ω/g, 'Ω'); + str = str.replace(/α/g, 'α'); + str = str.replace(/β/g, 'β'); + str = str.replace(/γ/g, 'γ'); + str = str.replace(/δ/g, 'δ'); + str = str.replace(/ε/g, 'ε'); + str = str.replace(/ζ/g, 'ζ'); + str = str.replace(/η/g, 'η'); + str = str.replace(/θ/g, 'θ'); + str = str.replace(/ι/g, 'ι'); + str = str.replace(/κ/g, 'κ'); + str = str.replace(/λ/g, 'λ'); + str = str.replace(/μ/g, 'μ'); + str = str.replace(/ν/g, 'ν'); + str = str.replace(/ξ/g, 'ξ'); + str = str.replace(/ο/g, 'ο'); + str = str.replace(/π/g, 'π'); + str = str.replace(/ρ/g, 'ρ'); + str = str.replace(/ς/g, 'ς'); + str = str.replace(/σ/g, 'σ'); + str = str.replace(/τ/g, 'τ'); + str = str.replace(/υ/g, 'υ'); + str = str.replace(/φ/g, 'φ'); + str = str.replace(/χ/g, 'χ'); + str = str.replace(/ψ/g, 'ψ'); + str = str.replace(/ω/g, 'ω'); + str = str.replace(/ϑ/g, 'ϑ'); + str = str.replace(/ϒ/g, 'ϒ'); + str = str.replace(/ϖ/g, 'ϖ'); + str = str.replace(/·/g, '·'); + return str; + } + }, { + key: 'strcharacterDiscode', + value: function strcharacterDiscode(str) { + // 加入常用解析 + str = str.replace(/ /g, ' '); + str = str.replace(/"/g, "'"); + str = str.replace(/&/g, '&'); + str = str.replace(/</g, '<'); + str = str.replace(/>/g, '>'); + str = str.replace(/•/g, '•'); + return str; + } + }, { + key: 'strOtherDiscode', + value: function strOtherDiscode(str) { + str = str.replace(/Œ/g, 'Œ'); + str = str.replace(/œ/g, 'œ'); + str = str.replace(/Š/g, 'Š'); + str = str.replace(/š/g, 'š'); + str = str.replace(/Ÿ/g, 'Ÿ'); + str = str.replace(/ƒ/g, 'ƒ'); + str = str.replace(/ˆ/g, 'ˆ'); + str = str.replace(/˜/g, '˜'); + str = str.replace(/ /g, ''); + str = str.replace(/ /g, ''); + str = str.replace(/ /g, ''); + str = str.replace(/‌/g, ''); + str = str.replace(/‍/g, ''); + str = str.replace(/‎/g, ''); + str = str.replace(/‏/g, ''); + str = str.replace(/–/g, '–'); + str = str.replace(/—/g, '—'); + str = str.replace(/‘/g, '‘'); + str = str.replace(/’/g, '’'); + str = str.replace(/‚/g, '‚'); + str = str.replace(/“/g, '“'); + str = str.replace(/”/g, '”'); + str = str.replace(/„/g, '„'); + str = str.replace(/†/g, '†'); + str = str.replace(/‡/g, '‡'); + str = str.replace(/•/g, '•'); + str = str.replace(/…/g, '…'); + str = str.replace(/‰/g, '‰'); + str = str.replace(/′/g, '′'); + str = str.replace(/″/g, '″'); + str = str.replace(/‹/g, '‹'); + str = str.replace(/›/g, '›'); + str = str.replace(/‾/g, '‾'); + str = str.replace(/€/g, '€'); + str = str.replace(/™/g, '™'); + str = str.replace(/←/g, '←'); + str = str.replace(/↑/g, '↑'); + str = str.replace(/→/g, '→'); + str = str.replace(/↓/g, '↓'); + str = str.replace(/↔/g, '↔'); + str = str.replace(/↵/g, '↵'); + str = str.replace(/⌈/g, '⌈'); + str = str.replace(/⌉/g, '⌉'); + str = str.replace(/⌊/g, '⌊'); + str = str.replace(/⌋/g, '⌋'); + str = str.replace(/◊/g, '◊'); + str = str.replace(/♠/g, '♠'); + str = str.replace(/♣/g, '♣'); + str = str.replace(/♥/g, '♥'); + str = str.replace(/♦/g, '♦'); + str = str.replace(/'/g, '\''); + return str; + } + }, { + key: 'strMoreDiscode', + value: function strMoreDiscode(str) { + str = str.replace(/\r\n/g, ''); + str = str.replace(/\n/g, ''); + str = str.replace(/code/g, 'wxxxcode-style'); + return str; + } + }, { + key: 'strDiscode', + value: function strDiscode(str) { + str = this.strNumDiscode(str); + str = this.strGreeceDiscode(str); + str = this.strcharacterDiscode(str); + str = this.strOtherDiscode(str); + str = this.strMoreDiscode(str); + return str; + } + }, { + key: 'urlToHttpUrl', + value: function urlToHttpUrl(url, rep) { + var patt1 = new RegExp('^//'); + var result = patt1.test(url); + if (result) { + url = rep + ':' + url; + } + return url; + } + }]); + + return Discode; +}(); + +var disCode = new Discode(); +exports.default = disCode; \ No newline at end of file diff --git a/node_modules/rich-text-parser/lib/html2json.js b/node_modules/rich-text-parser/lib/html2json.js new file mode 100644 index 0000000..bd2e8be --- /dev/null +++ b/node_modules/rich-text-parser/lib/html2json.js @@ -0,0 +1,157 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _discode = require('./discode'); + +var _discode2 = _interopRequireDefault(_discode); + +var _htmlparser = require('./htmlparser'); + +var _htmlparser2 = _interopRequireDefault(_htmlparser); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var HtmlToJson = function () { + function HtmlToJson() { + _classCallCheck(this, HtmlToJson); + + this.__placeImgeUrlHttps = 'https'; + this.customTag = {}; + } + + _createClass(HtmlToJson, [{ + key: 'removeDoctype', + value: function removeDoctype(html) { + return html.replace(/<\?xml.*\?>\n/, '').replace(/<.*!doctype.*\n/, '').replace(/<.*!DOCTYPE.*\n/, ''); + } + }, { + key: 'trimHtml', + value: function trimHtml(html) { + return html.replace(/\r?\n+/g, '').replace(//ig, '').replace(/\/\*.*?\*\//ig, '').replace(/[ ]+\s]+))?)*)\s*(\/?)>/, + endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/, + attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; + +// Empty Elements - HTML 5 +var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"); + +// Block Elements - HTML 5 +var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"); + +// Inline Elements - HTML 5 +var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"); + +// Elements that you can, intentionally, leave open +// (and which close themselves) +var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"); + +// Attributes that have their values filled in disabled="disabled" +var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"); + +// Special Elements (can contain anything) +var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block"); + +function HTMLParser(html, handler) { + var index, + chars, + match, + stack = [], + last = html; + stack.last = function () { + return this[this.length - 1]; + }; + + while (html) { + chars = true; + + // Make sure we're not in a script or style element + if (!stack.last() || !special[stack.last()]) { + + // Comment + if (html.indexOf(""); + + if (index >= 0) { + if (handler.comment) handler.comment(html.substring(4, index)); + html = html.substring(index + 3); + chars = false; + } + + // end tag + } else if (html.indexOf("]*>"), function (all, text) { + text = text.replace(/|/g, "$1$2"); + if (handler.chars) handler.chars(text); + + return ""; + }); + + parseEndTag("", stack.last()); + } + + if (html == last) throw "Parse Error: " + html; + last = html; + } + + // Clean up any remaining tags + parseEndTag(); + + function parseStartTag(tag, tagName, rest, unary) { + tagName = tagName.toLowerCase(); + + if (block[tagName]) { + while (stack.last() && inline[stack.last()]) { + parseEndTag("", stack.last()); + } + } + + if (closeSelf[tagName] && stack.last() == tagName) { + parseEndTag("", tagName); + } + + unary = empty[tagName] || !!unary; + + if (!unary) stack.push(tagName); + + if (handler.start) { + var attrs = []; + + rest.replace(attr, function (match, name) { + var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : ""; + + attrs.push({ + name: name, + value: value, + escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //" + }); + }); + + if (handler.start) { + handler.start(tagName, attrs, unary); + } + } + } + + function parseEndTag(tag, tagName) { + // If no tag name is provided, clean shop + if (!tagName) var pos = 0; + + // Find the closest opened tag of the same type + else { + tagName = tagName.toLowerCase(); + for (var pos = stack.length - 1; pos >= 0; pos--) { + if (stack[pos] == tagName) break; + } + } + if (pos >= 0) { + // Close all the open elements, up the stack + for (var i = stack.length - 1; i >= pos; i--) { + if (handler.end) handler.end(stack[i]); + } // Remove the open elements from the stack + stack.length = pos; + } + } +}; + +function makeMap(str) { + var obj = {}, + items = str.split(","); + for (var i = 0; i < items.length; i++) { + obj[items[i]] = true; + }return obj; +} + +module.exports = HTMLParser; \ No newline at end of file diff --git a/node_modules/rich-text-parser/lib/parser.js b/node_modules/rich-text-parser/lib/parser.js new file mode 100644 index 0000000..26fcf71 --- /dev/null +++ b/node_modules/rich-text-parser/lib/parser.js @@ -0,0 +1,52 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _html2json = require('./html2json'); + +var _html2json2 = _interopRequireDefault(_html2json); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Parser = function (_ParseJson) { + _inherits(Parser, _ParseJson); + + function Parser() { + _classCallCheck(this, Parser); + + return _possibleConstructorReturn(this, (Parser.__proto__ || Object.getPrototypeOf(Parser)).apply(this, arguments)); + } + + _createClass(Parser, [{ + key: 'getRichTextJson', + value: function getRichTextJson(html) { + return _get(Parser.prototype.__proto__ || Object.getPrototypeOf(Parser.prototype), 'getHtmlJson', this).call(this, html); + } + }, { + key: 'definedCustomTag', + value: function definedCustomTag(options) { + var newOptions = {}; + for (var i in options) { + newOptions[i] = options[i] ? options[i] : 'div'; + } + _get(Parser.prototype.__proto__ || Object.getPrototypeOf(Parser.prototype), 'definedCustomTag', this).call(this, newOptions); + } + }]); + + return Parser; +}(_html2json2.default); + +var parser = new Parser(); +exports.default = parser; \ No newline at end of file diff --git a/node_modules/rich-text-parser/package.json b/node_modules/rich-text-parser/package.json new file mode 100644 index 0000000..cb388b9 --- /dev/null +++ b/node_modules/rich-text-parser/package.json @@ -0,0 +1,24 @@ +{ + "name": "rich-text-parser", + "version": "1.0.2", + "description": "html to json parser work for weapp rich-text", + "main": "./lib/parser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Chaunjie/rich-text-parser.git" + }, + "keywords": [ + "rich-text", + "html", + "json" + ], + "author": "chaunjie", + "license": "ISC", + "bugs": { + "url": "https://github.com/Chaunjie/rich-text-parser/issues" + }, + "homepage": "https://github.com/Chaunjie/rich-text-parser#readme" +} diff --git a/node_modules/rich-text-parser/src/discode.js b/node_modules/rich-text-parser/src/discode.js new file mode 100644 index 0000000..c0b612f --- /dev/null +++ b/node_modules/rich-text-parser/src/discode.js @@ -0,0 +1,193 @@ +class Discode { + strNumDiscode (str) { + str = str.replace(/∀/g, '∀') + str = str.replace(/∂/g, '∂') + str = str.replace(/&exists;/g, '∃') + str = str.replace(/∅/g, '∅') + str = str.replace(/∇/g, '∇') + str = str.replace(/∈/g, '∈') + str = str.replace(/∉/g, '∉') + str = str.replace(/∋/g, '∋') + str = str.replace(/∏/g, '∏') + str = str.replace(/∑/g, '∑') + str = str.replace(/−/g, '−') + str = str.replace(/∗/g, '∗') + str = str.replace(/√/g, '√') + str = str.replace(/∝/g, '∝') + str = str.replace(/∞/g, '∞') + str = str.replace(/∠/g, '∠') + str = str.replace(/∧/g, '∧') + str = str.replace(/∨/g, '∨') + str = str.replace(/∩/g, '∩') + str = str.replace(/∩/g, '∪') + str = str.replace(/∫/g, '∫') + str = str.replace(/∴/g, '∴') + str = str.replace(/∼/g, '∼') + str = str.replace(/≅/g, '≅') + str = str.replace(/≈/g, '≈') + str = str.replace(/≠/g, '≠') + str = str.replace(/≤/g, '≤') + str = str.replace(/≥/g, '≥') + str = str.replace(/⊂/g, '⊂') + str = str.replace(/⊃/g, '⊃') + str = str.replace(/⊄/g, '⊄') + str = str.replace(/⊆/g, '⊆') + str = str.replace(/⊇/g, '⊇') + str = str.replace(/⊕/g, '⊕') + str = str.replace(/⊗/g, '⊗') + str = str.replace(/⊥/g, '⊥') + str = str.replace(/⋅/g, '⋅') + return str + } + + strGreeceDiscode (str) { + str = str.replace(/Α/g, 'Α') + str = str.replace(/Β/g, 'Β') + str = str.replace(/Γ/g, 'Γ') + str = str.replace(/Δ/g, 'Δ') + str = str.replace(/Ε/g, 'Ε') + str = str.replace(/Ζ/g, 'Ζ') + str = str.replace(/Η/g, 'Η') + str = str.replace(/Θ/g, 'Θ') + str = str.replace(/Ι/g, 'Ι') + str = str.replace(/Κ/g, 'Κ') + str = str.replace(/Λ/g, 'Λ') + str = str.replace(/Μ/g, 'Μ') + str = str.replace(/Ν/g, 'Ν') + str = str.replace(/Ξ/g, 'Ν') + str = str.replace(/Ο/g, 'Ο') + str = str.replace(/Π/g, 'Π') + str = str.replace(/Ρ/g, 'Ρ') + str = str.replace(/Σ/g, 'Σ') + str = str.replace(/Τ/g, 'Τ') + str = str.replace(/Υ/g, 'Υ') + str = str.replace(/Φ/g, 'Φ') + str = str.replace(/Χ/g, 'Χ') + str = str.replace(/Ψ/g, 'Ψ') + str = str.replace(/Ω/g, 'Ω') + str = str.replace(/α/g, 'α') + str = str.replace(/β/g, 'β') + str = str.replace(/γ/g, 'γ') + str = str.replace(/δ/g, 'δ') + str = str.replace(/ε/g, 'ε') + str = str.replace(/ζ/g, 'ζ') + str = str.replace(/η/g, 'η') + str = str.replace(/θ/g, 'θ') + str = str.replace(/ι/g, 'ι') + str = str.replace(/κ/g, 'κ') + str = str.replace(/λ/g, 'λ') + str = str.replace(/μ/g, 'μ') + str = str.replace(/ν/g, 'ν') + str = str.replace(/ξ/g, 'ξ') + str = str.replace(/ο/g, 'ο') + str = str.replace(/π/g, 'π') + str = str.replace(/ρ/g, 'ρ') + str = str.replace(/ς/g, 'ς') + str = str.replace(/σ/g, 'σ') + str = str.replace(/τ/g, 'τ') + str = str.replace(/υ/g, 'υ') + str = str.replace(/φ/g, 'φ') + str = str.replace(/χ/g, 'χ') + str = str.replace(/ψ/g, 'ψ') + str = str.replace(/ω/g, 'ω') + str = str.replace(/ϑ/g, 'ϑ') + str = str.replace(/ϒ/g, 'ϒ') + str = str.replace(/ϖ/g, 'ϖ') + str = str.replace(/·/g, '·') + return str + } + + strcharacterDiscode (str) { + // 加入常用解析 + str = str.replace(/ /g, ' ') + str = str.replace(/"/g, "'") + str = str.replace(/&/g, '&') + str = str.replace(/</g, '<') + str = str.replace(/>/g, '>') + str = str.replace(/•/g, '•') + return str + } + + strOtherDiscode (str) { + str = str.replace(/Œ/g, 'Œ') + str = str.replace(/œ/g, 'œ') + str = str.replace(/Š/g, 'Š') + str = str.replace(/š/g, 'š') + str = str.replace(/Ÿ/g, 'Ÿ') + str = str.replace(/ƒ/g, 'ƒ') + str = str.replace(/ˆ/g, 'ˆ') + str = str.replace(/˜/g, '˜') + str = str.replace(/ /g, '') + str = str.replace(/ /g, '') + str = str.replace(/ /g, '') + str = str.replace(/‌/g, '') + str = str.replace(/‍/g, '') + str = str.replace(/‎/g, '') + str = str.replace(/‏/g, '') + str = str.replace(/–/g, '–') + str = str.replace(/—/g, '—') + str = str.replace(/‘/g, '‘') + str = str.replace(/’/g, '’') + str = str.replace(/‚/g, '‚') + str = str.replace(/“/g, '“') + str = str.replace(/”/g, '”') + str = str.replace(/„/g, '„') + str = str.replace(/†/g, '†') + str = str.replace(/‡/g, '‡') + str = str.replace(/•/g, '•') + str = str.replace(/…/g, '…') + str = str.replace(/‰/g, '‰') + str = str.replace(/′/g, '′') + str = str.replace(/″/g, '″') + str = str.replace(/‹/g, '‹') + str = str.replace(/›/g, '›') + str = str.replace(/‾/g, '‾') + str = str.replace(/€/g, '€') + str = str.replace(/™/g, '™') + str = str.replace(/←/g, '←') + str = str.replace(/↑/g, '↑') + str = str.replace(/→/g, '→') + str = str.replace(/↓/g, '↓') + str = str.replace(/↔/g, '↔') + str = str.replace(/↵/g, '↵') + str = str.replace(/⌈/g, '⌈') + str = str.replace(/⌉/g, '⌉') + str = str.replace(/⌊/g, '⌊') + str = str.replace(/⌋/g, '⌋') + str = str.replace(/◊/g, '◊') + str = str.replace(/♠/g, '♠') + str = str.replace(/♣/g, '♣') + str = str.replace(/♥/g, '♥') + str = str.replace(/♦/g, '♦') + str = str.replace(/'/g, '\'') + return str + } + + strMoreDiscode (str) { + str = str.replace(/\r\n/g, '') + str = str.replace(/\n/g, '') + str = str.replace(/code/g, 'wxxxcode-style') + return str + } + + strDiscode (str) { + str = this.strNumDiscode(str) + str = this.strGreeceDiscode(str) + str = this.strcharacterDiscode(str) + str = this.strOtherDiscode(str) + str = this.strMoreDiscode(str) + return str + } + + urlToHttpUrl (url, rep) { + const patt1 = new RegExp('^//') + const result = patt1.test(url) + if (result) { + url = rep + ':' + url + } + return url + } +} + +const disCode = new Discode() +export default disCode diff --git a/node_modules/rich-text-parser/src/html2json.js b/node_modules/rich-text-parser/src/html2json.js new file mode 100644 index 0000000..8132662 --- /dev/null +++ b/node_modules/rich-text-parser/src/html2json.js @@ -0,0 +1,127 @@ +import discode from './discode' +import htmlParser from './htmlparser' + +export default class HtmlToJson { + constructor () { + this.__placeImgeUrlHttps = 'https' + this.customTag = {} + } + + removeDoctype (html) { + return html.replace(/<\?xml.*\?>\n/, '').replace(/<.*!doctype.*\n/, '').replace(/<.*!DOCTYPE.*\n/, '') + } + + trimHtml (html) { + return html.replace(/\r?\n+/g, '').replace(//ig, '').replace(/\/\*.*?\*\//ig, '').replace(/[ ]+\s]+))?)*)\s*(\/?)>/, + endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/, + attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; + +// Empty Elements - HTML 5 +var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"); + +// Block Elements - HTML 5 +var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"); + +// Inline Elements - HTML 5 +var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"); + +// Elements that you can, intentionally, leave open +// (and which close themselves) +var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"); + +// Attributes that have their values filled in disabled="disabled" +var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"); + +// Special Elements (can contain anything) +var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block"); + +function HTMLParser(html, handler) { + var index, chars, match, stack = [], last = html; + stack.last = function () { + return this[this.length - 1]; + }; + + while (html) { + chars = true; + + // Make sure we're not in a script or style element + if (!stack.last() || !special[stack.last()]) { + + // Comment + if (html.indexOf(""); + + if (index >= 0) { + if (handler.comment) + handler.comment(html.substring(4, index)); + html = html.substring(index + 3); + chars = false; + } + + // end tag + } else if (html.indexOf("]*>"), function (all, text) { + text = text.replace(/|/g, "$1$2"); + if (handler.chars) + handler.chars(text); + + return ""; + }); + + + parseEndTag("", stack.last()); + } + + if (html == last) + throw "Parse Error: " + html; + last = html; + } + + // Clean up any remaining tags + parseEndTag(); + + function parseStartTag(tag, tagName, rest, unary) { + tagName = tagName.toLowerCase(); + + if (block[tagName]) { + while (stack.last() && inline[stack.last()]) { + parseEndTag("", stack.last()); + } + } + + if (closeSelf[tagName] && stack.last() == tagName) { + parseEndTag("", tagName); + } + + unary = empty[tagName] || !!unary; + + if (!unary) + stack.push(tagName); + + if (handler.start) { + var attrs = []; + + rest.replace(attr, function (match, name) { + var value = arguments[2] ? arguments[2] : + arguments[3] ? arguments[3] : + arguments[4] ? arguments[4] : + fillAttrs[name] ? name : ""; + + attrs.push({ + name: name, + value: value, + escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //" + }); + }); + + if (handler.start) { + handler.start(tagName, attrs, unary); + } + + } + } + + function parseEndTag(tag, tagName) { + // If no tag name is provided, clean shop + if (!tagName) + var pos = 0; + + // Find the closest opened tag of the same type + else { + tagName = tagName.toLowerCase(); + for (var pos = stack.length - 1; pos >= 0; pos--) + if (stack[pos] == tagName) + break; + } + if (pos >= 0) { + // Close all the open elements, up the stack + for (var i = stack.length - 1; i >= pos; i--) + if (handler.end) + handler.end(stack[i]); + + // Remove the open elements from the stack + stack.length = pos; + } + } +}; + + +function makeMap(str) { + var obj = {}, items = str.split(","); + for (var i = 0; i < items.length; i++) + obj[items[i]] = true; + return obj; +} + +module.exports = HTMLParser; diff --git a/node_modules/rich-text-parser/src/parser.js b/node_modules/rich-text-parser/src/parser.js new file mode 100644 index 0000000..a265e0c --- /dev/null +++ b/node_modules/rich-text-parser/src/parser.js @@ -0,0 +1,18 @@ +import ParseJson from './html2json' + +class Parser extends ParseJson { + getRichTextJson (html) { + return super.getHtmlJson(html) + } + + definedCustomTag (options) { + const newOptions = {} + for (let i in options) { + newOptions[i] = options[i] ? options[i] : 'div' + } + super.definedCustomTag(newOptions) + } +} + +const parser = new Parser() +export default parser diff --git a/node_modules/sass/package.json b/node_modules/sass/package.json index 56851cb..6f805f8 100644 --- a/node_modules/sass/package.json +++ b/node_modules/sass/package.json @@ -1,79 +1 @@ -{ - "_args": [ - [ - "sass@1.79.3", - "D:\\my_project\\lanan\\lanan-repair-app" - ] - ], - "_development": true, - "_from": "sass@1.79.3", - "_id": "sass@1.79.3", - "_inBundle": false, - "_integrity": "sha512-m7dZxh0W9EZ3cw50Me5GOuYm/tVAJAn91SUnohLRo9cXBixGUOdvmryN+dXpwR831bhoY3Zv7rEFt85PUwTmzA==", - "_location": "/sass", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "sass@1.79.3", - "name": "sass", - "escapedName": "sass", - "rawSpec": "1.79.3", - "saveSpec": null, - "fetchSpec": "1.79.3" - }, - "_requiredBy": [ - "#DEV:/" - ], - "_resolved": "https://registry.npmmirror.com/sass/-/sass-1.79.3.tgz", - "_spec": "1.79.3", - "_where": "D:\\my_project\\lanan\\lanan-repair-app", - "author": { - "name": "Natalie Weizenbaum", - "email": "nweiz@google.com", - "url": "https://github.com/nex3" - }, - "bin": { - "sass": "sass.js" - }, - "bugs": { - "url": "https://github.com/sass/dart-sass/issues" - }, - "dependencies": { - "chokidar": "^4.0.0", - "immutable": "^4.0.0", - "source-map-js": ">=0.6.2 <2.0.0" - }, - "description": "A pure JavaScript implementation of Sass.", - "engines": { - "node": ">=14.0.0" - }, - "exports": { - "types": "./types/index.d.ts", - "node": { - "require": "./sass.node.js", - "default": "./sass.node.mjs" - }, - "default": { - "require": "./sass.default.cjs", - "default": "./sass.default.js" - } - }, - "homepage": "https://github.com/sass/dart-sass", - "keywords": [ - "style", - "scss", - "sass", - "preprocessor", - "css" - ], - "license": "MIT", - "main": "sass.node.js", - "name": "sass", - "repository": { - "type": "git", - "url": "git+https://github.com/sass/dart-sass.git" - }, - "types": "types/index.d.ts", - "version": "1.79.3" -} +{"name":"sass","description":"A pure JavaScript implementation of Sass.","license":"MIT","bugs":"https://github.com/sass/dart-sass/issues","homepage":"https://github.com/sass/dart-sass","repository":{"type":"git","url":"https://github.com/sass/dart-sass"},"author":{"name":"Natalie Weizenbaum","email":"nweiz@google.com","url":"https://github.com/nex3"},"engines":{"node":">=14.0.0"},"dependencies":{"chokidar":"^4.0.0","immutable":"^4.0.0","source-map-js":">=0.6.2 <2.0.0"},"keywords":["style","scss","sass","preprocessor","css"],"types":"types/index.d.ts","exports":{"types":"./types/index.d.ts","node":{"require":"./sass.node.js","default":"./sass.node.mjs"},"default":{"require":"./sass.default.cjs","default":"./sass.default.js"}},"version":"1.79.3","bin":{"sass":"sass.js"},"main":"sass.node.js"} \ No newline at end of file diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json index a4c6508..663d370 100644 --- a/node_modules/semver/package.json +++ b/node_modules/semver/package.json @@ -1,51 +1,30 @@ { - "_args": [ - [ - "semver@7.6.3", - "D:\\my_project\\lanan\\lanan-repair-app" - ] - ], - "_development": true, - "_from": "semver@7.6.3", - "_id": "semver@7.6.3", - "_inBundle": false, - "_integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "_location": "/semver", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "semver@7.6.3", - "name": "semver", - "escapedName": "semver", - "rawSpec": "7.6.3", - "saveSpec": null, - "fetchSpec": "7.6.3" - }, - "_requiredBy": [ - "/sass-loader" - ], - "_resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.3.tgz", - "_spec": "7.6.3", - "_where": "D:\\my_project\\lanan\\lanan-repair-app", - "author": { - "name": "GitHub Inc." - }, - "bin": { - "semver": "bin/semver.js" - }, - "bugs": { - "url": "https://github.com/npm/node-semver/issues" - }, + "name": "semver", + "version": "7.6.3", "description": "The semantic version parser used by npm.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "postlint": "template-oss-check", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force" + }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/template-oss": "4.22.0", "benchmark": "^2.1.4", "tap": "^16.0.0" }, - "engines": { - "node": ">=10" + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "bin/semver.js" }, "files": [ "bin/", @@ -58,23 +37,6 @@ "preload.js", "range.bnf" ], - "homepage": "https://github.com/npm/node-semver#readme", - "license": "ISC", - "main": "index.js", - "name": "semver", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/node-semver.git" - }, - "scripts": { - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "lintfix": "npm run lint -- --fix", - "postlint": "template-oss-check", - "posttest": "npm run lint", - "snap": "tap", - "template-oss-apply": "template-oss-apply --force", - "test": "tap" - }, "tap": { "timeout": 30, "coverage-map": "map.js", @@ -83,6 +45,10 @@ "tap-snapshots/**" ] }, + "engines": { + "node": ">=10" + }, + "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "version": "4.22.0", @@ -107,6 +73,5 @@ "/benchmarks" ], "publish": "true" - }, - "version": "7.6.3" + } } diff --git a/node_modules/uqrcodejs/LICENSE.md b/node_modules/uqrcodejs/LICENSE.md new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/uqrcodejs/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/uqrcodejs/README.md b/node_modules/uqrcodejs/README.md new file mode 100644 index 0000000..77d7925 --- /dev/null +++ b/node_modules/uqrcodejs/README.md @@ -0,0 +1,392 @@ +# 介绍 + +`uQRCode`是一款基于`Javascript`环境开发的二维码生成插件,适用所有`Javascript`运行环境的前端应用和`Node.js`应用。 + +`uQRCode`可扩展性高,它支持自定义渲染二维码,可通过`uQRCode API`得到二维码绘制关键信息后,使用`canvas`、`svg`或`js`操作`dom`的方式绘制二维码图案。还可自定义二维码样式,如随机颜色、圆点、方块、块与块之间的间距等。 + +欢迎加入群聊【uQRCode交流群】:[695070434](https://jq.qq.com/?_wv=1027&k=JRjzDqiw)。 + +# 设计器 + +uQRCode发布了配套的可视化设计器,可根据自己喜好在设计器中设计二维码样式,一键生成配置代码复制到项目中,详情请在微信小程序搜索“柚子二维码”,或扫描下方小程序码体验。 + +![uQRCode设计器](https://uqrcode.cn/mp_weixin_code.jpg) + +## 设计器模板示例 + +![uQRCode设计器](https://uqrcode.cn/yz_1.png) +![uQRCode设计器](https://uqrcode.cn/yz_2.png) +![uQRCode设计器](https://uqrcode.cn/yz_3.png) +![uQRCode设计器](https://uqrcode.cn/yz_4.png) +![uQRCode设计器](https://uqrcode.cn/yz_5.png) +![uQRCode设计器](https://uqrcode.cn/yz_6.png) +![uQRCode设计器](https://uqrcode.cn/yz_7.png) +![uQRCode设计器](https://uqrcode.cn/yz_8.png) +![uQRCode设计器](https://uqrcode.cn/yz_9.png) + +# 快速上手 + +> 在`uni-app`中,我们更推荐使用组件方式来生成二维码,组件方式大大提高了页面的可读性以及避开了一些平台容易出问题的地方,当组件无法满足需求的时候,再考虑切换成原生方式。 + +官方文档:[https://uqrcode.cn/doc](https://uqrcode.cn/doc)。 + +github地址:[https://github.com/Sansnn/uQRCode](https://github.com/Sansnn/uQRCode)。 + +npm地址:[https://www.npmjs.com/package/uqrcodejs](https://www.npmjs.com/package/uqrcodejs)。 + +uni-app插件市场地址:[https://ext.dcloud.net.cn/plugin?id=1287](https://ext.dcloud.net.cn/plugin?id=1287)。 + +## 原生方式 + +原生方式仅需要获取`uqrcode.js`文件便可使用。详细配置请移步到:文档 > [原生](https://uqrcode.cn/doc/document/native.html)。 + +### 安装 + +1. 通过`npm`安装,成功后即可使用`import`或`require`进行引用。 +``` bash +# npm安装 +npm install uqrcodejs +# 或者 +npm install @uqrcode/js +``` + +2. 通过项目开源地址获取`uqrcode.js`,下载`uqrcode.js`后,将其复制到您项目指定目录,在页面中引入`uqrcode.js`文件即可开始使用。 + +### 引入 + +- 通过`import`引入。 +``` javascript +// npm安装 +import UQRCode from 'uqrcodejs'; // npm install uqrcodejs +// 或者 +import UQRCode from '@uqrcode/js'; // npm install @uqrcode/js +``` + +- `Node.js`通过`require`引入。 +``` javascript +// npm安装 +const UQRCode = require('uqrcodejs'); // npm install uqrcodejs +// 或者 +const UQRCode = require('@uqrcode/js'); // npm install @uqrcode/js +``` + +- 原生浏览器环境,在js脚本加载时添加到`window`。 +``` html + + +``` + +### 简单用法 + +`uQRCode`基于`Canvas API`封装了一套方法,建议开发者使用`canvas`生成,一键调用,非常方便。以下是示例: + +- HTML示例 + - DOM部分 + ``` html + + ``` + + - JS部分 + ``` javascript + // 获取uQRCode实例 + var qr = new UQRCode(); + // 设置二维码内容 + qr.data = "https://uqrcode.cn/doc"; + // 设置二维码大小,必须与canvas设置的宽高一致 + qr.size = 200; + // 调用制作二维码方法 + qr.make(); + // 获取canvas元素 + var canvas = document.getElementById("qrcode"); + // 获取canvas上下文 + var canvasContext = canvas.getContext("2d"); + // 设置uQRCode实例的canvas上下文 + qr.canvasContext = canvasContext; + // 调用绘制方法将二维码图案绘制到canvas上 + qr.drawCanvas(); + ``` + +- uni-app示例 + - Template部分 + ``` html + + ``` + + - JS部分 + ``` javascript + onReady() { + // 获取uQRCode实例 + var qr = new UQRCode(); + // 设置二维码内容 + qr.data = "https://uqrcode.cn/doc"; + // 设置二维码大小,必须与canvas设置的宽高一致 + qr.size = 200; + // 调用制作二维码方法 + qr.make(); + // 获取canvas上下文 + var canvasContext = uni.createCanvasContext('qrcode', this); // 如果是组件,this必须传入 + // 设置uQRCode实例的canvas上下文 + qr.canvasContext = canvasContext; + // 调用绘制方法将二维码图案绘制到canvas上 + qr.drawCanvas(); + } + ``` + +- 微信小程序,推荐使用Canvas 2D,关于Canvas 2D的使用请参考微信开放文档。 + +### 高级用法 + +考虑到部分平台可能不支持`canvas`,所以`uQRCode`并没有强制要求和`canvas`一起使用,您还可以选择其他方式来生成二维码,例如使用`js`操作`dom`进行绘制或是使用`svg`绘制等。以下是示例: + +- uni-app v-for+view + +```html + + + +``` + +- js操作dom + +``` html + + + + + uQRCode二维码生成 + + +
+ + + + +``` + +- svg +``` html + + + + + uQRCode二维码生成 + + + + + + + +``` + +> 更多用法大家自行探索咯,期待分享哟~ + +### 导出临时文件路径 + +原生方式基于`Canvas`的,请自行参阅各平台`Canvas`的导出方式。以下是部分示例: + +- uni-app +```javascript +// 通过uni.createCanvasContext方式创建绘制上下文的,对应导出API为uni.canvasToTempFilePath +// 调用完ctx.draw()方法后不能第一时间导出,否则会异常,需要有一定的延时 +setTimeout(() => { + uni.canvasToTempFilePath( + { + canvasId: this.canvasId, + fileType: this.fileType, + width: this.canvasWidth, + height: this.canvasHeight, + success: res => { + console.log(res); + }, + fail: err => { + console.log(err); + } + }, + // this // 组件内使用必传当前实例 + ); +}, 300); +``` + +- Canvas2D +```javascript +// 得到base64 +console.log(canvas.toDataURL()); +// 得到buffer +console.log(canvas.toBuffer()); +``` + +### 保存二维码到本地相册 + +必须在导出临时文件路径成功后再执行保存。uni-app通用保存方式(H5除外): +```javascript +uni.saveImageToPhotosAlbum({ + filePath: tempFilePath, + success: res => { + console.log(res); + }, + fail: err => { + console.log(err); + } +}); +``` + +H5可以通过设置``标签`href`属性的方式进行保存: +```javascript +const aEle = document.createElement('a'); +aEle.download = 'uQRCode'; // 设置下载的文件名,默认是'下载' +aEle.href = tempFilePath; +document.body.appendChild(aEle); +aEle.click(); +aEle.remove(); // 下载之后把创建的元素删除 +``` +经过测试,PC端浏览器可以下载,部分安卓自带或第三方浏览器可以下载,安卓微信浏览器不适用,移动端iOS所有浏览器均不适用,差异较大,还是推荐各位导出文件给图片组件显示,然后提示用户通过长按图片进行保存这种方式。 + +## uni-app组件方式 + +### 安装 + +通过uni-app插件市场地址安装:[https://ext.dcloud.net.cn/plugin?id=1287](https://ext.dcloud.net.cn/plugin?id=1287)。详细配置请移步到:文档 > [uni-app组件](https://uqrcode.cn/doc/document/uni-app.html)。 + +### 引入 + +uni-app默认为easycom模式,可直接键入``标签。 + +### 简单用法 + +安装`uqrcode`组件后,在`template`中键入``。设置`ref`属性可使用组件内部方法,`canvas-id`属性为组件内部的canvas组件标识,`value`属性为二维码生成对应内容,`options`为配置选项,可配置二维码样式,绘制Logo等,详见:[options](https://uqrcode.cn/doc/document/uni-app.html#options) 。 + +``` html + +``` + +### 导出临时文件路径 + +为了保证方法调用成功,请在 [complete](https://uqrcode.cn/doc/document/uni-app.html#complete) 事件返回`success=true`后调用。 + +```javascript +// uqrcode为组件的ref名称 +this.$refs.uqrcode.toTempFilePath({ + success: res => { + console.log(res); + } +}); +``` + +### 保存二维码到本地相册 + +为了保证方法调用成功,请在 [complete](https://uqrcode.cn/doc/document/uni-app.html#complete) 事件返回`success=true`后调用。 + +```javascript +// uqrcode为组件的ref名称 +this.$refs.uqrcode.save({ + success: () => { + uni.showToast({ + icon: 'success', + title: '保存成功' + }); + } +}); +``` + +## 更多使用说明请前往官方文档查看:[https://uqrcode.cn/doc](https://uqrcode.cn/doc)。 \ No newline at end of file diff --git a/node_modules/uqrcodejs/package.json b/node_modules/uqrcodejs/package.json new file mode 100644 index 0000000..1a2247d --- /dev/null +++ b/node_modules/uqrcodejs/package.json @@ -0,0 +1,27 @@ +{ + "name": "uqrcodejs", + "version": "4.0.7", + "description": "uQRCode是一款基于Javascript环境开发的二维码生成插件,适用所有Javascript运行环境的前端应用和Node.js。", + "main": "uqrcode.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Sansnn/uQRCode.git" + }, + "keywords": [ + "uQRCode", + "QR", + "QRCode", + "artQRCode", + "二维码", + "艺术码" + ], + "author": "Sansnn", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/Sansnn/uQRCode/issues" + }, + "homepage": "https://github.com/Sansnn/uQRCode#readme" +} diff --git a/node_modules/uqrcodejs/uqrcode.js b/node_modules/uqrcodejs/uqrcode.js new file mode 100644 index 0000000..3fbf731 --- /dev/null +++ b/node_modules/uqrcodejs/uqrcode.js @@ -0,0 +1,34 @@ +//--------------------------------------------------------------------- +// uQRCode二维码生成插件 v4.0.7 +// +// uQRCode是一款基于Javascript环境开发的二维码生成插件,适用所有Javascript运行环境的前端应用和Node.js。 +// +// Copyright (c) Sansnn uQRCode All rights reserved. +// +// Licensed under the Apache License, Version 2.0. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// github地址: +// https://github.com/Sansnn/uQRCode +// +// npm地址: +// https://www.npmjs.com/package/uqrcodejs +// +// uni-app插件市场地址: +// https://ext.dcloud.net.cn/plugin?id=1287 +// +// 复制使用请保留本段注释,感谢支持开源! +// +//--------------------------------------------------------------------- + +//--------------------------------------------------------------------- +// 当前文件格式为 umd,通用模块定义,生成的包同时支持 amd、cjs 和 iife 三种格式 +// 如需在其他环境使用,请获取环境对应的格式文件 +// 格式说明: +// amd - 异步模块定义,适用于 RequireJS 等模块加载器 +// cjs - CommonJS,适用于 Node 环境和其他打包工具(别名:commonjs) +// es - 将 bundle 保留为 ES 模块文件,适用于其他打包工具以及支持