@superblocksteam/library 2.0.0-next.107 → 2.0.0-next.108
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-C87GcBiX.js → allPaths-BYjRvmVW.js} +2 -2
- package/dist/{allPaths-C87GcBiX.js.map → allPaths-BYjRvmVW.js.map} +1 -1
- package/dist/{allPaths-CDxZNKK6.js → allPaths-B_8jnuaV.js} +2 -2
- package/dist/{allPaths-CDxZNKK6.js.map → allPaths-B_8jnuaV.js.map} +1 -1
- package/dist/{allPathsLoader-DSfR6N4x.js → allPathsLoader-BxgB7o0q.js} +3 -3
- package/dist/{allPathsLoader-DSfR6N4x.js.map → allPathsLoader-BxgB7o0q.js.map} +1 -1
- package/dist/{allPathsLoader-Tn_25haG.js → allPathsLoader-DXmNAbaz.js} +3 -3
- package/dist/{allPathsLoader-Tn_25haG.js.map → allPathsLoader-DXmNAbaz.js.map} +1 -1
- package/dist/{index-BVFDrjgu.js → index-HBvkJUiu.js} +91 -67
- package/dist/{index-BVFDrjgu.js.map → index-HBvkJUiu.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{splitPathsBySizeLoader-yjB1zNTJ.js → splitPathsBySizeLoader-CWNr4mDJ.js} +2 -2
- package/dist/{splitPathsBySizeLoader-yjB1zNTJ.js.map → splitPathsBySizeLoader-CWNr4mDJ.js.map} +1 -1
- package/dist/{splitPathsBySizeLoader-AOJMwnbQ.js → splitPathsBySizeLoader-us-uCnrg.js} +2 -2
- package/dist/{splitPathsBySizeLoader-AOJMwnbQ.js.map → splitPathsBySizeLoader-us-uCnrg.js.map} +1 -1
- package/dist-types/edit-mode/features/interaction-layer-manager.d.ts +10 -4
- package/dist-types/edit-mode/interaction-utils.d.ts +4 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { I as IconSvgPaths16 } from "./index-BxzKdlqH.js";
|
|
2
2
|
import { I as IconSvgPaths20 } from "./index-DIn-fanT.js";
|
|
3
|
-
import { p as pascalCase, b as IconSize } from "./index-
|
|
3
|
+
import { p as pascalCase, b as IconSize } from "./index-HBvkJUiu.js";
|
|
4
4
|
function getIconPaths(name, size) {
|
|
5
5
|
var key = pascalCase(name);
|
|
6
6
|
return size === IconSize.STANDARD ? IconSvgPaths16[key] : IconSvgPaths20[key];
|
|
@@ -14,4 +14,4 @@ export {
|
|
|
14
14
|
getIconPaths,
|
|
15
15
|
iconNameToPathsRecordKey
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=allPaths-
|
|
17
|
+
//# sourceMappingURL=allPaths-BYjRvmVW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPaths-
|
|
1
|
+
{"version":3,"file":"allPaths-BYjRvmVW.js","sources":["../../../node_modules/.pnpm/@blueprintjs+icons@5.20.0_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@blueprintjs/icons/lib/esm/allPaths.js"],"sourcesContent":["/*\n * Copyright 2021 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pascalCase } from \"change-case\";\nimport * as IconSvgPaths16 from \"./generated/16px/paths\";\nimport * as IconSvgPaths20 from \"./generated/20px/paths\";\nimport { IconSize } from \"./iconTypes\";\nexport { IconSvgPaths16, IconSvgPaths20 };\n/**\n * Get the list of vector paths that define a given icon. These path strings are used to render `<path>`\n * elements inside an `<svg>` icon element. For full implementation details and nuances, see the icon component\n * handlebars template and `generate-icon-components` script in the __@blueprintjs/icons__ package.\n *\n * Note: this function loads all icon definitions __statically__, which means every icon is included in your\n * JS bundle. Only use this API if your app is likely to use all Blueprint icons at runtime. If you are looking for a\n * dynamic icon loader which loads icon definitions on-demand, use `{ Icons } from \"@blueprintjs/icons\"` instead.\n */\nexport function getIconPaths(name, size) {\n var key = pascalCase(name);\n return size === IconSize.STANDARD ? IconSvgPaths16[key] : IconSvgPaths20[key];\n}\n/**\n * Type safe string literal conversion of snake-case icon names to PascalCase icon names.\n * This is useful for indexing into the SVG paths record to extract a single icon's SVG path definition.\n *\n * @deprecated use `getIconPaths` instead\n */\nexport function iconNameToPathsRecordKey(name) {\n return pascalCase(name);\n}\n//# sourceMappingURL=allPaths.js.map"],"names":[],"mappings":";;;AA6BO,SAAS,aAAa,MAAM,MAAM;AACrC,MAAI,MAAM,WAAW,IAAI;AACzB,SAAO,SAAS,SAAS,WAAW,eAAe,GAAG,IAAI,eAAe,GAAG;AAChF;AAOO,SAAS,yBAAyB,MAAM;AAC3C,SAAO,WAAW,IAAI;AAC1B;","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { I as IconSvgPaths16 } from "./index-DIJYif9G.js";
|
|
2
2
|
import { I as IconSvgPaths20 } from "./index-LHtbj0-V.js";
|
|
3
|
-
import { p as pascalCase, I as IconSize } from "./index-
|
|
3
|
+
import { p as pascalCase, I as IconSize } from "./index-HBvkJUiu.js";
|
|
4
4
|
function getIconPaths(name, size) {
|
|
5
5
|
var key = pascalCase(name);
|
|
6
6
|
return size === IconSize.STANDARD ? IconSvgPaths16[key] : IconSvgPaths20[key];
|
|
@@ -14,4 +14,4 @@ export {
|
|
|
14
14
|
getIconPaths,
|
|
15
15
|
iconNameToPathsRecordKey
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=allPaths-
|
|
17
|
+
//# sourceMappingURL=allPaths-B_8jnuaV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPaths-
|
|
1
|
+
{"version":3,"file":"allPaths-B_8jnuaV.js","sources":["../../../node_modules/.pnpm/@blueprintjs+icons@5.18.1_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@blueprintjs/icons/lib/esm/allPaths.js"],"sourcesContent":["/*\n * Copyright 2021 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pascalCase } from \"change-case\";\nimport * as IconSvgPaths16 from \"./generated/16px/paths\";\nimport * as IconSvgPaths20 from \"./generated/20px/paths\";\nimport { IconSize } from \"./iconTypes\";\nexport { IconSvgPaths16, IconSvgPaths20 };\n/**\n * Get the list of vector paths that define a given icon. These path strings are used to render `<path>`\n * elements inside an `<svg>` icon element. For full implementation details and nuances, see the icon component\n * handlebars template and `generate-icon-components` script in the __@blueprintjs/icons__ package.\n *\n * Note: this function loads all icon definitions __statically__, which means every icon is included in your\n * JS bundle. Only use this API if your app is likely to use all Blueprint icons at runtime. If you are looking for a\n * dynamic icon loader which loads icon definitions on-demand, use `{ Icons } from \"@blueprintjs/icons\"` instead.\n */\nexport function getIconPaths(name, size) {\n var key = pascalCase(name);\n return size === IconSize.STANDARD ? IconSvgPaths16[key] : IconSvgPaths20[key];\n}\n/**\n * Type safe string literal conversion of snake-case icon names to PascalCase icon names.\n * This is useful for indexing into the SVG paths record to extract a single icon's SVG path definition.\n *\n * @deprecated use `getIconPaths` instead\n */\nexport function iconNameToPathsRecordKey(name) {\n return pascalCase(name);\n}\n//# sourceMappingURL=allPaths.js.map"],"names":[],"mappings":";;;AA6BO,SAAS,aAAa,MAAM,MAAM;AACrC,MAAI,MAAM,WAAW,IAAI;AACzB,SAAO,SAAS,SAAS,WAAW,eAAe,GAAG,IAAI,eAAe,GAAG;AAChF;AAOO,SAAS,yBAAyB,MAAM;AAC3C,SAAO,WAAW,IAAI;AAC1B;","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __awaiter, a as __generator } from "./index-
|
|
1
|
+
import { _ as __awaiter, a as __generator } from "./index-HBvkJUiu.js";
|
|
2
2
|
var allPathsLoader = function(name, size) {
|
|
3
3
|
return __awaiter(void 0, void 0, void 0, function() {
|
|
4
4
|
var getIconPaths;
|
|
@@ -7,7 +7,7 @@ var allPathsLoader = function(name, size) {
|
|
|
7
7
|
case 0:
|
|
8
8
|
return [4, import(
|
|
9
9
|
/* webpackChunkName: "blueprint-icons-all-paths" */
|
|
10
|
-
"./allPaths-
|
|
10
|
+
"./allPaths-B_8jnuaV.js"
|
|
11
11
|
)];
|
|
12
12
|
case 1:
|
|
13
13
|
getIconPaths = _a.sent().getIconPaths;
|
|
@@ -19,4 +19,4 @@ var allPathsLoader = function(name, size) {
|
|
|
19
19
|
export {
|
|
20
20
|
allPathsLoader
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=allPathsLoader-
|
|
22
|
+
//# sourceMappingURL=allPathsLoader-BxgB7o0q.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPathsLoader-
|
|
1
|
+
{"version":3,"file":"allPathsLoader-BxgB7o0q.js","sources":["../../../node_modules/.pnpm/@blueprintjs+icons@5.18.1_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@blueprintjs/icons/lib/esm/paths-loaders/allPathsLoader.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __awaiter, __generator } from \"tslib\";\n/**\n * A simple module loader which concatenates all icon paths into a single chunk.\n */\nexport var allPathsLoader = function (name, size) { return __awaiter(void 0, void 0, void 0, function () {\n var getIconPaths;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-all-paths\" */\n \"../allPaths\")];\n case 1:\n getIconPaths = (_a.sent()).getIconPaths;\n return [2 /*return*/, getIconPaths(name, size)];\n }\n });\n}); };\n//# sourceMappingURL=allPathsLoader.js.map"],"names":[],"mappings":";AAmBU,IAAC,iBAAiB,SAAU,MAAM,MAAM;AAAE,SAAO,UAAU,QAAQ,QAAQ,QAAQ,WAAY;AACrG,QAAI;AACJ,WAAO,YAAY,MAAM,SAAU,IAAI;AACnC,cAAQ,GAAG,OAAK;AAAA,QACZ,KAAK;AAAG,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEzB;AAAA,UAAa,CAAC;AAAA,QAClB,KAAK;AACD,yBAAgB,GAAG,KAAI,EAAI;AAC3B,iBAAO,CAAC,GAAc,aAAa,MAAM,IAAI,CAAC;AAAA,MAC9D;AAAA,IACA,CAAK;AAAA,EACL,CAAC;AAAE;","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __awaiter, a as __generator } from "./index-
|
|
1
|
+
import { _ as __awaiter, a as __generator } from "./index-HBvkJUiu.js";
|
|
2
2
|
var allPathsLoader = function(name, size) {
|
|
3
3
|
return __awaiter(void 0, void 0, void 0, function() {
|
|
4
4
|
var getIconPaths;
|
|
@@ -7,7 +7,7 @@ var allPathsLoader = function(name, size) {
|
|
|
7
7
|
case 0:
|
|
8
8
|
return [4, import(
|
|
9
9
|
/* webpackChunkName: "blueprint-icons-all-paths" */
|
|
10
|
-
"./allPaths-
|
|
10
|
+
"./allPaths-BYjRvmVW.js"
|
|
11
11
|
)];
|
|
12
12
|
case 1:
|
|
13
13
|
getIconPaths = _a.sent().getIconPaths;
|
|
@@ -19,4 +19,4 @@ var allPathsLoader = function(name, size) {
|
|
|
19
19
|
export {
|
|
20
20
|
allPathsLoader
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=allPathsLoader-
|
|
22
|
+
//# sourceMappingURL=allPathsLoader-DXmNAbaz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPathsLoader-
|
|
1
|
+
{"version":3,"file":"allPathsLoader-DXmNAbaz.js","sources":["../../../node_modules/.pnpm/@blueprintjs+icons@5.20.0_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@blueprintjs/icons/lib/esm/paths-loaders/allPathsLoader.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __awaiter, __generator } from \"tslib\";\n/**\n * A simple module loader which concatenates all icon paths into a single chunk.\n */\nexport var allPathsLoader = function (name, size) { return __awaiter(void 0, void 0, void 0, function () {\n var getIconPaths;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-all-paths\" */\n \"../allPaths\")];\n case 1:\n getIconPaths = (_a.sent()).getIconPaths;\n return [2 /*return*/, getIconPaths(name, size)];\n }\n });\n}); };\n//# sourceMappingURL=allPathsLoader.js.map"],"names":[],"mappings":";AAmBU,IAAC,iBAAiB,SAAU,MAAM,MAAM;AAAE,SAAO,UAAU,QAAQ,QAAQ,QAAQ,WAAY;AACrG,QAAI;AACJ,WAAO,YAAY,MAAM,SAAU,IAAI;AACnC,cAAQ,GAAG,OAAK;AAAA,QACZ,KAAK;AAAG,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEzB;AAAA,UAAa,CAAC;AAAA,QAClB,KAAK;AACD,yBAAgB,GAAG,KAAI,EAAI;AAC3B,iBAAO,CAAC,GAAc,aAAa,MAAM,IAAI,CAAC;AAAA,MAC9D;AAAA,IACA,CAAK;AAAA,EACL,CAAC;AAAE;","x_google_ignoreList":[0]}
|
|
@@ -2684,14 +2684,14 @@ function getLoaderFn$1(options) {
|
|
|
2684
2684
|
if (!(loader === "all")) return [3, 3];
|
|
2685
2685
|
return [4, import(
|
|
2686
2686
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
2687
|
-
"./allPathsLoader-
|
|
2687
|
+
"./allPathsLoader-BxgB7o0q.js"
|
|
2688
2688
|
)];
|
|
2689
2689
|
case 2:
|
|
2690
2690
|
return [2, _b2.sent().allPathsLoader];
|
|
2691
2691
|
case 3:
|
|
2692
2692
|
return [4, import(
|
|
2693
2693
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
2694
|
-
"./splitPathsBySizeLoader-
|
|
2694
|
+
"./splitPathsBySizeLoader-us-uCnrg.js"
|
|
2695
2695
|
)];
|
|
2696
2696
|
case 4:
|
|
2697
2697
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -98181,6 +98181,67 @@ class ConnectionManager {
|
|
|
98181
98181
|
this.connectionStatus = "disconnected";
|
|
98182
98182
|
}
|
|
98183
98183
|
}
|
|
98184
|
+
const getWidgetAnchorName = (instanceId) => {
|
|
98185
|
+
return `--widget-${instanceId}`;
|
|
98186
|
+
};
|
|
98187
|
+
const getWidgetRectAnchorName = (instanceId) => {
|
|
98188
|
+
return `--widget-rect-${instanceId}`;
|
|
98189
|
+
};
|
|
98190
|
+
const getWidgetDropAreaAnchorName = (instanceId, widgetType) => {
|
|
98191
|
+
if (widgetType === "SbModal" || widgetType === "SbSlideout") {
|
|
98192
|
+
return `--widget-drop-area-${instanceId}`;
|
|
98193
|
+
}
|
|
98194
|
+
return `--widget-${instanceId}`;
|
|
98195
|
+
};
|
|
98196
|
+
const getEditWrapperId = (instanceId) => {
|
|
98197
|
+
return `sb-edit-wrapper-${instanceId}`;
|
|
98198
|
+
};
|
|
98199
|
+
const getEditWrapperIdWithType = (instanceId, widgetType) => {
|
|
98200
|
+
if (widgetType === "SbModal" || widgetType === "SbSlideout") {
|
|
98201
|
+
return `sb-edit-wrapper-for-${widgetType}-${instanceId}`;
|
|
98202
|
+
}
|
|
98203
|
+
return `sb-edit-wrapper-${instanceId}`;
|
|
98204
|
+
};
|
|
98205
|
+
const getBoundingBoxForWidget = (instanceId) => {
|
|
98206
|
+
var _a2;
|
|
98207
|
+
return (_a2 = getWidgetNode(instanceId)) == null ? void 0 : _a2.getBoundingClientRect();
|
|
98208
|
+
};
|
|
98209
|
+
const getFirstInstanceElement = (element) => {
|
|
98210
|
+
let current = element;
|
|
98211
|
+
while (current) {
|
|
98212
|
+
const instanceId = current.getAttribute(WIDGET_INSTANCE_ID_ATTRIBUTE);
|
|
98213
|
+
if (instanceId) {
|
|
98214
|
+
return {
|
|
98215
|
+
element: current,
|
|
98216
|
+
instanceId
|
|
98217
|
+
};
|
|
98218
|
+
}
|
|
98219
|
+
current = current.firstElementChild;
|
|
98220
|
+
}
|
|
98221
|
+
return null;
|
|
98222
|
+
};
|
|
98223
|
+
const getWidgetNode = (instanceId) => {
|
|
98224
|
+
const widgetMeta = getEditStore().runtimeEntitiesManager.getEditorWidgetMeta(instanceId);
|
|
98225
|
+
const sourceId = widgetMeta == null ? void 0 : widgetMeta.sourceId;
|
|
98226
|
+
const type5 = widgetMeta == null ? void 0 : widgetMeta.type;
|
|
98227
|
+
const editWrapperId = getEditWrapperIdWithType(instanceId, type5);
|
|
98228
|
+
const wrapperElem = document.getElementById(editWrapperId);
|
|
98229
|
+
return wrapperElem == null ? void 0 : wrapperElem.querySelector(
|
|
98230
|
+
`[${WIDGET_SOURCE_ID_ATTRIBUTE}="${sourceId}"]`
|
|
98231
|
+
);
|
|
98232
|
+
};
|
|
98233
|
+
const getIsComponentInInteractionLayer = (instanceId) => {
|
|
98234
|
+
const editStore2 = getEditStore();
|
|
98235
|
+
const activeRootInstanceId = editStore2.interactionLayerManager.activeRootInstanceId;
|
|
98236
|
+
const isDropTargetInInteractionLayer = (
|
|
98237
|
+
// if active root id is undefined, we are in the page and can drop anywhere
|
|
98238
|
+
!activeRootInstanceId || instanceId && (instanceId === activeRootInstanceId || editStore2.runtimeEntitiesManager.isChildOf(
|
|
98239
|
+
instanceId,
|
|
98240
|
+
activeRootInstanceId
|
|
98241
|
+
))
|
|
98242
|
+
);
|
|
98243
|
+
return isDropTargetInInteractionLayer;
|
|
98244
|
+
};
|
|
98184
98245
|
_setActiveRootInstanceId_dec = [action], _setSourceIdElement_dec = [action], _removeSourceIdElement_dec = [action];
|
|
98185
98246
|
class InteractionLayerManager {
|
|
98186
98247
|
constructor() {
|
|
@@ -98201,17 +98262,25 @@ class InteractionLayerManager {
|
|
|
98201
98262
|
setActiveRootInstanceId(rootInstanceId) {
|
|
98202
98263
|
this.activeRootInstanceId = rootInstanceId;
|
|
98203
98264
|
}
|
|
98204
|
-
setSourceIdElement(
|
|
98205
|
-
|
|
98265
|
+
setSourceIdElement(el2, sourceId) {
|
|
98266
|
+
const { element, instanceId } = getFirstInstanceElement(el2) ?? {};
|
|
98267
|
+
if (!element || !instanceId) {
|
|
98268
|
+
return;
|
|
98269
|
+
}
|
|
98270
|
+
this.sourceIdElements.set(instanceId, { sourceId, element });
|
|
98271
|
+
return instanceId;
|
|
98206
98272
|
}
|
|
98207
|
-
removeSourceIdElement(
|
|
98208
|
-
this.sourceIdElements.delete(
|
|
98273
|
+
removeSourceIdElement(instanceId) {
|
|
98274
|
+
this.sourceIdElements.delete(instanceId);
|
|
98209
98275
|
}
|
|
98210
98276
|
getSourceIdElements(sourceId) {
|
|
98211
98277
|
const elements = [];
|
|
98212
|
-
for (const [
|
|
98213
|
-
if (
|
|
98214
|
-
elements.push(
|
|
98278
|
+
for (const [instanceId, info] of this.sourceIdElements.entries()) {
|
|
98279
|
+
if (info.sourceId === sourceId) {
|
|
98280
|
+
elements.push({
|
|
98281
|
+
element: info.element,
|
|
98282
|
+
instanceId
|
|
98283
|
+
});
|
|
98215
98284
|
}
|
|
98216
98285
|
}
|
|
98217
98286
|
return elements;
|
|
@@ -100316,53 +100385,6 @@ class StackManager {
|
|
|
100316
100385
|
return dragInfo ?? { insertionIndex: void 0, placeholders: void 0 };
|
|
100317
100386
|
}
|
|
100318
100387
|
}
|
|
100319
|
-
const getWidgetAnchorName = (instanceId) => {
|
|
100320
|
-
return `--widget-${instanceId}`;
|
|
100321
|
-
};
|
|
100322
|
-
const getWidgetRectAnchorName = (instanceId) => {
|
|
100323
|
-
return `--widget-rect-${instanceId}`;
|
|
100324
|
-
};
|
|
100325
|
-
const getWidgetDropAreaAnchorName = (instanceId, widgetType) => {
|
|
100326
|
-
if (widgetType === "SbModal" || widgetType === "SbSlideout") {
|
|
100327
|
-
return `--widget-drop-area-${instanceId}`;
|
|
100328
|
-
}
|
|
100329
|
-
return `--widget-${instanceId}`;
|
|
100330
|
-
};
|
|
100331
|
-
const getEditWrapperId = (instanceId) => {
|
|
100332
|
-
return `sb-edit-wrapper-${instanceId}`;
|
|
100333
|
-
};
|
|
100334
|
-
const getEditWrapperIdWithType = (instanceId, widgetType) => {
|
|
100335
|
-
if (widgetType === "SbModal" || widgetType === "SbSlideout") {
|
|
100336
|
-
return `sb-edit-wrapper-for-${widgetType}-${instanceId}`;
|
|
100337
|
-
}
|
|
100338
|
-
return `sb-edit-wrapper-${instanceId}`;
|
|
100339
|
-
};
|
|
100340
|
-
const getBoundingBoxForWidget = (instanceId) => {
|
|
100341
|
-
var _a2;
|
|
100342
|
-
return (_a2 = getWidgetNode(instanceId)) == null ? void 0 : _a2.getBoundingClientRect();
|
|
100343
|
-
};
|
|
100344
|
-
const getWidgetNode = (instanceId) => {
|
|
100345
|
-
const widgetMeta = getEditStore().runtimeEntitiesManager.getEditorWidgetMeta(instanceId);
|
|
100346
|
-
const sourceId = widgetMeta == null ? void 0 : widgetMeta.sourceId;
|
|
100347
|
-
const type5 = widgetMeta == null ? void 0 : widgetMeta.type;
|
|
100348
|
-
const editWrapperId = getEditWrapperIdWithType(instanceId, type5);
|
|
100349
|
-
const wrapperElem = document.getElementById(editWrapperId);
|
|
100350
|
-
return wrapperElem == null ? void 0 : wrapperElem.querySelector(
|
|
100351
|
-
`[${WIDGET_SOURCE_ID_ATTRIBUTE}="${sourceId}"]`
|
|
100352
|
-
);
|
|
100353
|
-
};
|
|
100354
|
-
const getIsComponentInInteractionLayer = (instanceId) => {
|
|
100355
|
-
const editStore2 = getEditStore();
|
|
100356
|
-
const activeRootInstanceId = editStore2.interactionLayerManager.activeRootInstanceId;
|
|
100357
|
-
const isDropTargetInInteractionLayer = (
|
|
100358
|
-
// if active root id is undefined, we are in the page and can drop anywhere
|
|
100359
|
-
!activeRootInstanceId || instanceId && (instanceId === activeRootInstanceId || editStore2.runtimeEntitiesManager.isChildOf(
|
|
100360
|
-
instanceId,
|
|
100361
|
-
activeRootInstanceId
|
|
100362
|
-
))
|
|
100363
|
-
);
|
|
100364
|
-
return isDropTargetInInteractionLayer;
|
|
100365
|
-
};
|
|
100366
100388
|
_setWidgetFeatures_dec = [action], _setIsDragging_dec = [action], _startNewComponentDrag_dec = [action], _cancelNewComponentDrag_dec = [action], _setValidRootIds_dec = [action], _setInvalidDropTarget_dec = [action], _setDropTargetId_dec = [action], _setActiveDragRect_dec = [action], _setActiveTargetRect_dec = [action], _setWidgetPosition_dec = [action], _updateChildPositions_dec = [action];
|
|
100367
100389
|
class DragAndDropManager {
|
|
100368
100390
|
constructor(root2) {
|
|
@@ -111343,7 +111365,7 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
111343
111365
|
return baseUpdate;
|
|
111344
111366
|
}
|
|
111345
111367
|
if (previousProps.layout !== "freeform" && newProps.layout === "freeform" && ((_a2 = newProps.width) == null ? void 0 : _a2.mode) === "fit") {
|
|
111346
|
-
const runtimeWidgetRect2 = (_d2 = (_c2 = (_b2 = editStore2.interactionLayerManager.getSourceIdElements(sourceId)) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.
|
|
111368
|
+
const runtimeWidgetRect2 = (_d2 = (_c2 = (_b2 = editStore2.interactionLayerManager.getSourceIdElements(sourceId)) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.element) == null ? void 0 : _d2.getBoundingClientRect();
|
|
111347
111369
|
const pixelWidth = runtimeWidgetRect2 == null ? void 0 : runtimeWidgetRect2.width;
|
|
111348
111370
|
baseUpdate[sourceId].props = {
|
|
111349
111371
|
...updates,
|
|
@@ -111352,7 +111374,7 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
111352
111374
|
};
|
|
111353
111375
|
}
|
|
111354
111376
|
const runtimeWidget = editStore2.runtimeEntitiesManager.getAnyEditorWidgetMeta(sourceId);
|
|
111355
|
-
const runtimeWidgetRect = (_g2 = (_f2 = (_e2 = editStore2.interactionLayerManager.getSourceIdElements(sourceId)) == null ? void 0 : _e2[0]) == null ? void 0 : _f2.
|
|
111377
|
+
const runtimeWidgetRect = (_g2 = (_f2 = (_e2 = editStore2.interactionLayerManager.getSourceIdElements(sourceId)) == null ? void 0 : _e2[0]) == null ? void 0 : _f2.element) == null ? void 0 : _g2.getBoundingClientRect();
|
|
111356
111378
|
if (!runtimeWidget || !runtimeWidgetRect) {
|
|
111357
111379
|
return baseUpdate;
|
|
111358
111380
|
}
|
|
@@ -111366,7 +111388,7 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
111366
111388
|
sourceId: child.sourceId,
|
|
111367
111389
|
element: (_b3 = (_a3 = editStore2.interactionLayerManager.getSourceIdElements(
|
|
111368
111390
|
child.sourceId
|
|
111369
|
-
)) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.
|
|
111391
|
+
)) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.element
|
|
111370
111392
|
};
|
|
111371
111393
|
}).filter(({ element }) => !!element)) ?? [];
|
|
111372
111394
|
if ("layout" in updates && updates.layout.value === "freeform") {
|
|
@@ -115284,19 +115306,21 @@ const DroppableWidget = observer(
|
|
|
115284
115306
|
}
|
|
115285
115307
|
);
|
|
115286
115308
|
function useRegisterSourceElement(sourceId) {
|
|
115287
|
-
const
|
|
115309
|
+
const instanceIdRef = useRef(null);
|
|
115288
115310
|
return useCallback(
|
|
115289
115311
|
(element) => {
|
|
115290
115312
|
if (element) {
|
|
115291
|
-
|
|
115292
|
-
getEditStore().interactionLayerManager.setSourceIdElement(
|
|
115313
|
+
const instanceId = getEditStore().interactionLayerManager.setSourceIdElement(
|
|
115293
115314
|
element,
|
|
115294
115315
|
sourceId
|
|
115295
115316
|
);
|
|
115317
|
+
if (instanceId) {
|
|
115318
|
+
instanceIdRef.current = instanceId;
|
|
115319
|
+
}
|
|
115296
115320
|
} else {
|
|
115297
|
-
if (
|
|
115321
|
+
if (instanceIdRef.current) {
|
|
115298
115322
|
getEditStore().interactionLayerManager.removeSourceIdElement(
|
|
115299
|
-
|
|
115323
|
+
instanceIdRef.current
|
|
115300
115324
|
);
|
|
115301
115325
|
}
|
|
115302
115326
|
}
|
|
@@ -144710,14 +144734,14 @@ function getLoaderFn(options) {
|
|
|
144710
144734
|
if (!(loader === "all")) return [3, 3];
|
|
144711
144735
|
return [4, import(
|
|
144712
144736
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
144713
|
-
"./allPathsLoader-
|
|
144737
|
+
"./allPathsLoader-DXmNAbaz.js"
|
|
144714
144738
|
)];
|
|
144715
144739
|
case 2:
|
|
144716
144740
|
return [2, _b2.sent().allPathsLoader];
|
|
144717
144741
|
case 3:
|
|
144718
144742
|
return [4, import(
|
|
144719
144743
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
144720
|
-
"./splitPathsBySizeLoader-
|
|
144744
|
+
"./splitPathsBySizeLoader-CWNr4mDJ.js"
|
|
144721
144745
|
)];
|
|
144722
144746
|
case 4:
|
|
144723
144747
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -196980,4 +197004,4 @@ export {
|
|
|
196980
197004
|
copyToClipboard as y,
|
|
196981
197005
|
navigateTo as z
|
|
196982
197006
|
};
|
|
196983
|
-
//# sourceMappingURL=index-
|
|
197007
|
+
//# sourceMappingURL=index-HBvkJUiu.js.map
|