@ni/nimble-components 34.10.1 → 34.10.3
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/all-components-bundle.js +168 -72
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +6689 -6675
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/checkbox/index.d.ts +2 -2
- package/dist/esm/combobox/index.d.ts +3 -3
- package/dist/esm/label-provider/base/index.js.map +1 -1
- package/dist/esm/number-field/index.d.ts +3 -3
- package/dist/esm/patterns/error/types.d.ts +2 -2
- package/dist/esm/patterns/required-visible/types.d.ts +1 -1
- package/dist/esm/radio-group/index.d.ts +3 -3
- package/dist/esm/rich-text/editor/index.d.ts +2 -2
- package/dist/esm/select/index.d.ts +3 -3
- package/dist/esm/select/index.js.map +1 -1
- package/dist/esm/table-column/anchor/index.d.ts +9 -9
- package/dist/esm/table-column/date-text/index.d.ts +7 -7
- package/dist/esm/table-column/duration-text/index.d.ts +7 -7
- package/dist/esm/table-column/mapping/index.d.ts +6 -6
- package/dist/esm/table-column/menu-button/index.d.ts +4 -4
- package/dist/esm/table-column/mixins/custom-sort-order.d.ts +2 -2
- package/dist/esm/table-column/mixins/fractional-width-column.d.ts +2 -2
- package/dist/esm/table-column/mixins/groupable-column.d.ts +1 -1
- package/dist/esm/table-column/mixins/placeholder.d.ts +1 -1
- package/dist/esm/table-column/mixins/sortable-column.d.ts +1 -1
- package/dist/esm/table-column/number-text/index.d.ts +7 -7
- package/dist/esm/table-column/text/index.d.ts +9 -9
- package/dist/esm/table-column/text-base/index.d.ts +5 -5
- package/dist/esm/text-area/index.d.ts +3 -3
- package/dist/esm/text-field/index.d.ts +3 -3
- package/dist/esm/wafer-map/workers/matrix-renderer.d.ts +5 -5
- package/dist/esm/wafer-map/workers/matrix-renderer.js.map +1 -1
- package/package.json +10 -30
|
@@ -46335,9 +46335,15 @@ ${renderedContent}
|
|
|
46335
46335
|
return attrs;
|
|
46336
46336
|
}
|
|
46337
46337
|
const filtered = {};
|
|
46338
|
-
allowedAttributes.forEach((
|
|
46339
|
-
|
|
46340
|
-
|
|
46338
|
+
allowedAttributes.forEach((attr) => {
|
|
46339
|
+
const attrName = typeof attr === "string" ? attr : attr.name;
|
|
46340
|
+
const skipIfDefault = typeof attr === "string" ? void 0 : attr.skipIfDefault;
|
|
46341
|
+
if (attrName in attrs) {
|
|
46342
|
+
const value = attrs[attrName];
|
|
46343
|
+
if (skipIfDefault !== void 0 && value === skipIfDefault) {
|
|
46344
|
+
return;
|
|
46345
|
+
}
|
|
46346
|
+
filtered[attrName] = value;
|
|
46341
46347
|
}
|
|
46342
46348
|
});
|
|
46343
46349
|
return filtered;
|
|
@@ -59347,32 +59353,36 @@ ${renderedContent}
|
|
|
59347
59353
|
if (!view.editable) {
|
|
59348
59354
|
return false;
|
|
59349
59355
|
}
|
|
59350
|
-
let
|
|
59351
|
-
if (event.target instanceof HTMLAnchorElement) {
|
|
59352
|
-
link = event.target;
|
|
59353
|
-
} else {
|
|
59354
|
-
let a = event.target;
|
|
59355
|
-
const els = [];
|
|
59356
|
-
while (a.nodeName !== "DIV") {
|
|
59357
|
-
els.push(a);
|
|
59358
|
-
a = a.parentNode;
|
|
59359
|
-
}
|
|
59360
|
-
link = els.find((value) => value.nodeName === "A");
|
|
59361
|
-
}
|
|
59362
|
-
if (!link) {
|
|
59363
|
-
return false;
|
|
59364
|
-
}
|
|
59365
|
-
const attrs = getAttributes(view.state, options.type.name);
|
|
59366
|
-
const href = (_a = link == null ? void 0 : link.href) != null ? _a : attrs.href;
|
|
59367
|
-
const target = (_b = link == null ? void 0 : link.target) != null ? _b : attrs.target;
|
|
59356
|
+
let handled = false;
|
|
59368
59357
|
if (options.enableClickSelection) {
|
|
59369
|
-
options.editor.commands.extendMarkRange(options.type.name);
|
|
59358
|
+
const commandResult = options.editor.commands.extendMarkRange(options.type.name);
|
|
59359
|
+
handled = commandResult;
|
|
59370
59360
|
}
|
|
59371
|
-
if (
|
|
59372
|
-
|
|
59373
|
-
|
|
59361
|
+
if (options.openOnClick) {
|
|
59362
|
+
let link = null;
|
|
59363
|
+
if (event.target instanceof HTMLAnchorElement) {
|
|
59364
|
+
link = event.target;
|
|
59365
|
+
} else {
|
|
59366
|
+
let a = event.target;
|
|
59367
|
+
const els = [];
|
|
59368
|
+
while (a.nodeName !== "DIV") {
|
|
59369
|
+
els.push(a);
|
|
59370
|
+
a = a.parentNode;
|
|
59371
|
+
}
|
|
59372
|
+
link = els.find((value) => value.nodeName === "A");
|
|
59373
|
+
}
|
|
59374
|
+
if (!link) {
|
|
59375
|
+
return handled;
|
|
59376
|
+
}
|
|
59377
|
+
const attrs = getAttributes(view.state, options.type.name);
|
|
59378
|
+
const href = (_a = link == null ? void 0 : link.href) != null ? _a : attrs.href;
|
|
59379
|
+
const target = (_b = link == null ? void 0 : link.target) != null ? _b : attrs.target;
|
|
59380
|
+
if (link && href) {
|
|
59381
|
+
window.open(href, target);
|
|
59382
|
+
handled = true;
|
|
59383
|
+
}
|
|
59374
59384
|
}
|
|
59375
|
-
return
|
|
59385
|
+
return handled;
|
|
59376
59386
|
}
|
|
59377
59387
|
}
|
|
59378
59388
|
});
|
|
@@ -59613,15 +59623,14 @@ ${renderedContent}
|
|
|
59613
59623
|
})
|
|
59614
59624
|
);
|
|
59615
59625
|
}
|
|
59616
|
-
|
|
59617
|
-
|
|
59618
|
-
|
|
59619
|
-
|
|
59620
|
-
|
|
59621
|
-
|
|
59622
|
-
|
|
59623
|
-
|
|
59624
|
-
}
|
|
59626
|
+
plugins.push(
|
|
59627
|
+
clickHandler({
|
|
59628
|
+
type: this.type,
|
|
59629
|
+
editor: this.editor,
|
|
59630
|
+
openOnClick: this.options.openOnClick === "whenNotEditable" ? true : this.options.openOnClick,
|
|
59631
|
+
enableClickSelection: this.options.enableClickSelection
|
|
59632
|
+
})
|
|
59633
|
+
);
|
|
59625
59634
|
if (this.options.linkOnPaste) {
|
|
59626
59635
|
plugins.push(
|
|
59627
59636
|
pasteHandler({
|
|
@@ -61142,7 +61151,25 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
61142
61151
|
nodeName: "mention",
|
|
61143
61152
|
name: "@",
|
|
61144
61153
|
selfClosing: true,
|
|
61145
|
-
allowedAttributes: ["id", "label"]
|
|
61154
|
+
allowedAttributes: ["id", "label", { name: "mentionSuggestionChar", skipIfDefault: "@" }],
|
|
61155
|
+
parseAttributes: (attrString) => {
|
|
61156
|
+
const attrs = {};
|
|
61157
|
+
const regex = /(\w+)=(?:"([^"]*)"|'([^']*)')/g;
|
|
61158
|
+
let match = regex.exec(attrString);
|
|
61159
|
+
while (match !== null) {
|
|
61160
|
+
const [, key, doubleQuoted, singleQuoted] = match;
|
|
61161
|
+
const value = doubleQuoted != null ? doubleQuoted : singleQuoted;
|
|
61162
|
+
attrs[key === "char" ? "mentionSuggestionChar" : key] = value;
|
|
61163
|
+
match = regex.exec(attrString);
|
|
61164
|
+
}
|
|
61165
|
+
return attrs;
|
|
61166
|
+
},
|
|
61167
|
+
serializeAttributes: (attrs) => {
|
|
61168
|
+
return Object.entries(attrs).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => {
|
|
61169
|
+
const serializedKey = key === "mentionSuggestionChar" ? "char" : key;
|
|
61170
|
+
return `${serializedKey}="${value}"`;
|
|
61171
|
+
}).join(" ");
|
|
61172
|
+
}
|
|
61146
61173
|
}),
|
|
61147
61174
|
renderText({ node }) {
|
|
61148
61175
|
const args = {
|
|
@@ -70800,8 +70827,9 @@ focus outline in that case.
|
|
|
70800
70827
|
function memo(getDeps, fn, opts) {
|
|
70801
70828
|
let deps = opts.initialDeps ?? [];
|
|
70802
70829
|
let result;
|
|
70830
|
+
let isInitial = true;
|
|
70803
70831
|
function memoizedFunction() {
|
|
70804
|
-
var _a, _b, _c
|
|
70832
|
+
var _a, _b, _c;
|
|
70805
70833
|
let depTime;
|
|
70806
70834
|
if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();
|
|
70807
70835
|
const newDeps = getDeps();
|
|
@@ -70836,7 +70864,10 @@ focus outline in that case.
|
|
|
70836
70864
|
opts == null ? void 0 : opts.key
|
|
70837
70865
|
);
|
|
70838
70866
|
}
|
|
70839
|
-
(
|
|
70867
|
+
if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {
|
|
70868
|
+
opts.onChange(result);
|
|
70869
|
+
}
|
|
70870
|
+
isInitial = false;
|
|
70840
70871
|
return result;
|
|
70841
70872
|
}
|
|
70842
70873
|
memoizedFunction.updateDeps = (newDeps) => {
|
|
@@ -70984,7 +71015,11 @@ focus outline in that case.
|
|
|
70984
71015
|
this.isScrolling = false;
|
|
70985
71016
|
this.measurementsCache = [];
|
|
70986
71017
|
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
71018
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
70987
71019
|
this.pendingMeasuredCacheIndexes = [];
|
|
71020
|
+
this.prevLanes = void 0;
|
|
71021
|
+
this.lanesChangedFlag = false;
|
|
71022
|
+
this.lanesSettling = false;
|
|
70988
71023
|
this.scrollRect = null;
|
|
70989
71024
|
this.scrollOffset = null;
|
|
70990
71025
|
this.scrollDirection = null;
|
|
@@ -71183,47 +71218,99 @@ focus outline in that case.
|
|
|
71183
71218
|
this.options.paddingStart,
|
|
71184
71219
|
this.options.scrollMargin,
|
|
71185
71220
|
this.options.getItemKey,
|
|
71186
|
-
this.options.enabled
|
|
71221
|
+
this.options.enabled,
|
|
71222
|
+
this.options.lanes
|
|
71187
71223
|
],
|
|
71188
|
-
(count, paddingStart, scrollMargin, getItemKey, enabled) => {
|
|
71224
|
+
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes) => {
|
|
71225
|
+
const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes;
|
|
71226
|
+
if (lanesChanged) {
|
|
71227
|
+
this.lanesChangedFlag = true;
|
|
71228
|
+
}
|
|
71229
|
+
this.prevLanes = lanes;
|
|
71189
71230
|
this.pendingMeasuredCacheIndexes = [];
|
|
71190
71231
|
return {
|
|
71191
71232
|
count,
|
|
71192
71233
|
paddingStart,
|
|
71193
71234
|
scrollMargin,
|
|
71194
71235
|
getItemKey,
|
|
71195
|
-
enabled
|
|
71236
|
+
enabled,
|
|
71237
|
+
lanes
|
|
71196
71238
|
};
|
|
71197
71239
|
},
|
|
71198
71240
|
{
|
|
71199
|
-
key: false
|
|
71241
|
+
key: false,
|
|
71242
|
+
skipInitialOnChange: true,
|
|
71243
|
+
onChange: () => {
|
|
71244
|
+
this.notify(this.isScrolling);
|
|
71245
|
+
}
|
|
71200
71246
|
}
|
|
71201
71247
|
);
|
|
71202
71248
|
this.getMeasurements = memo(
|
|
71203
71249
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
71204
|
-
({ count, paddingStart, scrollMargin, getItemKey, enabled }, itemSizeCache) => {
|
|
71250
|
+
({ count, paddingStart, scrollMargin, getItemKey, enabled, lanes }, itemSizeCache) => {
|
|
71205
71251
|
if (!enabled) {
|
|
71206
71252
|
this.measurementsCache = [];
|
|
71207
71253
|
this.itemSizeCache.clear();
|
|
71254
|
+
this.laneAssignments.clear();
|
|
71208
71255
|
return [];
|
|
71209
71256
|
}
|
|
71257
|
+
if (this.laneAssignments.size > count) {
|
|
71258
|
+
for (const index of this.laneAssignments.keys()) {
|
|
71259
|
+
if (index >= count) {
|
|
71260
|
+
this.laneAssignments.delete(index);
|
|
71261
|
+
}
|
|
71262
|
+
}
|
|
71263
|
+
}
|
|
71264
|
+
if (this.lanesChangedFlag) {
|
|
71265
|
+
this.lanesChangedFlag = false;
|
|
71266
|
+
this.lanesSettling = true;
|
|
71267
|
+
this.measurementsCache = [];
|
|
71268
|
+
this.itemSizeCache.clear();
|
|
71269
|
+
this.laneAssignments.clear();
|
|
71270
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
71271
|
+
}
|
|
71210
71272
|
if (this.measurementsCache.length === 0) {
|
|
71211
71273
|
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
71212
71274
|
this.measurementsCache.forEach((item) => {
|
|
71213
71275
|
this.itemSizeCache.set(item.key, item.size);
|
|
71214
71276
|
});
|
|
71215
71277
|
}
|
|
71216
|
-
const min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
71278
|
+
const min = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
71217
71279
|
this.pendingMeasuredCacheIndexes = [];
|
|
71280
|
+
if (this.lanesSettling && this.measurementsCache.length === count) {
|
|
71281
|
+
this.lanesSettling = false;
|
|
71282
|
+
}
|
|
71218
71283
|
const measurements = this.measurementsCache.slice(0, min);
|
|
71284
|
+
const laneLastIndex = new Array(lanes).fill(
|
|
71285
|
+
void 0
|
|
71286
|
+
);
|
|
71287
|
+
for (let m = 0; m < min; m++) {
|
|
71288
|
+
const item = measurements[m];
|
|
71289
|
+
if (item) {
|
|
71290
|
+
laneLastIndex[item.lane] = m;
|
|
71291
|
+
}
|
|
71292
|
+
}
|
|
71219
71293
|
for (let i = min; i < count; i++) {
|
|
71220
71294
|
const key = getItemKey(i);
|
|
71221
|
-
const
|
|
71222
|
-
|
|
71295
|
+
const cachedLane = this.laneAssignments.get(i);
|
|
71296
|
+
let lane;
|
|
71297
|
+
let start;
|
|
71298
|
+
if (cachedLane !== void 0 && this.options.lanes > 1) {
|
|
71299
|
+
lane = cachedLane;
|
|
71300
|
+
const prevIndex = laneLastIndex[lane];
|
|
71301
|
+
const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;
|
|
71302
|
+
start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin;
|
|
71303
|
+
} else {
|
|
71304
|
+
const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
|
|
71305
|
+
start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
|
|
71306
|
+
lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
|
|
71307
|
+
if (this.options.lanes > 1) {
|
|
71308
|
+
this.laneAssignments.set(i, lane);
|
|
71309
|
+
}
|
|
71310
|
+
}
|
|
71223
71311
|
const measuredSize = itemSizeCache.get(key);
|
|
71224
71312
|
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
|
|
71225
71313
|
const end = start + size;
|
|
71226
|
-
const lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
|
|
71227
71314
|
measurements[i] = {
|
|
71228
71315
|
index: i,
|
|
71229
71316
|
start,
|
|
@@ -71232,6 +71319,7 @@ focus outline in that case.
|
|
|
71232
71319
|
key,
|
|
71233
71320
|
lane
|
|
71234
71321
|
};
|
|
71322
|
+
laneLastIndex[lane] = i;
|
|
71235
71323
|
}
|
|
71236
71324
|
this.measurementsCache = measurements;
|
|
71237
71325
|
return measurements;
|
|
@@ -71525,6 +71613,7 @@ focus outline in that case.
|
|
|
71525
71613
|
};
|
|
71526
71614
|
this.measure = () => {
|
|
71527
71615
|
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
71616
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
71528
71617
|
this.notify(false);
|
|
71529
71618
|
};
|
|
71530
71619
|
this.setOptions(opts);
|
|
@@ -83117,28 +83206,33 @@ focus outline in that case.
|
|
|
83117
83206
|
return this.bytes_.length;
|
|
83118
83207
|
}
|
|
83119
83208
|
readInt8(offset) {
|
|
83120
|
-
return this.readUint8(offset) << 24 >> 24;
|
|
83209
|
+
return (this.readUint8(offset) << 24) >> 24;
|
|
83121
83210
|
}
|
|
83122
83211
|
readUint8(offset) {
|
|
83123
83212
|
return this.bytes_[offset];
|
|
83124
83213
|
}
|
|
83125
83214
|
readInt16(offset) {
|
|
83126
|
-
return this.readUint16(offset) << 16 >> 16;
|
|
83215
|
+
return (this.readUint16(offset) << 16) >> 16;
|
|
83127
83216
|
}
|
|
83128
83217
|
readUint16(offset) {
|
|
83129
|
-
return this.bytes_[offset] | this.bytes_[offset + 1] << 8;
|
|
83218
|
+
return this.bytes_[offset] | (this.bytes_[offset + 1] << 8);
|
|
83130
83219
|
}
|
|
83131
83220
|
readInt32(offset) {
|
|
83132
|
-
return this.bytes_[offset] |
|
|
83221
|
+
return (this.bytes_[offset] |
|
|
83222
|
+
(this.bytes_[offset + 1] << 8) |
|
|
83223
|
+
(this.bytes_[offset + 2] << 16) |
|
|
83224
|
+
(this.bytes_[offset + 3] << 24));
|
|
83133
83225
|
}
|
|
83134
83226
|
readUint32(offset) {
|
|
83135
83227
|
return this.readInt32(offset) >>> 0;
|
|
83136
83228
|
}
|
|
83137
83229
|
readInt64(offset) {
|
|
83138
|
-
return BigInt.asIntN(64, BigInt(this.readUint32(offset)) +
|
|
83230
|
+
return BigInt.asIntN(64, BigInt(this.readUint32(offset)) +
|
|
83231
|
+
(BigInt(this.readUint32(offset + 4)) << BigInt(32)));
|
|
83139
83232
|
}
|
|
83140
83233
|
readUint64(offset) {
|
|
83141
|
-
return BigInt.asUintN(64, BigInt(this.readUint32(offset)) +
|
|
83234
|
+
return BigInt.asUintN(64, BigInt(this.readUint32(offset)) +
|
|
83235
|
+
(BigInt(this.readUint32(offset + 4)) << BigInt(32)));
|
|
83142
83236
|
}
|
|
83143
83237
|
readFloat32(offset) {
|
|
83144
83238
|
int32[0] = this.readInt32(offset);
|
|
@@ -83198,11 +83292,11 @@ focus outline in that case.
|
|
|
83198
83292
|
* start of a the root vtable).
|
|
83199
83293
|
*/
|
|
83200
83294
|
getBufferIdentifier() {
|
|
83201
|
-
if (this.bytes_.length <
|
|
83202
|
-
FILE_IDENTIFIER_LENGTH) {
|
|
83295
|
+
if (this.bytes_.length <
|
|
83296
|
+
this.position_ + SIZEOF_INT + FILE_IDENTIFIER_LENGTH) {
|
|
83203
83297
|
throw new Error('FlatBuffers: ByteBuffer is too short to contain an identifier.');
|
|
83204
83298
|
}
|
|
83205
|
-
let result =
|
|
83299
|
+
let result = '';
|
|
83206
83300
|
for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {
|
|
83207
83301
|
result += String.fromCharCode(this.readInt8(this.position_ + SIZEOF_INT + i));
|
|
83208
83302
|
}
|
|
@@ -83214,7 +83308,9 @@ focus outline in that case.
|
|
|
83214
83308
|
*/
|
|
83215
83309
|
__offset(bb_pos, vtable_offset) {
|
|
83216
83310
|
const vtable = bb_pos - this.readInt32(bb_pos);
|
|
83217
|
-
return vtable_offset < this.readInt16(vtable)
|
|
83311
|
+
return vtable_offset < this.readInt16(vtable)
|
|
83312
|
+
? this.readInt16(vtable + vtable_offset)
|
|
83313
|
+
: 0;
|
|
83218
83314
|
}
|
|
83219
83315
|
/**
|
|
83220
83316
|
* Initialize any Table-derived type to point to the union at the given offset.
|
|
@@ -83278,8 +83374,7 @@ focus outline in that case.
|
|
|
83278
83374
|
}
|
|
83279
83375
|
__has_identifier(ident) {
|
|
83280
83376
|
if (ident.length != FILE_IDENTIFIER_LENGTH) {
|
|
83281
|
-
throw new Error('FlatBuffers: file identifier must be length ' +
|
|
83282
|
-
FILE_IDENTIFIER_LENGTH);
|
|
83377
|
+
throw new Error('FlatBuffers: file identifier must be length ' + FILE_IDENTIFIER_LENGTH);
|
|
83283
83378
|
}
|
|
83284
83379
|
for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {
|
|
83285
83380
|
if (ident.charCodeAt(i) != this.readInt8(this.position() + SIZEOF_INT + i)) {
|
|
@@ -83392,7 +83487,9 @@ focus outline in that case.
|
|
|
83392
83487
|
* called finish().
|
|
83393
83488
|
*/
|
|
83394
83489
|
asUint8Array() {
|
|
83395
|
-
return this.bb
|
|
83490
|
+
return this.bb
|
|
83491
|
+
.bytes()
|
|
83492
|
+
.subarray(this.bb.position(), this.bb.position() + this.offset());
|
|
83396
83493
|
}
|
|
83397
83494
|
/**
|
|
83398
83495
|
* Prepare to write an element of `size` after `additional_bytes` have been
|
|
@@ -83410,7 +83507,7 @@ focus outline in that case.
|
|
|
83410
83507
|
}
|
|
83411
83508
|
// Find the amount of alignment needed such that `size` is properly
|
|
83412
83509
|
// aligned after `additional_bytes`
|
|
83413
|
-
const align_size = (
|
|
83510
|
+
const align_size = (~(this.bb.capacity() - this.space + additional_bytes) + 1) & (size - 1);
|
|
83414
83511
|
// Reallocate the buffer if needed.
|
|
83415
83512
|
while (this.space < align_size + size + additional_bytes) {
|
|
83416
83513
|
const old_buf_size = this.bb.capacity();
|
|
@@ -83425,22 +83522,22 @@ focus outline in that case.
|
|
|
83425
83522
|
}
|
|
83426
83523
|
}
|
|
83427
83524
|
writeInt8(value) {
|
|
83428
|
-
this.bb.writeInt8(this.space -= 1, value);
|
|
83525
|
+
this.bb.writeInt8((this.space -= 1), value);
|
|
83429
83526
|
}
|
|
83430
83527
|
writeInt16(value) {
|
|
83431
|
-
this.bb.writeInt16(this.space -= 2, value);
|
|
83528
|
+
this.bb.writeInt16((this.space -= 2), value);
|
|
83432
83529
|
}
|
|
83433
83530
|
writeInt32(value) {
|
|
83434
|
-
this.bb.writeInt32(this.space -= 4, value);
|
|
83531
|
+
this.bb.writeInt32((this.space -= 4), value);
|
|
83435
83532
|
}
|
|
83436
83533
|
writeInt64(value) {
|
|
83437
|
-
this.bb.writeInt64(this.space -= 8, value);
|
|
83534
|
+
this.bb.writeInt64((this.space -= 8), value);
|
|
83438
83535
|
}
|
|
83439
83536
|
writeFloat32(value) {
|
|
83440
|
-
this.bb.writeFloat32(this.space -= 4, value);
|
|
83537
|
+
this.bb.writeFloat32((this.space -= 4), value);
|
|
83441
83538
|
}
|
|
83442
83539
|
writeFloat64(value) {
|
|
83443
|
-
this.bb.writeFloat64(this.space -= 8, value);
|
|
83540
|
+
this.bb.writeFloat64((this.space -= 8), value);
|
|
83444
83541
|
}
|
|
83445
83542
|
/**
|
|
83446
83543
|
* Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
|
|
@@ -83588,7 +83685,7 @@ focus outline in that case.
|
|
|
83588
83685
|
static growByteBuffer(bb) {
|
|
83589
83686
|
const old_buf_size = bb.capacity();
|
|
83590
83687
|
// Ensure we don't grow beyond what fits in an int.
|
|
83591
|
-
if (old_buf_size &
|
|
83688
|
+
if (old_buf_size & 0xc0000000) {
|
|
83592
83689
|
throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.');
|
|
83593
83690
|
}
|
|
83594
83691
|
const new_buf_size = old_buf_size << 1;
|
|
@@ -83687,8 +83784,7 @@ focus outline in that case.
|
|
|
83687
83784
|
const size_prefix = opt_size_prefix ? SIZE_PREFIX_LENGTH : 0;
|
|
83688
83785
|
if (opt_file_identifier) {
|
|
83689
83786
|
const file_identifier = opt_file_identifier;
|
|
83690
|
-
this.prep(this.minalign, SIZEOF_INT +
|
|
83691
|
-
FILE_IDENTIFIER_LENGTH + size_prefix);
|
|
83787
|
+
this.prep(this.minalign, SIZEOF_INT + FILE_IDENTIFIER_LENGTH + size_prefix);
|
|
83692
83788
|
if (file_identifier.length != FILE_IDENTIFIER_LENGTH) {
|
|
83693
83789
|
throw new TypeError('FlatBuffers: file identifier must be length ' +
|
|
83694
83790
|
FILE_IDENTIFIER_LENGTH);
|
|
@@ -83791,7 +83887,7 @@ focus outline in that case.
|
|
|
83791
83887
|
}
|
|
83792
83888
|
this.addInt8(0);
|
|
83793
83889
|
this.startVector(1, utf8.length, 1);
|
|
83794
|
-
this.bb.setPosition(this.space -= utf8.length);
|
|
83890
|
+
this.bb.setPosition((this.space -= utf8.length));
|
|
83795
83891
|
this.bb.bytes().set(utf8, this.space);
|
|
83796
83892
|
return this.endVector();
|
|
83797
83893
|
}
|
|
@@ -83806,7 +83902,7 @@ focus outline in that case.
|
|
|
83806
83902
|
return 0;
|
|
83807
83903
|
}
|
|
83808
83904
|
this.startVector(1, v.length, 1);
|
|
83809
|
-
this.bb.setPosition(this.space -= v.length);
|
|
83905
|
+
this.bb.setPosition((this.space -= v.length));
|
|
83810
83906
|
this.bb.bytes().set(v, this.space);
|
|
83811
83907
|
return this.endVector();
|
|
83812
83908
|
}
|