Replace deprecated row/cell/instance terminology with "item" and "value" terms (#4075)

This commit is contained in:
Keavon Chambers
2026-04-28 19:12:59 -07:00
committed by GitHub
parent f6c73d1c20
commit 5774ec215d
49 changed files with 347 additions and 354 deletions
@@ -191,7 +191,7 @@
const isViewport = placeholder.hasAttribute("data-is-viewport");
if (isViewport && canvas.isConnected && canvas.parentElement?.closest("[data-viewport]")) return;
// Clone canvas for repeated instances (layers that appear multiple times)
// Clone canvas for repeated occurrences (layers that appear multiple times)
if (!isViewport && canvas.parentElement) {
const newCanvas = window.document.createElement("canvas");
const context = newCanvas.getContext("2d");
+7 -7
View File
@@ -27,7 +27,7 @@
ancestorOfSelected: boolean;
parentsVisible: boolean;
parentsUnlocked: boolean;
instancePath: bigint[];
treePath: bigint[];
};
type DraggingData = {
@@ -140,10 +140,10 @@
editor.toggleLayerLock(id);
}
function handleExpandArrowClickWithModifiers(e: MouseEvent, instancePath: bigint[]) {
function handleExpandArrowClickWithModifiers(e: MouseEvent, treePath: bigint[]) {
const accel = operatingSystem() === "Mac" ? e.metaKey : e.ctrlKey;
const collapseRecursive = e.altKey || accel;
editor.toggleLayerExpansion(BigUint64Array.from(instancePath), collapseRecursive);
editor.toggleLayerExpansion(BigUint64Array.from(treePath), collapseRecursive);
e.stopPropagation();
}
@@ -514,7 +514,7 @@
// Build the new layer hierarchy
const recurse = (children: LayerStructureEntry[], depth: number, parentId: bigint | undefined, parentPath: bigint[], parentsVisible: boolean, parentsUnlocked: boolean) => {
children.forEach((item, index) => {
const instancePath = [...parentPath, item.layerId];
const treePath = [...parentPath, item.layerId];
const mapping = layerCache.get(String(item.layerId));
if (mapping) {
@@ -531,14 +531,14 @@
ancestorOfSelected: item.descendantSelected,
parentsVisible,
parentsUnlocked,
instancePath,
treePath,
});
}
// Call self recursively, propagating this layer's visibility/lock state to its children
const childParentsVisible = parentsVisible && (mapping?.visible ?? true);
const childParentsUnlocked = parentsUnlocked && (mapping?.unlocked ?? true);
if (item.children.length >= 1) recurse(item.children, depth + 1, item.layerId, instancePath, childParentsVisible, childParentsUnlocked);
if (item.children.length >= 1) recurse(item.children, depth + 1, item.layerId, treePath, childParentsVisible, childParentsUnlocked);
});
};
recurse(layerStructure, 1, undefined, [], true, true);
@@ -605,7 +605,7 @@
: "Show this layer's children. (To recursively expand all descendants, perform the shortcut shown.)") +
(listing.ancestorOfSelected && !listing.expanded ? "\n\nA selected layer is currently contained within.\n" : "")}
data-tooltip-shortcut={$tooltip.altClickShortcut?.shortcut ? JSON.stringify($tooltip.altClickShortcut.shortcut) : undefined}
on:click={(e) => handleExpandArrowClickWithModifiers(e, listing.instancePath)}
on:click={(e) => handleExpandArrowClickWithModifiers(e, listing.treePath)}
tabindex="0"
></button>
{:else}
@@ -12,9 +12,9 @@
<tbody>
{#each widgetData.tableWidgets as row}
<tr>
{#each row as cell}
{#each row as widget}
<td colspan={row.length < columns ? columns - row.length + 1 : undefined}>
<WidgetSpan direction="row" widgets={[cell]} {layoutTarget} narrow={true} />
<WidgetSpan direction="row" widgets={[widget]} {layoutTarget} narrow={true} />
</td>
{/each}
</tr>