vim-web 0.5.0-dev.6 → 0.5.0-dev.7
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/vim-web.js
CHANGED
|
@@ -58368,16 +58368,16 @@ class ColorManager {
|
|
|
58368
58368
|
}
|
|
58369
58369
|
/**
|
|
58370
58370
|
* Creates or retrieves cached color instances for multiple hex values.
|
|
58371
|
-
* @param
|
|
58371
|
+
* @param colors - Array of RGBA32 color values
|
|
58372
58372
|
* @returns Promise resolving to an array of ColorHandles in the same order as input, or undefined if creation fails
|
|
58373
58373
|
* @remarks Duplicate hex values will be mapped to the same color instance for efficiency
|
|
58374
58374
|
*/
|
|
58375
|
-
async getColors(
|
|
58376
|
-
const result = new Array(
|
|
58375
|
+
async getColors(colors) {
|
|
58376
|
+
const result = new Array(colors.length);
|
|
58377
58377
|
const hexToIndices = /* @__PURE__ */ new Map();
|
|
58378
58378
|
const toCreate = [];
|
|
58379
|
-
for (let i = 0; i <
|
|
58380
|
-
const color =
|
|
58379
|
+
for (let i = 0; i < colors.length; i++) {
|
|
58380
|
+
const color = colors[i];
|
|
58381
58381
|
const hex = color.getHex();
|
|
58382
58382
|
if (this._hexToColor.has(hex)) {
|
|
58383
58383
|
result[i] = this._hexToColor.get(hex);
|
|
@@ -58388,13 +58388,13 @@ class ColorManager {
|
|
|
58388
58388
|
hexToIndices.set(hex, [i]);
|
|
58389
58389
|
}
|
|
58390
58390
|
}
|
|
58391
|
-
const
|
|
58392
|
-
if (!
|
|
58393
|
-
for (let i = 0; i <
|
|
58391
|
+
const remoteColors = await this._createColors(toCreate);
|
|
58392
|
+
if (!remoteColors) return void 0;
|
|
58393
|
+
for (let i = 0; i < remoteColors.length; i++) {
|
|
58394
58394
|
const color = toCreate[i];
|
|
58395
58395
|
const indices = hexToIndices.get(color.getHex());
|
|
58396
58396
|
for (const index2 of indices) {
|
|
58397
|
-
result[index2] =
|
|
58397
|
+
result[index2] = remoteColors[i];
|
|
58398
58398
|
}
|
|
58399
58399
|
}
|
|
58400
58400
|
return result;
|
|
@@ -60877,6 +60877,7 @@ class Vim2 {
|
|
|
60877
60877
|
// default state
|
|
60878
60878
|
);
|
|
60879
60879
|
}
|
|
60880
|
+
//TODO: Rename this to getElementFromNode, prefer using element instead
|
|
60880
60881
|
getElement(elementIndex) {
|
|
60881
60882
|
if (this._objects.has(elementIndex)) {
|
|
60882
60883
|
return this._objects.get(elementIndex);
|
|
@@ -60889,7 +60890,7 @@ class Vim2 {
|
|
|
60889
60890
|
throw new Error("Method not implemented.");
|
|
60890
60891
|
}
|
|
60891
60892
|
getElementFromIndex(element) {
|
|
60892
|
-
|
|
60893
|
+
return this.getElement(element);
|
|
60893
60894
|
}
|
|
60894
60895
|
getObjectsInBox(box) {
|
|
60895
60896
|
throw new Error("Method not implemented.");
|
|
@@ -76268,6 +76269,7 @@ function createAdapter(viewer) {
|
|
|
76268
76269
|
obj.state = VisibilityState.HIGHLIGHTED;
|
|
76269
76270
|
});
|
|
76270
76271
|
},
|
|
76272
|
+
// TODO: Change this api to use elements
|
|
76271
76273
|
isolate: (instances) => {
|
|
76272
76274
|
hide("all");
|
|
76273
76275
|
viewer.selection.getAll().forEach((obj) => {
|