@macrostrat/feedback-components 1.0.0 → 1.1.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 +13 -5
- package/dist/esm/feedback-components.4359bc80.js +70 -0
- package/dist/esm/feedback-components.4359bc80.js.map +1 -0
- package/dist/{extractions.54be85f8.js → esm/feedback-components.5df2a926.js} +52 -24
- package/dist/esm/feedback-components.5df2a926.js.map +1 -0
- package/dist/esm/feedback-components.6a6c8af5.js +552 -0
- package/dist/esm/feedback-components.6a6c8af5.js.map +1 -0
- package/dist/{main.module.ca3db294.js → esm/feedback-components.6d32ee91.js} +1 -1
- package/dist/{main.module.ca3db294.js.map → esm/feedback-components.6d32ee91.js.map} +1 -1
- package/dist/esm/feedback-components.7cd9b6cc.js +114 -0
- package/dist/esm/feedback-components.7cd9b6cc.js.map +1 -0
- package/dist/{node.30d0b8c3.js → esm/feedback-components.87533431.js} +12 -7
- package/dist/esm/feedback-components.87533431.js.map +1 -0
- package/dist/esm/feedback-components.921dcd46.js +241 -0
- package/dist/esm/feedback-components.921dcd46.js.map +1 -0
- package/dist/{type-selector.e75dd247.js → esm/feedback-components.ad9f284e.js} +11 -10
- package/dist/esm/feedback-components.ad9f284e.js.map +1 -0
- package/dist/esm/feedback-components.b7d9b015.css +156 -0
- package/dist/esm/feedback-components.b7d9b015.css.map +1 -0
- package/dist/{edit-state.e8edb13a.js → esm/feedback-components.bf5f7cf7.js} +105 -14
- package/dist/esm/feedback-components.bf5f7cf7.js.map +1 -0
- package/dist/{main.module.f9f92ece.css → esm/feedback-components.bf93773c.css} +1 -1
- package/dist/{main.module.f9f92ece.css.map → esm/feedback-components.bf93773c.css.map} +1 -1
- package/dist/{main.module.d6508c0e.css → esm/feedback-components.e273ed5b.css} +1 -1
- package/dist/{main.module.d6508c0e.css.map → esm/feedback-components.e273ed5b.css.map} +1 -1
- package/dist/{main.module.21bbfaf4.js → esm/feedback-components.f9850d85.js} +1 -1
- package/dist/{main.module.21bbfaf4.js.map → esm/feedback-components.f9850d85.js.map} +1 -1
- package/dist/{index.d.ts → esm/index.d.ts} +38 -13
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/{index.js → esm/index.js} +2 -2
- package/dist/node/feedback-components.15e1316d.js +2 -0
- package/dist/node/feedback-components.15e1316d.js.map +1 -0
- package/dist/node/feedback-components.2f391fa4.js +2 -0
- package/dist/node/feedback-components.2f391fa4.js.map +1 -0
- package/dist/node/feedback-components.65d8488e.js +2 -0
- package/dist/node/feedback-components.65d8488e.js.map +1 -0
- package/dist/node/feedback-components.6681dbde.js +2 -0
- package/dist/node/feedback-components.6681dbde.js.map +1 -0
- package/dist/node/feedback-components.77b6fc89.css +2 -0
- package/dist/node/feedback-components.77b6fc89.css.map +1 -0
- package/dist/node/feedback-components.794f429b.js +2 -0
- package/dist/node/feedback-components.794f429b.js.map +1 -0
- package/dist/node/feedback-components.7caa447a.js +2 -0
- package/dist/node/feedback-components.7caa447a.js.map +1 -0
- package/dist/node/feedback-components.83c21466.css +2 -0
- package/dist/node/feedback-components.83c21466.css.map +1 -0
- package/dist/node/feedback-components.8b03e8be.js +2 -0
- package/dist/node/feedback-components.8b03e8be.js.map +1 -0
- package/dist/node/feedback-components.9eb1d41a.css +2 -0
- package/dist/node/feedback-components.9eb1d41a.css.map +1 -0
- package/dist/node/feedback-components.acac789b.js +2 -0
- package/dist/node/feedback-components.acac789b.js.map +1 -0
- package/dist/node/feedback-components.e2f3c4b7.js +2 -0
- package/dist/node/feedback-components.e2f3c4b7.js.map +1 -0
- package/dist/node/feedback-components.e8aa70b8.js +2 -0
- package/dist/node/feedback-components.e8aa70b8.js.map +1 -0
- package/dist/node/index.js +2 -0
- package/dist/node/index.js.map +1 -0
- package/package.json +29 -15
- package/src/extractions/index.ts +76 -21
- package/src/extractions/types.ts +6 -1
- package/src/feedback/edit-state.ts +146 -16
- package/src/feedback/feedback.module.sass +93 -1
- package/src/feedback/graph.ts +71 -30
- package/src/feedback/index.ts +444 -71
- package/src/feedback/node.ts +7 -1
- package/src/feedback/text-visualizer.ts +258 -47
- package/src/feedback/type-selector/index.ts +4 -2
- package/dist/edit-state.e8edb13a.js.map +0 -1
- package/dist/extractions.54be85f8.js.map +0 -1
- package/dist/feedback.46c2b5c4.js +0 -252
- package/dist/feedback.46c2b5c4.js.map +0 -1
- package/dist/feedback.module.7e16830e.css +0 -44
- package/dist/feedback.module.7e16830e.css.map +0 -1
- package/dist/feedback.module.c28cbac7.js +0 -28
- package/dist/feedback.module.c28cbac7.js.map +0 -1
- package/dist/graph.cb42b871.js +0 -83
- package/dist/graph.cb42b871.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/node.30d0b8c3.js.map +0 -1
- package/dist/text-visualizer.77af0d24.js +0 -101
- package/dist/text-visualizer.77af0d24.js.map +0 -1
- package/dist/type-selector.e75dd247.js.map +0 -1
- package/stories/feedback.stories.ts +0 -40
- package/stories/test-data.ts +0 -330
- /package/dist/{index.js.map → esm/index.js.map} +0 -0
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
import "./feedback-components.b7d9b015.css";
|
|
2
|
+
import $bvJLP$feedbackcomponents4359bc80js from "./feedback-components.4359bc80.js";
|
|
3
|
+
import $b6b9741bf83336eb$export$2e2bcd8739ae039 from "./feedback-components.87533431.js";
|
|
4
|
+
import {FeedbackText as $156a3efbc315814c$export$6e107db9091b8219} from "./feedback-components.921dcd46.js";
|
|
5
|
+
import {ModelInfo as $03d8811e9c9b360d$export$4eb2a0ce903ce967} from "./feedback-components.5df2a926.js";
|
|
6
|
+
import {TreeDispatchContext as $b79bf29960412ca7$export$e5ce04c5b3f58533, treeToGraph as $b79bf29960412ca7$export$8d9dbb7a64bf2a5e, useUpdatableTree as $b79bf29960412ca7$export$911bb4b9c8065d3d} from "./feedback-components.bf5f7cf7.js";
|
|
7
|
+
import {OmniboxSelector as $fda9ef5406c1cfb4$export$d8660660a589068c} from "./feedback-components.ad9f284e.js";
|
|
8
|
+
import {GraphView as $ff8c3e7f2bc22925$export$6a7fe3ef90e8d566} from "./feedback-components.7cd9b6cc.js";
|
|
9
|
+
import $bvJLP$macrostrathyper from "@macrostrat/hyper";
|
|
10
|
+
import {Tree as $bvJLP$Tree} from "react-arborist";
|
|
11
|
+
import {useState as $bvJLP$useState, useRef as $bvJLP$useRef, useCallback as $bvJLP$useCallback, useEffect as $bvJLP$useEffect} from "react";
|
|
12
|
+
import {SegmentedControl as $bvJLP$SegmentedControl, Card as $bvJLP$Card, ButtonGroup as $bvJLP$ButtonGroup, Divider as $bvJLP$Divider, Icon as $bvJLP$Icon, Overlay2 as $bvJLP$Overlay2, Popover as $bvJLP$Popover} from "@blueprintjs/core";
|
|
13
|
+
import {ErrorBoundary as $bvJLP$ErrorBoundary, FlexRow as $bvJLP$FlexRow, CancelButton as $bvJLP$CancelButton, SaveButton as $bvJLP$SaveButton, useInDarkMode as $bvJLP$useInDarkMode} from "@macrostrat/ui-components";
|
|
14
|
+
import $bvJLP$useelementdimensions from "use-element-dimensions";
|
|
15
|
+
import {asChromaColor as $bvJLP$asChromaColor} from "@macrostrat/color-utils";
|
|
16
|
+
import {ColorPicker as $bvJLP$ColorPicker} from "@macrostrat/data-sheet";
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
function $parcel$interopDefault(a) {
|
|
20
|
+
return a && a.__esModule ? a.default : a;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
const $71d20dff35996763$var$h = (0, $bvJLP$macrostrathyper).styled((0, ($parcel$interopDefault($bvJLP$feedbackcomponents4359bc80js))));
|
|
38
|
+
function $71d20dff35996763$var$setsAreTheSame(a, b) {
|
|
39
|
+
if (a.size !== b.size) return false;
|
|
40
|
+
for (const item of a){
|
|
41
|
+
if (!b.has(item)) return false;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
function $71d20dff35996763$export$a90600c9da52b40c({ entities: entities = [], text: text, model: model, entityTypes: entityTypes, matchComponent: matchComponent, onSave: onSave, lineHeight: lineHeight, allowOverlap: allowOverlap }) {
|
|
46
|
+
// Get the input arguments
|
|
47
|
+
const [state, dispatch] = (0, $b79bf29960412ca7$export$911bb4b9c8065d3d)(entities.map($71d20dff35996763$var$processEntity), entityTypes);
|
|
48
|
+
const { selectedNodes: selectedNodes, tree: tree, selectedEntityType: selectedEntityType, isSelectingEntityType: isSelectingEntityType, entityTypesMap: entityTypesMap } = state;
|
|
49
|
+
const [{ width: width, height: height }, ref] = (0, $bvJLP$useelementdimensions)();
|
|
50
|
+
return $71d20dff35996763$var$h((0, $b79bf29960412ca7$export$e5ce04c5b3f58533).Provider, {
|
|
51
|
+
value: dispatch
|
|
52
|
+
}, [
|
|
53
|
+
$71d20dff35996763$var$h((0, $bvJLP$ErrorBoundary), {
|
|
54
|
+
description: "An error occurred while rendering the feedback text component."
|
|
55
|
+
}, $71d20dff35996763$var$h((0, $156a3efbc315814c$export$6e107db9091b8219), {
|
|
56
|
+
text: text,
|
|
57
|
+
dispatch: dispatch,
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
nodes: tree,
|
|
60
|
+
selectedNodes: selectedNodes,
|
|
61
|
+
lineHeight: lineHeight,
|
|
62
|
+
allowOverlap: allowOverlap
|
|
63
|
+
})),
|
|
64
|
+
$71d20dff35996763$var$h((0, $bvJLP$FlexRow), {
|
|
65
|
+
alignItems: "baseline",
|
|
66
|
+
justifyContent: "space-between"
|
|
67
|
+
}, [
|
|
68
|
+
$71d20dff35996763$var$h((0, $03d8811e9c9b360d$export$4eb2a0ce903ce967), {
|
|
69
|
+
data: model
|
|
70
|
+
}),
|
|
71
|
+
$71d20dff35996763$var$h((0, $bvJLP$SegmentedControl), {
|
|
72
|
+
options: [
|
|
73
|
+
{
|
|
74
|
+
label: "Tree",
|
|
75
|
+
value: "tree"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: "Graph",
|
|
79
|
+
value: "graph"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
value: state.viewMode,
|
|
83
|
+
small: true,
|
|
84
|
+
onValueChange (value) {
|
|
85
|
+
console.log("Setting view mode", value);
|
|
86
|
+
dispatch({
|
|
87
|
+
type: "set-view-mode",
|
|
88
|
+
payload: value
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
]),
|
|
93
|
+
$71d20dff35996763$var$h("div.entity-panel", {
|
|
94
|
+
ref: ref
|
|
95
|
+
}, [
|
|
96
|
+
$71d20dff35996763$var$h((0, $bvJLP$Card), {
|
|
97
|
+
className: "control-panel"
|
|
98
|
+
}, [
|
|
99
|
+
$71d20dff35996763$var$h((0, $bvJLP$ButtonGroup), {
|
|
100
|
+
vertical: true,
|
|
101
|
+
fill: true,
|
|
102
|
+
minimal: true,
|
|
103
|
+
alignText: "left"
|
|
104
|
+
}, [
|
|
105
|
+
$71d20dff35996763$var$h((0, $bvJLP$CancelButton), {
|
|
106
|
+
icon: "trash",
|
|
107
|
+
disabled: state.initialTree == state.tree,
|
|
108
|
+
onClick () {
|
|
109
|
+
dispatch({
|
|
110
|
+
type: "reset"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}, "Reset"),
|
|
114
|
+
$71d20dff35996763$var$h((0, $bvJLP$SaveButton), {
|
|
115
|
+
onClick () {
|
|
116
|
+
onSave(state.tree);
|
|
117
|
+
},
|
|
118
|
+
disabled: state.initialTree == state.tree
|
|
119
|
+
}, "Save")
|
|
120
|
+
]),
|
|
121
|
+
$71d20dff35996763$var$h((0, $bvJLP$Divider)),
|
|
122
|
+
$71d20dff35996763$var$h($71d20dff35996763$var$EntityTypeSelector, {
|
|
123
|
+
entityTypes: entityTypesMap,
|
|
124
|
+
selected: selectedEntityType,
|
|
125
|
+
onChange (payload) {
|
|
126
|
+
dispatch({
|
|
127
|
+
type: "select-entity-type",
|
|
128
|
+
payload: payload
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
dispatch: dispatch,
|
|
132
|
+
tree: tree,
|
|
133
|
+
selectedNodes: selectedNodes,
|
|
134
|
+
isOpen: isSelectingEntityType,
|
|
135
|
+
setOpen: (isOpen)=>dispatch({
|
|
136
|
+
type: "toggle-entity-type-selector",
|
|
137
|
+
payload: isOpen
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
]),
|
|
141
|
+
$71d20dff35996763$var$h.if(state.viewMode == "tree")($71d20dff35996763$var$ManagedSelectionTree, {
|
|
142
|
+
selectedNodes: selectedNodes,
|
|
143
|
+
dispatch: dispatch,
|
|
144
|
+
tree: tree,
|
|
145
|
+
width: width,
|
|
146
|
+
height: height,
|
|
147
|
+
matchComponent: matchComponent
|
|
148
|
+
}),
|
|
149
|
+
$71d20dff35996763$var$h.if(state.viewMode == "graph")((0, $ff8c3e7f2bc22925$export$6a7fe3ef90e8d566), {
|
|
150
|
+
tree: tree,
|
|
151
|
+
width: width,
|
|
152
|
+
height: height,
|
|
153
|
+
dispatch: dispatch,
|
|
154
|
+
selectedNodes: selectedNodes
|
|
155
|
+
})
|
|
156
|
+
])
|
|
157
|
+
]);
|
|
158
|
+
}
|
|
159
|
+
function $71d20dff35996763$var$processEntity(entity) {
|
|
160
|
+
// @ts-ignore
|
|
161
|
+
return {
|
|
162
|
+
...entity,
|
|
163
|
+
// @ts-ignore
|
|
164
|
+
term_type: entity.type.name,
|
|
165
|
+
txt_range: [
|
|
166
|
+
entity.indices
|
|
167
|
+
],
|
|
168
|
+
children: entity.children?.map($71d20dff35996763$var$processEntity) ?? []
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function $71d20dff35996763$var$EntityTypeSelector({ entityTypes: entityTypes, selected: selected, isOpen: isOpen, setOpen: setOpen, onChange: onChange, tree: tree, dispatch: dispatch, selectedNodes: selectedNodes = [] }) {
|
|
172
|
+
// Show all entity types when selected is null
|
|
173
|
+
const _selected = selected != null ? selected : undefined;
|
|
174
|
+
const [inputValue, setInputValue] = (0, $bvJLP$useState)("");
|
|
175
|
+
const types = Array.from(entityTypes.values());
|
|
176
|
+
const items = inputValue !== "" ? types.filter((d)=>d.name.toLowerCase().includes(inputValue.toLowerCase())) : types;
|
|
177
|
+
return $71d20dff35996763$var$h("div.entity-type-selector", [
|
|
178
|
+
$71d20dff35996763$var$h($71d20dff35996763$var$TypeList, {
|
|
179
|
+
types: entityTypes,
|
|
180
|
+
selected: _selected,
|
|
181
|
+
dispatch: dispatch,
|
|
182
|
+
selectedNodes: selectedNodes,
|
|
183
|
+
tree: tree
|
|
184
|
+
}),
|
|
185
|
+
$71d20dff35996763$var$h((0, $fda9ef5406c1cfb4$export$d8660660a589068c), {
|
|
186
|
+
isOpen: isOpen,
|
|
187
|
+
items: items,
|
|
188
|
+
selectedItem: _selected,
|
|
189
|
+
onSelectItem (item) {
|
|
190
|
+
setOpen(false);
|
|
191
|
+
onChange(item);
|
|
192
|
+
},
|
|
193
|
+
onQueryChange (query) {
|
|
194
|
+
setInputValue(query);
|
|
195
|
+
},
|
|
196
|
+
onClose () {
|
|
197
|
+
setOpen(false);
|
|
198
|
+
}
|
|
199
|
+
})
|
|
200
|
+
]);
|
|
201
|
+
}
|
|
202
|
+
function $71d20dff35996763$var$countNodes(tree) {
|
|
203
|
+
if (!tree) return 0;
|
|
204
|
+
let count = 0;
|
|
205
|
+
function recurse(nodes) {
|
|
206
|
+
for (const node of nodes){
|
|
207
|
+
count++;
|
|
208
|
+
if (node.children && Array.isArray(node.children)) recurse(node.children);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
recurse(tree);
|
|
212
|
+
return count;
|
|
213
|
+
}
|
|
214
|
+
function $71d20dff35996763$var$ManagedSelectionTree(props) {
|
|
215
|
+
const { selectedNodes: selectedNodes, dispatch: dispatch, tree: tree, height: height, width: width, matchComponent: matchComponent } = props;
|
|
216
|
+
const ref = (0, $bvJLP$useRef)();
|
|
217
|
+
// Use a ref to track clicks (won't cause rerender)
|
|
218
|
+
const clickedRef = (0, $bvJLP$useRef)(false);
|
|
219
|
+
const _Node = (0, $bvJLP$useCallback)((props)=>$71d20dff35996763$var$h((0, $b6b9741bf83336eb$export$2e2bcd8739ae039), {
|
|
220
|
+
...props,
|
|
221
|
+
matchComponent: matchComponent
|
|
222
|
+
}), [
|
|
223
|
+
matchComponent
|
|
224
|
+
]);
|
|
225
|
+
// Update Tree selection when selectedNodes change
|
|
226
|
+
(0, $bvJLP$useEffect)(()=>{
|
|
227
|
+
if (ref.current == null) return;
|
|
228
|
+
const selection = new Set(selectedNodes.map((d)=>d.toString()));
|
|
229
|
+
const currentSelection = ref.current.selectedIds;
|
|
230
|
+
if ($71d20dff35996763$var$setsAreTheSame(selection, currentSelection)) return;
|
|
231
|
+
ref.current.setSelection({
|
|
232
|
+
ids: selectedNodes.map((d)=>d.toString()),
|
|
233
|
+
anchor: null,
|
|
234
|
+
mostRecent: null
|
|
235
|
+
});
|
|
236
|
+
}, [
|
|
237
|
+
selectedNodes
|
|
238
|
+
]);
|
|
239
|
+
// Mark clicked when user clicks inside the tree container
|
|
240
|
+
function handleClick() {
|
|
241
|
+
clickedRef.current = true;
|
|
242
|
+
}
|
|
243
|
+
const handleSelect = (0, $bvJLP$useCallback)((nodes)=>{
|
|
244
|
+
if (!clickedRef.current) return;
|
|
245
|
+
clickedRef.current = false;
|
|
246
|
+
console.log("Clicked nodes:", nodes);
|
|
247
|
+
let ids = nodes.map((d)=>parseInt(d.id));
|
|
248
|
+
if (ids.length === 1 && ids[0] === selectedNodes[0]) ids = [];
|
|
249
|
+
dispatch({
|
|
250
|
+
type: "select-node",
|
|
251
|
+
payload: {
|
|
252
|
+
ids: ids
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}, [
|
|
256
|
+
selectedNodes,
|
|
257
|
+
dispatch
|
|
258
|
+
]);
|
|
259
|
+
return $71d20dff35996763$var$h("div.selection-tree-wrapper", {
|
|
260
|
+
onPointerDown: handleClick
|
|
261
|
+
}, $71d20dff35996763$var$h((0, $bvJLP$Tree), {
|
|
262
|
+
className: "selection-tree",
|
|
263
|
+
height: height,
|
|
264
|
+
width: width,
|
|
265
|
+
ref: ref,
|
|
266
|
+
data: tree,
|
|
267
|
+
onMove ({ dragIds: dragIds, parentId: parentId, index: index }) {
|
|
268
|
+
dispatch({
|
|
269
|
+
type: "move-node",
|
|
270
|
+
payload: {
|
|
271
|
+
dragIds: dragIds.map((d)=>parseInt(d)),
|
|
272
|
+
parentId: parentId ? parseInt(parentId) : null,
|
|
273
|
+
index: index
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
},
|
|
277
|
+
onDelete ({ ids: ids }) {
|
|
278
|
+
dispatch({
|
|
279
|
+
type: "delete-node",
|
|
280
|
+
payload: {
|
|
281
|
+
ids: ids.map((d)=>parseInt(d))
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
},
|
|
285
|
+
onSelect: handleSelect,
|
|
286
|
+
children: _Node,
|
|
287
|
+
idAccessor (d) {
|
|
288
|
+
return d.id.toString();
|
|
289
|
+
}
|
|
290
|
+
}));
|
|
291
|
+
}
|
|
292
|
+
function $71d20dff35996763$var$TypeList({ types: types, selected: selected, dispatch: dispatch, selectedNodes: selectedNodes, tree: tree }) {
|
|
293
|
+
const [selectedType, setSelectedType] = (0, $bvJLP$useState)(null);
|
|
294
|
+
const isSelectedNodes = selectedNodes.length > 0;
|
|
295
|
+
const darkMode = (0, $bvJLP$useInDarkMode)();
|
|
296
|
+
const luminance = darkMode ? 0.9 : 0.4;
|
|
297
|
+
return $71d20dff35996763$var$h("div.type-list-container", [
|
|
298
|
+
$71d20dff35996763$var$h("div.type-list-header", isSelectedNodes && !selectedType ? "Change selected nodes to:" : "Entity Types"),
|
|
299
|
+
$71d20dff35996763$var$h("div.type-list", Array.from(types.values()).map((type)=>$71d20dff35996763$var$h($71d20dff35996763$var$TypeTag, {
|
|
300
|
+
type: type,
|
|
301
|
+
luminance: luminance,
|
|
302
|
+
selectedType: selectedType,
|
|
303
|
+
setSelectedType: setSelectedType,
|
|
304
|
+
dispatch: dispatch,
|
|
305
|
+
tree: tree,
|
|
306
|
+
selectedNodes: selectedNodes,
|
|
307
|
+
selected: selected,
|
|
308
|
+
isSelectedNodes: isSelectedNodes
|
|
309
|
+
}))),
|
|
310
|
+
$71d20dff35996763$var$h($71d20dff35996763$var$AddType, {
|
|
311
|
+
dispatch: dispatch
|
|
312
|
+
})
|
|
313
|
+
]);
|
|
314
|
+
}
|
|
315
|
+
function $71d20dff35996763$var$collectMatchingIds(tree, id) {
|
|
316
|
+
const ids = [];
|
|
317
|
+
function traverse(node) {
|
|
318
|
+
if (node.type.id === id) ids.push(node.id);
|
|
319
|
+
if (Array.isArray(node.children)) node.children.forEach(traverse);
|
|
320
|
+
}
|
|
321
|
+
tree.forEach(traverse);
|
|
322
|
+
return ids;
|
|
323
|
+
}
|
|
324
|
+
function $71d20dff35996763$var$AddType({ dispatch: dispatch }) {
|
|
325
|
+
const [overlayOpen, setOverlayOpen] = (0, $bvJLP$useState)(false);
|
|
326
|
+
const saveHandler = (payload)=>{
|
|
327
|
+
dispatch({
|
|
328
|
+
type: "add-entity-type",
|
|
329
|
+
payload: payload
|
|
330
|
+
});
|
|
331
|
+
setOverlayOpen(false);
|
|
332
|
+
};
|
|
333
|
+
return $71d20dff35996763$var$h("div.add-type-container", [
|
|
334
|
+
$71d20dff35996763$var$h("div.add-type", {
|
|
335
|
+
onClick: ()=>setOverlayOpen(true)
|
|
336
|
+
}, [
|
|
337
|
+
$71d20dff35996763$var$h("p.add-type-text", "Add new type"),
|
|
338
|
+
$71d20dff35996763$var$h((0, $bvJLP$Icon), {
|
|
339
|
+
icon: "plus"
|
|
340
|
+
})
|
|
341
|
+
]),
|
|
342
|
+
$71d20dff35996763$var$h($71d20dff35996763$var$TypeOverlay, {
|
|
343
|
+
setOverlayOpen: setOverlayOpen,
|
|
344
|
+
overlayOpen: overlayOpen,
|
|
345
|
+
title: "Add New Type",
|
|
346
|
+
saveHandler: saveHandler
|
|
347
|
+
})
|
|
348
|
+
]);
|
|
349
|
+
}
|
|
350
|
+
function $71d20dff35996763$var$EditType({ dispatch: dispatch, type: type }) {
|
|
351
|
+
const [editorOpen, setEditorOpen] = (0, $bvJLP$useState)(false);
|
|
352
|
+
const saveHandler = (payload)=>{
|
|
353
|
+
dispatch({
|
|
354
|
+
type: "update-entity-type",
|
|
355
|
+
payload: payload
|
|
356
|
+
});
|
|
357
|
+
setEditorOpen(false);
|
|
358
|
+
};
|
|
359
|
+
return $71d20dff35996763$var$h("div.edit-type", [
|
|
360
|
+
$71d20dff35996763$var$h((0, $bvJLP$Icon), {
|
|
361
|
+
icon: "edit",
|
|
362
|
+
className: "edit-icon",
|
|
363
|
+
onClick: (e)=>{
|
|
364
|
+
e.stopPropagation();
|
|
365
|
+
setEditorOpen(true);
|
|
366
|
+
}
|
|
367
|
+
}),
|
|
368
|
+
$71d20dff35996763$var$h($71d20dff35996763$var$TypeOverlay, {
|
|
369
|
+
setOverlayOpen: setEditorOpen,
|
|
370
|
+
overlayOpen: editorOpen,
|
|
371
|
+
originalType: type,
|
|
372
|
+
title: "Edit Type",
|
|
373
|
+
saveHandler: saveHandler
|
|
374
|
+
})
|
|
375
|
+
]);
|
|
376
|
+
}
|
|
377
|
+
function $71d20dff35996763$var$TypeOverlay({ setOverlayOpen: setOverlayOpen, overlayOpen: overlayOpen, originalType: originalType, title: title, saveHandler: saveHandler }) {
|
|
378
|
+
const { name: name, description: description, color: color, id: id } = originalType || {};
|
|
379
|
+
const [nameInput, setNameInput] = (0, $bvJLP$useState)(name || "");
|
|
380
|
+
const [descriptionInput, setDescriptionInput] = (0, $bvJLP$useState)(description || "");
|
|
381
|
+
const [colorInput, setColorInput] = (0, $bvJLP$useState)(color || "#fff");
|
|
382
|
+
return $71d20dff35996763$var$h((0, $bvJLP$Overlay2), {
|
|
383
|
+
isOpen: overlayOpen
|
|
384
|
+
}, $71d20dff35996763$var$h("div.overlay-container", $71d20dff35996763$var$h("div.add-type-overlay", [
|
|
385
|
+
$71d20dff35996763$var$h("h2.title", [
|
|
386
|
+
title,
|
|
387
|
+
$71d20dff35996763$var$h((0, $bvJLP$Icon), {
|
|
388
|
+
icon: "cross",
|
|
389
|
+
className: "close-icon",
|
|
390
|
+
onClick: ()=>{
|
|
391
|
+
setOverlayOpen(false);
|
|
392
|
+
},
|
|
393
|
+
style: {
|
|
394
|
+
cursor: "pointer",
|
|
395
|
+
color: "red"
|
|
396
|
+
}
|
|
397
|
+
})
|
|
398
|
+
]),
|
|
399
|
+
$71d20dff35996763$var$h("div.form-group", [
|
|
400
|
+
$71d20dff35996763$var$h("div.text-inputs", [
|
|
401
|
+
$71d20dff35996763$var$h("div.form-field.name", [
|
|
402
|
+
$71d20dff35996763$var$h("p.label", "Name"),
|
|
403
|
+
$71d20dff35996763$var$h("input", {
|
|
404
|
+
type: "text",
|
|
405
|
+
placeholder: "Enter type name",
|
|
406
|
+
onChange: (e)=>setNameInput(e.target.value),
|
|
407
|
+
value: nameInput
|
|
408
|
+
})
|
|
409
|
+
]),
|
|
410
|
+
$71d20dff35996763$var$h("div.form-field.form-description", [
|
|
411
|
+
$71d20dff35996763$var$h("p.label", "Description"),
|
|
412
|
+
$71d20dff35996763$var$h("input", {
|
|
413
|
+
type: "text",
|
|
414
|
+
placeholder: "Enter type description",
|
|
415
|
+
onChange: (e)=>setDescriptionInput(e.target.value),
|
|
416
|
+
value: descriptionInput
|
|
417
|
+
})
|
|
418
|
+
])
|
|
419
|
+
]),
|
|
420
|
+
$71d20dff35996763$var$h("div.form-field.color", [
|
|
421
|
+
$71d20dff35996763$var$h("p.label", "Color"),
|
|
422
|
+
$71d20dff35996763$var$h((0, $bvJLP$ColorPicker), {
|
|
423
|
+
value: colorInput,
|
|
424
|
+
onChange: (color)=>setColorInput(color),
|
|
425
|
+
style: {
|
|
426
|
+
width: "100%"
|
|
427
|
+
}
|
|
428
|
+
})
|
|
429
|
+
])
|
|
430
|
+
]),
|
|
431
|
+
$71d20dff35996763$var$h((0, $bvJLP$SaveButton), {
|
|
432
|
+
className: "save-btn",
|
|
433
|
+
small: true,
|
|
434
|
+
onClick: ()=>saveHandler({
|
|
435
|
+
name: nameInput,
|
|
436
|
+
description: descriptionInput,
|
|
437
|
+
color: colorInput,
|
|
438
|
+
id: id
|
|
439
|
+
})
|
|
440
|
+
}, "Save changes")
|
|
441
|
+
])));
|
|
442
|
+
}
|
|
443
|
+
function $71d20dff35996763$var$TypeTag({ type: type, luminance: luminance, selectedType: selectedType, setSelectedType: setSelectedType, dispatch: dispatch, tree: tree, selectedNodes: selectedNodes, selected: selected, isSelectedNodes: isSelectedNodes }) {
|
|
444
|
+
const { color: color, name: name, id: id, description: description } = type;
|
|
445
|
+
const chromaColor = (0, $bvJLP$asChromaColor)(color ?? "#000000");
|
|
446
|
+
const darkMode = (0, $bvJLP$useInDarkMode)();
|
|
447
|
+
const payload = {
|
|
448
|
+
id: id,
|
|
449
|
+
name: name,
|
|
450
|
+
color: color,
|
|
451
|
+
description: description
|
|
452
|
+
};
|
|
453
|
+
const ids = $71d20dff35996763$var$collectMatchingIds(tree, id);
|
|
454
|
+
const handleTagClick = ()=>{
|
|
455
|
+
if (!isSelectedNodes && selectedType === null) {
|
|
456
|
+
if (ids.length > 0) {
|
|
457
|
+
setSelectedType(type);
|
|
458
|
+
dispatch({
|
|
459
|
+
type: "toggle-node-selected",
|
|
460
|
+
payload: {
|
|
461
|
+
ids: ids
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
} else if (isSelectedNodes && selectedType === null) {
|
|
466
|
+
if (id === selected?.id && selectedNodes.length > 0) dispatch({
|
|
467
|
+
type: "toggle-node-selected",
|
|
468
|
+
payload: {
|
|
469
|
+
ids: selectedNodes
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
else dispatch({
|
|
473
|
+
type: "select-entity-type",
|
|
474
|
+
payload: payload
|
|
475
|
+
});
|
|
476
|
+
} else if (isSelectedNodes && selectedType.id === id) {
|
|
477
|
+
setSelectedType(null);
|
|
478
|
+
dispatch({
|
|
479
|
+
type: "toggle-node-selected",
|
|
480
|
+
payload: {
|
|
481
|
+
ids: ids
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
} else if (isSelectedNodes && selectedType.id !== id) {
|
|
485
|
+
if (ids.length > 0) {
|
|
486
|
+
setSelectedType(type);
|
|
487
|
+
const oldIds = $71d20dff35996763$var$collectMatchingIds(tree, selectedType.id);
|
|
488
|
+
dispatch({
|
|
489
|
+
type: "toggle-node-selected",
|
|
490
|
+
payload: {
|
|
491
|
+
ids: oldIds
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
dispatch({
|
|
495
|
+
type: "toggle-node-selected",
|
|
496
|
+
payload: {
|
|
497
|
+
ids: ids
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
} else console.warn("Unexpected state in TypeTag click handler", {
|
|
502
|
+
isSelectedNodes: isSelectedNodes,
|
|
503
|
+
selectedType: selectedType,
|
|
504
|
+
selectedNodes: selectedNodes,
|
|
505
|
+
ids: ids,
|
|
506
|
+
id: id,
|
|
507
|
+
selected: selected
|
|
508
|
+
});
|
|
509
|
+
};
|
|
510
|
+
return $71d20dff35996763$var$h((0, $bvJLP$Popover), {
|
|
511
|
+
autoFocus: false,
|
|
512
|
+
content: $71d20dff35996763$var$h("div.description", description || "No description available"),
|
|
513
|
+
interactionKind: "hover"
|
|
514
|
+
}, $71d20dff35996763$var$h("div.type-tag", {
|
|
515
|
+
onClick: handleTagClick,
|
|
516
|
+
style: {
|
|
517
|
+
cursor: ids.length > 0 || isSelectedNodes && !selectedType ? "pointer" : "",
|
|
518
|
+
color: darkMode ? "white" : "black",
|
|
519
|
+
backgroundColor: chromaColor?.luminance(1 - luminance).hex(),
|
|
520
|
+
border: id === selected?.id && selectedNodes.length > 0 ? `1px solid var(--text-emphasized-color)` : `1px solid var(--background-color)`
|
|
521
|
+
}
|
|
522
|
+
}, $71d20dff35996763$var$h("div.type-container", [
|
|
523
|
+
$71d20dff35996763$var$h("div.type-name", name),
|
|
524
|
+
$71d20dff35996763$var$h("div.icons", [
|
|
525
|
+
$71d20dff35996763$var$h($71d20dff35996763$var$EditType, {
|
|
526
|
+
dispatch: dispatch,
|
|
527
|
+
type: type
|
|
528
|
+
}),
|
|
529
|
+
$71d20dff35996763$var$h((0, $bvJLP$Icon), {
|
|
530
|
+
icon: "cross",
|
|
531
|
+
className: "delete-type-icon",
|
|
532
|
+
style: {
|
|
533
|
+
color: "red",
|
|
534
|
+
cursor: "pointer"
|
|
535
|
+
},
|
|
536
|
+
onClick: (e)=>{
|
|
537
|
+
e.stopPropagation();
|
|
538
|
+
dispatch({
|
|
539
|
+
type: "delete-entity-type",
|
|
540
|
+
payload: {
|
|
541
|
+
id: id
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
})
|
|
546
|
+
])
|
|
547
|
+
])));
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
export {$71d20dff35996763$export$a90600c9da52b40c as FeedbackComponent, $b79bf29960412ca7$export$8d9dbb7a64bf2a5e as treeToGraph};
|
|
552
|
+
//# sourceMappingURL=feedback-components.6a6c8af5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,8EAAK;AAE5B,SAAS,qCAAkB,CAAS,EAAE,CAAS;IAC7C,IAAI,EAAE,IAAI,KAAK,EAAE,IAAI,EAAE,OAAO;IAC9B,KAAK,MAAM,QAAQ,EAAG;QACpB,IAAI,CAAC,EAAE,GAAG,CAAC,O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CAAE;wBAAG;oBAChB;gBACF;YACF;SACD;KACF;AAGP","sources":["packages/feedback-components/src/feedback/index.ts"],"sourcesContent":["import styles from \"./feedback.module.sass\";\nimport hyper from \"@macrostrat/hyper\";\n\nimport { Tree, TreeApi } from \"react-arborist\";\nimport Node from \"./node\";\nimport { FeedbackText } from \"./text-visualizer\";\nimport type { InternalEntity, TreeData } from \"./types\";\nimport type { Entity } from \"../extractions\";\nimport { ModelInfo } from \"../extractions\";\nimport {\n TreeDispatchContext,\n treeToGraph,\n useUpdatableTree,\n ViewMode,\n} from \"./edit-state\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport {\n ButtonGroup,\n Card,\n SegmentedControl,\n Icon,\n Popover,\n Divider,\n Overlay2,\n} from \"@blueprintjs/core\";\nimport { OmniboxSelector } from \"./type-selector\";\nimport {\n CancelButton,\n DataField,\n ErrorBoundary,\n FlexBox,\n FlexRow,\n SaveButton,\n} from \"@macrostrat/ui-components\";\nimport useElementDimensions from \"use-element-dimensions\";\nimport { GraphView } from \"./graph\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport { asChromaColor } from \"@macrostrat/color-utils\";\nimport { ColorPicker } from \"@macrostrat/data-sheet\";\n\nexport type { GraphData } from \"./edit-state\";\nexport { treeToGraph } from \"./edit-state\";\nexport type { TreeData } from \"./types\";\n\nconst h = hyper.styled(styles);\n\nfunction setsAreTheSame<T>(a: Set<T>, b: Set<T>) {\n if (a.size !== b.size) return false;\n for (const item of a) {\n if (!b.has(item)) return false;\n }\n return true;\n}\n\nexport function FeedbackComponent({\n entities = [],\n text,\n model,\n entityTypes,\n matchComponent,\n onSave,\n lineHeight,\n allowOverlap,\n}) {\n // Get the input arguments\n const [state, dispatch] = useUpdatableTree(\n entities.map(processEntity) as any,\n entityTypes,\n );\n\n const {\n selectedNodes,\n tree,\n selectedEntityType,\n isSelectingEntityType,\n entityTypesMap,\n } = state;\n\n const [{ width, height }, ref] = useElementDimensions();\n\n return h(TreeDispatchContext.Provider, { value: dispatch }, [\n h(\n ErrorBoundary,\n {\n description:\n \"An error occurred while rendering the feedback text component.\",\n },\n h(FeedbackText, {\n text,\n dispatch,\n // @ts-ignore\n nodes: tree,\n selectedNodes,\n lineHeight,\n allowOverlap,\n }),\n ),\n h(FlexRow, { alignItems: \"baseline\", justifyContent: \"space-between\" }, [\n h(ModelInfo, { data: model }),\n h(SegmentedControl, {\n options: [\n { label: \"Tree\", value: \"tree\" },\n { label: \"Graph\", value: \"graph\" },\n ],\n value: state.viewMode,\n small: true,\n onValueChange(value: ViewMode) {\n console.log(\"Setting view mode\", value);\n dispatch({ type: \"set-view-mode\", payload: value });\n },\n }),\n ]),\n h(\n \"div.entity-panel\",\n {\n ref,\n },\n [\n h(Card, { className: \"control-panel\" }, [\n h(\n ButtonGroup,\n {\n vertical: true,\n fill: true,\n minimal: true,\n alignText: \"left\",\n },\n [\n h(\n CancelButton,\n {\n icon: \"trash\",\n disabled: state.initialTree == state.tree,\n onClick() {\n dispatch({ type: \"reset\" });\n },\n },\n \"Reset\",\n ),\n h(\n SaveButton,\n {\n onClick() {\n onSave(state.tree);\n },\n disabled: state.initialTree == state.tree,\n },\n \"Save\",\n ),\n ],\n ),\n h(Divider),\n h(EntityTypeSelector, {\n entityTypes: entityTypesMap,\n selected: selectedEntityType,\n onChange(payload) {\n dispatch({ type: \"select-entity-type\", payload });\n },\n dispatch,\n tree,\n selectedNodes,\n isOpen: isSelectingEntityType,\n setOpen: (isOpen: boolean) =>\n dispatch({\n type: \"toggle-entity-type-selector\",\n payload: isOpen,\n }),\n }),\n ]),\n h.if(state.viewMode == \"tree\")(ManagedSelectionTree, {\n selectedNodes,\n dispatch,\n tree,\n width,\n height,\n matchComponent,\n }),\n h.if(state.viewMode == \"graph\")(GraphView, {\n tree,\n width,\n height,\n dispatch,\n selectedNodes,\n }),\n ],\n ),\n ]);\n}\n\nfunction processEntity(entity: Entity): InternalEntity {\n // @ts-ignore\n return {\n ...entity,\n // @ts-ignore\n term_type: entity.type.name,\n txt_range: [entity.indices],\n children: entity.children?.map(processEntity) ?? [],\n };\n}\n\nfunction EntityTypeSelector({\n entityTypes,\n selected,\n isOpen,\n setOpen,\n onChange,\n tree,\n dispatch,\n selectedNodes = [],\n}) {\n // Show all entity types when selected is null\n const _selected = selected != null ? selected : undefined;\n const [inputValue, setInputValue] = useState(\"\");\n const types = Array.from(entityTypes.values());\n\n const items =\n inputValue !== \"\"\n ? types.filter((d) =>\n d.name.toLowerCase().includes(inputValue.toLowerCase()),\n )\n : types;\n\n return h(\"div.entity-type-selector\", [\n h(TypeList, {\n types: entityTypes,\n selected: _selected,\n dispatch,\n selectedNodes,\n tree,\n }),\n h(OmniboxSelector, {\n isOpen,\n items,\n selectedItem: _selected,\n onSelectItem(item) {\n setOpen(false);\n onChange(item);\n },\n onQueryChange(query) {\n setInputValue(query);\n },\n onClose() {\n setOpen(false);\n },\n }),\n ]);\n}\n\nfunction countNodes(tree) {\n if (!tree) return 0;\n let count = 0;\n\n function recurse(nodes) {\n for (const node of nodes) {\n count++;\n if (node.children && Array.isArray(node.children)) {\n recurse(node.children);\n }\n }\n }\n\n recurse(tree);\n return count;\n}\n\nfunction ManagedSelectionTree(props) {\n const { selectedNodes, dispatch, tree, height, width, matchComponent } =\n props;\n\n const ref = useRef<TreeApi<TreeData>>();\n // Use a ref to track clicks (won't cause rerender)\n const clickedRef = useRef(false);\n\n const _Node = useCallback(\n (props) => h(Node, { ...props, matchComponent }),\n [matchComponent],\n );\n\n // Update Tree selection when selectedNodes change\n useEffect(() => {\n if (ref.current == null) return;\n\n const selection = new Set(selectedNodes.map((d) => d.toString()));\n const currentSelection = ref.current.selectedIds;\n if (setsAreTheSame(selection, currentSelection)) return;\n\n ref.current.setSelection({\n ids: selectedNodes.map((d) => d.toString()),\n anchor: null,\n mostRecent: null,\n });\n }, [selectedNodes]);\n\n // Mark clicked when user clicks inside the tree container\n function handleClick() {\n clickedRef.current = true;\n }\n\n const handleSelect = useCallback(\n (nodes) => {\n if (!clickedRef.current) return;\n clickedRef.current = false;\n console.log(\"Clicked nodes:\", nodes);\n\n let ids = nodes.map((d) => parseInt(d.id));\n if (ids.length === 1 && ids[0] === selectedNodes[0]) {\n ids = [];\n }\n\n dispatch({ type: \"select-node\", payload: { ids } });\n },\n [selectedNodes, dispatch],\n );\n\n return h(\n \"div.selection-tree-wrapper\",\n { onPointerDown: handleClick },\n h(Tree, {\n className: \"selection-tree\",\n height,\n width,\n ref,\n data: tree,\n onMove({ dragIds, parentId, index }) {\n dispatch({\n type: \"move-node\",\n payload: {\n dragIds: dragIds.map((d) => parseInt(d)),\n parentId: parentId ? parseInt(parentId) : null,\n index,\n },\n });\n },\n onDelete({ ids }) {\n dispatch({\n type: \"delete-node\",\n payload: { ids: ids.map((d) => parseInt(d)) },\n });\n },\n onSelect: handleSelect,\n children: _Node,\n idAccessor(d) {\n return d.id.toString();\n },\n }),\n );\n}\n\nfunction TypeList({ types, selected, dispatch, selectedNodes, tree }) {\n const [selectedType, setSelectedType] = useState(null);\n const isSelectedNodes = selectedNodes.length > 0;\n const darkMode = useInDarkMode();\n const luminance = darkMode ? 0.9 : 0.4;\n\n return h(\"div.type-list-container\", [\n h(\n \"div.type-list-header\",\n isSelectedNodes && !selectedType\n ? \"Change selected nodes to:\"\n : \"Entity Types\",\n ),\n h(\n \"div.type-list\",\n Array.from(types.values()).map((type) =>\n h(TypeTag, {\n type,\n luminance,\n selectedType,\n setSelectedType,\n dispatch,\n tree,\n selectedNodes,\n selected,\n isSelectedNodes,\n }),\n ),\n ),\n h(AddType, { dispatch }),\n ]);\n}\n\nfunction collectMatchingIds(tree, id) {\n const ids = [];\n\n function traverse(node) {\n if (node.type.id === id) {\n ids.push(node.id);\n }\n if (Array.isArray(node.children)) {\n node.children.forEach(traverse);\n }\n }\n\n tree.forEach(traverse);\n return ids;\n}\n\nfunction AddType({ dispatch }) {\n const [overlayOpen, setOverlayOpen] = useState(false);\n\n const saveHandler = (payload) => {\n dispatch({\n type: \"add-entity-type\",\n payload,\n });\n setOverlayOpen(false);\n };\n\n return h(\"div.add-type-container\", [\n h(\"div.add-type\", { onClick: () => setOverlayOpen(true) }, [\n h(\"p.add-type-text\", \"Add new type\"),\n h(Icon, { icon: \"plus\" }),\n ]),\n h(TypeOverlay, {\n setOverlayOpen,\n overlayOpen,\n title: \"Add New Type\",\n saveHandler,\n }),\n ]);\n}\n\nfunction EditType({ dispatch, type }) {\n const [editorOpen, setEditorOpen] = useState(false);\n\n const saveHandler = (payload) => {\n dispatch({\n type: \"update-entity-type\",\n payload,\n });\n setEditorOpen(false);\n };\n\n return h(\"div.edit-type\", [\n h(Icon, {\n icon: \"edit\",\n className: \"edit-icon\",\n onClick: (e) => {\n e.stopPropagation();\n setEditorOpen(true);\n },\n }),\n h(TypeOverlay, {\n setOverlayOpen: setEditorOpen,\n overlayOpen: editorOpen,\n originalType: type,\n title: \"Edit Type\",\n saveHandler,\n }),\n ]);\n}\n\nfunction TypeOverlay({\n setOverlayOpen,\n overlayOpen,\n originalType,\n title,\n saveHandler,\n}) {\n const { name, description, color, id } = originalType || {};\n\n const [nameInput, setNameInput] = useState(name || \"\");\n const [descriptionInput, setDescriptionInput] = useState(description || \"\");\n const [colorInput, setColorInput] = useState(color || \"#fff\");\n\n return h(\n Overlay2,\n {\n isOpen: overlayOpen,\n },\n h(\n \"div.overlay-container\",\n h(\"div.add-type-overlay\", [\n h(\"h2.title\", [\n title,\n h(Icon, {\n icon: \"cross\",\n className: \"close-icon\",\n onClick: () => {\n setOverlayOpen(false);\n },\n style: { cursor: \"pointer\", color: \"red\" },\n }),\n ]),\n h(\"div.form-group\", [\n h(\"div.text-inputs\", [\n h(\"div.form-field.name\", [\n h(\"p.label\", \"Name\"),\n h(\"input\", {\n type: \"text\",\n placeholder: \"Enter type name\",\n onChange: (e) => setNameInput(e.target.value),\n value: nameInput,\n }),\n ]),\n h(\"div.form-field.form-description\", [\n h(\"p.label\", \"Description\"),\n h(\"input\", {\n type: \"text\",\n placeholder: \"Enter type description\",\n onChange: (e) => setDescriptionInput(e.target.value),\n value: descriptionInput,\n }),\n ]),\n ]),\n h(\"div.form-field.color\", [\n h(\"p.label\", \"Color\"),\n h(ColorPicker, {\n value: colorInput,\n onChange: (color) => setColorInput(color),\n style: { width: \"100%\" },\n }),\n ]),\n ]),\n h(\n SaveButton,\n {\n className: \"save-btn\",\n small: true,\n onClick: () =>\n saveHandler({\n name: nameInput,\n description: descriptionInput,\n color: colorInput,\n id,\n }),\n },\n \"Save changes\",\n ),\n ]),\n ),\n );\n}\n\nfunction TypeTag({\n type,\n luminance,\n selectedType,\n setSelectedType,\n dispatch,\n tree,\n selectedNodes,\n selected,\n isSelectedNodes,\n}) {\n const { color, name, id, description } = type;\n const chromaColor = asChromaColor(color ?? \"#000000\");\n const darkMode = useInDarkMode();\n\n const payload = {\n id,\n name,\n color,\n description,\n };\n\n const ids = collectMatchingIds(tree, id);\n\n const handleTagClick = () => {\n if (!isSelectedNodes && selectedType === null) {\n if (ids.length > 0) {\n setSelectedType(type);\n dispatch({ type: \"toggle-node-selected\", payload: { ids } });\n }\n } else if (isSelectedNodes && selectedType === null) {\n if (id === selected?.id && selectedNodes.length > 0) {\n dispatch({\n type: \"toggle-node-selected\",\n payload: { ids: selectedNodes },\n });\n } else {\n dispatch({ type: \"select-entity-type\", payload });\n }\n } else if (isSelectedNodes && selectedType.id === id) {\n setSelectedType(null);\n dispatch({ type: \"toggle-node-selected\", payload: { ids } });\n } else if (isSelectedNodes && selectedType.id !== id) {\n if (ids.length > 0) {\n setSelectedType(type);\n const oldIds = collectMatchingIds(tree, selectedType.id);\n\n dispatch({ type: \"toggle-node-selected\", payload: { ids: oldIds } });\n dispatch({ type: \"toggle-node-selected\", payload: { ids } });\n }\n } else {\n console.warn(\"Unexpected state in TypeTag click handler\", {\n isSelectedNodes,\n selectedType,\n selectedNodes,\n ids,\n id,\n selected,\n });\n }\n };\n\n return h(\n Popover,\n {\n autoFocus: false,\n content: h(\"div.description\", description || \"No description available\"),\n interactionKind: \"hover\",\n },\n h(\n \"div.type-tag\",\n {\n onClick: handleTagClick,\n style: {\n cursor:\n ids.length > 0 || (isSelectedNodes && !selectedType)\n ? \"pointer\"\n : \"\",\n color: darkMode ? \"white\" : \"black\",\n backgroundColor: chromaColor?.luminance(1 - luminance).hex(),\n border:\n id === selected?.id && selectedNodes.length > 0\n ? `1px solid var(--text-emphasized-color)`\n : `1px solid var(--background-color)`,\n },\n },\n h(\"div.type-container\", [\n h(\"div.type-name\", name),\n h(\"div.icons\", [\n h(EditType, {\n dispatch,\n type,\n }),\n h(Icon, {\n icon: \"cross\",\n className: \"delete-type-icon\",\n style: { color: \"red\", cursor: \"pointer\" },\n onClick: (e) => {\n e.stopPropagation();\n dispatch({\n type: \"delete-entity-type\",\n payload: { id },\n });\n },\n }),\n ]),\n ]),\n ),\n );\n}\n"],"names":[],"version":3,"file":"feedback-components.6a6c8af5.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA,IAAA;AACA,IAAA;AADA,4CAA6B,CAAC,eAAe,CAAC;AAC9C,4CAA2B,CAAC,aAAa,CAAC","sources":["packages/feedback-components/src/extractions/main.module.sass"],"sourcesContent":[".entities\n list-style: none\n padding-left: 0\n\n .entities ul\n list-style: none\n\n.entity\n margin: 0.2em 0 0.5em\n padding-right: 3px\n"],"names":[],"version":3,"file":"
|
|
1
|
+
{"mappings":";;;;;;;;AAAA,IAAA;AACA,IAAA;AADA,4CAA6B,CAAC,eAAe,CAAC;AAC9C,4CAA2B,CAAC,aAAa,CAAC","sources":["packages/feedback-components/src/extractions/main.module.sass"],"sourcesContent":[".entities\n list-style: none\n padding-left: 0\n\n .entities ul\n list-style: none\n\n.entity\n margin: 0.2em 0 0.5em\n padding-right: 3px\n"],"names":[],"version":3,"file":"feedback-components.6d32ee91.js.map"}
|