@searpent/react-image-annotate 2.0.75 → 2.0.77
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/.babelrc +6 -0
- package/.env +1 -0
- package/.flowconfig +2 -0
- package/.github/workflows/release-on-master.yml +32 -0
- package/.github/workflows/test.yml +16 -0
- package/.prettierrc +3 -0
- package/.releaserc.js +18 -0
- package/.storybook/addons.js +2 -0
- package/.storybook/config.js +16 -0
- package/LICENSE +21 -0
- package/package.json +1 -1
- package/public/favicon.ico +0 -0
- package/public/index.html +38 -0
- package/src/Annotator/bike-pic.png +0 -0
- package/src/Annotator/bike-pic2.png +0 -0
- package/src/Annotator/dab-keyframes.story.json +1 -0
- package/src/Annotator/exampleImages.js +48 -0
- package/src/Annotator/examplePhotos.js +7603 -0
- package/src/Annotator/index.js +380 -0
- package/src/Annotator/index.story.js +899 -0
- package/src/Annotator/poses.story.js +150 -0
- package/src/Annotator/reducers/combine-reducers.js +7 -0
- package/src/Annotator/reducers/convert-expanding-line-to-polygon.js +53 -0
- package/{Annotator → src/Annotator}/reducers/fix-twisted.js +5 -3
- package/src/Annotator/reducers/general-reducer.js +1228 -0
- package/src/Annotator/reducers/get-active-image.js +21 -0
- package/src/Annotator/reducers/get-implied-video-regions.js +115 -0
- package/src/Annotator/reducers/history-handler.js +60 -0
- package/src/Annotator/reducers/image-reducer.js +23 -0
- package/src/Annotator/reducers/video-reducer.js +85 -0
- package/src/Annotator/video.story.js +51 -0
- package/src/ClassSelectionMenu/index.js +112 -0
- package/src/Crosshairs/index.js +64 -0
- package/src/DebugSidebarBox/index.js +36 -0
- package/src/DemoSite/Editor.js +235 -0
- package/src/DemoSite/ErrorBoundaryDialog.js +34 -0
- package/src/DemoSite/index.js +41 -0
- package/src/DemoSite/index.story.js +10 -0
- package/src/DemoSite/simple-segmentation-example.json +572 -0
- package/{Editor → src/Editor}/annotation-plugin/annotation.css +20 -0
- package/src/Editor/annotation-plugin/annotation.js +546 -0
- package/src/Editor/index.js +50 -0
- package/src/Editor/readOnly.js +31 -0
- package/{Editor → src/Editor}/tools.js +3 -2
- package/src/Errorer/index.js +13 -0
- package/src/FullImageSegmentationAnnotator/hard1.story.jpg +0 -0
- package/src/FullImageSegmentationAnnotator/hard2.story.jpg +0 -0
- package/src/FullImageSegmentationAnnotator/hard3.story.jpg +0 -0
- package/src/FullImageSegmentationAnnotator/index.js +7 -0
- package/src/FullImageSegmentationAnnotator/index.story.js +177 -0
- package/src/FullImageSegmentationAnnotator/orange.story.png +0 -0
- package/src/GroupSelectorSidebarBox/index.js +48 -0
- package/src/GroupsEditorSidebarBox/index.js +108 -0
- package/src/HelpSidebarBox/index.js +43 -0
- package/src/HighlightBox/index.js +143 -0
- package/src/HistorySidebarBox/index.js +78 -0
- package/src/ImageCanvas/dancing-man.story.jpg +0 -0
- package/src/ImageCanvas/index.js +515 -0
- package/src/ImageCanvas/index.story.js +314 -0
- package/src/ImageCanvas/mouse_mask.story.png +0 -0
- package/src/ImageCanvas/region-tools.js +171 -0
- package/src/ImageCanvas/seves_desk.story.jpg +0 -0
- package/{ImageCanvas → src/ImageCanvas}/styles.js +8 -12
- package/src/ImageCanvas/use-mouse.js +168 -0
- package/src/ImageCanvas/use-project-box.js +23 -0
- package/src/ImageCanvas/use-wasd-mode.js +50 -0
- package/src/ImageMask/index.js +127 -0
- package/src/ImageMask/load-image.js +32 -0
- package/src/ImageSelectorSidebarBox/index.js +54 -0
- package/src/KeyframeTimeline/get-time-string.js +25 -0
- package/src/KeyframeTimeline/index.js +223 -0
- package/src/KeyframesSelectorSidebarBox/index.js +93 -0
- package/src/LandingPage/content.md +57 -0
- package/src/LandingPage/github-markdown.css +964 -0
- package/src/LandingPage/index.js +147 -0
- package/src/Locker/index.js +13 -0
- package/src/MainLayout/RightSidebarItemsWrapper.js +21 -0
- package/src/MainLayout/icon-dictionary.js +79 -0
- package/src/MainLayout/index.js +564 -0
- package/src/MainLayout/index.story.js +240 -0
- package/{MainLayout → src/MainLayout}/styles.js +7 -6
- package/src/MainLayout/types.js +171 -0
- package/src/MainLayout/use-implied-video-regions.js +17 -0
- package/src/MetadataEditorSidebarBox/index.js +160 -0
- package/src/PageSelector/index.js +159 -0
- package/src/PointDistances/index.js +90 -0
- package/src/PreventScrollToParents/index.js +48 -0
- package/src/PreventScrollToParents/index.story.js +23 -0
- package/src/RegionLabel/index.js +236 -0
- package/{RegionLabel → src/RegionLabel}/styles.js +15 -12
- package/src/RegionSelectAndTransformBoxes/index.js +236 -0
- package/src/RegionSelectorSidebarBox/index.js +220 -0
- package/{RegionSelectorSidebarBox → src/RegionSelectorSidebarBox}/styles.js +14 -13
- package/src/RegionShapes/index.js +254 -0
- package/src/RegionTags/index.js +136 -0
- package/src/SettingsDialog/index.js +58 -0
- package/src/SettingsProvider/index.js +57 -0
- package/src/Shortcuts/ShortcutField.js +44 -0
- package/src/Shortcuts/index.js +129 -0
- package/src/ShortcutsManager/index.js +162 -0
- package/src/Sidebar/index.js +117 -0
- package/src/SidebarBoxContainer/index.js +93 -0
- package/src/SmallToolButton/index.js +57 -0
- package/src/TagsSidebarBox/index.js +93 -0
- package/src/TaskDescriptionSidebarBox/index.js +43 -0
- package/src/Theme/index.js +36 -0
- package/src/VideoOrImageCanvasBackground/index.js +170 -0
- package/src/colors.js +32 -0
- package/src/hooks/use-colors.js +95 -0
- package/src/hooks/use-event-callback.js +11 -0
- package/src/hooks/use-exclude-pattern.js +27 -0
- package/src/hooks/use-load-image.js +21 -0
- package/src/hooks/use-window-size.js +46 -0
- package/{hooks → src/hooks}/xpattern.js +1 -1
- package/src/hooks/xpattern.png +0 -0
- package/src/index.js +18 -0
- package/src/lib.js +7 -0
- package/src/screenshot.png +0 -0
- package/src/site.css +5 -0
- package/src/stories.js +2 -0
- package/src/utils/blocks-to-article.js +61 -0
- package/{utils → src/utils}/blocks-to-article.test.js +8 -5
- package/{utils → src/utils}/default-locked-until.js +1 -2
- package/{utils → src/utils}/filter-only-unique.js +1 -1
- package/src/utils/get-from-local-storage.js +7 -0
- package/src/utils/get-hotkey-help-text.js +11 -0
- package/src/utils/get-landmarks-with-transform.js +23 -0
- package/src/utils/photosToImages.js +67 -0
- package/src/utils/regions-groups.js +19 -0
- package/src/utils/regions-to-blocks.js +16 -0
- package/src/utils/saveable-actions-enum.js +5 -0
- package/src/utils/set-in-local-storage.js +6 -0
- package/src/utils/sleep.js +3 -0
- package/src/utils/uuid-to-hash.js +5 -0
- package/Annotator/exampleImages.js +0 -41
- package/Annotator/examplePhotos.js +0 -6980
- package/Annotator/index.js +0 -417
- package/Annotator/reducers/combine-reducers.js +0 -14
- package/Annotator/reducers/convert-expanding-line-to-polygon.js +0 -73
- package/Annotator/reducers/general-reducer.js +0 -1430
- package/Annotator/reducers/get-active-image.js +0 -27
- package/Annotator/reducers/get-implied-video-regions.js +0 -180
- package/Annotator/reducers/history-handler.js +0 -38
- package/Annotator/reducers/image-reducer.js +0 -20
- package/Annotator/reducers/video-reducer.js +0 -88
- package/ClassSelectionMenu/index.js +0 -140
- package/Crosshairs/index.js +0 -53
- package/DebugSidebarBox/index.js +0 -20
- package/DemoSite/Editor.js +0 -194
- package/DemoSite/ErrorBoundaryDialog.js +0 -64
- package/DemoSite/index.js +0 -40
- package/Editor/annotation-plugin/annotation.js +0 -647
- package/Editor/index.js +0 -93
- package/Editor/readOnly.js +0 -73
- package/Errorer/index.js +0 -11
- package/FullImageSegmentationAnnotator/index.js +0 -7
- package/GroupSelectorSidebarBox/index.js +0 -63
- package/GroupsEditorSidebarBox/index.js +0 -138
- package/HelpSidebarBox/index.js +0 -58
- package/HighlightBox/index.js +0 -102
- package/HistorySidebarBox/index.js +0 -71
- package/ImageCanvas/index.js +0 -441
- package/ImageCanvas/region-tools.js +0 -165
- package/ImageCanvas/use-mouse.js +0 -180
- package/ImageCanvas/use-project-box.js +0 -27
- package/ImageCanvas/use-wasd-mode.js +0 -62
- package/ImageMask/index.js +0 -133
- package/ImageMask/load-image.js +0 -25
- package/ImageSelectorSidebarBox/index.js +0 -60
- package/KeyframeTimeline/get-time-string.js +0 -27
- package/KeyframeTimeline/index.js +0 -233
- package/KeyframesSelectorSidebarBox/index.js +0 -93
- package/LandingPage/index.js +0 -159
- package/Locker/index.js +0 -11
- package/MainLayout/RightSidebarItemsWrapper.js +0 -19
- package/MainLayout/icon-dictionary.js +0 -104
- package/MainLayout/index.js +0 -526
- package/MainLayout/types.js +0 -0
- package/MainLayout/use-implied-video-regions.js +0 -13
- package/MetadataEditorSidebarBox/index.js +0 -231
- package/PageSelector/index.js +0 -180
- package/PointDistances/index.js +0 -73
- package/PreventScrollToParents/index.js +0 -51
- package/RegionLabel/index.js +0 -232
- package/RegionSelectAndTransformBoxes/index.js +0 -169
- package/RegionSelectorSidebarBox/index.js +0 -254
- package/RegionShapes/index.js +0 -294
- package/RegionTags/index.js +0 -144
- package/SettingsDialog/index.js +0 -52
- package/SettingsProvider/index.js +0 -60
- package/Shortcuts/ShortcutField.js +0 -46
- package/Shortcuts/index.js +0 -133
- package/ShortcutsManager/index.js +0 -155
- package/Sidebar/index.js +0 -69
- package/SidebarBoxContainer/index.js +0 -93
- package/SmallToolButton/index.js +0 -42
- package/TagsSidebarBox/index.js +0 -105
- package/TaskDescriptionSidebarBox/index.js +0 -58
- package/Theme/index.js +0 -30
- package/VideoOrImageCanvasBackground/index.js +0 -151
- package/colors.js +0 -14
- package/hooks/use-colors.js +0 -97
- package/hooks/use-event-callback.js +0 -10
- package/hooks/use-exclude-pattern.js +0 -24
- package/hooks/use-load-image.js +0 -26
- package/hooks/use-window-size.js +0 -46
- package/index.js +0 -3
- package/lib.js +0 -3
- package/stories.js +0 -5
- package/utils/blocks-to-article.js +0 -60
- package/utils/get-from-local-storage.js +0 -7
- package/utils/get-hotkey-help-text.js +0 -9
- package/utils/get-landmarks-with-transform.js +0 -40
- package/utils/photosToImages.js +0 -85
- package/utils/regions-groups.js +0 -28
- package/utils/regions-to-blocks.js +0 -18
- package/utils/saveable-actions-enum.js +0 -3
- package/utils/set-in-local-storage.js +0 -3
- package/utils/sleep.js +0 -7
- package/utils/uuid-to-hash.js +0 -5
- /package/{Errorer → src/Errorer}/errorer.css +0 -0
- /package/{Locker → src/Locker}/locker.css +0 -0
- /package/{PageSelector → src/PageSelector}/page-selector.css +0 -0
- /package/{utils → src/utils}/next-group-id.js +0 -0
package/Editor/index.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import React, { useState } from 'react';
|
|
5
|
-
import { createReactEditorJS } from 'react-editor-js';
|
|
6
|
-
import blocksToArticle from '../utils/blocks-to-article';
|
|
7
|
-
import { EDITOR_JS_TOOLS } from './tools';
|
|
8
|
-
import ReadOnly from './readOnly';
|
|
9
|
-
var ReactEditorJS = createReactEditorJS();
|
|
10
|
-
|
|
11
|
-
function Editor(_ref) {
|
|
12
|
-
var _ref$blocks = _ref.blocks,
|
|
13
|
-
blocks = _ref$blocks === void 0 ? [] : _ref$blocks,
|
|
14
|
-
onChange = _ref.onChange,
|
|
15
|
-
imageIndex = _ref.imageIndex,
|
|
16
|
-
selectedFrame = _ref.selectedFrame;
|
|
17
|
-
|
|
18
|
-
var _useState = useState(false),
|
|
19
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
-
editMode = _useState2[0],
|
|
21
|
-
setEditMode = _useState2[1];
|
|
22
|
-
|
|
23
|
-
var handleChange =
|
|
24
|
-
/*#__PURE__*/
|
|
25
|
-
function () {
|
|
26
|
-
var _ref2 = _asyncToGenerator(
|
|
27
|
-
/*#__PURE__*/
|
|
28
|
-
_regeneratorRuntime.mark(function _callee(instance) {
|
|
29
|
-
var data;
|
|
30
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
31
|
-
while (1) {
|
|
32
|
-
switch (_context.prev = _context.next) {
|
|
33
|
-
case 0:
|
|
34
|
-
_context.next = 2;
|
|
35
|
-
return instance.saver.save();
|
|
36
|
-
|
|
37
|
-
case 2:
|
|
38
|
-
data = _context.sent;
|
|
39
|
-
onChange({
|
|
40
|
-
imageIndex: imageIndex,
|
|
41
|
-
data: data
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
case 4:
|
|
45
|
-
case "end":
|
|
46
|
-
return _context.stop();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}, _callee);
|
|
50
|
-
}));
|
|
51
|
-
|
|
52
|
-
return function handleChange(_x) {
|
|
53
|
-
return _ref2.apply(this, arguments);
|
|
54
|
-
};
|
|
55
|
-
}();
|
|
56
|
-
|
|
57
|
-
var toggleEditMode = function toggleEditMode() {
|
|
58
|
-
setEditMode(function (prev) {
|
|
59
|
-
return !prev;
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
if (blocks.length < 1) {
|
|
64
|
-
return React.createElement("div", {
|
|
65
|
-
className: "instructions"
|
|
66
|
-
}, React.createElement("h1", null, "Click article to display text."));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return React.createElement("div", null, React.createElement("div", {
|
|
70
|
-
className: "show-metadata-wrapper"
|
|
71
|
-
}, React.createElement("label", {
|
|
72
|
-
className: "switch mr-2"
|
|
73
|
-
}, React.createElement("input", {
|
|
74
|
-
id: "show-metadata",
|
|
75
|
-
type: "checkbox",
|
|
76
|
-
value: editMode,
|
|
77
|
-
onChange: toggleEditMode
|
|
78
|
-
}), React.createElement("span", {
|
|
79
|
-
className: "slider round"
|
|
80
|
-
})), React.createElement("label", null, "Edit mode")), !editMode ? React.createElement(ReadOnly, {
|
|
81
|
-
article: blocksToArticle(blocks)
|
|
82
|
-
}) : React.createElement(ReactEditorJS, {
|
|
83
|
-
defaultValue: {
|
|
84
|
-
blocks: blocks
|
|
85
|
-
},
|
|
86
|
-
tools: EDITOR_JS_TOOLS,
|
|
87
|
-
onChange: handleChange,
|
|
88
|
-
enableReInitialize: true,
|
|
89
|
-
key: selectedFrame
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default Editor;
|
package/Editor/readOnly.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
function ReadOnly(_ref) {
|
|
4
|
-
var article = _ref.article;
|
|
5
|
-
return React.createElement("div", null, React.createElement("h1", {
|
|
6
|
-
className: "ro-title",
|
|
7
|
-
dangerouslySetInnerHTML: {
|
|
8
|
-
__html: article.title
|
|
9
|
-
}
|
|
10
|
-
}), React.createElement("h2", {
|
|
11
|
-
className: "ro-subtitle",
|
|
12
|
-
dangerouslySetInnerHTML: {
|
|
13
|
-
__html: article.subtitle
|
|
14
|
-
}
|
|
15
|
-
}), React.createElement("p", {
|
|
16
|
-
className: "ro-text",
|
|
17
|
-
dangerouslySetInnerHTML: {
|
|
18
|
-
__html: article.text
|
|
19
|
-
}
|
|
20
|
-
}), React.createElement("p", {
|
|
21
|
-
className: "ro-author",
|
|
22
|
-
dangerouslySetInnerHTML: {
|
|
23
|
-
__html: article.author
|
|
24
|
-
}
|
|
25
|
-
}), React.createElement("p", {
|
|
26
|
-
className: "ro-about-author",
|
|
27
|
-
dangerouslySetInnerHTML: {
|
|
28
|
-
__html: article.about_author
|
|
29
|
-
}
|
|
30
|
-
}), React.createElement("p", {
|
|
31
|
-
className: "ro-appendix",
|
|
32
|
-
dangerouslySetInnerHTML: {
|
|
33
|
-
__html: article.appendix
|
|
34
|
-
}
|
|
35
|
-
}), React.createElement("p", {
|
|
36
|
-
className: "ro-photo-author",
|
|
37
|
-
dangerouslySetInnerHTML: {
|
|
38
|
-
__html: article.photo_author
|
|
39
|
-
}
|
|
40
|
-
}), React.createElement("p", {
|
|
41
|
-
className: "ro-photo-caption",
|
|
42
|
-
dangerouslySetInnerHTML: {
|
|
43
|
-
__html: article.photo_caption
|
|
44
|
-
}
|
|
45
|
-
}), React.createElement("p", {
|
|
46
|
-
className: "ro-advertisment",
|
|
47
|
-
dangerouslySetInnerHTML: {
|
|
48
|
-
__html: article.advertisement
|
|
49
|
-
}
|
|
50
|
-
}), React.createElement("p", {
|
|
51
|
-
className: "ro-other-graphics",
|
|
52
|
-
dangerouslySetInnerHTML: {
|
|
53
|
-
__html: article.other_graphics
|
|
54
|
-
}
|
|
55
|
-
}), React.createElement("p", {
|
|
56
|
-
className: "ro-unknown",
|
|
57
|
-
dangerouslySetInnerHTML: {
|
|
58
|
-
__html: article.unknown
|
|
59
|
-
}
|
|
60
|
-
}), React.createElement("p", {
|
|
61
|
-
className: "ro-table",
|
|
62
|
-
dangerouslySetInnerHTML: {
|
|
63
|
-
__html: article.table
|
|
64
|
-
}
|
|
65
|
-
}), React.createElement("p", {
|
|
66
|
-
className: "ro-section",
|
|
67
|
-
dangerouslySetInnerHTML: {
|
|
68
|
-
__html: article.section
|
|
69
|
-
}
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export default ReadOnly;
|
package/Errorer/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ErrorIcon from '@mui/icons-material/Error';
|
|
3
|
-
import './errorer.css';
|
|
4
|
-
|
|
5
|
-
function Errorer() {
|
|
6
|
-
return React.createElement("div", {
|
|
7
|
-
className: "errorer"
|
|
8
|
-
}, React.createElement(ErrorIcon, null));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default Errorer;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React, { memo } from "react";
|
|
2
|
-
import { makeStyles } from "@mui/styles";
|
|
3
|
-
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
4
|
-
import SidebarBoxContainer from "../SidebarBoxContainer";
|
|
5
|
-
import CollectionsIcon from "@mui/icons-material/Collections";
|
|
6
|
-
import { grey } from "@mui/material/colors";
|
|
7
|
-
import List from "@mui/material/List";
|
|
8
|
-
import ListItem from "@mui/material/ListItem";
|
|
9
|
-
import ListItemText from "@mui/material/ListItemText";
|
|
10
|
-
import uuidToHash from '../utils/uuid-to-hash';
|
|
11
|
-
var theme = createTheme();
|
|
12
|
-
var useStyles = makeStyles(function (theme) {
|
|
13
|
-
return {
|
|
14
|
-
img: {
|
|
15
|
-
width: 40,
|
|
16
|
-
height: 40,
|
|
17
|
-
borderRadius: 8
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
export var GroupSelectorSidebarBox = function GroupSelectorSidebarBox(_ref) {
|
|
22
|
-
var title = _ref.title,
|
|
23
|
-
subtitle = _ref.subtitle,
|
|
24
|
-
groups = _ref.groups,
|
|
25
|
-
onSelect = _ref.onSelect,
|
|
26
|
-
selectedGroupId = _ref.selectedGroupId;
|
|
27
|
-
var classes = useStyles();
|
|
28
|
-
return React.createElement(ThemeProvider, {
|
|
29
|
-
theme: theme
|
|
30
|
-
}, React.createElement(SidebarBoxContainer, {
|
|
31
|
-
title: title || '',
|
|
32
|
-
subTitle: subtitle || '',
|
|
33
|
-
icon: React.createElement(CollectionsIcon, {
|
|
34
|
-
style: {
|
|
35
|
-
color: grey[700]
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
}, React.createElement(List, null, groups.map(function (_ref2, i) {
|
|
39
|
-
var id = _ref2.id,
|
|
40
|
-
groupTitle = _ref2.title,
|
|
41
|
-
groupSubtitle = _ref2.subtitle,
|
|
42
|
-
color = _ref2.color;
|
|
43
|
-
return React.createElement(ListItem, {
|
|
44
|
-
button: true,
|
|
45
|
-
onClick: function onClick() {
|
|
46
|
-
return onSelect(id);
|
|
47
|
-
},
|
|
48
|
-
dense: true,
|
|
49
|
-
key: id,
|
|
50
|
-
style: {
|
|
51
|
-
backgroundColor: id === selectedGroupId ? '#bbdefb' : null
|
|
52
|
-
}
|
|
53
|
-
}, React.createElement(ListItemText, {
|
|
54
|
-
primary: React.createElement("strong", {
|
|
55
|
-
style: {
|
|
56
|
-
color: color
|
|
57
|
-
}
|
|
58
|
-
}, uuidToHash(groupTitle)),
|
|
59
|
-
secondary: groupSubtitle
|
|
60
|
-
}));
|
|
61
|
-
}))));
|
|
62
|
-
};
|
|
63
|
-
export default GroupSelectorSidebarBox;
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { memo, useState } from "react";
|
|
3
|
-
import SidebarBoxContainer from "../SidebarBoxContainer";
|
|
4
|
-
import FilterNoneIcon from '@mui/icons-material/FilterNone';
|
|
5
|
-
import { styled } from "@mui/material/styles";
|
|
6
|
-
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
7
|
-
import { grey } from "@mui/material/colors";
|
|
8
|
-
import uuidToHash from "../utils/uuid-to-hash";
|
|
9
|
-
var theme = createTheme();
|
|
10
|
-
var GroupItemDiv = styled("div")(function (_ref) {
|
|
11
|
-
var theme = _ref.theme;
|
|
12
|
-
return {
|
|
13
|
-
display: "flex",
|
|
14
|
-
flexDirection: "column",
|
|
15
|
-
marginBottom: "1rem",
|
|
16
|
-
"& > label": {
|
|
17
|
-
fontSize: "1rem",
|
|
18
|
-
marginBottom: ".5rem",
|
|
19
|
-
textTransform: "capitalize"
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
var GroupItem = function GroupItem(_ref2) {
|
|
25
|
-
var group = _ref2.group;
|
|
26
|
-
return React.createElement(GroupItemDiv, null, uuidToHash(group.id));
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
var GroupList = function GroupList(_ref3) {
|
|
30
|
-
var groups = _ref3.groups;
|
|
31
|
-
return React.createElement("div", null, React.createElement("h2", null, "Groups"), groups.map(function (g, idx) {
|
|
32
|
-
return React.createElement(GroupItem, {
|
|
33
|
-
key: "".concat(g, "-").concat(idx),
|
|
34
|
-
group: g
|
|
35
|
-
});
|
|
36
|
-
}));
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var AddGroupFormDiv = styled("div")(function (_ref4) {
|
|
40
|
-
var theme = _ref4.theme;
|
|
41
|
-
return {
|
|
42
|
-
display: "flex",
|
|
43
|
-
flexDirection: "row"
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
var AddGroupFrom = function AddGroupFrom(_ref5) {
|
|
48
|
-
var onAddGroup = _ref5.onAddGroup;
|
|
49
|
-
|
|
50
|
-
var _useState = useState(""),
|
|
51
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
-
value = _useState2[0],
|
|
53
|
-
setValue = _useState2[1];
|
|
54
|
-
|
|
55
|
-
var handleChange = function handleChange(e) {
|
|
56
|
-
setValue(e.target.value);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
var handleSubmit = function handleSubmit(e) {
|
|
60
|
-
e.preventDefault();
|
|
61
|
-
onAddGroup(value);
|
|
62
|
-
setValue('');
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return React.createElement(AddGroupFormDiv, null, React.createElement("form", {
|
|
66
|
-
onSubmit: handleSubmit,
|
|
67
|
-
style: {
|
|
68
|
-
display: "flex",
|
|
69
|
-
paddingRight: "6px"
|
|
70
|
-
}
|
|
71
|
-
}, React.createElement("input", {
|
|
72
|
-
type: "text",
|
|
73
|
-
value: value,
|
|
74
|
-
name: "new-group",
|
|
75
|
-
placeholder: "New group name",
|
|
76
|
-
onChange: handleChange,
|
|
77
|
-
style: {
|
|
78
|
-
marginRight: "1rem"
|
|
79
|
-
}
|
|
80
|
-
}), React.createElement("input", {
|
|
81
|
-
type: "submit",
|
|
82
|
-
value: "Create group"
|
|
83
|
-
})));
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
var DivContainer = styled("div")(function (_ref6) {
|
|
87
|
-
var theme = _ref6.theme;
|
|
88
|
-
return {
|
|
89
|
-
paddingLeft: 16,
|
|
90
|
-
paddingRight: 16,
|
|
91
|
-
fontSize: 12,
|
|
92
|
-
"& h1": {
|
|
93
|
-
fontSize: 18
|
|
94
|
-
},
|
|
95
|
-
"& h2": {
|
|
96
|
-
fontSize: 14
|
|
97
|
-
},
|
|
98
|
-
"& h3": {
|
|
99
|
-
fontSize: 12
|
|
100
|
-
},
|
|
101
|
-
"& h4": {
|
|
102
|
-
fontSize: 12
|
|
103
|
-
},
|
|
104
|
-
"& h5": {
|
|
105
|
-
fontSize: 12
|
|
106
|
-
},
|
|
107
|
-
"& h6": {
|
|
108
|
-
fontSize: 12
|
|
109
|
-
},
|
|
110
|
-
"& p": {
|
|
111
|
-
fontSize: 12
|
|
112
|
-
},
|
|
113
|
-
"& a": {},
|
|
114
|
-
"& img": {
|
|
115
|
-
width: "100%"
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
});
|
|
119
|
-
export var GroupsEditorSidebarBox = function GroupsEditorSidebarBox(_ref7) {
|
|
120
|
-
var groups = _ref7.groups,
|
|
121
|
-
onAddGroup = _ref7.onAddGroup;
|
|
122
|
-
return React.createElement(ThemeProvider, {
|
|
123
|
-
theme: theme
|
|
124
|
-
}, React.createElement(SidebarBoxContainer, {
|
|
125
|
-
title: "Groups",
|
|
126
|
-
icon: React.createElement(FilterNoneIcon, {
|
|
127
|
-
style: {
|
|
128
|
-
color: grey[700]
|
|
129
|
-
}
|
|
130
|
-
}),
|
|
131
|
-
expandedByDefault: true
|
|
132
|
-
}, React.createElement(DivContainer, null, React.createElement("h2", null, "Add new group"), React.createElement(AddGroupFrom, {
|
|
133
|
-
onAddGroup: onAddGroup
|
|
134
|
-
}), React.createElement(GroupList, {
|
|
135
|
-
groups: groups
|
|
136
|
-
}))));
|
|
137
|
-
};
|
|
138
|
-
export default memo(GroupsEditorSidebarBox);
|
package/HelpSidebarBox/index.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React, { memo } from "react";
|
|
2
|
-
import SidebarBoxContainer from "../SidebarBoxContainer";
|
|
3
|
-
import HelpIcon from '@mui/icons-material/Help';
|
|
4
|
-
import { styled } from "@mui/material/styles";
|
|
5
|
-
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
6
|
-
import { grey } from "@mui/material/colors";
|
|
7
|
-
import Markdown from "react-markdown";
|
|
8
|
-
var theme = createTheme();
|
|
9
|
-
var MarkdownContainer = styled("div")(function (_ref) {
|
|
10
|
-
var theme = _ref.theme;
|
|
11
|
-
return {
|
|
12
|
-
paddingLeft: 16,
|
|
13
|
-
paddingRight: 16,
|
|
14
|
-
fontSize: 12,
|
|
15
|
-
"& h1": {
|
|
16
|
-
fontSize: 18
|
|
17
|
-
},
|
|
18
|
-
"& h2": {
|
|
19
|
-
fontSize: 14
|
|
20
|
-
},
|
|
21
|
-
"& h3": {
|
|
22
|
-
fontSize: 12
|
|
23
|
-
},
|
|
24
|
-
"& h4": {
|
|
25
|
-
fontSize: 12
|
|
26
|
-
},
|
|
27
|
-
"& h5": {
|
|
28
|
-
fontSize: 12
|
|
29
|
-
},
|
|
30
|
-
"& h6": {
|
|
31
|
-
fontSize: 12
|
|
32
|
-
},
|
|
33
|
-
"& p": {
|
|
34
|
-
fontSize: 12
|
|
35
|
-
},
|
|
36
|
-
"& a": {},
|
|
37
|
-
"& img": {
|
|
38
|
-
width: "100%"
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
export var HelpSidebarBox = function HelpSidebarBox(_ref2) {
|
|
43
|
-
var help = _ref2.help;
|
|
44
|
-
return React.createElement(ThemeProvider, {
|
|
45
|
-
theme: theme
|
|
46
|
-
}, React.createElement(SidebarBoxContainer, {
|
|
47
|
-
title: "Help",
|
|
48
|
-
icon: React.createElement(HelpIcon, {
|
|
49
|
-
style: {
|
|
50
|
-
color: grey[700]
|
|
51
|
-
}
|
|
52
|
-
}),
|
|
53
|
-
expandedByDefault: help && help !== "" ? false : true
|
|
54
|
-
}, React.createElement(MarkdownContainer, null, React.createElement(Markdown, {
|
|
55
|
-
source: help
|
|
56
|
-
}))));
|
|
57
|
-
};
|
|
58
|
-
export default memo(HelpSidebarBox);
|
package/HighlightBox/index.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import classnames from "classnames";
|
|
4
|
-
import { makeStyles } from "@mui/styles";
|
|
5
|
-
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
6
|
-
var theme = createTheme();
|
|
7
|
-
var useStyles = makeStyles(function (theme) {
|
|
8
|
-
return {
|
|
9
|
-
"@keyframes borderDance": {
|
|
10
|
-
from: {
|
|
11
|
-
strokeDashoffset: 0
|
|
12
|
-
},
|
|
13
|
-
to: {
|
|
14
|
-
strokeDashoffset: 100
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
highlightBox: {
|
|
18
|
-
zIndex: 2,
|
|
19
|
-
transition: "opacity 500ms",
|
|
20
|
-
"&.highlighted": {
|
|
21
|
-
zIndex: 3
|
|
22
|
-
},
|
|
23
|
-
"&:not(.highlighted)": {
|
|
24
|
-
opacity: 0
|
|
25
|
-
},
|
|
26
|
-
"&:not(.highlighted):hover": {
|
|
27
|
-
opacity: 0.6
|
|
28
|
-
},
|
|
29
|
-
"& path": {
|
|
30
|
-
// NOTE: attributes below commnted because resetting screen caused old frame to highlight
|
|
31
|
-
// vectorEffect: "non-scaling-stroke",
|
|
32
|
-
// strokeWidth: 2,
|
|
33
|
-
// stroke: "#FFF",
|
|
34
|
-
// strokeDasharray: 5,
|
|
35
|
-
fill: "none",
|
|
36
|
-
animationName: "$borderDance",
|
|
37
|
-
animationDuration: "4s",
|
|
38
|
-
animationTimingFunction: "linear",
|
|
39
|
-
animationIterationCount: "infinite",
|
|
40
|
-
animationPlayState: "running"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
export var HighlightBox = function HighlightBox(_ref) {
|
|
46
|
-
var mouseEvents = _ref.mouseEvents,
|
|
47
|
-
dragWithPrimary = _ref.dragWithPrimary,
|
|
48
|
-
zoomWithPrimary = _ref.zoomWithPrimary,
|
|
49
|
-
createWithPrimary = _ref.createWithPrimary,
|
|
50
|
-
onBeginMovePoint = _ref.onBeginMovePoint,
|
|
51
|
-
onSelectRegion = _ref.onSelectRegion,
|
|
52
|
-
r = _ref.region,
|
|
53
|
-
pbox = _ref.pbox;
|
|
54
|
-
var classes = useStyles();
|
|
55
|
-
if (!pbox.w || pbox.w === Infinity) return null;
|
|
56
|
-
if (!pbox.h || pbox.h === Infinity) return null;
|
|
57
|
-
if (r.unfinished) return null;
|
|
58
|
-
var styleCoords = r.type === "point" ? {
|
|
59
|
-
left: pbox.x + pbox.w / 2 - 30,
|
|
60
|
-
top: pbox.y + pbox.h / 2 - 30,
|
|
61
|
-
width: 60,
|
|
62
|
-
height: 60
|
|
63
|
-
} : {
|
|
64
|
-
left: pbox.x - 5,
|
|
65
|
-
top: pbox.y - 5,
|
|
66
|
-
width: pbox.w + 10,
|
|
67
|
-
height: pbox.h + 10
|
|
68
|
-
};
|
|
69
|
-
var pathD = r.type === "point" ? "M5,5 L".concat(styleCoords.width - 5, " 5L").concat(styleCoords.width - 5, " ").concat(styleCoords.height - 5, "L5 ").concat(styleCoords.height - 5, "Z") : "M5,5 L".concat(pbox.w + 5, ",5 L").concat(pbox.w + 5, ",").concat(pbox.h + 5, " L5,").concat(pbox.h + 5, " Z");
|
|
70
|
-
return React.createElement(ThemeProvider, {
|
|
71
|
-
theme: theme
|
|
72
|
-
}, React.createElement("svg", Object.assign({
|
|
73
|
-
key: r.id,
|
|
74
|
-
className: classnames(classes.highlightBox, {
|
|
75
|
-
highlighted: r.highlighted
|
|
76
|
-
})
|
|
77
|
-
}, mouseEvents, !zoomWithPrimary && !dragWithPrimary ? {
|
|
78
|
-
onMouseDown: function onMouseDown(e) {
|
|
79
|
-
if (!r.locked && r.type === "point" && r.highlighted && e.button === 0) {
|
|
80
|
-
return onBeginMovePoint(r);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (e.button === 0 && !createWithPrimary) return onSelectRegion(_objectSpread({}, r, {
|
|
84
|
-
ctrlKey: e.ctrlKey
|
|
85
|
-
}));
|
|
86
|
-
mouseEvents.onMouseDown(e);
|
|
87
|
-
}
|
|
88
|
-
} : {}, {
|
|
89
|
-
style: _objectSpread({}, r.highlighted ? {
|
|
90
|
-
pointerEvents: r.type !== "point" ? "none" : undefined,
|
|
91
|
-
cursor: "grab"
|
|
92
|
-
} : {
|
|
93
|
-
cursor: !(zoomWithPrimary || dragWithPrimary || createWithPrimary) ? "pointer" : undefined,
|
|
94
|
-
pointerEvents: zoomWithPrimary || dragWithPrimary || createWithPrimary && !r.highlighted ? "none" : undefined
|
|
95
|
-
}, {
|
|
96
|
-
position: "absolute"
|
|
97
|
-
}, styleCoords)
|
|
98
|
-
}), React.createElement("path", {
|
|
99
|
-
d: pathD
|
|
100
|
-
})));
|
|
101
|
-
};
|
|
102
|
-
export default HighlightBox;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React, { setState, memo } from "react";
|
|
2
|
-
import { makeStyles } from "@mui/styles";
|
|
3
|
-
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
4
|
-
import SidebarBoxContainer from "../SidebarBoxContainer";
|
|
5
|
-
import HistoryIcon from "@mui/icons-material/History";
|
|
6
|
-
import List from "@mui/material/List";
|
|
7
|
-
import ListItem from "@mui/material/ListItem";
|
|
8
|
-
import ListItemText from "@mui/material/ListItemText";
|
|
9
|
-
import IconButton from "@mui/material/IconButton";
|
|
10
|
-
import ListItemSecondaryAction from "@mui/material/ListItemSecondaryAction";
|
|
11
|
-
import UndoIcon from "@mui/icons-material/Undo";
|
|
12
|
-
import moment from "moment";
|
|
13
|
-
import { grey } from "@mui/material/colors";
|
|
14
|
-
import isEqual from "lodash/isEqual";
|
|
15
|
-
import Box from "@mui/material/Box";
|
|
16
|
-
var theme = createTheme();
|
|
17
|
-
var useStyles = makeStyles(function (theme) {
|
|
18
|
-
return {
|
|
19
|
-
emptyText: {
|
|
20
|
-
fontSize: 14,
|
|
21
|
-
fontWeight: "bold",
|
|
22
|
-
color: grey[500],
|
|
23
|
-
textAlign: "center",
|
|
24
|
-
padding: 20
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
var listItemTextStyle = {
|
|
29
|
-
paddingLeft: 16
|
|
30
|
-
};
|
|
31
|
-
export var HistorySidebarBox = function HistorySidebarBox(_ref) {
|
|
32
|
-
var history = _ref.history,
|
|
33
|
-
onRestoreHistory = _ref.onRestoreHistory;
|
|
34
|
-
var classes = useStyles();
|
|
35
|
-
return React.createElement(ThemeProvider, {
|
|
36
|
-
theme: theme
|
|
37
|
-
}, React.createElement(SidebarBoxContainer, {
|
|
38
|
-
title: "History",
|
|
39
|
-
icon: React.createElement(HistoryIcon, {
|
|
40
|
-
style: {
|
|
41
|
-
color: grey[700]
|
|
42
|
-
}
|
|
43
|
-
}),
|
|
44
|
-
expandedByDefault: true
|
|
45
|
-
}, React.createElement(List, null, history.length === 0 && React.createElement("div", {
|
|
46
|
-
className: classes.emptyText
|
|
47
|
-
}, "No History Yet"), history.map(function (_ref2, i) {
|
|
48
|
-
var name = _ref2.name,
|
|
49
|
-
time = _ref2.time;
|
|
50
|
-
return React.createElement(ListItem, {
|
|
51
|
-
button: true,
|
|
52
|
-
dense: true,
|
|
53
|
-
key: i
|
|
54
|
-
}, React.createElement(ListItemText, {
|
|
55
|
-
style: listItemTextStyle,
|
|
56
|
-
primary: name,
|
|
57
|
-
secondary: moment(time).format("LT")
|
|
58
|
-
}), i === 0 && React.createElement(ListItemSecondaryAction, {
|
|
59
|
-
onClick: function onClick() {
|
|
60
|
-
return onRestoreHistory();
|
|
61
|
-
}
|
|
62
|
-
}, React.createElement(IconButton, null, React.createElement(UndoIcon, null))));
|
|
63
|
-
}))));
|
|
64
|
-
};
|
|
65
|
-
export default memo(HistorySidebarBox, function (prevProps, nextProps) {
|
|
66
|
-
return isEqual(prevProps.history.map(function (a) {
|
|
67
|
-
return [a.name, a.time];
|
|
68
|
-
}), nextProps.history.map(function (a) {
|
|
69
|
-
return [a.name, a.time];
|
|
70
|
-
}));
|
|
71
|
-
});
|