@rpcbase/ui 0.261.0 → 0.262.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/dist/assets/sha256.worker-BEf4_Y9w.js.map +1 -0
- package/dist/components/FilesUploadField/index.d.ts +19 -6
- package/dist/components/FilesUploadField/index.d.ts.map +1 -1
- package/dist/components/FilesUploadField/sha256.d.ts +5 -0
- package/dist/components/FilesUploadField/sha256.d.ts.map +1 -0
- package/dist/components/FilesUploadField/sha256.worker.d.ts +4 -0
- package/dist/components/FilesUploadField/sha256.worker.d.ts.map +1 -0
- package/dist/components/ImagesField/index.d.ts +4 -2
- package/dist/components/ImagesField/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index298.js +11 -803
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +865 -28
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +26 -510
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +481 -755
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +786 -7428
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +7429 -7
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +6 -12
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +12 -5
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +3 -3
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +5 -469
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +464 -32
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +36 -18
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +17 -28
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +30 -4
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +4 -59
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +59 -9
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +9 -5
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +5 -9
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +9 -12
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +13 -3
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +3 -17
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +14 -23
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +23 -39
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +41 -5
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +5 -25
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +24 -18
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +17 -32
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +34 -5
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +5 -9
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +8 -7
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +8 -9
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +9 -10
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +10 -7
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +7 -75
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +66 -153
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +147 -99
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +113 -13
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +12 -78
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +57 -23
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +45 -12
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +13 -16
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +15 -100
- package/dist/index339.js.map +1 -1
- package/dist/index340.js +95 -50
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +5 -57
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +78 -41
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +58 -100
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +104 -46
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +51 -39
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +42 -142
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +123 -120
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +108 -224
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +174 -158
- package/dist/index349.js.map +1 -1
- package/dist/index350.js +144 -213
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +309 -5
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +5 -6
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +6 -7
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +5 -4
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +4 -4
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +6 -21
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +21 -10
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +10 -128
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +122 -36
- package/dist/index359.js.map +1 -1
- package/dist/index360.js +38 -64
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +66 -115
- package/dist/index361.js.map +1 -1
- package/dist/index362.js +112 -485
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +490 -13
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +13 -4
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +4 -47
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +44 -15
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +19 -5
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +5 -27
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +27 -48
- package/dist/index369.js.map +1 -1
- package/dist/index370.js +46 -27
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +27 -16
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +16 -41
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +42 -14
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +14 -10
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +9 -51
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +53 -43
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +43 -16
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +15 -4
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +4 -4
- package/dist/index379.js.map +1 -1
- package/dist/index380.js +4 -9
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +9 -340
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +339 -4
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +5 -16
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +16 -111
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +109 -19
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +18 -18
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +21 -5
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +5 -20
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +19 -13
- package/dist/index389.js.map +1 -1
- package/dist/index390.js +13 -84
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +84 -7
- package/dist/index391.js.map +1 -1
- package/dist/index392.js +9 -29
- package/dist/index392.js.map +1 -1
- package/dist/index393.js +28 -9
- package/dist/index393.js.map +1 -1
- package/dist/index394.js +9 -5
- package/dist/index394.js.map +1 -1
- package/dist/index395.js +6 -252
- package/dist/index395.js.map +1 -1
- package/dist/index396.js +250 -10
- package/dist/index396.js.map +1 -1
- package/dist/index397.js +11 -10
- package/dist/index397.js.map +1 -1
- package/dist/index398.js +10 -6
- package/dist/index398.js.map +1 -1
- package/dist/index399.js +6 -22
- package/dist/index399.js.map +1 -1
- package/dist/index400.js +21 -21
- package/dist/index400.js.map +1 -1
- package/dist/index401.js +21 -107
- package/dist/index401.js.map +1 -1
- package/dist/index402.js +109 -15
- package/dist/index402.js.map +1 -1
- package/dist/index403.js +15 -12
- package/dist/index403.js.map +1 -1
- package/dist/index404.js +10 -8
- package/dist/index404.js.map +1 -1
- package/dist/index405.js +8 -242
- package/dist/index405.js.map +1 -1
- package/dist/index406.js +238 -25
- package/dist/index406.js.map +1 -1
- package/dist/index407.js +29 -51
- package/dist/index407.js.map +1 -1
- package/dist/index408.js +51 -10
- package/dist/index408.js.map +1 -1
- package/dist/index409.js +11 -128
- package/dist/index409.js.map +1 -1
- package/dist/index410.js +124 -35
- package/dist/index410.js.map +1 -1
- package/dist/index411.js +36 -23
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +26 -11
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +11 -23
- package/dist/index413.js.map +1 -1
- package/dist/index414.js +19 -13
- package/dist/index414.js.map +1 -1
- package/dist/index415.js +14 -13
- package/dist/index415.js.map +1 -1
- package/dist/index416.js +14 -322
- package/dist/index416.js.map +1 -1
- package/dist/index417.js +323 -61
- package/dist/index417.js.map +1 -1
- package/dist/index418.js +63 -4
- package/dist/index418.js.map +1 -1
- package/dist/index419.js +4 -28
- package/dist/index419.js.map +1 -1
- package/dist/index420.js +25 -468
- package/dist/index420.js.map +1 -1
- package/dist/index421.js +452 -250
- package/dist/index421.js.map +1 -1
- package/dist/index422.js +272 -0
- package/dist/index422.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256.worker-BEf4_Y9w.js","names":["exports"],"sources":["../../../../node_modules/fast-sha256/sha256.js","../../src/components/FilesUploadField/sha256.ts","../../src/components/FilesUploadField/sha256.worker.ts"],"sourcesContent":["(function (root, factory) {\n // Hack to make all exports of this module sha256 function object properties.\n var exports = {};\n factory(exports);\n var sha256 = exports[\"default\"];\n for (var k in exports) {\n sha256[k] = exports[k];\n }\n \n if (typeof module === 'object' && typeof module.exports === 'object') {\n module.exports = sha256;\n } else if (typeof define === 'function' && define.amd) {\n define(function() { return sha256; }); \n } else {\n root.sha256 = sha256;\n }\n})(this, function(exports) {\n\"use strict\";\nexports.__esModule = true;\n// SHA-256 (+ HMAC and PBKDF2) for JavaScript.\n//\n// Written in 2014-2016 by Dmitry Chestnykh.\n// Public domain, no warranty.\n//\n// Functions (accept and return Uint8Arrays):\n//\n// sha256(message) -> hash\n// sha256.hmac(key, message) -> mac\n// sha256.pbkdf2(password, salt, rounds, dkLen) -> dk\n//\n// Classes:\n//\n// new sha256.Hash()\n// new sha256.HMAC(key)\n//\nexports.digestLength = 32;\nexports.blockSize = 64;\n// SHA-256 constants\nvar K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,\n 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,\n 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,\n 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,\n 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,\n 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,\n 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\nfunction hashBlocks(w, v, p, pos, len) {\n var a, b, c, d, e, f, g, h, u, i, j, t1, t2;\n while (len >= 64) {\n a = v[0];\n b = v[1];\n c = v[2];\n d = v[3];\n e = v[4];\n f = v[5];\n g = v[6];\n h = v[7];\n for (i = 0; i < 16; i++) {\n j = pos + i * 4;\n w[i] = (((p[j] & 0xff) << 24) | ((p[j + 1] & 0xff) << 16) |\n ((p[j + 2] & 0xff) << 8) | (p[j + 3] & 0xff));\n }\n for (i = 16; i < 64; i++) {\n u = w[i - 2];\n t1 = (u >>> 17 | u << (32 - 17)) ^ (u >>> 19 | u << (32 - 19)) ^ (u >>> 10);\n u = w[i - 15];\n t2 = (u >>> 7 | u << (32 - 7)) ^ (u >>> 18 | u << (32 - 18)) ^ (u >>> 3);\n w[i] = (t1 + w[i - 7] | 0) + (t2 + w[i - 16] | 0);\n }\n for (i = 0; i < 64; i++) {\n t1 = (((((e >>> 6 | e << (32 - 6)) ^ (e >>> 11 | e << (32 - 11)) ^\n (e >>> 25 | e << (32 - 25))) + ((e & f) ^ (~e & g))) | 0) +\n ((h + ((K[i] + w[i]) | 0)) | 0)) | 0;\n t2 = (((a >>> 2 | a << (32 - 2)) ^ (a >>> 13 | a << (32 - 13)) ^\n (a >>> 22 | a << (32 - 22))) + ((a & b) ^ (a & c) ^ (b & c))) | 0;\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n v[0] += a;\n v[1] += b;\n v[2] += c;\n v[3] += d;\n v[4] += e;\n v[5] += f;\n v[6] += g;\n v[7] += h;\n pos += 64;\n len -= 64;\n }\n return pos;\n}\n// Hash implements SHA256 hash algorithm.\nvar Hash = /** @class */ (function () {\n function Hash() {\n this.digestLength = exports.digestLength;\n this.blockSize = exports.blockSize;\n // Note: Int32Array is used instead of Uint32Array for performance reasons.\n this.state = new Int32Array(8); // hash state\n this.temp = new Int32Array(64); // temporary state\n this.buffer = new Uint8Array(128); // buffer for data to hash\n this.bufferLength = 0; // number of bytes in buffer\n this.bytesHashed = 0; // number of total bytes hashed\n this.finished = false; // indicates whether the hash was finalized\n this.reset();\n }\n // Resets hash state making it possible\n // to re-use this instance to hash other data.\n Hash.prototype.reset = function () {\n this.state[0] = 0x6a09e667;\n this.state[1] = 0xbb67ae85;\n this.state[2] = 0x3c6ef372;\n this.state[3] = 0xa54ff53a;\n this.state[4] = 0x510e527f;\n this.state[5] = 0x9b05688c;\n this.state[6] = 0x1f83d9ab;\n this.state[7] = 0x5be0cd19;\n this.bufferLength = 0;\n this.bytesHashed = 0;\n this.finished = false;\n return this;\n };\n // Cleans internal buffers and re-initializes hash state.\n Hash.prototype.clean = function () {\n for (var i = 0; i < this.buffer.length; i++) {\n this.buffer[i] = 0;\n }\n for (var i = 0; i < this.temp.length; i++) {\n this.temp[i] = 0;\n }\n this.reset();\n };\n // Updates hash state with the given data.\n //\n // Optionally, length of the data can be specified to hash\n // fewer bytes than data.length.\n //\n // Throws error when trying to update already finalized hash:\n // instance must be reset to use it again.\n Hash.prototype.update = function (data, dataLength) {\n if (dataLength === void 0) { dataLength = data.length; }\n if (this.finished) {\n throw new Error(\"SHA256: can't update because hash was finished.\");\n }\n var dataPos = 0;\n this.bytesHashed += dataLength;\n if (this.bufferLength > 0) {\n while (this.bufferLength < 64 && dataLength > 0) {\n this.buffer[this.bufferLength++] = data[dataPos++];\n dataLength--;\n }\n if (this.bufferLength === 64) {\n hashBlocks(this.temp, this.state, this.buffer, 0, 64);\n this.bufferLength = 0;\n }\n }\n if (dataLength >= 64) {\n dataPos = hashBlocks(this.temp, this.state, data, dataPos, dataLength);\n dataLength %= 64;\n }\n while (dataLength > 0) {\n this.buffer[this.bufferLength++] = data[dataPos++];\n dataLength--;\n }\n return this;\n };\n // Finalizes hash state and puts hash into out.\n //\n // If hash was already finalized, puts the same value.\n Hash.prototype.finish = function (out) {\n if (!this.finished) {\n var bytesHashed = this.bytesHashed;\n var left = this.bufferLength;\n var bitLenHi = (bytesHashed / 0x20000000) | 0;\n var bitLenLo = bytesHashed << 3;\n var padLength = (bytesHashed % 64 < 56) ? 64 : 128;\n this.buffer[left] = 0x80;\n for (var i = left + 1; i < padLength - 8; i++) {\n this.buffer[i] = 0;\n }\n this.buffer[padLength - 8] = (bitLenHi >>> 24) & 0xff;\n this.buffer[padLength - 7] = (bitLenHi >>> 16) & 0xff;\n this.buffer[padLength - 6] = (bitLenHi >>> 8) & 0xff;\n this.buffer[padLength - 5] = (bitLenHi >>> 0) & 0xff;\n this.buffer[padLength - 4] = (bitLenLo >>> 24) & 0xff;\n this.buffer[padLength - 3] = (bitLenLo >>> 16) & 0xff;\n this.buffer[padLength - 2] = (bitLenLo >>> 8) & 0xff;\n this.buffer[padLength - 1] = (bitLenLo >>> 0) & 0xff;\n hashBlocks(this.temp, this.state, this.buffer, 0, padLength);\n this.finished = true;\n }\n for (var i = 0; i < 8; i++) {\n out[i * 4 + 0] = (this.state[i] >>> 24) & 0xff;\n out[i * 4 + 1] = (this.state[i] >>> 16) & 0xff;\n out[i * 4 + 2] = (this.state[i] >>> 8) & 0xff;\n out[i * 4 + 3] = (this.state[i] >>> 0) & 0xff;\n }\n return this;\n };\n // Returns the final hash digest.\n Hash.prototype.digest = function () {\n var out = new Uint8Array(this.digestLength);\n this.finish(out);\n return out;\n };\n // Internal function for use in HMAC for optimization.\n Hash.prototype._saveState = function (out) {\n for (var i = 0; i < this.state.length; i++) {\n out[i] = this.state[i];\n }\n };\n // Internal function for use in HMAC for optimization.\n Hash.prototype._restoreState = function (from, bytesHashed) {\n for (var i = 0; i < this.state.length; i++) {\n this.state[i] = from[i];\n }\n this.bytesHashed = bytesHashed;\n this.finished = false;\n this.bufferLength = 0;\n };\n return Hash;\n}());\nexports.Hash = Hash;\n// HMAC implements HMAC-SHA256 message authentication algorithm.\nvar HMAC = /** @class */ (function () {\n function HMAC(key) {\n this.inner = new Hash();\n this.outer = new Hash();\n this.blockSize = this.inner.blockSize;\n this.digestLength = this.inner.digestLength;\n var pad = new Uint8Array(this.blockSize);\n if (key.length > this.blockSize) {\n (new Hash()).update(key).finish(pad).clean();\n }\n else {\n for (var i = 0; i < key.length; i++) {\n pad[i] = key[i];\n }\n }\n for (var i = 0; i < pad.length; i++) {\n pad[i] ^= 0x36;\n }\n this.inner.update(pad);\n for (var i = 0; i < pad.length; i++) {\n pad[i] ^= 0x36 ^ 0x5c;\n }\n this.outer.update(pad);\n this.istate = new Uint32Array(8);\n this.ostate = new Uint32Array(8);\n this.inner._saveState(this.istate);\n this.outer._saveState(this.ostate);\n for (var i = 0; i < pad.length; i++) {\n pad[i] = 0;\n }\n }\n // Returns HMAC state to the state initialized with key\n // to make it possible to run HMAC over the other data with the same\n // key without creating a new instance.\n HMAC.prototype.reset = function () {\n this.inner._restoreState(this.istate, this.inner.blockSize);\n this.outer._restoreState(this.ostate, this.outer.blockSize);\n return this;\n };\n // Cleans HMAC state.\n HMAC.prototype.clean = function () {\n for (var i = 0; i < this.istate.length; i++) {\n this.ostate[i] = this.istate[i] = 0;\n }\n this.inner.clean();\n this.outer.clean();\n };\n // Updates state with provided data.\n HMAC.prototype.update = function (data) {\n this.inner.update(data);\n return this;\n };\n // Finalizes HMAC and puts the result in out.\n HMAC.prototype.finish = function (out) {\n if (this.outer.finished) {\n this.outer.finish(out);\n }\n else {\n this.inner.finish(out);\n this.outer.update(out, this.digestLength).finish(out);\n }\n return this;\n };\n // Returns message authentication code.\n HMAC.prototype.digest = function () {\n var out = new Uint8Array(this.digestLength);\n this.finish(out);\n return out;\n };\n return HMAC;\n}());\nexports.HMAC = HMAC;\n// Returns SHA256 hash of data.\nfunction hash(data) {\n var h = (new Hash()).update(data);\n var digest = h.digest();\n h.clean();\n return digest;\n}\nexports.hash = hash;\n// Function hash is both available as module.hash and as default export.\nexports[\"default\"] = hash;\n// Returns HMAC-SHA256 of data under the key.\nfunction hmac(key, data) {\n var h = (new HMAC(key)).update(data);\n var digest = h.digest();\n h.clean();\n return digest;\n}\nexports.hmac = hmac;\n// Fills hkdf buffer like this:\n// T(1) = HMAC-Hash(PRK, T(0) | info | 0x01)\nfunction fillBuffer(buffer, hmac, info, counter) {\n // Counter is a byte value: check if it overflowed.\n var num = counter[0];\n if (num === 0) {\n throw new Error(\"hkdf: cannot expand more\");\n }\n // Prepare HMAC instance for new data with old key.\n hmac.reset();\n // Hash in previous output if it was generated\n // (i.e. counter is greater than 1).\n if (num > 1) {\n hmac.update(buffer);\n }\n // Hash in info if it exists.\n if (info) {\n hmac.update(info);\n }\n // Hash in the counter.\n hmac.update(counter);\n // Output result to buffer and clean HMAC instance.\n hmac.finish(buffer);\n // Increment counter inside typed array, this works properly.\n counter[0]++;\n}\nvar hkdfSalt = new Uint8Array(exports.digestLength); // Filled with zeroes.\nfunction hkdf(key, salt, info, length) {\n if (salt === void 0) { salt = hkdfSalt; }\n if (length === void 0) { length = 32; }\n var counter = new Uint8Array([1]);\n // HKDF-Extract uses salt as HMAC key, and key as data.\n var okm = hmac(salt, key);\n // Initialize HMAC for expanding with extracted key.\n // Ensure no collisions with `hmac` function.\n var hmac_ = new HMAC(okm);\n // Allocate buffer.\n var buffer = new Uint8Array(hmac_.digestLength);\n var bufpos = buffer.length;\n var out = new Uint8Array(length);\n for (var i = 0; i < length; i++) {\n if (bufpos === buffer.length) {\n fillBuffer(buffer, hmac_, info, counter);\n bufpos = 0;\n }\n out[i] = buffer[bufpos++];\n }\n hmac_.clean();\n buffer.fill(0);\n counter.fill(0);\n return out;\n}\nexports.hkdf = hkdf;\n// Derives a key from password and salt using PBKDF2-HMAC-SHA256\n// with the given number of iterations.\n//\n// The number of bytes returned is equal to dkLen.\n//\n// (For better security, avoid dkLen greater than hash length - 32 bytes).\nfunction pbkdf2(password, salt, iterations, dkLen) {\n var prf = new HMAC(password);\n var len = prf.digestLength;\n var ctr = new Uint8Array(4);\n var t = new Uint8Array(len);\n var u = new Uint8Array(len);\n var dk = new Uint8Array(dkLen);\n for (var i = 0; i * len < dkLen; i++) {\n var c = i + 1;\n ctr[0] = (c >>> 24) & 0xff;\n ctr[1] = (c >>> 16) & 0xff;\n ctr[2] = (c >>> 8) & 0xff;\n ctr[3] = (c >>> 0) & 0xff;\n prf.reset();\n prf.update(salt);\n prf.update(ctr);\n prf.finish(u);\n for (var j = 0; j < len; j++) {\n t[j] = u[j];\n }\n for (var j = 2; j <= iterations; j++) {\n prf.reset();\n prf.update(u).finish(u);\n for (var k = 0; k < len; k++) {\n t[k] ^= u[k];\n }\n }\n for (var j = 0; j < len && i * len + j < dkLen; j++) {\n dk[i * len + j] = t[j];\n }\n }\n for (var i = 0; i < len; i++) {\n t[i] = u[i] = 0;\n }\n for (var i = 0; i < 4; i++) {\n ctr[i] = 0;\n }\n prf.clean();\n return dk;\n}\nexports.pbkdf2 = pbkdf2;\n});\n","import { Hash } from \"fast-sha256\"\n\n\nexport const SHA256_FILE_CHUNK_SIZE_BYTES = 4 * 1024 * 1024\n\ntype SliceableBlob = Pick<Blob, \"size\" | \"slice\">\n\nexport const sha256BlobHex = async (\n blob: SliceableBlob,\n chunkSize = SHA256_FILE_CHUNK_SIZE_BYTES,\n): Promise<string> => {\n if (!Number.isInteger(chunkSize) || chunkSize <= 0) {\n throw new Error(\"Invalid hash chunk size\")\n }\n\n const hasher = new Hash()\n try {\n for (let offset = 0; offset < blob.size; offset += chunkSize) {\n const chunk = blob.slice(offset, Math.min(blob.size, offset + chunkSize))\n hasher.update(new Uint8Array(await chunk.arrayBuffer()))\n }\n\n return Array.from(hasher.digest())\n .map((byte) => byte.toString(16).padStart(2, \"0\"))\n .join(\"\")\n } finally {\n hasher.clean()\n }\n}\n","import { sha256BlobHex } from \"./sha256\"\n\n\ntype HashWorkerResponse =\n | { ok: true; hash: string }\n | { ok: false; error: string }\n\nconst workerScope = typeof self === \"undefined\" ? null : self as unknown as {\n addEventListener: (type: \"message\", listener: (event: MessageEvent<File>) => void) => void\n postMessage: (message: HashWorkerResponse) => void\n}\n\nif (workerScope) {\n workerScope.addEventListener(\"message\", (event) => {\n void (async () => {\n try {\n const hash = await sha256BlobHex(event.data)\n workerScope.postMessage({ ok: true, hash })\n } catch {\n workerScope.postMessage({ ok: false, error: \"hash_failed\" })\n }\n })()\n })\n}\n\nexport default class RawSha256WorkerModule {\n constructor() {\n throw new Error(\"This worker entry must be loaded through Vite's inline worker transform\")\n }\n}\n"],"x_google_ignoreList":[0],"mappings":"+FAAC,SAAU,EAAM,EAAS,CAEtB,IAAIA,EAAU,CAA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EAAI,EAAK,IACrB,EAAE,GAAK,EAAE,GAAK,EAElB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IACnB,EAAI,GAAK,EAGb,OADA,EAAI,MAAM,EACH,CACX,CACA,EAAQ,OAAS,CACjB,CAAC,OCvaD,IAIa,EAAgB,MAC3B,EACA,EAAY,UACQ,CACpB,GAAI,CAAC,OAAO,UAAU,CAAS,GAAK,GAAa,EAC/C,MAAU,MAAM,yBAAyB,EAG3C,IAAM,EAAS,IAAI,EAAA,KACnB,GAAI,CACF,IAAK,IAAI,EAAS,EAAG,EAAS,EAAK,KAAM,GAAU,EAAW,CAC5D,IAAM,EAAQ,EAAK,MAAM,EAAQ,KAAK,IAAI,EAAK,KAAM,EAAS,CAAS,CAAC,EACxE,EAAO,OAAO,IAAI,WAAW,MAAM,EAAM,YAAY,CAAC,CAAC,CACzD,CAEA,OAAO,MAAM,KAAK,EAAO,OAAO,CAAC,CAAC,CAC/B,IAAK,GAAS,EAAK,SAAS,EAAE,CAAC,CAAC,SAAS,EAAG,GAAG,CAAC,CAAC,CACjD,KAAK,EAAE,CACZ,QAAU,CACR,EAAO,MAAM,CACf,CACF,ECrBM,EAAc,OAAO,KAAS,IAAc,KAAO,KAKrD,GACF,EAAY,iBAAiB,UAAY,GAAU,EAC3C,SAAY,CAChB,GAAI,CACF,IAAM,EAAO,MAAM,EAAc,EAAM,IAAI,EAC3C,EAAY,YAAY,CAAE,GAAI,GAAM,MAAK,CAAC,CAC5C,MAAQ,CACN,EAAY,YAAY,CAAE,GAAI,GAAO,MAAO,aAAc,CAAC,CAC7D,CACF,EAAA,CAAG,CACL,CAAC"}
|
|
@@ -6,10 +6,14 @@ export type FilesUploadFieldFile = {
|
|
|
6
6
|
uploadKey?: string;
|
|
7
7
|
};
|
|
8
8
|
type UploadResult = FilesUploadFieldFile | Promise<FilesUploadFieldFile>;
|
|
9
|
-
type
|
|
9
|
+
export type FileUploadAccessScope = "owner" | "tenant" | "public";
|
|
10
|
+
export type FilesUploadFieldUploadOptions = {
|
|
10
11
|
signal?: AbortSignal;
|
|
11
12
|
isPublic?: boolean;
|
|
12
|
-
|
|
13
|
+
accessScope?: FileUploadAccessScope;
|
|
14
|
+
deduplicationNamespace?: string;
|
|
15
|
+
};
|
|
16
|
+
export type FilesUploadFieldUploadHandler = (file: File, onProgress: (progress: number) => void, options?: FilesUploadFieldUploadOptions) => UploadResult;
|
|
13
17
|
export type FilesUploadFieldRenderItemProps = {
|
|
14
18
|
file: FilesUploadFieldFile;
|
|
15
19
|
previewUrl: string;
|
|
@@ -17,11 +21,12 @@ export type FilesUploadFieldRenderItemProps = {
|
|
|
17
21
|
progress: number;
|
|
18
22
|
fileName?: string;
|
|
19
23
|
};
|
|
20
|
-
|
|
24
|
+
type FilesUploadFieldBaseProps = {
|
|
21
25
|
initialFiles?: FilesUploadFieldFile[];
|
|
22
26
|
onChange?: (files: FilesUploadFieldFile[]) => void;
|
|
23
|
-
upload?:
|
|
24
|
-
|
|
27
|
+
upload?: FilesUploadFieldUploadHandler;
|
|
28
|
+
uploadDeduplicationNamespace?: string;
|
|
29
|
+
maxFiles?: number;
|
|
25
30
|
disabled?: boolean;
|
|
26
31
|
onUploadingChange?: (isUploading: boolean) => void;
|
|
27
32
|
accept?: string | string[];
|
|
@@ -31,6 +36,14 @@ export type FilesUploadFieldProps = {
|
|
|
31
36
|
removeButtonAriaLabel?: string;
|
|
32
37
|
variant?: "card" | "bare";
|
|
33
38
|
};
|
|
34
|
-
|
|
39
|
+
type FilesUploadFieldVisibilityProps = {
|
|
40
|
+
uploadAccessScope?: never;
|
|
41
|
+
uploadIsPublic?: boolean;
|
|
42
|
+
} | {
|
|
43
|
+
uploadAccessScope: FileUploadAccessScope;
|
|
44
|
+
uploadIsPublic?: never;
|
|
45
|
+
};
|
|
46
|
+
export type FilesUploadFieldProps = FilesUploadFieldBaseProps & FilesUploadFieldVisibilityProps;
|
|
47
|
+
export declare function FilesUploadField({ initialFiles, onChange, upload, uploadIsPublic, uploadAccessScope, uploadDeduplicationNamespace, maxFiles, disabled, onUploadingChange, accept, renderHeader, renderItem, addButtonAriaLabel, removeButtonAriaLabel, variant, }: FilesUploadFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
35
48
|
export {};
|
|
36
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FilesUploadField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FilesUploadField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AA6B5E,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAogBD,KAAK,YAAY,GAAG,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAExE,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEjE,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,qBAAqB,CAAA;IACnC,sBAAsB,CAAC,EAAE,MAAM,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,CAC1C,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,EACtC,OAAO,CAAC,EAAE,6BAA6B,KACpC,YAAY,CAAA;AAEjB,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,o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AQ,EACR,QAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,YAAY,EACZ,UAAU,EACV,kBAAyC,EACzC,qBAA8C,EAC9C,OAAgB,GACjB,EAAE,qBAAqB,2CA+xBvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../../../src/components/FilesUploadField/sha256.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,QAAkB,CAAA;AAE3D,KAAK,aAAa,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAA;AAEjD,eAAO,MAAM,aAAa,SAClB,aAAa,yBAElB,OAAO,CAAC,MAAM,CAkBhB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256.worker.d.ts","sourceRoot":"","sources":["../../../src/components/FilesUploadField/sha256.worker.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACxC,cAEC;CACF"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { FilesUploadFieldFile, FilesUploadFieldProps } from "../FilesUploadField";
|
|
2
2
|
export type ImagesFieldImage = FilesUploadFieldFile;
|
|
3
|
-
|
|
3
|
+
type ToImagesFieldProps<T> = T extends unknown ? Omit<T, "initialFiles" | "onChange"> & {
|
|
4
4
|
initialImages?: ImagesFieldImage[];
|
|
5
5
|
onChange?: (images: ImagesFieldImage[]) => void;
|
|
6
|
-
};
|
|
6
|
+
} : never;
|
|
7
|
+
export type ImagesFieldProps = ToImagesFieldProps<FilesUploadFieldProps>;
|
|
7
8
|
export declare function ImagesField({ initialImages, onChange, accept, addButtonAriaLabel, removeButtonAriaLabel, ...props }: ImagesFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ImagesField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAItF,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAA;AAEnD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ImagesField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAItF,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAA;AAEnD,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAC1C,IAAI,CAAC,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,GAAG;IACvC,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAA;CAChD,GACC,KAAK,CAAA;AAET,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;AAIxE,wBAAgB,WAAW,CAAC,EAC1B,aAAkB,EAClB,QAAQ,EACR,MAA2B,EAC3B,kBAAwC,EACxC,qBAA2C,EAC3C,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAWlB"}
|
package/dist/index.js
CHANGED
|
@@ -12,14 +12,14 @@ import { Checkbox as u } from "./index16.js";
|
|
|
12
12
|
import { DayPicker as d, DayPickerField as f, DayPickerInput as p } from "./index182.js";
|
|
13
13
|
import { Dialog as m, DialogClose as h, DialogContent as g, DialogDescription as _, DialogFooter as v, DialogHeader as y, DialogOverlay as b, DialogPortal as x, DialogTitle as S, DialogTrigger as C } from "./index295.js";
|
|
14
14
|
import { Image as w, defaultImageWidths as T, getImageSrcSet as E, isRpcbaseFileImageSrc as D, withImageWidth as O } from "./index297.js";
|
|
15
|
-
import { FilesUploadField as k } from "./
|
|
16
|
-
import { ImagesField as A } from "./
|
|
17
|
-
import { I18nField as j, I18nFieldLocaleProvider as M } from "./
|
|
18
|
-
import { HourPickerField as N, HourPickerInput as P } from "./
|
|
19
|
-
import { PhoneNumberInput as F } from "./
|
|
20
|
-
import { Select as I, SelectContent as L, SelectGroup as R, SelectItem as z, SelectLabel as B, SelectScrollDownButton as V, SelectScrollUpButton as H, SelectSeparator as U, SelectTrigger as W, SelectValue as G } from "./
|
|
21
|
-
import { Header as K } from "./
|
|
22
|
-
import { NotificationsButton as q } from "./
|
|
23
|
-
import { NotificationsDrawer as J } from "./
|
|
24
|
-
import { NotificationsSettings as Y } from "./
|
|
15
|
+
import { FilesUploadField as k } from "./index299.js";
|
|
16
|
+
import { ImagesField as A } from "./index300.js";
|
|
17
|
+
import { I18nField as j, I18nFieldLocaleProvider as M } from "./index301.js";
|
|
18
|
+
import { HourPickerField as N, HourPickerInput as P } from "./index302.js";
|
|
19
|
+
import { PhoneNumberInput as F } from "./index363.js";
|
|
20
|
+
import { Select as I, SelectContent as L, SelectGroup as R, SelectItem as z, SelectLabel as B, SelectScrollDownButton as V, SelectScrollUpButton as H, SelectSeparator as U, SelectTrigger as W, SelectValue as G } from "./index417.js";
|
|
21
|
+
import { Header as K } from "./index419.js";
|
|
22
|
+
import { NotificationsButton as q } from "./index420.js";
|
|
23
|
+
import { NotificationsDrawer as J } from "./index421.js";
|
|
24
|
+
import { NotificationsSettings as Y } from "./index422.js";
|
|
25
25
|
export { c as AddressAutocompleteInput, l as ApplePayButton, u as Checkbox, d as DayPicker, f as DayPickerField, p as DayPickerInput, m as Dialog, h as DialogClose, g as DialogContent, _ as DialogDescription, v as DialogFooter, y as DialogHeader, b as DialogOverlay, x as DialogPortal, S as DialogTitle, C as DialogTrigger, k as FilesUploadField, K as Header, N as HourPickerField, P as HourPickerInput, j as I18nField, M as I18nFieldLocaleProvider, w as Image, A as ImagesField, s as Input, q as NotificationsButton, J as NotificationsDrawer, Y as NotificationsSettings, F as PhoneNumberInput, I as Select, L as SelectContent, R as SelectGroup, z as SelectItem, B as SelectLabel, V as SelectScrollDownButton, H as SelectScrollUpButton, U as SelectSeparator, W as SelectTrigger, G as SelectValue, o as cn, T as defaultImageWidths, E as getImageSrcSet, e as isMobileDevice, D as isRpcbaseFileImageSrc, t as useIsTouchDevice, n as useMapsLibrary, a as useScrollHideOnDown, r as useScrollPagination, i as useUserScrollIntent, O as withImageWidth };
|