Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# SVG-Edit CHANGES

## 7.3.8
- Update svgcanvas to 7.2.7

## 7.3.7
- Fixed issue where foreignObject styles were removed during object moves (#1053)
- Fixed svgToString converting HTML elements to uppercase (#1051)
- Updated README to correct config() and init() order (#1049) for proper initialization sequence.
- Fixed rendering issue with SVG filters (#1042)
- Added custom SVG cursors (commit)
- update dependencies

## 7.3.6
- #1040: Fixed bug in Editor.loadFromURL where the promise was not resolving
- #1038: Fixed bug in ext-opensave.js when dropping text
- #1035: Consider pathedit mode when zooming
- #1033: Fix gradient
- update dependencies

## 7.3.5
- update dependencies
- minor fixes
Expand Down
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@ WORKDIR /app
COPY . /app

# Install dependencies
RUN npm install
RUN npm install

# Set npm to ignore scripts
ENV npm_config_ignore_scripts=true

# Run build manually ignoring scripts
WORKDIR /app/packages/svgcanvas
RUN npx rollup -c
WORKDIR /app
RUN npx rollup -c
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,28 @@ V7 is changing significantly the way to integrate and customize SVGEdit. You can
import Editor from './Editor.js'
/* for available options see the file `docs/tutorials/ConfigOptions.md` */
const svgEditor = new Editor(document.getElementById('container'))
/* initialize the Editor */
svgEditor.init()
/* set the configuration */
svgEditor.setConfig({
allowInitialUserOverride: true,
extensions: [],
noDefaultExtensions: false,
userExtensions: []
})
/* initialize the Editor */
svgEditor.init()
</script>
</html>
```

## I want to build my own svg editor
You can just use the underlying canvas and use it in your application with your favorite framework.
See example in the demos folder or the svg-edit-react repository.
See example in the demos folder or the svg-edit-react repository.

To install the canvas:

`npm i -s '@svgedit/svgcanvas'`

you can then import it in your application:
you can then import it in your application:

`import svgCanvas from '@svgedit/svgcanvas'`

Expand Down
30 changes: 15 additions & 15 deletions coverage/coverage-summary.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cypress/e2e/ui/scenario1.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ describe('check tool shape and image of svg-edit', { testIsolation: false }, fun
// issue with snapshot not being consistent on CI/Interactive
// cy.svgSnapshot()
// so we use typical DOM tests to validate
cy.get('#svg_2').should('have.attr', 'xlink:href').and('equal', './images/logo.svg')
cy.get('#svg_2').should('have.attr', 'href').and('equal', './images/logo.svg')
})
})
44 changes: 44 additions & 0 deletions cypress/e2e/ui/seComponents.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
describe('Editor Web Components', () => {
context('seButton', () => {
it('renders and reacts to click', () => {
const onClick = cy.stub().as('seButtonClick')

cy.document().then(doc => {
const el = doc.createElement('se-button')
el.addEventListener('click', onClick)
doc.body.appendChild(el)
})

cy.get('se-button').should('exist').click({ force: true })
cy.get('@seButtonClick').should('have.been.called')
})
})

context('seFlyingButton', () => {
it('renders and reacts to click', () => {
const onClick = cy.stub().as('seFlyingClick')
cy.document().then(doc => {
const el = doc.createElement('se-flying-button')
el.addEventListener('click', onClick)
doc.body.appendChild(el)
})

cy.get('se-flying-button').should('exist').click({ force: true })
cy.get('@seFlyingClick').should('have.been.called')
})
})

context('seExplorerButton', () => {
it('renders and reacts to click', () => {
const onClick = cy.stub().as('seExplorerClick')
cy.document().then(doc => {
const el = doc.createElement('se-explorer-button')
el.addEventListener('click', onClick)
doc.body.appendChild(el)
})

cy.get('se-explorer-button').should('exist').click({ force: true })
cy.get('@seExplorerClick').should('have.been.called')
})
})
})
4 changes: 2 additions & 2 deletions cypress/e2e/unit/test1.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ describe('Basic Module', function () {
svgCanvas.setSvgString(
"<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='400' x='300'>" +
"<rect id='the-rect' width='200' height='200'/>" +
"<use id='the-use' xlink:href='#the-rect'/>" +
"<use id='foreign-use' xlink:href='somefile.svg#the-rect'/>" +
"<use id='the-use' href='#the-rect'/>" +
"<use id='foreign-use' href='somefile.svg#the-rect'/>" +
"<use id='no-use'/>" +
'</svg>'
)
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/unit/utilities-performance.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('utilities performance', function () {
<!-- Must include this thumbnail view to see some of the performance issues -->
<svg id="overviewMiniView" width="132" height="112.5" x="0" y="0" viewBox="100 100 1000 1000" style="float: right;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<use x="0" y="0" xlink:href="#svgroot"></use>
<use x="0" y="0" href="#svgroot"></use>
</svg>


Expand Down
Loading