@superblocksteam/library 2.0.6-next.2 → 2.0.6-next.20
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-CO-aWzss.js → allPaths-C3m8JKL1.js} +2 -2
- package/dist/{allPaths-CO-aWzss.js.map → allPaths-C3m8JKL1.js.map} +1 -1
- package/dist/{allPaths-BtYOw5Ru.js → allPaths-IhoxI4IW.js} +2 -2
- package/dist/{allPaths-BtYOw5Ru.js.map → allPaths-IhoxI4IW.js.map} +1 -1
- package/dist/{allPathsLoader-B3Ii4JGL.js → allPathsLoader-5w2Df9lN.js} +3 -3
- package/dist/{allPathsLoader-KDCEbuYo.js.map → allPathsLoader-5w2Df9lN.js.map} +1 -1
- package/dist/{allPathsLoader-KDCEbuYo.js → allPathsLoader-BAwHv7e7.js} +3 -3
- package/dist/{allPathsLoader-B3Ii4JGL.js.map → allPathsLoader-BAwHv7e7.js.map} +1 -1
- package/dist/{devtools-consolidated-B1B3uBW_.js → devtools-consolidated-Eo3xuD81.js} +2 -2
- package/dist/{devtools-consolidated-B1B3uBW_.js.map → devtools-consolidated-Eo3xuD81.js.map} +1 -1
- package/dist/{index-kjgG33Rg.js → index-Bnnq0M9f.js} +246 -145
- package/dist/{index-kjgG33Rg.js.map → index-Bnnq0M9f.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{splitPathsBySizeLoader-VThmaq3t.js → splitPathsBySizeLoader-CUJrKt9p.js} +2 -2
- package/dist/{splitPathsBySizeLoader-VThmaq3t.js.map → splitPathsBySizeLoader-CUJrKt9p.js.map} +1 -1
- package/dist/{splitPathsBySizeLoader-Btq5cpt-.js → splitPathsBySizeLoader-DALk2KWT.js} +2 -2
- package/dist/{splitPathsBySizeLoader-Btq5cpt-.js.map → splitPathsBySizeLoader-DALk2KWT.js.map} +1 -1
- package/dist-types/edit-mode/iframe-wrappers.d.ts +1 -0
- package/dist-types/lib/internal-details/is-sb-component.d.ts +5 -1
- package/dist-types/lib/triggers/implementations/state/reset-state-var.d.ts +3 -3
- package/dist-types/lib/triggers/implementations/state/set-state-var.d.ts +3 -3
- package/dist-types/lib/triggers/implementations/timers/control-timer.d.ts +4 -3
- package/dist-types/lib/triggers/registry.d.ts +6 -6
- package/dist-types/lib/user-facing/build-manifest.d.ts +2 -0
- package/dist-types/lib/user-facing/components/grid/index.d.ts +7 -5
- package/dist-types/lib/user-facing/sb-event-flow.d.ts +2 -2
- package/package.json +3 -3
- package/dist-types/lib/user-facing/components/grid/utils.d.ts +0 -1
|
@@ -78418,7 +78418,7 @@ const ShowAlertTrigger = {
|
|
|
78418
78418
|
const ResetStateVarTrigger = {
|
|
78419
78419
|
type: TriggerStepType.RESET_STATE_VAR,
|
|
78420
78420
|
async execute(context2, step) {
|
|
78421
|
-
if (step.
|
|
78421
|
+
if (step.variable === void 0) {
|
|
78422
78422
|
return;
|
|
78423
78423
|
}
|
|
78424
78424
|
context2.rootStore.entityManager.runCode({
|
|
@@ -78426,22 +78426,22 @@ const ResetStateVarTrigger = {
|
|
|
78426
78426
|
name: context2.name,
|
|
78427
78427
|
func: () => {
|
|
78428
78428
|
var _a2;
|
|
78429
|
-
return (_a2 = step.
|
|
78429
|
+
return (_a2 = step.variable) == null ? void 0 : _a2.set(step.variable.defaultValue);
|
|
78430
78430
|
},
|
|
78431
78431
|
args: []
|
|
78432
78432
|
});
|
|
78433
78433
|
},
|
|
78434
|
-
create(
|
|
78434
|
+
create(variable) {
|
|
78435
78435
|
return {
|
|
78436
78436
|
type: TriggerStepType.RESET_STATE_VAR,
|
|
78437
|
-
|
|
78437
|
+
variable
|
|
78438
78438
|
};
|
|
78439
78439
|
}
|
|
78440
78440
|
};
|
|
78441
78441
|
const SetStateVarTrigger = {
|
|
78442
78442
|
type: TriggerStepType.SET_STATE_VAR,
|
|
78443
78443
|
async execute(context2, step) {
|
|
78444
|
-
if (step.
|
|
78444
|
+
if (step.variable === void 0) {
|
|
78445
78445
|
return;
|
|
78446
78446
|
}
|
|
78447
78447
|
const value = context2.rootStore.entityManager.computeValue({
|
|
@@ -78455,15 +78455,15 @@ const SetStateVarTrigger = {
|
|
|
78455
78455
|
func: (state, value2) => {
|
|
78456
78456
|
var _a2;
|
|
78457
78457
|
if (!state) return;
|
|
78458
|
-
(_a2 = step.
|
|
78458
|
+
(_a2 = step.variable) == null ? void 0 : _a2.set(value2);
|
|
78459
78459
|
},
|
|
78460
78460
|
args: [value]
|
|
78461
78461
|
});
|
|
78462
78462
|
},
|
|
78463
|
-
create(
|
|
78463
|
+
create(variable, value) {
|
|
78464
78464
|
return {
|
|
78465
78465
|
type: TriggerStepType.SET_STATE_VAR,
|
|
78466
|
-
|
|
78466
|
+
variable,
|
|
78467
78467
|
value
|
|
78468
78468
|
};
|
|
78469
78469
|
}
|
|
@@ -78471,12 +78471,14 @@ const SetStateVarTrigger = {
|
|
|
78471
78471
|
const ControlTimerTrigger = {
|
|
78472
78472
|
type: TriggerStepType.CONTROL_TIMER,
|
|
78473
78473
|
async execute(_context, step) {
|
|
78474
|
-
|
|
78474
|
+
if (step.timer) {
|
|
78475
|
+
step.timer[step.action]();
|
|
78476
|
+
}
|
|
78475
78477
|
},
|
|
78476
|
-
create(
|
|
78478
|
+
create(timer, action2) {
|
|
78477
78479
|
return {
|
|
78478
78480
|
type: TriggerStepType.CONTROL_TIMER,
|
|
78479
|
-
|
|
78481
|
+
timer,
|
|
78480
78482
|
action: action2
|
|
78481
78483
|
};
|
|
78482
78484
|
}
|
|
@@ -83504,7 +83506,7 @@ function registerStores(stores) {
|
|
|
83504
83506
|
internalStores = { ...internalStores, ...stores };
|
|
83505
83507
|
if (SUPPORTED_MODES.includes("production")) {
|
|
83506
83508
|
if (Object.keys(internalStores).length === Object.keys(stores).length) {
|
|
83507
|
-
import("./devtools-consolidated-
|
|
83509
|
+
import("./devtools-consolidated-Eo3xuD81.js").then(({ initializeCustomDevTools, setRegisteredStores }) => {
|
|
83508
83510
|
setRegisteredStores(internalStores);
|
|
83509
83511
|
initializeCustomDevTools();
|
|
83510
83512
|
}).catch((error) => {
|
|
@@ -83517,7 +83519,7 @@ function registerStores(stores) {
|
|
|
83517
83519
|
}
|
|
83518
83520
|
}
|
|
83519
83521
|
const DevToolsInternal = React__default.lazy(() => {
|
|
83520
|
-
return import("./devtools-consolidated-
|
|
83522
|
+
return import("./devtools-consolidated-Eo3xuD81.js").then((module2) => ({
|
|
83521
83523
|
default: module2.CustomDevTools
|
|
83522
83524
|
}));
|
|
83523
83525
|
});
|
|
@@ -83874,11 +83876,11 @@ class SbEventFlow {
|
|
|
83874
83876
|
controlModal(modal, action2) {
|
|
83875
83877
|
return this.addStep(EventRegistry.controlModal.create(modal, action2));
|
|
83876
83878
|
}
|
|
83877
|
-
static controlTimer(
|
|
83878
|
-
return SbEventFlow.start().controlTimer(
|
|
83879
|
+
static controlTimer(stateTimer, action2) {
|
|
83880
|
+
return SbEventFlow.start().controlTimer(stateTimer, action2);
|
|
83879
83881
|
}
|
|
83880
|
-
controlTimer(
|
|
83881
|
-
return this.addStep(EventRegistry.controlTimer.create(
|
|
83882
|
+
controlTimer(stateTimer, action2) {
|
|
83883
|
+
return this.addStep(EventRegistry.controlTimer.create(stateTimer, action2));
|
|
83882
83884
|
}
|
|
83883
83885
|
static runApis(apis, onSuccess, onError2) {
|
|
83884
83886
|
return SbEventFlow.start().runApis(apis, onSuccess, onError2);
|
|
@@ -86952,7 +86954,7 @@ function getPropertyValue$1({
|
|
|
86952
86954
|
return property.value;
|
|
86953
86955
|
}
|
|
86954
86956
|
function getSbEventFlow(step, scopeId) {
|
|
86955
|
-
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
86957
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
86956
86958
|
if (!isValidStepDef(step)) {
|
|
86957
86959
|
return void 0;
|
|
86958
86960
|
}
|
|
@@ -87025,27 +87027,33 @@ function getSbEventFlow(step, scopeId) {
|
|
|
87025
87027
|
return SbEventFlow.controlModal(modalEntity, step.direction);
|
|
87026
87028
|
}
|
|
87027
87029
|
case "controlTimer": {
|
|
87028
|
-
const
|
|
87030
|
+
const timerStep = step;
|
|
87031
|
+
if (!((_a2 = timerStep.timer) == null ? void 0 : _a2.name)) {
|
|
87032
|
+
return void 0;
|
|
87033
|
+
}
|
|
87034
|
+
const timerEntity = getEntity(timerStep.timer.name);
|
|
87029
87035
|
if (!timerEntity) return void 0;
|
|
87030
|
-
return SbEventFlow.controlTimer(
|
|
87036
|
+
return SbEventFlow.controlTimer(timerEntity, step.command ?? "start");
|
|
87031
87037
|
}
|
|
87032
87038
|
case "setStateVar": {
|
|
87033
|
-
const
|
|
87039
|
+
const variableStep = step;
|
|
87040
|
+
const stateEntity = getEntity((_b2 = variableStep.variable) == null ? void 0 : _b2.name);
|
|
87034
87041
|
if (!stateEntity) return void 0;
|
|
87035
|
-
const value = isPropertyInfo(
|
|
87036
|
-
property:
|
|
87042
|
+
const value = isPropertyInfo(variableStep.value) ? getPropertyValue$1({
|
|
87043
|
+
property: variableStep.value,
|
|
87037
87044
|
scopeId,
|
|
87038
|
-
name: getName((
|
|
87045
|
+
name: getName((_c2 = variableStep.variable) == null ? void 0 : _c2.name)
|
|
87039
87046
|
}) : step.value;
|
|
87040
87047
|
return SbEventFlow.setStateVar(stateEntity, value);
|
|
87041
87048
|
}
|
|
87042
87049
|
case "resetStateVar": {
|
|
87043
|
-
const
|
|
87050
|
+
const variableStep = step;
|
|
87051
|
+
const resetStateEntity = getEntity((_d2 = variableStep.variable) == null ? void 0 : _d2.name);
|
|
87044
87052
|
if (!resetStateEntity) return void 0;
|
|
87045
87053
|
return SbEventFlow.resetStateVar(resetStateEntity);
|
|
87046
87054
|
}
|
|
87047
87055
|
case "resetComponent": {
|
|
87048
|
-
const resetWidgetEntity = getEntity((
|
|
87056
|
+
const resetWidgetEntity = getEntity((_e2 = step.widget) == null ? void 0 : _e2.name);
|
|
87049
87057
|
if (!resetWidgetEntity) return void 0;
|
|
87050
87058
|
return SbEventFlow.resetComponent(
|
|
87051
87059
|
step.widget,
|
|
@@ -87054,7 +87062,7 @@ function getSbEventFlow(step, scopeId) {
|
|
|
87054
87062
|
);
|
|
87055
87063
|
}
|
|
87056
87064
|
case "setComponentProperty": {
|
|
87057
|
-
const setWidgetEntity = getEntity((
|
|
87065
|
+
const setWidgetEntity = getEntity((_f2 = step.widget) == null ? void 0 : _f2.name);
|
|
87058
87066
|
if (!setWidgetEntity) return void 0;
|
|
87059
87067
|
return SbEventFlow.setComponentProperty(
|
|
87060
87068
|
step.widget,
|
|
@@ -87072,7 +87080,7 @@ function getSbEventFlow(step, scopeId) {
|
|
|
87072
87080
|
case "setProfile":
|
|
87073
87081
|
return SbEventFlow.setProfile(step.profileId, step.profileAction);
|
|
87074
87082
|
case "triggerEvent":
|
|
87075
|
-
return SbEventFlow.triggerEvent((
|
|
87083
|
+
return SbEventFlow.triggerEvent((_g2 = step.event) == null ? void 0 : _g2.name, step.eventPayload);
|
|
87076
87084
|
default:
|
|
87077
87085
|
console.warn("Unhandled runtime step type", step.type);
|
|
87078
87086
|
return void 0;
|
|
@@ -91039,14 +91047,14 @@ function getLoaderFn$1(options) {
|
|
|
91039
91047
|
if (!(loader === "all")) return [3, 3];
|
|
91040
91048
|
return [4, import(
|
|
91041
91049
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
91042
|
-
"./allPathsLoader-
|
|
91050
|
+
"./allPathsLoader-5w2Df9lN.js"
|
|
91043
91051
|
)];
|
|
91044
91052
|
case 2:
|
|
91045
91053
|
return [2, _b2.sent().allPathsLoader];
|
|
91046
91054
|
case 3:
|
|
91047
91055
|
return [4, import(
|
|
91048
91056
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
91049
|
-
"./splitPathsBySizeLoader-
|
|
91057
|
+
"./splitPathsBySizeLoader-CUJrKt9p.js"
|
|
91050
91058
|
)];
|
|
91051
91059
|
case 4:
|
|
91052
91060
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -111848,28 +111856,52 @@ const size$2 = ({
|
|
|
111848
111856
|
controlType: "WIDTH_DROPDOWN",
|
|
111849
111857
|
defaultValue: defaults2 == null ? void 0 : defaults2.minWidth,
|
|
111850
111858
|
defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.minWidth,
|
|
111851
|
-
isVisible:
|
|
111859
|
+
isVisible: function(s3) {
|
|
111860
|
+
var _a2;
|
|
111861
|
+
const hideWidth = ((_a2 = this == null ? void 0 : this.width) == null ? void 0 : _a2.mode) === "px";
|
|
111862
|
+
return Boolean(
|
|
111863
|
+
(showMinWidth ? showMinWidth == null ? void 0 : showMinWidth.call(this, s3) : true) && !hideWidth
|
|
111864
|
+
);
|
|
111865
|
+
}
|
|
111852
111866
|
});
|
|
111853
111867
|
const maxWidthProperty = getSizeProp({
|
|
111854
111868
|
label: "Max width",
|
|
111855
111869
|
controlType: "WIDTH_DROPDOWN",
|
|
111856
111870
|
defaultValue: defaults2 == null ? void 0 : defaults2.maxWidth,
|
|
111857
111871
|
defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.maxWidth,
|
|
111858
|
-
isVisible:
|
|
111872
|
+
isVisible: function(s3) {
|
|
111873
|
+
var _a2;
|
|
111874
|
+
const hideWidth = ((_a2 = this == null ? void 0 : this.width) == null ? void 0 : _a2.mode) === "px";
|
|
111875
|
+
return Boolean(
|
|
111876
|
+
(showMaxWidth ? showMaxWidth == null ? void 0 : showMaxWidth.call(this, s3) : true) && !hideWidth
|
|
111877
|
+
);
|
|
111878
|
+
}
|
|
111859
111879
|
});
|
|
111860
111880
|
const minHeightProperty = getSizeProp({
|
|
111861
111881
|
label: "Min height",
|
|
111862
111882
|
controlType: "HEIGHT_DROPDOWN",
|
|
111863
111883
|
defaultValue: defaults2 == null ? void 0 : defaults2.minHeight,
|
|
111864
111884
|
defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.minHeight,
|
|
111865
|
-
isVisible:
|
|
111885
|
+
isVisible: function(s3) {
|
|
111886
|
+
var _a2;
|
|
111887
|
+
const hideHeight = ((_a2 = this == null ? void 0 : this.height) == null ? void 0 : _a2.mode) === "px";
|
|
111888
|
+
return Boolean(
|
|
111889
|
+
(showMinHeight ? showMinHeight == null ? void 0 : showMinHeight.call(this, s3) : true) && !hideHeight
|
|
111890
|
+
);
|
|
111891
|
+
}
|
|
111866
111892
|
});
|
|
111867
111893
|
const maxHeightProperty = getSizeProp({
|
|
111868
111894
|
label: "Max height",
|
|
111869
111895
|
controlType: "HEIGHT_DROPDOWN",
|
|
111870
111896
|
defaultValue: defaults2 == null ? void 0 : defaults2.maxHeight,
|
|
111871
111897
|
defaultOnAdd: defaultsOnAdd == null ? void 0 : defaultsOnAdd.maxHeight,
|
|
111872
|
-
isVisible:
|
|
111898
|
+
isVisible: function(s3) {
|
|
111899
|
+
var _a2;
|
|
111900
|
+
const hideHeight = ((_a2 = this == null ? void 0 : this.height) == null ? void 0 : _a2.mode) === "px";
|
|
111901
|
+
return Boolean(
|
|
111902
|
+
(showMaxHeight ? showMaxHeight == null ? void 0 : showMaxHeight.call(this, s3) : true) && !hideHeight
|
|
111903
|
+
);
|
|
111904
|
+
}
|
|
111873
111905
|
});
|
|
111874
111906
|
let heightProperty = Prop.dimension().readAndWrite().propertiesPanel({
|
|
111875
111907
|
label: "Height",
|
|
@@ -117530,12 +117562,18 @@ const AddSectionButton = ({
|
|
|
117530
117562
|
sectionInstanceId
|
|
117531
117563
|
}) => {
|
|
117532
117564
|
const indexForNewSection = placement === "above" ? indexForBaseSection : indexForBaseSection + 1;
|
|
117533
|
-
const createSection = useCallback(() => {
|
|
117534
|
-
createComponent({
|
|
117565
|
+
const createSection = useCallback(async () => {
|
|
117566
|
+
const newSectionSourceId = await createComponent({
|
|
117535
117567
|
componentType: "SbSection",
|
|
117536
117568
|
parent: { id: sectionParentSourceId, index: indexForNewSection },
|
|
117537
117569
|
scopeName: sectionParentScopeName
|
|
117538
117570
|
});
|
|
117571
|
+
if (newSectionSourceId) {
|
|
117572
|
+
const newSectionInstanceId = getEditStore().runtimeEntitiesManager.widgets.getAnyInstanceIdForSourceId(
|
|
117573
|
+
newSectionSourceId
|
|
117574
|
+
);
|
|
117575
|
+
getEditStore().ui.selectWidget(newSectionInstanceId);
|
|
117576
|
+
}
|
|
117539
117577
|
}, [sectionParentSourceId, indexForNewSection, sectionParentScopeName]);
|
|
117540
117578
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
117541
117579
|
Wrapper$2,
|
|
@@ -119823,22 +119861,13 @@ const getStackChildStyle = ({
|
|
|
119823
119861
|
(childProps == null ? void 0 : childProps.type) ?? ""
|
|
119824
119862
|
) ? Dim.fit() : Dim.fill());
|
|
119825
119863
|
const widthCss = childCount === 1 && (width == null ? void 0 : width.mode) === "fill" && (parentWidth == null ? void 0 : parentWidth.mode) !== "fit" ? { width: "100%" } : dimToCSS(width, "width", primary === "width");
|
|
119826
|
-
const
|
|
119827
|
-
|
|
119828
|
-
|
|
119829
|
-
);
|
|
119830
|
-
const maxWidthCss = getMinMaxCss(
|
|
119831
|
-
|
|
119832
|
-
|
|
119833
|
-
);
|
|
119834
|
-
const minHeightCss = getMinMaxCss(
|
|
119835
|
-
childProps == null ? void 0 : childProps.minHeight,
|
|
119836
|
-
"minHeight"
|
|
119837
|
-
);
|
|
119838
|
-
const maxHeightCss = getMinMaxCss(
|
|
119839
|
-
childProps == null ? void 0 : childProps.maxHeight,
|
|
119840
|
-
"maxHeight"
|
|
119841
|
-
);
|
|
119864
|
+
const widthInPx = (width == null ? void 0 : width.mode) === "px";
|
|
119865
|
+
const heightInPx = (height == null ? void 0 : height.mode) === "px";
|
|
119866
|
+
const shouldNotShrink = widthInPx && primary === "width" || heightInPx && primary === "height";
|
|
119867
|
+
const minWidthCss = widthInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.minWidth, "minWidth");
|
|
119868
|
+
const maxWidthCss = widthInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.maxWidth, "maxWidth");
|
|
119869
|
+
const minHeightCss = heightInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.minHeight, "minHeight");
|
|
119870
|
+
const maxHeightCss = heightInPx ? {} : getMinMaxCss(childProps == null ? void 0 : childProps.maxHeight, "maxHeight");
|
|
119842
119871
|
const margin2 = (childProps == null ? void 0 : childProps.margin) ?? {
|
|
119843
119872
|
top: Dim.px(0),
|
|
119844
119873
|
bottom: Dim.px(0),
|
|
@@ -119848,6 +119877,7 @@ const getStackChildStyle = ({
|
|
|
119848
119877
|
const marginCss = { margin: generatePaddingStyle(margin2) };
|
|
119849
119878
|
const stickyCss = (childProps == null ? void 0 : childProps.sticky) ? { position: "sticky", top: "0px", zIndex: Layers$1.stickySections } : {};
|
|
119850
119879
|
const style2 = {
|
|
119880
|
+
...shouldNotShrink ? { flexShrink: 0 } : {},
|
|
119851
119881
|
...heightCss,
|
|
119852
119882
|
...widthCss,
|
|
119853
119883
|
...minHeightCss,
|
|
@@ -120058,20 +120088,16 @@ const generateClassName = (seed2) => {
|
|
|
120058
120088
|
return `superblocks_widget_${seed2}`;
|
|
120059
120089
|
};
|
|
120060
120090
|
const getCanvasClassName = () => "canvas";
|
|
120061
|
-
const getChildName = (child) => {
|
|
120062
|
-
var _a2;
|
|
120063
|
-
return ((_a2 = getBindingIdentifier(child.props.bind)) == null ? void 0 : _a2.entityName) ?? child.props[WIDGET_SOURCE_ID_ATTRIBUTE];
|
|
120064
|
-
};
|
|
120065
120091
|
const calculateRowPositions = (orderedNames, childrenArray, rowHeight, pxHeights) => {
|
|
120066
120092
|
return orderedNames.reduce(
|
|
120067
120093
|
(acc, name) => {
|
|
120068
120094
|
var _a2;
|
|
120069
|
-
const child = childrenArray.find((child2) =>
|
|
120095
|
+
const child = childrenArray.find((child2) => child2.name === name);
|
|
120070
120096
|
if (!child) {
|
|
120071
120097
|
return acc;
|
|
120072
120098
|
}
|
|
120073
|
-
const marginTopPx = (((_a2 = child.
|
|
120074
|
-
const constraintTop = child.
|
|
120099
|
+
const marginTopPx = (((_a2 = child.marginTop) == null ? void 0 : _a2.value) ?? 0) * rowHeight;
|
|
120100
|
+
const constraintTop = child.constraintTop;
|
|
120075
120101
|
const bottomFunc = (name2) => {
|
|
120076
120102
|
const topRow = acc[name2];
|
|
120077
120103
|
const pxHeight = pxHeights[name2];
|
|
@@ -120096,16 +120122,16 @@ const calculateRowPositions = (orderedNames, childrenArray, rowHeight, pxHeights
|
|
|
120096
120122
|
const orderConstraints = (children) => {
|
|
120097
120123
|
const childrenMap = children.reduce(
|
|
120098
120124
|
(acc, child) => {
|
|
120099
|
-
acc[
|
|
120125
|
+
acc[child.name] = child;
|
|
120100
120126
|
return acc;
|
|
120101
120127
|
},
|
|
120102
120128
|
{}
|
|
120103
120129
|
);
|
|
120104
120130
|
const constraintsMap = children.reduce(
|
|
120105
120131
|
(acc, child) => {
|
|
120106
|
-
if (child.
|
|
120107
|
-
const constraints = Array.isArray(child.
|
|
120108
|
-
acc[
|
|
120132
|
+
if (child.constraintTop) {
|
|
120133
|
+
const constraints = Array.isArray(child.constraintTop) ? child.constraintTop : [child.constraintTop];
|
|
120134
|
+
acc[child.name] = constraints.filter(
|
|
120109
120135
|
(constraint) => !!childrenMap[constraint]
|
|
120110
120136
|
);
|
|
120111
120137
|
}
|
|
@@ -120117,24 +120143,24 @@ const orderConstraints = (children) => {
|
|
|
120117
120143
|
const foundItems = /* @__PURE__ */ new Set();
|
|
120118
120144
|
const itemsLeft = /* @__PURE__ */ new Set();
|
|
120119
120145
|
children.forEach((child) => {
|
|
120120
|
-
const constraints = constraintsMap[
|
|
120146
|
+
const constraints = constraintsMap[child.name] ?? [];
|
|
120121
120147
|
const hasNoConstraints = constraints.length === 0;
|
|
120122
120148
|
if (hasNoConstraints) {
|
|
120123
|
-
foundItems.add(
|
|
120124
|
-
orderedNames.push(
|
|
120149
|
+
foundItems.add(child.name);
|
|
120150
|
+
orderedNames.push(child.name);
|
|
120125
120151
|
} else {
|
|
120126
120152
|
itemsLeft.add(child);
|
|
120127
120153
|
}
|
|
120128
120154
|
});
|
|
120129
120155
|
while (itemsLeft.size > 0) {
|
|
120130
120156
|
itemsLeft.forEach((child) => {
|
|
120131
|
-
const constraints = constraintsMap[
|
|
120157
|
+
const constraints = constraintsMap[child.name] ?? [];
|
|
120132
120158
|
const constraintsLeft = constraints.filter(
|
|
120133
120159
|
(constraint) => !foundItems.has(constraint)
|
|
120134
120160
|
);
|
|
120135
120161
|
if (constraintsLeft.length === 0) {
|
|
120136
|
-
foundItems.add(
|
|
120137
|
-
orderedNames.push(
|
|
120162
|
+
foundItems.add(child.name);
|
|
120163
|
+
orderedNames.push(child.name);
|
|
120138
120164
|
itemsLeft.delete(child);
|
|
120139
120165
|
}
|
|
120140
120166
|
});
|
|
@@ -120185,99 +120211,141 @@ const heightReducer = (state, action2) => {
|
|
|
120185
120211
|
}
|
|
120186
120212
|
};
|
|
120187
120213
|
const EMPTY_ARRAY$1 = [];
|
|
120188
|
-
const
|
|
120189
|
-
|
|
120190
|
-
|
|
120191
|
-
|
|
120192
|
-
|
|
120193
|
-
|
|
120194
|
-
|
|
120195
|
-
|
|
120196
|
-
|
|
120197
|
-
|
|
120198
|
-
|
|
120199
|
-
|
|
120200
|
-
|
|
120201
|
-
|
|
120202
|
-
}
|
|
120203
|
-
return childrenArray2;
|
|
120204
|
-
}, [children, isEditing]);
|
|
120205
|
-
const columns = props2.columns ?? 12;
|
|
120206
|
-
const [pxHeights, dispatchHeight] = React__default.useReducer(heightReducer, {});
|
|
120207
|
-
const gridPositions = useMemo$2(() => {
|
|
120208
|
-
const orderedNames = orderConstraints(childrenArray);
|
|
120209
|
-
const rowPos = calculateRowPositions(
|
|
120210
|
-
orderedNames,
|
|
120211
|
-
childrenArray,
|
|
120212
|
-
rowHeight,
|
|
120213
|
-
pxHeights
|
|
120214
|
-
);
|
|
120215
|
-
const positions = childrenArray.reduce(
|
|
120216
|
-
(acc, child) => {
|
|
120217
|
-
var _a3, _b3, _c2;
|
|
120218
|
-
let width = ((_a3 = child.props.width) == null ? void 0 : _a3.value) ?? (child.type.sbType === "SbTable" || child.type.sbType === "SbContainer" ? 6 : 2);
|
|
120219
|
-
if (((_b3 = child.props.width) == null ? void 0 : _b3.mode) === "fill") {
|
|
120220
|
-
width = columns;
|
|
120221
|
-
}
|
|
120222
|
-
acc[getChildName(child)] = {
|
|
120223
|
-
top: rowPos[getChildName(child)],
|
|
120224
|
-
left: ((_c2 = child.props.marginLeft) == null ? void 0 : _c2.value) ?? 0,
|
|
120225
|
-
width,
|
|
120226
|
-
height: Math.ceil(pxHeights[getChildName(child)] / rowHeight)
|
|
120227
|
-
};
|
|
120228
|
-
return acc;
|
|
120229
|
-
},
|
|
120230
|
-
{}
|
|
120231
|
-
);
|
|
120232
|
-
return positions;
|
|
120233
|
-
}, [columns, childrenArray, rowHeight, pxHeights]);
|
|
120234
|
-
const gridStyle = React__default.useMemo(() => {
|
|
120235
|
-
const spacingValue = 0;
|
|
120236
|
-
const columnsSize = `calc(${100 / columns}% - ${(columns - 1) * spacingValue / columns}px)`;
|
|
120237
|
-
return {
|
|
120238
|
-
display: "grid",
|
|
120239
|
-
gridAutoRows: `${rowHeight}px`,
|
|
120240
|
-
gap: `${spacingValue}px`,
|
|
120241
|
-
gridTemplateColumns: `repeat(${columns}, ${columnsSize})`,
|
|
120242
|
-
...style2
|
|
120243
|
-
};
|
|
120244
|
-
}, [columns, rowHeight, style2]);
|
|
120245
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(DragDisplay, { passThroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: gridStyle, className: props2.className, children: childrenArray.map((child) => {
|
|
120246
|
-
var _a3, _b3;
|
|
120247
|
-
const heightMode = ((_a3 = child.props.height) == null ? void 0 : _a3.mode) ?? "fit";
|
|
120248
|
-
const top2 = gridPositions[getChildName(child)].top;
|
|
120249
|
-
const left2 = gridPositions[getChildName(child)].left;
|
|
120250
|
-
const rows = gridPositions[getChildName(child)].height;
|
|
120251
|
-
const columns2 = gridPositions[getChildName(child)].width;
|
|
120214
|
+
const GridChild = observer(
|
|
120215
|
+
({
|
|
120216
|
+
childProps,
|
|
120217
|
+
gridPositions,
|
|
120218
|
+
rowHeight,
|
|
120219
|
+
dispatchHeight,
|
|
120220
|
+
childElement
|
|
120221
|
+
}) => {
|
|
120222
|
+
var _a2, _b2;
|
|
120223
|
+
const heightMode = ((_a2 = childProps.height) == null ? void 0 : _a2.mode) ?? "fit";
|
|
120224
|
+
const top2 = gridPositions[childProps.name].top;
|
|
120225
|
+
const left2 = gridPositions[childProps.name].left;
|
|
120226
|
+
const rows = gridPositions[childProps.name].height;
|
|
120227
|
+
const columns = gridPositions[childProps.name].width;
|
|
120252
120228
|
const Component3 = heightMode === "fit" ? MeasuredComponent : StaticComponent;
|
|
120253
120229
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
120254
120230
|
"div",
|
|
120255
120231
|
{
|
|
120256
120232
|
style: {
|
|
120257
120233
|
gridRow: `${top2 + 1} / span ${Math.max(1, rows)}`,
|
|
120258
|
-
gridColumn: `${left2 + 1} / span ${Math.max(1,
|
|
120234
|
+
gridColumn: `${left2 + 1} / span ${Math.max(1, columns)}`,
|
|
120259
120235
|
width: "100%",
|
|
120260
120236
|
maxWidth: "100%"
|
|
120261
120237
|
},
|
|
120262
120238
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
120263
120239
|
Component3,
|
|
120264
120240
|
{
|
|
120265
|
-
staticHeight: (((
|
|
120241
|
+
staticHeight: (((_b2 = childProps.height) == null ? void 0 : _b2.value) ?? 0) * rowHeight,
|
|
120266
120242
|
onHeightChanged: (height) => {
|
|
120267
120243
|
dispatchHeight({
|
|
120268
120244
|
type: "SET_HEIGHT",
|
|
120269
|
-
name:
|
|
120245
|
+
name: childProps.name,
|
|
120270
120246
|
height
|
|
120271
120247
|
});
|
|
120272
120248
|
},
|
|
120273
|
-
children:
|
|
120249
|
+
children: childElement
|
|
120274
120250
|
}
|
|
120275
120251
|
)
|
|
120276
120252
|
},
|
|
120277
|
-
|
|
120253
|
+
childProps.name
|
|
120278
120254
|
);
|
|
120279
|
-
}
|
|
120280
|
-
|
|
120255
|
+
}
|
|
120256
|
+
);
|
|
120257
|
+
const InternalGrid = observer(
|
|
120258
|
+
({ children = EMPTY_ARRAY$1, ...props2 }) => {
|
|
120259
|
+
var _a2;
|
|
120260
|
+
const { style: style2, ...passThroughProps } = usePassthroughProps(props2);
|
|
120261
|
+
const rowHeight = ((_a2 = props2.rowHeight) == null ? void 0 : _a2.value) ?? 12;
|
|
120262
|
+
const childrenArray = useObserverMemo(() => {
|
|
120263
|
+
var _a3;
|
|
120264
|
+
const childrenArray2 = Array.isArray(children) ? children : [children];
|
|
120265
|
+
const isEditing = Boolean((_a3 = rootStore.editStore) == null ? void 0 : _a3.isInitialized);
|
|
120266
|
+
const withEvaluatedProps = childrenArray2.reduce((acc, child) => {
|
|
120267
|
+
const bindingIdentifier = getBindingIdentifier(child.props.bind);
|
|
120268
|
+
const entity = bindingIdentifier ? rootStore.entityManager.getEntity(bindingIdentifier.scopeId, {
|
|
120269
|
+
value: bindingIdentifier.entityName,
|
|
120270
|
+
isAnonymous: false
|
|
120271
|
+
}) : null;
|
|
120272
|
+
const marginTop = (entity == null ? void 0 : entity.marginTop) ?? (isDimension(child.props.marginTop) ? child.props.marginTop : void 0);
|
|
120273
|
+
const marginLeft = (entity == null ? void 0 : entity.marginLeft) ?? (isDimension(child.props.marginLeft) ? child.props.marginLeft : void 0);
|
|
120274
|
+
const width = (entity == null ? void 0 : entity.width) ?? (isDimension(child.props.width) ? child.props.width : void 0);
|
|
120275
|
+
const height = (entity == null ? void 0 : entity.height) ?? (isDimension(child.props.height) ? child.props.height : void 0);
|
|
120276
|
+
const constraintTop = (entity == null ? void 0 : entity.constraintTop) ?? child.props.constraintTop;
|
|
120277
|
+
const isVisible2 = (entity == null ? void 0 : entity.isVisible) ?? child.props.isVisible;
|
|
120278
|
+
const gridChild = {
|
|
120279
|
+
marginTop,
|
|
120280
|
+
marginLeft,
|
|
120281
|
+
width,
|
|
120282
|
+
height,
|
|
120283
|
+
constraintTop,
|
|
120284
|
+
name: (bindingIdentifier == null ? void 0 : bindingIdentifier.entityName) ?? child.props[WIDGET_SOURCE_ID_ATTRIBUTE],
|
|
120285
|
+
// source ID as a fallback
|
|
120286
|
+
sbType: isSbComponent(child) ? child.type.sbType : void 0,
|
|
120287
|
+
element: child
|
|
120288
|
+
};
|
|
120289
|
+
if (isVisible2 !== false || isEditing) {
|
|
120290
|
+
acc.push(gridChild);
|
|
120291
|
+
}
|
|
120292
|
+
return acc;
|
|
120293
|
+
}, []);
|
|
120294
|
+
return withEvaluatedProps;
|
|
120295
|
+
}, [children]);
|
|
120296
|
+
const columns = props2.columns ?? 12;
|
|
120297
|
+
const [pxHeights, dispatchHeight] = React__default.useReducer(heightReducer, {});
|
|
120298
|
+
const gridPositions = useMemo$2(() => {
|
|
120299
|
+
const orderedNames = orderConstraints(childrenArray);
|
|
120300
|
+
const rowPos = calculateRowPositions(
|
|
120301
|
+
orderedNames,
|
|
120302
|
+
childrenArray,
|
|
120303
|
+
rowHeight,
|
|
120304
|
+
pxHeights
|
|
120305
|
+
);
|
|
120306
|
+
const positions = childrenArray.reduce(
|
|
120307
|
+
(acc, child) => {
|
|
120308
|
+
var _a3, _b2, _c2;
|
|
120309
|
+
let width = ((_a3 = child.width) == null ? void 0 : _a3.value) ?? (child.sbType === "SbTable" || child.sbType === "SbContainer" ? 6 : 2);
|
|
120310
|
+
if (((_b2 = child.width) == null ? void 0 : _b2.mode) === "fill") {
|
|
120311
|
+
width = columns;
|
|
120312
|
+
}
|
|
120313
|
+
acc[child.name] = {
|
|
120314
|
+
top: rowPos[child.name],
|
|
120315
|
+
left: ((_c2 = child.marginLeft) == null ? void 0 : _c2.value) ?? 0,
|
|
120316
|
+
width,
|
|
120317
|
+
height: Math.ceil(pxHeights[child.name] / rowHeight)
|
|
120318
|
+
};
|
|
120319
|
+
return acc;
|
|
120320
|
+
},
|
|
120321
|
+
{}
|
|
120322
|
+
);
|
|
120323
|
+
return positions;
|
|
120324
|
+
}, [columns, childrenArray, rowHeight, pxHeights]);
|
|
120325
|
+
const gridStyle = React__default.useMemo(() => {
|
|
120326
|
+
const spacingValue = 0;
|
|
120327
|
+
const columnsSize = `calc(${100 / columns}% - ${(columns - 1) * spacingValue / columns}px)`;
|
|
120328
|
+
return {
|
|
120329
|
+
display: "grid",
|
|
120330
|
+
gridAutoRows: `${rowHeight}px`,
|
|
120331
|
+
gap: `${spacingValue}px`,
|
|
120332
|
+
gridTemplateColumns: `repeat(${columns}, ${columnsSize})`,
|
|
120333
|
+
...style2
|
|
120334
|
+
};
|
|
120335
|
+
}, [columns, rowHeight, style2]);
|
|
120336
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DragDisplay, { passThroughProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: gridStyle, className: props2.className, children: childrenArray.map((child) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
120337
|
+
GridChild,
|
|
120338
|
+
{
|
|
120339
|
+
childProps: child,
|
|
120340
|
+
childElement: child.element,
|
|
120341
|
+
gridPositions,
|
|
120342
|
+
rowHeight,
|
|
120343
|
+
dispatchHeight
|
|
120344
|
+
},
|
|
120345
|
+
child.name
|
|
120346
|
+
)) }) });
|
|
120347
|
+
}
|
|
120348
|
+
);
|
|
120281
120349
|
const DragDisplay = (props2) => {
|
|
120282
120350
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
120283
120351
|
"div",
|
|
@@ -145512,14 +145580,14 @@ function getLoaderFn(options) {
|
|
|
145512
145580
|
if (!(loader === "all")) return [3, 3];
|
|
145513
145581
|
return [4, import(
|
|
145514
145582
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
145515
|
-
"./allPathsLoader-
|
|
145583
|
+
"./allPathsLoader-BAwHv7e7.js"
|
|
145516
145584
|
)];
|
|
145517
145585
|
case 2:
|
|
145518
145586
|
return [2, _b2.sent().allPathsLoader];
|
|
145519
145587
|
case 3:
|
|
145520
145588
|
return [4, import(
|
|
145521
145589
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
145522
|
-
"./splitPathsBySizeLoader-
|
|
145590
|
+
"./splitPathsBySizeLoader-DALk2KWT.js"
|
|
145523
145591
|
)];
|
|
145524
145592
|
case 4:
|
|
145525
145593
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -162757,6 +162825,7 @@ const propertiesDefinition$9 = {
|
|
|
162757
162825
|
visibility: "SHOW_NAME",
|
|
162758
162826
|
isJSConvertible: false,
|
|
162759
162827
|
isRemovable: true,
|
|
162828
|
+
defaultOnAdd: () => Property.Computed(""),
|
|
162760
162829
|
helpText: "Allows specifying the filters that will be used on page load",
|
|
162761
162830
|
isVisible: function() {
|
|
162762
162831
|
return this.isFilterable && this.pageType !== "server-side";
|
|
@@ -162833,6 +162902,8 @@ const propertiesDefinition$9 = {
|
|
|
162833
162902
|
label: "Default sort",
|
|
162834
162903
|
helpText: "Allows specifying the sort options that will be used on page load",
|
|
162835
162904
|
controlType: "DEFAULT_TABLE_SORT",
|
|
162905
|
+
isRemovable: true,
|
|
162906
|
+
visibility: "SHOW_NAME",
|
|
162836
162907
|
childrenDisplayMode: {
|
|
162837
162908
|
type: "popover",
|
|
162838
162909
|
title: "Default sort"
|
|
@@ -162841,6 +162912,8 @@ const propertiesDefinition$9 = {
|
|
|
162841
162912
|
defaultSearchText: Prop.string().readAndWrite().propertiesPanel({
|
|
162842
162913
|
label: "Default search",
|
|
162843
162914
|
helpText: "Sets the default search text",
|
|
162915
|
+
isRemovable: true,
|
|
162916
|
+
visibility: "SHOW_NAME",
|
|
162844
162917
|
isVisible: function() {
|
|
162845
162918
|
return this.enableClientSideSearch !== false;
|
|
162846
162919
|
}
|
|
@@ -183845,8 +183918,8 @@ const SbVariable = registerSbEntity(
|
|
|
183845
183918
|
);
|
|
183846
183919
|
const propertiesDefinition$1 = {
|
|
183847
183920
|
general: Section.category(PropsPanelCategory.Uncategorized).propertiesPanel({ showHeader: false }).children({
|
|
183848
|
-
intervalMs: Prop.number().default(
|
|
183849
|
-
label: "Interval
|
|
183921
|
+
intervalMs: Prop.number().default(300).readAndWrite().propertiesPanel({
|
|
183922
|
+
label: "Interval",
|
|
183850
183923
|
helpText: "Sets the interval of the timer",
|
|
183851
183924
|
placeholder: "1000",
|
|
183852
183925
|
isJSConvertible: false,
|
|
@@ -186705,6 +186778,23 @@ console.log = (...args) => {
|
|
|
186705
186778
|
} catch {
|
|
186706
186779
|
}
|
|
186707
186780
|
};
|
|
186781
|
+
const loadApisIntoLibrary = async function loadApisIntoLibrary2() {
|
|
186782
|
+
var _a2, _b2;
|
|
186783
|
+
{
|
|
186784
|
+
try {
|
|
186785
|
+
const mod2 = await import("./user-facing/build-manifest.js");
|
|
186786
|
+
const apis = ((_a2 = mod2.default) == null ? void 0 : _a2.apis) ?? {};
|
|
186787
|
+
const apiDependencies = ((_b2 = mod2.default) == null ? void 0 : _b2.apiDependencies) ?? [];
|
|
186788
|
+
rootStore.apis.setAllApis(apis);
|
|
186789
|
+
apiDependencies.forEach((dep) => {
|
|
186790
|
+
rootStore.apis.setApiDepCandidates(dep.apiName, dep.params);
|
|
186791
|
+
rootStore.apis.setApiReferences(dep.apiName, dep.dependencies);
|
|
186792
|
+
});
|
|
186793
|
+
} catch (error) {
|
|
186794
|
+
console.error("Error loading apis into library", error);
|
|
186795
|
+
}
|
|
186796
|
+
}
|
|
186797
|
+
};
|
|
186708
186798
|
const SbProvider = function SbProvider2({
|
|
186709
186799
|
name = "codemode",
|
|
186710
186800
|
settings,
|
|
@@ -186713,6 +186803,14 @@ const SbProvider = function SbProvider2({
|
|
|
186713
186803
|
}) {
|
|
186714
186804
|
var _a2, _b2;
|
|
186715
186805
|
const isEmbedded = typeof window !== "undefined" && window.parent !== window.self;
|
|
186806
|
+
const [isApisInitialized, setIsApisInitialized] = useState(false);
|
|
186807
|
+
const runApiInitialization = useCallback(async () => {
|
|
186808
|
+
await loadApisIntoLibrary();
|
|
186809
|
+
setIsApisInitialized(true);
|
|
186810
|
+
}, []);
|
|
186811
|
+
useEffect(() => {
|
|
186812
|
+
runApiInitialization();
|
|
186813
|
+
}, [runApiInitialization]);
|
|
186716
186814
|
const [userAccessibleTheme, setUserAccessibleTheme] = useState(DEFAULT_THEME);
|
|
186717
186815
|
useEffect(() => {
|
|
186718
186816
|
const mergedTheme = lodashExports.merge(BASE_THEME_V5, settings == null ? void 0 : settings.theme);
|
|
@@ -186725,6 +186823,9 @@ const SbProvider = function SbProvider2({
|
|
|
186725
186823
|
useEffect(() => {
|
|
186726
186824
|
initializeStyles(name);
|
|
186727
186825
|
}, [preloadedData, name]);
|
|
186826
|
+
if (!isApisInitialized) {
|
|
186827
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FullPageSpinner, {});
|
|
186828
|
+
}
|
|
186728
186829
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
186729
186830
|
"div",
|
|
186730
186831
|
{
|
|
@@ -198333,4 +198434,4 @@ export {
|
|
|
198333
198434
|
SbTimer as y,
|
|
198334
198435
|
SbApi as z
|
|
198335
198436
|
};
|
|
198336
|
-
//# sourceMappingURL=index-
|
|
198437
|
+
//# sourceMappingURL=index-Bnnq0M9f.js.map
|