@rkmodules/rules 0.0.70 → 0.0.71
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/index.cjs.css +20 -1
- package/dist/index.cjs.js +19 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.css +20 -1
- package/dist/index.esm.js +20 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -1
package/dist/index.esm.css
CHANGED
|
@@ -101,8 +101,27 @@
|
|
|
101
101
|
.Label_wBwWA {
|
|
102
102
|
border-bottom: 1px solid var(--ln);
|
|
103
103
|
padding: 4px 8px;
|
|
104
|
-
text-align: center;
|
|
105
104
|
font-weight: bold;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.Label_wBwWA span {
|
|
110
|
+
flex: 1;
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
}
|
|
114
|
+
.DeleteButton_kglTP {
|
|
115
|
+
border: 1px solid var(--ln);
|
|
116
|
+
border-radius: 4px;
|
|
117
|
+
width: 20px;
|
|
118
|
+
height: 20px;
|
|
119
|
+
padding: 0;
|
|
120
|
+
margin: 0;
|
|
121
|
+
display: inline-flex;
|
|
122
|
+
align-self: flex-end;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: center;
|
|
106
125
|
}
|
|
107
126
|
|
|
108
127
|
.DefaultNode_R2P6c table {
|
package/dist/index.esm.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { create, all } from 'mathjs';
|
|
2
2
|
import React, { createContext, memo, useEffect, useLayoutEffect, useState, useCallback, useMemo, isValidElement, cloneElement, useContext } from 'react';
|
|
3
|
-
import { Handle, Position, useConnection, getSimpleBezierPath, ReactFlowProvider, useOnSelectionChange, applyNodeChanges, applyEdgeChanges, ReactFlow, Background, BackgroundVariant, Controls } from '@xyflow/react';
|
|
3
|
+
import { Handle, Position, useReactFlow, useConnection, getSimpleBezierPath, ReactFlowProvider, useOnSelectionChange, applyNodeChanges, applyEdgeChanges, ReactFlow, Background, BackgroundVariant, Controls } from '@xyflow/react';
|
|
4
4
|
import katex from 'katex';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import rcin from 'rc-input-number';
|
|
7
|
+
import { useLongPress } from 'use-long-press';
|
|
7
8
|
import { create as create$1 } from 'zustand';
|
|
8
9
|
import { persist } from 'zustand/middleware';
|
|
9
10
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -4818,13 +4819,20 @@ var Output = function (_a) {
|
|
|
4818
4819
|
normalized.label || name)));
|
|
4819
4820
|
};
|
|
4820
4821
|
|
|
4821
|
-
var styles = {"DefaultNode":"DefaultNode_R2P6c","selected":"selected_VmB-F","active":"active_zjUzx","Log":"Log_dsq5e","Label":"Label_wBwWA","Description":"Description_f9s4l","PreviewHead":"PreviewHead_oFT4K","expanded":"expanded_3vnbi","Preview":"Preview_HbkZ6","Duration":"Duration_0jqWx","GroupHead":"GroupHead_QJhST","GroupName":"GroupName_Qvu4r","GroupCnt":"GroupCnt_3ctdd","GroupMore":"GroupMore_D1Kiz","GroupChildren":"GroupChildren_NKx-B","GroupLeaf":"GroupLeaf_eliT8"};
|
|
4822
|
+
var styles = {"DefaultNode":"DefaultNode_R2P6c","selected":"selected_VmB-F","active":"active_zjUzx","Log":"Log_dsq5e","Label":"Label_wBwWA","DeleteButton":"DeleteButton_kglTP","Description":"Description_f9s4l","PreviewHead":"PreviewHead_oFT4K","expanded":"expanded_3vnbi","Preview":"Preview_HbkZ6","Duration":"Duration_0jqWx","GroupHead":"GroupHead_QJhST","GroupName":"GroupName_Qvu4r","GroupCnt":"GroupCnt_3ctdd","GroupMore":"GroupMore_D1Kiz","GroupChildren":"GroupChildren_NKx-B","GroupLeaf":"GroupLeaf_eliT8"};
|
|
4822
4823
|
|
|
4823
4824
|
function NodeContainer(_a) {
|
|
4824
4825
|
var _b;
|
|
4825
4826
|
var id = _a.id, label = _a.label, className = _a.className, selected = _a.selected, children = _a.children;
|
|
4826
4827
|
var engine = useEngine();
|
|
4827
4828
|
var _c = __read(React.useState(false), 2), active = _c[0], setActive = _c[1];
|
|
4829
|
+
var _d = __read(React.useState(false), 2), deleteMode = _d[0], setDeleteMode = _d[1];
|
|
4830
|
+
var instance = useReactFlow();
|
|
4831
|
+
React.useEffect(function () {
|
|
4832
|
+
if (!selected) {
|
|
4833
|
+
setDeleteMode(false);
|
|
4834
|
+
}
|
|
4835
|
+
}, [selected]);
|
|
4828
4836
|
React.useEffect(function () {
|
|
4829
4837
|
if (!id)
|
|
4830
4838
|
return;
|
|
@@ -4845,11 +4853,20 @@ function NodeContainer(_a) {
|
|
|
4845
4853
|
removeOnResult();
|
|
4846
4854
|
};
|
|
4847
4855
|
}, [id]);
|
|
4856
|
+
var handlers = useLongPress(function () {
|
|
4857
|
+
setDeleteMode(true);
|
|
4858
|
+
});
|
|
4859
|
+
var handleDelete = function () {
|
|
4860
|
+
instance.deleteElements({ nodes: [{ id: id }] });
|
|
4861
|
+
};
|
|
4848
4862
|
return (React.createElement("div", { className: classNames(className, styles.DefaultNode, (_b = {},
|
|
4849
4863
|
_b[styles.selected] = selected,
|
|
4850
4864
|
_b[styles.active] = active,
|
|
4851
4865
|
_b)) },
|
|
4852
|
-
React.createElement("div", { className: styles.Label },
|
|
4866
|
+
React.createElement("div", __assign({ className: styles.Label }, handlers()),
|
|
4867
|
+
React.createElement("span", null),
|
|
4868
|
+
label,
|
|
4869
|
+
React.createElement("span", null, deleteMode && (React.createElement("button", { className: styles.DeleteButton, onClick: handleDelete }, "\u2715")))),
|
|
4853
4870
|
children));
|
|
4854
4871
|
}
|
|
4855
4872
|
|