@logicflow/react-node-registry 1.2.0-alpha.1 → 1.2.0-alpha.3

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.
Files changed (57) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/CHANGELOG.md +15 -0
  3. package/dist/index.css +122 -0
  4. package/es/components/Container.d.ts +9 -0
  5. package/es/components/Container.js +16 -0
  6. package/es/components/Container.js.map +1 -0
  7. package/es/components/TitleBar.d.ts +8 -0
  8. package/es/components/TitleBar.js +87 -0
  9. package/es/components/TitleBar.js.map +1 -0
  10. package/es/index.css +122 -0
  11. package/es/index.less +1 -0
  12. package/es/model.d.ts +18 -1
  13. package/es/model.js +46 -8
  14. package/es/model.js.map +1 -1
  15. package/es/style/index.css +122 -0
  16. package/es/style/index.less +140 -0
  17. package/es/style/raw.d.ts +4 -0
  18. package/es/style/raw.js +6 -0
  19. package/es/style/raw.js.map +1 -0
  20. package/es/view.d.ts +10 -1
  21. package/es/view.js +123 -9
  22. package/es/view.js.map +1 -1
  23. package/es/wrapper.d.ts +1 -1
  24. package/es/wrapper.js +4 -2
  25. package/es/wrapper.js.map +1 -1
  26. package/lib/components/Container.d.ts +9 -0
  27. package/lib/components/Container.js +23 -0
  28. package/lib/components/Container.js.map +1 -0
  29. package/lib/components/TitleBar.d.ts +8 -0
  30. package/lib/components/TitleBar.js +114 -0
  31. package/lib/components/TitleBar.js.map +1 -0
  32. package/lib/index.css +122 -0
  33. package/lib/index.less +1 -0
  34. package/lib/model.d.ts +18 -1
  35. package/lib/model.js +44 -6
  36. package/lib/model.js.map +1 -1
  37. package/lib/style/index.css +122 -0
  38. package/lib/style/index.less +140 -0
  39. package/lib/style/raw.d.ts +4 -0
  40. package/lib/style/raw.js +9 -0
  41. package/lib/style/raw.js.map +1 -0
  42. package/lib/view.d.ts +10 -1
  43. package/lib/view.js +123 -9
  44. package/lib/view.js.map +1 -1
  45. package/lib/wrapper.d.ts +1 -1
  46. package/lib/wrapper.js +7 -2
  47. package/lib/wrapper.js.map +1 -1
  48. package/package.json +3 -3
  49. package/rollup.config.js +52 -0
  50. package/src/components/Container.tsx +33 -0
  51. package/src/components/TitleBar.tsx +149 -0
  52. package/src/index.less +1 -0
  53. package/src/model.ts +82 -6
  54. package/src/style/index.less +140 -0
  55. package/src/style/raw.ts +129 -0
  56. package/src/view.ts +102 -9
  57. package/src/wrapper.tsx +17 -2
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.TitleBar = void 0;
27
+ var react_1 = __importStar(require("react"));
28
+ var lodash_es_1 = require("lodash-es");
29
+ var TitleBar = function (_a) {
30
+ var node = _a.node, graph = _a.graph;
31
+ var props = (node === null || node === void 0 ? void 0 : node.properties) || {};
32
+ var icon = props._icon;
33
+ var title = props._title || '';
34
+ var expanded = !!props._expanded;
35
+ var titleHeight = (0, lodash_es_1.isNumber)(props._titleHeight) ? props._titleHeight : 28;
36
+ var actProps = props._titleActions || [];
37
+ var privActs = node.__actions || [];
38
+ var actions = Array.isArray(privActs) && privActs.length > 0 ? privActs : actProps;
39
+ var showMoreAction = Array.isArray(actions) && actions.length > 0;
40
+ var trigger = props.titleTrigger === 'hover' ? 'hover' : 'click';
41
+ var _b = (0, react_1.useState)(false), showTooltip = _b[0], setShowTooltip = _b[1];
42
+ var moreBtnRef = (0, react_1.useRef)(null);
43
+ var tooltipRef = (0, react_1.useRef)(null);
44
+ var toggleExpand = function () {
45
+ var _a;
46
+ var cur = !!((_a = node === null || node === void 0 ? void 0 : node.properties) === null || _a === void 0 ? void 0 : _a._expanded);
47
+ node === null || node === void 0 ? void 0 : node.setProperty('_expanded', !cur);
48
+ };
49
+ var runAction = function (act) {
50
+ var _a;
51
+ var fn = (act === null || act === void 0 ? void 0 : act.callback) ||
52
+ ((_a = (privActs || []).find(function (a) { return (a === null || a === void 0 ? void 0 : a.name) === (act === null || act === void 0 ? void 0 : act.name); })) === null || _a === void 0 ? void 0 : _a.callback);
53
+ typeof fn === 'function' && fn(node, graph);
54
+ };
55
+ (0, react_1.useEffect)(function () {
56
+ if (trigger === 'hover') {
57
+ var mb_1 = moreBtnRef.current;
58
+ var tt_1 = tooltipRef.current;
59
+ var onEnter_1 = function () { return setShowTooltip(true); };
60
+ var onLeave_1 = function () { return setShowTooltip(false); };
61
+ mb_1 === null || mb_1 === void 0 ? void 0 : mb_1.addEventListener('mouseenter', onEnter_1);
62
+ mb_1 === null || mb_1 === void 0 ? void 0 : mb_1.addEventListener('mouseleave', onLeave_1);
63
+ tt_1 === null || tt_1 === void 0 ? void 0 : tt_1.addEventListener('mouseenter', onEnter_1);
64
+ tt_1 === null || tt_1 === void 0 ? void 0 : tt_1.addEventListener('mouseleave', onLeave_1);
65
+ return function () {
66
+ mb_1 === null || mb_1 === void 0 ? void 0 : mb_1.removeEventListener('mouseenter', onEnter_1);
67
+ mb_1 === null || mb_1 === void 0 ? void 0 : mb_1.removeEventListener('mouseleave', onLeave_1);
68
+ tt_1 === null || tt_1 === void 0 ? void 0 : tt_1.removeEventListener('mouseenter', onEnter_1);
69
+ tt_1 === null || tt_1 === void 0 ? void 0 : tt_1.removeEventListener('mouseleave', onLeave_1);
70
+ };
71
+ }
72
+ var onDoc = function (e) {
73
+ var mb = moreBtnRef.current;
74
+ var tt = tooltipRef.current;
75
+ var t = e.target;
76
+ if (showTooltip && mb && tt && !mb.contains(t) && !tt.contains(t)) {
77
+ setShowTooltip(false);
78
+ }
79
+ };
80
+ document.addEventListener('click', onDoc);
81
+ return function () { return document.removeEventListener('click', onDoc); };
82
+ }, [trigger, showTooltip]);
83
+ return (react_1.default.createElement("div", { className: expanded
84
+ ? 'lf-vue-node-title lf-vue-node-title-expanded'
85
+ : 'lf-vue-node-title', style: { height: expanded ? titleHeight : 18 }, title: title },
86
+ react_1.default.createElement("div", { className: "lf-vue-node-title-left" },
87
+ icon ? react_1.default.createElement("i", { className: "lf-vue-node-title-icon" }, icon) : null,
88
+ react_1.default.createElement("span", { className: "lf-vue-node-title-text" }, title)),
89
+ react_1.default.createElement("div", { className: "lf-vue-node-title-actions" },
90
+ react_1.default.createElement("button", { className: "lf-vue-node-title-expand", onClick: function (e) {
91
+ e.stopPropagation();
92
+ toggleExpand();
93
+ } },
94
+ react_1.default.createElement("svg", { width: 14, height: 12, viewBox: "0 0 14 12", xmlns: "http://www.w3.org/2000/svg", className: "lf-vue-node-title-expand-icon", style: { transform: expanded ? 'rotate(180deg)' : 'rotate(0deg)' } },
95
+ react_1.default.createElement("path", { d: "M0.5201124,5.47988755C0.23603013,5.7639699,0.24460429,6.2271326,0.53900635,6.5005059L6.3195491,11.8681526C6.7032304,12.2244282,7.2967696,12.2244282,7.6804514,11.8681526L13.460994,6.5005059C13.755396,6.2271326,13.76397,5.7639699,13.479888,5.47988755C13.211547,5.21154633,12.779465,5.20215771,12.499721,5.45858961L7.3378625,10.1902928C7.1467018,10.3655233,6.8532982,10.3655233,6.6621375,10.1902928L1.5002797,5.45858967C1.2205358,5.20215771,0.78845364,5.21154633,0.5201124,5.47988755Z", fill: "#474747" }),
96
+ react_1.default.createElement("path", { d: "M0.5201124,0.47988755C0.23603013,0.7639699,0.24460429,1.2271326,0.53900635,1.5005059L6.3195491,6.8681526C6.7032304,7.2244282,7.2967696,7.2244282,7.6804514,6.8681526L13.460994,1.5005059C13.755396,1.2271326,13.76397,0.7639699,13.479888,0.47988755C13.211547,0.21154633,12.779465,0.20215771,12.499721,0.45858961L7.3378625,5.1902928C7.1467018,5.3655233,6.8532982,5.3655233,6.6621375,5.1902928L1.5002797,0.45858967C1.2205358,0.20215771,0.78845364,0.21154633,0.5201124,0.47988755Z", fill: "#9B9B9B" }))),
97
+ showMoreAction && (react_1.default.createElement("button", { ref: moreBtnRef, className: "lf-vue-node-title-more", onClick: function (e) {
98
+ e.stopPropagation();
99
+ if (trigger === 'click')
100
+ setShowTooltip(!showTooltip);
101
+ } },
102
+ react_1.default.createElement("i", { className: "lf-vue-node-title-more-icon" }, "\u22EF"))),
103
+ showMoreAction && (react_1.default.createElement("div", { ref: tooltipRef, className: "lf-vue-node-title-tooltip", style: {
104
+ opacity: showTooltip ? 1 : 0,
105
+ pointerEvents: showTooltip ? 'auto' : 'none',
106
+ } },
107
+ react_1.default.createElement("div", { className: "lf-vue-node-title-tooltip-list" }, actions.map(function (act, idx) { return (react_1.default.createElement("div", { key: idx, className: "lf-vue-node-title-tooltip-item", onClick: function (e) {
108
+ e.stopPropagation();
109
+ runAction(act);
110
+ } }, (act === null || act === void 0 ? void 0 : act.name) || '')); })))))));
111
+ };
112
+ exports.TitleBar = TitleBar;
113
+ exports.default = exports.TitleBar;
114
+ //# sourceMappingURL=TitleBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TitleBar.js","sourceRoot":"","sources":["../../src/components/TitleBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA0D;AAE1D,uCAAoC;AAO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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC5B,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;iBAC7C;gBAED,uCAAK,SAAS,EAAC,gCAAgC,IAC5C,OAAO,CAAC,GAAG,CAAC,UAAC,GAAQ,EAAE,GAAW,IAAK,OAAA,CACtC,uCACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,gCAAgC,EAC1C,OAAO,EAAE,UAAC,CAAC;wBACT,CAAC,CAAC,eAAe,EAAE,CAAA;wBACnB,SAAS,CAAC,GAAG,CAAC,CAAA;oBAChB,CAAC,IAEA,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,KAAI,EAAE,CACZ,CACP,EAXuC,CAWvC,CAAC,CACE,CACF,CACP,CACG,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAzIY,QAAA,QAAQ,YAyIpB;AAED,kBAAe,gBAAQ,CAAA"}
package/lib/index.css ADDED
@@ -0,0 +1,122 @@
1
+ .lf-vue-node-container {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ box-sizing: border-box;
6
+ padding: 6px;
7
+ color: #474747;
8
+ border-radius: 12px;
9
+ box-shadow: 0 0 10px #cad2e15f;
10
+ }
11
+ .lf-vue-node-content-wrap {
12
+ display: flex;
13
+ flex: 1 1 auto;
14
+ justify-content: center;
15
+ }
16
+ .lf-vue-node-title {
17
+ display: flex;
18
+ align-items: flex-start;
19
+ justify-content: space-between;
20
+ box-sizing: border-box;
21
+ margin-bottom: 4px;
22
+ padding: 0 8px;
23
+ backdrop-filter: saturate(180%) blur(4px);
24
+ }
25
+ .lf-vue-node-title-expanded {
26
+ margin-bottom: 6px;
27
+ padding-bottom: 8px;
28
+ border-bottom: 1px solid #eaeaea;
29
+ }
30
+ @supports not (backdrop-filter: blur(1px)) {
31
+ .lf-vue-node-title {
32
+ backdrop-filter: none;
33
+ }
34
+ }
35
+ .lf-vue-node-title-left {
36
+ display: flex;
37
+ gap: 6px;
38
+ align-items: center;
39
+ min-width: 0;
40
+ }
41
+ .lf-vue-node-title-icon {
42
+ display: inline-block;
43
+ width: 16px;
44
+ height: 16px;
45
+ color: #666;
46
+ font-style: normal;
47
+ line-height: 16px;
48
+ text-align: center;
49
+ }
50
+ .lf-vue-node-title-text {
51
+ overflow: hidden;
52
+ color: #333;
53
+ font-weight: 500;
54
+ font-size: 14px;
55
+ white-space: nowrap;
56
+ text-overflow: ellipsis;
57
+ }
58
+ .lf-vue-node-title-actions {
59
+ display: flex;
60
+ gap: 6px;
61
+ align-items: center;
62
+ }
63
+ .lf-vue-node-title-expand,
64
+ .lf-vue-node-title-more {
65
+ display: inline-flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ width: 20px;
69
+ height: 20px;
70
+ padding: 2px;
71
+ background: transparent;
72
+ border: none;
73
+ border-radius: 4px;
74
+ cursor: pointer;
75
+ transition: background 0.15s ease;
76
+ appearance: none;
77
+ }
78
+ .lf-vue-node-title-expand:hover,
79
+ .lf-vue-node-title-more:hover {
80
+ background: rgba(0, 0, 0, 0.06);
81
+ }
82
+ .lf-vue-node-title-expand-icon {
83
+ color: #666;
84
+ font-style: normal;
85
+ transition: transform 0.3s ease;
86
+ }
87
+ .lf-vue-node-title-more-icon {
88
+ color: #666;
89
+ font-style: normal;
90
+ }
91
+ .lf-vue-node-title-tooltip {
92
+ position: absolute;
93
+ top: -50px;
94
+ right: -135px;
95
+ min-width: 120px;
96
+ max-width: 240px;
97
+ padding: 6px 8px;
98
+ background: #fff;
99
+ border: 1px solid rgba(0, 0, 0, 0.1);
100
+ border-radius: 6px;
101
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
102
+ transform: translateY(calc(100% + 4px));
103
+ transition: opacity 0.15s ease, transform 0.15s ease;
104
+ }
105
+ .lf-vue-node-title-tooltip-list {
106
+ display: flex;
107
+ flex-direction: column;
108
+ gap: 4px;
109
+ }
110
+ .lf-vue-node-title-tooltip-item {
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: flex-start;
114
+ padding: 6px;
115
+ color: #333;
116
+ font-size: 12px;
117
+ border-radius: 4px;
118
+ cursor: pointer;
119
+ }
120
+ .lf-vue-node-title-tooltip-item:hover {
121
+ background: rgba(0, 0, 0, 0.05);
122
+ }
package/lib/index.less ADDED
@@ -0,0 +1 @@
1
+ @import url('./style/index.less');
package/lib/model.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- import LogicFlow, { HtmlNodeModel, IHtmlNodeProperties } from '@logicflow/core';
1
+ import LogicFlow, { HtmlNodeModel, IHtmlNodeProperties, BaseNodeModel, GraphModel } from '@logicflow/core';
2
+ import NodeConfig = LogicFlow.NodeConfig;
3
+ export type NodeAction = {
4
+ name: string;
5
+ callback?: (node: BaseNodeModel, graph: GraphModel) => void;
6
+ };
2
7
  export interface ReactCustomProperties extends IHtmlNodeProperties {
3
8
  width?: number;
4
9
  height?: number;
@@ -7,10 +12,22 @@ export interface ReactCustomProperties extends IHtmlNodeProperties {
7
12
  refY?: number;
8
13
  style?: LogicFlow.CommonTheme;
9
14
  textStyle?: LogicFlow.TextNodeTheme;
15
+ _showTitle?: boolean;
16
+ _title?: string;
17
+ _icon?: string;
18
+ _titleHeight?: number;
19
+ _expanded?: boolean;
10
20
  }
11
21
  export declare class ReactNodeModel<P extends ReactCustomProperties = ReactCustomProperties> extends HtmlNodeModel<P> {
22
+ private __baseHeight?;
23
+ __actions?: {
24
+ name: string;
25
+ callback?: (node: BaseNodeModel, graph: GraphModel) => void;
26
+ }[];
27
+ constructor(data: NodeConfig<P>, graphModel: GraphModel);
12
28
  setAttributes(): void;
13
29
  getTextStyle(): LogicFlow.TextNodeTheme;
14
30
  getNodeStyle(): LogicFlow.CommonTheme;
31
+ setNodeActions(actions: NodeAction[]): void;
15
32
  }
16
33
  export default ReactNodeModel;
package/lib/model.js CHANGED
@@ -31,20 +31,54 @@ var core_1 = require("@logicflow/core");
31
31
  var lodash_es_1 = require("lodash-es");
32
32
  var ReactNodeModel = /** @class */ (function (_super) {
33
33
  __extends(ReactNodeModel, _super);
34
- function ReactNodeModel() {
35
- return _super !== null && _super.apply(this, arguments) || this;
34
+ function ReactNodeModel(data, graphModel) {
35
+ var _this = _super.call(this, data, graphModel) || this;
36
+ var properties = data.properties;
37
+ if (properties) {
38
+ var _a = properties._showTitle, _showTitle = _a === void 0 ? false : _a, _b = properties.style, style = _b === void 0 ? {} : _b;
39
+ if (_showTitle) {
40
+ _this.minWidth = 160;
41
+ _this.minHeight = 80;
42
+ _this.text.editable = false;
43
+ // 判断当前节点宽高是否小于最小宽高,如果是,强制设置为最小宽高
44
+ var newWidth = _this.width < _this.minWidth ? _this.minWidth : _this.width;
45
+ var newHeight = _this.height < _this.minHeight ? _this.minHeight : _this.height;
46
+ _this.setProperties(__assign(__assign({ _expanded: false }, properties), { style: __assign({ overflow: 'visible' }, (0, lodash_es_1.cloneDeep)(style)), width: newWidth, height: newHeight }));
47
+ _this.setNodeActions([
48
+ {
49
+ name: '复制',
50
+ callback: function (nodeModel, graphModel) {
51
+ graphModel.cloneNode(nodeModel.id);
52
+ },
53
+ },
54
+ {
55
+ name: '删除',
56
+ callback: function (nodeModel, graphModel) {
57
+ graphModel.deleteNode(nodeModel.id);
58
+ },
59
+ },
60
+ ]);
61
+ }
62
+ }
63
+ return _this;
36
64
  }
37
65
  ReactNodeModel.prototype.setAttributes = function () {
38
- var _a = this.properties, width = _a.width, height = _a.height, radius = _a.radius;
39
- if (width) {
66
+ var _a = this.properties, width = _a.width, height = _a.height, radius = _a.radius, _showTitle = _a._showTitle, _titleHeight = _a._titleHeight;
67
+ if (!(0, lodash_es_1.isNil)(width)) {
40
68
  this.width = width;
41
69
  }
42
- if (height) {
70
+ if (!(0, lodash_es_1.isNil)(height)) {
43
71
  this.height = height;
44
72
  }
45
- if (radius) {
73
+ if (!(0, lodash_es_1.isNil)(radius)) {
46
74
  this.radius = radius;
47
75
  }
76
+ if (this.__baseHeight === undefined) {
77
+ this.__baseHeight = (0, lodash_es_1.isNil)(height) ? this.height : height;
78
+ }
79
+ var extra = _showTitle ? (_titleHeight !== null && _titleHeight !== void 0 ? _titleHeight : 28) : 0;
80
+ var base = (0, lodash_es_1.isNil)(height) ? this.__baseHeight : height;
81
+ this.height = base + extra;
48
82
  };
49
83
  ReactNodeModel.prototype.getTextStyle = function () {
50
84
  // const { x, y, width, height } = this
@@ -58,6 +92,10 @@ var ReactNodeModel = /** @class */ (function (_super) {
58
92
  var customNodeStyle = this.properties.style;
59
93
  return __assign(__assign({}, style), ((0, lodash_es_1.cloneDeep)(customNodeStyle) || {}));
60
94
  };
95
+ ReactNodeModel.prototype.setNodeActions = function (actions) {
96
+ this.__actions =
97
+ (0, lodash_es_1.isArray)(actions) && !(0, lodash_es_1.isEmpty)(actions) ? (0, lodash_es_1.cloneDeep)(actions) : [];
98
+ };
61
99
  return ReactNodeModel;
62
100
  }(core_1.HtmlNodeModel));
63
101
  exports.ReactNodeModel = ReactNodeModel;
package/lib/model.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA+E;AAC/E,uCAAqC;AAiBrC;IAEU,kCAAgB;IAF1B;;IA2CA,CAAC;IAxCC,sCAAa,GAAb;QACQ,IAAA,KAA4B,IAAI,CAAC,UAAU,EAAzC,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAoB,CAAA;QACjD,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACpB,CAAC;QACD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACtB,CAAC;QACD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACtB,CAAC;IACH,CAAC;IAED,qCAAY,GAAZ;QACE,uCA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AE,CAAA;QAEhC,IAAO,eAAe,GAEpB,IAAI,CAAC,UAAU,MAFK,CAEL;QAEnB,6BACK,KAAK,GACL,CAAC,IAAA,qBAAS,EAAC,eAAe,CAAC,IAAI,EAAE,CAAC,EAGtC;IACH,CAAC;IAED,uCAAc,GAAd,UAAe,OAAqB;QAClC,IAAI,CAAC,SAAS;YACZ,IAAA,mBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,IAAA,mBAAO,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,qBAAS,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACnE,CAAC;IACH,qBAAC;AAAD,CAAC,AArGD,CAEU,oBAAa,GAmGtB;AArGY,wCAAc;AAuG3B,kBAAe,cAAc,CAAA"}
@@ -0,0 +1,122 @@
1
+ .lf-vue-node-container {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ box-sizing: border-box;
6
+ padding: 6px;
7
+ color: #474747;
8
+ border-radius: 12px;
9
+ box-shadow: 0 0 10px #cad2e15f;
10
+ }
11
+ .lf-vue-node-content-wrap {
12
+ display: flex;
13
+ flex: 1 1 auto;
14
+ justify-content: center;
15
+ }
16
+ .lf-vue-node-title {
17
+ display: flex;
18
+ align-items: flex-start;
19
+ justify-content: space-between;
20
+ box-sizing: border-box;
21
+ margin-bottom: 4px;
22
+ padding: 0 8px;
23
+ backdrop-filter: saturate(180%) blur(4px);
24
+ }
25
+ .lf-vue-node-title-expanded {
26
+ margin-bottom: 6px;
27
+ padding-bottom: 8px;
28
+ border-bottom: 1px solid #eaeaea;
29
+ }
30
+ @supports not (backdrop-filter: blur(1px)) {
31
+ .lf-vue-node-title {
32
+ backdrop-filter: none;
33
+ }
34
+ }
35
+ .lf-vue-node-title-left {
36
+ display: flex;
37
+ gap: 6px;
38
+ align-items: center;
39
+ min-width: 0;
40
+ }
41
+ .lf-vue-node-title-icon {
42
+ display: inline-block;
43
+ width: 16px;
44
+ height: 16px;
45
+ color: #666;
46
+ font-style: normal;
47
+ line-height: 16px;
48
+ text-align: center;
49
+ }
50
+ .lf-vue-node-title-text {
51
+ overflow: hidden;
52
+ color: #333;
53
+ font-weight: 500;
54
+ font-size: 14px;
55
+ white-space: nowrap;
56
+ text-overflow: ellipsis;
57
+ }
58
+ .lf-vue-node-title-actions {
59
+ display: flex;
60
+ gap: 6px;
61
+ align-items: center;
62
+ }
63
+ .lf-vue-node-title-expand,
64
+ .lf-vue-node-title-more {
65
+ display: inline-flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ width: 20px;
69
+ height: 20px;
70
+ padding: 2px;
71
+ background: transparent;
72
+ border: none;
73
+ border-radius: 4px;
74
+ cursor: pointer;
75
+ transition: background 0.15s ease;
76
+ appearance: none;
77
+ }
78
+ .lf-vue-node-title-expand:hover,
79
+ .lf-vue-node-title-more:hover {
80
+ background: rgba(0, 0, 0, 0.06);
81
+ }
82
+ .lf-vue-node-title-expand-icon {
83
+ color: #666;
84
+ font-style: normal;
85
+ transition: transform 0.3s ease;
86
+ }
87
+ .lf-vue-node-title-more-icon {
88
+ color: #666;
89
+ font-style: normal;
90
+ }
91
+ .lf-vue-node-title-tooltip {
92
+ position: absolute;
93
+ top: -50px;
94
+ right: -135px;
95
+ min-width: 120px;
96
+ max-width: 240px;
97
+ padding: 6px 8px;
98
+ background: #fff;
99
+ border: 1px solid rgba(0, 0, 0, 0.1);
100
+ border-radius: 6px;
101
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
102
+ transform: translateY(calc(100% + 4px));
103
+ transition: opacity 0.15s ease, transform 0.15s ease;
104
+ }
105
+ .lf-vue-node-title-tooltip-list {
106
+ display: flex;
107
+ flex-direction: column;
108
+ gap: 4px;
109
+ }
110
+ .lf-vue-node-title-tooltip-item {
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: flex-start;
114
+ padding: 6px;
115
+ color: #333;
116
+ font-size: 12px;
117
+ border-radius: 4px;
118
+ cursor: pointer;
119
+ }
120
+ .lf-vue-node-title-tooltip-item:hover {
121
+ background: rgba(0, 0, 0, 0.05);
122
+ }
@@ -0,0 +1,140 @@
1
+ .lf-vue-node-container {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ box-sizing: border-box;
6
+ padding: 6px;
7
+ color: #474747;
8
+ border-radius: 12px;
9
+ box-shadow: 0 0 10px #cad2e15f;
10
+ }
11
+
12
+ .lf-vue-node-content-wrap {
13
+ display: flex;
14
+ flex: 1 1 auto;
15
+ justify-content: center;
16
+ }
17
+
18
+ .lf-vue-node-title {
19
+ display: flex;
20
+ align-items: flex-start;
21
+ justify-content: space-between;
22
+ box-sizing: border-box;
23
+ margin-bottom: 4px;
24
+ padding: 0 8px;
25
+ backdrop-filter: saturate(180%) blur(4px);
26
+
27
+ &-expanded {
28
+ margin-bottom: 6px;
29
+ padding-bottom: 8px;
30
+ border-bottom: 1px solid #eaeaea;
31
+ }
32
+ }
33
+
34
+ @supports not (backdrop-filter: blur(1px)) {
35
+ .lf-vue-node-title {
36
+ backdrop-filter: none;
37
+ }
38
+ }
39
+
40
+ .lf-vue-node-title-left {
41
+ display: flex;
42
+ gap: 6px;
43
+ align-items: center;
44
+ min-width: 0;
45
+ }
46
+
47
+ .lf-vue-node-title-icon {
48
+ display: inline-block;
49
+ width: 16px;
50
+ height: 16px;
51
+ color: #666;
52
+ font-style: normal;
53
+ line-height: 16px;
54
+ text-align: center;
55
+ }
56
+
57
+ .lf-vue-node-title-text {
58
+ overflow: hidden;
59
+ color: #333;
60
+ font-weight: 500;
61
+ font-size: 14px;
62
+ white-space: nowrap;
63
+ text-overflow: ellipsis;
64
+ }
65
+
66
+ .lf-vue-node-title-actions {
67
+ display: flex;
68
+ gap: 6px;
69
+ align-items: center;
70
+ }
71
+
72
+ .lf-vue-node-title-expand,
73
+ .lf-vue-node-title-more {
74
+ display: inline-flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ width: 20px;
78
+ height: 20px;
79
+ padding: 2px;
80
+ background: transparent;
81
+ border: none;
82
+ border-radius: 4px;
83
+ cursor: pointer;
84
+ transition: background 0.15s ease;
85
+ appearance: none;
86
+ }
87
+
88
+ .lf-vue-node-title-expand:hover,
89
+ .lf-vue-node-title-more:hover {
90
+ background: rgb(0 0 0 / 6%);
91
+ }
92
+
93
+ .lf-vue-node-title-expand-icon {
94
+ color: #666;
95
+ font-style: normal;
96
+ transition: transform 0.3s ease;
97
+ }
98
+
99
+ .lf-vue-node-title-more-icon {
100
+ color: #666;
101
+ font-style: normal;
102
+ }
103
+
104
+ .lf-vue-node-title-tooltip {
105
+ position: absolute;
106
+ top: -50px;
107
+ right: -135px;
108
+ min-width: 120px;
109
+ max-width: 240px;
110
+ padding: 6px 8px;
111
+ background: #fff;
112
+ border: 1px solid rgb(0 0 0 / 10%);
113
+ border-radius: 6px;
114
+ box-shadow: 0 6px 20px rgb(0 0 0 / 12%);
115
+ transform: translateY(calc(100% + 4px));
116
+ transition:
117
+ opacity 0.15s ease,
118
+ transform 0.15s ease;
119
+ }
120
+
121
+ .lf-vue-node-title-tooltip-list {
122
+ display: flex;
123
+ flex-direction: column;
124
+ gap: 4px;
125
+ }
126
+
127
+ .lf-vue-node-title-tooltip-item {
128
+ display: flex;
129
+ align-items: center;
130
+ justify-content: flex-start;
131
+ padding: 6px;
132
+ color: #333;
133
+ font-size: 12px;
134
+ border-radius: 4px;
135
+ cursor: pointer;
136
+ }
137
+
138
+ .lf-vue-node-title-tooltip-item:hover {
139
+ background: rgb(0 0 0 / 5%);
140
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Auto generated file, do not modify it!
3
+ */
4
+ export declare const content = ".lf-vue-node-container {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 6px;\n color: #474747;\n border-radius: 12px;\n box-shadow: 0 0 10px #cad2e15f;\n}\n.lf-vue-node-content-wrap {\n display: flex;\n flex: 1 1 auto;\n justify-content: center;\n}\n.lf-vue-node-title {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n box-sizing: border-box;\n margin-bottom: 4px;\n padding: 0 8px;\n backdrop-filter: saturate(180%) blur(4px);\n}\n.lf-vue-node-title-expanded {\n margin-bottom: 6px;\n padding-bottom: 8px;\n border-bottom: 1px solid #eaeaea;\n}\n@supports not (backdrop-filter: blur(1px)) {\n .lf-vue-node-title {\n backdrop-filter: none;\n }\n}\n.lf-vue-node-title-left {\n display: flex;\n gap: 6px;\n align-items: center;\n min-width: 0;\n}\n.lf-vue-node-title-icon {\n display: inline-block;\n width: 16px;\n height: 16px;\n color: #666;\n font-style: normal;\n line-height: 16px;\n text-align: center;\n}\n.lf-vue-node-title-text {\n overflow: hidden;\n color: #333;\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.lf-vue-node-title-actions {\n display: flex;\n gap: 6px;\n align-items: center;\n}\n.lf-vue-node-title-expand,\n.lf-vue-node-title-more {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 2px;\n background: transparent;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n transition: background 0.15s ease;\n appearance: none;\n}\n.lf-vue-node-title-expand:hover,\n.lf-vue-node-title-more:hover {\n background: rgba(0, 0, 0, 0.06);\n}\n.lf-vue-node-title-expand-icon {\n color: #666;\n font-style: normal;\n transition: transform 0.3s ease;\n}\n.lf-vue-node-title-more-icon {\n color: #666;\n font-style: normal;\n}\n.lf-vue-node-title-tooltip {\n position: absolute;\n top: -50px;\n right: -135px;\n min-width: 120px;\n max-width: 240px;\n padding: 6px 8px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 6px;\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);\n transform: translateY(calc(100% + 4px));\n transition: opacity 0.15s ease, transform 0.15s ease;\n}\n.lf-vue-node-title-tooltip-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.lf-vue-node-title-tooltip-item {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 6px;\n color: #333;\n font-size: 12px;\n border-radius: 4px;\n cursor: pointer;\n}\n.lf-vue-node-title-tooltip-item:hover {\n background: rgba(0, 0, 0, 0.05);\n}\n";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.content = void 0;
5
+ /**
6
+ * Auto generated file, do not modify it!
7
+ */
8
+ exports.content = ".lf-vue-node-container {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 6px;\n color: #474747;\n border-radius: 12px;\n box-shadow: 0 0 10px #cad2e15f;\n}\n.lf-vue-node-content-wrap {\n display: flex;\n flex: 1 1 auto;\n justify-content: center;\n}\n.lf-vue-node-title {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n box-sizing: border-box;\n margin-bottom: 4px;\n padding: 0 8px;\n backdrop-filter: saturate(180%) blur(4px);\n}\n.lf-vue-node-title-expanded {\n margin-bottom: 6px;\n padding-bottom: 8px;\n border-bottom: 1px solid #eaeaea;\n}\n@supports not (backdrop-filter: blur(1px)) {\n .lf-vue-node-title {\n backdrop-filter: none;\n }\n}\n.lf-vue-node-title-left {\n display: flex;\n gap: 6px;\n align-items: center;\n min-width: 0;\n}\n.lf-vue-node-title-icon {\n display: inline-block;\n width: 16px;\n height: 16px;\n color: #666;\n font-style: normal;\n line-height: 16px;\n text-align: center;\n}\n.lf-vue-node-title-text {\n overflow: hidden;\n color: #333;\n font-weight: 500;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.lf-vue-node-title-actions {\n display: flex;\n gap: 6px;\n align-items: center;\n}\n.lf-vue-node-title-expand,\n.lf-vue-node-title-more {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 2px;\n background: transparent;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n transition: background 0.15s ease;\n appearance: none;\n}\n.lf-vue-node-title-expand:hover,\n.lf-vue-node-title-more:hover {\n background: rgba(0, 0, 0, 0.06);\n}\n.lf-vue-node-title-expand-icon {\n color: #666;\n font-style: normal;\n transition: transform 0.3s ease;\n}\n.lf-vue-node-title-more-icon {\n color: #666;\n font-style: normal;\n}\n.lf-vue-node-title-tooltip {\n position: absolute;\n top: -50px;\n right: -135px;\n min-width: 120px;\n max-width: 240px;\n padding: 6px 8px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 6px;\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);\n transform: translateY(calc(100% + 4px));\n transition: opacity 0.15s ease, transform 0.15s ease;\n}\n.lf-vue-node-title-tooltip-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.lf-vue-node-title-tooltip-item {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 6px;\n color: #333;\n font-size: 12px;\n border-radius: 4px;\n cursor: pointer;\n}\n.lf-vue-node-title-tooltip-item:hover {\n background: rgba(0, 0, 0, 0.05);\n}\n";
9
+ //# sourceMappingURL=raw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw.js","sourceRoot":"","sources":["../../src/style/raw.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;AAEpB;;GAEG;AAEU,QAAA,OAAO,GAAG,unFA0HtB,CAAA"}