@salesforce/ui-design-mode 12.17.0 → 13.0.0

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.
Files changed (96) hide show
  1. package/dist/authoring/core/DesignPropertyPanelRoot.d.cts +4 -2
  2. package/dist/authoring/core/DesignPropertyPanelRoot.d.ts +4 -2
  3. package/dist/authoring/core/DesignPropertyPanelRoot.d.ts.map +1 -1
  4. package/dist/authoring/core/editors/BoxDimensionEditor.d.cts +20 -34
  5. package/dist/authoring/core/editors/BoxDimensionEditor.d.ts +20 -34
  6. package/dist/authoring/core/editors/BoxDimensionEditor.d.ts.map +1 -1
  7. package/dist/authoring/core/editors/ColorEditor.d.cts +8 -7
  8. package/dist/authoring/core/editors/ColorEditor.d.ts +8 -7
  9. package/dist/authoring/core/editors/ColorEditor.d.ts.map +1 -1
  10. package/dist/authoring/core/editors/DimensionEditor.d.ts.map +1 -1
  11. package/dist/authoring/core/editors/FieldNotice.d.cts +17 -0
  12. package/dist/authoring/core/editors/FieldNotice.d.ts +17 -0
  13. package/dist/authoring/core/editors/FieldNotice.d.ts.map +1 -0
  14. package/dist/authoring/core/editors/FontFamilyEditor.d.cts +4 -6
  15. package/dist/authoring/core/editors/FontFamilyEditor.d.ts +4 -6
  16. package/dist/authoring/core/editors/FontFamilyEditor.d.ts.map +1 -1
  17. package/dist/authoring/core/editors/FontWeightEditor.d.cts +6 -5
  18. package/dist/authoring/core/editors/FontWeightEditor.d.ts +6 -5
  19. package/dist/authoring/core/editors/FontWeightEditor.d.ts.map +1 -1
  20. package/dist/authoring/core/editors/ImageEditor.d.cts +21 -1
  21. package/dist/authoring/core/editors/ImageEditor.d.ts +21 -1
  22. package/dist/authoring/core/editors/ImageEditor.d.ts.map +1 -1
  23. package/dist/authoring/core/editors/PicklistEditor.d.cts +5 -21
  24. package/dist/authoring/core/editors/PicklistEditor.d.ts +5 -21
  25. package/dist/authoring/core/editors/PicklistEditor.d.ts.map +1 -1
  26. package/dist/authoring/core/history/changeSet.d.cts +28 -5
  27. package/dist/authoring/core/history/changeSet.d.ts +28 -5
  28. package/dist/authoring/core/history/changeSet.d.ts.map +1 -1
  29. package/dist/authoring/core/history/historyService.d.cts +1 -3
  30. package/dist/authoring/core/history/historyService.d.ts +1 -3
  31. package/dist/authoring/core/history/historyService.d.ts.map +1 -1
  32. package/dist/authoring/core/history/iframeCommandExecutor.d.cts +1 -1
  33. package/dist/authoring/core/history/iframeCommandExecutor.d.ts +1 -1
  34. package/dist/authoring/core/hooks/useRecentColors.d.cts +12 -0
  35. package/dist/authoring/core/hooks/useRecentColors.d.ts +12 -0
  36. package/dist/authoring/core/hooks/useRecentColors.d.ts.map +1 -0
  37. package/dist/authoring/core/labels/labels.d.cts +74 -97
  38. package/dist/authoring/core/labels/labels.d.ts +74 -97
  39. package/dist/authoring/core/labels/labels.d.ts.map +1 -1
  40. package/dist/authoring/core/utils/colorEditorModel.d.cts +18 -0
  41. package/dist/authoring/core/utils/colorEditorModel.d.ts +18 -0
  42. package/dist/authoring/core/utils/colorEditorModel.d.ts.map +1 -0
  43. package/dist/authoring/core/utils/colorOcclusion.d.cts +4 -20
  44. package/dist/authoring/core/utils/colorOcclusion.d.ts +4 -20
  45. package/dist/authoring/core/utils/colorOcclusion.d.ts.map +1 -1
  46. package/dist/authoring/core/utils/dimensionUtils.d.cts +0 -39
  47. package/dist/authoring/core/utils/dimensionUtils.d.ts +0 -39
  48. package/dist/authoring/core/utils/dimensionUtils.d.ts.map +1 -1
  49. package/dist/authoring/react/index.d.cts +1 -1
  50. package/dist/authoring/react/index.d.ts +1 -1
  51. package/dist/authoring/react/index.d.ts.map +1 -1
  52. package/dist/authoring/react/index.js +3 -3
  53. package/dist/authoring/react/styles.css +1 -1
  54. package/dist/authoring/web-component/index.d.cts +3 -1
  55. package/dist/authoring/web-component/index.d.ts +3 -1
  56. package/dist/authoring/web-component/index.d.ts.map +1 -1
  57. package/dist/authoring/web-component/index.js +290 -288
  58. package/dist/protocol/domAttributes.cjs +4 -0
  59. package/dist/protocol/domAttributes.d.cts +17 -0
  60. package/dist/protocol/domAttributes.d.ts +17 -0
  61. package/dist/protocol/domAttributes.d.ts.map +1 -1
  62. package/dist/protocol/domAttributes.js +4 -0
  63. package/dist/protocol/index.cjs +4 -0
  64. package/dist/protocol/index.js +6 -2
  65. package/dist/protocol/measuredStyleProperties.cjs +18 -0
  66. package/dist/protocol/measuredStyleProperties.d.cts +7 -0
  67. package/dist/protocol/measuredStyleProperties.d.ts +7 -0
  68. package/dist/protocol/measuredStyleProperties.d.ts.map +1 -1
  69. package/dist/protocol/measuredStyleProperties.js +18 -0
  70. package/dist/protocol/messageTypes.d.cts +27 -16
  71. package/dist/protocol/messageTypes.d.ts +27 -16
  72. package/dist/protocol/messageTypes.d.ts.map +1 -1
  73. package/dist/protocol/version.cjs +1 -1
  74. package/dist/protocol/version.js +1 -1
  75. package/dist/runtime/design-mode-interactions.js +198 -88
  76. package/dist/runtime/interactions/communicationManager.d.cts +2 -2
  77. package/dist/runtime/interactions/communicationManager.d.ts +2 -2
  78. package/dist/runtime/interactions/communicationManager.d.ts.map +1 -1
  79. package/dist/runtime/interactions/eventHandlers.d.cts +1 -1
  80. package/dist/runtime/interactions/eventHandlers.d.ts +1 -1
  81. package/dist/runtime/interactions/eventHandlers.d.ts.map +1 -1
  82. package/dist/runtime/interactions/interactionsController.d.cts +2 -0
  83. package/dist/runtime/interactions/interactionsController.d.ts +2 -0
  84. package/dist/runtime/interactions/interactionsController.d.ts.map +1 -1
  85. package/dist/runtime/interactions/propertyEditorCapabilities.d.cts +4 -0
  86. package/dist/runtime/interactions/propertyEditorCapabilities.d.ts +4 -0
  87. package/dist/runtime/interactions/propertyEditorCapabilities.d.ts.map +1 -0
  88. package/dist/runtime/interactions/utils/cssUtils.d.cts +3 -7
  89. package/dist/runtime/interactions/utils/cssUtils.d.ts +3 -7
  90. package/dist/runtime/interactions/utils/cssUtils.d.ts.map +1 -1
  91. package/dist/runtime/interactions/utils/sourceUtils.d.cts +1 -1
  92. package/dist/runtime/interactions/utils/sourceUtils.d.ts +1 -1
  93. package/dist/source-locator/react/babel/reactDesignTimeLocatorBabelPlugin.cjs +33 -0
  94. package/dist/source-locator/react/babel/reactDesignTimeLocatorBabelPlugin.d.ts.map +1 -1
  95. package/dist/source-locator/react/babel/reactDesignTimeLocatorBabelPlugin.js +34 -1
  96. package/package.json +1 -1
@@ -26,6 +26,8 @@
26
26
 
27
27
  // src/protocol/domAttributes.ts
28
28
  var ATTR_SOURCE_FILE = "data-source-file";
29
+ var ATTR_SRC_KIND = "data-src-kind";
30
+ var ATTR_ALT_KIND = "data-alt-kind";
29
31
 
30
32
  // src/protocol/editableElementTags.ts
31
33
  var EDITABLE_ELEMENT_TAGS = [
@@ -56,14 +58,30 @@
56
58
  ];
57
59
 
58
60
  // src/protocol/version.ts
59
- var UI_DESIGN_MODE_VERSION = "12.17.0";
61
+ var UI_DESIGN_MODE_VERSION = "13.0.0";
60
62
 
61
63
  // src/protocol/measuredStyleProperties.ts
62
64
  var MEASURED_TYPOGRAPHY_PROPERTIES = /* @__PURE__ */ new Set([
65
+ "fontFamily",
66
+ "fontWeight",
63
67
  "fontSize",
64
68
  "lineHeight",
65
69
  "letterSpacing"
66
70
  ]);
71
+ var BOX_DIMENSION_LONGHANDS = {
72
+ padding: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
73
+ margin: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
74
+ borderRadius: [
75
+ "borderTopLeftRadius",
76
+ "borderTopRightRadius",
77
+ "borderBottomRightRadius",
78
+ "borderBottomLeftRadius"
79
+ ]
80
+ };
81
+ var MEASURED_BOX_PROPERTIES = /* @__PURE__ */ new Set([
82
+ ...Object.keys(BOX_DIMENSION_LONGHANDS),
83
+ ...Object.values(BOX_DIMENSION_LONGHANDS).flat()
84
+ ]);
67
85
 
68
86
  // src/runtime/interactions/utils/sourceUtils.ts
69
87
  function parseRequiredInt(value) {
@@ -248,6 +266,52 @@
248
266
  }
249
267
  };
250
268
 
269
+ // src/runtime/interactions/propertyEditorCapabilities.ts
270
+ var NON_TEXT_TAGS = new Set(
271
+ "IMG SVG CANVAS VIDEO AUDIO IFRAME OBJECT EMBED HR BR SCRIPT STYLE TEMPLATE".split(" ")
272
+ );
273
+ var NON_TEXT_INPUT_TYPES = new Set("checkbox radio range color image hidden".split(" "));
274
+ var NON_BOX_TAGS = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "TEMPLATE", "OPTION", "OPTGROUP", "SVG"]);
275
+ function getPropertyEditorCapabilities(element) {
276
+ const tag = element.tagName.toUpperCase();
277
+ const hasText = (node) => {
278
+ const nodeTag = node.tagName.toUpperCase();
279
+ if (NON_TEXT_TAGS.has(nodeTag)) return false;
280
+ const view = node.ownerDocument?.defaultView;
281
+ const computed = view?.getComputedStyle(node);
282
+ if (computed?.display === "none" || computed?.contentVisibility === "hidden" || node.getAttribute("hidden") === "until-found")
283
+ return false;
284
+ const visible = computed?.visibility !== "hidden" && computed?.visibility !== "collapse";
285
+ if (nodeTag === "INPUT") {
286
+ return visible && !NON_TEXT_INPUT_TYPES.has(node.type);
287
+ }
288
+ if ((nodeTag === "TEXTAREA" || nodeTag === "SELECT") && visible) return true;
289
+ if (["::before", "::after"].some((pseudo) => {
290
+ const style = view?.getComputedStyle(node, pseudo);
291
+ if (!style || style.display === "none" || style.visibility === "hidden" || style.visibility === "collapse")
292
+ return false;
293
+ const tokens = style.content.matchAll(
294
+ /"(?:\\.|[^"\\])*"|url\((?:"(?:\\.|[^"\\])*"|[^)])*\)|counters?\([^)]*\)|\//gi
295
+ );
296
+ for (const [token] of tokens) {
297
+ if (token === "/") break;
298
+ if (token.startsWith('"') && token.slice(1, -1).trim()) return true;
299
+ if (/^counters?\(/i.test(token)) return true;
300
+ }
301
+ return false;
302
+ }))
303
+ return true;
304
+ const children = node.tagName.toUpperCase() === "SLOT" ? node.assignedNodes({ flatten: true }).length ? node.assignedNodes({ flatten: true }) : node.childNodes : node.shadowRoot?.childNodes ?? node.childNodes;
305
+ return Array.from(children ?? []).some(
306
+ (child) => child.nodeType === 3 ? visible && Boolean(child.textContent?.trim()) : child.nodeType === 1 && hasText(child)
307
+ );
308
+ };
309
+ return {
310
+ text: hasText(element),
311
+ box: !NON_BOX_TAGS.has(tag) && element.ownerDocument?.defaultView?.getComputedStyle(element).display !== "contents" && !(tag === "INPUT" && element.getAttribute("type")?.toLowerCase() === "hidden")
312
+ };
313
+ }
314
+
251
315
  // src/runtime/interactions/utils/cssUtils.ts
252
316
  function getElementStyles(element) {
253
317
  if (!element) return {};
@@ -261,13 +325,14 @@
261
325
  let inlineValue = inlineStyle[shorthand] || "";
262
326
  if (!inlineValue) {
263
327
  const iT = inlineStyle[top] || "", iR = inlineStyle[right] || "", iB = inlineStyle[bottom] || "", iL = inlineStyle[left] || "";
264
- if (iT || iR || iB || iL) {
265
- inlineValue = `${iT || "0px"} ${iR || "0px"} ${iB || "0px"} ${iL || "0px"}`;
328
+ if (iT && iR && iB && iL) {
329
+ inlineValue = `${iT} ${iR} ${iB} ${iL}`;
266
330
  }
267
331
  }
332
+ const measured = [top, right, bottom, left].map((side) => computed[side] || "");
268
333
  return {
269
334
  inline: inlineValue,
270
- computed: `${computed[top] || ""} ${computed[right] || ""} ${computed[bottom] || ""} ${computed[left] || ""}`
335
+ computed: measured.every(Boolean) ? measured.join(" ") : ""
271
336
  };
272
337
  };
273
338
  return {
@@ -278,28 +343,15 @@
278
343
  minHeight: prop("minHeight"),
279
344
  maxHeight: prop("maxHeight"),
280
345
  overflow: prop("overflow"),
281
- padding: box("padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft"),
282
- margin: box("margin", "marginTop", "marginRight", "marginBottom", "marginLeft"),
346
+ padding: box("padding", ...BOX_DIMENSION_LONGHANDS.padding),
347
+ margin: box("margin", ...BOX_DIMENSION_LONGHANDS.margin),
283
348
  backgroundColor: prop("backgroundColor"),
284
349
  backgroundImage: prop("backgroundImage"),
285
350
  backgroundClip: prop("backgroundClip"),
286
- borderWidth: box(
287
- "borderWidth",
288
- "borderTopWidth",
289
- "borderRightWidth",
290
- "borderBottomWidth",
291
- "borderLeftWidth"
292
- ),
293
351
  borderStyle: prop("borderStyle", "borderTopStyle"),
294
352
  borderColor: prop("borderColor", "borderTopColor"),
295
353
  borderImageSource: prop("borderImageSource"),
296
- borderRadius: box(
297
- "borderRadius",
298
- "borderTopLeftRadius",
299
- "borderTopRightRadius",
300
- "borderBottomRightRadius",
301
- "borderBottomLeftRadius"
302
- ),
354
+ borderRadius: box("borderRadius", ...BOX_DIMENSION_LONGHANDS.borderRadius),
303
355
  color: prop("color"),
304
356
  webkitTextFillColor: prop("webkitTextFillColor"),
305
357
  fontFamily: prop("fontFamily"),
@@ -310,7 +362,10 @@
310
362
  letterSpacing: prop("letterSpacing"),
311
363
  textAlign: prop("textAlign"),
312
364
  textDecoration: prop("textDecoration", "textDecorationLine"),
313
- textTransform: prop("textTransform")
365
+ textTransform: prop("textTransform"),
366
+ ...Object.fromEntries(
367
+ Object.values(BOX_DIMENSION_LONGHANDS).flat().map((side) => [side, prop(side)])
368
+ )
314
369
  };
315
370
  }
316
371
 
@@ -348,14 +403,28 @@
348
403
  }
349
404
 
350
405
  // src/runtime/interactions/communicationManager.ts
406
+ var MEDIA_VALUE_KINDS = [
407
+ "literal",
408
+ "asset-import",
409
+ "unknown"
410
+ ];
411
+ function readMediaValueKind(element, attribute) {
412
+ const kind = element.getAttribute(attribute);
413
+ if (kind == null) return void 0;
414
+ return MEDIA_VALUE_KINDS.includes(kind) ? kind : "unknown";
415
+ }
351
416
  function getMediaInfo(element, styles) {
352
417
  switch (element.tagName) {
353
418
  case "IMG": {
354
419
  const img = element;
420
+ const srcKind = readMediaValueKind(img, ATTR_SRC_KIND);
421
+ const altKind = readMediaValueKind(img, ATTR_ALT_KIND);
355
422
  return {
356
423
  tag: "img",
357
424
  src: img.getAttribute("src") ?? "",
358
- alt: img.getAttribute("alt") ?? ""
425
+ alt: img.getAttribute("alt") ?? "",
426
+ ...srcKind ? { srcKind } : {},
427
+ ...altKind ? { altKind } : {}
359
428
  };
360
429
  }
361
430
  }
@@ -377,10 +446,12 @@
377
446
  const label = getLabelFromSource(element);
378
447
  const styles = getElementStyles(element);
379
448
  const debugSource = getSourceFromDataAttributes(element);
380
- const instanceIndex = debugSource ? findElementsBySourceLocation(debugSource).indexOf(element) : -1;
449
+ const instances = debugSource ? findElementsBySourceLocation(debugSource) : [];
450
+ const instanceIndex = instances.indexOf(element);
381
451
  const textType = element.dataset?.textType ?? "none";
382
452
  const hasNonEditableText = TEXT_TAGS.includes(element.tagName) && (textType === "dynamic" || textType === "mixed");
383
453
  const media = getMediaInfo(element, styles);
454
+ const propertyEditorCapabilities = getPropertyEditorCapabilities(element);
384
455
  try {
385
456
  if (window.parent !== window) {
386
457
  window.parent.postMessage(
@@ -394,8 +465,9 @@
394
465
  ...styles
395
466
  },
396
467
  debugSource,
397
- ...instanceIndex >= 0 ? { instanceIndex } : {},
468
+ ...instanceIndex >= 0 ? { instanceIndex, instanceCount: instances.length } : {},
398
469
  hasNonEditableText,
470
+ propertyEditorCapabilities,
399
471
  ...media ? { media } : {}
400
472
  }
401
473
  },
@@ -694,6 +766,7 @@
694
766
  if (element.contentEditable !== "true") {
695
767
  this.editableManager.makeEditableIfText(element);
696
768
  }
769
+ this.communicationManager.notifyComponentSelected(element, true);
697
770
  return;
698
771
  }
699
772
  if (this.selectedElement) {
@@ -1414,6 +1487,11 @@
1414
1487
 
1415
1488
  // src/runtime/interactions/interactionsController.ts
1416
1489
  var MAX_DRIFT_LINE_DELTA = 50;
1490
+ var REMEASURE_TRIGGER_PROPERTIES = /* @__PURE__ */ new Set([
1491
+ "fontFamily",
1492
+ "fontWeight",
1493
+ "fontStyle"
1494
+ ]);
1417
1495
  var mediaAppliers = {
1418
1496
  // Whitelist by construction: this applier reads only the attribute keys
1419
1497
  // valid for <img> and ignores anything else in `attrs`. The map is never
@@ -1435,6 +1513,7 @@
1435
1513
  __publicField(this, "editableManager");
1436
1514
  __publicField(this, "eventHandlers");
1437
1515
  __publicField(this, "interceptOverlay");
1516
+ __publicField(this, "boxRefreshFrame", null);
1438
1517
  this.enabled = enabled;
1439
1518
  this.isActive = false;
1440
1519
  this.componentMatcher = new ComponentMatcher({
@@ -1491,10 +1570,11 @@
1491
1570
  });
1492
1571
  this.overlayManager = new OverlayManager();
1493
1572
  this.communicationManager = new CommunicationManager();
1494
- this.editableManager = new EditableManager(
1495
- this.communicationManager,
1496
- () => this.overlayManager.reposition()
1497
- );
1573
+ this.editableManager = new EditableManager(this.communicationManager, () => {
1574
+ this.overlayManager.reposition();
1575
+ const selected = this.eventHandlers.getSelectedElement();
1576
+ if (selected) this.communicationManager.notifyComponentSelected(selected, true);
1577
+ });
1498
1578
  this.eventHandlers = new EventHandlers(
1499
1579
  () => this.isActive,
1500
1580
  this.componentMatcher,
@@ -1528,6 +1608,7 @@
1528
1608
  * Disable the design mode interactions
1529
1609
  */
1530
1610
  disable() {
1611
+ this.flushBoxRefresh();
1531
1612
  this.isActive = false;
1532
1613
  this.eventHandlers.clearAll();
1533
1614
  this.interceptOverlay.unmount();
@@ -1603,20 +1684,46 @@
1603
1684
  * the source location is read from the currently selected element.
1604
1685
  */
1605
1686
  applyStyleChange(property, value, sourceLocation) {
1687
+ const name = property.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`).replace(/^webkit-/, "-webkit-");
1606
1688
  for (const el of this.resolveTargets(sourceLocation)) {
1607
- el.style[property] = value;
1689
+ const style = el.style;
1690
+ if (typeof style.setProperty === "function") {
1691
+ const priority = style.getPropertyPriority(name);
1692
+ const sides = Object.hasOwn(BOX_DIMENSION_LONGHANDS, property) ? BOX_DIMENSION_LONGHANDS[property] : void 0;
1693
+ const importantSides = !priority ? sides?.map((side) => side.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)).filter((side) => style.getPropertyPriority(side) === "important") : void 0;
1694
+ style.setProperty(name, value, priority);
1695
+ for (const side of importantSides ?? []) {
1696
+ const sideValue = style.getPropertyValue(side);
1697
+ if (sideValue) style.setProperty(side, sideValue, "important");
1698
+ }
1699
+ } else {
1700
+ style[property] = value;
1701
+ }
1608
1702
  }
1609
1703
  this.overlayManager.reposition();
1610
- if (value === "" || MEASURED_TYPOGRAPHY_PROPERTIES.has(property)) {
1704
+ if (MEASURED_BOX_PROPERTIES.has(property)) {
1705
+ if (this.boxRefreshFrame === null && this.eventHandlers.getSelectedElement()) {
1706
+ this.boxRefreshFrame = requestAnimationFrame(() => this.flushBoxRefresh());
1707
+ }
1708
+ } else if (value === "" || MEASURED_TYPOGRAPHY_PROPERTIES.has(property) || REMEASURE_TRIGGER_PROPERTIES.has(property)) {
1611
1709
  const selected = this.eventHandlers.getSelectedElement();
1612
1710
  if (selected) this.communicationManager.notifyComponentSelected(selected, true);
1613
1711
  }
1614
1712
  }
1713
+ flushBoxRefresh() {
1714
+ if (this.boxRefreshFrame === null) return;
1715
+ cancelAnimationFrame(this.boxRefreshFrame);
1716
+ this.boxRefreshFrame = null;
1717
+ const selected = this.eventHandlers.getSelectedElement();
1718
+ if (selected) this.communicationManager.notifyComponentSelected(selected, true);
1719
+ }
1615
1720
  applyTextChange(text, sourceLocation) {
1616
1721
  for (const el of this.resolveTargets(sourceLocation)) {
1617
1722
  el.textContent = text;
1618
1723
  }
1619
1724
  this.overlayManager.reposition();
1725
+ const selected = this.eventHandlers.getSelectedElement();
1726
+ if (selected) this.communicationManager.notifyComponentSelected(selected, true);
1620
1727
  }
1621
1728
  /**
1622
1729
  * Apply attribute changes to all elements at the given source location whose
@@ -1647,6 +1754,7 @@
1647
1754
  * Cleanup and remove event listeners
1648
1755
  */
1649
1756
  destroy() {
1757
+ this.flushBoxRefresh();
1650
1758
  this.interceptOverlay.unmount();
1651
1759
  this.overlayManager.unmountOverlay();
1652
1760
  this.eventHandlers.clearAll();
@@ -1654,68 +1762,70 @@
1654
1762
  };
1655
1763
 
1656
1764
  // src/runtime/interactions/index.ts
1657
- var interactions = new InteractionsController(true);
1658
- if (typeof document !== "undefined") {
1659
- if (document.readyState === "loading") {
1660
- document.addEventListener("DOMContentLoaded", () => {
1765
+ if (typeof window === "undefined" || !window.__uiDesignMode__) {
1766
+ const interactions = new InteractionsController(true);
1767
+ if (typeof document !== "undefined") {
1768
+ if (document.readyState === "loading") {
1769
+ document.addEventListener("DOMContentLoaded", () => {
1770
+ interactions.initialize();
1771
+ });
1772
+ } else {
1661
1773
  interactions.initialize();
1662
- });
1663
- } else {
1664
- interactions.initialize();
1665
- }
1666
- }
1667
- if (typeof window !== "undefined") {
1668
- const win = window;
1669
- win.__uiDesignMode__ = {
1670
- getVersion() {
1671
- return UI_DESIGN_MODE_VERSION;
1672
- }
1673
- };
1674
- window.enableInteractions = function(workspaceRoots = []) {
1675
- interactions.enable(workspaceRoots);
1676
- };
1677
- window.disableInteractions = function() {
1678
- interactions.disable();
1679
- };
1680
- window.addEventListener("message", function(event) {
1681
- const data = event.data;
1682
- const typed = data && typeof data === "object" ? data : null;
1683
- if (typed && typed.type === MSG_STYLE_CHANGE) {
1684
- interactions.applyStyleChange(
1685
- String(typed.property ?? ""),
1686
- String(typed.value ?? ""),
1687
- parseSourceLocation(typed.sourceLocation)
1688
- );
1689
- }
1690
- if (typed && typed.type === MSG_TEXT_CHANGE) {
1691
- interactions.applyTextChange(
1692
- String(typed.text ?? ""),
1693
- parseSourceLocation(typed.sourceLocation)
1694
- );
1695
1774
  }
1696
- if (typed && typed.type === MSG_MEDIA_CHANGE) {
1697
- const tag = typeof typed.tag === "string" ? typed.tag : "";
1698
- const rawAttributes = typed.attributes && typeof typed.attributes === "object" ? typed.attributes : {};
1699
- const attributes = {};
1700
- for (const [key, raw] of Object.entries(rawAttributes)) {
1701
- attributes[key] = raw === void 0 ? void 0 : String(raw);
1775
+ }
1776
+ if (typeof window !== "undefined") {
1777
+ const win = window;
1778
+ win.__uiDesignMode__ = {
1779
+ getVersion() {
1780
+ return UI_DESIGN_MODE_VERSION;
1702
1781
  }
1703
- if (tag) {
1704
- interactions.applyMediaChange(tag, attributes, parseSourceLocation(typed.sourceLocation));
1782
+ };
1783
+ window.enableInteractions = function(workspaceRoots = []) {
1784
+ interactions.enable(workspaceRoots);
1785
+ };
1786
+ window.disableInteractions = function() {
1787
+ interactions.disable();
1788
+ };
1789
+ window.addEventListener("message", function(event) {
1790
+ const data = event.data;
1791
+ const typed = data && typeof data === "object" ? data : null;
1792
+ if (typed && typed.type === MSG_STYLE_CHANGE) {
1793
+ interactions.applyStyleChange(
1794
+ String(typed.property ?? ""),
1795
+ String(typed.value ?? ""),
1796
+ parseSourceLocation(typed.sourceLocation)
1797
+ );
1705
1798
  }
1706
- }
1707
- if (typed && typed.type === MSG_ENABLE_INTERACTIONS) {
1708
- const roots = Array.isArray(typed.workspaceRoots) ? typed.workspaceRoots.filter((r) => typeof r === "string") : [];
1709
- window.enableInteractions?.(roots);
1710
- }
1711
- if (typed && typed.type === MSG_DISABLE_INTERACTIONS) {
1712
- window.disableInteractions?.();
1713
- }
1714
- if (typed && typed.type === MSG_SELECT_ELEMENT) {
1715
- const tag = typeof typed.tag === "string" ? typed.tag : void 0;
1716
- interactions.selectByIdentity(parseSourceLocation(typed.sourceLocation), tag);
1717
- }
1718
- });
1799
+ if (typed && typed.type === MSG_TEXT_CHANGE) {
1800
+ interactions.applyTextChange(
1801
+ String(typed.text ?? ""),
1802
+ parseSourceLocation(typed.sourceLocation)
1803
+ );
1804
+ }
1805
+ if (typed && typed.type === MSG_MEDIA_CHANGE) {
1806
+ const tag = typeof typed.tag === "string" ? typed.tag : "";
1807
+ const rawAttributes = typed.attributes && typeof typed.attributes === "object" ? typed.attributes : {};
1808
+ const attributes = {};
1809
+ for (const [key, raw] of Object.entries(rawAttributes)) {
1810
+ attributes[key] = raw === void 0 ? void 0 : String(raw);
1811
+ }
1812
+ if (tag) {
1813
+ interactions.applyMediaChange(tag, attributes, parseSourceLocation(typed.sourceLocation));
1814
+ }
1815
+ }
1816
+ if (typed && typed.type === MSG_ENABLE_INTERACTIONS) {
1817
+ const roots = Array.isArray(typed.workspaceRoots) ? typed.workspaceRoots.filter((r) => typeof r === "string") : [];
1818
+ window.enableInteractions?.(roots);
1819
+ }
1820
+ if (typed && typed.type === MSG_DISABLE_INTERACTIONS) {
1821
+ window.disableInteractions?.();
1822
+ }
1823
+ if (typed && typed.type === MSG_SELECT_ELEMENT) {
1824
+ const tag = typeof typed.tag === "string" ? typed.tag : void 0;
1825
+ interactions.selectByIdentity(parseSourceLocation(typed.sourceLocation), tag);
1826
+ }
1827
+ });
1828
+ }
1719
1829
  }
1720
1830
  })();
1721
1831
 
@@ -1,10 +1,10 @@
1
- import { MediaInfo } from '../../protocol.cjs';
1
+ import { MediaInfo } from '../../protocol/index.cjs';
2
2
  import { getElementStyles } from './utils/cssUtils.cjs';
3
3
  export type { MediaInfo };
4
4
  /**
5
5
  * Editable media metadata for a selected element, or `undefined` if none (the
6
6
  * caller then omits `media` from the payload):
7
- * 1. `<img>` → `img` variant (raw `src`/`alt`/`width`/`height`).
7
+ * 1. `<img>` → `img` variant (raw `src`/`alt`, plus their source kinds when stamped).
8
8
  * 2. Any other element painting a `background-image` `url()` layer →
9
9
  * `background-image` variant. Read inline-if-set-else-computed, matching the
10
10
  * Background Color editor; gradient-only backgrounds have no `url()`, so none.
@@ -1,10 +1,10 @@
1
- import { MediaInfo } from '../../protocol.js';
1
+ import { MediaInfo } from '../../protocol/index.js';
2
2
  import { getElementStyles } from './utils/cssUtils.js';
3
3
  export type { MediaInfo };
4
4
  /**
5
5
  * Editable media metadata for a selected element, or `undefined` if none (the
6
6
  * caller then omits `media` from the payload):
7
- * 1. `<img>` → `img` variant (raw `src`/`alt`/`width`/`height`).
7
+ * 1. `<img>` → `img` variant (raw `src`/`alt`, plus their source kinds when stamped).
8
8
  * 2. Any other element painting a `background-image` `url()` layer →
9
9
  * `background-image` variant. Read inline-if-set-else-computed, matching the
10
10
  * Background Color editor; gradient-only backgrounds have no `url()`, so none.
@@ -1 +1 @@
1
- {"version":3,"file":"communicationManager.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/communicationManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAMN,KAAK,SAAS,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAcpD,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,WAAW,EACpB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GAC1C,SAAS,GAAG,SAAS,CAkBvB;AAED,qBAAa,oBAAoB;;IAKhC;;;OAGG;IACH,uBAAuB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI;IAsD3E;;;;;OAKG;IACH,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAyBnF;;OAEG;IACH,4BAA4B,IAAI,IAAI;CAmBpC"}
1
+ {"version":3,"file":"communicationManager.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/communicationManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAQN,KAAK,SAAS,EAEd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAcpD,YAAY,EAAE,SAAS,EAAE,CAAC;AAkB1B;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,WAAW,EACpB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GAC1C,SAAS,GAAG,SAAS,CAsBvB;AAED,qBAAa,oBAAoB;;IAKhC;;;OAGG;IACH,uBAAuB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI;IAuD3E;;;;;OAKG;IACH,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAyBnF;;OAEG;IACH,4BAA4B,IAAI,IAAI;CAmBpC"}
@@ -17,7 +17,7 @@ interface EditableManagerLike {
17
17
  removeEditable: (element: HTMLElement) => void;
18
18
  }
19
19
  interface CommunicationManagerLike {
20
- notifyComponentSelected: (element: HTMLElement) => void;
20
+ notifyComponentSelected: (element: HTMLElement, styleRefresh?: boolean) => void;
21
21
  }
22
22
  export declare class EventHandlers {
23
23
  private isInteractionsActive;
@@ -17,7 +17,7 @@ interface EditableManagerLike {
17
17
  removeEditable: (element: HTMLElement) => void;
18
18
  }
19
19
  interface CommunicationManagerLike {
20
- notifyComponentSelected: (element: HTMLElement) => void;
20
+ notifyComponentSelected: (element: HTMLElement, styleRefresh?: boolean) => void;
21
21
  }
22
22
  export declare class EventHandlers {
23
23
  private isInteractionsActive;
@@ -1 +1 @@
1
- {"version":3,"file":"eventHandlers.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/eventHandlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,UAAU,oBAAoB;IAC7B,wBAAwB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAC;CACtE;AAED,UAAU,kBAAkB;IAC3B,iBAAiB,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IACrD,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,cAAc,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAClD,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,UAAU,mBAAmB;IAC5B,kBAAkB,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACnD,cAAc,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC/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9
  private eventHandlers;
10
10
  private interceptOverlay;
11
+ private boxRefreshFrame;
11
12
  constructor(enabled?: boolean);
12
13
  /**
13
14
  * Initialize the design mode interactions
@@ -63,6 +64,7 @@ export declare class InteractionsController {
63
64
  * the source location is read from the currently selected element.
64
65
  */
65
66
  applyStyleChange(property: string, value: string, sourceLocation?: SourceLocation): void;
67
+ private flushBoxRefresh;
66
68
  applyTextChange(text: string, sourceLocation?: SourceLocation): void;
67
69
  /**
68
70
  * Apply attribute changes to all elements at the given source location whose
@@ -8,6 +8,7 @@ export declare class InteractionsController {
8
8
  private editableManager;
9
9
  private eventHandlers;
10
10
  private interceptOverlay;
11
+ private boxRefreshFrame;
11
12
  constructor(enabled?: boolean);
12
13
  /**
13
14
  * Initialize the design mode interactions
@@ -63,6 +64,7 @@ export declare class InteractionsController {
63
64
  * the source location is read from the currently selected element.
64
65
  */
65
66
  applyStyleChange(property: string, value: string, sourceLocation?: SourceLocation): void;
67
+ private flushBoxRefresh;
66
68
  applyTextChange(text: string, sourceLocation?: SourceLocation): void;
67
69
  /**
68
70
  * Apply attribute changes to all elements at the given source location whose
@@ -1 +1 @@
1
- {"version":3,"file":"interactionsController.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/interactionsController.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,OAAO,EAIN,KAAK,cAAc,EACnB,MAAM,qBAAqB,CAAC;AA6C7B,qBAAa,sBAAsB;IAClC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAAU;IAE1B,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,OAAO,UAAO;IA2E1B;;OAEG;IACH,UAAU,IAAI,IAAI;IAalB;;;;OAIG;IACH,MAAM,CAAC,cAAc,GAAE,SAAS,MAAM,EAAO,GAAG,IAAI;IAMpD;;OAEG;IACH,OAAO,IAAI,IAAI;IAMf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,gBAAgB,CAAC,cAAc,CAAC,EAAE,cAAc,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO;IAoCxE,OAAO,CAAC,cAAc;IAWtB;;;;;OAKG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI;IAgBxF,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI;IAOpE;;;;;;;;;;;;;;OAcG;IACH,gBAAgB,CACf,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC9C,cAAc,CAAC,EAAE,cAAc,GAC7B,IAAI;IAWP;;OAEG;IACH,OAAO,IAAI,IAAI;CAKf"}
1
+ {"version":3,"file":"interactionsController.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/interactionsController.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,EAIN,KAAK,cAAc,EACnB,MAAM,qBAAqB,CAAC;AAoD7B,qBAAa,sBAAsB;IAClC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAAU;IAE1B,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,eAAe,CAAuB;gBAElC,OAAO,UAAO;IA6E1B;;OAEG;IACH,UAAU,IAAI,IAAI;IAalB;;;;OAIG;IACH,MAAM,CAAC,cAAc,GAAE,SAAS,MAAM,EAAO,GAAG,IAAI;IAMpD;;OAEG;IACH,OAAO,IAAI,IAAI;IAOf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,gBAAgB,CAAC,cAAc,CAAC,EAAE,cAAc,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO;IAoCxE,OAAO,CAAC,cAAc;IAWtB;;;;;OAKG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI;IAgDxF,OAAO,CAAC,eAAe;IAQvB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI;IASpE;;;;;;;;;;;;;;OAcG;IACH,gBAAgB,CACf,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC9C,cAAc,CAAC,EAAE,cAAc,GAC7B,IAAI;IAWP;;OAEG;IACH,OAAO,IAAI,IAAI;CAMf"}
@@ -0,0 +1,4 @@
1
+ import { ComponentData } from '../../protocol/index.cjs';
2
+ /** Derive editor applicability from rendered content and element semantics. */
3
+ export declare function getPropertyEditorCapabilities(element: Element): NonNullable<ComponentData["propertyEditorCapabilities"]>;
4
+ //# sourceMappingURL=propertyEditorCapabilities.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { ComponentData } from '../../protocol/index.js';
2
+ /** Derive editor applicability from rendered content and element semantics. */
3
+ export declare function getPropertyEditorCapabilities(element: Element): NonNullable<ComponentData["propertyEditorCapabilities"]>;
4
+ //# sourceMappingURL=propertyEditorCapabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propertyEditorCapabilities.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/propertyEditorCapabilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQpD,+EAA+E;AAC/E,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,OAAO,GACd,WAAW,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC,CA+D1D"}
@@ -1,8 +1,4 @@
1
- /**
2
- * Copyright (c) 2026, Salesforce, Inc.,
3
- * All rights reserved.
4
- * For full license text, see the LICENSE.txt file
5
- */
1
+ import { BOX_DIMENSION_LONGHANDS } from '../../../protocol/index.cjs';
6
2
  /**
7
3
  * Style value with both inline and computed values.
8
4
  * - inline: the raw value from element.style (what was explicitly set via
@@ -16,7 +12,7 @@ interface StyleValue {
16
12
  /**
17
13
  * Complete element styles snapshot
18
14
  */
19
- interface ElementStyles {
15
+ interface ElementStyles extends Record<BoxLonghand, StyleValue> {
20
16
  width: StyleValue;
21
17
  minWidth: StyleValue;
22
18
  maxWidth: StyleValue;
@@ -40,7 +36,6 @@ interface ElementStyles {
40
36
  * from an unrelated decorative background-image on a text element.
41
37
  */
42
38
  backgroundClip: StyleValue;
43
- borderWidth: StyleValue;
44
39
  borderStyle: StyleValue;
45
40
  borderColor: StyleValue;
46
41
  /**
@@ -70,6 +65,7 @@ interface ElementStyles {
70
65
  textDecoration: StyleValue;
71
66
  textTransform: StyleValue;
72
67
  }
68
+ type BoxLonghand = (typeof BOX_DIMENSION_LONGHANDS)[keyof typeof BOX_DIMENSION_LONGHANDS][number];
73
69
  /**
74
70
  * Get all style values relevant to UI controls for an element.
75
71
  * Each property returns { inline, computed } where inline is the raw
@@ -1,8 +1,4 @@
1
- /**
2
- * Copyright (c) 2026, Salesforce, Inc.,
3
- * All rights reserved.
4
- * For full license text, see the LICENSE.txt file
5
- */
1
+ import { BOX_DIMENSION_LONGHANDS } from '../../../protocol/index.js';
6
2
  /**
7
3
  * Style value with both inline and computed values.
8
4
  * - inline: the raw value from element.style (what was explicitly set via
@@ -16,7 +12,7 @@ interface StyleValue {
16
12
  /**
17
13
  * Complete element styles snapshot
18
14
  */
19
- interface ElementStyles {
15
+ interface ElementStyles extends Record<BoxLonghand, StyleValue> {
20
16
  width: StyleValue;
21
17
  minWidth: StyleValue;
22
18
  maxWidth: StyleValue;
@@ -40,7 +36,6 @@ interface ElementStyles {
40
36
  * from an unrelated decorative background-image on a text element.
41
37
  */
42
38
  backgroundClip: StyleValue;
43
- borderWidth: StyleValue;
44
39
  borderStyle: StyleValue;
45
40
  borderColor: StyleValue;
46
41
  /**
@@ -70,6 +65,7 @@ interface ElementStyles {
70
65
  textDecoration: StyleValue;
71
66
  textTransform: StyleValue;
72
67
  }
68
+ type BoxLonghand = (typeof BOX_DIMENSION_LONGHANDS)[keyof typeof BOX_DIMENSION_LONGHANDS][number];
73
69
  /**
74
70
  * Get all style values relevant to UI controls for an element.
75
71
  * Each property returns { inline, computed } where inline is the raw
@@ -1 +1 @@
1
- {"version":3,"file":"cssUtils.d.ts","sourceRoot":"","sources":["../../../../src/runtime/interactions/utils/cssUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,UAAU,UAAU;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACjB;AAID;;GAEG;AACH,UAAU,aAAa;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,EAAE,UAAU,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,UAAU,CAAC;IACtB,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,UAAU,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,eAAe,EAAE,UAAU,CAAC;IAC5B;;;;OAIG;IACH,eAAe,EAAE,UAAU,CAAC;IAC5B;;;;;OAKG;IACH,cAAc,EAAE,UAAU,CAAC;IAC3B,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE,U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G;IACH,eAAe,EAAE,UAAU,CAAC;IAC5B;;;;;OAKG;IACH,cAAc,EAAE,UAAU,CAAC;IAC3B,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE,UAAU,CAAC;IACxB;;;;;OAKG;IACH,iBAAiB,EAAE,UAAU,CAAC;IAC9B,YAAY,EAAE,UAAU,CAAC;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB;;;;;;OAMG;IACH,mBAAmB,EAAE,UAAU,CAAC;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,UAAU,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,UAAU,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,UAAU,CAAC;IAC1B,SAAS,EAAE,UAAU,CAAC;IACtB,cAAc,EAAE,UAAU,CAAC;IAC3B,aAAa,EAAE,UAAU,CAAC;CAC1B;AAED,KAAK,WAAW,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElG;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAgFhG"}
@@ -1,4 +1,4 @@
1
- import { SourceLocation } from '../../../protocol.cjs';
1
+ import { SourceLocation } from '../../../protocol/index.cjs';
2
2
  export type { SourceLocation };
3
3
  /**
4
4
  * Extract source location information from data attributes.