Skip to content

Commit

Permalink
Merge branch 'master' into fix-transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Oct 31, 2022
2 parents f9071cf + 5d95075 commit 459e72f
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 322 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [next]

- chore(TS): migrate Triangle to TS [#8410](https://github.com/fabricjs/fabric.js/pull/8410)
- chore(TS): migrate Circle to TS [#8406](https://github.com/fabricjs/fabric.js/pull/8406)
- chore(TS): convert Object interactivity mixin to its own class [#8401](https://github.com/fabricjs/fabric.js/pull/8401)
- chore(TS): Convert controls e6/ts [#8400](https://github.com/fabricjs/fabric.js/pull/8400)
- ci(): remove buggy changelog action in favor of `git diff` bash script + direct git how to merge `CHANGELOG.md` [#8309](https://github.com/fabricjs/fabric.js/pull/8346)
Expand Down
28 changes: 0 additions & 28 deletions HEADER.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,6 @@ fabric.isTouchSupported =
fabric.isLikelyNode =
typeof Buffer !== 'undefined' && typeof window === 'undefined';

/* _FROM_SVG_START_ */
/**
* Attributes parsed from all SVG elements
* @type array
*/
fabric.SHARED_ATTRIBUTES = [
'display',
'transform',
'fill',
'fill-opacity',
'fill-rule',
'opacity',
'stroke',
'stroke-dasharray',
'stroke-linecap',
'stroke-dashoffset',
'stroke-linejoin',
'stroke-miterlimit',
'stroke-opacity',
'stroke-width',
'id',
'paint-order',
'vector-effect',
'instantiated_by_use',
'clip-path',
];
/* _FROM_SVG_END_ */

/**
* @todo move to config when window is exported
*/
Expand Down
25 changes: 25 additions & 0 deletions src/parser/attributes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Attributes parsed from all SVG elements
* @type array
*/
export const SHARED_ATTRIBUTES = [
'display',
'transform',
'fill',
'fill-opacity',
'fill-rule',
'opacity',
'stroke',
'stroke-dasharray',
'stroke-linecap',
'stroke-dashoffset',
'stroke-linejoin',
'stroke-miterlimit',
'stroke-opacity',
'stroke-width',
'id',
'paint-order',
'vector-effect',
'instantiated_by_use',
'clip-path',
];
3 changes: 2 additions & 1 deletion src/parser/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ts-nocheck
import { fabric } from '../../HEADER';
import { SHARED_ATTRIBUTES } from './attributes';
import { clipPaths, cssRules, gradientDefs } from './constants';
import { ElementsParser } from './elements_parser';
import { getCSSRules } from './getCSSRules';
Expand All @@ -15,6 +15,7 @@ import { parseSVGDocument } from './parseSVGDocument';
import { parseTransformAttribute } from './parseTransformAttribute';

Object.assign(fabric, {
SHARED_ATTRIBUTES,
cssRules,
gradientDefs,
clipPaths,
Expand Down
2 changes: 1 addition & 1 deletion src/parser/parseAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { setStrokeFillOpacity } from './setStrokeFillOpacity';
* @param {Array} attributes Array of attributes to parse
* @return {Object} object containing parsed attributes' names/values
*/
export function parseAttributes(element, attributes, svgUid) {
export function parseAttributes(element, attributes, svgUid?: string) {
if (!element) {
return;
}
Expand Down
Loading

0 comments on commit 459e72f

Please sign in to comment.