@superblocksteam/library 2.0.0-next.107 → 2.0.0-next.109
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-CDxZNKK6.js → allPaths-C9t-oueG.js} +2 -2
- package/dist/{allPaths-CDxZNKK6.js.map → allPaths-C9t-oueG.js.map} +1 -1
- package/dist/{allPaths-C87GcBiX.js → allPaths-v-9aWvcC.js} +2 -2
- package/dist/{allPaths-C87GcBiX.js.map → allPaths-v-9aWvcC.js.map} +1 -1
- package/dist/{allPathsLoader-DSfR6N4x.js → allPathsLoader-C12f21WG.js} +3 -3
- package/dist/{allPathsLoader-Tn_25haG.js.map → allPathsLoader-C12f21WG.js.map} +1 -1
- package/dist/{allPathsLoader-Tn_25haG.js → allPathsLoader-ptt7LSRI.js} +3 -3
- package/dist/{allPathsLoader-DSfR6N4x.js.map → allPathsLoader-ptt7LSRI.js.map} +1 -1
- package/dist/{index-BVFDrjgu.js → index-Dmuv9J5-.js} +167 -81
- package/dist/{index-BVFDrjgu.js.map → index-Dmuv9J5-.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{splitPathsBySizeLoader-yjB1zNTJ.js → splitPathsBySizeLoader-C9M7hrZo.js} +2 -2
- package/dist/{splitPathsBySizeLoader-yjB1zNTJ.js.map → splitPathsBySizeLoader-C9M7hrZo.js.map} +1 -1
- package/dist/{splitPathsBySizeLoader-AOJMwnbQ.js → splitPathsBySizeLoader-yx8MCpqw.js} +2 -2
- package/dist/{splitPathsBySizeLoader-AOJMwnbQ.js.map → splitPathsBySizeLoader-yx8MCpqw.js.map} +1 -1
- package/dist-types/edit-mode/create-component.d.ts +3 -1
- package/dist-types/edit-mode/dnd/utils.d.ts +4 -0
- package/dist-types/edit-mode/features/interaction-layer-manager.d.ts +10 -4
- package/dist-types/edit-mode/features/operation-store.d.ts +11 -2
- package/dist-types/edit-mode/interaction-utils.d.ts +4 -0
- package/dist-types/lib/internal-details/lib/types.d.ts +2 -0
- package/package.json +2 -2
|
@@ -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-Dmuv9J5-.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-C9t-oueG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPaths-
|
|
1
|
+
{"version":3,"file":"allPaths-C9t-oueG.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,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-Dmuv9J5-.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-v-9aWvcC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPaths-
|
|
1
|
+
{"version":3,"file":"allPaths-v-9aWvcC.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,4 +1,4 @@
|
|
|
1
|
-
import { _ as __awaiter, a as __generator } from "./index-
|
|
1
|
+
import { _ as __awaiter, a as __generator } from "./index-Dmuv9J5-.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-v-9aWvcC.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-C12f21WG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPathsLoader-
|
|
1
|
+
{"version":3,"file":"allPathsLoader-C12f21WG.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]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __awaiter, a as __generator } from "./index-
|
|
1
|
+
import { _ as __awaiter, a as __generator } from "./index-Dmuv9J5-.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-C9t-oueG.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-ptt7LSRI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allPathsLoader-
|
|
1
|
+
{"version":3,"file":"allPathsLoader-ptt7LSRI.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]}
|
|
@@ -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-ptt7LSRI.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-yx8MCpqw.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;
|
|
@@ -98663,7 +98732,11 @@ class OperationManager {
|
|
|
98663
98732
|
payload: { element: { source: { id: sourceId } }, properties: updates }
|
|
98664
98733
|
});
|
|
98665
98734
|
}
|
|
98666
|
-
setWidgetProperties(
|
|
98735
|
+
setWidgetProperties({
|
|
98736
|
+
sourceId,
|
|
98737
|
+
properties: properties2,
|
|
98738
|
+
callback
|
|
98739
|
+
}) {
|
|
98667
98740
|
const payload = {
|
|
98668
98741
|
element: {
|
|
98669
98742
|
source: {
|
|
@@ -98678,8 +98751,17 @@ class OperationManager {
|
|
|
98678
98751
|
callback
|
|
98679
98752
|
});
|
|
98680
98753
|
}
|
|
98681
|
-
setWidgetProperty(
|
|
98682
|
-
|
|
98754
|
+
setWidgetProperty({
|
|
98755
|
+
sourceId,
|
|
98756
|
+
property,
|
|
98757
|
+
value,
|
|
98758
|
+
callback
|
|
98759
|
+
}) {
|
|
98760
|
+
this.setWidgetProperties({
|
|
98761
|
+
sourceId,
|
|
98762
|
+
properties: { [property]: value },
|
|
98763
|
+
callback
|
|
98764
|
+
});
|
|
98683
98765
|
}
|
|
98684
98766
|
renameWidget(params) {
|
|
98685
98767
|
var _a2;
|
|
@@ -99541,6 +99623,10 @@ const StackLikeContainerTypes = /* @__PURE__ */ new Set([
|
|
|
99541
99623
|
...VStackLikeContainerTypes,
|
|
99542
99624
|
...HStackLikeContainerTypes
|
|
99543
99625
|
]);
|
|
99626
|
+
const detachedComponentTypeList = ["SbModal", "SbSlideout"];
|
|
99627
|
+
const DetachedComponentTypes = new Set(
|
|
99628
|
+
detachedComponentTypeList
|
|
99629
|
+
);
|
|
99544
99630
|
function rule(description, restriction) {
|
|
99545
99631
|
return {
|
|
99546
99632
|
description,
|
|
@@ -99612,6 +99698,9 @@ const isContentDraggable = (type5) => {
|
|
|
99612
99698
|
return isTypeDraggable(type5) && type5 !== "SbColumn" && type5 !== "SbSection";
|
|
99613
99699
|
};
|
|
99614
99700
|
function shouldWrapInSectionAndColumn(type5, parentType) {
|
|
99701
|
+
if (DetachedComponentTypes.has(type5)) {
|
|
99702
|
+
return false;
|
|
99703
|
+
}
|
|
99615
99704
|
return parentType === "SbPage" && type5 !== "SbSection" || parentType === "SbSection" && type5 !== "SbColumn";
|
|
99616
99705
|
}
|
|
99617
99706
|
const filterSafeStackDimensionProperties = (existingProps) => {
|
|
@@ -100316,53 +100405,6 @@ class StackManager {
|
|
|
100316
100405
|
return dragInfo ?? { insertionIndex: void 0, placeholders: void 0 };
|
|
100317
100406
|
}
|
|
100318
100407
|
}
|
|
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
100408
|
_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
100409
|
class DragAndDropManager {
|
|
100368
100410
|
constructor(root2) {
|
|
@@ -100929,13 +100971,13 @@ class ResizingManager {
|
|
|
100929
100971
|
}
|
|
100930
100972
|
};
|
|
100931
100973
|
if (Object.keys(properties2).length > 0) {
|
|
100932
|
-
(_b2 = this.root.editStore) == null ? void 0 : _b2.operationManager.setWidgetProperties(
|
|
100933
|
-
resizeState.sourceId,
|
|
100934
|
-
properties2,
|
|
100935
|
-
() => {
|
|
100974
|
+
(_b2 = this.root.editStore) == null ? void 0 : _b2.operationManager.setWidgetProperties({
|
|
100975
|
+
sourceId: resizeState.sourceId,
|
|
100976
|
+
properties: properties2,
|
|
100977
|
+
callback: () => {
|
|
100936
100978
|
this._activeResizes.delete(sourceId);
|
|
100937
100979
|
}
|
|
100938
|
-
);
|
|
100980
|
+
});
|
|
100939
100981
|
}
|
|
100940
100982
|
}
|
|
100941
100983
|
}
|
|
@@ -111343,7 +111385,7 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
111343
111385
|
return baseUpdate;
|
|
111344
111386
|
}
|
|
111345
111387
|
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.
|
|
111388
|
+
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
111389
|
const pixelWidth = runtimeWidgetRect2 == null ? void 0 : runtimeWidgetRect2.width;
|
|
111348
111390
|
baseUpdate[sourceId].props = {
|
|
111349
111391
|
...updates,
|
|
@@ -111352,7 +111394,7 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
111352
111394
|
};
|
|
111353
111395
|
}
|
|
111354
111396
|
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.
|
|
111397
|
+
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
111398
|
if (!runtimeWidget || !runtimeWidgetRect) {
|
|
111357
111399
|
return baseUpdate;
|
|
111358
111400
|
}
|
|
@@ -111366,7 +111408,7 @@ const containerLayout = (sizeProps) => Prop.union({
|
|
|
111366
111408
|
sourceId: child.sourceId,
|
|
111367
111409
|
element: (_b3 = (_a3 = editStore2.interactionLayerManager.getSourceIdElements(
|
|
111368
111410
|
child.sourceId
|
|
111369
|
-
)) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.
|
|
111411
|
+
)) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.element
|
|
111370
111412
|
};
|
|
111371
111413
|
}).filter(({ element }) => !!element)) ?? [];
|
|
111372
111414
|
if ("layout" in updates && updates.layout.value === "freeform") {
|
|
@@ -115284,19 +115326,21 @@ const DroppableWidget = observer(
|
|
|
115284
115326
|
}
|
|
115285
115327
|
);
|
|
115286
115328
|
function useRegisterSourceElement(sourceId) {
|
|
115287
|
-
const
|
|
115329
|
+
const instanceIdRef = useRef(null);
|
|
115288
115330
|
return useCallback(
|
|
115289
115331
|
(element) => {
|
|
115290
115332
|
if (element) {
|
|
115291
|
-
|
|
115292
|
-
getEditStore().interactionLayerManager.setSourceIdElement(
|
|
115333
|
+
const instanceId = getEditStore().interactionLayerManager.setSourceIdElement(
|
|
115293
115334
|
element,
|
|
115294
115335
|
sourceId
|
|
115295
115336
|
);
|
|
115337
|
+
if (instanceId) {
|
|
115338
|
+
instanceIdRef.current = instanceId;
|
|
115339
|
+
}
|
|
115296
115340
|
} else {
|
|
115297
|
-
if (
|
|
115341
|
+
if (instanceIdRef.current) {
|
|
115298
115342
|
getEditStore().interactionLayerManager.removeSourceIdElement(
|
|
115299
|
-
|
|
115343
|
+
instanceIdRef.current
|
|
115300
115344
|
);
|
|
115301
115345
|
}
|
|
115302
115346
|
}
|
|
@@ -116014,7 +116058,9 @@ async function createComponent({
|
|
|
116014
116058
|
componentType,
|
|
116015
116059
|
parent,
|
|
116016
116060
|
scopeName,
|
|
116017
|
-
baseProperties = {}
|
|
116061
|
+
baseProperties = {},
|
|
116062
|
+
skipTriggerCreation,
|
|
116063
|
+
otherComponentsUpdates
|
|
116018
116064
|
}) {
|
|
116019
116065
|
const parentInfo = getParentInfo(parent);
|
|
116020
116066
|
if (!checkComponentForParentTypeBeforeCreating(componentType, parentInfo.type)) {
|
|
@@ -116043,10 +116089,23 @@ async function createComponent({
|
|
|
116043
116089
|
};
|
|
116044
116090
|
console.log("creating component", { tagName, properties: properties2 });
|
|
116045
116091
|
const parentElement = { source: parent };
|
|
116046
|
-
const
|
|
116092
|
+
const isDetachedComponent = DetachedComponentTypes.has(componentType);
|
|
116093
|
+
const needTriggerComponent = isDetachedComponent && !skipTriggerCreation;
|
|
116047
116094
|
const editStore2 = getEditStore();
|
|
116095
|
+
const parentInstanceId = editStore2.runtimeEntitiesManager.widgets.getAnyInstanceIdForSourceId(
|
|
116096
|
+
parent.id
|
|
116097
|
+
);
|
|
116098
|
+
const pageComponent = editStore2.runtimeEntitiesManager.getClosestAncestorByType(
|
|
116099
|
+
parentInstanceId,
|
|
116100
|
+
"SbPage"
|
|
116101
|
+
);
|
|
116102
|
+
const pageSource = {
|
|
116103
|
+
source: {
|
|
116104
|
+
id: pageComponent == null ? void 0 : pageComponent.sourceId
|
|
116105
|
+
}
|
|
116106
|
+
};
|
|
116048
116107
|
let primaryComponent = {
|
|
116049
|
-
parentElement,
|
|
116108
|
+
parentElement: isDetachedComponent ? pageSource : parentElement,
|
|
116050
116109
|
tagName,
|
|
116051
116110
|
properties: properties2,
|
|
116052
116111
|
children,
|
|
@@ -116059,6 +116118,14 @@ async function createComponent({
|
|
|
116059
116118
|
parentInfo.type
|
|
116060
116119
|
);
|
|
116061
116120
|
}
|
|
116121
|
+
const performOtherComponentsUpdates = (otherComponentsUpdates2) => {
|
|
116122
|
+
Object.entries(otherComponentsUpdates2).forEach(([sourceId, updates]) => {
|
|
116123
|
+
editStore2.operationManager.setWidgetProperties({
|
|
116124
|
+
sourceId,
|
|
116125
|
+
properties: updates
|
|
116126
|
+
});
|
|
116127
|
+
});
|
|
116128
|
+
};
|
|
116062
116129
|
if (needTriggerComponent) {
|
|
116063
116130
|
const triggerComponent = getTriggerComponent({
|
|
116064
116131
|
componentType,
|
|
@@ -116069,10 +116136,20 @@ async function createComponent({
|
|
|
116069
116136
|
editStore2.operationManager.batchUpdate(() => {
|
|
116070
116137
|
editStore2.operationManager.createComponent(triggerComponent);
|
|
116071
116138
|
editStore2.operationManager.createComponent(primaryComponent);
|
|
116139
|
+
if (otherComponentsUpdates) {
|
|
116140
|
+
performOtherComponentsUpdates(otherComponentsUpdates);
|
|
116141
|
+
}
|
|
116072
116142
|
});
|
|
116073
116143
|
return triggerComponent.id;
|
|
116074
116144
|
} else {
|
|
116075
|
-
|
|
116145
|
+
if (otherComponentsUpdates) {
|
|
116146
|
+
editStore2.operationManager.batchUpdate(() => {
|
|
116147
|
+
editStore2.operationManager.createComponent(primaryComponent);
|
|
116148
|
+
performOtherComponentsUpdates(otherComponentsUpdates);
|
|
116149
|
+
});
|
|
116150
|
+
} else {
|
|
116151
|
+
editStore2.operationManager.createComponent(primaryComponent);
|
|
116152
|
+
}
|
|
116076
116153
|
return primaryComponent.id;
|
|
116077
116154
|
}
|
|
116078
116155
|
}
|
|
@@ -144710,14 +144787,14 @@ function getLoaderFn(options) {
|
|
|
144710
144787
|
if (!(loader === "all")) return [3, 3];
|
|
144711
144788
|
return [4, import(
|
|
144712
144789
|
/* webpackChunkName: "blueprint-icons-all-paths-loader" */
|
|
144713
|
-
"./allPathsLoader-
|
|
144790
|
+
"./allPathsLoader-C12f21WG.js"
|
|
144714
144791
|
)];
|
|
144715
144792
|
case 2:
|
|
144716
144793
|
return [2, _b2.sent().allPathsLoader];
|
|
144717
144794
|
case 3:
|
|
144718
144795
|
return [4, import(
|
|
144719
144796
|
/* webpackChunkName: "blueprint-icons-split-paths-by-size-loader" */
|
|
144720
|
-
"./splitPathsBySizeLoader-
|
|
144797
|
+
"./splitPathsBySizeLoader-C9M7hrZo.js"
|
|
144721
144798
|
)];
|
|
144722
144799
|
case 4:
|
|
144723
144800
|
return [2, _b2.sent().splitPathsBySizeLoader];
|
|
@@ -183687,13 +183764,22 @@ const EmbedWrapper = (props2) => {
|
|
|
183687
183764
|
updatePropertyWithEffectsListener
|
|
183688
183765
|
);
|
|
183689
183766
|
const createComponentListener = async (event) => {
|
|
183690
|
-
const {
|
|
183767
|
+
const {
|
|
183768
|
+
componentType,
|
|
183769
|
+
parent,
|
|
183770
|
+
scopeName,
|
|
183771
|
+
baseProperties,
|
|
183772
|
+
skipTriggerCreation,
|
|
183773
|
+
otherComponentsUpdates
|
|
183774
|
+
} = event.data.payload;
|
|
183691
183775
|
try {
|
|
183692
183776
|
await createComponent({
|
|
183693
183777
|
componentType,
|
|
183694
183778
|
parent,
|
|
183695
183779
|
scopeName,
|
|
183696
|
-
baseProperties
|
|
183780
|
+
baseProperties,
|
|
183781
|
+
skipTriggerCreation,
|
|
183782
|
+
otherComponentsUpdates
|
|
183697
183783
|
});
|
|
183698
183784
|
} catch (error2) {
|
|
183699
183785
|
console.error("Failed to create component:", error2);
|
|
@@ -196980,4 +197066,4 @@ export {
|
|
|
196980
197066
|
copyToClipboard as y,
|
|
196981
197067
|
navigateTo as z
|
|
196982
197068
|
};
|
|
196983
|
-
//# sourceMappingURL=index-
|
|
197069
|
+
//# sourceMappingURL=index-Dmuv9J5-.js.map
|