retejs / history-plugin Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://retejs.org
License: MIT License
Home Page: https://retejs.org
License: MIT License
I've found a situation that causes a connection path to stick around after the connection has been removed. The connection will be stuck until the page is reloaded.
Steps to reproduce:
Example codepen: https://codepen.io/gollum999/pen/rNxoaLB
Hi!
First of all, thank you for the great plugin!
In my project, I need an ability to restrict a count of stored history actions. I've downloaded this plugin and implemented it for myself, but, I suppose, it would be great if original plugin will have this functionality too.
Don't you mind if I will make a pull request with this feature?
Thanks for your response! ๐๐
I would like to be able to modify actions in the history under certain circumstances. (Similar to how the code that sets up DragNodeAction
combines multiple node moves into a single action.)
As far as I can tell, there is no way to get at the History
object in client code.
A couple of potential ideas:
install
function of all plugins return something to the caller, which could be stored alongside options
in Context.plugins
.history
inside Action
, setting the value when 'addhistory'
is triggered.Thanks for very nice library and for you continues support,
My question is about editor.on('undo', (p1) => {})
. I'm receiving an empty object here p1
, is this ok ?
I expect the object to describe the action.
Hi, thank you for the plugin.
For the issue. I believe the plugin does not properly add the history for the clear action that is called with the editor engine itself. Plugin may need to integrate it better with the editor action such as clear. Which clears/resets the stage/graph/
I'm getting the error Unhandled Rejection (Error): The event clear does not exist
when just trying to use this plugin. Using "rete-history-plugin": "^0.2.2"
and "rete": "^1.3.0"
(for rete-dock-plugin).
Here's the whole stacktrace:
Unhandled Rejection (Error): The event clear does not exist
(anonymous function)
src/core/emitter.ts:16
13 | const events = names instanceof Array ? names : (names as string).split(' ');
14 |
15 | (events as string[]).forEach(name => {
> 16 | if (!this.events[name])
| ^ 17 | throw new Error(`The event ${name} does not exist`);
18 | this.events[name].push(handler);
19 | });
View compiled
NodeEditor.on
src/core/emitter.ts:15
12 | on<K extends keyof EventTypes>(names: K | K[], handler: (args: EventTypes[K]) => any) {
13 | const events = names instanceof Array ? names : (names as string).split(' ');
14 |
> 15 | (events as string[]).forEach(name => {
| ^ 16 | if (!this.events[name])
17 | throw new Error(`The event ${name} does not exist`);
18 | this.events[name].push(handler);
View compiled
install
src/index.js:33
NodeEditor.use
src/core/context.ts:27
24 | use<T extends Plugin, O extends PluginParams<T>>(plugin: T, options?: O) {
25 | if (plugin.name && this.plugins.has(plugin.name)) throw new Error(`Plugin ${plugin.name} already in use`)
26 |
> 27 | plugin.install(this, options || {});
| ^ 28 | this.plugins.set(plugin.name, options)
29 | }
30 |
View compiled
createEditor
src/component/Rete.jsx:153
150 | });
151 | // editor.use(SelectionPlugin, { enabled: true });
152 |
> 153 | editor.use(HistoryPlugin, { keyboard: true });
| ^ 154 |
155 | // editor.on('editcomment', async (comment) => {
156 | // comment.text = await openEditModal(comment.text);
View compiled
(anonymous function)
src/component/Rete.jsx:207
204 |
205 | useEffect(() => {
206 | if (container) {
> 207 | createEditor(container).then((value) => {
| ^ 208 | console.log("created");
209 | editorRef.current = value;
210 | });
View compiled
โถ 18 stack frames were collapsed.
Module.<anonymous>
src/index.js:7
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 |
> 7 | ReactDOM.render(
8 | <React.StrictMode>
9 | <App />
10 | </React.StrictMode>,
View compiled
Module../src/index.js
http://localhost:3000/static/js/main.chunk.js:840:30
__webpack_require__
/home/hugo/EIA/PGE/proto-sym-ui/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
fn
/home/hugo/EIA/PGE/proto-sym-ui/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
> 150 | return __webpack_require__(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
1
http://localhost:3000/static/js/main.chunk.js:963:18
__webpack_require__
/home/hugo/EIA/PGE/proto-sym-ui/webpack/bootstrap:856
853 |
854 | __webpack_require__.$Refresh$.init();
855 | try {
> 856 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 857 | } finally {
858 | __webpack_require__.$Refresh$.cleanup(moduleId);
859 | }
View compiled
checkDeferredModules
/home/hugo/EIA/PGE/proto-sym-ui/webpack/bootstrap:45
42 | }
43 | if(fulfilled) {
44 | deferredModules.splice(i--, 1);
> 45 | result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
| ^ 46 | }
47 | }
48 |
View compiled
Array.webpackJsonpCallback [as push]
/home/hugo/EIA/PGE/proto-sym-ui/webpack/bootstrap:32
29 | deferredModules.push.apply(deferredModules, executeModules || []);
30 |
31 | // run deferred modules when all chunks ready
> 32 | return checkDeferredModules();
| ^ 33 | };
34 | function checkDeferredModules() {
35 | var result;
View compiled
(anonymous function)
http://localhost:3000/static/js/main.chunk.js:1:77
Hi, I can see that you automatically add node creation for example.
Is there a way to to make a workaround if i have a non-removable node that exists by default in my app, to avoid to add to the undo redo list when the model is being created?
Any idea?
Thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.