@symbo.ls/create 2.11.127 → 2.11.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bundle/index.js +132 -33
- package/package.json +2 -2
package/dist/cjs/bundle/index.js
CHANGED
|
@@ -3719,8 +3719,9 @@ var require_extend = __commonJS({
|
|
|
3719
3719
|
if (props6 && props6.ignoreChildExtend)
|
|
3720
3720
|
return;
|
|
3721
3721
|
childExtendStack = (0, import_utils26.getExtendStack)(parent.childExtend);
|
|
3722
|
-
if (parent.childExtendRecursive) {
|
|
3723
|
-
const
|
|
3722
|
+
if (parent.childExtendRecursive || props6 && props6.ignoreChildExtendRecursive) {
|
|
3723
|
+
const propsChildExtendRecursive = props6 && !props6.ignoreChildExtendRecursive;
|
|
3724
|
+
const canExtendRecursive = propsChildExtendRecursive && element.key !== "__text";
|
|
3724
3725
|
if (canExtendRecursive) {
|
|
3725
3726
|
const childExtendRecursiveStack = (0, import_utils26.getExtendStack)(parent.childExtendRecursive);
|
|
3726
3727
|
childExtendStack = childExtendStack.concat(childExtendRecursiveStack);
|
|
@@ -18117,13 +18118,118 @@ var decodePayload = (encodedPayload, binaryType) => {
|
|
|
18117
18118
|
}
|
|
18118
18119
|
return packets;
|
|
18119
18120
|
};
|
|
18121
|
+
function createPacketEncoderStream() {
|
|
18122
|
+
return new TransformStream({
|
|
18123
|
+
transform(packet, controller) {
|
|
18124
|
+
encodePacketToBinary(packet, (encodedPacket) => {
|
|
18125
|
+
const payloadLength = encodedPacket.length;
|
|
18126
|
+
let header;
|
|
18127
|
+
if (payloadLength < 126) {
|
|
18128
|
+
header = new Uint8Array(1);
|
|
18129
|
+
new DataView(header.buffer).setUint8(0, payloadLength);
|
|
18130
|
+
} else if (payloadLength < 65536) {
|
|
18131
|
+
header = new Uint8Array(3);
|
|
18132
|
+
const view = new DataView(header.buffer);
|
|
18133
|
+
view.setUint8(0, 126);
|
|
18134
|
+
view.setUint16(1, payloadLength);
|
|
18135
|
+
} else {
|
|
18136
|
+
header = new Uint8Array(9);
|
|
18137
|
+
const view = new DataView(header.buffer);
|
|
18138
|
+
view.setUint8(0, 127);
|
|
18139
|
+
view.setBigUint64(1, BigInt(payloadLength));
|
|
18140
|
+
}
|
|
18141
|
+
if (packet.data && typeof packet.data !== "string") {
|
|
18142
|
+
header[0] |= 128;
|
|
18143
|
+
}
|
|
18144
|
+
controller.enqueue(header);
|
|
18145
|
+
controller.enqueue(encodedPacket);
|
|
18146
|
+
});
|
|
18147
|
+
}
|
|
18148
|
+
});
|
|
18149
|
+
}
|
|
18120
18150
|
var TEXT_DECODER;
|
|
18121
|
-
function
|
|
18151
|
+
function totalLength(chunks) {
|
|
18152
|
+
return chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
18153
|
+
}
|
|
18154
|
+
function concatChunks(chunks, size) {
|
|
18155
|
+
if (chunks[0].length === size) {
|
|
18156
|
+
return chunks.shift();
|
|
18157
|
+
}
|
|
18158
|
+
const buffer = new Uint8Array(size);
|
|
18159
|
+
let j = 0;
|
|
18160
|
+
for (let i2 = 0; i2 < size; i2++) {
|
|
18161
|
+
buffer[i2] = chunks[0][j++];
|
|
18162
|
+
if (j === chunks[0].length) {
|
|
18163
|
+
chunks.shift();
|
|
18164
|
+
j = 0;
|
|
18165
|
+
}
|
|
18166
|
+
}
|
|
18167
|
+
if (chunks.length && j < chunks[0].length) {
|
|
18168
|
+
chunks[0] = chunks[0].slice(j);
|
|
18169
|
+
}
|
|
18170
|
+
return buffer;
|
|
18171
|
+
}
|
|
18172
|
+
function createPacketDecoderStream(maxPayload, binaryType) {
|
|
18122
18173
|
if (!TEXT_DECODER) {
|
|
18123
18174
|
TEXT_DECODER = new TextDecoder();
|
|
18124
18175
|
}
|
|
18125
|
-
const
|
|
18126
|
-
|
|
18176
|
+
const chunks = [];
|
|
18177
|
+
let state = 0;
|
|
18178
|
+
let expectedLength = -1;
|
|
18179
|
+
let isBinary2 = false;
|
|
18180
|
+
return new TransformStream({
|
|
18181
|
+
transform(chunk, controller) {
|
|
18182
|
+
chunks.push(chunk);
|
|
18183
|
+
while (true) {
|
|
18184
|
+
if (state === 0) {
|
|
18185
|
+
if (totalLength(chunks) < 1) {
|
|
18186
|
+
break;
|
|
18187
|
+
}
|
|
18188
|
+
const header = concatChunks(chunks, 1);
|
|
18189
|
+
isBinary2 = (header[0] & 128) === 128;
|
|
18190
|
+
expectedLength = header[0] & 127;
|
|
18191
|
+
if (expectedLength < 126) {
|
|
18192
|
+
state = 3;
|
|
18193
|
+
} else if (expectedLength === 126) {
|
|
18194
|
+
state = 1;
|
|
18195
|
+
} else {
|
|
18196
|
+
state = 2;
|
|
18197
|
+
}
|
|
18198
|
+
} else if (state === 1) {
|
|
18199
|
+
if (totalLength(chunks) < 2) {
|
|
18200
|
+
break;
|
|
18201
|
+
}
|
|
18202
|
+
const headerArray = concatChunks(chunks, 2);
|
|
18203
|
+
expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);
|
|
18204
|
+
state = 3;
|
|
18205
|
+
} else if (state === 2) {
|
|
18206
|
+
if (totalLength(chunks) < 8) {
|
|
18207
|
+
break;
|
|
18208
|
+
}
|
|
18209
|
+
const headerArray = concatChunks(chunks, 8);
|
|
18210
|
+
const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length);
|
|
18211
|
+
const n = view.getUint32(0);
|
|
18212
|
+
if (n > Math.pow(2, 53 - 32) - 1) {
|
|
18213
|
+
controller.enqueue(ERROR_PACKET);
|
|
18214
|
+
break;
|
|
18215
|
+
}
|
|
18216
|
+
expectedLength = n * Math.pow(2, 32) + view.getUint32(4);
|
|
18217
|
+
state = 3;
|
|
18218
|
+
} else {
|
|
18219
|
+
if (totalLength(chunks) < expectedLength) {
|
|
18220
|
+
break;
|
|
18221
|
+
}
|
|
18222
|
+
const data = concatChunks(chunks, expectedLength);
|
|
18223
|
+
controller.enqueue(decodePacket(isBinary2 ? data : TEXT_DECODER.decode(data), binaryType));
|
|
18224
|
+
state = 0;
|
|
18225
|
+
}
|
|
18226
|
+
if (expectedLength === 0 || expectedLength > maxPayload) {
|
|
18227
|
+
controller.enqueue(ERROR_PACKET);
|
|
18228
|
+
break;
|
|
18229
|
+
}
|
|
18230
|
+
}
|
|
18231
|
+
}
|
|
18232
|
+
});
|
|
18127
18233
|
}
|
|
18128
18234
|
var protocol = 4;
|
|
18129
18235
|
|
|
@@ -18855,7 +18961,7 @@ var WS = class extends Transport {
|
|
|
18855
18961
|
} catch (err) {
|
|
18856
18962
|
return this.emitReserved("error", err);
|
|
18857
18963
|
}
|
|
18858
|
-
this.ws.binaryType = this.socket.binaryType
|
|
18964
|
+
this.ws.binaryType = this.socket.binaryType;
|
|
18859
18965
|
this.addEventListeners();
|
|
18860
18966
|
}
|
|
18861
18967
|
/**
|
|
@@ -18949,9 +19055,6 @@ var WS = class extends Transport {
|
|
|
18949
19055
|
};
|
|
18950
19056
|
|
|
18951
19057
|
// ../../node_modules/engine.io-client/build/esm/transports/webtransport.js
|
|
18952
|
-
function shouldIncludeBinaryHeader(packet, encoded) {
|
|
18953
|
-
return packet.type === "message" && typeof packet.data !== "string" && encoded[0] >= 48 && encoded[0] <= 54;
|
|
18954
|
-
}
|
|
18955
19058
|
var WT = class extends Transport {
|
|
18956
19059
|
get name() {
|
|
18957
19060
|
return "webtransport";
|
|
@@ -18968,27 +19071,27 @@ var WT = class extends Transport {
|
|
|
18968
19071
|
});
|
|
18969
19072
|
this.transport.ready.then(() => {
|
|
18970
19073
|
this.transport.createBidirectionalStream().then((stream) => {
|
|
18971
|
-
const
|
|
18972
|
-
|
|
18973
|
-
|
|
19074
|
+
const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);
|
|
19075
|
+
const reader = stream.readable.pipeThrough(decoderStream).getReader();
|
|
19076
|
+
const encoderStream = createPacketEncoderStream();
|
|
19077
|
+
encoderStream.readable.pipeTo(stream.writable);
|
|
19078
|
+
this.writer = encoderStream.writable.getWriter();
|
|
18974
19079
|
const read = () => {
|
|
18975
19080
|
reader.read().then(({ done, value: value2 }) => {
|
|
18976
19081
|
if (done) {
|
|
18977
19082
|
return;
|
|
18978
19083
|
}
|
|
18979
|
-
|
|
18980
|
-
binaryFlag = true;
|
|
18981
|
-
} else {
|
|
18982
|
-
this.onPacket(decodePacketFromBinary(value2, binaryFlag, "arraybuffer"));
|
|
18983
|
-
binaryFlag = false;
|
|
18984
|
-
}
|
|
19084
|
+
this.onPacket(value2);
|
|
18985
19085
|
read();
|
|
18986
19086
|
}).catch((err) => {
|
|
18987
19087
|
});
|
|
18988
19088
|
};
|
|
18989
19089
|
read();
|
|
18990
|
-
const
|
|
18991
|
-
|
|
19090
|
+
const packet = { type: "open" };
|
|
19091
|
+
if (this.query.sid) {
|
|
19092
|
+
packet.data = `{"sid":"${this.query.sid}"}`;
|
|
19093
|
+
}
|
|
19094
|
+
this.writer.write(packet).then(() => this.onOpen());
|
|
18992
19095
|
});
|
|
18993
19096
|
});
|
|
18994
19097
|
}
|
|
@@ -18997,18 +19100,13 @@ var WT = class extends Transport {
|
|
|
18997
19100
|
for (let i2 = 0; i2 < packets.length; i2++) {
|
|
18998
19101
|
const packet = packets[i2];
|
|
18999
19102
|
const lastPacket = i2 === packets.length - 1;
|
|
19000
|
-
|
|
19001
|
-
if (
|
|
19002
|
-
|
|
19003
|
-
|
|
19004
|
-
|
|
19005
|
-
|
|
19006
|
-
|
|
19007
|
-
this.writable = true;
|
|
19008
|
-
this.emitReserved("drain");
|
|
19009
|
-
}, this.setTimeoutFn);
|
|
19010
|
-
}
|
|
19011
|
-
});
|
|
19103
|
+
this.writer.write(packet).then(() => {
|
|
19104
|
+
if (lastPacket) {
|
|
19105
|
+
nextTick(() => {
|
|
19106
|
+
this.writable = true;
|
|
19107
|
+
this.emitReserved("drain");
|
|
19108
|
+
}, this.setTimeoutFn);
|
|
19109
|
+
}
|
|
19012
19110
|
});
|
|
19013
19111
|
}
|
|
19014
19112
|
}
|
|
@@ -19092,6 +19190,7 @@ var Socket = class extends Emitter {
|
|
|
19092
19190
|
*/
|
|
19093
19191
|
constructor(uri, opts = {}) {
|
|
19094
19192
|
super();
|
|
19193
|
+
this.binaryType = defaultBinaryType;
|
|
19095
19194
|
this.writeBuffer = [];
|
|
19096
19195
|
if (uri && "object" === typeof uri) {
|
|
19097
19196
|
opts = uri;
|
|
@@ -19345,12 +19444,12 @@ var Socket = class extends Emitter {
|
|
|
19345
19444
|
if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
|
|
19346
19445
|
this.emitReserved("packet", packet);
|
|
19347
19446
|
this.emitReserved("heartbeat");
|
|
19447
|
+
this.resetPingTimeout();
|
|
19348
19448
|
switch (packet.type) {
|
|
19349
19449
|
case "open":
|
|
19350
19450
|
this.onHandshake(JSON.parse(packet.data));
|
|
19351
19451
|
break;
|
|
19352
19452
|
case "ping":
|
|
19353
|
-
this.resetPingTimeout();
|
|
19354
19453
|
this.sendPacket("pong");
|
|
19355
19454
|
this.emitReserved("ping");
|
|
19356
19455
|
this.emitReserved("pong");
|
package/package.json
CHANGED