@superblocksteam/library 2.0.6-next.38 → 2.0.6-next.39
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/{allPaths-BhIhuhyr.js → allPaths-DrkZM5UN.js} +2 -2
- package/dist/{allPaths-BhIhuhyr.js.map → allPaths-DrkZM5UN.js.map} +1 -1
- package/dist/{allPaths-C-GS61ep.js → allPaths-DtYnQ-yV.js} +2 -2
- package/dist/{allPaths-C-GS61ep.js.map → allPaths-DtYnQ-yV.js.map} +1 -1
- package/dist/{allPathsLoader-okzKZ8ZK.js → allPathsLoader-Bt-mJXJw.js} +3 -3
- package/dist/{allPathsLoader-yqClhllT.js.map → allPathsLoader-Bt-mJXJw.js.map} +1 -1
- package/dist/{allPathsLoader-yqClhllT.js → allPathsLoader-rDsLNp7q.js} +3 -3
- package/dist/{allPathsLoader-okzKZ8ZK.js.map → allPathsLoader-rDsLNp7q.js.map} +1 -1
- package/dist/{devtools-consolidated-BQ5Eme4s.js → devtools-consolidated-DaYe-zkb.js} +2 -2
- package/dist/{devtools-consolidated-BQ5Eme4s.js.map → devtools-consolidated-DaYe-zkb.js.map} +1 -1
- package/dist/{index-CQOHJMew.js → index-D9O95zsr.js} +126 -64
- package/dist/{index-CQOHJMew.js.map → index-D9O95zsr.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{splitPathsBySizeLoader-DOjF2YSu.js → splitPathsBySizeLoader-DCl0XfAP.js} +2 -2
- package/dist/{splitPathsBySizeLoader-DOjF2YSu.js.map → splitPathsBySizeLoader-DCl0XfAP.js.map} +1 -1
- package/dist/{splitPathsBySizeLoader-BV47-5ws.js → splitPathsBySizeLoader-HDsWhSbE.js} +2 -2
- package/dist/{splitPathsBySizeLoader-BV47-5ws.js.map → splitPathsBySizeLoader-HDsWhSbE.js.map} +1 -1
- package/dist-types/edit-mode/dnd/utils.d.ts +4 -0
- package/dist-types/lib/user-facing/components/icon/index.d.ts +0 -2
- package/dist-types/lib/user-facing/components/icon/props.d.ts +0 -2
- package/package.json +2 -2
|
@@ -83526,7 +83526,7 @@ function registerStores(stores) {
|
|
|
83526
83526
|
internalStores = { ...internalStores, ...stores };
|
|
83527
83527
|
if (SUPPORTED_MODES.includes("production")) {
|
|
83528
83528
|
if (Object.keys(internalStores).length === Object.keys(stores).length) {
|
|
83529
|
-
import("./devtools-consolidated-
|
|
83529
|
+
import("./devtools-consolidated-DaYe-zkb.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
|
|
83530
83530
|
setRegisteredStores(internalStores);
|
|
83531
83531
|
initializeCustomDevTools();
|
|
83532
83532
|
}).catch((error) => {
|
|
@@ -83539,7 +83539,7 @@ function registerStores(stores) {
|
|
|
83539
83539
|
}
|
|
83540
83540
|
}
|
|
83541
83541
|
const DevToolsInternal = React__default.lazy(() => {
|
|
83542
|
-
return import("./devtools-consolidated-
|
|
83542
|
+
return import("./devtools-consolidated-DaYe-zkb.js").then((module2) => ({
|
|
83543
83543
|
default: module2.CustomDevTools
|
|
83544
83544
|
}));
|
|
83545
83545
|
});
|
|
@@ -87518,8 +87518,9 @@ class RuntimeEntitiesManager {
|
|
|
87518
87518
|
const { width, height, marginLeft, marginTop } = pendingResize;
|
|
87519
87519
|
merged.props = {
|
|
87520
87520
|
...merged.props || {},
|
|
87521
|
-
...width && { width },
|
|
87522
|
-
...height && { height },
|
|
87521
|
+
...width && merged.type !== "SbIcon" && { width },
|
|
87522
|
+
...height && merged.type !== "SbIcon" && { height },
|
|
87523
|
+
...width && merged.type === "SbIcon" && { size: width },
|
|
87523
87524
|
...marginLeft && { marginLeft },
|
|
87524
87525
|
...marginTop && { marginTop }
|
|
87525
87526
|
};
|
|
@@ -87897,22 +87898,27 @@ function shouldWrapInSectionAndColumn(type5, parentType) {
|
|
|
87897
87898
|
return parentType === "SbPage" && type5 !== "SbSection" || parentType === "SbSection" && type5 !== "SbColumn";
|
|
87898
87899
|
}
|
|
87899
87900
|
const filterSafeStackDimensionProperties = (existingProps) => {
|
|
87900
|
-
const { width, height } = existingProps;
|
|
87901
|
+
const { width, height, size: size2 } = existingProps;
|
|
87901
87902
|
let safeHeight;
|
|
87902
87903
|
let safeWidth;
|
|
87904
|
+
let safeSize;
|
|
87903
87905
|
if ((height == null ? void 0 : height.mode) === "px" || (height == null ? void 0 : height.mode) === "fit" || (height == null ? void 0 : height.mode) === "fill") {
|
|
87904
87906
|
safeHeight = Property.Dimension(height);
|
|
87905
87907
|
}
|
|
87906
87908
|
if ((width == null ? void 0 : width.mode) === "px" || (width == null ? void 0 : width.mode) === "fit" || (width == null ? void 0 : width.mode) === "fill") {
|
|
87907
87909
|
safeWidth = Property.Dimension(width);
|
|
87908
87910
|
}
|
|
87911
|
+
if ((size2 == null ? void 0 : size2.mode) === "px") {
|
|
87912
|
+
safeSize = Property.Dimension(size2);
|
|
87913
|
+
}
|
|
87909
87914
|
return {
|
|
87910
87915
|
width: safeWidth,
|
|
87911
|
-
height: safeHeight
|
|
87916
|
+
height: safeHeight,
|
|
87917
|
+
size: safeSize
|
|
87912
87918
|
};
|
|
87913
87919
|
};
|
|
87914
87920
|
const filterSafeGridDimensionProperties = (existingProps) => {
|
|
87915
|
-
const { width, height } = existingProps;
|
|
87921
|
+
const { width, height, size: size2 } = existingProps;
|
|
87916
87922
|
const safeDimensions = {};
|
|
87917
87923
|
if ((height == null ? void 0 : height.mode) === "rows" || (height == null ? void 0 : height.mode) === "fit") {
|
|
87918
87924
|
safeDimensions.height = Property.Dimension(height);
|
|
@@ -87920,6 +87926,9 @@ const filterSafeGridDimensionProperties = (existingProps) => {
|
|
|
87920
87926
|
if ((width == null ? void 0 : width.mode) === "columns") {
|
|
87921
87927
|
safeDimensions.width = Property.Dimension(width);
|
|
87922
87928
|
}
|
|
87929
|
+
if ((size2 == null ? void 0 : size2.mode) === "columns") {
|
|
87930
|
+
safeDimensions.size = Property.Dimension(size2);
|
|
87931
|
+
}
|
|
87923
87932
|
return safeDimensions;
|
|
87924
87933
|
};
|
|
87925
87934
|
const defaultSizeForComponent = (componentType, isFreeform, draggedDimensions) => {
|
|
@@ -88879,7 +88888,7 @@ class ResizingManager {
|
|
|
88879
88888
|
return this._activeResizes.get(selectedSourceId);
|
|
88880
88889
|
}
|
|
88881
88890
|
startResizing(dragStartX, dragStartY, instanceId, position2) {
|
|
88882
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k, _l2, _m2, _n2, _o2;
|
|
88891
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k, _l2, _m2, _n2, _o2, _p2, _q;
|
|
88883
88892
|
const widget = (_a2 = this.root.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetMeta(
|
|
88884
88893
|
instanceId
|
|
88885
88894
|
);
|
|
@@ -88918,10 +88927,10 @@ class ResizingManager {
|
|
|
88918
88927
|
dragStartX,
|
|
88919
88928
|
dragStartY,
|
|
88920
88929
|
start: {
|
|
88921
|
-
width: ((_i = (_h2 = widget == null ? void 0 : widget.props) == null ? void 0 : _h2.width) == null ? void 0 : _i.value) ?? 0,
|
|
88922
|
-
height: ((
|
|
88923
|
-
marginLeft: ((
|
|
88924
|
-
marginTop: ((
|
|
88930
|
+
width: ((_i = (_h2 = widget == null ? void 0 : widget.props) == null ? void 0 : _h2.width) == null ? void 0 : _i.value) ?? ((_k = (_j = widget == null ? void 0 : widget.props) == null ? void 0 : _j.size) == null ? void 0 : _k.value) ?? 0,
|
|
88931
|
+
height: ((_m2 = (_l2 = widget == null ? void 0 : widget.props) == null ? void 0 : _l2.height) == null ? void 0 : _m2.value) ?? 0,
|
|
88932
|
+
marginLeft: ((_o2 = (_n2 = widget == null ? void 0 : widget.props) == null ? void 0 : _n2.marginLeft) == null ? void 0 : _o2.value) ?? 0,
|
|
88933
|
+
marginTop: ((_q = (_p2 = widget == null ? void 0 : widget.props) == null ? void 0 : _p2.marginTop) == null ? void 0 : _q.value) ?? 0
|
|
88925
88934
|
},
|
|
88926
88935
|
resizedPosition: position2,
|
|
88927
88936
|
widthToUpdate: null,
|
|
@@ -89059,21 +89068,34 @@ class ResizingManager {
|
|
|
89059
89068
|
});
|
|
89060
89069
|
}
|
|
89061
89070
|
resizeWidget(currentX, currentY, instanceId, canResizeWidth2, canResizeHeight2) {
|
|
89062
|
-
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
89071
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k;
|
|
89063
89072
|
const sourceId = (_a2 = this.root.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetSourceId(
|
|
89064
89073
|
instanceId
|
|
89065
89074
|
);
|
|
89075
|
+
const type5 = (_b2 = this.root.editStore) == null ? void 0 : _b2.runtimeEntitiesManager.getEditorWidgetType(
|
|
89076
|
+
instanceId
|
|
89077
|
+
);
|
|
89066
89078
|
const resizeState = sourceId && this._activeResizes.get(sourceId);
|
|
89067
89079
|
if (!resizeState) {
|
|
89068
89080
|
return;
|
|
89069
89081
|
}
|
|
89070
|
-
const widget = (
|
|
89082
|
+
const widget = (_c2 = this.root.editStore) == null ? void 0 : _c2.runtimeEntitiesManager.getEditorWidgetMeta(
|
|
89071
89083
|
instanceId
|
|
89072
89084
|
);
|
|
89073
|
-
|
|
89074
|
-
const heightMode = (
|
|
89085
|
+
let widthMode = (_e2 = (_d2 = widget == null ? void 0 : widget.props) == null ? void 0 : _d2.width) == null ? void 0 : _e2.mode;
|
|
89086
|
+
const heightMode = (_g2 = (_f2 = widget == null ? void 0 : widget.props) == null ? void 0 : _f2.height) == null ? void 0 : _g2.mode;
|
|
89075
89087
|
const deltaX = currentX - resizeState.dragStartX;
|
|
89076
89088
|
const deltaY = currentY - resizeState.dragStartY;
|
|
89089
|
+
if (type5 === "SbIcon") {
|
|
89090
|
+
widthMode = (_i = (_h2 = widget == null ? void 0 : widget.props) == null ? void 0 : _h2.size) == null ? void 0 : _i.mode;
|
|
89091
|
+
if (!widthMode) {
|
|
89092
|
+
const parentInstanceId = widget == null ? void 0 : widget.parentInstanceId;
|
|
89093
|
+
const parentWidget = parentInstanceId && ((_j = this.root.editStore) == null ? void 0 : _j.runtimeEntitiesManager.getEditorWidgetMeta(
|
|
89094
|
+
parentInstanceId
|
|
89095
|
+
));
|
|
89096
|
+
widthMode = ((_k = parentWidget == null ? void 0 : parentWidget.props) == null ? void 0 : _k.layout) === "freeform" ? "columns" : "px";
|
|
89097
|
+
}
|
|
89098
|
+
}
|
|
89077
89099
|
const updateWidth = this.handleResizeDimension({
|
|
89078
89100
|
resizeState,
|
|
89079
89101
|
dimension: "width",
|
|
@@ -89128,22 +89150,28 @@ class ResizingManager {
|
|
|
89128
89150
|
);
|
|
89129
89151
|
}
|
|
89130
89152
|
applyResize(instanceId) {
|
|
89131
|
-
var _a2, _b2;
|
|
89153
|
+
var _a2, _b2, _c2;
|
|
89132
89154
|
const sourceId = (_a2 = this.root.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetSourceId(
|
|
89133
89155
|
instanceId
|
|
89134
89156
|
);
|
|
89157
|
+
const type5 = (_b2 = this.root.editStore) == null ? void 0 : _b2.runtimeEntitiesManager.getEditorWidgetType(
|
|
89158
|
+
instanceId
|
|
89159
|
+
);
|
|
89135
89160
|
const resizeState = sourceId && this._activeResizes.get(sourceId);
|
|
89136
89161
|
if (!resizeState) {
|
|
89137
89162
|
return;
|
|
89138
89163
|
}
|
|
89139
89164
|
resizeState.isApplyingResize = true;
|
|
89140
89165
|
const properties2 = {
|
|
89141
|
-
...resizeState.heightToUpdate && {
|
|
89166
|
+
...resizeState.heightToUpdate && type5 !== "SbIcon" && {
|
|
89142
89167
|
height: Property.Dimension(resizeState.heightToUpdate)
|
|
89143
89168
|
},
|
|
89144
|
-
...resizeState.widthToUpdate && {
|
|
89169
|
+
...resizeState.widthToUpdate && type5 !== "SbIcon" && {
|
|
89145
89170
|
width: Property.Dimension(resizeState.widthToUpdate)
|
|
89146
89171
|
},
|
|
89172
|
+
...resizeState.widthToUpdate && type5 === "SbIcon" && {
|
|
89173
|
+
size: Property.Dimension(resizeState.widthToUpdate)
|
|
89174
|
+
},
|
|
89147
89175
|
...resizeState.marginLeftToUpdate && {
|
|
89148
89176
|
marginLeft: Property.Dimension(resizeState.marginLeftToUpdate)
|
|
89149
89177
|
},
|
|
@@ -89152,7 +89180,7 @@ class ResizingManager {
|
|
|
89152
89180
|
}
|
|
89153
89181
|
};
|
|
89154
89182
|
if (Object.keys(properties2).length > 0) {
|
|
89155
|
-
(
|
|
89183
|
+
(_c2 = this.root.editStore) == null ? void 0 : _c2.operationManager.setWidgetProperties({
|
|
89156
89184
|
sourceId: resizeState.sourceId,
|
|
89157
89185
|
properties: properties2,
|
|
89158
89186
|
callback: () => {
|
|
@@ -91163,14 +91191,14 @@ function getLoaderFn$1(options) {
|
|
|
91163
91191
|
if (!(loader === "all")) return [3, 3];
|
|
91164
91192
|
return [4, import(
|
|
91165
91193
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
91166
|
-
"./allPathsLoader-
|
|
91194
|
+
"./allPathsLoader-Bt-mJXJw.js"
|
|
91167
91195
|
)];
|
|
91168
91196
|
case 2:
|
|
91169
91197
|
return [2, _b2.sent().allPathsLoader];
|
|
91170
91198
|
case 3:
|
|
91171
91199
|
return [4, import(
|
|
91172
91200
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
91173
|
-
"./splitPathsBySizeLoader-
|
|
91201
|
+
"./splitPathsBySizeLoader-HDsWhSbE.js"
|
|
91174
91202
|
)];
|
|
91175
91203
|
case 4:
|
|
91176
91204
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -112263,7 +112291,8 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
112263
112291
|
sourceId: child.sourceId,
|
|
112264
112292
|
element: (_b3 = (_a3 = editStore2.interactionLayerManager.getSourceIdElements(
|
|
112265
112293
|
child.sourceId
|
|
112266
|
-
)) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.element
|
|
112294
|
+
)) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.element,
|
|
112295
|
+
type: child.type
|
|
112267
112296
|
};
|
|
112268
112297
|
}).filter(({ element }) => !!element)) ?? [];
|
|
112269
112298
|
if ("layout" in updates && updates.layout.value === "freeform") {
|
|
@@ -112275,7 +112304,7 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
112275
112304
|
return baseUpdate;
|
|
112276
112305
|
}
|
|
112277
112306
|
const updatesBySourceId = {};
|
|
112278
|
-
elements.forEach(({ sourceId: sourceId2, element, currentProps }) => {
|
|
112307
|
+
elements.forEach(({ sourceId: sourceId2, element, currentProps, type: type5 }) => {
|
|
112279
112308
|
const elementRect = element.getBoundingClientRect();
|
|
112280
112309
|
const gridPosition = editStore2.ui.dnd.grid.getGridPositionInfo({
|
|
112281
112310
|
positionRect: elementRect,
|
|
@@ -112288,8 +112317,14 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
112288
112317
|
props: {
|
|
112289
112318
|
marginTop: Property.Dimension(Dim.row(gridPosition.yGU)),
|
|
112290
112319
|
marginLeft: Property.Dimension(Dim.col(gridPosition.xGU)),
|
|
112291
|
-
|
|
112292
|
-
|
|
112320
|
+
...type5 === "SbIcon" ? {
|
|
112321
|
+
size: Property.Dimension(Dim.col(gridPosition.widthGU))
|
|
112322
|
+
} : {
|
|
112323
|
+
width: Property.Dimension(
|
|
112324
|
+
Dim.col(gridPosition.widthGU)
|
|
112325
|
+
),
|
|
112326
|
+
height: isHeightFit ? Property.Dimension(Dim.fit()) : Property.Dimension(Dim.row(gridPosition.heightGU))
|
|
112327
|
+
}
|
|
112293
112328
|
},
|
|
112294
112329
|
meta: {}
|
|
112295
112330
|
};
|
|
@@ -112306,7 +112341,7 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
112306
112341
|
};
|
|
112307
112342
|
} else if (previousProps.layout === "freeform" && (newProps.layout === "vertical" || newProps.layout === "horizontal")) {
|
|
112308
112343
|
const updatesBySourceId = {};
|
|
112309
|
-
elements.forEach(({ sourceId: sourceId2, element, currentProps }) => {
|
|
112344
|
+
elements.forEach(({ sourceId: sourceId2, element, currentProps, type: type5 }) => {
|
|
112310
112345
|
const elementRect = element.getBoundingClientRect();
|
|
112311
112346
|
const isHeightFit = isDimension(currentProps == null ? void 0 : currentProps.height) && currentProps.height.mode === "fit";
|
|
112312
112347
|
updatesBySourceId[sourceId2] = {
|
|
@@ -112314,8 +112349,12 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
112314
112349
|
marginTop: Property.Static(""),
|
|
112315
112350
|
marginLeft: Property.Static(""),
|
|
112316
112351
|
constraintTop: Property.Static(""),
|
|
112317
|
-
|
|
112318
|
-
|
|
112352
|
+
...type5 === "SbIcon" ? {
|
|
112353
|
+
size: Property.Dimension(Dim.px(elementRect.width))
|
|
112354
|
+
} : {
|
|
112355
|
+
width: Property.Dimension(Dim.px(elementRect.width)),
|
|
112356
|
+
height: isHeightFit ? Property.Dimension(Dim.fit()) : Property.Dimension(Dim.px(elementRect.height))
|
|
112357
|
+
}
|
|
112319
112358
|
},
|
|
112320
112359
|
meta: {}
|
|
112321
112360
|
};
|
|
@@ -117046,6 +117085,7 @@ const handleGridDropWithinCanvas = (params) => {
|
|
|
117046
117085
|
const editStore2 = getEditStore();
|
|
117047
117086
|
const dropSourceId = editStore2.runtimeEntitiesManager.getEditorWidgetSourceId(dropTargetId);
|
|
117048
117087
|
const draggedSourceId = editStore2.runtimeEntitiesManager.getEditorWidgetSourceId(draggedId);
|
|
117088
|
+
const draggedType = editStore2.runtimeEntitiesManager.getEditorWidgetType(draggedId);
|
|
117049
117089
|
if (!dropSourceId || !draggedSourceId) {
|
|
117050
117090
|
throw new Error(`Missing IDs: dragging ${draggedId} to ${dropTargetId}`);
|
|
117051
117091
|
}
|
|
@@ -117065,15 +117105,16 @@ const handleGridDropWithinCanvas = (params) => {
|
|
|
117065
117105
|
const droppedWidgetProps = (_a2 = editStore2.runtimeEntitiesManager.getEditorWidgetMeta(draggedId)) == null ? void 0 : _a2.props;
|
|
117066
117106
|
const safeExistingDimensions = filterSafeGridDimensionProperties({
|
|
117067
117107
|
width: droppedWidgetProps == null ? void 0 : droppedWidgetProps.width,
|
|
117068
|
-
height: droppedWidgetProps == null ? void 0 : droppedWidgetProps.height
|
|
117108
|
+
height: droppedWidgetProps == null ? void 0 : droppedWidgetProps.height,
|
|
117109
|
+
size: droppedWidgetProps == null ? void 0 : droppedWidgetProps.size
|
|
117069
117110
|
});
|
|
117070
117111
|
const width = safeExistingDimensions.width ?? Property.Dimension(Dim.col(droppedWidgetConstraints.width));
|
|
117071
117112
|
const height = safeExistingDimensions.height ?? Property.Dimension(Dim.rows(droppedWidgetConstraints.height));
|
|
117113
|
+
const size2 = safeExistingDimensions.size ?? Property.Dimension(Dim.col(droppedWidgetConstraints.width));
|
|
117072
117114
|
const propsToChange = droppedWidgetConstraints ? {
|
|
117073
117115
|
marginTop: Property.Dimension(Dim.row(droppedWidgetConstraints.top)),
|
|
117074
117116
|
marginLeft: Property.Dimension(Dim.col(droppedWidgetConstraints.left)),
|
|
117075
|
-
width,
|
|
117076
|
-
height,
|
|
117117
|
+
...draggedType === "SbIcon" ? { size: size2 } : { width, height },
|
|
117077
117118
|
constraintTop: Property.Expression(
|
|
117078
117119
|
JSON.stringify(droppedWidgetConstraints.constraintTop)
|
|
117079
117120
|
)
|
|
@@ -117139,13 +117180,18 @@ const handleGridDrop = async ({
|
|
|
117139
117180
|
});
|
|
117140
117181
|
}
|
|
117141
117182
|
};
|
|
117142
|
-
const mergeDroppedDimensions = (draggedProps, activeDragRect) => {
|
|
117183
|
+
const mergeDroppedDimensions = (draggedType, draggedProps, activeDragRect) => {
|
|
117143
117184
|
const safeExistingDimensions = filterSafeStackDimensionProperties({
|
|
117144
117185
|
width: draggedProps == null ? void 0 : draggedProps.width,
|
|
117145
|
-
height: draggedProps == null ? void 0 : draggedProps.height
|
|
117186
|
+
height: draggedProps == null ? void 0 : draggedProps.height,
|
|
117187
|
+
size: draggedProps == null ? void 0 : draggedProps.size
|
|
117146
117188
|
});
|
|
117147
117189
|
const width = safeExistingDimensions.width ?? ((activeDragRect == null ? void 0 : activeDragRect.width) ? Property.Dimension(Dim.px(activeDragRect.width)) : Property.Static(""));
|
|
117148
117190
|
const height = safeExistingDimensions.height ?? ((activeDragRect == null ? void 0 : activeDragRect.height) ? Property.Dimension(Dim.px(activeDragRect.height)) : Property.Static(""));
|
|
117191
|
+
if (draggedType === "SbIcon") {
|
|
117192
|
+
const size2 = safeExistingDimensions.size ?? ((activeDragRect == null ? void 0 : activeDragRect.height) ? Property.Dimension(Dim.px(activeDragRect.height)) : Property.Static(""));
|
|
117193
|
+
return { size: size2 };
|
|
117194
|
+
}
|
|
117149
117195
|
return {
|
|
117150
117196
|
width,
|
|
117151
117197
|
height
|
|
@@ -117198,7 +117244,7 @@ const handleStackDropWithinCanvas = (params) => {
|
|
|
117198
117244
|
marginTop: Property.Static(""),
|
|
117199
117245
|
marginLeft: Property.Static(""),
|
|
117200
117246
|
constraintTop: Property.Static(""),
|
|
117201
|
-
...mergeDroppedDimensions(draggedProps, activeDragRect)
|
|
117247
|
+
...mergeDroppedDimensions(draggedType, draggedProps, activeDragRect)
|
|
117202
117248
|
}
|
|
117203
117249
|
});
|
|
117204
117250
|
}
|
|
@@ -117241,7 +117287,7 @@ const dropComponentInWrappingSectionOrColumn = async (params) => {
|
|
|
117241
117287
|
marginTop: Property.Static(""),
|
|
117242
117288
|
marginLeft: Property.Static(""),
|
|
117243
117289
|
constraintTop: Property.Static(""),
|
|
117244
|
-
...mergeDroppedDimensions(draggedProps, activeDragRect)
|
|
117290
|
+
...mergeDroppedDimensions(dropTargetType, draggedProps, activeDragRect)
|
|
117245
117291
|
}
|
|
117246
117292
|
});
|
|
117247
117293
|
};
|
|
@@ -117784,10 +117830,17 @@ const canResizeHeight = (heightMode) => {
|
|
|
117784
117830
|
return heightMode === "px" || heightMode === "rows" || heightMode === "gridUnit";
|
|
117785
117831
|
};
|
|
117786
117832
|
const useResizeCapabilities = (instanceId) => {
|
|
117787
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
117833
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
117788
117834
|
const widget = (_a2 = rootStore.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetMeta(instanceId);
|
|
117789
|
-
|
|
117790
|
-
|
|
117835
|
+
if ((widget == null ? void 0 : widget.type) === "SbIcon") {
|
|
117836
|
+
const sizeMode = (_c2 = (_b2 = widget.props) == null ? void 0 : _b2.size) == null ? void 0 : _c2.mode;
|
|
117837
|
+
return {
|
|
117838
|
+
canResizeWidth: sizeMode != null && sizeMode !== "fit",
|
|
117839
|
+
canResizeHeight: false
|
|
117840
|
+
};
|
|
117841
|
+
}
|
|
117842
|
+
const widthMode = (_e2 = (_d2 = widget == null ? void 0 : widget.props) == null ? void 0 : _d2.width) == null ? void 0 : _e2.mode;
|
|
117843
|
+
const heightMode = (_g2 = (_f2 = widget == null ? void 0 : widget.props) == null ? void 0 : _f2.height) == null ? void 0 : _g2.mode;
|
|
117791
117844
|
return {
|
|
117792
117845
|
canResizeWidth: canResizeWidth(widthMode),
|
|
117793
117846
|
canResizeHeight: canResizeHeight(heightMode)
|
|
@@ -117812,7 +117865,9 @@ const HandlesWrapper = qe$1.div`
|
|
|
117812
117865
|
pointer-events: none;
|
|
117813
117866
|
`;
|
|
117814
117867
|
const InteractionRectHandles = (props2) => {
|
|
117868
|
+
var _a2;
|
|
117815
117869
|
const { instanceId, isDragging, selectionType } = props2;
|
|
117870
|
+
const type5 = (_a2 = rootStore.editStore) == null ? void 0 : _a2.runtimeEntitiesManager.getEditorWidgetType(instanceId);
|
|
117816
117871
|
const [showPopover, setShowPopover] = useState(null);
|
|
117817
117872
|
const { canResizeWidth: canResizeWidth2, canResizeHeight: canResizeHeight2 } = useResizeCapabilities(instanceId);
|
|
117818
117873
|
const timeoutRef = useRef(null);
|
|
@@ -117825,8 +117880,8 @@ const InteractionRectHandles = (props2) => {
|
|
|
117825
117880
|
}, []);
|
|
117826
117881
|
const throttledResizeWidget = useMemo$2(
|
|
117827
117882
|
() => lodashExports.throttle((e3) => {
|
|
117828
|
-
var
|
|
117829
|
-
(
|
|
117883
|
+
var _a3;
|
|
117884
|
+
(_a3 = rootStore.editStore) == null ? void 0 : _a3.ui.resizing.resizeWidget(
|
|
117830
117885
|
e3.clientX,
|
|
117831
117886
|
e3.clientY,
|
|
117832
117887
|
instanceId,
|
|
@@ -117843,14 +117898,14 @@ const InteractionRectHandles = (props2) => {
|
|
|
117843
117898
|
[throttledResizeWidget]
|
|
117844
117899
|
);
|
|
117845
117900
|
const handlePointerUp = useCallback(() => {
|
|
117846
|
-
var
|
|
117847
|
-
(
|
|
117901
|
+
var _a3;
|
|
117902
|
+
(_a3 = rootStore.editStore) == null ? void 0 : _a3.ui.resizing.applyResize(instanceId);
|
|
117848
117903
|
window.removeEventListener("pointermove", handlePointerMove);
|
|
117849
117904
|
window.removeEventListener("pointerup", handlePointerUp);
|
|
117850
117905
|
}, [handlePointerMove, instanceId]);
|
|
117851
117906
|
const handlePointerDown = useCallback(
|
|
117852
117907
|
(e3, position2) => {
|
|
117853
|
-
var
|
|
117908
|
+
var _a3;
|
|
117854
117909
|
e3.stopPropagation();
|
|
117855
117910
|
e3.preventDefault();
|
|
117856
117911
|
if (timeoutRef.current) {
|
|
@@ -117868,7 +117923,7 @@ const InteractionRectHandles = (props2) => {
|
|
|
117868
117923
|
return;
|
|
117869
117924
|
}
|
|
117870
117925
|
setShowPopover(null);
|
|
117871
|
-
(
|
|
117926
|
+
(_a3 = rootStore.editStore) == null ? void 0 : _a3.ui.resizing.startResizing(
|
|
117872
117927
|
e3.clientX,
|
|
117873
117928
|
e3.clientY,
|
|
117874
117929
|
instanceId,
|
|
@@ -117956,7 +118011,7 @@ const InteractionRectHandles = (props2) => {
|
|
|
117956
118011
|
}
|
|
117957
118012
|
}
|
|
117958
118013
|
},
|
|
117959
|
-
content: /* @__PURE__ */ jsxRuntimeExports.jsx(NotifierTooltipBody, { children: pos2 === "left" || pos2 === "right" ? "Width cannot be resized. Change width to pixel to enable manual resizing." : pos2 === "top" || pos2 === "bottom" ? "Height cannot be resized. Change height to pixel to enable manual resizing." : "" }),
|
|
118014
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsx(NotifierTooltipBody, { children: pos2 === "left" || pos2 === "right" ? "Width cannot be resized. Change width to pixel to enable manual resizing." : pos2 === "top" || pos2 === "bottom" ? type5 === "SbIcon" ? "Icons can be resized by changing its width." : "Height cannot be resized. Change height to pixel to enable manual resizing." : "" }),
|
|
117960
118015
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" } })
|
|
117961
118016
|
}
|
|
117962
118017
|
)
|
|
@@ -119972,7 +120027,7 @@ const getStackChildStyle = ({
|
|
|
119972
120027
|
parentWidth
|
|
119973
120028
|
}) => {
|
|
119974
120029
|
const height = (childProps == null ? void 0 : childProps.height) ?? Dim.fit();
|
|
119975
|
-
|
|
120030
|
+
let heightCss = (
|
|
119976
120031
|
// using 100% height when there is only one child and user's intention to set the child height as exact 100%, e.g. an image with large original height
|
|
119977
120032
|
// if parent height is fit-content, child height 100% will cause unexpected height if child is empty container
|
|
119978
120033
|
childCount === 1 && (height == null ? void 0 : height.mode) === "fill" && (parentHeight == null ? void 0 : parentHeight.mode) !== "fit" ? { height: "100%" } : dimToCSS(height, "height", primary === "height")
|
|
@@ -119980,7 +120035,11 @@ const getStackChildStyle = ({
|
|
|
119980
120035
|
const width = (childProps == null ? void 0 : childProps.width) ?? (["SbText", "SbButton", "SbCheckbox", "SbSwitch"].includes(
|
|
119981
120036
|
(childProps == null ? void 0 : childProps.type) ?? ""
|
|
119982
120037
|
) ? Dim.fit() : Dim.fill());
|
|
119983
|
-
|
|
120038
|
+
let widthCss = childCount === 1 && (width == null ? void 0 : width.mode) === "fill" && (parentWidth == null ? void 0 : parentWidth.mode) !== "fit" ? { width: "100%" } : dimToCSS(width, "width", primary === "width");
|
|
120039
|
+
if ((childProps == null ? void 0 : childProps.type) === "SbIcon") {
|
|
120040
|
+
heightCss = dimToCSS(Dim.fit(), "height", false);
|
|
120041
|
+
widthCss = dimToCSS(Dim.fit(), "width", false);
|
|
120042
|
+
}
|
|
119984
120043
|
const widthInPx = (width == null ? void 0 : width.mode) === "px";
|
|
119985
120044
|
const heightInPx = (height == null ? void 0 : height.mode) === "px";
|
|
119986
120045
|
const shouldNotShrink = widthInPx && primary === "width" || heightInPx && primary === "height";
|
|
@@ -120345,7 +120404,7 @@ const GridChild = observer(
|
|
|
120345
120404
|
const left2 = gridPositions[childProps.name].left;
|
|
120346
120405
|
const rows = gridPositions[childProps.name].height;
|
|
120347
120406
|
const columns = gridPositions[childProps.name].width;
|
|
120348
|
-
const Component3 = heightMode === "fit" ? MeasuredComponent : StaticComponent;
|
|
120407
|
+
const Component3 = heightMode === "fit" || childProps.sbType === "SbIcon" ? MeasuredComponent : StaticComponent;
|
|
120349
120408
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
120350
120409
|
"div",
|
|
120351
120410
|
{
|
|
@@ -120359,6 +120418,9 @@ const GridChild = observer(
|
|
|
120359
120418
|
Component3,
|
|
120360
120419
|
{
|
|
120361
120420
|
staticHeight: (((_b2 = childProps.height) == null ? void 0 : _b2.value) ?? 0) * rowHeight,
|
|
120421
|
+
style: childProps.sbType === "SbIcon" ? {
|
|
120422
|
+
aspectRatio: "1"
|
|
120423
|
+
} : void 0,
|
|
120362
120424
|
onHeightChanged: (height) => {
|
|
120363
120425
|
dispatchHeight({
|
|
120364
120426
|
type: "SET_HEIGHT",
|
|
@@ -120389,9 +120451,13 @@ const InternalGrid = observer(
|
|
|
120389
120451
|
value: bindingIdentifier.entityName,
|
|
120390
120452
|
isAnonymous: false
|
|
120391
120453
|
}) : null;
|
|
120454
|
+
const sbType = isSbComponent(child) ? child.type.sbType : void 0;
|
|
120392
120455
|
const marginTop = (entity == null ? void 0 : entity.marginTop) ?? (isDimension(child.props.marginTop) ? child.props.marginTop : void 0);
|
|
120393
120456
|
const marginLeft = (entity == null ? void 0 : entity.marginLeft) ?? (isDimension(child.props.marginLeft) ? child.props.marginLeft : void 0);
|
|
120394
|
-
|
|
120457
|
+
let width = (entity == null ? void 0 : entity.width) ?? (isDimension(child.props.width) ? child.props.width : void 0);
|
|
120458
|
+
if (sbType === "SbIcon") {
|
|
120459
|
+
width = (entity == null ? void 0 : entity.size) ?? (isDimension(child.props.size) ? child.props.size : void 0);
|
|
120460
|
+
}
|
|
120395
120461
|
const height = (entity == null ? void 0 : entity.height) ?? (isDimension(child.props.height) ? child.props.height : void 0);
|
|
120396
120462
|
const constraintTop = (entity == null ? void 0 : entity.constraintTop) ?? child.props.constraintTop;
|
|
120397
120463
|
const isVisible2 = (entity == null ? void 0 : entity.isVisible) ?? child.props.isVisible;
|
|
@@ -120403,7 +120469,7 @@ const InternalGrid = observer(
|
|
|
120403
120469
|
constraintTop,
|
|
120404
120470
|
name: (bindingIdentifier == null ? void 0 : bindingIdentifier.entityName) ?? child.props[WIDGET_SOURCE_ID_ATTRIBUTE],
|
|
120405
120471
|
// source ID as a fallback
|
|
120406
|
-
sbType
|
|
120472
|
+
sbType,
|
|
120407
120473
|
element: child
|
|
120408
120474
|
};
|
|
120409
120475
|
if (isVisible2 !== false || isEditing) {
|
|
@@ -145727,14 +145793,14 @@ function getLoaderFn(options) {
|
|
|
145727
145793
|
if (!(loader === "all")) return [3, 3];
|
|
145728
145794
|
return [4, import(
|
|
145729
145795
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
145730
|
-
"./allPathsLoader-
|
|
145796
|
+
"./allPathsLoader-rDsLNp7q.js"
|
|
145731
145797
|
)];
|
|
145732
145798
|
case 2:
|
|
145733
145799
|
return [2, _b2.sent().allPathsLoader];
|
|
145734
145800
|
case 3:
|
|
145735
145801
|
return [4, import(
|
|
145736
145802
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
145737
|
-
"./splitPathsBySizeLoader-
|
|
145803
|
+
"./splitPathsBySizeLoader-DCl0XfAP.js"
|
|
145738
145804
|
)];
|
|
145739
145805
|
case 4:
|
|
145740
145806
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -182527,13 +182593,7 @@ const propertiesDefinition$4 = {
|
|
|
182527
182593
|
size: Prop.dimension().readAndWrite().propertiesPanel({
|
|
182528
182594
|
label: "Size",
|
|
182529
182595
|
controlType: "WIDTH_DROPDOWN"
|
|
182530
|
-
}).default(Dim.
|
|
182531
|
-
width: Prop.dimension().readAndWrite().default(function() {
|
|
182532
|
-
return this.size;
|
|
182533
|
-
}),
|
|
182534
|
-
height: Prop.dimension().readAndWrite().default(function() {
|
|
182535
|
-
return this.size;
|
|
182536
|
-
})
|
|
182596
|
+
}).default(Dim.fit())
|
|
182537
182597
|
}).add(margin()).add(visible()),
|
|
182538
182598
|
appearance: Section.category(PropsPanelCategory.Appearance).children({
|
|
182539
182599
|
color: colorProp({
|
|
@@ -182559,7 +182619,7 @@ const SbIcon = registerSbComponent(
|
|
|
182559
182619
|
},
|
|
182560
182620
|
(props2) => {
|
|
182561
182621
|
const [isLoading, setIsLoading] = useState(false);
|
|
182562
|
-
const { icon, style: style2, color, onClick } = props2;
|
|
182622
|
+
const { icon, style: style2, color, size: size2, onClick } = props2;
|
|
182563
182623
|
const { style: passthroughStyle, ...passThroughProps } = usePassthroughProps(props2);
|
|
182564
182624
|
const inlineStyles = useMemo$2(() => {
|
|
182565
182625
|
const minWidthStyle = !icon ? {
|
|
@@ -182571,7 +182631,8 @@ const SbIcon = registerSbComponent(
|
|
|
182571
182631
|
...passthroughStyle,
|
|
182572
182632
|
color,
|
|
182573
182633
|
cursor: onClick ? "pointer" : "inherit",
|
|
182574
|
-
...style2
|
|
182634
|
+
...style2,
|
|
182635
|
+
height: "100%"
|
|
182575
182636
|
};
|
|
182576
182637
|
}, [style2, color, onClick, passthroughStyle, icon]);
|
|
182577
182638
|
const handleClick = useCallback(async () => {
|
|
@@ -182597,7 +182658,8 @@ const SbIcon = registerSbComponent(
|
|
|
182597
182658
|
disablePointerEvents: true,
|
|
182598
182659
|
iconName: icon,
|
|
182599
182660
|
color,
|
|
182600
|
-
fill:
|
|
182661
|
+
fill: (size2 == null ? void 0 : size2.mode) !== "px",
|
|
182662
|
+
size: (size2 == null ? void 0 : size2.mode) === "px" ? size2.value : void 0
|
|
182601
182663
|
}
|
|
182602
182664
|
)
|
|
182603
182665
|
}
|
|
@@ -197422,4 +197484,4 @@ export {
|
|
|
197422
197484
|
SbTimer as y,
|
|
197423
197485
|
SbApi as z
|
|
197424
197486
|
};
|
|
197425
|
-
//# sourceMappingURL=index-
|
|
197487
|
+
//# sourceMappingURL=index-D9O95zsr.js.map
|