From 309014dbc5fb52628e9970a59424f7bd5f4ec9ed Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Fri, 30 Jul 2021 12:07:51 +0800 Subject: [PATCH] feat(app): support animation --- .../uni-app-plus/dist/uni-app-service.es.js | 801 +++++++++--------- .../uni-app-plus/dist/uni-app-view.umd.js | 50 +- .../framework/dom/components/UniComponent.ts | 10 +- .../dom/elements/UniAnimationElement.ts | 30 +- .../view/framework/dom/elements/UniElement.ts | 6 +- .../framework/dom/elements/UniHoverElement.ts | 3 +- .../framework/dom/elements/UniTextElement.ts | 3 +- .../src/view/framework/dom/utils.ts | 11 + .../uni-app-vue/dist/service.runtime.esm.js | 24 +- .../uni-app-vue/lib/service.runtime.esm.js | 20 +- packages/uni-shared/dist/uni-shared.cjs.js | 4 +- packages/uni-shared/dist/uni-shared.d.ts | 4 + packages/uni-shared/dist/uni-shared.es.js | 5 +- packages/uni-shared/src/constants.ts | 2 + packages/uni-shared/src/vdom/Event.ts | 1 + packages/uni-shared/src/vdom/Node.ts | 2 +- 16 files changed, 523 insertions(+), 453 deletions(-) create mode 100644 packages/uni-app-plus/src/view/framework/dom/utils.ts diff --git a/packages/uni-app-plus/dist/uni-app-service.es.js b/packages/uni-app-plus/dist/uni-app-service.es.js index 746bffd6a..cb16fdc2b 100644 --- a/packages/uni-app-plus/dist/uni-app-service.es.js +++ b/packages/uni-app-plus/dist/uni-app-service.es.js @@ -11018,7 +11018,7 @@ var serviceContext = (function (vue) { UniServiceJSBridge: UniServiceJSBridge$1, }; - /*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ + /*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // @@ -11047,19 +11047,19 @@ var serviceContext = (function (vue) { //const Z_FILTERED = 1; //const Z_HUFFMAN_ONLY = 2; //const Z_RLE = 3; - const Z_FIXED = 4; + const Z_FIXED$1 = 4; //const Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ const Z_BINARY = 0; const Z_TEXT = 1; //const Z_ASCII = 1; // = Z_TEXT - const Z_UNKNOWN = 2; + const Z_UNKNOWN$1 = 2; /*============================================================================*/ - function zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } + function zero$1(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } // From zutil.h @@ -11068,8 +11068,8 @@ var serviceContext = (function (vue) { const DYN_TREES = 2; /* The three kinds of block type */ - const MIN_MATCH = 3; - const MAX_MATCH = 258; + const MIN_MATCH$1 = 3; + const MAX_MATCH$1 = 258; /* The minimum and maximum match lengths */ // From deflate.h @@ -11077,25 +11077,25 @@ var serviceContext = (function (vue) { * Internal compression state. */ - const LENGTH_CODES = 29; + const LENGTH_CODES$1 = 29; /* number of length codes, not counting the special END_BLOCK code */ - const LITERALS = 256; + const LITERALS$1 = 256; /* number of literal bytes 0..255 */ - const L_CODES = LITERALS + 1 + LENGTH_CODES; + const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; /* number of Literal or Length codes, including the END_BLOCK code */ - const D_CODES = 30; + const D_CODES$1 = 30; /* number of distance codes */ - const BL_CODES = 19; + const BL_CODES$1 = 19; /* number of codes used to transfer the bit lengths */ - const HEAP_SIZE = 2 * L_CODES + 1; + const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; /* maximum heap size */ - const MAX_BITS = 15; + const MAX_BITS$1 = 15; /* All codes must not exceed MAX_BITS bits */ const Buf_size = 16; @@ -11148,37 +11148,37 @@ var serviceContext = (function (vue) { const DIST_CODE_LEN = 512; /* see definition of array dist_code below */ // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 - const static_ltree = new Array((L_CODES + 2) * 2); - zero(static_ltree); + const static_ltree = new Array((L_CODES$1 + 2) * 2); + zero$1(static_ltree); /* The static literal tree. Since the bit lengths are imposed, there is no * need for the L_CODES extra codes used during heap construction. However * The codes 286 and 287 are needed to build a canonical tree (see _tr_init * below). */ - const static_dtree = new Array(D_CODES * 2); - zero(static_dtree); + const static_dtree = new Array(D_CODES$1 * 2); + zero$1(static_dtree); /* The static distance tree. (Actually a trivial tree since all codes use * 5 bits.) */ const _dist_code = new Array(DIST_CODE_LEN); - zero(_dist_code); + zero$1(_dist_code); /* Distance codes. The first 256 values correspond to the distances * 3 .. 258, the last 256 values correspond to the top 8 bits of * the 15 bit distances. */ - const _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); - zero(_length_code); + const _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1); + zero$1(_length_code); /* length code for each normalized match length (0 == MIN_MATCH) */ - const base_length = new Array(LENGTH_CODES); - zero(base_length); + const base_length = new Array(LENGTH_CODES$1); + zero$1(base_length); /* First normalized length for each code (0 = MIN_MATCH) */ - const base_dist = new Array(D_CODES); - zero(base_dist); + const base_dist = new Array(D_CODES$1); + zero$1(base_dist); /* First normalized distance for each code (0 = distance of 1) */ @@ -11313,7 +11313,7 @@ var serviceContext = (function (vue) { let f; /* frequency */ let overflow = 0; /* number of elements with bit length too large */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { s.bl_count[bits] = 0; } @@ -11322,7 +11322,7 @@ var serviceContext = (function (vue) { */ tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) { n = s.heap[h]; bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; if (bits > max_length) { @@ -11397,7 +11397,7 @@ var serviceContext = (function (vue) { // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { - const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + const next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */ let code = 0; /* running code value */ let bits; /* bit index */ let n; /* code index */ @@ -11405,7 +11405,7 @@ var serviceContext = (function (vue) { /* The distribution counts are first used to generate the code values * without bit reversal. */ - for (bits = 1; bits <= MAX_BITS; bits++) { + for (bits = 1; bits <= MAX_BITS$1; bits++) { next_code[bits] = code = (code + bl_count[bits - 1]) << 1; } /* Check that the bit counts in bl_count are consistent. The last code @@ -11437,7 +11437,7 @@ var serviceContext = (function (vue) { let length; /* length value */ let code; /* code value */ let dist; /* distance index */ - const bl_count = new Array(MAX_BITS + 1); + const bl_count = new Array(MAX_BITS$1 + 1); /* number of codes at each bit length for an optimal tree */ // do check in _tr_init() @@ -11454,7 +11454,7 @@ var serviceContext = (function (vue) { /* Initialize the mapping length (0..255) -> length code (0..28) */ length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { + for (code = 0; code < LENGTH_CODES$1 - 1; code++) { base_length[code] = length; for (n = 0; n < (1 << extra_lbits[code]); n++) { _length_code[length++] = code; @@ -11477,7 +11477,7 @@ var serviceContext = (function (vue) { } //Assert (dist == 256, "tr_static_init: dist != 256"); dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { + for (; code < D_CODES$1; code++) { base_dist[code] = dist << 7; for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { _dist_code[256 + dist++] = code; @@ -11486,7 +11486,7 @@ var serviceContext = (function (vue) { //Assert (dist == 256, "tr_static_init: 256+dist != 512"); /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { bl_count[bits] = 0; } @@ -11515,18 +11515,18 @@ var serviceContext = (function (vue) { * tree construction to get a canonical Huffman tree (longest code * all ones) */ - gen_codes(static_ltree, L_CODES + 1, bl_count); + gen_codes(static_ltree, L_CODES$1 + 1, bl_count); /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { + for (n = 0; n < D_CODES$1; n++) { static_dtree[n * 2 + 1]/*.Len*/ = 5; static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); } // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS); //static_init_done = true; }; @@ -11540,9 +11540,9 @@ var serviceContext = (function (vue) { let n; /* iterates over tree elements */ /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; s.opt_len = s.static_len = 0; @@ -11662,7 +11662,7 @@ var serviceContext = (function (vue) { } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */ extra = extra_lbits[code]; if (extra !== 0) { lc -= base_length[code]; @@ -11716,7 +11716,7 @@ var serviceContext = (function (vue) { * heap[0] is not used. */ s.heap_len = 0; - s.heap_max = HEAP_SIZE; + s.heap_max = HEAP_SIZE$1; for (n = 0; n < elems; n++) { if (tree[n * 2]/*.Freq*/ !== 0) { @@ -11950,7 +11950,7 @@ var serviceContext = (function (vue) { * requires that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { break; } @@ -12029,7 +12029,7 @@ var serviceContext = (function (vue) { s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { return Z_TEXT; } - for (n = 32; n < LITERALS; n++) { + for (n = 32; n < LITERALS$1; n++) { if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { return Z_TEXT; } @@ -12047,7 +12047,7 @@ var serviceContext = (function (vue) { /* =========================================================================== * Initialize the tree data structures for a new zlib stream. */ - const _tr_init = (s) => + const _tr_init$1 = (s) => { if (!static_init_done) { @@ -12070,7 +12070,7 @@ var serviceContext = (function (vue) { /* =========================================================================== * Send a stored block */ - const _tr_stored_block = (s, buf, stored_len, last) => + const _tr_stored_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block */ //ulg stored_len; /* length of input block */ @@ -12085,7 +12085,7 @@ var serviceContext = (function (vue) { * Send one empty static block to give enough lookahead for inflate. * This takes 10 bits, of which 7 may remain in the bit buffer. */ - const _tr_align = (s) => { + const _tr_align$1 = (s) => { send_bits(s, STATIC_TREES << 1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); @@ -12096,7 +12096,7 @@ var serviceContext = (function (vue) { * Determine the best encoding for the current block: dynamic trees, static * trees or store, and output the encoded block to the zip file. */ - const _tr_flush_block = (s, buf, stored_len, last) => + const _tr_flush_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ @@ -12109,7 +12109,7 @@ var serviceContext = (function (vue) { if (s.level > 0) { /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { + if (s.strm.data_type === Z_UNKNOWN$1) { s.strm.data_type = detect_data_type(s); } @@ -12154,9 +12154,9 @@ var serviceContext = (function (vue) { * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ - _tr_stored_block(s, buf, stored_len, last); + _tr_stored_block$1(s, buf, stored_len, last); - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); @@ -12183,7 +12183,7 @@ var serviceContext = (function (vue) { * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ - const _tr_tally = (s, dist, lc) => + const _tr_tally$1 = (s, dist, lc) => // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ @@ -12207,7 +12207,7 @@ var serviceContext = (function (vue) { // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]/*.Freq*/++; s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; } @@ -12241,11 +12241,11 @@ var serviceContext = (function (vue) { */ }; - var _tr_init_1 = _tr_init; - var _tr_stored_block_1 = _tr_stored_block; - var _tr_flush_block_1 = _tr_flush_block; - var _tr_tally_1 = _tr_tally; - var _tr_align_1 = _tr_align; + var _tr_init_1 = _tr_init$1; + var _tr_stored_block_1 = _tr_stored_block$1; + var _tr_flush_block_1 = _tr_flush_block$1; + var _tr_tally_1 = _tr_tally$1; + var _tr_align_1 = _tr_align$1; var trees = { _tr_init: _tr_init_1, @@ -12413,7 +12413,7 @@ var serviceContext = (function (vue) { // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - var constants = { + var constants$2 = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, @@ -12480,7 +12480,7 @@ var serviceContext = (function (vue) { // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - const { _tr_init: _tr_init$1, _tr_stored_block: _tr_stored_block$1, _tr_flush_block: _tr_flush_block$1, _tr_tally: _tr_tally$1, _tr_align: _tr_align$1 } = trees; + const { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees; @@ -12489,42 +12489,42 @@ var serviceContext = (function (vue) { /* ===========================================================================*/ const { - Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK, - Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR, - Z_DEFAULT_COMPRESSION, - Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED: Z_FIXED$1, Z_DEFAULT_STRATEGY, - Z_UNKNOWN: Z_UNKNOWN$1, - Z_DEFLATED - } = constants; + Z_NO_FLUSH: Z_NO_FLUSH$2, Z_PARTIAL_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$3, Z_BLOCK: Z_BLOCK$1, + Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_BUF_ERROR: Z_BUF_ERROR$1, + Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, + Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_UNKNOWN, + Z_DEFLATED: Z_DEFLATED$2 + } = constants$2; /*============================================================================*/ const MAX_MEM_LEVEL = 9; /* Maximum value for memLevel in deflateInit2 */ - const MAX_WBITS = 15; + const MAX_WBITS$1 = 15; /* 32K LZ77 window */ const DEF_MEM_LEVEL = 8; - const LENGTH_CODES$1 = 29; + const LENGTH_CODES = 29; /* number of length codes, not counting the special END_BLOCK code */ - const LITERALS$1 = 256; + const LITERALS = 256; /* number of literal bytes 0..255 */ - const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; + const L_CODES = LITERALS + 1 + LENGTH_CODES; /* number of Literal or Length codes, including the END_BLOCK code */ - const D_CODES$1 = 30; + const D_CODES = 30; /* number of distance codes */ - const BL_CODES$1 = 19; + const BL_CODES = 19; /* number of codes used to transfer the bit lengths */ - const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; + const HEAP_SIZE = 2 * L_CODES + 1; /* maximum heap size */ - const MAX_BITS$1 = 15; + const MAX_BITS = 15; /* All codes must not exceed MAX_BITS bits */ - const MIN_MATCH$1 = 3; - const MAX_MATCH$1 = 258; - const MIN_LOOKAHEAD = (MAX_MATCH$1 + MIN_MATCH$1 + 1); + const MIN_MATCH = 3; + const MAX_MATCH = 258; + const MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); const PRESET_DICT = 0x20; @@ -12552,7 +12552,7 @@ var serviceContext = (function (vue) { return ((f) << 1) - ((f) > 4 ? 9 : 0); }; - const zero$1 = (buf) => { + const zero = (buf) => { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }; @@ -12593,7 +12593,7 @@ var serviceContext = (function (vue) { const flush_block_only = (s, last) => { - _tr_flush_block$1(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); s.block_start = s.strstart; flush_pending(s.strm); }; @@ -12680,7 +12680,7 @@ var serviceContext = (function (vue) { * we prevent matches with the string of window index 0. */ - const strend = s.strstart + MAX_MATCH$1; + const strend = s.strstart + MAX_MATCH; let scan_end1 = _win[scan + best_len - 1]; let scan_end = _win[scan + best_len]; @@ -12743,8 +12743,8 @@ var serviceContext = (function (vue) { // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - len = MAX_MATCH$1 - (strend - scan); - scan = strend - MAX_MATCH$1; + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; @@ -12858,7 +12858,7 @@ var serviceContext = (function (vue) { s.lookahead += n; /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH$1) { + if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; @@ -12869,13 +12869,13 @@ var serviceContext = (function (vue) { //#endif while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; - if (s.lookahead + s.insert < MIN_MATCH$1) { + if (s.lookahead + s.insert < MIN_MATCH) { break; } } @@ -12957,7 +12957,7 @@ var serviceContext = (function (vue) { // } fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + if (s.lookahead === 0 && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } @@ -13003,7 +13003,7 @@ var serviceContext = (function (vue) { s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13045,7 +13045,7 @@ var serviceContext = (function (vue) { */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { @@ -13057,9 +13057,9 @@ var serviceContext = (function (vue) { * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -13076,24 +13076,24 @@ var serviceContext = (function (vue) { s.match_length = longest_match(s, hash_head); /* longest_match() sets match_start */ } - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /*** _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ - if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) { + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { s.match_length--; /* string at strstart already in table */ do { s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -13121,7 +13121,7 @@ var serviceContext = (function (vue) { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s.window[s.strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -13135,8 +13135,8 @@ var serviceContext = (function (vue) { /***/ } } - s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1); - if (flush === Z_FINISH) { + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13177,7 +13177,7 @@ var serviceContext = (function (vue) { */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -13187,9 +13187,9 @@ var serviceContext = (function (vue) { * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -13199,7 +13199,7 @@ var serviceContext = (function (vue) { */ s.prev_length = s.match_length; s.prev_match = s.match_start; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { @@ -13211,26 +13211,26 @@ var serviceContext = (function (vue) { /* longest_match() sets match_start */ if (s.match_length <= 5 && - (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ - if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH$1; + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length); /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ - bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in @@ -13241,14 +13241,14 @@ var serviceContext = (function (vue) { do { if (++s.strstart <= max_insert) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } } while (--s.prev_length !== 0); s.match_available = 0; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; s.strstart++; if (bflush) { @@ -13267,7 +13267,7 @@ var serviceContext = (function (vue) { */ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); if (bflush) { /*** FLUSH_BLOCK_ONLY(s, 0) ***/ @@ -13292,12 +13292,12 @@ var serviceContext = (function (vue) { if (s.match_available) { //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); s.match_available = 0; } - s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1; - if (flush === Z_FINISH) { + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13337,9 +13337,9 @@ var serviceContext = (function (vue) { * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ - if (s.lookahead <= MAX_MATCH$1) { + if (s.lookahead <= MAX_MATCH) { fill_window(s); - if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) { + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -13347,11 +13347,11 @@ var serviceContext = (function (vue) { /* See how many times the previous byte repeats */ s.match_length = 0; - if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) { + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH$1; + strend = s.strstart + MAX_MATCH; do { /*jshint noempty:false*/ } while (prev === _win[++scan] && prev === _win[++scan] && @@ -13359,7 +13359,7 @@ var serviceContext = (function (vue) { prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); - s.match_length = MAX_MATCH$1 - (strend - scan); + s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; } @@ -13368,11 +13368,11 @@ var serviceContext = (function (vue) { } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { //check_match(s, s.strstart, s.strstart - 1, s.match_length); /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; @@ -13381,7 +13381,7 @@ var serviceContext = (function (vue) { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -13396,7 +13396,7 @@ var serviceContext = (function (vue) { } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13429,7 +13429,7 @@ var serviceContext = (function (vue) { if (s.lookahead === 0) { fill_window(s); if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { + if (flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } break; /* flush the current block */ @@ -13440,7 +13440,7 @@ var serviceContext = (function (vue) { s.match_length = 0; //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; if (bflush) { @@ -13453,7 +13453,7 @@ var serviceContext = (function (vue) { } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13511,7 +13511,7 @@ var serviceContext = (function (vue) { s.window_size = 2 * s.w_size; /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); /* Set the default configuration parameters: */ @@ -13524,7 +13524,7 @@ var serviceContext = (function (vue) { s.block_start = 0; s.lookahead = 0; s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; }; @@ -13540,7 +13540,7 @@ var serviceContext = (function (vue) { this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ this.gzhead = null; /* gzip header information to write */ this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.method = Z_DEFLATED$2; /* can only be DEFLATED */ this.last_flush = -1; /* value of flush param for previous deflate call */ this.w_size = 0; /* LZ77 window size (32K by default) */ @@ -13633,24 +13633,24 @@ var serviceContext = (function (vue) { // Use flat array of DOUBLE size, with interleaved fata, // because JS does not support effective - this.dyn_ltree = new Uint16Array(HEAP_SIZE$1 * 2); - this.dyn_dtree = new Uint16Array((2 * D_CODES$1 + 1) * 2); - this.bl_tree = new Uint16Array((2 * BL_CODES$1 + 1) * 2); - zero$1(this.dyn_ltree); - zero$1(this.dyn_dtree); - zero$1(this.bl_tree); + this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2); + this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2); + this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); this.l_desc = null; /* desc. for literal tree */ this.d_desc = null; /* desc. for distance tree */ this.bl_desc = null; /* desc. for bit length tree */ //ush bl_count[MAX_BITS+1]; - this.bl_count = new Uint16Array(MAX_BITS$1 + 1); + this.bl_count = new Uint16Array(MAX_BITS + 1); /* number of codes at each bit length for an optimal tree */ //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new Uint16Array(2 * L_CODES$1 + 1); /* heap used to build the Huffman trees */ - zero$1(this.heap); + this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); this.heap_len = 0; /* number of elements in the heap */ this.heap_max = 0; /* element of largest frequency */ @@ -13658,8 +13658,8 @@ var serviceContext = (function (vue) { * The same heap array is used to build all trees. */ - this.depth = new Uint16Array(2 * L_CODES$1 + 1); //uch depth[2*L_CODES+1]; - zero$1(this.depth); + this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); /* Depth of each subtree used as tie breaker for trees of equal frequency */ @@ -13722,11 +13722,11 @@ var serviceContext = (function (vue) { const deflateResetKeep = (strm) => { if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN$1; + strm.data_type = Z_UNKNOWN; const s = strm.state; s.pending = 0; @@ -13741,16 +13741,16 @@ var serviceContext = (function (vue) { 0 // crc32(0, Z_NULL, 0) : 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; - _tr_init$1(s); - return Z_OK; + s.last_flush = Z_NO_FLUSH$2; + _tr_init(s); + return Z_OK$3; }; const deflateReset = (strm) => { const ret = deflateResetKeep(strm); - if (ret === Z_OK) { + if (ret === Z_OK$3) { lm_init(strm.state); } return ret; @@ -13759,21 +13759,21 @@ var serviceContext = (function (vue) { const deflateSetHeader = (strm, head) => { - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + if (!strm || !strm.state) { return Z_STREAM_ERROR$2; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR$2; } strm.state.gzhead = head; - return Z_OK; + return Z_OK$3; }; const deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => { if (!strm) { // === Z_NULL - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } let wrap = 1; - if (level === Z_DEFAULT_COMPRESSION) { + if (level === Z_DEFAULT_COMPRESSION$1) { level = 6; } @@ -13788,10 +13788,10 @@ var serviceContext = (function (vue) { } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED$1) { - return err(strm, Z_STREAM_ERROR); + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR$2); } @@ -13814,7 +13814,7 @@ var serviceContext = (function (vue) { s.hash_bits = memLevel + 7; s.hash_size = 1 << s.hash_bits; s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH$1 - 1) / MIN_MATCH$1); + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); s.window = new Uint8Array(s.w_size * 2); s.head = new Uint16Array(s.hash_size); @@ -13847,25 +13847,25 @@ var serviceContext = (function (vue) { const deflateInit = (strm, level) => { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1); }; - const deflate = (strm, flush) => { + const deflate$2 = (strm, flush) => { let beg, val; // for gzip header write only if (!strm || !strm.state || - flush > Z_BLOCK || flush < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + flush > Z_BLOCK$1 || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2; } const s = strm.state; if (!strm.output || (!strm.input && strm.avail_in !== 0) || - (s.status === FINISH_STATE && flush !== Z_FINISH)) { - return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + (s.status === FINISH_STATE && flush !== Z_FINISH$3)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2); } s.strm = strm; /* just in case */ @@ -13920,7 +13920,7 @@ var serviceContext = (function (vue) { } else // DEFLATE header { - let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + let header = (Z_DEFLATED$2 + ((s.w_bits - 8) << 4)) << 8; let level_flags = -1; if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { @@ -14083,7 +14083,7 @@ var serviceContext = (function (vue) { * return OK instead of BUF_ERROR at next call of deflate: */ s.last_flush = -1; - return Z_OK; + return Z_OK$3; } /* Make sure there is something to do and avoid duplicate consecutive @@ -14091,19 +14091,19 @@ var serviceContext = (function (vue) { * returning Z_STREAM_END instead of Z_BUF_ERROR. */ } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && - flush !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); + flush !== Z_FINISH$3) { + return err(strm, Z_BUF_ERROR$1); } /* User must not provide more input after the first FINISH: */ if (s.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); + return err(strm, Z_BUF_ERROR$1); } /* Start a new block or continue the current one. */ if (strm.avail_in !== 0 || s.lookahead !== 0 || - (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + (flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE)) { let bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : (s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush)); @@ -14116,7 +14116,7 @@ var serviceContext = (function (vue) { s.last_flush = -1; /* avoid BUF_ERROR next call, see above */ } - return Z_OK; + return Z_OK$3; /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an @@ -14127,17 +14127,17 @@ var serviceContext = (function (vue) { } if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { - _tr_align$1(s); + _tr_align(s); } - else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + else if (flush !== Z_BLOCK$1) { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block$1(s, 0, 0, false); + _tr_stored_block(s, 0, 0, false); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ - if (flush === Z_FULL_FLUSH) { + if (flush === Z_FULL_FLUSH$1) { /*** CLEAR_HASH(s); ***/ /* forget history */ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); if (s.lookahead === 0) { s.strstart = 0; @@ -14149,15 +14149,15 @@ var serviceContext = (function (vue) { flush_pending(strm); if (strm.avail_out === 0) { s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; + return Z_OK$3; } } } //Assert(strm->avail_out > 0, "bug2"); //if (strm.avail_out <= 0) { throw new Error("bug2");} - if (flush !== Z_FINISH) { return Z_OK; } - if (s.wrap <= 0) { return Z_STREAM_END; } + if (flush !== Z_FINISH$3) { return Z_OK$3; } + if (s.wrap <= 0) { return Z_STREAM_END$3; } /* Write the trailer */ if (s.wrap === 2) { @@ -14182,14 +14182,14 @@ var serviceContext = (function (vue) { */ if (s.wrap > 0) { s.wrap = -s.wrap; } /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; + return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3; }; const deflateEnd = (strm) => { if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } const status = strm.state.status; @@ -14201,12 +14201,12 @@ var serviceContext = (function (vue) { status !== BUSY_STATE && status !== FINISH_STATE ) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.state = null; - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3; }; @@ -14219,14 +14219,14 @@ var serviceContext = (function (vue) { let dictLength = dictionary.length; if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } const s = strm.state; const wrap = s.wrap; if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } /* when using zlib wrappers, compute Adler-32 for provided dictionary */ @@ -14241,7 +14241,7 @@ var serviceContext = (function (vue) { if (dictLength >= s.w_size) { if (wrap === 0) { /* already empty otherwise */ /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); s.strstart = 0; s.block_start = 0; s.insert = 0; @@ -14261,12 +14261,12 @@ var serviceContext = (function (vue) { strm.next_in = 0; strm.input = dictionary; fill_window(s); - while (s.lookahead >= MIN_MATCH$1) { + while (s.lookahead >= MIN_MATCH) { let str = s.strstart; - let n = s.lookahead - (MIN_MATCH$1 - 1); + let n = s.lookahead - (MIN_MATCH - 1); do { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; @@ -14274,20 +14274,20 @@ var serviceContext = (function (vue) { str++; } while (--n); s.strstart = str; - s.lookahead = MIN_MATCH$1 - 1; + s.lookahead = MIN_MATCH - 1; fill_window(s); } s.strstart += s.lookahead; s.block_start = s.strstart; s.insert = s.lookahead; s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; strm.next_in = next; strm.input = input; strm.avail_in = avail; s.wrap = wrap; - return Z_OK; + return Z_OK$3; }; @@ -14296,7 +14296,7 @@ var serviceContext = (function (vue) { var deflateReset_1 = deflateReset; var deflateResetKeep_1 = deflateResetKeep; var deflateSetHeader_1 = deflateSetHeader; - var deflate_2 = deflate; + var deflate_2$1 = deflate$2; var deflateEnd_1 = deflateEnd; var deflateSetDictionary_1 = deflateSetDictionary; var deflateInfo = 'pako deflate (from Nodeca project)'; @@ -14310,13 +14310,13 @@ var serviceContext = (function (vue) { module.exports.deflateTune = deflateTune; */ - var deflate_1 = { + var deflate_1$2 = { deflateInit: deflateInit_1, deflateInit2: deflateInit2_1, deflateReset: deflateReset_1, deflateResetKeep: deflateResetKeep_1, deflateSetHeader: deflateSetHeader_1, - deflate: deflate_2, + deflate: deflate_2$1, deflateEnd: deflateEnd_1, deflateSetDictionary: deflateSetDictionary_1, deflateInfo: deflateInfo @@ -14398,6 +14398,10 @@ var serviceContext = (function (vue) { // convert string to array (typed, when possible) var string2buf = (str) => { + if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; // count binary size @@ -14471,9 +14475,14 @@ var serviceContext = (function (vue) { // convert array to string var buf2string = (buf, max) => { - let i, out; const len = max || buf.length; + if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + + let i, out; + // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -14590,18 +14599,18 @@ var serviceContext = (function (vue) { var zstream = ZStream; - const toString = Object.prototype.toString; + const toString$1 = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$1, - Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, - Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, - Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH: Z_FINISH$2, + Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2, + Z_DEFAULT_COMPRESSION, + Z_DEFAULT_STRATEGY, Z_DEFLATED: Z_DEFLATED$1 - } = constants; + } = constants$2; /* ===========================================================================*/ @@ -14691,14 +14700,14 @@ var serviceContext = (function (vue) { * console.log(deflate.result); * ``` **/ - function Deflate(options) { + function Deflate$1(options) { this.options = common.assign({ - level: Z_DEFAULT_COMPRESSION$1, + level: Z_DEFAULT_COMPRESSION, method: Z_DEFLATED$1, chunkSize: 16384, windowBits: 15, memLevel: 8, - strategy: Z_DEFAULT_STRATEGY$1 + strategy: Z_DEFAULT_STRATEGY }, options || {}); let opt = this.options; @@ -14719,7 +14728,7 @@ var serviceContext = (function (vue) { this.strm = new zstream(); this.strm.avail_out = 0; - let status = deflate_1.deflateInit2( + let status = deflate_1$2.deflateInit2( this.strm, opt.level, opt.method, @@ -14728,12 +14737,12 @@ var serviceContext = (function (vue) { opt.strategy ); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } if (opt.header) { - deflate_1.deflateSetHeader(this.strm, opt.header); + deflate_1$2.deflateSetHeader(this.strm, opt.header); } if (opt.dictionary) { @@ -14742,15 +14751,15 @@ var serviceContext = (function (vue) { if (typeof opt.dictionary === 'string') { // If we need to compress text, change encoding to utf8. dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { dict = new Uint8Array(opt.dictionary); } else { dict = opt.dictionary; } - status = deflate_1.deflateSetDictionary(this.strm, dict); + status = deflate_1$2.deflateSetDictionary(this.strm, dict); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } @@ -14780,7 +14789,7 @@ var serviceContext = (function (vue) { * push(chunk, true); // push last chunk * ``` **/ - Deflate.prototype.push = function (data, flush_mode) { + Deflate$1.prototype.push = function (data, flush_mode) { const strm = this.strm; const chunkSize = this.options.chunkSize; let status, _flush_mode; @@ -14788,13 +14797,13 @@ var serviceContext = (function (vue) { if (this.ended) { return false; } if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1; + else _flush_mode = flush_mode === true ? Z_FINISH$2 : Z_NO_FLUSH$1; // Convert data if needed if (typeof data === 'string') { // If we need to compress text, change encoding to utf8. strm.input = strings.string2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { + } else if (toString$1.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -14811,23 +14820,23 @@ var serviceContext = (function (vue) { } // Make sure avail_out > 6 to avoid repeating markers - if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH$1) && strm.avail_out <= 6) { + if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) { this.onData(strm.output.subarray(0, strm.next_out)); strm.avail_out = 0; continue; } - status = deflate_1.deflate(strm, _flush_mode); + status = deflate_1$2.deflate(strm, _flush_mode); // Ended => flush and finish - if (status === Z_STREAM_END$1) { + if (status === Z_STREAM_END$2) { if (strm.next_out > 0) { this.onData(strm.output.subarray(0, strm.next_out)); } - status = deflate_1.deflateEnd(this.strm); + status = deflate_1$2.deflateEnd(this.strm); this.onEnd(status); this.ended = true; - return status === Z_OK$1; + return status === Z_OK$2; } // Flush if out buffer full @@ -14857,7 +14866,7 @@ var serviceContext = (function (vue) { * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ - Deflate.prototype.onData = function (chunk) { + Deflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; @@ -14871,9 +14880,9 @@ var serviceContext = (function (vue) { * complete (Z_FINISH). By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ - Deflate.prototype.onEnd = function (status) { + Deflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$1) { + if (status === Z_OK$2) { this.result = common.flattenChunks(this.chunks); } this.chunks = []; @@ -14915,7 +14924,7 @@ var serviceContext = (function (vue) { * ``` **/ function deflate$1(input, options) { - const deflator = new Deflate(options); + const deflator = new Deflate$1(options); deflator.push(input, true); @@ -14934,7 +14943,7 @@ var serviceContext = (function (vue) { * The same as [[deflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ - function deflateRaw(input, options) { + function deflateRaw$1(input, options) { options = options || {}; options.raw = true; return deflate$1(input, options); @@ -14949,24 +14958,24 @@ var serviceContext = (function (vue) { * The same as [[deflate]], but create gzip wrapper instead of * deflate one. **/ - function gzip(input, options) { + function gzip$1(input, options) { options = options || {}; options.gzip = true; return deflate$1(input, options); } - var Deflate_1 = Deflate; - var deflate_2$1 = deflate$1; - var deflateRaw_1 = deflateRaw; - var gzip_1 = gzip; - var constants$1 = constants; + var Deflate_1$1 = Deflate$1; + var deflate_2 = deflate$1; + var deflateRaw_1$1 = deflateRaw$1; + var gzip_1$1 = gzip$1; + var constants$1 = constants$2; var deflate_1$1 = { - Deflate: Deflate_1, - deflate: deflate_2$1, - deflateRaw: deflateRaw_1, - gzip: gzip_1, + Deflate: Deflate_1$1, + deflate: deflate_2, + deflateRaw: deflateRaw_1$1, + gzip: gzip_1$1, constants: constants$1 }; @@ -14990,8 +14999,8 @@ var serviceContext = (function (vue) { // 3. This notice may not be removed or altered from any source distribution. // See state defs from inflate.js - const BAD = 30; /* got a data error -- remain here until reset */ - const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + const BAD$1 = 30; /* got a data error -- remain here until reset */ + const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ /* Decode literal, length, and distance codes and write out the resulting @@ -15153,7 +15162,7 @@ var serviceContext = (function (vue) { //#ifdef INFLATE_STRICT if (dist > dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } //#endif @@ -15166,7 +15175,7 @@ var serviceContext = (function (vue) { if (op > whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -15271,7 +15280,7 @@ var serviceContext = (function (vue) { } else { strm.msg = 'invalid distance code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -15284,12 +15293,12 @@ var serviceContext = (function (vue) { } else if (op & 32) { /* end-of-block */ //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; + state.mode = TYPE$1; break top; } else { strm.msg = 'invalid literal/length code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -15333,13 +15342,13 @@ var serviceContext = (function (vue) { // 3. This notice may not be removed or altered from any source distribution. const MAXBITS = 15; - const ENOUGH_LENS = 852; - const ENOUGH_DISTS = 592; + const ENOUGH_LENS$1 = 852; + const ENOUGH_DISTS$1 = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - const CODES = 0; - const LENS = 1; - const DISTS = 2; + const CODES$1 = 0; + const LENS$1 = 1; + const DISTS$1 = 2; const lbase = new Uint16Array([ /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, @@ -15471,7 +15480,7 @@ var serviceContext = (function (vue) { return -1; } /* over-subscribed */ } - if (left > 0 && (type === CODES || max !== 1)) { + if (left > 0 && (type === CODES$1 || max !== 1)) { return -1; /* incomplete set */ } @@ -15522,11 +15531,11 @@ var serviceContext = (function (vue) { /* set up for code type */ // poor man optimization - use if-else instead of switch, // to avoid deopts in old v8 - if (type === CODES) { + if (type === CODES$1) { base = extra = work; /* dummy value--not used */ end = 19; - } else if (type === LENS) { + } else if (type === LENS$1) { base = lbase; base_index -= 257; extra = lext; @@ -15551,8 +15560,8 @@ var serviceContext = (function (vue) { mask = used - 1; /* mask for comparing low */ /* check available table space */ - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -15623,8 +15632,8 @@ var serviceContext = (function (vue) { /* check for enough space */ used += 1 << curr; - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -15680,18 +15689,18 @@ var serviceContext = (function (vue) { - const CODES$1 = 0; - const LENS$1 = 1; - const DISTS$1 = 2; + const CODES = 0; + const LENS = 1; + const DISTS = 2; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_FINISH: Z_FINISH$2, Z_BLOCK: Z_BLOCK$1, Z_TREES, - Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2, Z_NEED_DICT, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR, Z_BUF_ERROR: Z_BUF_ERROR$1, - Z_DEFLATED: Z_DEFLATED$2 - } = constants; + Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES, + Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR, + Z_DEFLATED + } = constants$2; /* STATES ====================================================================*/ @@ -15709,7 +15718,7 @@ var serviceContext = (function (vue) { const HCRC = 9; /* i: waiting for header crc (gzip) */ const DICTID = 10; /* i: waiting for dictionary check value */ const DICT = 11; /* waiting for inflateSetDictionary() call */ - const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ + const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ const TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ const STORED = 14; /* i: waiting for stored size (length and complement) */ const COPY_ = 15; /* i/o: same as COPY below, but only first time in */ @@ -15727,7 +15736,7 @@ var serviceContext = (function (vue) { const CHECK = 27; /* i: waiting for 32-bit check value */ const LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ const DONE = 29; /* finished check, done -- remain here until reset */ - const BAD$1 = 30; /* got a data error -- remain here until reset */ + const BAD = 30; /* got a data error -- remain here until reset */ const MEM = 31; /* got an inflate() memory error -- remain here until reset */ const SYNC = 32; /* looking for synchronization bytes to restart inflate() */ @@ -15735,13 +15744,13 @@ var serviceContext = (function (vue) { - const ENOUGH_LENS$1 = 852; - const ENOUGH_DISTS$1 = 592; + const ENOUGH_LENS = 852; + const ENOUGH_DISTS = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - const MAX_WBITS$1 = 15; + const MAX_WBITS = 15; /* 32K LZ77 window */ - const DEF_WBITS = MAX_WBITS$1; + const DEF_WBITS = MAX_WBITS; const zswap32 = (q) => { @@ -15829,13 +15838,13 @@ var serviceContext = (function (vue) { state.hold = 0; state.bits = 0; //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS$1); - state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS$1); + state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS); + state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS); state.sane = 1; state.back = -1; //Tracev((stderr, "inflate: reset\n")); - return Z_OK$2; + return Z_OK$1; }; @@ -15897,7 +15906,7 @@ var serviceContext = (function (vue) { strm.state = state; state.window = null/*Z_NULL*/; const ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK$2) { + if (ret !== Z_OK$1) { strm.state = null/*Z_NULL*/; } return ret; @@ -15939,13 +15948,13 @@ var serviceContext = (function (vue) { while (sym < 280) { state.lens[sym++] = 7; } while (sym < 288) { state.lens[sym++] = 8; } - inftrees(LENS$1, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); /* distance table */ sym = 0; while (sym < 32) { state.lens[sym++] = 5; } - inftrees(DISTS$1, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); /* do this just once */ virgin = false; @@ -16016,7 +16025,7 @@ var serviceContext = (function (vue) { }; - const inflate = (strm, flush) => { + const inflate$2 = (strm, flush) => { let state; let input, output; // input/output buffers @@ -16050,7 +16059,7 @@ var serviceContext = (function (vue) { } state = strm.state; - if (state.mode === TYPE$1) { state.mode = TYPEDO; } /* skip check */ + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ //--- LOAD() --- @@ -16066,7 +16075,7 @@ var serviceContext = (function (vue) { _in = have; _out = left; - ret = Z_OK$2; + ret = Z_OK$1; inf_leave: // goto emulation for (;;) { @@ -16106,12 +16115,12 @@ var serviceContext = (function (vue) { if (!(state.wrap & 1) || /* check if zlib header allowed */ (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { strm.msg = 'incorrect header check'; - state.mode = BAD$1; + state.mode = BAD; break; } - if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED$2) { + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } //--- DROPBITS(4) ---// @@ -16124,7 +16133,7 @@ var serviceContext = (function (vue) { } else if (len > state.wbits) { strm.msg = 'invalid window size'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -16135,7 +16144,7 @@ var serviceContext = (function (vue) { //Tracev((stderr, "inflate: zlib header ok\n")); strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = hold & 0x200 ? DICTID : TYPE$1; + state.mode = hold & 0x200 ? DICTID : TYPE; //=== INITBITS(); hold = 0; bits = 0; @@ -16151,14 +16160,14 @@ var serviceContext = (function (vue) { } //===// state.flags = hold; - if ((state.flags & 0xff) !== Z_DEFLATED$2) { + if ((state.flags & 0xff) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.flags & 0xe000) { strm.msg = 'unknown header flags set'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.head) { @@ -16361,7 +16370,7 @@ var serviceContext = (function (vue) { //===// if (hold !== (state.check & 0xffff)) { strm.msg = 'header crc mismatch'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -16374,7 +16383,7 @@ var serviceContext = (function (vue) { state.head.done = true; } strm.adler = state.check = 0; - state.mode = TYPE$1; + state.mode = TYPE; break; case DICTID: //=== NEEDBITS(32); */ @@ -16402,13 +16411,13 @@ var serviceContext = (function (vue) { state.hold = hold; state.bits = bits; //--- - return Z_NEED_DICT; + return Z_NEED_DICT$1; } strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = TYPE$1; + state.mode = TYPE; /* falls through */ - case TYPE$1: - if (flush === Z_BLOCK$1 || flush === Z_TREES) { break inf_leave; } + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } /* falls through */ case TYPEDO: if (state.last) { @@ -16459,7 +16468,7 @@ var serviceContext = (function (vue) { break; case 3: strm.msg = 'invalid block type'; - state.mode = BAD$1; + state.mode = BAD; } //--- DROPBITS(2) ---// hold >>>= 2; @@ -16481,7 +16490,7 @@ var serviceContext = (function (vue) { //===// if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { strm.msg = 'invalid stored block lengths'; - state.mode = BAD$1; + state.mode = BAD; break; } state.length = hold & 0xffff; @@ -16514,7 +16523,7 @@ var serviceContext = (function (vue) { break; } //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE$1; + state.mode = TYPE; break; case TABLE: //=== NEEDBITS(14); */ @@ -16543,7 +16552,7 @@ var serviceContext = (function (vue) { //#ifndef PKZIP_BUG_WORKAROUND if (state.nlen > 286 || state.ndist > 30) { strm.msg = 'too many length or distance symbols'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -16578,12 +16587,12 @@ var serviceContext = (function (vue) { state.lenbits = 7; opts = { bits: state.lenbits }; - ret = inftrees(CODES$1, state.lens, 0, 19, state.lencode, 0, state.work, opts); + ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = 'invalid code lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, "inflate: code lengths ok\n")); @@ -16630,7 +16639,7 @@ var serviceContext = (function (vue) { //---// if (state.have === 0) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } len = state.lens[state.have - 1]; @@ -16684,7 +16693,7 @@ var serviceContext = (function (vue) { } if (state.have + copy > state.nlen + state.ndist) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } while (copy--) { @@ -16694,12 +16703,12 @@ var serviceContext = (function (vue) { } /* handle error breaks in while */ - if (state.mode === BAD$1) { break; } + if (state.mode === BAD) { break; } /* check for end-of-block code (better have one) */ if (state.lens[256] === 0) { strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -16709,7 +16718,7 @@ var serviceContext = (function (vue) { state.lenbits = 9; opts = { bits: state.lenbits }; - ret = inftrees(LENS$1, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.lenbits = opts.bits; @@ -16717,7 +16726,7 @@ var serviceContext = (function (vue) { if (ret) { strm.msg = 'invalid literal/lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -16726,7 +16735,7 @@ var serviceContext = (function (vue) { // Switch to use dynamic table state.distcode = state.distdyn; opts = { bits: state.distbits }; - ret = inftrees(DISTS$1, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.distbits = opts.bits; @@ -16734,7 +16743,7 @@ var serviceContext = (function (vue) { if (ret) { strm.msg = 'invalid distances set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, 'inflate: codes ok\n')); @@ -16766,7 +16775,7 @@ var serviceContext = (function (vue) { bits = state.bits; //--- - if (state.mode === TYPE$1) { + if (state.mode === TYPE) { state.back = -1; } break; @@ -16827,12 +16836,12 @@ var serviceContext = (function (vue) { if (here_op & 32) { //Tracevv((stderr, "inflate: end of block\n")); state.back = -1; - state.mode = TYPE$1; + state.mode = TYPE; break; } if (here_op & 64) { strm.msg = 'invalid literal/length code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.extra = here_op & 15; @@ -16907,7 +16916,7 @@ var serviceContext = (function (vue) { state.back += here_bits; if (here_op & 64) { strm.msg = 'invalid distance code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.offset = here_val; @@ -16935,7 +16944,7 @@ var serviceContext = (function (vue) { //#ifdef INFLATE_STRICT if (state.offset > state.dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -16950,7 +16959,7 @@ var serviceContext = (function (vue) { if (copy > state.whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } // (!) This block is disabled in zlib defaults, @@ -17022,7 +17031,7 @@ var serviceContext = (function (vue) { // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = 'incorrect data check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -17045,7 +17054,7 @@ var serviceContext = (function (vue) { //===// if (hold !== (state.total & 0xffffffff)) { strm.msg = 'incorrect length check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -17057,13 +17066,13 @@ var serviceContext = (function (vue) { state.mode = DONE; /* falls through */ case DONE: - ret = Z_STREAM_END$2; + ret = Z_STREAM_END$1; break inf_leave; - case BAD$1: + case BAD: ret = Z_DATA_ERROR$1; break inf_leave; case MEM: - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; case SYNC: /* falls through */ default: @@ -17089,8 +17098,8 @@ var serviceContext = (function (vue) { state.bits = bits; //--- - if (state.wsize || (_out !== strm.avail_out && state.mode < BAD$1 && - (state.mode < CHECK || flush !== Z_FINISH$2))) { + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH$1))) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ; } _in -= strm.avail_in; @@ -17103,10 +17112,10 @@ var serviceContext = (function (vue) { (state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out)); } strm.data_type = state.bits + (state.last ? 64 : 0) + - (state.mode === TYPE$1 ? 128 : 0) + + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if (((_in === 0 && _out === 0) || flush === Z_FINISH$2) && ret === Z_OK$2) { - ret = Z_BUF_ERROR$1; + if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) { + ret = Z_BUF_ERROR; } return ret; }; @@ -17123,7 +17132,7 @@ var serviceContext = (function (vue) { state.window = null; } strm.state = null; - return Z_OK$2; + return Z_OK$1; }; @@ -17137,7 +17146,7 @@ var serviceContext = (function (vue) { /* save header structure */ state.head = head; head.done = false; - return Z_OK$2; + return Z_OK$1; }; @@ -17170,11 +17179,11 @@ var serviceContext = (function (vue) { ret = updatewindow(strm, dictionary, dictLength, dictLength); if (ret) { state.mode = MEM; - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; } state.havedict = 1; // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK$2; + return Z_OK$1; }; @@ -17183,7 +17192,7 @@ var serviceContext = (function (vue) { var inflateResetKeep_1 = inflateResetKeep; var inflateInit_1 = inflateInit; var inflateInit2_1 = inflateInit2; - var inflate_2 = inflate; + var inflate_2$1 = inflate$2; var inflateEnd_1 = inflateEnd; var inflateGetHeader_1 = inflateGetHeader; var inflateSetDictionary_1 = inflateSetDictionary; @@ -17199,13 +17208,13 @@ var serviceContext = (function (vue) { module.exports.inflateUndermine = inflateUndermine; */ - var inflate_1 = { + var inflate_1$2 = { inflateReset: inflateReset_1, inflateReset2: inflateReset2_1, inflateResetKeep: inflateResetKeep_1, inflateInit: inflateInit_1, inflateInit2: inflateInit2_1, - inflate: inflate_2, + inflate: inflate_2$1, inflateEnd: inflateEnd_1, inflateGetHeader: inflateGetHeader_1, inflateSetDictionary: inflateSetDictionary_1, @@ -17269,15 +17278,15 @@ var serviceContext = (function (vue) { var gzheader = GZheader; - const toString$1 = Object.prototype.toString; + const toString = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_NO_FLUSH: Z_NO_FLUSH$2, Z_FINISH: Z_FINISH$3, - Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_MEM_ERROR: Z_MEM_ERROR$1 - } = constants; + Z_NO_FLUSH, Z_FINISH, + Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR + } = constants$2; /* ===========================================================================*/ @@ -17359,7 +17368,7 @@ var serviceContext = (function (vue) { * console.log(inflate.result); * ``` **/ - function Inflate(options) { + function Inflate$1(options) { this.options = common.assign({ chunkSize: 1024 * 64, windowBits: 15, @@ -17399,30 +17408,30 @@ var serviceContext = (function (vue) { this.strm = new zstream(); this.strm.avail_out = 0; - let status = inflate_1.inflateInit2( + let status = inflate_1$2.inflateInit2( this.strm, opt.windowBits ); - if (status !== Z_OK$3) { + if (status !== Z_OK) { throw new Error(messages[status]); } this.header = new gzheader(); - inflate_1.inflateGetHeader(this.strm, this.header); + inflate_1$2.inflateGetHeader(this.strm, this.header); // Setup dictionary if (opt.dictionary) { // Convert data if needed if (typeof opt.dictionary === 'string') { opt.dictionary = strings.string2buf(opt.dictionary); - } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { opt.dictionary = new Uint8Array(opt.dictionary); } if (opt.raw) { //In raw mode we need to set the dictionary early - status = inflate_1.inflateSetDictionary(this.strm, opt.dictionary); - if (status !== Z_OK$3) { + status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary); + if (status !== Z_OK) { throw new Error(messages[status]); } } @@ -17454,7 +17463,7 @@ var serviceContext = (function (vue) { * push(chunk, true); // push last chunk * ``` **/ - Inflate.prototype.push = function (data, flush_mode) { + Inflate$1.prototype.push = function (data, flush_mode) { const strm = this.strm; const chunkSize = this.options.chunkSize; const dictionary = this.options.dictionary; @@ -17463,10 +17472,10 @@ var serviceContext = (function (vue) { if (this.ended) return false; if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$3 : Z_NO_FLUSH$2; + else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; // Convert data if needed - if (toString$1.call(data) === '[object ArrayBuffer]') { + if (toString.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -17482,34 +17491,34 @@ var serviceContext = (function (vue) { strm.avail_out = chunkSize; } - status = inflate_1.inflate(strm, _flush_mode); + status = inflate_1$2.inflate(strm, _flush_mode); - if (status === Z_NEED_DICT$1 && dictionary) { - status = inflate_1.inflateSetDictionary(strm, dictionary); + if (status === Z_NEED_DICT && dictionary) { + status = inflate_1$2.inflateSetDictionary(strm, dictionary); - if (status === Z_OK$3) { - status = inflate_1.inflate(strm, _flush_mode); - } else if (status === Z_DATA_ERROR$2) { + if (status === Z_OK) { + status = inflate_1$2.inflate(strm, _flush_mode); + } else if (status === Z_DATA_ERROR) { // Replace code with more verbose - status = Z_NEED_DICT$1; + status = Z_NEED_DICT; } } // Skip snyc markers if more data follows and not raw mode while (strm.avail_in > 0 && - status === Z_STREAM_END$3 && + status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) { - inflate_1.inflateReset(strm); - status = inflate_1.inflate(strm, _flush_mode); + inflate_1$2.inflateReset(strm); + status = inflate_1$2.inflate(strm, _flush_mode); } switch (status) { - case Z_STREAM_ERROR$2: - case Z_DATA_ERROR$2: - case Z_NEED_DICT$1: - case Z_MEM_ERROR$1: + case Z_STREAM_ERROR: + case Z_DATA_ERROR: + case Z_NEED_DICT: + case Z_MEM_ERROR: this.onEnd(status); this.ended = true; return false; @@ -17520,7 +17529,7 @@ var serviceContext = (function (vue) { last_avail_out = strm.avail_out; if (strm.next_out) { - if (strm.avail_out === 0 || status === Z_STREAM_END$3) { + if (strm.avail_out === 0 || status === Z_STREAM_END) { if (this.options.to === 'string') { @@ -17543,11 +17552,11 @@ var serviceContext = (function (vue) { } // Must repeat iteration if out buffer is full - if (status === Z_OK$3 && last_avail_out === 0) continue; + if (status === Z_OK && last_avail_out === 0) continue; // Finalize if end of stream reached. - if (status === Z_STREAM_END$3) { - status = inflate_1.inflateEnd(this.strm); + if (status === Z_STREAM_END) { + status = inflate_1$2.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return true; @@ -17568,7 +17577,7 @@ var serviceContext = (function (vue) { * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ - Inflate.prototype.onData = function (chunk) { + Inflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; @@ -17582,9 +17591,9 @@ var serviceContext = (function (vue) { * complete (Z_FINISH). By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ - Inflate.prototype.onEnd = function (status) { + Inflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$3) { + if (status === Z_OK) { if (this.options.to === 'string') { this.result = this.chunks.join(''); } else { @@ -17631,13 +17640,13 @@ var serviceContext = (function (vue) { * * try { * output = pako.inflate(input); - * } catch (err) + * } catch (err) { * console.log(err); * } * ``` **/ function inflate$1(input, options) { - const inflator = new Inflate(options); + const inflator = new Inflate$1(options); inflator.push(input); @@ -17656,7 +17665,7 @@ var serviceContext = (function (vue) { * The same as [[inflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ - function inflateRaw(input, options) { + function inflateRaw$1(input, options) { options = options || {}; options.raw = true; return inflate$1(input, options); @@ -17673,59 +17682,59 @@ var serviceContext = (function (vue) { **/ - var Inflate_1 = Inflate; - var inflate_2$1 = inflate$1; - var inflateRaw_1 = inflateRaw; - var ungzip = inflate$1; - var constants$2 = constants; + var Inflate_1$1 = Inflate$1; + var inflate_2 = inflate$1; + var inflateRaw_1$1 = inflateRaw$1; + var ungzip$1 = inflate$1; + var constants = constants$2; var inflate_1$1 = { - Inflate: Inflate_1, - inflate: inflate_2$1, - inflateRaw: inflateRaw_1, - ungzip: ungzip, - constants: constants$2 + Inflate: Inflate_1$1, + inflate: inflate_2, + inflateRaw: inflateRaw_1$1, + ungzip: ungzip$1, + constants: constants }; - const { Deflate: Deflate$1, deflate: deflate$2, deflateRaw: deflateRaw$1, gzip: gzip$1 } = deflate_1$1; + const { Deflate, deflate, deflateRaw, gzip } = deflate_1$1; - const { Inflate: Inflate$1, inflate: inflate$2, inflateRaw: inflateRaw$1, ungzip: ungzip$1 } = inflate_1$1; + const { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1; - var Deflate_1$1 = Deflate$1; - var deflate_1$2 = deflate$2; - var deflateRaw_1$1 = deflateRaw$1; - var gzip_1$1 = gzip$1; - var Inflate_1$1 = Inflate$1; - var inflate_1$2 = inflate$2; - var inflateRaw_1$1 = inflateRaw$1; - var ungzip_1 = ungzip$1; - var constants_1 = constants; + var Deflate_1 = Deflate; + var deflate_1 = deflate; + var deflateRaw_1 = deflateRaw; + var gzip_1 = gzip; + var Inflate_1 = Inflate; + var inflate_1 = inflate; + var inflateRaw_1 = inflateRaw; + var ungzip_1 = ungzip; + var constants_1 = constants$2; var pako = { - Deflate: Deflate_1$1, - deflate: deflate_1$2, - deflateRaw: deflateRaw_1$1, - gzip: gzip_1$1, - Inflate: Inflate_1$1, - inflate: inflate_1$2, - inflateRaw: inflateRaw_1$1, + Deflate: Deflate_1, + deflate: deflate_1, + deflateRaw: deflateRaw_1, + gzip: gzip_1, + Inflate: Inflate_1, + inflate: inflate_1, + inflateRaw: inflateRaw_1, ungzip: ungzip_1, constants: constants_1 }; var pako_esm = /*#__PURE__*/Object.freeze({ __proto__: null, - 'default': pako, - Deflate: Deflate_1$1, - Inflate: Inflate_1$1, + Deflate: Deflate_1, + Inflate: Inflate_1, constants: constants_1, - deflate: deflate_1$2, - deflateRaw: deflateRaw_1$1, - gzip: gzip_1$1, - inflate: inflate_1$2, - inflateRaw: inflateRaw_1$1, + 'default': pako, + deflate: deflate_1, + deflateRaw: deflateRaw_1, + gzip: gzip_1, + inflate: inflate_1, + inflateRaw: inflateRaw_1, ungzip: ungzip_1 }); diff --git a/packages/uni-app-plus/dist/uni-app-view.umd.js b/packages/uni-app-plus/dist/uni-app-view.umd.js index 7449d9203..7166c2877 100644 --- a/packages/uni-app-plus/dist/uni-app-view.umd.js +++ b/packages/uni-app-plus/dist/uni-app-view.umd.js @@ -322,6 +322,7 @@ const PRIMARY_COLOR = "#007aff"; const SCHEME_RE = /^([a-z-]+:)?\/\//i; const DATA_RE = /^data:.*,.*/; + const JSON_PROTOCOL = "json://"; const ON_PAGE_SCROLL = "onPageScroll"; const ON_REACH_BOTTOM = "onReachBottom"; const isObject = (val) => val !== null && typeof val === "object"; @@ -6083,6 +6084,13 @@ postActionJobs.clear(); } } + const JSON_PROTOCOL_LEN = JSON_PROTOCOL.length; + function decodeAttr(value) { + if (isString(value) && value.indexOf(JSON_PROTOCOL) === 0) { + value = JSON.parse(value.substr(JSON_PROTOCOL_LEN)); + } + return value; + } class UniElement extends UniNode { constructor(id2, element, parentNodeId, refNodeId, nodeJson, propNames = []) { super(id2, element.tagName, parentNodeId, element); @@ -6108,7 +6116,7 @@ watch(this.$props, () => { queuePostActionJob(this._update); }, { flush: "sync" }); - this.update(); + this.update(true); } setAttrs(attrs2) { Object.keys(attrs2).forEach((name) => { @@ -6145,6 +6153,7 @@ } } setAttribute(name, value) { + value = decodeAttr(value); if (this.$propNames.indexOf(name) !== -1) { this.$props[name] = value; } else { @@ -6158,7 +6167,7 @@ this.$.removeAttribute(name); } } - update() { + update(isMounted = false) { } } class UniComment extends UniNode { @@ -14304,13 +14313,23 @@ }; fn.call(context); } - init(nodeJson) { - super.init(nodeJson); - const item = animation.watch.animation; - watch(() => this.$props.animation, () => { - this.call(item.handler); - }, { deep: item.deep }); - this.call(animation.mounted); + setAttribute(name, value) { + if (name === "animation") { + this.$animate = true; + } + return super.setAttribute(name, value); + } + update(isMounted = false) { + if (!this.$animate) { + return; + } + if (isMounted) { + return this.call(animation.mounted); + } + if (this.$animate) { + this.$animate = false; + this.call(animation.watch.animation.handler); + } } } const PROP_NAMES_HOVER$1 = ["space", "decode"]; @@ -14327,7 +14346,7 @@ this._text = text2; this.update(); } - update() { + update(isMounted = false) { const { $props: { space, decode } } = this; @@ -14335,6 +14354,7 @@ space, decode }).join("
"); + super.update(isMounted); } } class UniTextNode extends UniNode { @@ -14358,7 +14378,7 @@ ...propNames ]); } - update() { + update(isMounted = false) { const hoverClass = this.$props["hover-class"]; if (hoverClass && hoverClass !== "none") { if (!this._hover) { @@ -14370,6 +14390,7 @@ this._hover.removeEvent(); } } + super.update(isMounted); } } class Hover { @@ -14691,8 +14712,6 @@ }; } }); - const JSON_PREFIX = "$JSON$:"; - const JSON_PREFIX_LEN = JSON_PREFIX.length; class UniComponent extends UniNode { constructor(id2, tag, component, parentNodeId, refNodeId, nodeJson, selector) { super(id2, tag, parentNodeId); @@ -14741,10 +14760,7 @@ this.$props[name] = null; } setAttr(name, value) { - if (isString(value) && value.indexOf(JSON_PREFIX) === 0) { - value = JSON.parse(value.substr(JSON_PREFIX_LEN)); - } - this.$props[name] = value; + this.$props[name] = decodeAttr(value); } removeAttr(name) { this.$props[name] = null; diff --git a/packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts b/packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts index 0f4df51ab..3e33d6237 100644 --- a/packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts +++ b/packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts @@ -1,4 +1,4 @@ -import { hasOwn, isString } from '@vue/shared' +import { hasOwn } from '@vue/shared' import { App, Component, @@ -14,9 +14,8 @@ import { createInvoker } from '../modules/events' import { createWrapper, UniCustomElement } from '.' import { $, removeElement } from '../page' import { queuePostActionJob } from '../scheduler' +import { decodeAttr } from '../utils' -const JSON_PREFIX = '$JSON$:' -const JSON_PREFIX_LEN = JSON_PREFIX.length export class UniComponent extends UniNode { declare $: UniCustomElement protected $props!: Record @@ -82,10 +81,7 @@ export class UniComponent extends UniNode { this.$props[name] = null } setAttr(name: string, value: unknown) { - if (isString(value) && value.indexOf(JSON_PREFIX) === 0) { - value = JSON.parse(value.substr(JSON_PREFIX_LEN)) - } - this.$props[name] = value + this.$props[name] = decodeAttr(value) } removeAttr(name: string) { this.$props[name] = null diff --git a/packages/uni-app-plus/src/view/framework/dom/elements/UniAnimationElement.ts b/packages/uni-app-plus/src/view/framework/dom/elements/UniAnimationElement.ts index b7f6f9745..7cbc35f1f 100644 --- a/packages/uni-app-plus/src/view/framework/dom/elements/UniAnimationElement.ts +++ b/packages/uni-app-plus/src/view/framework/dom/elements/UniAnimationElement.ts @@ -1,4 +1,3 @@ -import { watch } from 'vue' import { UniNodeJSON } from '@dcloudio/uni-shared' import { animation } from '@dcloudio/uni-components' import { UniElement } from './UniElement' @@ -9,6 +8,7 @@ interface AnimationProps { export class UniAnimationElement extends UniElement< T & AnimationProps > { + private $animate?: boolean constructor( id: number, element: Element, @@ -29,16 +29,22 @@ export class UniAnimationElement extends UniElement< } fn.call(context) } - init(nodeJson: Partial) { - super.init(nodeJson) - const item = animation.watch.animation - watch( - () => this.$props.animation, - () => { - this.call(item.handler) - }, - { deep: item.deep } - ) - this.call(animation.mounted) + setAttribute(name: string, value: unknown) { + if (name === 'animation') { + this.$animate = true + } + return super.setAttribute(name, value) + } + update(isMounted: boolean = false) { + if (!this.$animate) { + return + } + if (isMounted) { + return this.call(animation.mounted) + } + if (this.$animate) { + this.$animate = false + this.call(animation.watch.animation.handler) + } } } diff --git a/packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts b/packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts index 3de5a4b0d..95847759c 100644 --- a/packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts +++ b/packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts @@ -7,6 +7,7 @@ import { patchStyle } from '../modules/style' import { patchEvent } from '../modules/events' import { UniCustomElement } from '../components' import { queuePostActionJob } from '../scheduler' +import { decodeAttr } from '../utils' export class UniElement extends UniNode { declare $: UniCustomElement @@ -47,7 +48,7 @@ export class UniElement extends UniNode { }, { flush: 'sync' } ) - this.update() + this.update(true) } setAttrs(attrs: Record) { Object.keys(attrs).forEach((name) => { @@ -84,6 +85,7 @@ export class UniElement extends UniNode { } } setAttribute(name: string, value: unknown) { + value = decodeAttr(value) if (this.$propNames.indexOf(name) !== -1) { ;(this.$props as any)[name] = value } else { @@ -97,5 +99,5 @@ export class UniElement extends UniNode { this.$.removeAttribute(name) } } - update() {} + update(isMounted: boolean = false) {} } diff --git a/packages/uni-app-plus/src/view/framework/dom/elements/UniHoverElement.ts b/packages/uni-app-plus/src/view/framework/dom/elements/UniHoverElement.ts index 3fe591506..c9c3766e5 100644 --- a/packages/uni-app-plus/src/view/framework/dom/elements/UniHoverElement.ts +++ b/packages/uni-app-plus/src/view/framework/dom/elements/UniHoverElement.ts @@ -28,7 +28,7 @@ export class UniHoverElement extends UniAnimationElement { ...propNames, ]) } - update() { + update(isMounted: boolean = false) { const hoverClass = this.$props['hover-class'] if (hoverClass && hoverClass !== 'none') { if (!this._hover) { @@ -40,6 +40,7 @@ export class UniHoverElement extends UniAnimationElement { this._hover.removeEvent() } } + super.update(isMounted) } } diff --git a/packages/uni-app-plus/src/view/framework/dom/elements/UniTextElement.ts b/packages/uni-app-plus/src/view/framework/dom/elements/UniTextElement.ts index db7d500b2..ee5c16a2b 100644 --- a/packages/uni-app-plus/src/view/framework/dom/elements/UniTextElement.ts +++ b/packages/uni-app-plus/src/view/framework/dom/elements/UniTextElement.ts @@ -39,7 +39,7 @@ export class UniTextElement extends UniAnimationElement { this.update() } - update() { + update(isMounted: boolean = false) { const { $props: { space, decode }, } = this @@ -47,5 +47,6 @@ export class UniTextElement extends UniAnimationElement { space, decode, }).join('
') + super.update(isMounted) } } diff --git a/packages/uni-app-plus/src/view/framework/dom/utils.ts b/packages/uni-app-plus/src/view/framework/dom/utils.ts new file mode 100644 index 000000000..4ad96567a --- /dev/null +++ b/packages/uni-app-plus/src/view/framework/dom/utils.ts @@ -0,0 +1,11 @@ +import { JSON_PROTOCOL } from '@dcloudio/uni-shared' +import { isString } from '@vue/shared' + +const JSON_PROTOCOL_LEN = JSON_PROTOCOL.length + +export function decodeAttr(value: unknown) { + if (isString(value) && value.indexOf(JSON_PROTOCOL) === 0) { + value = JSON.parse(value.substr(JSON_PROTOCOL_LEN)) + } + return value +} diff --git a/packages/uni-app-vue/dist/service.runtime.esm.js b/packages/uni-app-vue/dist/service.runtime.esm.js index a9014a24c..16ce37bca 100644 --- a/packages/uni-app-vue/dist/service.runtime.esm.js +++ b/packages/uni-app-vue/dist/service.runtime.esm.js @@ -386,7 +386,8 @@ export default function vueFactory(exports) { super(nodeType, nodeName, container); this.attributes = Object.create(null); this.style = null; - this._html = null; // this.style = proxyStyle(new UniCSSStyleDeclaration()) + this.vShow = null; + this._html = null; } get className() { @@ -562,6 +563,8 @@ export default function vueFactory(exports) { } } + + var JSON_PROTOCOL = 'json://'; /** * Make a map and return a function for checking if a key * is in that map. @@ -570,7 +573,6 @@ export default function vueFactory(exports) { * So that rollup can tree-shake them if necessary. */ - function makeMap(str, expectsLowerCase) { var map = Object.create(null); var list = str.split(','); @@ -11127,8 +11129,13 @@ export default function vueFactory(exports) { VIDEO: ['danmu-list', 'header'], 'WEB-VIEW': ['webview-styles'] }; + var forcePatchPropKeys = ['animation']; var forcePatchProp = (_, key) => { + if (forcePatchPropKeys.indexOf(key) > -1) { + return true; + } + var keys = forcePatchProps[_.nodeName]; if (keys && keys.indexOf(key) > -1) { @@ -11156,14 +11163,18 @@ export default function vueFactory(exports) { patchEvent(el, key, prevValue, nextValue); } } else { - if (isProxy(nextValue)) { - var equal = prevValue === nextValue; // 触发收集最新依赖 + // 非基本类型 + if (isObject(nextValue)) { + var equal = prevValue === nextValue; // 可触发收集响应式数据的最新依赖 - nextValue = '$JSON$:' + JSON.stringify(nextValue); + nextValue = JSON_PROTOCOL + JSON.stringify(nextValue); if (equal && el.getAttribute(key) === nextValue) { return; } + } else if (prevValue === nextValue) { + // 基本类型 + return; } patchAttr(el, key, nextValue); @@ -11844,7 +11855,6 @@ export default function vueFactory(exports) { beforeMount(el, { value }) { - el._vod = el.style.display === 'none' ? '' : el.style.display; setDisplay(el, value); }, @@ -11865,7 +11875,7 @@ export default function vueFactory(exports) { }; function setDisplay(el, value) { - el.style.display = value ? el._vod : 'none'; + el.setAttribute('.vShow', !!value); } var rendererOptions = extend({ diff --git a/packages/uni-app-vue/lib/service.runtime.esm.js b/packages/uni-app-vue/lib/service.runtime.esm.js index bc051f13b..0e4bbbebc 100644 --- a/packages/uni-app-vue/lib/service.runtime.esm.js +++ b/packages/uni-app-vue/lib/service.runtime.esm.js @@ -1,4 +1,4 @@ -import { UniInputElement, UniTextAreaElement, UniElement, UniTextNode, UniCommentNode } from '@dcloudio/uni-shared'; +import { UniInputElement, UniTextAreaElement, UniElement, UniTextNode, UniCommentNode, JSON_PROTOCOL } from '@dcloudio/uni-shared'; /** * Make a map and return a function for checking if a key @@ -9134,7 +9134,11 @@ const forcePatchProps = { VIDEO: ['danmu-list', 'header'], 'WEB-VIEW': ['webview-styles'] }; +const forcePatchPropKeys = ['animation']; const forcePatchProp = (_, key) => { + if (forcePatchPropKeys.indexOf(key) > -1) { + return true; + } const keys = forcePatchProps[_.nodeName]; if (keys && keys.indexOf(key) > -1) { return true; @@ -9158,14 +9162,19 @@ const patchProp = (el, key, prevValue, nextValue, parentComponent) => { } } else { - if (isProxy(nextValue)) { + // 非基本类型 + if (isObject(nextValue)) { const equal = prevValue === nextValue; - // 触发收集最新依赖 - nextValue = '$JSON$:' + JSON.stringify(nextValue); + // 可触发收集响应式数据的最新依赖 + nextValue = JSON_PROTOCOL + JSON.stringify(nextValue); if (equal && el.getAttribute(key) === nextValue) { return; } } + else if (prevValue === nextValue) { + // 基本类型 + return; + } patchAttr(el, key, nextValue); } break; @@ -9728,7 +9737,6 @@ const withKeys = (fn, modifiers) => { const vShow = { beforeMount(el, { value }) { - el._vod = (el.style.display === 'none' ? '' : el.style.display); setDisplay(el, value); }, updated(el, { value, oldValue }) { @@ -9741,7 +9749,7 @@ const vShow = { } }; function setDisplay(el, value) { - el.style.display = value ? el._vod : 'none'; + el.setAttribute('.vShow', !!value); } const rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps); diff --git a/packages/uni-shared/dist/uni-shared.cjs.js b/packages/uni-shared/dist/uni-shared.cjs.js index 98083b0b9..0080ebc94 100644 --- a/packages/uni-shared/dist/uni-shared.cjs.js +++ b/packages/uni-shared/dist/uni-shared.cjs.js @@ -577,8 +577,8 @@ class UniBaseNode extends UniNode { super(nodeType, nodeName, container); this.attributes = Object.create(null); this.style = null; + this.vShow = null; this._html = null; - // this.style = proxyStyle(new UniCSSStyleDeclaration()) } get className() { return (this.attributes[ATTR_CLASS] || ''); @@ -833,6 +833,7 @@ const UNI_SSR_GLOBAL_DATA = 'globalData'; const SCHEME_RE = /^([a-z-]+:)?\/\//i; const DATA_RE = /^data:.*,.*/; const WEB_INVOKE_APPSERVICE = 'WEB_INVOKE_APPSERVICE'; +const JSON_PROTOCOL = 'json://'; // lifecycle // App and Page const ON_SHOW = 'onShow'; @@ -958,6 +959,7 @@ exports.COMPONENT_SELECTOR_PREFIX = COMPONENT_SELECTOR_PREFIX; exports.DATA_RE = DATA_RE; exports.EventChannel = EventChannel; exports.EventModifierFlags = EventModifierFlags; +exports.JSON_PROTOCOL = JSON_PROTOCOL; exports.NAVBAR_HEIGHT = NAVBAR_HEIGHT; exports.NODE_TYPE_COMMENT = NODE_TYPE_COMMENT; exports.NODE_TYPE_ELEMENT = NODE_TYPE_ELEMENT; diff --git a/packages/uni-shared/dist/uni-shared.d.ts b/packages/uni-shared/dist/uni-shared.d.ts index da233a999..b5a529965 100644 --- a/packages/uni-shared/dist/uni-shared.d.ts +++ b/packages/uni-shared/dist/uni-shared.d.ts @@ -186,6 +186,8 @@ export declare interface IUniPageNode { onNodeValue: (thisNode: UniNode, val: string | null) => void; } +export declare const JSON_PROTOCOL = "json://"; + export declare const NAVBAR_HEIGHT = 44; declare type NavigateToOptionEvents = Record void>; @@ -410,6 +412,7 @@ export declare const UNI_SSR_TITLE = "title"; export declare class UniBaseNode extends UniNode { attributes: Record; style: null | string | Record; + vShow: null | boolean; protected _html: string | null; constructor(nodeType: UniNodeType, nodeName: string, container: UniElement | IUniPageNode); get className(): string; @@ -451,6 +454,7 @@ export declare class UniEvent { bubbles: boolean; cancelable: boolean; defaultPrevented: boolean; + detail?: Record; timeStamp: number; _stop: boolean; _end: boolean; diff --git a/packages/uni-shared/dist/uni-shared.es.js b/packages/uni-shared/dist/uni-shared.es.js index ebeba0b31..06545b4b6 100644 --- a/packages/uni-shared/dist/uni-shared.es.js +++ b/packages/uni-shared/dist/uni-shared.es.js @@ -573,8 +573,8 @@ class UniBaseNode extends UniNode { super(nodeType, nodeName, container); this.attributes = Object.create(null); this.style = null; + this.vShow = null; this._html = null; - // this.style = proxyStyle(new UniCSSStyleDeclaration()) } get className() { return (this.attributes[ATTR_CLASS] || ''); @@ -829,6 +829,7 @@ const UNI_SSR_GLOBAL_DATA = 'globalData'; const SCHEME_RE = /^([a-z-]+:)?\/\//i; const DATA_RE = /^data:.*,.*/; const WEB_INVOKE_APPSERVICE = 'WEB_INVOKE_APPSERVICE'; +const JSON_PROTOCOL = 'json://'; // lifecycle // App and Page const ON_SHOW = 'onShow'; @@ -933,4 +934,4 @@ function getEnvLocale() { return (lang && lang.replace(/[.:].*/, '')) || 'en'; } -export { ACTION_TYPE_ADD_EVENT, ACTION_TYPE_CREATE, ACTION_TYPE_EVENT, ACTION_TYPE_INSERT, ACTION_TYPE_PAGE_CREATE, ACTION_TYPE_PAGE_CREATED, ACTION_TYPE_REMOVE, ACTION_TYPE_REMOVE_ATTRIBUTE, ACTION_TYPE_REMOVE_EVENT, ACTION_TYPE_SET_ATTRIBUTE, ACTION_TYPE_SET_TEXT, ATTR_CLASS, ATTR_STYLE, BACKGROUND_COLOR, BUILT_IN_TAGS, COMPONENT_NAME_PREFIX, COMPONENT_PREFIX, COMPONENT_SELECTOR_PREFIX, DATA_RE, EventChannel, EventModifierFlags, NAVBAR_HEIGHT, NODE_TYPE_COMMENT, NODE_TYPE_ELEMENT, NODE_TYPE_PAGE, NODE_TYPE_TEXT, ON_ADD_TO_FAVORITES, ON_APP_ENTER_BACKGROUND, ON_APP_ENTER_FOREGROUND, ON_BACK_PRESS, ON_ERROR, ON_HIDE, ON_KEYBOARD_HEIGHT_CHANGE, ON_LAUNCH, ON_LOAD, ON_NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_PAGE_NOT_FOUND, ON_PAGE_SCROLL, ON_PULL_DOWN_REFRESH, ON_REACH_BOTTOM, ON_REACH_BOTTOM_DISTANCE, ON_READY, ON_RESIZE, ON_SHARE_APP_MESSAGE, ON_SHARE_TIMELINE, ON_SHOW, ON_TAB_ITEM_TAP, ON_THEME_CHANGE, ON_UNHANDLE_REJECTION, ON_UNLOAD, ON_WEB_INVOKE_APP_SERVICE, PLUS_RE, PRIMARY_COLOR, RESPONSIVE_MIN_WIDTH, SCHEME_RE, SELECTED_COLOR, TABBAR_HEIGHT, TAGS, UNI_SSR, UNI_SSR_DATA, UNI_SSR_GLOBAL_DATA, UNI_SSR_STORE, UNI_SSR_TITLE, UniBaseNode, UniCommentNode, UniElement, UniEvent, UniInputElement, UniNode, UniTextAreaElement, UniTextNode, WEB_INVOKE_APPSERVICE, addFont, cache, cacheStringFunction, callOptions, createRpx2Unit, createUniEvent, debounce, decode, decodedQuery, defaultRpx2Unit, formatDateTime, formatLog, getCustomDataset, getEnvLocale, getLen, initCustomDataset, invokeArrayFns, isBuiltInComponent, isCustomElement, isNativeTag, isServiceCustomElement, isServiceNativeTag, normalizeDataset, normalizeEventType, normalizeTarget, once, parseEventName, parseQuery, parseUrl, passive, plusReady, removeLeadingSlash, sanitise, scrollTo, stringifyQuery, updateElementStyle }; +export { ACTION_TYPE_ADD_EVENT, ACTION_TYPE_CREATE, ACTION_TYPE_EVENT, ACTION_TYPE_INSERT, ACTION_TYPE_PAGE_CREATE, ACTION_TYPE_PAGE_CREATED, ACTION_TYPE_REMOVE, ACTION_TYPE_REMOVE_ATTRIBUTE, ACTION_TYPE_REMOVE_EVENT, ACTION_TYPE_SET_ATTRIBUTE, ACTION_TYPE_SET_TEXT, ATTR_CLASS, ATTR_STYLE, BACKGROUND_COLOR, BUILT_IN_TAGS, COMPONENT_NAME_PREFIX, COMPONENT_PREFIX, COMPONENT_SELECTOR_PREFIX, DATA_RE, EventChannel, EventModifierFlags, JSON_PROTOCOL, NAVBAR_HEIGHT, NODE_TYPE_COMMENT, NODE_TYPE_ELEMENT, NODE_TYPE_PAGE, NODE_TYPE_TEXT, ON_ADD_TO_FAVORITES, ON_APP_ENTER_BACKGROUND, ON_APP_ENTER_FOREGROUND, ON_BACK_PRESS, ON_ERROR, ON_HIDE, ON_KEYBOARD_HEIGHT_CHANGE, ON_LAUNCH, ON_LOAD, ON_NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_PAGE_NOT_FOUND, ON_PAGE_SCROLL, ON_PULL_DOWN_REFRESH, ON_REACH_BOTTOM, ON_REACH_BOTTOM_DISTANCE, ON_READY, ON_RESIZE, ON_SHARE_APP_MESSAGE, ON_SHARE_TIMELINE, ON_SHOW, ON_TAB_ITEM_TAP, ON_THEME_CHANGE, ON_UNHANDLE_REJECTION, ON_UNLOAD, ON_WEB_INVOKE_APP_SERVICE, PLUS_RE, PRIMARY_COLOR, RESPONSIVE_MIN_WIDTH, SCHEME_RE, SELECTED_COLOR, TABBAR_HEIGHT, TAGS, UNI_SSR, UNI_SSR_DATA, UNI_SSR_GLOBAL_DATA, UNI_SSR_STORE, UNI_SSR_TITLE, UniBaseNode, UniCommentNode, UniElement, UniEvent, UniInputElement, UniNode, UniTextAreaElement, UniTextNode, WEB_INVOKE_APPSERVICE, addFont, cache, cacheStringFunction, callOptions, createRpx2Unit, createUniEvent, debounce, decode, decodedQuery, defaultRpx2Unit, formatDateTime, formatLog, getCustomDataset, getEnvLocale, getLen, initCustomDataset, invokeArrayFns, isBuiltInComponent, isCustomElement, isNativeTag, isServiceCustomElement, isServiceNativeTag, normalizeDataset, normalizeEventType, normalizeTarget, once, parseEventName, parseQuery, parseUrl, passive, plusReady, removeLeadingSlash, sanitise, scrollTo, stringifyQuery, updateElementStyle }; diff --git a/packages/uni-shared/src/constants.ts b/packages/uni-shared/src/constants.ts index 0c0da703e..6b5088117 100644 --- a/packages/uni-shared/src/constants.ts +++ b/packages/uni-shared/src/constants.ts @@ -20,6 +20,8 @@ export const DATA_RE = /^data:.*,.*/ export const WEB_INVOKE_APPSERVICE = 'WEB_INVOKE_APPSERVICE' +export const JSON_PROTOCOL = 'json://' + // lifecycle // App and Page diff --git a/packages/uni-shared/src/vdom/Event.ts b/packages/uni-shared/src/vdom/Event.ts index ab435b0ea..e6db26c17 100644 --- a/packages/uni-shared/src/vdom/Event.ts +++ b/packages/uni-shared/src/vdom/Event.ts @@ -35,6 +35,7 @@ export class UniEvent { bubbles: boolean cancelable: boolean defaultPrevented: boolean = false + detail?: Record timeStamp = Date.now() diff --git a/packages/uni-shared/src/vdom/Node.ts b/packages/uni-shared/src/vdom/Node.ts index 0f05e00f9..5c4373fb7 100644 --- a/packages/uni-shared/src/vdom/Node.ts +++ b/packages/uni-shared/src/vdom/Node.ts @@ -257,6 +257,7 @@ export const ATTR_STYLE = 'style' export class UniBaseNode extends UniNode { attributes: Record = Object.create(null) style: null | string | Record = null + vShow: null | boolean = null protected _html: string | null = null @@ -266,7 +267,6 @@ export class UniBaseNode extends UniNode { container: UniElement | IUniPageNode ) { super(nodeType, nodeName, container) - // this.style = proxyStyle(new UniCSSStyleDeclaration()) } get className() { -- GitLab