canvas-editor-engine 1.1.27 → 1.1.29

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.d.ts CHANGED
@@ -14,6 +14,7 @@ import ToolLayerService from "./services/tool-layers.service";
14
14
  import EventService from "./services/event.service";
15
15
  import ThroughHistoryService from "./services/through-history.service";
16
16
  import ProjectsService from "./services/projects.service";
17
+ import PullProjectService from "./services/pull-project.service";
17
18
  import AppStore from "./store/store";
18
19
  declare class CanvasEditorEngine {
19
20
  constructor(webComponentTagName?: string);
@@ -31,4 +32,4 @@ declare class VueCanvasEditorEngine extends CanvasEditorEngine {
31
32
  getContext2D(): CanvasRenderingContext2D;
32
33
  getCanvas(): HTMLCanvasElement;
33
34
  }
34
- export { AppConfig, PipetteComponent, CanvasComponent, ExcretionComponent, SlotComponent, LoadingComponent, ToolService, DrawService, LoggerService, CropService, DownloadService, ToolLayerService, EventService, ThroughHistoryService, ProjectsService, StaticCanvasEditorEngine, VueCanvasEditorEngine, AppStore, };
35
+ export { AppConfig, PipetteComponent, CanvasComponent, ExcretionComponent, SlotComponent, LoadingComponent, ToolService, DrawService, LoggerService, CropService, DownloadService, ToolLayerService, EventService, ThroughHistoryService, ProjectsService, PullProjectService, StaticCanvasEditorEngine, VueCanvasEditorEngine, AppStore, };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppStore = exports.VueCanvasEditorEngine = exports.StaticCanvasEditorEngine = exports.ProjectsService = exports.ThroughHistoryService = exports.EventService = exports.ToolLayerService = exports.DownloadService = exports.CropService = exports.LoggerService = exports.DrawService = exports.ToolService = exports.LoadingComponent = exports.SlotComponent = exports.ExcretionComponent = exports.CanvasComponent = exports.PipetteComponent = exports.AppConfig = void 0;
3
+ exports.AppStore = exports.VueCanvasEditorEngine = exports.StaticCanvasEditorEngine = exports.PullProjectService = exports.ProjectsService = exports.ThroughHistoryService = exports.EventService = exports.ToolLayerService = exports.DownloadService = exports.CropService = exports.LoggerService = exports.DrawService = exports.ToolService = exports.LoadingComponent = exports.SlotComponent = exports.ExcretionComponent = exports.CanvasComponent = exports.PipetteComponent = exports.AppConfig = void 0;
4
4
  const config_1 = require("./config");
5
5
  exports.AppConfig = config_1.default;
6
6
  const web_component_1 = require("./web-component");
@@ -32,6 +32,8 @@ const through_history_service_1 = require("./services/through-history.service");
32
32
  exports.ThroughHistoryService = through_history_service_1.default;
33
33
  const projects_service_1 = require("./services/projects.service");
34
34
  exports.ProjectsService = projects_service_1.default;
35
+ const pull_project_service_1 = require("./services/pull-project.service");
36
+ exports.PullProjectService = pull_project_service_1.default;
35
37
  const store_1 = require("./store/store");
36
38
  exports.AppStore = store_1.default;
37
39
  class CanvasEditorEngine {
@@ -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.29",
4
4
  "description": "CanvasEditorEngine library, use: [typescript] [canvas]",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",