sys-shim 0.0.1-13 → 0.0.1-15
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/package.json +10 -5
 - package/readme.md +9 -1
 - package/script/npm-pkg/bin/pack.mjs +7 -3
 - package/script/npm-pkg/browser/main.esm.min.js +2 -2
 - package/script/npm-pkg/browser/main.umd.min.js +2 -2
 - package/script/npm-pkg/lib/winrar/x32/WinCon.SFX +0 -0
 - package/script/npm-pkg/lib/winrar/x32/WinRAR.exe +0 -0
 - package/script/npm-pkg/lib/winrar/x32/Zip.SFX +0 -0
 - package/script/npm-pkg/lib/winrar/x64/Default.SFX +0 -0
 - package/script/npm-pkg/lib/winrar/x64/Default64.SFX +0 -0
 - package/script/npm-pkg/lib/winrar/x64/WinCon.SFX +0 -0
 - package/script/npm-pkg/lib/winrar/x64/WinCon64.SFX +0 -0
 - package/script/npm-pkg/lib/winrar/x64/Zip.SFX +0 -0
 - package/script/npm-pkg/lib/winrar/x64/Zip64.SFX +0 -0
 - package/script/npm-pkg/node/main.min.cjs +1 -1
 - package/script/npm-pkg/node/main.min.mjs +1 -1
 - package/script/npm-pkg/shim/win/main.exe +0 -0
 - package/src/util.js +10 -1
 - package/script/npm-pkg/shim/win/page.html +0 -22
 - /package/script/npm-pkg/lib/{Default.SFX → winrar/x32/Default.SFX} +0 -0
 - /package/script/npm-pkg/lib/{WinRAR.exe → winrar/x64/WinRAR.exe} +0 -0
 
| 
         Binary file 
     | 
    
        package/src/util.js
    CHANGED
    
    | 
         @@ -36,6 +36,7 @@ export function getCodeLine(inputStr) { 
     | 
|
| 
       36 
36 
     | 
    
         
             
              return maxAsterisks
         
     | 
| 
       37 
37 
     | 
    
         
             
            }
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
      
 39 
     | 
    
         
            +
            export const sleep = (time = 1e3) => new Promise(resolve => setTimeout(resolve, time))
         
     | 
| 
       39 
40 
     | 
    
         
             
            export function deepProxy({
         
     | 
| 
       40 
41 
     | 
    
         
             
              keys = [`then`, `catch`],
         
     | 
| 
       41 
42 
     | 
    
         
             
              cb = (records) => {
         
     | 
| 
         @@ -73,7 +74,7 @@ export function deepProxy({ 
     | 
|
| 
       73 
74 
     | 
    
         
             
                  let records = getRecords(this)
         
     | 
| 
       74 
75 
     | 
    
         
             
                  setTimeout(() => {
         
     | 
| 
       75 
76 
     | 
    
         
             
                    let recordsEnd = getRecords(this)
         
     | 
| 
       76 
     | 
    
         
            -
                    !recordsEnd.hackRun && cb(recordsEnd)
         
     | 
| 
      
 77 
     | 
    
         
            +
                    !recordsEnd.hackRun && (cb(recordsEnd), recordsEnd.hackRun = true)
         
     | 
| 
       77 
78 
     | 
    
         
             
                  }, 0)
         
     | 
| 
       78 
79 
     | 
    
         
             
                  const key = records[records.length - 1].key
         
     | 
| 
       79 
80 
     | 
    
         
             
                  records[records.length - 1] = { type: `apply`, key, arg: args }
         
     | 
| 
         @@ -284,6 +285,14 @@ export function getUuid () { 
     | 
|
| 
       284 
285 
     | 
    
         
             
              })
         
     | 
| 
       285 
286 
     | 
    
         
             
            }
         
     | 
| 
       286 
287 
     | 
    
         | 
| 
      
 288 
     | 
    
         
            +
            /**
         
     | 
| 
      
 289 
     | 
    
         
            +
             * 获取 uuid
         
     | 
| 
      
 290 
     | 
    
         
            +
             * @returns
         
     | 
| 
      
 291 
     | 
    
         
            +
             */
         
     | 
| 
      
 292 
     | 
    
         
            +
            export function getCodeId () {
         
     | 
| 
      
 293 
     | 
    
         
            +
              return `c_${getUuid()}`.replace(/[_-]/g, ``)
         
     | 
| 
      
 294 
     | 
    
         
            +
            }
         
     | 
| 
      
 295 
     | 
    
         
            +
             
     | 
| 
       287 
296 
     | 
    
         
             
            export function isUTF8MultiByteStart(byte) {
         
     | 
| 
       288 
297 
     | 
    
         
             
              // 如果字节的高位为11,则是多字节字符的起始字节
         
     | 
| 
       289 
298 
     | 
    
         
             
              return (byte & 0xC0) === 0xC0
         
     | 
| 
         @@ -1,22 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <!DOCTYPE html>
         
     | 
| 
       2 
     | 
    
         
            -
            <html>
         
     | 
| 
       3 
     | 
    
         
            -
              <head>
         
     | 
| 
       4 
     | 
    
         
            -
                <meta charset="utf-8" />
         
     | 
| 
       5 
     | 
    
         
            -
                <title>sys-shim page</title>
         
     | 
| 
       6 
     | 
    
         
            -
              </head>
         
     | 
| 
       7 
     | 
    
         
            -
              <script>
         
     | 
| 
       8 
     | 
    
         
            -
                new Sys({
         
     | 
| 
       9 
     | 
    
         
            -
                  log: true,
         
     | 
| 
       10 
     | 
    
         
            -
                  wsUrl: undefined
         
     | 
| 
       11 
     | 
    
         
            -
                }).then(async main => {
         
     | 
| 
       12 
     | 
    
         
            -
                  globalThis.native = main.native
         
     | 
| 
       13 
     | 
    
         
            -
                  globalThis.nativeMain = main.nativeMain
         
     | 
| 
       14 
     | 
    
         
            -
                  document.body.append(`${globalThis.ext.wsUrl}?token=${globalThis.ext.token}`)
         
     | 
| 
       15 
     | 
    
         
            -
                })
         
     | 
| 
       16 
     | 
    
         
            -
              </script>
         
     | 
| 
       17 
     | 
    
         
            -
              <body>
         
     | 
| 
       18 
     | 
    
         
            -
                <button onclick="native.win.msgbox(`hello`, `title`)">msgbox</button>
         
     | 
| 
       19 
     | 
    
         
            -
                <button onclick="nativeMain.win.quitMessage()">exit</button>
         
     | 
| 
       20 
     | 
    
         
            -
                <hr>
         
     | 
| 
       21 
     | 
    
         
            -
              </body>
         
     | 
| 
       22 
     | 
    
         
            -
            </html>
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |