@salesforce/ui-design-mode 11.43.2 → 11.44.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.
package/dist/protocol/version.js
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
];
|
|
45
45
|
|
|
46
46
|
// src/protocol/version.ts
|
|
47
|
-
var UI_DESIGN_MODE_VERSION = "11.
|
|
47
|
+
var UI_DESIGN_MODE_VERSION = "11.44.0";
|
|
48
48
|
|
|
49
49
|
// src/runtime/interactions/utils/sourceUtils.ts
|
|
50
50
|
function parseRequiredInt(value) {
|
|
@@ -682,12 +682,15 @@
|
|
|
682
682
|
};
|
|
683
683
|
|
|
684
684
|
// src/runtime/interactions/overlayManager.ts
|
|
685
|
-
var BORDER_WIDTH = 2;
|
|
686
685
|
var TAB_HEIGHT_ESTIMATE = 18;
|
|
687
686
|
var OVERLAY_Z_INDEX = 2147483647;
|
|
688
|
-
var
|
|
689
|
-
var
|
|
690
|
-
var
|
|
687
|
+
var COLOR_ACCENT = "#2864f6";
|
|
688
|
+
var COLOR_HOVER_FILL = "rgba(40, 100, 246, 0.08)";
|
|
689
|
+
var BORDER_WIDTH = { hover: 1, selected: 2 };
|
|
690
|
+
var BORDER_INSET = {
|
|
691
|
+
hover: 0,
|
|
692
|
+
selected: Math.round(BORDER_WIDTH.selected / 2)
|
|
693
|
+
};
|
|
691
694
|
var raf = typeof requestAnimationFrame === "function" ? (cb) => requestAnimationFrame(cb) : (cb) => setTimeout(cb, 16);
|
|
692
695
|
var OverlayManager = class {
|
|
693
696
|
constructor() {
|
|
@@ -752,8 +755,8 @@
|
|
|
752
755
|
pointer-events: none;
|
|
753
756
|
z-index: ${OVERLAY_Z_INDEX};
|
|
754
757
|
}
|
|
755
|
-
.design-mode-box.hover { border: ${BORDER_WIDTH}px solid ${
|
|
756
|
-
.design-mode-box.selected { border: ${BORDER_WIDTH}px solid ${
|
|
758
|
+
.design-mode-box.hover { border: ${BORDER_WIDTH.hover}px solid ${COLOR_ACCENT}; background: ${COLOR_HOVER_FILL}; }
|
|
759
|
+
.design-mode-box.selected { border: ${BORDER_WIDTH.selected}px solid ${COLOR_ACCENT}; }
|
|
757
760
|
.design-mode-tab {
|
|
758
761
|
position: fixed;
|
|
759
762
|
pointer-events: none;
|
|
@@ -766,8 +769,8 @@
|
|
|
766
769
|
padding: 2px 6px;
|
|
767
770
|
color: #fff;
|
|
768
771
|
}
|
|
769
|
-
.design-mode-tab.hover { background: ${
|
|
770
|
-
.design-mode-tab.selected { background: ${
|
|
772
|
+
.design-mode-tab.hover { background: ${COLOR_ACCENT}; }
|
|
773
|
+
.design-mode-tab.selected { background: ${COLOR_ACCENT}; }
|
|
771
774
|
`;
|
|
772
775
|
}
|
|
773
776
|
/**
|
|
@@ -811,8 +814,8 @@
|
|
|
811
814
|
this.shadow.appendChild(box);
|
|
812
815
|
this.shadow.appendChild(tab);
|
|
813
816
|
layer.entries.set(el, { box, tab });
|
|
814
|
-
this._positionBox(box, el);
|
|
815
|
-
this._positionTab(tab, el);
|
|
817
|
+
this._positionBox(box, el, kind);
|
|
818
|
+
this._positionTab(tab, el, kind);
|
|
816
819
|
}
|
|
817
820
|
}
|
|
818
821
|
_clearLayer(layer) {
|
|
@@ -874,34 +877,36 @@
|
|
|
874
877
|
toJSON: () => ({})
|
|
875
878
|
};
|
|
876
879
|
}
|
|
877
|
-
_positionBox(box, el) {
|
|
880
|
+
_positionBox(box, el, kind) {
|
|
878
881
|
const rect = this._visibleRect(el);
|
|
879
882
|
if (this._isOffscreen(rect)) {
|
|
880
883
|
box.style.display = "none";
|
|
881
884
|
return;
|
|
882
885
|
}
|
|
886
|
+
const inset = BORDER_INSET[kind];
|
|
883
887
|
box.style.display = "";
|
|
884
|
-
box.style.top = `${rect.top -
|
|
885
|
-
box.style.left = `${rect.left -
|
|
886
|
-
box.style.width = `${rect.width +
|
|
887
|
-
box.style.height = `${rect.height +
|
|
888
|
+
box.style.top = `${rect.top - inset}px`;
|
|
889
|
+
box.style.left = `${rect.left - inset}px`;
|
|
890
|
+
box.style.width = `${rect.width + inset * 2}px`;
|
|
891
|
+
box.style.height = `${rect.height + inset * 2}px`;
|
|
888
892
|
}
|
|
889
|
-
_positionTab(tab, el) {
|
|
893
|
+
_positionTab(tab, el, kind) {
|
|
890
894
|
const rect = this._visibleRect(el);
|
|
891
895
|
if (this._isOffscreen(rect)) {
|
|
892
896
|
tab.style.display = "none";
|
|
893
897
|
return;
|
|
894
898
|
}
|
|
899
|
+
const inset = BORDER_INSET[kind];
|
|
895
900
|
tab.style.display = "";
|
|
896
901
|
const tabHeight = tab.offsetHeight || TAB_HEIGHT_ESTIMATE;
|
|
897
|
-
const topAbove = rect.top -
|
|
902
|
+
const topAbove = rect.top - inset - tabHeight;
|
|
898
903
|
const flipBelow = topAbove < 0;
|
|
899
|
-
tab.style.top = flipBelow ? `${rect.bottom +
|
|
904
|
+
tab.style.top = flipBelow ? `${rect.bottom + inset}px` : `${topAbove}px`;
|
|
900
905
|
tab.style.borderRadius = flipBelow ? "0 0 2px 2px" : "2px 2px 0 0";
|
|
901
906
|
const tabWidth = tab.offsetWidth;
|
|
902
|
-
const leftAligned = rect.left -
|
|
907
|
+
const leftAligned = rect.left - inset;
|
|
903
908
|
if (tabWidth > 0 && leftAligned + tabWidth > window.innerWidth) {
|
|
904
|
-
tab.style.left = `${rect.right +
|
|
909
|
+
tab.style.left = `${rect.right + inset - tabWidth}px`;
|
|
905
910
|
} else {
|
|
906
911
|
tab.style.left = `${leftAligned}px`;
|
|
907
912
|
}
|
|
@@ -925,10 +930,14 @@
|
|
|
925
930
|
});
|
|
926
931
|
}
|
|
927
932
|
_reposition() {
|
|
928
|
-
|
|
933
|
+
const layers = [
|
|
934
|
+
[this.hover, "hover"],
|
|
935
|
+
[this.selected, "selected"]
|
|
936
|
+
];
|
|
937
|
+
for (const [layer, kind] of layers) {
|
|
929
938
|
for (const [el, { box, tab }] of layer.entries) {
|
|
930
|
-
this._positionBox(box, el);
|
|
931
|
-
this._positionTab(tab, el);
|
|
939
|
+
this._positionBox(box, el, kind);
|
|
940
|
+
this._positionTab(tab, el, kind);
|
|
932
941
|
}
|
|
933
942
|
}
|
|
934
943
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlayManager.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/overlayManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"overlayManager.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/overlayManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgEH,qBAAa,cAAc;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,mBAAmB,CAAU;IACrC,OAAO,CAAC,eAAe,CAAa;;IAYpC;;OAEG;IACH,YAAY,IAAI,IAAI;IAyBpB;;OAEG;IACH,cAAc,IAAI,IAAI;IAYtB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IA4BlB;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAIhD;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAI3B;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAI7C;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAIxB,OAAO,CAAC,YAAY;IA0BpB,OAAO,CAAC,WAAW;IAQnB,kFAAkF;IAClF,OAAO,CAAC,YAAY;IASpB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,YAAY;IAkCpB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,YAAY;IA8BpB;;;;OAIG;IACH,UAAU,IAAI,IAAI;IAIlB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,WAAW;CAYnB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/ui-design-mode",
|
|
3
3
|
"description": "Hybrid editor (design-mode) authoring UI, iframe runtime, source-locator, and protocol for Salesforce UI Bundles",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.44.0",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|