foundry-design-web-adapter 0.2.0-beta.21 → 0.2.0-beta.22

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/README.md CHANGED
@@ -10,7 +10,7 @@ Design Branches keeps parallel visual directions isolated inside one local sessi
10
10
 
11
11
  Foundry is distributed through npm, so testers do not need GitHub access.
12
12
 
13
- > **Current beta release:** `0.2.0-beta.21`. After publication, both npm `latest` and `beta` resolve to this release.
13
+ > **Current beta release:** `0.2.0-beta.22`. After publication, both npm `latest` and `beta` resolve to this release.
14
14
 
15
15
  Full documentation is available at [withfoundry.ai](https://withfoundry.ai).
16
16
 
@@ -141,7 +141,7 @@ If an npm mirror or existing `npx` cache reports an old tag, bypass it with a te
141
141
 
142
142
  ```bash
143
143
  FOUNDRY_NPX_CACHE="$(mktemp -d)"
144
- npx --yes --prefer-online --registry=https://registry.npmjs.org --cache "$FOUNDRY_NPX_CACHE" --package=foundry-design@0.2.0-beta.21 foundry-design
144
+ npx --yes --prefer-online --registry=https://registry.npmjs.org --cache "$FOUNDRY_NPX_CACHE" --package=foundry-design@0.2.0-beta.22 foundry-design
145
145
  ```
146
146
 
147
147
  The beta supports Node.js 20 or newer. Read the [local-first safety model](https://withfoundry.ai/#safety) before using it with sensitive work.
@@ -158,7 +158,7 @@ Foundry remains local-first. Installing the plugin does not create an account, e
158
158
 
159
159
  ### Cursor one-click connection
160
160
 
161
- [Add the Foundry MCP bridge to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=foundry-design-control&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIi0tcHJlZmVyLW9ubGluZSIsImZvdW5kcnktZGVzaWduLW1jcC1zZXJ2ZXJAMC4yLjAtYmV0YS4yMSJdLCJlbnYiOnsiRk9VTkRSWV9ERVNJR05fUlVOVElNRV9VUkwiOiJodHRwOi8vMTI3LjAuMC4xOjQzODcifX0%3D), then run `npx foundry-design` inside the project. The repository's Cursor plugin additionally bundles the Foundry skill and session-start hook for marketplace distribution.
161
+ [Add the Foundry MCP bridge to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=foundry-design-control&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIi0tcHJlZmVyLW9ubGluZSIsImZvdW5kcnktZGVzaWduLW1jcC1zZXJ2ZXJAMC4yLjAtYmV0YS4yMiJdLCJlbnYiOnsiRk9VTkRSWV9ERVNJR05fUlVOVElNRV9VUkwiOiJodHRwOi8vMTI3LjAuMC4xOjQzODcifX0%3D), then run `npx foundry-design` inside the project. The repository's Cursor plugin additionally bundles the Foundry skill and session-start hook for marketplace distribution.
162
162
 
163
163
  ## Current capabilities
164
164
 
package/dist/adapter.js CHANGED
@@ -277,9 +277,9 @@ function auditHealthSnapshot(snapshot) {
277
277
  });
278
278
  }
279
279
  }
280
- const outsideViewport = snapshot.left < -1 || snapshot.right > snapshot.viewportWidth + 1 || snapshot.top < -1 || snapshot.bottom > snapshot.viewportHeight + 1;
281
- const clipsX = ["auto", "scroll", "hidden", "clip"].includes(snapshot.overflowX);
282
- const clipsY = ["auto", "scroll", "hidden", "clip"].includes(snapshot.overflowY);
280
+ const outsideViewport = snapshot.left < -1 || snapshot.right > snapshot.viewportWidth + 1;
281
+ const clipsX = ["hidden", "clip"].includes(snapshot.overflowX);
282
+ const clipsY = ["hidden", "clip"].includes(snapshot.overflowY);
283
283
  const contentOverflow = clipsX && snapshot.scrollWidth > snapshot.clientWidth + 1 || clipsY && snapshot.scrollHeight > snapshot.clientHeight + 1;
284
284
  if (outsideViewport || contentOverflow) {
285
285
  findings.push({
@@ -287,7 +287,7 @@ function auditHealthSnapshot(snapshot) {
287
287
  category: "overflow",
288
288
  severity: outsideViewport ? "high" : "medium",
289
289
  title: outsideViewport ? "Content leaves the viewport" : "Content is being clipped",
290
- description: outsideViewport ? "Keep this element inside the current viewport or add an intentional scrolling container." : "The rendered content is larger than its available box.",
290
+ description: outsideViewport ? "Keep this element inside the current viewport width or add an intentional horizontal scrolling container." : "The rendered content is larger than its available box.",
291
291
  evidence: outsideViewport ? `${Math.round(snapshot.left)}\u2013${Math.round(snapshot.right)} px across a ${snapshot.viewportWidth} px viewport` : `${snapshot.scrollWidth} \xD7 ${snapshot.scrollHeight} content inside ${snapshot.clientWidth} \xD7 ${snapshot.clientHeight}`,
292
292
  fix: outsideViewport && snapshot.width > snapshot.viewportWidth ? {
293
293
  label: "Constrain to the viewport",
@@ -21293,6 +21293,18 @@ function normalizeStressConditions(values) {
21293
21293
  }
21294
21294
  return normalized3;
21295
21295
  }
21296
+ function validateStressConditions(values) {
21297
+ const unsupportedIndex = values.findIndex((value) => !stressIds.has(value));
21298
+ if (unsupportedIndex >= 0) {
21299
+ throw new Error(`Unsupported stress test: ${String(values[unsupportedIndex])}`);
21300
+ }
21301
+ const normalized3 = normalizeStressConditions(values);
21302
+ if (!normalized3.length) throw new Error("Select at least one supported stress test");
21303
+ return normalized3;
21304
+ }
21305
+ function designHealthScope(active, requestedScope) {
21306
+ return normalizeStressConditions(active).length ? requestedScope : "canvas";
21307
+ }
21296
21308
 
21297
21309
  // src/apply-run.ts
21298
21310
  var ACTIVE_APPLY_STATES = [
@@ -24725,6 +24737,7 @@ function installFoundryInspector(options = {}) {
24725
24737
  let draggedLayer = null;
24726
24738
  let layerScrollFrame = 0;
24727
24739
  let healthIssues = [];
24740
+ let healthScanError = "";
24728
24741
  let healthFilter = "all";
24729
24742
  const ignoredHealthIssues = /* @__PURE__ */ new Set();
24730
24743
  try {
@@ -24762,6 +24775,7 @@ function installFoundryInspector(options = {}) {
24762
24775
  let responsiveContainerPreview = null;
24763
24776
  let activeStressConditions = [];
24764
24777
  let activeStressScope = "selection";
24778
+ let activeStressTarget = null;
24765
24779
  let stressDraftConditions = [];
24766
24780
  let stressDraftScope = "selection";
24767
24781
  let stressAppliedAt = "";
@@ -25007,7 +25021,8 @@ function installFoundryInspector(options = {}) {
25007
25021
  active: activeStressConditions,
25008
25022
  scope: activeStressScope,
25009
25023
  appliedAt: stressAppliedAt || null,
25010
- target: activeStressScope === "selection" && selected ? layerLabel(selected) : "Entire canvas"
25024
+ error: healthScanError || null,
25025
+ target: activeStressScope === "selection" ? activeStressTarget?.label ?? (selected ? layerLabel(selected) : "No selection") : "Entire canvas"
25011
25026
  },
25012
25027
  memory: designMemory,
25013
25028
  decisionMemory: {
@@ -25222,7 +25237,7 @@ function installFoundryInspector(options = {}) {
25222
25237
  window.setTimeout(publishWorkspaceState, 0);
25223
25238
  }
25224
25239
  function stressRoots(scope2) {
25225
- if (scope2 === "selection" && selected?.isConnected) return [selected];
25240
+ if (scope2 === "selection") return selected?.isConnected ? [selected] : [];
25226
25241
  return [document.body];
25227
25242
  }
25228
25243
  function textNodesInside(root) {
@@ -25242,6 +25257,8 @@ function installFoundryInspector(options = {}) {
25242
25257
  for (const restore of stressRestore.reverse()) restore();
25243
25258
  stressRestore = [];
25244
25259
  activeStressConditions = [];
25260
+ activeStressTarget = null;
25261
+ healthScanError = "";
25245
25262
  stressAppliedAt = "";
25246
25263
  document.documentElement.removeAttribute("data-foundry-stress");
25247
25264
  window.dispatchEvent(
@@ -25257,12 +25274,21 @@ function installFoundryInspector(options = {}) {
25257
25274
  }
25258
25275
  }
25259
25276
  function applyStressConditions(conditions, scope2) {
25277
+ const normalizedConditions = validateStressConditions(conditions);
25278
+ const roots = stressRoots(scope2);
25279
+ if (scope2 === "selection" && !roots[0]) {
25280
+ throw new Error("The selected stress target is no longer available. Select it again.");
25281
+ }
25260
25282
  restoreStressConditions(false);
25261
25283
  activeStressScope = scope2;
25262
- activeStressConditions = normalizeStressConditions(conditions);
25284
+ activeStressConditions = normalizedConditions;
25263
25285
  stressDraftScope = scope2;
25264
25286
  stressDraftConditions = [...activeStressConditions];
25265
- const roots = stressRoots(scope2);
25287
+ activeStressTarget = scope2 === "selection" && roots[0] ? {
25288
+ element: roots[0],
25289
+ label: layerLabel(roots[0])
25290
+ } : null;
25291
+ healthScanError = "";
25266
25292
  const textNodes = roots.flatMap(textNodesInside);
25267
25293
  const saveStyle = (element, property, value) => {
25268
25294
  const previous = String(element.style[property] ?? "");
@@ -25352,10 +25378,7 @@ function installFoundryInspector(options = {}) {
25352
25378
  }
25353
25379
  })
25354
25380
  );
25355
- window.setTimeout(() => {
25356
- scanDesignHealth();
25357
- publishWorkspaceState();
25358
- }, 0);
25381
+ return scanDesignHealthOrThrow();
25359
25382
  }
25360
25383
  function applyResponsiveStress(mode) {
25361
25384
  clearResponsiveStress();
@@ -26367,12 +26390,19 @@ ${rule.cssText}` === key))
26367
26390
  }
26368
26391
  if (command === "apply-health-stress") {
26369
26392
  const stressScope = payload.scope === "canvas" ? "canvas" : "selection";
26370
- if (stressScope === "selection" && !selected) throw new Error("Select a target first");
26371
- applyStressConditions(
26393
+ if (stressScope === "selection" && !selected?.isConnected) {
26394
+ throw new Error("Select a connected target first");
26395
+ }
26396
+ const findings = applyStressConditions(
26372
26397
  Array.isArray(payload.conditions) ? payload.conditions : [],
26373
26398
  stressScope
26374
26399
  );
26375
- return { applied: true, scope: stressScope, conditions: activeStressConditions };
26400
+ return {
26401
+ applied: true,
26402
+ scope: stressScope,
26403
+ conditions: activeStressConditions,
26404
+ findings
26405
+ };
26376
26406
  }
26377
26407
  if (command === "clear-health-stress") {
26378
26408
  stressDraftConditions = [];
@@ -26712,9 +26742,7 @@ ${rule.cssText}` === key))
26712
26742
  return { preference, resolved: resolvedInterfaceTheme() };
26713
26743
  }
26714
26744
  if (command === "scan-health") {
26715
- scanDesignHealth();
26716
- publishWorkspaceState();
26717
- return { scanned: true, findings: healthIssues.length };
26745
+ return { scanned: true, findings: scanDesignHealthOrThrow() };
26718
26746
  }
26719
26747
  throw new Error(`Unknown workspace command: ${command}`);
26720
26748
  }
@@ -31782,6 +31810,7 @@ ${rule.cssText}` === key))
31782
31810
  if (!activeStressConditions.includes("keyboard-only") || !keyboardReachable(element))
31783
31811
  return void 0;
31784
31812
  const previousFocus = document.activeElement;
31813
+ element.blur();
31785
31814
  const before = getComputedStyle(element);
31786
31815
  const baseline = {
31787
31816
  outlineStyle: before.outlineStyle,
@@ -31790,21 +31819,38 @@ ${rule.cssText}` === key))
31790
31819
  borderColor: before.borderColor,
31791
31820
  backgroundColor: before.backgroundColor
31792
31821
  };
31793
- element.focus({ preventScroll: true });
31822
+ element.focus({ preventScroll: true, focusVisible: true });
31823
+ const forcedFocusVisible = element.matches(":focus-visible");
31794
31824
  const focused = getComputedStyle(element);
31795
31825
  const outlineVisible = focused.outlineStyle !== "none" && Number.parseFloat(focused.outlineWidth) > 0;
31796
31826
  const treatmentChanged = focused.boxShadow !== baseline.boxShadow || focused.borderColor !== baseline.borderColor || focused.backgroundColor !== baseline.backgroundColor || focused.outlineStyle !== baseline.outlineStyle || focused.outlineWidth !== baseline.outlineWidth;
31797
31827
  if (previousFocus?.isConnected) previousFocus.focus({ preventScroll: true });
31798
31828
  else element.blur();
31799
- return outlineVisible || treatmentChanged;
31829
+ const treatmentVisible = outlineVisible || treatmentChanged;
31830
+ return forcedFocusVisible ? treatmentVisible : treatmentVisible || void 0;
31831
+ }
31832
+ function resolveActiveStressTarget() {
31833
+ if (!activeStressTarget) return null;
31834
+ return activeStressTarget.element.isConnected ? activeStressTarget.element : null;
31835
+ }
31836
+ function belongsToHealthRoot(element, root) {
31837
+ let candidate2 = element;
31838
+ while (candidate2) {
31839
+ if (candidate2 === root) return true;
31840
+ candidate2 = composedParent(candidate2);
31841
+ }
31842
+ return false;
31800
31843
  }
31801
31844
  function scanDesignHealth() {
31802
31845
  const spacingTokens = (designGraph?.tokens ?? []).filter(
31803
31846
  (token2) => token2.category === "spacing"
31804
31847
  );
31805
31848
  const nextIssues = [];
31849
+ const healthScope = designHealthScope(activeStressConditions, activeStressScope);
31850
+ const healthRoot = healthScope === "selection" ? resolveActiveStressTarget() : null;
31851
+ healthScanError = healthScope === "selection" && !healthRoot ? "The selected stress target is no longer available. Clear the test and select it again." : "";
31806
31852
  const elements = collectLayerElements(document).filter(
31807
- (element) => element.getAttribute("aria-hidden") !== "true" && isVisibleLayer(element) && element !== document.documentElement && element !== document.body
31853
+ (element) => element.getAttribute("aria-hidden") !== "true" && isVisibleLayer(element) && element !== document.documentElement && element !== document.body && (healthScope === "canvas" || healthRoot && belongsToHealthRoot(element, healthRoot))
31808
31854
  ).slice(0, 1e4);
31809
31855
  for (const element of elements) {
31810
31856
  const style = getComputedStyle(element);
@@ -31866,6 +31912,12 @@ ${rule.cssText}` === key))
31866
31912
  healthIssues = nextIssues;
31867
31913
  renderHealthPanel();
31868
31914
  }
31915
+ function scanDesignHealthOrThrow() {
31916
+ scanDesignHealth();
31917
+ publishWorkspaceState();
31918
+ if (healthScanError) throw new Error(healthScanError);
31919
+ return healthIssues.length;
31920
+ }
31869
31921
  function renderHealthPanel() {
31870
31922
  const visibleIssues = healthIssues.filter((issue2) => !ignoredHealthIssues.has(issue2.id));
31871
31923
  const filtered = visibleIssues.filter(
@@ -31873,7 +31925,7 @@ ${rule.cssText}` === key))
31873
31925
  );
31874
31926
  const score = healthScore(visibleIssues);
31875
31927
  const scoreColor = score >= 90 ? "#2b9a76" : score >= 70 ? "#d69b3c" : "#d15d43";
31876
- healthSummary.innerHTML = `<div class="health-score" style="--score:${score};--score-color:${scoreColor}"><strong>${score}</strong></div><div class="health-summary-copy"><strong>${visibleIssues.length ? `${visibleIssues.length} issue${visibleIssues.length === 1 ? "" : "s"} found` : "No issues found"}</strong><span>${visibleIssues.length ? "Review evidence before previewing a correction." : "The current viewport passed this health scan."}</span></div>`;
31928
+ healthSummary.innerHTML = `<div class="health-score" style="--score:${healthScanError ? 0 : score};--score-color:${healthScanError ? "#d69b3c" : scoreColor}"><strong>${healthScanError ? "\u2013" : score}</strong></div><div class="health-summary-copy"><strong>${healthScanError ? "Selection unavailable" : visibleIssues.length ? `${visibleIssues.length} issue${visibleIssues.length === 1 ? "" : "s"} found` : "No issues found"}</strong><span>${healthScanError || (visibleIssues.length ? "Review evidence before previewing a correction." : "The current viewport passed this health scan.")}</span></div>`;
31877
31929
  healthStress.innerHTML = `<div class="health-stress-head"><strong>Temporary stress</strong><span>${activeStressConditions.length ? `${activeStressConditions.length} active` : "Preview only"}</span></div><div class="health-stress-scope" role="group" aria-label="Stress test scope"><button class="${stressDraftScope === "selection" ? "active" : ""}" data-health-stress-scope="selection" aria-pressed="${stressDraftScope === "selection"}">Selection</button><button class="${stressDraftScope === "canvas" ? "active" : ""}" data-health-stress-scope="canvas" aria-pressed="${stressDraftScope === "canvas"}">Canvas</button></div><div class="health-stress-options">${STRESS_CONDITIONS.map((condition) => `<button class="${stressDraftConditions.includes(condition.id) ? "active" : ""}" data-health-stress-condition="${condition.id}" aria-pressed="${stressDraftConditions.includes(condition.id)}" title="${escapeHtml(condition.description)}">${escapeHtml(condition.label)}</button>`).join("")}</div><div class="health-stress-actions"><button data-health-stress-clear>Clear</button><button data-health-stress-apply ${stressDraftConditions.length ? "" : "disabled"}>Apply and scan</button></div>`;
31878
31930
  const filters = ["all", "high", "medium", "low"];
31879
31931
  healthFilters.innerHTML = filters.map((filter) => {
@@ -31883,7 +31935,7 @@ ${rule.cssText}` === key))
31883
31935
  }).join("");
31884
31936
  healthList.innerHTML = filtered.length ? filtered.map(
31885
31937
  (issue2) => `<article class="health-card" data-health-issue="${escapeHtml(issue2.id)}"><div class="health-card-top"><span class="health-severity ${issue2.severity}"></span><strong>${escapeHtml(issue2.title)}</strong><span>${escapeHtml(issue2.severity)}</span></div><p>${escapeHtml(issue2.description)}</p><div class="health-evidence"><strong>${escapeHtml(issue2.elementLabel)}</strong><br/>${escapeHtml(issue2.evidence)}</div><div class="health-actions"><button data-health-select="${escapeHtml(issue2.id)}">Select</button><button class="health-ignore" data-health-ignore="${escapeHtml(issue2.id)}">Ignore</button>${issue2.fix ? `<button class="health-fix ${issue2.previewed ? "previewed" : ""}" data-health-fix="${escapeHtml(issue2.id)}" ${issue2.previewed ? "disabled" : ""}>${issue2.previewed ? '<i data-foundry-icon="check"></i> Added to review' : escapeHtml(issue2.fix.label)}</button>` : ""}</div></article>`
31886
- ).join("") : `<div class="health-empty"><i data-foundry-icon="${visibleIssues.length ? "triangle-alert" : "check"}"></i>${visibleIssues.length ? "No issues match this filter." : "This viewport is looking healthy."}</div>`;
31938
+ ).join("") : `<div class="health-empty"><i data-foundry-icon="${healthScanError || visibleIssues.length ? "triangle-alert" : "check"}"></i>${healthScanError || (visibleIssues.length ? "No issues match this filter." : "This viewport is looking healthy.")}</div>`;
31887
31939
  const ignoredCount = healthIssues.filter((issue2) => ignoredHealthIssues.has(issue2.id)).length;
31888
31940
  const ignoredButton = shadow.querySelector(".health-show-ignored");
31889
31941
  ignoredButton.hidden = ignoredCount === 0;
@@ -31922,12 +31974,16 @@ ${rule.cssText}` === key))
31922
31974
  restoreStressConditions();
31923
31975
  });
31924
31976
  healthStress.querySelector("[data-health-stress-apply]")?.addEventListener("click", () => {
31925
- if (stressDraftScope === "selection" && !selected) {
31977
+ if (stressDraftScope === "selection" && !selected?.isConnected) {
31926
31978
  showToast("Select a layer before applying selection stress");
31927
31979
  return;
31928
31980
  }
31929
- applyStressConditions(stressDraftConditions, stressDraftScope);
31930
- showToast("Temporary stress applied");
31981
+ try {
31982
+ applyStressConditions(stressDraftConditions, stressDraftScope);
31983
+ showToast("Temporary stress applied and measured");
31984
+ } catch (error61) {
31985
+ showToast(error61 instanceof Error ? error61.message : "Could not apply temporary stress");
31986
+ }
31931
31987
  });
31932
31988
  healthFilters.querySelectorAll("[data-health-filter]").forEach(
31933
31989
  (button) => button.addEventListener("click", () => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgGA,OAAO,EAgCL,KAAK,6BAA6B,EACnC,MAAM,iBAAiB,CAAC;AA6CzB,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxE,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,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@ -20,7 +20,9 @@ export interface StressFindingGroup<T extends StressFindingContext> {
20
20
  }
21
21
  export declare const STRESS_CONDITIONS: readonly StressConditionDefinition[];
22
22
  export declare function normalizeStressConditions(values: readonly unknown[]): StressConditionId[];
23
+ export declare function validateStressConditions(values: readonly unknown[]): StressConditionId[];
23
24
  export declare function toggleStressCondition(active: readonly StressConditionId[], id: StressConditionId): StressConditionId[];
24
25
  export declare function stressConditionSummary(active: readonly StressConditionId[]): string;
26
+ export declare function designHealthScope(active: readonly StressConditionId[], requestedScope: StressScope): StressScope;
25
27
  export declare function groupStressFindings<T extends StressFindingContext>(findings: readonly T[], groupBy?: 'severity' | 'source'): StressFindingGroup<T>[];
26
28
  //# sourceMappingURL=stress-testing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stress-testing.d.ts","sourceRoot":"","sources":["../src/stress-testing.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,GAAG,eAAe,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,eAAe,GACf,UAAU,GACV,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,gBAAgB,GAChB,eAAe,CAAC;AAEpB,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEjD,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,iBAAiB,CAAC;IACtB,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,CAAC;CAChE;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAA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S,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,CAAC;CAChE;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,oBAAoB;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,EAAE,CAAC;CACf;AAED,eAAO,MAAM,iBAAiB,EAAE,SAAS,yBAAyB,EA4FxD,CAAC;AAIX,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAmBzF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAQxF;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,iBAAiB,EAAE,EACpC,EAAE,EAAE,iBAAiB,GACpB,iBAAiB,EAAE,CAGrB;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,GAAG,MAAM,CAOnF;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,iBAAiB,EAAE,EACpC,cAAc,EAAE,WAAW,GAC1B,WAAW,CAEb;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,oBAAoB,EAChE,QAAQ,EAAE,SAAS,CAAC,EAAE,EACtB,OAAO,GAAE,UAAU,GAAG,QAAqB,GAC1C,kBAAkB,CAAC,CAAC,CAAC,EAAE,CAuBzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-design-web-adapter",
3
- "version": "0.2.0-beta.21",
3
+ "version": "0.2.0-beta.22",
4
4
  "description": "Development-only browser inspector for Foundry",
5
5
  "type": "module",
6
6
  "main": "dist/adapter.js",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@iconify-icons/keyline-icons": "2.0.0",
36
- "foundry-design-protocol": "0.2.0-beta.21"
36
+ "foundry-design-protocol": "0.2.0-beta.22"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "esbuild src/index.ts --bundle --format=esm --target=es2022 --outfile=dist/adapter.js && tsc -p tsconfig.json --emitDeclarationOnly",