@vectoriox/iox-builder 7.0.1 → 7.0.2
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.
|
@@ -5076,13 +5076,16 @@ class RenderDirective {
|
|
|
5076
5076
|
// template node is selectable/editable. Skip overlay registration + interaction
|
|
5077
5077
|
// wiring for them so they can't be hovered, selected, or edited on the canvas.
|
|
5078
5078
|
const isPreviewClone = !!node.__previewClone;
|
|
5079
|
+
// WRAPPER-COLLAPSE (opt-in via ioxDragSourceId): the HOST is the flex/grid item, so it carries
|
|
5080
|
+
// `iox-outer-{id}` (margin, width, grid placement) IN ADDITION to `iox-node-{id}` (visual) — one
|
|
5081
|
+
// element, like the engine. A display-only clone (a repeater row, a design specimen) is laid out
|
|
5082
|
+
// the same way: it only skips drag and selection below. Without the class a clone lost every
|
|
5083
|
+
// OUTER prop — its width, margin and grid placement — on the canvas alone.
|
|
5084
|
+
if (nativeEl && this.ioxDragSourceId != null && cssId)
|
|
5085
|
+
nativeEl.classList.add(`iox-outer-${cssId}`);
|
|
5079
5086
|
if (nativeEl && !isPreviewClone) {
|
|
5080
|
-
//
|
|
5081
|
-
// carries `iox-outer-{id}` (margin/width) IN ADDITION to `iox-node-{id}` (visual) — one
|
|
5082
|
-
// element, like the engine — and drag is registered on it (the wrapper is gone). The
|
|
5083
|
-
// StyleRegistry's split still works: both classes are on this one host.
|
|
5087
|
+
// Drag is registered on the collapsed host (the wrapper is gone).
|
|
5084
5088
|
if (this.ioxDragSourceId != null && cssId) {
|
|
5085
|
-
nativeEl.classList.add(`iox-outer-${cssId}`);
|
|
5086
5089
|
const sourceId = this.ioxDragSourceId;
|
|
5087
5090
|
this.dragEngine.registerDraggable(nativeEl, () => ({
|
|
5088
5091
|
type: 'internal',
|
|
@@ -10634,12 +10637,18 @@ function wearing(node, styleId) {
|
|
|
10634
10637
|
applyElementStyle(node, styleId);
|
|
10635
10638
|
return node;
|
|
10636
10639
|
}
|
|
10640
|
+
/** A Text node: a new Text wears `body` and the palette's 10px padding; a specimen's text sits flush. */
|
|
10637
10641
|
function text(content, createConfig, styleId, styles = {}) {
|
|
10638
10642
|
const node = textNode(content, createConfig);
|
|
10639
10643
|
if (styleId)
|
|
10640
10644
|
wearing(node, styleId);
|
|
10641
|
-
return styled(node, styles);
|
|
10645
|
+
return styled(node, { padding: '0', margin: '0', ...styles });
|
|
10642
10646
|
}
|
|
10647
|
+
/** A button's label takes the BUTTON's type (the style's size, weight, case, tracking) — not body's. */
|
|
10648
|
+
const BUTTON_LABEL = {
|
|
10649
|
+
color: 'inherit', fontFamily: 'inherit', fontSize: 'inherit', fontWeight: 'inherit', lineHeight: 'inherit',
|
|
10650
|
+
letterSpacing: 'inherit', textTransform: 'inherit',
|
|
10651
|
+
};
|
|
10643
10652
|
function withChildren(node, children) {
|
|
10644
10653
|
if (!node || children.some(c => !c))
|
|
10645
10654
|
return null;
|
|
@@ -10665,7 +10674,7 @@ function button(styleId, label, createConfig, styles = {}) {
|
|
|
10665
10674
|
return null;
|
|
10666
10675
|
setTrait(btn, 'tag', 'button');
|
|
10667
10676
|
styled(btn, styles);
|
|
10668
|
-
return withChildren(btn, [text(label, createConfig, undefined,
|
|
10677
|
+
return withChildren(btn, [text(label, createConfig, undefined, BUTTON_LABEL)]);
|
|
10669
10678
|
}
|
|
10670
10679
|
/** A Container sized by its content: the palette Container's 200px drop-zone min-height is canvas
|
|
10671
10680
|
* furniture, and a specimen has no drop zone. */
|