@next-core/editor-bricks-helper 0.35.4 → 0.37.0
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/CHANGELOG.md +36 -0
- package/dist/index.bundle.js +19 -11
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +19 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/types/DropZone/DropZone.d.ts +2 -1
- package/dist/types/SlotContainer/SlotContainer.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,42 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.37.0](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.36.1...@next-core/editor-bricks-helper@0.37.0) (2022-03-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* support get widget editor brick ([ca88ed4](https://github.com/easyops-cn/next-core/commit/ca88ed4d440472229ff0b760625eba3b1dbd923e))
|
|
12
|
+
* update unit test ([f9760ab](https://github.com/easyops-cn/next-core/commit/f9760abcff5c2e0375ab968145630d20035232bc))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## [0.36.1](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.36.0...@next-core/editor-bricks-helper@0.36.1) (2022-03-09)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* refine builder node name ([d2ed295](https://github.com/easyops-cn/next-core/commit/d2ed2958adb77b1a41c9ef927c7c89b596da7fae))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# [0.36.0](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.35.4...@next-core/editor-bricks-helper@0.36.0) (2022-03-08)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* support dropZone add Empty ClassName ([5fbdd83](https://github.com/easyops-cn/next-core/commit/5fbdd83792d4ba54ece99953afcd6713c497dbb1))
|
|
35
|
+
* update dropZone add emptyClassName ([f539585](https://github.com/easyops-cn/next-core/commit/f539585b936abf3de416d2d47867a4f7603e77c9))
|
|
36
|
+
* update dropZone style ([53e2015](https://github.com/easyops-cn/next-core/commit/53e2015384c6f698218714b9267ef9430ad92ddd))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
6
42
|
## [0.35.4](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.35.3...@next-core/editor-bricks-helper@0.35.4) (2022-03-07)
|
|
7
43
|
|
|
8
44
|
**Note:** Version bump only for package @next-core/editor-bricks-helper
|
package/dist/index.bundle.js
CHANGED
|
@@ -443,16 +443,16 @@
|
|
|
443
443
|
var tempParsedId = void 0;
|
|
444
444
|
var tempParsedTestId = void 0;
|
|
445
445
|
|
|
446
|
-
if ((
|
|
446
|
+
if ((tempParsedTestId = parsed === null || parsed === void 0 ? void 0 : (_parsed$dataset = parsed.dataset) === null || _parsed$dataset === void 0 ? void 0 : _parsed$dataset.testid, typeof tempParsedTestId === "string") && !computationRegExp.test(tempParsedTestId)) {
|
|
447
|
+
parsedTestId = tempParsedTestId;
|
|
448
|
+
} else if ((tempParsedId = parsed === null || parsed === void 0 ? void 0 : parsed.id, typeof tempParsedId === "string") && !computationRegExp.test(tempParsedId)) {
|
|
447
449
|
parsedId = tempParsedId;
|
|
448
450
|
matchedSelectors.push("#".concat(parsedId));
|
|
449
|
-
} else if ((tempParsedTestId = parsed === null || parsed === void 0 ? void 0 : (_parsed$dataset = parsed.dataset) === null || _parsed$dataset === void 0 ? void 0 : _parsed$dataset.testid, typeof tempParsedTestId === "string") && !computationRegExp.test(tempParsedTestId)) {
|
|
450
|
-
parsedTestId = tempParsedTestId;
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
-
return Object.fromEntries(Object.entries(nodeData).filter(entry => !nodeIgnoreFields.includes(entry[0])).concat([["alias", nodeData.alias || (brickUtils.isBrickNode(nodeData) ?
|
|
455
|
+
return Object.fromEntries(Object.entries(nodeData).filter(entry => !nodeIgnoreFields.includes(entry[0])).concat([["alias", nodeData.alias || (brickUtils.isBrickNode(nodeData) ? nodeData.ref || parsedTestId || parsedId || nodeData.brick.split(".").pop() : undefined)], ["$$uid", nodeUid], ["$$matchedSelectors", matchedSelectors], ["$$isTemplateInternalNode", isTemplateInternalNode], ["$$normalized", normalized]]).concat(parsedFields));
|
|
456
456
|
}
|
|
457
457
|
|
|
458
458
|
function getAppendingNodesAndEdges(nodeData, nodeUid, templateSourceMap) {
|
|
@@ -1514,7 +1514,11 @@
|
|
|
1514
1514
|
tryEditorBricks.push(ANY_ROUTE_EDITOR);
|
|
1515
1515
|
} else if (brickUtils.isBrickNode(node)) {
|
|
1516
1516
|
if (node.brick.includes("-")) {
|
|
1517
|
+
var _node$brick$split$;
|
|
1518
|
+
|
|
1519
|
+
var isWidget = (_node$brick$split$ = node.brick.split(".")[1]) === null || _node$brick$split$ === void 0 ? void 0 : _node$brick$split$.startsWith("tpl-");
|
|
1517
1520
|
tryEditorBricks.push("".concat(node.brick, "--editor"));
|
|
1521
|
+
isWidget && tryEditorBricks.push("editors-of-".concat(node.brick, "--editor"));
|
|
1518
1522
|
}
|
|
1519
1523
|
|
|
1520
1524
|
if (editor) {
|
|
@@ -1656,7 +1660,7 @@
|
|
|
1656
1660
|
ref: node.$$isTemplateInternalNode ? undefined : dragRef,
|
|
1657
1661
|
draggable: !node.$$isTemplateInternalNode,
|
|
1658
1662
|
className: classNames({
|
|
1659
|
-
[styles$2.baseView]: node.brick === "basic-bricks.micro-view" || node.brick === "basic-bricks.micro-app" || node.brick === "basic-bricks.easy-view"
|
|
1663
|
+
[styles$2.baseView]: node.brick === "basic-bricks.micro-view" || node.brick === "basic-bricks.micro-app" || node.brick === "basic-bricks.easy-view" || node.brick === "frame-bricks.side-bar"
|
|
1660
1664
|
})
|
|
1661
1665
|
}, /*#__PURE__*/React__default["default"].createElement(brickKit.BrickAsComponent, {
|
|
1662
1666
|
useBrick: brickConf
|
|
@@ -2183,8 +2187,8 @@
|
|
|
2183
2187
|
}, [rootChildNodes]);
|
|
2184
2188
|
}
|
|
2185
2189
|
|
|
2186
|
-
var css_248z$1 = ".DropZone--dropZone--
|
|
2187
|
-
var styles$1 = {"dropZone":"DropZone--dropZone--
|
|
2190
|
+
var css_248z$1 = ".DropZone--dropZone--189f8p9 {\n position: relative;\n min-height: calc(var(--editor-brick-base-height) + 2px);\n border-radius: var(--editor-brick-border-radius);\n\n --drop-zone-padding: 20px;\n}\n\n.DropZone--isSlot--189f8p9 {\n border: 1px dashed transparent;\n}\n\n.DropZone--isSlot--189f8p9.DropZone--dropping--189f8p9 {\n background: var(--editor-brick-slot-bg);\n border-color: var(--editor-brick-slot-stroke-color);\n}\n\n.DropZone--showOutlineIfEmpty--189f8p9:not(.DropZone--dropping--189f8p9) {\n background: var(--editor-brick-skeleton-bg-light);\n}\n\n.DropZone--isRoot--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n padding: calc(var(--drop-zone-padding) + 7px) var(--drop-zone-padding)\n var(--drop-zone-padding);\n}\n\n.DropZone--isRoot--189f8p9.DropZone--active--189f8p9,\n.DropZone--isRoot--189f8p9.DropZone--dropping--189f8p9 {\n box-shadow: 0 0 0 1px var(--editor-brick-stroke-color-active);\n}\n\n.DropZone--isPortalCanvas--189f8p9,\n.DropZone--isRoot--189f8p9:not(.DropZone--isPortalCanvas--189f8p9) > .DropZone--dropZoneBody--189f8p9 {\n height: calc(\n 100vh - 148px - var(--editor-brick-toolbar-height) - var(--page-card-gap)\n );\n overflow-y: auto;\n}\n\n.DropZone--fullscreen--189f8p9.DropZone--isPortalCanvas--189f8p9,\n.DropZone--fullscreen--189f8p9:not(.DropZone--isPortalCanvas--189f8p9) > .DropZone--dropZoneBody--189f8p9 {\n height: calc(\n 100vh - var(--editor-brick-overlay-padding) * 2 - var(--page-card-gap) * 2 -\n var(--editor-brick-toolbar-height)\n );\n}\n\n.DropZone--hasTabs--189f8p9.DropZone--isPortalCanvas--189f8p9,\n.DropZone--hasTabs--189f8p9.DropZone--isRoot--189f8p9:not(.DropZone--isPortalCanvas--189f8p9) > .DropZone--dropZoneBody--189f8p9 {\n height: calc(\n 100vh - 158px - var(--editor-brick-toolbar-height) - var(--page-card-gap)\n );\n overflow-y: auto;\n}\n\n.DropZone--hasTabs--189f8p9.DropZone--fullscreen--189f8p9.DropZone--isPortalCanvas--189f8p9,\n.DropZone--hasTabs--189f8p9.DropZone--fullscreen--189f8p9:not(.DropZone--isPortalCanvas--189f8p9) > .DropZone--dropZoneBody--189f8p9 {\n height: calc(\n 100vh - var(--editor-brick-overlay-padding) * 2 - var(--page-card-gap) * 2 -\n 10px - var(--editor-brick-toolbar-height)\n );\n}\n\n.DropZone--slotContentLayoutBlock--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n display: grid;\n grid-gap: var(--editor-brick-gap);\n grid-template-columns: repeat(\n auto-fill,\n minmax(var(--editor-brick-inline-width), 1fr)\n );\n}\n\n.DropZone--slotContentLayoutInline--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n display: flex;\n flex-wrap: wrap;\n margin: 0 calc(var(--editor-brick-gap-half) * -1);\n}\n\n.DropZone--slotContentLayoutGrid--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n display: grid;\n grid-gap: var(--editor-brick-gap);\n grid-template-columns: repeat(\n auto-fill,\n minmax(var(--editor-brick-grid-width), 1fr)\n );\n height: 100%;\n}\n\n.DropZone--mode-dialog--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n margin: 0 auto;\n max-width: calc(600px + var(--drop-zone-padding) * 2);\n}\n\n.DropZone--mode-dialog--189f8p9.DropZone--mode-large--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n max-width: calc(800px + var(--drop-zone-padding) * 2);\n}\n\n.DropZone--mode-dialog--189f8p9.DropZone--mode-small--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n max-width: calc(400px + var(--drop-zone-padding) * 2);\n}\n\n.DropZone--mode-drawer--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n margin: 0 auto;\n max-width: calc(900px + var(--drop-zone-padding) * 2);\n}\n\n.DropZone--mode-drawer--189f8p9.DropZone--mode-large--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n max-width: calc(1200px + var(--drop-zone-padding) * 2);\n}\n\n.DropZone--mode-drawer--189f8p9.DropZone--mode-small--189f8p9 > .DropZone--dropZoneBody--189f8p9 {\n max-width: calc(600px + var(--drop-zone-padding) * 2);\n}\n\n.DropZone--dropCursor--189f8p9 {\n position: absolute;\n background: #bb79bb;\n display: none;\n pointer-events: none;\n}\n\n.DropZone--dropping--189f8p9 > .DropZone--dropCursor--189f8p9 {\n display: block;\n}\n\n.DropZone--dropCursorHorizontal--189f8p9 {\n height: 2px;\n left: 10px;\n right: 10px;\n margin-top: -1px;\n}\n\n.DropZone--dropCursorVertical--189f8p9 {\n width: 2px;\n margin-left: -1px;\n}\n\n.DropZone--dropCursor--189f8p9::before,\n.DropZone--dropCursor--189f8p9::after {\n position: absolute;\n content: \"\";\n background: #bb79bb;\n}\n\n.DropZone--dropCursorHorizontal--189f8p9::before,\n.DropZone--dropCursorHorizontal--189f8p9::after {\n top: -4px;\n height: 10px;\n width: 2px;\n}\n\n.DropZone--dropCursorHorizontal--189f8p9::before {\n left: 0;\n}\n\n.DropZone--dropCursorHorizontal--189f8p9::after {\n right: 0;\n}\n\n.DropZone--dropCursorVertical--189f8p9::before,\n.DropZone--dropCursorVertical--189f8p9::after {\n left: -4px;\n width: 10px;\n height: 2px;\n}\n\n.DropZone--dropCursorVertical--189f8p9::before {\n top: 0;\n}\n\n.DropZone--dropCursorVertical--189f8p9::after {\n bottom: 0;\n}\n";
|
|
2191
|
+
var styles$1 = {"dropZone":"DropZone--dropZone--189f8p9","isSlot":"DropZone--isSlot--189f8p9","dropping":"DropZone--dropping--189f8p9","showOutlineIfEmpty":"DropZone--showOutlineIfEmpty--189f8p9","isRoot":"DropZone--isRoot--189f8p9","dropZoneBody":"DropZone--dropZoneBody--189f8p9","active":"DropZone--active--189f8p9","isPortalCanvas":"DropZone--isPortalCanvas--189f8p9","fullscreen":"DropZone--fullscreen--189f8p9","hasTabs":"DropZone--hasTabs--189f8p9","slotContentLayoutBlock":"DropZone--slotContentLayoutBlock--189f8p9","slotContentLayoutInline":"DropZone--slotContentLayoutInline--189f8p9","slotContentLayoutGrid":"DropZone--slotContentLayoutGrid--189f8p9","mode-dialog":"DropZone--mode-dialog--189f8p9","mode-large":"DropZone--mode-large--189f8p9","mode-small":"DropZone--mode-small--189f8p9","mode-drawer":"DropZone--mode-drawer--189f8p9","dropCursor":"DropZone--dropCursor--189f8p9","dropCursorHorizontal":"DropZone--dropCursorHorizontal--189f8p9","dropCursorVertical":"DropZone--dropCursorVertical--189f8p9"};
|
|
2188
2192
|
styleInject(css_248z$1);
|
|
2189
2193
|
|
|
2190
2194
|
var _excluded = ["type"];
|
|
@@ -2203,7 +2207,8 @@
|
|
|
2203
2207
|
dropZoneBodyStyle,
|
|
2204
2208
|
slotContentLayout,
|
|
2205
2209
|
showOutlineIfEmpty,
|
|
2206
|
-
hiddenWrapper = true
|
|
2210
|
+
hiddenWrapper = true,
|
|
2211
|
+
emptyClassName
|
|
2207
2212
|
} = _ref;
|
|
2208
2213
|
var dropZoneBody = React__default["default"].useRef();
|
|
2209
2214
|
var [dropPositionCursor, setDropPositionCursor] = React__default["default"].useState(null);
|
|
@@ -2363,7 +2368,8 @@
|
|
|
2363
2368
|
onContextMenu: isRoot ? handleContextMenu : null
|
|
2364
2369
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2365
2370
|
ref: dropZoneBody,
|
|
2366
|
-
className: styles$1.dropZoneBody,
|
|
2371
|
+
className: classNames(styles$1.dropZoneBody, selfChildNodesInCurrentCanvas.length === 0 && emptyClassName),
|
|
2372
|
+
"data-slot-id": mountPoint,
|
|
2367
2373
|
style: dropZoneBodyStyle
|
|
2368
2374
|
}, selfChildNodesInCurrentCanvas.map(child => /*#__PURE__*/React__default["default"].createElement(EditorBrickAsComponent, {
|
|
2369
2375
|
key: child.$$uid,
|
|
@@ -2394,7 +2400,8 @@
|
|
|
2394
2400
|
dropZoneStyle,
|
|
2395
2401
|
dropZoneBodyStyle,
|
|
2396
2402
|
slotContentLayout,
|
|
2397
|
-
showOutlineIfEmpty
|
|
2403
|
+
showOutlineIfEmpty,
|
|
2404
|
+
emptyClassName
|
|
2398
2405
|
} = _ref;
|
|
2399
2406
|
var node = useBuilderNode({
|
|
2400
2407
|
nodeUid
|
|
@@ -2421,7 +2428,8 @@
|
|
|
2421
2428
|
dropZoneStyle: dropZoneStyle,
|
|
2422
2429
|
dropZoneBodyStyle: dropZoneBodyStyle,
|
|
2423
2430
|
slotContentLayout: slotContentLayout,
|
|
2424
|
-
showOutlineIfEmpty: showOutlineIfEmpty
|
|
2431
|
+
showOutlineIfEmpty: showOutlineIfEmpty,
|
|
2432
|
+
emptyClassName: emptyClassName
|
|
2425
2433
|
}));
|
|
2426
2434
|
}
|
|
2427
2435
|
|