canvas-editor-engine 1.1.27 → 1.1.28

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.
@@ -1,4 +1,4 @@
1
- import { Project, IProjectModule, TProjectModuleName } from "../types/project";
1
+ import { IProjectModule, TProjectModuleName } from "../types/project";
2
2
  import { ProjectFileSerializer } from "../utils/project-file-serializer";
3
3
  export default class ProjectsService {
4
4
  private static _modules;
@@ -8,5 +8,4 @@ export default class ProjectsService {
8
8
  instance: IProjectModule;
9
9
  };
10
10
  private static _addModule;
11
- pull(name: Project['name'], description: Project['description']): Project;
12
11
  }
@@ -1,10 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const store_1 = require("../store/store");
4
- const project_1 = require("../types/project");
5
- const guid4_1 = require("../utils/guid4");
6
3
  const project_file_serializer_1 = require("../utils/project-file-serializer");
7
- const through_history_service_1 = require("./through-history.service");
8
4
  class LocalStorageProjectModule {
9
5
  projectsKey = 'cee-projects';
10
6
  getProjectsFromLocalStorage() {
@@ -98,15 +94,5 @@ class ProjectsService {
98
94
  static _addModule(name, module) {
99
95
  ProjectsService._modules.push({ name, instance: module });
100
96
  }
101
- pull(name, description) {
102
- const project = new project_1.Project();
103
- project.id = new guid4_1.Guid4().generate();
104
- project.description = description || 'New Project';
105
- project.name = name || 'New Project';
106
- project.state.cache = through_history_service_1.default.cache;
107
- project.state.history = store_1.default.store.historyState.historyLines;
108
- project.state.current = store_1.default.store.imageState.getEntry();
109
- return project;
110
- }
111
97
  }
112
98
  exports.default = ProjectsService;
@@ -4,4 +4,5 @@ export default class PullProjectService {
4
4
  static get project(): Project;
5
5
  static refreshProject(): void;
6
6
  static updateProject(project: IUpdateProject): void;
7
+ static pull(name: Project['name'], description: Project['description']): void;
7
8
  }
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const store_1 = require("../store/store");
3
4
  const project_1 = require("../types/project");
5
+ const guid4_1 = require("../utils/guid4");
6
+ const through_history_service_1 = require("./through-history.service");
4
7
  class PullProjectService {
5
8
  static _project = new project_1.Project();
6
9
  static get project() {
@@ -14,5 +17,15 @@ class PullProjectService {
14
17
  PullProjectService._project[key] = project[key];
15
18
  });
16
19
  }
20
+ static pull(name, description) {
21
+ const project = new project_1.Project();
22
+ project.id = new guid4_1.Guid4().generate();
23
+ project.description = description || 'New Project';
24
+ project.name = name || 'New Project';
25
+ project.state.cache = through_history_service_1.default.cache;
26
+ project.state.history = store_1.default.store.historyState.historyLines;
27
+ project.state.current = store_1.default.store.imageState.getEntry();
28
+ this._project = project;
29
+ }
17
30
  }
18
31
  exports.default = PullProjectService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvas-editor-engine",
3
- "version": "1.1.27",
3
+ "version": "1.1.28",
4
4
  "description": "CanvasEditorEngine library, use: [typescript] [canvas]",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",