@salesforce/ui-design-mode 11.31.6 → 11.31.8
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/authoring/react/index.js +2 -2
- package/dist/authoring/web-component/index.js +3 -3
- package/dist/protocol/editableElementTags.cjs +2 -1
- package/dist/protocol/editableElementTags.d.cts +6 -0
- package/dist/protocol/editableElementTags.d.ts +6 -0
- package/dist/protocol/editableElementTags.d.ts.map +1 -1
- package/dist/protocol/editableElementTags.js +2 -1
- package/dist/protocol/version.cjs +1 -1
- package/dist/protocol/version.js +1 -1
- package/dist/runtime/design-mode-interactions.js +53 -4
- package/dist/runtime/interactions/overlayManager.d.cts +21 -0
- package/dist/runtime/interactions/overlayManager.d.ts +21 -0
- package/dist/runtime/interactions/overlayManager.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
* panel (which shows the inline-edit hint for them) so the two stay in lockstep.
|
|
10
10
|
*
|
|
11
11
|
* Compared against `element.tagName`, which the DOM always reports uppercase.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: `DIV` is a generic container, but being on this list does NOT make every
|
|
14
|
+
* `<div>` editable — the runtime additionally requires `data-text-type === "static"`
|
|
15
|
+
* (a single pure-text child). A `<div>` wrapping other elements is `element`/`mixed`
|
|
16
|
+
* and stays non-editable. So membership here only unlocks the text-only-`<div>` case,
|
|
17
|
+
* matching the semantics already applied to `P`/`SPAN`.
|
|
12
18
|
*/
|
|
13
19
|
export declare const EDITABLE_ELEMENT_TAGS: readonly string[];
|
|
14
20
|
//# sourceMappingURL=editableElementTags.d.ts.map
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
* panel (which shows the inline-edit hint for them) so the two stay in lockstep.
|
|
10
10
|
*
|
|
11
11
|
* Compared against `element.tagName`, which the DOM always reports uppercase.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: `DIV` is a generic container, but being on this list does NOT make every
|
|
14
|
+
* `<div>` editable — the runtime additionally requires `data-text-type === "static"`
|
|
15
|
+
* (a single pure-text child). A `<div>` wrapping other elements is `element`/`mixed`
|
|
16
|
+
* and stays non-editable. So membership here only unlocks the text-only-`<div>` case,
|
|
17
|
+
* matching the semantics already applied to `P`/`SPAN`.
|
|
12
18
|
*/
|
|
13
19
|
export declare const EDITABLE_ELEMENT_TAGS: readonly string[];
|
|
14
20
|
//# sourceMappingURL=editableElementTags.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editableElementTags.d.ts","sourceRoot":"","sources":["../../src/protocol/editableElementTags.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"editableElementTags.d.ts","sourceRoot":"","sources":["../../src/protocol/editableElementTags.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAalD,CAAC"}
|
package/dist/protocol/version.js
CHANGED
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
"SPAN",
|
|
38
38
|
"A",
|
|
39
39
|
"BUTTON",
|
|
40
|
-
"LABEL"
|
|
40
|
+
"LABEL",
|
|
41
|
+
"DIV"
|
|
41
42
|
];
|
|
42
43
|
|
|
43
44
|
// src/protocol/version.ts
|
|
44
|
-
var UI_DESIGN_MODE_VERSION = "11.31.
|
|
45
|
+
var UI_DESIGN_MODE_VERSION = "11.31.8";
|
|
45
46
|
|
|
46
47
|
// src/runtime/interactions/utils/sourceUtils.ts
|
|
47
48
|
function parseRequiredInt(value) {
|
|
@@ -790,8 +791,56 @@
|
|
|
790
791
|
_isOffscreen(rect) {
|
|
791
792
|
return rect.bottom < 0 || rect.right < 0 || rect.top > window.innerHeight || rect.left > window.innerWidth;
|
|
792
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* The element's visible extent: its layout box (`getBoundingClientRect`)
|
|
796
|
+
* grown vertically to cover the ink rects of its text content.
|
|
797
|
+
*
|
|
798
|
+
* A `line-height` below 1 collapses the layout box shorter than the glyphs it
|
|
799
|
+
* paints, so a border sized to the layout box alone cuts through the text (and
|
|
800
|
+
* shifts when the box changes on edit-mode focus). Growing the top/bottom to
|
|
801
|
+
* the text ink keeps the border wrapping the glyphs in every state. When
|
|
802
|
+
* `line-height >= 1` the ink sits inside the box vertically, so the extent
|
|
803
|
+
* equals the layout box and nothing changes.
|
|
804
|
+
*
|
|
805
|
+
* Only the vertical axis is unioned. `Range.getClientRects()` reports text
|
|
806
|
+
* geometry that ignores paint-time clipping and off-screen placement, so
|
|
807
|
+
* growing horizontally would over-size the border for truncated text
|
|
808
|
+
* (`overflow:hidden` + ellipsis reports the full un-clipped width) and
|
|
809
|
+
* image-replacement text (`text-indent:-9999px` reports ink far off-screen).
|
|
810
|
+
* The layout box is the correct horizontal bound in every case. Falls back to
|
|
811
|
+
* the layout box where Range layout is unavailable (no text node, or a
|
|
812
|
+
* non-layout environment).
|
|
813
|
+
*/
|
|
814
|
+
_visibleRect(el) {
|
|
815
|
+
const box = el.getBoundingClientRect();
|
|
816
|
+
let top = box.top;
|
|
817
|
+
let bottom = box.bottom;
|
|
818
|
+
try {
|
|
819
|
+
const range = el.ownerDocument.createRange();
|
|
820
|
+
range.selectNodeContents(el);
|
|
821
|
+
for (const r of Array.from(range.getClientRects())) {
|
|
822
|
+
if (r.width === 0 && r.height === 0) {
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
top = Math.min(top, r.top);
|
|
826
|
+
bottom = Math.max(bottom, r.bottom);
|
|
827
|
+
}
|
|
828
|
+
} catch {
|
|
829
|
+
}
|
|
830
|
+
return {
|
|
831
|
+
top,
|
|
832
|
+
left: box.left,
|
|
833
|
+
right: box.right,
|
|
834
|
+
bottom,
|
|
835
|
+
width: box.width,
|
|
836
|
+
height: bottom - top,
|
|
837
|
+
x: box.left,
|
|
838
|
+
y: top,
|
|
839
|
+
toJSON: () => ({})
|
|
840
|
+
};
|
|
841
|
+
}
|
|
793
842
|
_positionBox(box, el) {
|
|
794
|
-
const rect =
|
|
843
|
+
const rect = this._visibleRect(el);
|
|
795
844
|
if (this._isOffscreen(rect)) {
|
|
796
845
|
box.style.display = "none";
|
|
797
846
|
return;
|
|
@@ -803,7 +852,7 @@
|
|
|
803
852
|
box.style.height = `${rect.height + BORDER_INSET * 2}px`;
|
|
804
853
|
}
|
|
805
854
|
_positionTab(tab, el) {
|
|
806
|
-
const rect =
|
|
855
|
+
const rect = this._visibleRect(el);
|
|
807
856
|
if (this._isOffscreen(rect)) {
|
|
808
857
|
tab.style.display = "none";
|
|
809
858
|
return;
|
|
@@ -46,6 +46,27 @@ export declare class OverlayManager {
|
|
|
46
46
|
private _clearLayer;
|
|
47
47
|
/** True when the element's rect is fully outside the viewport (scrolled away). */
|
|
48
48
|
private _isOffscreen;
|
|
49
|
+
/**
|
|
50
|
+
* The element's visible extent: its layout box (`getBoundingClientRect`)
|
|
51
|
+
* grown vertically to cover the ink rects of its text content.
|
|
52
|
+
*
|
|
53
|
+
* A `line-height` below 1 collapses the layout box shorter than the glyphs it
|
|
54
|
+
* paints, so a border sized to the layout box alone cuts through the text (and
|
|
55
|
+
* shifts when the box changes on edit-mode focus). Growing the top/bottom to
|
|
56
|
+
* the text ink keeps the border wrapping the glyphs in every state. When
|
|
57
|
+
* `line-height >= 1` the ink sits inside the box vertically, so the extent
|
|
58
|
+
* equals the layout box and nothing changes.
|
|
59
|
+
*
|
|
60
|
+
* Only the vertical axis is unioned. `Range.getClientRects()` reports text
|
|
61
|
+
* geometry that ignores paint-time clipping and off-screen placement, so
|
|
62
|
+
* growing horizontally would over-size the border for truncated text
|
|
63
|
+
* (`overflow:hidden` + ellipsis reports the full un-clipped width) and
|
|
64
|
+
* image-replacement text (`text-indent:-9999px` reports ink far off-screen).
|
|
65
|
+
* The layout box is the correct horizontal bound in every case. Falls back to
|
|
66
|
+
* the layout box where Range layout is unavailable (no text node, or a
|
|
67
|
+
* non-layout environment).
|
|
68
|
+
*/
|
|
69
|
+
private _visibleRect;
|
|
49
70
|
private _positionBox;
|
|
50
71
|
private _positionTab;
|
|
51
72
|
/**
|
|
@@ -46,6 +46,27 @@ export declare class OverlayManager {
|
|
|
46
46
|
private _clearLayer;
|
|
47
47
|
/** True when the element's rect is fully outside the viewport (scrolled away). */
|
|
48
48
|
private _isOffscreen;
|
|
49
|
+
/**
|
|
50
|
+
* The element's visible extent: its layout box (`getBoundingClientRect`)
|
|
51
|
+
* grown vertically to cover the ink rects of its text content.
|
|
52
|
+
*
|
|
53
|
+
* A `line-height` below 1 collapses the layout box shorter than the glyphs it
|
|
54
|
+
* paints, so a border sized to the layout box alone cuts through the text (and
|
|
55
|
+
* shifts when the box changes on edit-mode focus). Growing the top/bottom to
|
|
56
|
+
* the text ink keeps the border wrapping the glyphs in every state. When
|
|
57
|
+
* `line-height >= 1` the ink sits inside the box vertically, so the extent
|
|
58
|
+
* equals the layout box and nothing changes.
|
|
59
|
+
*
|
|
60
|
+
* Only the vertical axis is unioned. `Range.getClientRects()` reports text
|
|
61
|
+
* geometry that ignores paint-time clipping and off-screen placement, so
|
|
62
|
+
* growing horizontally would over-size the border for truncated text
|
|
63
|
+
* (`overflow:hidden` + ellipsis reports the full un-clipped width) and
|
|
64
|
+
* image-replacement text (`text-indent:-9999px` reports ink far off-screen).
|
|
65
|
+
* The layout box is the correct horizontal bound in every case. Falls back to
|
|
66
|
+
* the layout box where Range layout is unavailable (no text node, or a
|
|
67
|
+
* non-layout environment).
|
|
68
|
+
*/
|
|
69
|
+
private _visibleRect;
|
|
49
70
|
private _positionBox;
|
|
50
71
|
private _positionTab;
|
|
51
72
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlayManager.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/overlayManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuCH,qBAAa,cAAc;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IA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ACH,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;IAapB,OAAO,CAAC,YAAY;IA6BpB;;;;OAIG;IACH,UAAU,IAAI,IAAI;IAIlB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,WAAW;CAQnB"}
|
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.31.
|
|
4
|
+
"version": "11.31.8",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|