Skip to content

Commit

Permalink
Add index.js as entry point, move model to subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
TheReincarnator committed Apr 18, 2018
1 parent d5a3a6d commit 979d821
Show file tree
Hide file tree
Showing 37 changed files with 28 additions and 19 deletions.
7 changes: 7 additions & 0 deletions html2asketch/index.js
@@ -0,0 +1,7 @@
export {default as nodeTreeToSketchGroup} from './nodeTreeToSketchGroup';
export {default as nodeTreeToSketchPage} from './nodeTreeToSketchPage';
export {default as nodeToSketchLayers} from './nodeToSketchLayers';

export {default as Base} from './model/base';
export {default as Group} from './model/group';
export {default as Page} from './model/page';
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion html2asketch/base.js → html2asketch/model/base.js
@@ -1,4 +1,4 @@
import {generateID} from './helpers/utils';
import {generateID} from '../helpers/utils';

class Base {
constructor() {
Expand Down
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
import {generateID, makeColorFromCSS} from './helpers/utils';
import {generateID, makeColorFromCSS} from '../helpers/utils';

function pageToPageReference(page) {
return {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions html2asketch/style.js → html2asketch/model/style.js
@@ -1,5 +1,5 @@
import {makeColorFill, makeImageFill, makeColorFromCSS} from './helpers/utils';
import convertAngleToFromAndTo from './helpers/convertAngleToFromAndTo';
import {makeColorFill, makeImageFill, makeColorFromCSS} from '../helpers/utils';
import convertAngleToFromAndTo from '../helpers/convertAngleToFromAndTo';

class Style {
constructor() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
import {generateID} from './helpers/utils';
import {generateID} from '../helpers/utils';
import Base from './base';
import SymbolInstance from './symbolInstance';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion html2asketch/nodeToSketchLayers.d.ts
@@ -1,4 +1,4 @@
import Base from "./base";
import Base from "./model/base";
import Options from "./options";

export default function nodeToSketchLayers(node: HTMLElement, options?: Options): Base[];
12 changes: 6 additions & 6 deletions html2asketch/nodeToSketchLayers.js
@@ -1,9 +1,9 @@
import Rectange from './rectangle';
import SVG from './svg';
import ShapeGroup from './shapeGroup';
import Style from './style';
import Text from './text';
import TextStyle from './textStyle';
import Rectange from './model/rectangle';
import SVG from './model/svg';
import ShapeGroup from './model/shapeGroup';
import Style from './model/style';
import Text from './model/text';
import TextStyle from './model/textStyle';
import createXPathFromElement from './helpers/createXPathFromElement';
import {parseBackgroundImage} from './helpers/background';
import {getSVGString} from './helpers/svg';
Expand Down
2 changes: 1 addition & 1 deletion html2asketch/nodeTreeToSketchGroup.d.ts
@@ -1,4 +1,4 @@
import Group from './group';
import Group from './model/group';
import Options from "./options";

export default function nodeTreeToSketchGroup(node: HTMLElement, options?: Options): Group;
4 changes: 2 additions & 2 deletions html2asketch/nodeTreeToSketchGroup.js
@@ -1,6 +1,6 @@
import Group from './model/group';
import Style from './model/style';
import nodeToSketchLayers from './nodeToSketchLayers';
import Group from './group';
import Style from './style';
import {isNodeVisible} from './helpers/visibility';

export default function nodeTreeToSketchGroup(node, options) {
Expand Down
2 changes: 1 addition & 1 deletion html2asketch/nodeTreeToSketchPage.d.ts
@@ -1,4 +1,4 @@
import Page from './page';
import Page from './model/page';
import Options from "./options";

export default function nodeTreeToSketchPage(node: HTMLElement, options?: Options): Page;
4 changes: 2 additions & 2 deletions html2asketch/nodeTreeToSketchPage.js
@@ -1,5 +1,5 @@
import Artboard from './artboard';
import Page from './page';
import Artboard from './model/artboard';
import Page from './model/page';
import nodeTreeToSketchGroup from './nodeTreeToSketchGroup';

export default function nodeTreeToSketchPage(node, options) {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -55,6 +55,8 @@
"sketch-constants": "^1.1.0",
"sketchapp-json-plugin": "^0.1.2"
},
"main": "build/html2asketch/index",
"typings": "build/html2asketch/index",
"files": ["asketch2sketch", "html2asketch", "build/html2asketch"],
"bugs": {
"url": "https://github.com/brainly/html-sketchapp/issues"
Expand Down
2 changes: 1 addition & 1 deletion test/inject.js
@@ -1,5 +1,5 @@
import nodeToSketchLayers from '../html2asketch/nodeToSketchLayers';
import Page from '../html2asketch/page';
import Page from '../html2asketch/model/page';

function flatten(arr) {
return [].concat(...arr);
Expand Down

0 comments on commit 979d821

Please sign in to comment.