├── src
├── assets
│ ├── .gitkeep
│ └── img
│ │ ├── tree.svg
│ │ ├── tree2.svg
│ │ ├── psyduck.svg
│ │ ├── snorlax.svg
│ │ ├── bellsprout.svg
│ │ ├── squirtle.svg
│ │ ├── pikachu.svg
│ │ ├── zubat.svg
│ │ ├── abra.svg
│ │ ├── caterpie.svg
│ │ └── pidgey.svg
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── favicon.ico
├── styles.scss
├── typings.d.ts
├── tsconfig.app.json
├── index.html
├── tsconfig.spec.json
├── main.ts
├── app
│ ├── app.module.ts
│ ├── app.component.scss
│ ├── app.component.css
│ ├── app.component.spec.ts
│ └── app.component.ts
├── test.ts
└── polyfills.ts
├── _config.yml
├── projects
└── angular-editor-fabric-js
│ ├── src
│ ├── assets
│ │ ├── .gitkeep
│ │ └── img
│ │ │ ├── tree.svg
│ │ │ ├── tree2.svg
│ │ │ ├── psyduck.svg
│ │ │ ├── snorlax.svg
│ │ │ ├── bellsprout.svg
│ │ │ ├── squirtle.svg
│ │ │ ├── pikachu.svg
│ │ │ ├── zubat.svg
│ │ │ ├── abra.svg
│ │ │ ├── caterpie.svg
│ │ │ └── pidgey.svg
│ ├── lib
│ │ ├── angular-editor-fabric-js.component.html
│ │ ├── angular-editor-fabric-js.component.css
│ │ ├── angular-editor-fabric-js.module.ts
│ │ └── angular-editor-fabric-js.component.spec.ts
│ ├── public-api.ts
│ └── test.ts
│ ├── tsconfig.lib.prod.json
│ ├── ng-package.json
│ ├── tslint.json
│ ├── tsconfig.spec.json
│ ├── package-lock.json
│ ├── tsconfig.lib.json
│ ├── package.json
│ ├── node_modules
│ └── @types
│ │ └── fabric
│ │ ├── index.d.ts
│ │ ├── README.md
│ │ ├── LICENSE
│ │ └── package.json
│ ├── karma.conf.js
│ └── README.md
├── favicon.ico
├── e2e
├── app.po.ts
├── tsconfig.json
├── tsconfig.e2e.json
├── app.e2e-spec.ts
└── src
│ ├── app.po.ts
│ └── app.e2e-spec.ts
├── tsconfig.app.json
├── .editorconfig
├── tsconfig.spec.json
├── browserslist
├── .github
└── FUNDING.yml
├── .gitignore
├── tsconfig.json
├── protractor.conf.js
├── LICENSE
├── karma.conf.js
├── .angular-cli.json
├── package.json
├── README.md
├── tslint.json
└── angular.json
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bytesleo/angular-editor-fabric-js/HEAD/favicon.ico
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bytesleo/angular-editor-fabric-js/HEAD/src/favicon.ico
--------------------------------------------------------------------------------
/src/styles.scss:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/lib/angular-editor-fabric-js.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/lib/angular-editor-fabric-js.component.css:
--------------------------------------------------------------------------------
1 | #canvas {
2 | border: 2px dashed #cccccc;
3 | }
4 |
--------------------------------------------------------------------------------
/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | /* SystemJS module definition */
2 | declare var module: NodeModule;
3 | interface NodeModule {
4 | id: string;
5 | }
6 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.lib.json",
3 | "angularCompilerOptions": {
4 | "enableIvy": false
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/ng-package.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3 | "dest": "../../dist/angular-editor-fabric-js",
4 | "lib": {
5 | "entryFile": "src/public-api.ts"
6 | }
7 | }
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/public-api.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Public API Surface of angular-editor-fabric-js
3 | */
4 |
5 | export * from './lib/angular-editor-fabric-js.component';
6 | export * from './lib/angular-editor-fabric-js.module';
7 |
--------------------------------------------------------------------------------
/e2e/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('app-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "baseUrl": "./",
6 | "module": "es2015",
7 | "types": []
8 | },
9 | "exclude": [
10 | "test.ts",
11 | "**/*.spec.ts"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "./out-tsc/app",
5 | "types": []
6 | },
7 | "files": [
8 | "src/main.ts",
9 | "src/polyfills.ts"
10 | ],
11 | "include": [
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "target": "es5",
8 | "types": [
9 | "jasmine",
10 | "jasminewd2",
11 | "node"
12 | ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('cli5 App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to app!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo(): Promise {
5 | return browser.get(browser.baseUrl) as Promise;
6 | }
7 |
8 | getTitleText(): Promise {
9 | return element(by.css('app-root .content span')).getText() as Promise;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "lib",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "lib",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | FabricjsEditor
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts"
12 | ],
13 | "include": [
14 | "**/*.spec.ts",
15 | "**/*.d.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "types": [
8 | "jasmine",
9 | "node"
10 | ]
11 | },
12 | "files": [
13 | "test.ts"
14 | ],
15 | "include": [
16 | "**/*.spec.ts",
17 | "**/*.d.ts"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "./out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts",
12 | "src/polyfills.ts",
13 | "src/main.ts"
14 | ],
15 | "include": [
16 | "src/**/*.spec.ts",
17 | "src/**/*.d.ts"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.error(err));
13 |
--------------------------------------------------------------------------------
/browserslist:
--------------------------------------------------------------------------------
1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 |
5 | # You can see what browsers were selected by your queries by running:
6 | # npx browserslist
7 |
8 | > 0.5%
9 | last 2 versions
10 | Firefox ESR
11 | not dead
12 | not IE 9-11 # For IE 9-11 support, remove 'not'.
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular-editor-fabric-js",
3 | "version": "0.0.1",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "@types/fabric": {
8 | "version": "3.6.2",
9 | "resolved": "https://registry.npmjs.org/@types/fabric/-/fabric-3.6.2.tgz",
10 | "integrity": "sha512-4bZv5tnAmgPqWnbl1we5yIvoMw7tZXyBvvBq7aV73RaqYMUa5fgZyYPO++igyrIuLSQq0YE0Ke/r25MKohniOQ=="
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/lib",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": [
10 | "dom",
11 | "es2018"
12 | ]
13 | },
14 | "angularCompilerOptions": {
15 | "skipTemplateCodegen": true,
16 | "strictMetadataEmit": true,
17 | "enableResourceInlining": true
18 | },
19 | "exclude": [
20 | "src/test.ts",
21 | "**/*.spec.ts"
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/lib/angular-editor-fabric-js.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { BrowserModule } from '@angular/platform-browser';
3 | import { FormsModule } from '@angular/forms';
4 | import { ColorPickerModule } from 'ngx-color-picker';
5 |
6 | import { FabricjsEditorComponent } from './angular-editor-fabric-js.component';
7 |
8 | @NgModule({
9 | declarations: [FabricjsEditorComponent],
10 | imports: [
11 | BrowserModule,
12 | FormsModule,
13 | ColorPickerModule
14 | ],
15 | exports: [FabricjsEditorComponent]
16 | })
17 | export class FabricjsEditorModule { }
18 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 |
4 | import { AppComponent } from './app.component';
5 | import { FabricjsEditorModule } from 'projects/angular-editor-fabric-js/src/public-api';
6 | import { FormsModule } from '@angular/forms';
7 | import { ColorPickerModule } from 'ngx-color-picker';
8 |
9 | @NgModule({
10 | declarations: [
11 | AppComponent
12 | ],
13 | imports: [
14 | BrowserModule,
15 | FabricjsEditorModule,
16 | FormsModule,
17 | ColorPickerModule
18 | ],
19 | providers: [],
20 | bootstrap: [AppComponent]
21 | })
22 | export class AppModule { }
23 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | #github: [dddd]
4 | patreon: kevoj # Replace with a single Patreon username
5 | #open_collective: # Replace with a single Open Collective username
6 | #ko_fi: # Replace with a single Ko-fi username
7 | #tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | #community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | #liberapay: # Replace with a single Liberapay username
10 | #issuehunt: # Replace with a single IssueHunt username
11 | #otechie: # Replace with a single Otechie username
12 | #custom: # Replace with a single custom sponsorship URL
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /dist-server
6 | /tmp
7 | /out-tsc
8 |
9 | # dependencies
10 | /node_modules
11 |
12 | # IDEs and editors
13 | /.idea
14 | .project
15 | .classpath
16 | .c9/
17 | *.launch
18 | .settings/
19 | *.sublime-workspace
20 |
21 | # IDE - VSCode
22 | .vscode/*
23 | !.vscode/settings.json
24 | !.vscode/tasks.json
25 | !.vscode/launch.json
26 | !.vscode/extensions.json
27 |
28 | # misc
29 | /.sass-cache
30 | /connect.lock
31 | /coverage
32 | /libpeerconnection.log
33 | npm-debug.log
34 | testem.log
35 | /typings
36 |
37 | # e2e
38 | /e2e/*.js
39 | /e2e/*.map
40 |
41 | # System Files
42 | .DS_Store
43 | Thumbs.db
44 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 | import { browser, logging } from 'protractor';
3 |
4 | describe('workspace-project App', () => {
5 | let page: AppPage;
6 |
7 | beforeEach(() => {
8 | page = new AppPage();
9 | });
10 |
11 | it('should display welcome message', () => {
12 | page.navigateTo();
13 | expect(page.getTitleText()).toEqual('angular-editor-fabric-js app is running!');
14 | });
15 |
16 | afterEach(async () => {
17 | // Assert that there are no errors emitted from the browser
18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19 | expect(logs).not.toContain(jasmine.objectContaining({
20 | level: logging.Level.SEVERE,
21 | } as logging.Entry));
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "downlevelIteration": true,
9 | "experimentalDecorators": true,
10 | "module": "esnext",
11 | "moduleResolution": "node",
12 | "importHelpers": true,
13 | "target": "es2015",
14 | "lib": [
15 | "es2018",
16 | "dom"
17 | ],
18 | },
19 | "angularCompilerOptions": {
20 | "fullTemplateTypeCheck": true,
21 | "strictInjectionParameters": true
22 | },
23 | "paths": {
24 | "angular-editor-fabric-js": [
25 | "dist/angular-editor-fabric-js"
26 | ],
27 | "angular-editor-fabric-js/*": [
28 | "dist/angular-editor-fabric-js/*"
29 | ]
30 | }
31 | }
--------------------------------------------------------------------------------
/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './e2e/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | onPrepare() {
23 | require('ts-node').register({
24 | project: 'e2e/tsconfig.e2e.json'
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/src/app/app.component.scss:
--------------------------------------------------------------------------------
1 | .main-title{
2 | margin-top: 10px;
3 | }
4 | .images-item {
5 | width: 48%;
6 | cursor: pointer;
7 | -webkit-transition: .5s ease;
8 | -webkit-transition: .5s ease;
9 | padding: 3px;
10 | max-width: 120px;
11 |
12 | &:hover {
13 | opacity: 0.7;
14 | }
15 | }
16 |
17 | .images-item-upload {
18 | width: 80%;
19 | cursor: pointer;
20 | padding-bottom: 10px;
21 | -webkit-transition: .5s ease;
22 | -webkit-transition: .5s ease;
23 |
24 | &:hover {
25 | opacity: 0.7;
26 | }
27 | }
28 |
29 | .custom-item {
30 | border-bottom: 2px solid #f3f3f3;
31 |
32 | .custom-item-title {
33 | color: #666666;
34 | font-weight: 600;
35 | }
36 |
37 | .custom-item-body {
38 | padding: 10px 0;
39 | }
40 | }
41 |
42 | .max-height{
43 | overflow: auto;
44 | max-height: 300px;
45 | }
46 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: {
11 | context(path: string, deep?: boolean, filter?: RegExp): {
12 | keys(): string[];
13 | (id: string): T;
14 | };
15 | };
16 |
17 | // First, initialize the Angular testing environment.
18 | getTestBed().initTestEnvironment(
19 | BrowserDynamicTestingModule,
20 | platformBrowserDynamicTesting()
21 | );
22 | // Then we find all the tests.
23 | const context = require.context('./', true, /\.spec\.ts$/);
24 | // And load the modules.
25 | context.keys().map(context);
26 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/lib/angular-editor-fabric-js.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { FabricjsEditorComponent } from './angular-editor-fabric-js.component';
4 |
5 | describe('FabricjsLibraryComponent', () => {
6 | let component: FabricjsEditorComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ FabricjsEditorComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(FabricjsEditorComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone';
4 | import 'zone.js/dist/zone-testing';
5 | import { getTestBed } from '@angular/core/testing';
6 | import {
7 | BrowserDynamicTestingModule,
8 | platformBrowserDynamicTesting
9 | } from '@angular/platform-browser-dynamic/testing';
10 |
11 | declare const require: {
12 | context(path: string, deep?: boolean, filter?: RegExp): {
13 | keys(): string[];
14 | (id: string): T;
15 | };
16 | };
17 |
18 | // First, initialize the Angular testing environment.
19 | getTestBed().initTestEnvironment(
20 | BrowserDynamicTestingModule,
21 | platformBrowserDynamicTesting()
22 | );
23 | // Then we find all the tests.
24 | const context = require.context('./', true, /\.spec\.ts$/);
25 | // And load the modules.
26 | context.keys().map(context);
27 |
--------------------------------------------------------------------------------
/src/app/app.component.css:
--------------------------------------------------------------------------------
1 | #canvas {
2 | border: 2px dashed #cccccc;
3 | }
4 | .main-title{
5 | margin-top: 10px;
6 | }
7 | .images-item {
8 | width: 48%;
9 | cursor: pointer;
10 | -webkit-transition: .5s ease;
11 | -webkit-transition: .5s ease;
12 | padding: 3px;
13 | max-width: 120px;
14 | }
15 |
16 | .images-item:hover {
17 | opacity: 0.7;
18 | }
19 |
20 | .images-item-upload {
21 | width: 80%;
22 | cursor: pointer;
23 | padding-bottom: 10px;
24 | -webkit-transition: .5s ease;
25 | -webkit-transition: .5s ease;
26 | }
27 |
28 | .images-item-upload:hover {
29 | opacity: 0.7;
30 | }
31 |
32 | .custom-item {
33 | border-bottom: 2px solid #f3f3f3;
34 | }
35 |
36 | .custom-item .custom-item-title {
37 | color: #666666;
38 | font-weight: 600;
39 | }
40 |
41 | .custom-item .custom-item-body {
42 | padding: 10px 0;
43 | }
44 |
45 | .max-height{
46 | overflow: auto;
47 | max-height: 300px;
48 | }
49 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular-editor-fabric-js",
3 | "version": "3.0.0",
4 | "desription": "A FabricJS canvas editor for Angular",
5 | "dependencies": {
6 | "fabric": "^3.6.3",
7 | "@types/fabric": "^3.6.2",
8 | "ngx-color-picker": "^9.1.0"
9 | },
10 | "peerDependencies": {
11 | "@angular/common": "^9.0.7",
12 | "@angular/core": "^9.0.7",
13 | "tslib": "^1.10.0"
14 | },
15 | "keywords": [
16 | "kitchensink",
17 | "kitchensink-angular",
18 | "canvas",
19 | "angular",
20 | "fabricjs",
21 | "editor",
22 | "images",
23 | "fabric",
24 | "fabricjs-angular",
25 | "angular-fabric"
26 | ],
27 | "ngPackage": {
28 | "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
29 | "lib": {
30 | "entryFile": "src/public-api.ts"
31 | },
32 | "dest": "../../dist/angular-editor-fabric-js",
33 | "whitelistedNonPeerDependencies": [
34 | "fabric",
35 | "@types/fabric",
36 | "ngx-color-picker"
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/node_modules/@types/fabric/index.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for FabricJS 3.6
2 | // Project: http://fabricjs.com/
3 | // Definitions by: Oliver Klemencic
4 | // Joseph Livecchi
5 | // Michael Randolph
6 | // Tiger Oakes
7 | // Brian Martinson
8 | // Rogerio Teixeira
9 | // Bradley Hill
10 | // Bryan Krol
11 | // Glenn Gartner
12 | // Codertx
13 | // Mike Moore
14 | // Natalie Marleny
15 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
16 | // TypeScript Version: 2.1
17 | export import fabric = require("fabric/fabric-impl");
18 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/node_modules/@types/fabric/README.md:
--------------------------------------------------------------------------------
1 | # Installation
2 | > `npm install --save @types/fabric`
3 |
4 | # Summary
5 | This package contains type definitions for FabricJS (http://fabricjs.com/).
6 |
7 | # Details
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fabric.
9 |
10 | ### Additional Details
11 | * Last updated: Tue, 18 Feb 2020 18:19:07 GMT
12 | * Dependencies: none
13 | * Global values: `fabric`
14 |
15 | # Credits
16 | These definitions were written by [Oliver Klemencic](https://github.com/oklemencic), [Joseph Livecchi](https://github.com/joewashear007), [Michael Randolph](https://github.com/mrand01), [Tiger Oakes](https://github.com/NotWoods), [Brian Martinson](https://github.com/bmartinson), [Rogerio Teixeira](https://github.com/RogerioTeixeira), [Bradley Hill](https://github.com/BradleyHill), [Bryan Krol](https://github.com/bmkrol823), [Glenn Gartner](https://github.com/glenngartner), [Codertx](https://github.com/codertx), [Mike Moore](https://github.com/mike667), and [Natalie Marleny](https://github.com/nataliemarleny).
17 |
--------------------------------------------------------------------------------
/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { AppComponent } from './app.component';
3 |
4 | describe('AppComponent', () => {
5 | beforeEach(async(() => {
6 | TestBed.configureTestingModule({
7 | declarations: [
8 | AppComponent
9 | ],
10 | }).compileComponents();
11 | }));
12 |
13 | it('should create the app', () => {
14 | const fixture = TestBed.createComponent(AppComponent);
15 | const app = fixture.componentInstance;
16 | expect(app).toBeTruthy();
17 | });
18 |
19 | it(`should have as title 'angular-editor-fabric-js'`, () => {
20 | const fixture = TestBed.createComponent(AppComponent);
21 | const app = fixture.componentInstance;
22 | expect(app.title).toEqual('angular-editor-fabric-js');
23 | });
24 |
25 | it('should render title', () => {
26 | const fixture = TestBed.createComponent(AppComponent);
27 | fixture.detectChanges();
28 | const compiled = fixture.nativeElement;
29 | expect(compiled.querySelector('.content span').textContent).toContain('angular-editor-fabric-js app is running!');
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 Leonardo Rico
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../../coverage/angular-editor-fabric-js'),
20 | reports: ['html', 'lcovonly', 'text-summary'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false,
30 | restartOnFileChange: true
31 | });
32 | };
33 |
--------------------------------------------------------------------------------
/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('./projects/angular-editor-fabric-js/node_modules/@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, './coverage/angular-editor-fabric-js'),
20 | reports: ['html', 'lcovonly', 'text-summary'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false,
30 | restartOnFileChange: true
31 | });
32 | };
33 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/README.md:
--------------------------------------------------------------------------------
1 | # FabricjsLibrary
2 |
3 | This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.7.
4 |
5 | ## Code scaffolding
6 |
7 | Run `ng generate component component-name --project angular-editor-fabric-js` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project angular-editor-fabric-js`.
8 | > Note: Don't forget to add `--project angular-editor-fabric-js` or else it will be added to the default project in your `angular.json` file.
9 |
10 | ## Build
11 |
12 | Run `ng build angular-editor-fabric-js` to build the project. The build artifacts will be stored in the `dist/` directory.
13 |
14 | ## Publishing
15 |
16 | After building your library with `ng build angular-editor-fabric-js`, go to the dist folder `cd dist/angular-editor-fabric-js` and run `npm publish`.
17 |
18 | ## Running unit tests
19 |
20 | Run `ng test angular-editor-fabric-js` to execute the unit tests via [Karma](https://karma-runner.github.io).
21 |
22 | ## Further help
23 |
24 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
25 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/node_modules/@types/fabric/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/.angular-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "project": {
4 | "name": "cli5"
5 | },
6 | "apps": [
7 | {
8 | "root": "src",
9 | "outDir": "dist",
10 | "assets": [
11 | "assets",
12 | "favicon.ico"
13 | ],
14 | "index": "index.html",
15 | "main": "main.ts",
16 | "polyfills": "polyfills.ts",
17 | "test": "test.ts",
18 | "tsconfig": "tsconfig.app.json",
19 | "testTsconfig": "tsconfig.spec.json",
20 | "prefix": "app",
21 | "styles": [
22 | "node_modules/bootstrap/dist/css/bootstrap.min.css",
23 | "node_modules/font-awesome/css/font-awesome.css",
24 | "styles.css"
25 | ],
26 | "scripts": [],
27 | "environmentSource": "environments/environment.ts",
28 | "environments": {
29 | "dev": "environments/environment.ts",
30 | "prod": "environments/environment.prod.ts"
31 | }
32 | }
33 | ],
34 | "e2e": {
35 | "protractor": {
36 | "config": "./protractor.conf.js"
37 | }
38 | },
39 | "lint": [
40 | {
41 | "project": "src/tsconfig.app.json",
42 | "exclude": "**/node_modules/**"
43 | },
44 | {
45 | "project": "src/tsconfig.spec.json",
46 | "exclude": "**/node_modules/**"
47 | },
48 | {
49 | "project": "e2e/tsconfig.e2e.json",
50 | "exclude": "**/node_modules/**"
51 | }
52 | ],
53 | "test": {
54 | "karma": {
55 | "config": "./karma.conf.js"
56 | }
57 | },
58 | "defaults": {
59 | "styleExt": "css",
60 | "component": {}
61 | }
62 | }
--------------------------------------------------------------------------------
/src/assets/img/tree.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
48 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "app-angular-editor-fabric-js",
3 | "version": "0.0.3",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve angular-editor-fabric-js-app",
7 | "build": "ng build angular-editor-fabric-js-app",
8 | "build:lib": "ng-packagr -p projects/angular-editor-fabric-js/package.json",
9 | "test": "ng test",
10 | "lint": "ng lint",
11 | "e2e": "ng e2e",
12 | "publish": "npm publish ./dist/angular-editor-fabric-js"
13 | },
14 | "private": true,
15 | "dependencies": {
16 | "@angular/animations": "~9.1.7",
17 | "@angular/common": "~9.1.7",
18 | "@angular/compiler": "~9.1.7",
19 | "@angular/core": "~9.1.7",
20 | "@angular/forms": "~9.1.7",
21 | "@angular/platform-browser": "~9.1.7",
22 | "@angular/platform-browser-dynamic": "~9.1.7",
23 | "@angular/router": "~9.1.7",
24 | "bootstrap": "^4.4.1",
25 | "fabric": "^5.2.4",
26 | "font-awesome": "^4.7.0",
27 | "ngx-color-picker": "^9.1.0",
28 | "rxjs": "~6.5.4",
29 | "tslib": "^1.10.0",
30 | "zone.js": "~0.10.2"
31 | },
32 | "devDependencies": {
33 | "@angular-devkit/build-angular": "~0.901.6",
34 | "@angular-devkit/build-ng-packagr": "~0.901.6",
35 | "@angular/cli": "~9.1.6",
36 | "@angular/compiler-cli": "~9.1.7",
37 | "@angular/language-service": "~9.1.7",
38 | "@types/fabric": "^3.6.2",
39 | "@types/jasmine": "~3.5.0",
40 | "@types/jasminewd2": "~2.0.3",
41 | "@types/node": "^12.11.1",
42 | "codelyzer": "^5.1.2",
43 | "jasmine-core": "~3.5.0",
44 | "jasmine-spec-reporter": "~4.2.1",
45 | "karma": "~4.3.0",
46 | "karma-chrome-launcher": "~3.1.0",
47 | "karma-coverage-istanbul-reporter": "~2.1.0",
48 | "karma-jasmine": "~2.0.1",
49 | "karma-jasmine-html-reporter": "^1.4.2",
50 | "ng-packagr": "^9.0.0",
51 | "protractor": "~5.4.3",
52 | "ts-node": "~8.3.0",
53 | "tslint": "~5.18.0",
54 | "typescript": "~3.7.5"
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/tree.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
48 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # angular-editor-fabric-js
2 |
3 | > Drag-and-drop editor based on Fabricjs for Angular with multiple options
4 |
5 | ### Example
6 | 
7 | ### Output
8 | 
9 |
10 | ### Features
11 | * Export to image
12 | * Export to SVG
13 | * Save to localStorage
14 | * Load From LocalStorage
15 | * Clean workspace
16 | * Resize workspace
17 | * Add text
18 | * Add Images
19 | * Upload Images
20 | * Add figures (Rectangle, Triangle, Square, Circle)
21 | * Render to JSON
22 | * Clone Object
23 | * Sent to front Object
24 | * Sent to back Object
25 | * Delete Object
26 | * Unselect Object
27 | * Add ID to Object
28 | * Opacity to Object
29 | * Color to Object
30 | * Font Famility to Object
31 | * Text Align to Object
32 | * Style to Object
33 | * Font Size to Object
34 | * Line Height To Object
35 | * Char Spacing to Object
36 |
37 | ## Installing the library in your project
38 |
39 | ```bash
40 | npm i angular-editor-fabric-js
41 | ```
42 |
43 | # Development
44 |
45 | ## Installing the project
46 |
47 | ```bash
48 | git clone https://github.com/kevoj/angular-editor-fabric-js.git
49 | cd angular-editor-fabric-js
50 | npm install
51 | ```
52 | ## Start
53 |
54 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
55 |
56 | ## Build
57 |
58 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
59 |
60 | ## Running unit tests
61 |
62 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
63 |
64 | ## Running end-to-end tests
65 |
66 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
67 | Before running the tests make sure you are serving the app via `ng serve`.
68 |
69 | ## License
70 | [MIT ©](https://github.com/kevoj/angular-editor-fabric-js/blob/master/LICENSE)
71 |
--------------------------------------------------------------------------------
/src/assets/img/tree2.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
53 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/tree2.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
53 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "tslint:recommended",
3 | "rules": {
4 | "array-type": false,
5 | "arrow-parens": false,
6 | "deprecation": {
7 | "severity": "warning"
8 | },
9 | "component-class-suffix": true,
10 | "contextual-lifecycle": true,
11 | "directive-class-suffix": true,
12 | "directive-selector": [
13 | true,
14 | "attribute",
15 | "app",
16 | "camelCase"
17 | ],
18 | "component-selector": [
19 | true,
20 | "element",
21 | "app",
22 | "kebab-case"
23 | ],
24 | "import-blacklist": [
25 | true,
26 | "rxjs/Rx"
27 | ],
28 | "interface-name": false,
29 | "max-classes-per-file": false,
30 | "max-line-length": [
31 | true,
32 | 140
33 | ],
34 | "member-access": false,
35 | "member-ordering": [
36 | true,
37 | {
38 | "order": [
39 | "static-field",
40 | "instance-field",
41 | "static-method",
42 | "instance-method"
43 | ]
44 | }
45 | ],
46 | "no-consecutive-blank-lines": false,
47 | "no-console": [
48 | true,
49 | "debug",
50 | "info",
51 | "time",
52 | "timeEnd",
53 | "trace"
54 | ],
55 | "no-empty": false,
56 | "no-inferrable-types": [
57 | true,
58 | "ignore-params"
59 | ],
60 | "no-non-null-assertion": true,
61 | "no-redundant-jsdoc": true,
62 | "no-switch-case-fall-through": true,
63 | "no-var-requires": false,
64 | "object-literal-key-quotes": [
65 | true,
66 | "as-needed"
67 | ],
68 | "object-literal-sort-keys": false,
69 | "ordered-imports": false,
70 | "quotemark": [
71 | true,
72 | "single"
73 | ],
74 | "trailing-comma": false,
75 | "no-conflicting-lifecycle": true,
76 | "no-host-metadata-property": true,
77 | "no-input-rename": true,
78 | "no-inputs-metadata-property": true,
79 | "no-output-native": true,
80 | "no-output-on-prefix": true,
81 | "no-output-rename": true,
82 | "no-outputs-metadata-property": true,
83 | "template-banana-in-box": true,
84 | "template-no-negated-async": true,
85 | "use-lifecycle-interface": true,
86 | "use-pipe-transform-interface": true
87 | },
88 | "rulesDirectory": [
89 | "codelyzer"
90 | ]
91 | }
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/node_modules/@types/fabric/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "_from": "@types/fabric",
3 | "_id": "@types/fabric@3.6.2",
4 | "_inBundle": false,
5 | "_integrity": "sha512-4bZv5tnAmgPqWnbl1we5yIvoMw7tZXyBvvBq7aV73RaqYMUa5fgZyYPO++igyrIuLSQq0YE0Ke/r25MKohniOQ==",
6 | "_location": "/@types/fabric",
7 | "_phantomChildren": {},
8 | "_requested": {
9 | "type": "tag",
10 | "registry": true,
11 | "raw": "@types/fabric",
12 | "name": "@types/fabric",
13 | "escapedName": "@types%2ffabric",
14 | "scope": "@types",
15 | "rawSpec": "",
16 | "saveSpec": null,
17 | "fetchSpec": "latest"
18 | },
19 | "_requiredBy": [
20 | "#USER",
21 | "/"
22 | ],
23 | "_resolved": "https://registry.npmjs.org/@types/fabric/-/fabric-3.6.2.tgz",
24 | "_shasum": "438e14a2e8a77f73d1a997dfc944c2dff61dbb9a",
25 | "_spec": "@types/fabric",
26 | "_where": "/home/marie-charlotte/Projects/fabricjs-editor/projects/fabricjs-library",
27 | "bugs": {
28 | "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
29 | },
30 | "bundleDependencies": false,
31 | "contributors": [
32 | {
33 | "name": "Oliver Klemencic",
34 | "url": "https://github.com/oklemencic"
35 | },
36 | {
37 | "name": "Joseph Livecchi",
38 | "url": "https://github.com/joewashear007"
39 | },
40 | {
41 | "name": "Michael Randolph",
42 | "url": "https://github.com/mrand01"
43 | },
44 | {
45 | "name": "Tiger Oakes",
46 | "url": "https://github.com/NotWoods"
47 | },
48 | {
49 | "name": "Brian Martinson",
50 | "url": "https://github.com/bmartinson"
51 | },
52 | {
53 | "name": "Rogerio Teixeira",
54 | "url": "https://github.com/RogerioTeixeira"
55 | },
56 | {
57 | "name": "Bradley Hill",
58 | "url": "https://github.com/BradleyHill"
59 | },
60 | {
61 | "name": "Bryan Krol",
62 | "url": "https://github.com/bmkrol823"
63 | },
64 | {
65 | "name": "Glenn Gartner",
66 | "url": "https://github.com/glenngartner"
67 | },
68 | {
69 | "name": "Codertx",
70 | "url": "https://github.com/codertx"
71 | },
72 | {
73 | "name": "Mike Moore",
74 | "url": "https://github.com/mike667"
75 | },
76 | {
77 | "name": "Natalie Marleny",
78 | "url": "https://github.com/nataliemarleny"
79 | }
80 | ],
81 | "dependencies": {},
82 | "deprecated": false,
83 | "description": "TypeScript definitions for FabricJS",
84 | "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
85 | "license": "MIT",
86 | "main": "",
87 | "name": "@types/fabric",
88 | "repository": {
89 | "type": "git",
90 | "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
91 | "directory": "types/fabric"
92 | },
93 | "scripts": {},
94 | "typeScriptVersion": "2.8",
95 | "types": "index.d.ts",
96 | "typesPublisherContentHash": "8ad0e7a03008c13c62bc577e8311346395c078116915a438c4c5714aa788ba25",
97 | "version": "3.6.2"
98 | }
99 |
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/guide/browser-support
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
22 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
23 |
24 | /**
25 | * Web Animations `@angular/platform-browser/animations`
26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
28 | */
29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
30 |
31 | /**
32 | * By default, zone.js will patch all possible macroTask and DomEvents
33 | * user can disable parts of macroTask/DomEvents patch by setting following flags
34 | * because those flags need to be set before `zone.js` being loaded, and webpack
35 | * will put import in the top of bundle, so user need to create a separate file
36 | * in this directory (for example: zone-flags.ts), and put the following flags
37 | * into that file, and then add the following code before importing zone.js.
38 | * import './zone-flags';
39 | *
40 | * The flags allowed in zone-flags.ts are listed here.
41 | *
42 | * The following flags will work for all browsers.
43 | *
44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
47 | *
48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge
50 | *
51 | * (window as any).__Zone_enable_cross_context_check = true;
52 | *
53 | */
54 |
55 | /***************************************************************************************************
56 | * Zone JS is required by default for Angular itself.
57 | */
58 | import 'zone.js/dist/zone'; // Included with Angular CLI.
59 |
60 |
61 | /***************************************************************************************************
62 | * APPLICATION IMPORTS
63 | */
64 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, ViewChild } from '@angular/core';
2 | import { FabricjsEditorComponent } from 'projects/angular-editor-fabric-js/src/public-api';
3 |
4 | @Component({
5 | selector: 'app-root',
6 | templateUrl: './app.component.html',
7 | styleUrls: ['./app.component.scss']
8 | })
9 | export class AppComponent {
10 | title = 'angular-editor-fabric-js';
11 |
12 | @ViewChild('canvas', { static: false }) canvas: FabricjsEditorComponent;
13 |
14 | public rasterize() {
15 | this.canvas.rasterize();
16 | }
17 |
18 | public rasterizeSVG() {
19 | this.canvas.rasterizeSVG();
20 | }
21 |
22 | public saveCanvasToJSON() {
23 | this.canvas.saveCanvasToJSON();
24 | }
25 |
26 | public loadCanvasFromJSON() {
27 | this.canvas.loadCanvasFromJSON();
28 | }
29 |
30 | public confirmClear() {
31 | this.canvas.confirmClear();
32 | }
33 |
34 | public changeSize() {
35 | this.canvas.changeSize();
36 | }
37 |
38 | public addText() {
39 | this.canvas.addText();
40 | }
41 |
42 | public getImgPolaroid(event) {
43 | this.canvas.getImgPolaroid(event);
44 | }
45 |
46 | public addImageOnCanvas(url) {
47 | this.canvas.addImageOnCanvas(url);
48 | }
49 |
50 | public readUrl(event) {
51 | this.canvas.readUrl(event);
52 | }
53 |
54 | public removeWhite(url) {
55 | this.canvas.removeWhite(url);
56 | }
57 |
58 | public addFigure(figure) {
59 | this.canvas.addFigure(figure);
60 | }
61 |
62 | public removeSelected() {
63 | this.canvas.removeSelected();
64 | }
65 |
66 | public sendToBack() {
67 | this.canvas.sendToBack();
68 | }
69 |
70 | public bringToFront() {
71 | this.canvas.bringToFront();
72 | }
73 |
74 | public clone() {
75 | this.canvas.clone();
76 | }
77 |
78 | public cleanSelect() {
79 | this.canvas.cleanSelect();
80 | }
81 |
82 | public setCanvasFill() {
83 | this.canvas.setCanvasFill();
84 | }
85 |
86 | public setCanvasImage() {
87 | this.canvas.setCanvasImage();
88 | }
89 |
90 | public setId() {
91 | this.canvas.setId();
92 | }
93 |
94 | public setOpacity() {
95 | this.canvas.setOpacity();
96 | }
97 |
98 | public setFill() {
99 | this.canvas.setFill();
100 | }
101 |
102 | public setFontFamily() {
103 | this.canvas.setFontFamily();
104 | }
105 |
106 | public setTextAlign(value) {
107 | this.canvas.setTextAlign(value);
108 | }
109 |
110 | public setBold() {
111 | this.canvas.setBold();
112 | }
113 |
114 | public setFontStyle() {
115 | this.canvas.setFontStyle();
116 | }
117 |
118 | public hasTextDecoration(value) {
119 | this.canvas.hasTextDecoration(value);
120 | }
121 |
122 | public setTextDecoration(value) {
123 | this.canvas.setTextDecoration(value);
124 | }
125 |
126 | public setFontSize() {
127 | this.canvas.setFontSize();
128 | }
129 |
130 | public setLineHeight() {
131 | this.canvas.setLineHeight();
132 | }
133 |
134 | public setCharSpacing() {
135 | this.canvas.setCharSpacing();
136 | }
137 |
138 | public rasterizeJSON() {
139 | this.canvas.rasterizeJSON();
140 | }
141 |
142 | public drawMode() {
143 | this.canvas.drawingMode();
144 | }
145 |
146 | public changeFigureColor(color){
147 | this.canvas.changeFigureColor(color);
148 | }
149 |
150 | onObjectColorChange(e){
151 | console.log(e)
152 | this.changeFigureColor(e.target.value)
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "angular-editor-fabric-js-app": {
7 | "projectType": "application",
8 | "schematics": {
9 | "@schematics/angular:component": {
10 | "style": "scss"
11 | }
12 | },
13 | "root": "",
14 | "sourceRoot": "src",
15 | "prefix": "app",
16 | "architect": {
17 | "build": {
18 | "builder": "@angular-devkit/build-angular:browser",
19 | "options": {
20 | "outputPath": "dist/angular-editor-fabric-js-app",
21 | "index": "src/index.html",
22 | "main": "src/main.ts",
23 | "polyfills": "src/polyfills.ts",
24 | "tsConfig": "tsconfig.app.json",
25 | "aot": true,
26 | "assets": [
27 | "src/favicon.ico",
28 | "src/assets"
29 | ],
30 | "styles": [
31 | "node_modules/bootstrap/dist/css/bootstrap.min.css",
32 | "node_modules/font-awesome/css/font-awesome.css",
33 | "src/styles.css"
34 | ],
35 | "scripts": []
36 | },
37 | "configurations": {
38 | "production": {
39 | "fileReplacements": [
40 | {
41 | "replace": "src/environments/environment.ts",
42 | "with": "src/environments/environment.prod.ts"
43 | }
44 | ],
45 | "optimization": true,
46 | "outputHashing": "all",
47 | "sourceMap": false,
48 | "extractCss": true,
49 | "namedChunks": false,
50 | "extractLicenses": true,
51 | "vendorChunk": false,
52 | "buildOptimizer": true,
53 | "budgets": [
54 | {
55 | "type": "initial",
56 | "maximumWarning": "2mb",
57 | "maximumError": "5mb"
58 | },
59 | {
60 | "type": "anyComponentStyle",
61 | "maximumWarning": "6kb",
62 | "maximumError": "10kb"
63 | }
64 | ]
65 | }
66 | }
67 | },
68 | "serve": {
69 | "builder": "@angular-devkit/build-angular:dev-server",
70 | "options": {
71 | "browserTarget": "angular-editor-fabric-js-app:build"
72 | },
73 | "configurations": {
74 | "production": {
75 | "browserTarget": "angular-editor-fabric-js-app:build:production"
76 | }
77 | }
78 | },
79 | "extract-i18n": {
80 | "builder": "@angular-devkit/build-angular:extract-i18n",
81 | "options": {
82 | "browserTarget": "angular-editor-fabric-js-app:build"
83 | }
84 | },
85 | "test": {
86 | "builder": "@angular-devkit/build-angular:karma",
87 | "options": {
88 | "main": "src/test.ts",
89 | "polyfills": "src/polyfills.ts",
90 | "tsConfig": "tsconfig.spec.json",
91 | "karmaConfig": "karma.conf.js",
92 | "assets": [
93 | "src/favicon.ico",
94 | "src/assets"
95 | ],
96 | "styles": [
97 | "src/styles.scss"
98 | ],
99 | "scripts": []
100 | }
101 | },
102 | "lint": {
103 | "builder": "@angular-devkit/build-angular:tslint",
104 | "options": {
105 | "tsConfig": [
106 | "tsconfig.app.json",
107 | "tsconfig.spec.json",
108 | "e2e/tsconfig.json"
109 | ],
110 | "exclude": [
111 | "**/node_modules/**"
112 | ]
113 | }
114 | },
115 | "e2e": {
116 | "builder": "@angular-devkit/build-angular:protractor",
117 | "options": {
118 | "protractorConfig": "e2e/protractor.conf.js",
119 | "devServerTarget": "angular-editor-fabric-js-app:serve"
120 | },
121 | "configurations": {
122 | "production": {
123 | "devServerTarget": "angular-editor-fabric-js-app:serve:production"
124 | }
125 | }
126 | }
127 | }
128 | },
129 | "angular-editor-fabric-js": {
130 | "projectType": "library",
131 | "root": "projects/angular-editor-fabric-js",
132 | "sourceRoot": "projects/angular-editor-fabric-js/src",
133 | "prefix": "lib",
134 | "architect": {
135 | "build": {
136 | "builder": "@angular-devkit/build-ng-packagr:build",
137 | "options": {
138 | "tsConfig": "projects/angular-editor-fabric-js/tsconfig.lib.json",
139 | "project": "projects/angular-editor-fabric-js/ng-package.json"
140 | },
141 | "configurations": {
142 | "production": {
143 | "tsConfig": "projects/angular-editor-fabric-js/tsconfig.lib.prod.json"
144 | }
145 | }
146 | },
147 | "test": {
148 | "builder": "@angular-devkit/build-angular:karma",
149 | "options": {
150 | "main": "projects/angular-editor-fabric-js/src/test.ts",
151 | "tsConfig": "projects/angular-editor-fabric-js/tsconfig.spec.json",
152 | "karmaConfig": "projects/angular-editor-fabric-js/karma.conf.js"
153 | }
154 | },
155 | "lint": {
156 | "builder": "@angular-devkit/build-angular:tslint",
157 | "options": {
158 | "tsConfig": [
159 | "projects/angular-editor-fabric-js/tsconfig.lib.json",
160 | "projects/angular-editor-fabric-js/tsconfig.spec.json"
161 | ],
162 | "exclude": [
163 | "**/node_modules/**"
164 | ]
165 | }
166 | }
167 | }
168 | }
169 | },
170 | "defaultProject": "angular-editor-fabric-js-app",
171 | "cli": {
172 | "analytics": "45fc0ac5-6d55-4254-98db-3e87ba5a084f"
173 | }
174 | }
--------------------------------------------------------------------------------
/src/assets/img/psyduck.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
138 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/psyduck.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
138 |
--------------------------------------------------------------------------------
/src/assets/img/snorlax.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
148 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/snorlax.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
148 |
--------------------------------------------------------------------------------
/src/assets/img/bellsprout.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
155 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/bellsprout.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
155 |
--------------------------------------------------------------------------------
/src/assets/img/squirtle.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
148 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/squirtle.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
148 |
--------------------------------------------------------------------------------
/src/assets/img/pikachu.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
165 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/pikachu.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
165 |
--------------------------------------------------------------------------------
/src/assets/img/zubat.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
177 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/zubat.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
177 |
--------------------------------------------------------------------------------
/src/assets/img/abra.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
176 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/abra.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
176 |
--------------------------------------------------------------------------------
/src/assets/img/caterpie.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
170 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/caterpie.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
170 |
--------------------------------------------------------------------------------
/src/assets/img/pidgey.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
193 |
--------------------------------------------------------------------------------
/projects/angular-editor-fabric-js/src/assets/img/pidgey.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
193 |
--------------------------------------------------------------------------------