Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

19
static/js/ketcher2/node_modules/svgstore/LICENSE generated vendored Normal file
View File

@ -0,0 +1,19 @@
Copyright (c) 2016 Shannon Moeller
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

103
static/js/ketcher2/node_modules/svgstore/README.md generated vendored Normal file
View File

@ -0,0 +1,103 @@
# `svgstore`
[![NPM version][npm-img]][npm-url] [![Downloads][downloads-img]][npm-url] [![Build Status][travis-img]][travis-url] [![Coverage Status][coveralls-img]][coveralls-url]
Combines multiple SVG files into one using `<symbol>` elements which you may [`<use>` in your markup](https://css-tricks.com/svg-sprites-use-better-icon-fonts/). Heavily inspired by [`grunt-svgstore`](https://github.com/FWeinb/grunt-svgstore) and [`gulp-svgstore`](https://github.com/w0rm/gulp-svgstore), this is a standalone module that may be [used in any asset pipeline](#future-goals).
## Install
$ npm install --save svgstore
## Usage
```js
var svgstore = require('svgstore');
var fs = require('fs');
var sprites = svgstore()
.add('unicorn', fs.readFileSync('./unicorn.svg', 'utf8'))
.add('rainbow', fs.readFileSync('./rainbow.svg', 'utf8'));
fs.writeFileSync('./sprites.svg', sprites);
```
The resulting file may be consumed in markup as external content.
```html
<body>
<svg role="img"><use xlink:href="./sprites.svg#unicorn"/></svg>
<svg role="img"><use xlink:href="./sprites.svg#rainbow"/></svg>
</body>
```
See the [examples directory](https://github.com/shannonmoeller/svgstore/tree/master/docs/examples) for more detail.
## API
### svgstore([options]): SvgStore
- `options` `{Object}`: [Options for converting SVGs to symbols](#svgstore-options)
Creates a container SVG sprites document.
### .element
The current [cheerio](https://github.com/cheeriojs/cheerio) instance.
### .add(id, svg [, options]): SvgStore
- `id` `{String}` Unique `id` for this SVG file.
- `svg` `{String}` Raw source of the SVG file.
- `options` `{Object}` Same as the [options of `svgstore()`](#svgstore-options), but will only apply to this SVG file's `<symbol>`.
Appends a file to the sprite with the given `id`.
### .toString([options]): String
- `options` `{Object}`
- `inline` `{Boolean}` (default: `false`) Don't output `<?xml ?>`, `DOCTYPE`, and the `xmlns` attribute.
Outputs sprite as a string of XML.
## <a name="svgstore-options"></a>Options
- `cleanDefs` `{Boolean|Array}` (default: `false`) Remove `style` attributes from SVG definitions, or a list of attributes to remove.
- `cleanObjects` `{Boolean|Array}` (default: `false`) Remove `style` attributes from SVG objects, or a list of attributes to remove.
- `svgAttrs` `{Boolean|Object}` (default: `false`) A map of attributes to set on the root `<svg>` element. If you set an attribute's value to null, you remove that attribute. Values may be functions like jQuery.
- `symbolAttrs` `{Boolean|Object}` (default: `false`) A map of attributes to set on each `<symbol>` element. If you set an attribute's value to null, you remove that attribute. Values may be functions like jQuery.
- `copyAttrs` `{Boolean|Array}` (default: `false`) Attributes to have `svgstore` attempt to copy to the newly created `<symbol>` tag from it's source `<svg>` tag. The `viewBox`, `aria-labelledby`, and `role` attributes are always copied.
## Contributing
Standards for this project, including tests, code coverage, and semantics are enforced with a build tool. Pull requests must include passing tests with 100% code coverage and no linting errors.
### Test
$ npm test
## Future Goals
The svgstore organization began after it was noticed that the common [build task of converting an `<svg>` into a `<symbol>` tag](https://css-tricks.com/svg-symbol-good-choice-icons/) was being implemented in a similar manner by many different projects across the JavaScript ecosystem.
The long-term goal for this project, in particular, is to provide a single standalone module that can be plugged in to any asset pipeline, thus allowing pipeline tools to focus on providing clean APIs and interfaces related to their build process integration, rather than implementing/duplicating SVG conversion logic directly.
#### Current build tools using `svgstore`:
* [broccoli-svgstore][broccoli-svgstore]
* [svgstore-cli][svgstore-cli]
----
© Shannon Moeller <me@shannonmoeller.com> (shannonmoeller.com)
Licensed under [MIT](http://shannonmoeller.com/mit.txt)
[coveralls-img]: http://img.shields.io/coveralls/svgstore/svgstore/master.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/svgstore/svgstore
[downloads-img]: http://img.shields.io/npm/dm/svgstore.svg?style=flat-square
[npm-img]: http://img.shields.io/npm/v/svgstore.svg?style=flat-square
[npm-url]: https://npmjs.org/package/svgstore
[travis-img]: http://img.shields.io/travis/svgstore/svgstore.svg?style=flat-square
[travis-url]: https://travis-ci.org/svgstore/svgstore
[broccoli-svgstore]: https://github.com/svgstore/broccoli-svgstore
[svgstore-cli]: https://github.com/svgstore/svgstore-cli

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve">
<g>
<g>
<path fill="#FF6666" d="M62,6.503V2C35.034,2,13.172,23.776,13.172,50.638h4.521C17.692,26.264,37.532,6.503,62,6.503z"/>
<path fill="#FFFB80" d="M17.692,50.638h4.521c0-21.884,17.814-39.631,39.786-39.631V6.503
C37.532,6.503,17.692,26.264,17.692,50.638z"/>
<path fill="#A3E66F" d="M62,15.51v-4.503c-21.972,0-39.786,17.747-39.786,39.631h4.521C26.735,31.238,42.525,15.51,62,15.51z"/>
<path fill="#66C2FF" d="M26.735,50.638h4.521c0-16.911,13.766-30.624,30.743-30.624V15.51
C42.525,15.51,26.735,31.238,26.735,50.638z"/>
<path fill="#9180FF" d="M62,24.518v-4.504c-16.978,0-30.743,13.713-30.743,30.624h4.521C35.777,36.212,47.52,24.518,62,24.518z"/>
</g>
<g>
<path fill="#FFFFFF" d="M10.137,60.652c-0.724,0-1.44-0.116-2.129-0.344c-2.781-0.913-4.651-3.484-4.651-6.398
c0-1.946,0.848-3.796,2.326-5.078c0.382-0.332,0.796-0.619,1.24-0.856L6.9,47.975l0.45-1.56c1.123-3.894,4.75-6.613,8.819-6.613
c0.405,0,0.821,0.032,1.311,0.103c0.375,0.054,0.742,0.13,1.102,0.226l0.18-0.323c1.644-2.945,4.766-4.775,8.146-4.775
c5.135,0,9.312,4.154,9.312,9.261c0,0.25-0.017,0.492-0.036,0.736l-0.015,0.182c0.396,0.15,0.782,0.332,1.155,0.547
c2.482,1.422,4.025,4.072,4.025,6.912c0,3.74-2.56,6.938-6.225,7.774c-0.598,0.138-1.205,0.209-1.801,0.209H10.137z"/>
<path fill="#75D6FF" d="M26.907,36.38c4.394,0,7.955,3.544,7.955,7.912c0,0.213-0.015,0.42-0.032,0.627
c-1.839,0.141-3.509,0.869-4.821,2.002c0.977-0.558,2.105-0.882,3.313-0.882c0.447,0,0.884,0.045,1.306,0.128
c0.723,0.143,1.4,0.403,2.017,0.757c1.999,1.146,3.347,3.286,3.347,5.745c0,3.149-2.209,5.784-5.17,6.461
c-0.482,0.11-0.982,0.174-1.498,0.174c0,0,0,0-0.001,0H10.137l0,0c-0.595,0-1.165-0.099-1.7-0.274
c-2.162-0.711-3.723-2.733-3.723-5.119c0-1.623,0.722-3.074,1.861-4.062c0.516-0.45,1.117-0.8,1.776-1.029
c0.56-0.193,1.159-0.306,1.786-0.306c1.749,0,3.299,0.826,4.292,2.105l0.048-0.001c-1.151-2.108-3.304-3.595-5.823-3.833
c0.937-3.25,3.944-5.635,7.514-5.635c0.382,0,0.752,0.036,1.118,0.089c0.725,0.104,1.417,0.302,2.063,0.588
c2.405,1.068,4.163,3.305,4.555,5.984c0-0.014,0-0.031,0-0.046c0-3.052-1.573-5.738-3.957-7.305
C21.306,38.03,23.912,36.38,26.907,36.38 M26.907,33.684c-3.658,0-7.053,1.869-9.004,4.92c-0.075-0.011-0.151-0.022-0.227-0.035
c-0.559-0.078-1.036-0.114-1.507-0.114c-4.671,0-8.834,3.12-10.123,7.589l-0.307,1.063c-0.333,0.212-0.651,0.451-0.952,0.712
C3.017,49.354,2,51.575,2,53.91c0,3.497,2.245,6.582,5.585,7.679C8.407,61.862,9.268,62,10.137,62h23.185
c0.7,0,1.41-0.081,2.112-0.244c4.278-0.977,7.271-4.715,7.271-9.087c0-3.321-1.804-6.418-4.706-8.081
c-0.14-0.08-0.281-0.156-0.425-0.229c0-0.022,0-0.044,0-0.066C37.575,38.442,32.79,33.684,26.907,33.684L26.907,33.684z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve">
<g>
<g>
<g>
<path fill="#E5BE7A" d="M12.645,19.666C12,12.56,16.381,11.69,18.766,12.197c2.385,0.506,4.349,6.39,1.712,13.026
c-3.631,9.127-10.542,10.65-10.542,10.65S13.489,28.984,12.645,19.666z"/>
<path fill="#E5BE7A" d="M14.893,27.481c-0.645-7.105,3.736-7.976,6.121-7.469c2.385,0.506,4.35,6.391,1.712,13.027
C19.095,42.167,9.553,44.716,9.553,44.716S15.737,36.799,14.893,27.481z"/>
<path fill="#E5BE7A" d="M16.481,37.437c-0.644-7.105,3.736-7.975,6.123-7.468c2.385,0.507,4.347,6.39,1.709,13.027
C20.685,52.124,8.658,55.69,8.658,55.69S17.325,46.755,16.481,37.437z"/>
</g>
<g>
<path fill="#E5BE7A" d="M53.813,19.893c-1.36-7.006-6.227-8.203-8.611-7.696c-2.383,0.506-4.347,6.39-1.71,13.026
c3.629,9.127,4.065,15.049,4.065,15.049S55.979,31.065,53.813,19.893z"/>
</g>
</g>
<g>
<g>
<path fill="#C1875D" d="M57.98,2.01c0.16,5.134-0.616,9.349-2.302,11.872c-2.545,1.584-6.93,2.396-12.362,2.276
c-0.159-5.134,0.614-9.352,2.302-11.874C48.164,2.701,52.548,1.888,57.98,2.01z"/>
</g>
<g>
<path fill="#3E4347" d="M54.746,5.131c0.091,2.867-0.344,5.224-1.285,6.635c-1.423,0.887-3.876,1.339-6.912,1.272
c-0.088-2.87,0.346-5.226,1.287-6.637C49.263,5.514,51.711,5.062,54.746,5.131z"/>
</g>
</g>
<g>
<g>
<path fill="#C1875D" d="M20.817,16.152c-5.371,0.151-9.783-0.59-12.423-2.201c-1.66-2.435-2.507-6.623-2.379-11.815
c5.369-0.151,9.777,0.586,12.417,2.198C20.094,6.773,20.94,10.958,20.817,16.152z"/>
</g>
<g>
<path fill="#3E4347" d="M17.583,13.092c-3.023,0.084-5.509-0.331-6.997-1.24C9.649,10.48,9.173,8.121,9.243,5.193
c3.028-0.087,5.511,0.33,6.998,1.239C17.176,7.807,17.659,10.167,17.583,13.092z"/>
</g>
</g>
<g>
<path fill="#C1875D" d="M48.585,28.956c0,3.673-4.128,16.411-4.128,21.752c0,0-5.146,0.514-12.477,0.514
c-7.188,0-12.299-0.246-12.299-0.246c0-5.477-4.304-18.336-4.304-22.02c0-4.886-0.53-10.083,4.589-16.834
c1.201-1.585,1.538-3.644,12.014-3.644c10.39,0,11.147,1.664,12.233,3.014C49.226,17.707,48.585,22.492,48.585,28.956z"/>
</g>
<g>
<path fill="#FFE2B3" d="M44.771,54.88c0,4.885-2.998,7.119-12.787,7.119c-9.792,0-12.788-2.234-12.788-7.119
c0-4.887,0.271-10.57,12.788-10.57C44.502,44.31,44.771,49.993,44.771,54.88z"/>
</g>
<g>
<g>
<path fill="#3E4347" d="M48.98,26.744c0,2.209-1.458,4-3.25,4c-1.797,0-3.25-1.791-3.25-4s1.453-4,3.25-4
C47.522,22.744,48.98,24.534,48.98,26.744z"/>
</g>
</g>
<g>
<g>
<ellipse fill="#3E4347" cx="18.231" cy="26.744" rx="3.25" ry="4"/>
</g>
</g>
<path fill="#FFE2B3" d="M40.549,43.339c-2.143-1.385-5.175,1.119-6.774,5.592c-1.6,4.482-1.155,9.236,0.993,10.621
c2.146,1.391,5.181-1.113,6.774-5.59C43.137,49.485,42.693,44.728,40.549,43.339z"/>
<path fill="#FFE2B3" d="M23.42,43.339c-2.146,1.393-2.591,6.146-0.992,10.625c1.597,4.475,4.629,6.979,6.774,5.59
c2.144-1.387,2.589-6.141,0.989-10.619C28.601,44.458,25.566,41.952,23.42,43.339z"/>
<path fill="#FFFFFF" d="M27.57,19.22c0-8.426,1.976-10.126,4.415-10.126c2.439,0,4.414,1.7,4.414,10.126
c0,8.428-4.414,20.39-4.414,20.39S27.57,27.648,27.57,19.22z"/>
<g>
<path fill="#3E4347" d="M39.776,45.974c-1.57-1.016-3.79,0.82-4.964,4.098c-1.173,3.281-0.844,6.766,0.729,7.781
c1.573,1.02,3.796-0.816,4.965-4.096C41.674,50.476,41.349,46.991,39.776,45.974z"/>
<path fill="#3E4347" d="M24.196,45.974c-1.573,1.02-1.9,4.502-0.729,7.783c1.169,3.279,3.391,5.115,4.963,4.096
c1.57-1.016,1.896-4.5,0.726-7.779C27.987,46.794,25.766,44.958,24.196,45.974z"/>
</g>
<path fill="#E5BE7A" d="M45.73,9.555C38.439-0.789,9.623,2.571,9.623,26.513c0,0,6.883-8.836,18.46-11.407
c0,0-4.606,5.271-10.041,9.45c0,0,11.297-2.86,18.275-9.357c0,0,0.815,4.672-8.524,7.768C27.792,22.966,54.687,22.269,45.73,9.555z
"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,37 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Example</title>
<style>
body {
font-family: sans-serif;
padding: 12%;
text-align: center;
}
svg {
display: inline-block;
height: 12em;
width: 12em;
}
</style>
<!--
! IE and Safari need a little bit of help.
! https://jonathantneal.github.io/svg4everybody/
!-->
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<script src="./vendor/svg4everybody.js"></script>
<script>svg4everybody();</script>
</head>
<body>
<svg role="img"><use xlink:href="./sprites.svg#unicorn" /></svg>
<svg role="img"><use xlink:href="./sprites.svg#rainbow" /></svg>
<p><small>Icons by <a href="http://emojione.com/">Emoji One</a></small></p>
</body>
</html>

View File

@ -0,0 +1,10 @@
'use strict';
var svgstore = require('../src/svgstore');
var fs = require('fs');
var sprites = svgstore()
.add('unicorn', fs.readFileSync('./assets/unicorn.svg', 'utf8'))
.add('rainbow', fs.readFileSync('./assets/rainbow.svg', 'utf8'));
fs.writeFileSync('./sprites.svg', sprites);

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><defs/><symbol id="unicorn" viewBox="0 0 64 64">
<g>
<g>
<g>
<path fill="#E5BE7A" d="M12.645,19.666C12,12.56,16.381,11.69,18.766,12.197c2.385,0.506,4.349,6.39,1.712,13.026
c-3.631,9.127-10.542,10.65-10.542,10.65S13.489,28.984,12.645,19.666z"/>
<path fill="#E5BE7A" d="M14.893,27.481c-0.645-7.105,3.736-7.976,6.121-7.469c2.385,0.506,4.35,6.391,1.712,13.027
C19.095,42.167,9.553,44.716,9.553,44.716S15.737,36.799,14.893,27.481z"/>
<path fill="#E5BE7A" d="M16.481,37.437c-0.644-7.105,3.736-7.975,6.123-7.468c2.385,0.507,4.347,6.39,1.709,13.027
C20.685,52.124,8.658,55.69,8.658,55.69S17.325,46.755,16.481,37.437z"/>
</g>
<g>
<path fill="#E5BE7A" d="M53.813,19.893c-1.36-7.006-6.227-8.203-8.611-7.696c-2.383,0.506-4.347,6.39-1.71,13.026
c3.629,9.127,4.065,15.049,4.065,15.049S55.979,31.065,53.813,19.893z"/>
</g>
</g>
<g>
<g>
<path fill="#C1875D" d="M57.98,2.01c0.16,5.134-0.616,9.349-2.302,11.872c-2.545,1.584-6.93,2.396-12.362,2.276
c-0.159-5.134,0.614-9.352,2.302-11.874C48.164,2.701,52.548,1.888,57.98,2.01z"/>
</g>
<g>
<path fill="#3E4347" d="M54.746,5.131c0.091,2.867-0.344,5.224-1.285,6.635c-1.423,0.887-3.876,1.339-6.912,1.272
c-0.088-2.87,0.346-5.226,1.287-6.637C49.263,5.514,51.711,5.062,54.746,5.131z"/>
</g>
</g>
<g>
<g>
<path fill="#C1875D" d="M20.817,16.152c-5.371,0.151-9.783-0.59-12.423-2.201c-1.66-2.435-2.507-6.623-2.379-11.815
c5.369-0.151,9.777,0.586,12.417,2.198C20.094,6.773,20.94,10.958,20.817,16.152z"/>
</g>
<g>
<path fill="#3E4347" d="M17.583,13.092c-3.023,0.084-5.509-0.331-6.997-1.24C9.649,10.48,9.173,8.121,9.243,5.193
c3.028-0.087,5.511,0.33,6.998,1.239C17.176,7.807,17.659,10.167,17.583,13.092z"/>
</g>
</g>
<g>
<path fill="#C1875D" d="M48.585,28.956c0,3.673-4.128,16.411-4.128,21.752c0,0-5.146,0.514-12.477,0.514
c-7.188,0-12.299-0.246-12.299-0.246c0-5.477-4.304-18.336-4.304-22.02c0-4.886-0.53-10.083,4.589-16.834
c1.201-1.585,1.538-3.644,12.014-3.644c10.39,0,11.147,1.664,12.233,3.014C49.226,17.707,48.585,22.492,48.585,28.956z"/>
</g>
<g>
<path fill="#FFE2B3" d="M44.771,54.88c0,4.885-2.998,7.119-12.787,7.119c-9.792,0-12.788-2.234-12.788-7.119
c0-4.887,0.271-10.57,12.788-10.57C44.502,44.31,44.771,49.993,44.771,54.88z"/>
</g>
<g>
<g>
<path fill="#3E4347" d="M48.98,26.744c0,2.209-1.458,4-3.25,4c-1.797,0-3.25-1.791-3.25-4s1.453-4,3.25-4
C47.522,22.744,48.98,24.534,48.98,26.744z"/>
</g>
</g>
<g>
<g>
<ellipse fill="#3E4347" cx="18.231" cy="26.744" rx="3.25" ry="4"/>
</g>
</g>
<path fill="#FFE2B3" d="M40.549,43.339c-2.143-1.385-5.175,1.119-6.774,5.592c-1.6,4.482-1.155,9.236,0.993,10.621
c2.146,1.391,5.181-1.113,6.774-5.59C43.137,49.485,42.693,44.728,40.549,43.339z"/>
<path fill="#FFE2B3" d="M23.42,43.339c-2.146,1.393-2.591,6.146-0.992,10.625c1.597,4.475,4.629,6.979,6.774,5.59
c2.144-1.387,2.589-6.141,0.989-10.619C28.601,44.458,25.566,41.952,23.42,43.339z"/>
<path fill="#FFFFFF" d="M27.57,19.22c0-8.426,1.976-10.126,4.415-10.126c2.439,0,4.414,1.7,4.414,10.126
c0,8.428-4.414,20.39-4.414,20.39S27.57,27.648,27.57,19.22z"/>
<g>
<path fill="#3E4347" d="M39.776,45.974c-1.57-1.016-3.79,0.82-4.964,4.098c-1.173,3.281-0.844,6.766,0.729,7.781
c1.573,1.02,3.796-0.816,4.965-4.096C41.674,50.476,41.349,46.991,39.776,45.974z"/>
<path fill="#3E4347" d="M24.196,45.974c-1.573,1.02-1.9,4.502-0.729,7.783c1.169,3.279,3.391,5.115,4.963,4.096
c1.57-1.016,1.896-4.5,0.726-7.779C27.987,46.794,25.766,44.958,24.196,45.974z"/>
</g>
<path fill="#E5BE7A" d="M45.73,9.555C38.439-0.789,9.623,2.571,9.623,26.513c0,0,6.883-8.836,18.46-11.407
c0,0-4.606,5.271-10.041,9.45c0,0,11.297-2.86,18.275-9.357c0,0,0.815,4.672-8.524,7.768C27.792,22.966,54.687,22.269,45.73,9.555z
"/>
</g>
</symbol><symbol id="rainbow" viewBox="0 0 64 64">
<g>
<g>
<path fill="#FF6666" d="M62,6.503V2C35.034,2,13.172,23.776,13.172,50.638h4.521C17.692,26.264,37.532,6.503,62,6.503z"/>
<path fill="#FFFB80" d="M17.692,50.638h4.521c0-21.884,17.814-39.631,39.786-39.631V6.503
C37.532,6.503,17.692,26.264,17.692,50.638z"/>
<path fill="#A3E66F" d="M62,15.51v-4.503c-21.972,0-39.786,17.747-39.786,39.631h4.521C26.735,31.238,42.525,15.51,62,15.51z"/>
<path fill="#66C2FF" d="M26.735,50.638h4.521c0-16.911,13.766-30.624,30.743-30.624V15.51
C42.525,15.51,26.735,31.238,26.735,50.638z"/>
<path fill="#9180FF" d="M62,24.518v-4.504c-16.978,0-30.743,13.713-30.743,30.624h4.521C35.777,36.212,47.52,24.518,62,24.518z"/>
</g>
<g>
<path fill="#FFFFFF" d="M10.137,60.652c-0.724,0-1.44-0.116-2.129-0.344c-2.781-0.913-4.651-3.484-4.651-6.398
c0-1.946,0.848-3.796,2.326-5.078c0.382-0.332,0.796-0.619,1.24-0.856L6.9,47.975l0.45-1.56c1.123-3.894,4.75-6.613,8.819-6.613
c0.405,0,0.821,0.032,1.311,0.103c0.375,0.054,0.742,0.13,1.102,0.226l0.18-0.323c1.644-2.945,4.766-4.775,8.146-4.775
c5.135,0,9.312,4.154,9.312,9.261c0,0.25-0.017,0.492-0.036,0.736l-0.015,0.182c0.396,0.15,0.782,0.332,1.155,0.547
c2.482,1.422,4.025,4.072,4.025,6.912c0,3.74-2.56,6.938-6.225,7.774c-0.598,0.138-1.205,0.209-1.801,0.209H10.137z"/>
<path fill="#75D6FF" d="M26.907,36.38c4.394,0,7.955,3.544,7.955,7.912c0,0.213-0.015,0.42-0.032,0.627
c-1.839,0.141-3.509,0.869-4.821,2.002c0.977-0.558,2.105-0.882,3.313-0.882c0.447,0,0.884,0.045,1.306,0.128
c0.723,0.143,1.4,0.403,2.017,0.757c1.999,1.146,3.347,3.286,3.347,5.745c0,3.149-2.209,5.784-5.17,6.461
c-0.482,0.11-0.982,0.174-1.498,0.174c0,0,0,0-0.001,0H10.137l0,0c-0.595,0-1.165-0.099-1.7-0.274
c-2.162-0.711-3.723-2.733-3.723-5.119c0-1.623,0.722-3.074,1.861-4.062c0.516-0.45,1.117-0.8,1.776-1.029
c0.56-0.193,1.159-0.306,1.786-0.306c1.749,0,3.299,0.826,4.292,2.105l0.048-0.001c-1.151-2.108-3.304-3.595-5.823-3.833
c0.937-3.25,3.944-5.635,7.514-5.635c0.382,0,0.752,0.036,1.118,0.089c0.725,0.104,1.417,0.302,2.063,0.588
c2.405,1.068,4.163,3.305,4.555,5.984c0-0.014,0-0.031,0-0.046c0-3.052-1.573-5.738-3.957-7.305
C21.306,38.03,23.912,36.38,26.907,36.38 M26.907,33.684c-3.658,0-7.053,1.869-9.004,4.92c-0.075-0.011-0.151-0.022-0.227-0.035
c-0.559-0.078-1.036-0.114-1.507-0.114c-4.671,0-8.834,3.12-10.123,7.589l-0.307,1.063c-0.333,0.212-0.651,0.451-0.952,0.712
C3.017,49.354,2,51.575,2,53.91c0,3.497,2.245,6.582,5.585,7.679C8.407,61.862,9.268,62,10.137,62h23.185
c0.7,0,1.41-0.081,2.112-0.244c4.278-0.977,7.271-4.715,7.271-9.087c0-3.321-1.804-6.418-4.706-8.081
c-0.14-0.08-0.281-0.156-0.425-0.229c0-0.022,0-0.044,0-0.066C37.575,38.442,32.79,33.684,26.907,33.684L26.907,33.684z"/>
</g>
</g>
</symbol></svg>

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -0,0 +1,2 @@
!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.svg4everybody=b()}):"object"==typeof exports?module.exports=b():a.svg4everybody=b()}(this,function(){/*! svg4everybody v2.0.0 | github.com/jonathantneal/svg4everybody */
function a(a,b){if(b){var c=!a.getAttribute("viewBox")&&b.getAttribute("viewBox"),d=document.createDocumentFragment(),e=b.cloneNode(!0);for(c&&a.setAttribute("viewBox",c);e.childNodes.length;)d.appendChild(e.firstChild);a.appendChild(d)}}function b(b){b.onreadystatechange=function(){if(4===b.readyState){var c=document.createElement("x");c.innerHTML=b.responseText,b.s.splice(0).map(function(b){a(b[0],c.querySelector("#"+b[1].replace(/(\W)/g,"\\$1")))})}},b.onreadystatechange()}function c(c){function d(){for(var c;c=e[0];){var j=c.parentNode;if(j&&/svg/i.test(j.nodeName)){var k=c.getAttribute("xlink:href");if(f&&(!g||g(k,j,c))){var l=k.split("#"),m=l[0],n=l[1];if(j.removeChild(c),m.length){var o=i[m]=i[m]||new XMLHttpRequest;o.s||(o.s=[],o.open("GET",m),o.send()),o.s.push([j,n]),b(o)}else a(j,document.getElementById(n))}}}h(d,17)}c=c||{};var e=document.getElementsByTagName("use"),f="shim"in c?c.shim:/\bEdge\/12\b|\bTrident\/[567]\b|\bVersion\/7.0 Safari\b/.test(navigator.userAgent)||(navigator.userAgent.match(/AppleWebKit\/(\d+)/)||[])[1]<537,g=c.validate,h=window.requestAnimationFrame||setTimeout,i={};f&&d()}return c});

91
static/js/ketcher2/node_modules/svgstore/package.json generated vendored Normal file
View File

@ -0,0 +1,91 @@
{
"_from": "svgstore@2.0.2",
"_id": "svgstore@2.0.2",
"_inBundle": false,
"_integrity": "sha1-GJVO0eVxw4kGHs3Tc4uqQeQBbKw=",
"_location": "/svgstore",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "svgstore@2.0.2",
"name": "svgstore",
"escapedName": "svgstore",
"rawSpec": "2.0.2",
"saveSpec": null,
"fetchSpec": "2.0.2"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/svgstore/-/svgstore-2.0.2.tgz",
"_shasum": "18954ed1e571c389061ecdd3738baa41e4016cac",
"_spec": "svgstore@2.0.2",
"_where": "/home/manfred/enviPath/ketcher2/ketcher",
"author": {
"name": "Shannon Moeller",
"email": "me@shannonmoeller.com",
"url": "http://shannonmoeller.com"
},
"bugs": {
"url": "https://github.com/svgstore/svgstore/issues"
},
"bundleDependencies": false,
"dependencies": {
"cheerio": "^0.22.0",
"object-assign": "^4.1.0"
},
"deprecated": false,
"description": "Combines mulitple svg files into one.",
"devDependencies": {
"ava": "0.16.0",
"chokidar-cli": "^1.2.0",
"coveralls": "^2.11.12",
"nyc": "^8.1.0",
"xo": "^0.16"
},
"engines": {
"node": ">= 0.12"
},
"homepage": "https://github.com/svgstore/svgstore",
"keywords": [
"concat",
"join",
"merge",
"pack",
"path",
"sprite",
"svg",
"svgs",
"svgstore",
"symbol",
"symbols"
],
"license": "MIT",
"main": "src/svgstore.js",
"maintainers": [
{
"name": "Shannon Moeller",
"email": "me@shannonmoeller.com",
"url": "https://github.com/shannonmoeller"
},
{
"name": "Brian Sipple",
"email": "bsipple57@gmail.com",
"url": "https://github.com/BrianSipple"
}
],
"name": "svgstore",
"repository": {
"type": "git",
"url": "git+https://github.com/svgstore/svgstore.git"
},
"scripts": {
"coveralls": "nyc report -r text-lcov | coveralls",
"posttest": "nyc report -r lcov",
"pretest": "xo src/*.js test/*.js",
"test": "nyc ava -v",
"watch": "chokidar '{src,test}/**/*.js' -d 1000 -c 'npm test'"
},
"version": "2.0.2"
}

View File

@ -0,0 +1,91 @@
'use strict';
var assign = require('object-assign');
var copyAttributes = require('./utils/copy-attributes');
var loadXml = require('./utils/load-xml');
var removeAttributes = require('./utils/remove-attributes');
var setAttributes = require('./utils/set-attributes');
var svgToSymbol = require('./utils/svg-to-symbol');
var SELECTOR_SVG = 'svg';
var SELECTOR_DEFS = 'defs';
var TEMPLATE_SVG = '<svg><defs/></svg>';
var TEMPLATE_DOCTYPE = '<?xml version="1.0" encoding="UTF-8"?>' +
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ' +
'"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';
var DEFAULT_OPTIONS = {
cleanDefs: false,
cleanSymbols: false,
inline: false,
svgAttrs: false,
symbolAttrs: false,
copyAttrs: false
};
function svgstore(options) {
var svgstoreOptions = assign({}, DEFAULT_OPTIONS, options);
// <svg>
var parent = loadXml(TEMPLATE_SVG);
var parentSvg = parent(SELECTOR_SVG);
var parentDefs = parent(SELECTOR_DEFS);
return {
element: parent,
add: function (id, file, options) {
var child = loadXml(file);
var addOptions = assign({}, svgstoreOptions, options);
// <defs>
var childDefs = child(SELECTOR_DEFS);
removeAttributes(childDefs, addOptions.cleanDefs);
parentDefs.append(childDefs.contents());
childDefs.remove();
// <symbol>
var childSvg = child(SELECTOR_SVG);
var childSymbol = svgToSymbol(id, child, addOptions);
removeAttributes(childSymbol, addOptions.cleanSymbols);
copyAttributes(childSymbol, childSvg, addOptions.copyAttrs);
setAttributes(childSymbol, addOptions.symbolAttrs);
parentSvg.append(childSymbol);
return this;
},
toString: function (options) {
// Create a clone so we don't modify the parent document.
var clone = loadXml(parent.xml());
var toStringOptions = assign({}, svgstoreOptions, options);
// <svg>
var svg = clone(SELECTOR_SVG);
setAttributes(svg, toStringOptions.svgAttrs);
// output inline
if (toStringOptions.inline) {
return clone.xml();
}
// output standalone
svg.attr('xmlns', function (val) {
return val || 'http://www.w3.org/2000/svg';
});
svg.attr('xmlns:xlink', function (val) {
return val || 'http://www.w3.org/1999/xlink';
});
return TEMPLATE_DOCTYPE + clone.xml();
}
};
}
module.exports = svgstore;

View File

@ -0,0 +1,34 @@
/**
* Utility to copy specific attributes from one node to another.
*/
'use strict';
var ALWAYS_COPY_ATTRS = [
'viewBox',
'aria-labelledby',
'role',
];
function copyAttributes(a, b, attrs) {
var attrsToCopy = ALWAYS_COPY_ATTRS.concat(attrs || []);
var copiedAttrs = Object.create(null);
attrsToCopy.forEach(function (attr) {
if (!attr || copiedAttrs[attr]) {
return;
}
copiedAttrs[attr] = true;
var bAttr = b.attr(attr);
if (bAttr != null) {
a.attr(attr, b.attr(attr));
}
});
return a;
}
module.exports = copyAttributes;

View File

@ -0,0 +1,16 @@
/**
* Utility method to create an XML document object with a jQuery-like
* interface for node manipulation.
*/
'use strict';
var cheerio = require('cheerio');
function loadXml(text) {
return cheerio.load(text, {
xmlMode: true
});
}
module.exports = loadXml;

View File

@ -0,0 +1,30 @@
/**
* Utility to remove specific attributes from all
* child nodes of a given node.
*/
'use strict';
function removeAttributes(el, attrs) {
var localAttrs = attrs;
if (localAttrs === true) {
localAttrs = ['style'];
}
if (!localAttrs || !localAttrs.length) {
return el;
}
var els = el.find('*');
els.each(function (i, el) {
localAttrs.forEach(function (attr) {
els.eq(i).removeAttr(attr);
});
});
return el;
}
module.exports = removeAttributes;

View File

@ -0,0 +1,28 @@
/**
* Utility function to set the attributes of an element. Allows values to be
* passed as functions so existing values may be manipulated or left untouched.
*/
'use strict';
function setAttributes(el, attrs) {
if (!attrs || typeof attrs !== 'object') {
return el;
}
Object.keys(attrs).forEach(function (attr) {
var value = attrs[attr];
// Handle function values directly as cherrio passes an unhelpful index
// as the first argument in the native function handler.
if (typeof value === 'function') {
value = value(el.attr(attr));
}
el.attr(attr, value);
});
return el;
}
module.exports = setAttributes;

View File

@ -0,0 +1,31 @@
/**
* Utility for cloning an <svg/> as a <symbol/> within
* the composition of svgstore output.
*/
'use strict';
var SELECTOR_SVG = 'svg';
var TEMPLATE_SYMBOL = '<symbol/>';
var ATTRIBUTE_ID = 'id';
/**
* @param {string} id The id to be applied to the symbol tag
* @param {string} child An object created by loading the content of the current file via the cheerio#load function.
* @param {object} options for parsing the svg content
* @return {object} symbol The final cheerio-aware object created by cloning the SVG contents
* @see <a href="https://github.com/cheeriojs/cheerio">The Cheerio Project</a>
*/
function svgToSymbol(id, child, options) {
var svgElem = child(SELECTOR_SVG);
// initialize a new <symbol> element
var symbol = child(TEMPLATE_SYMBOL);
symbol.attr(ATTRIBUTE_ID, id);
symbol.append(svgElem.contents());
return symbol;
}
module.exports = svgToSymbol;

View File

@ -0,0 +1,189 @@
import test from 'ava';
import svgstore from '../src/svgstore';
const doctype = '<?xml version="1.0" encoding="UTF-8"?>' +
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ' +
'"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';
const svgNs = '<svg xmlns="http://www.w3.org/2000/svg" ' +
'xmlns:xlink="http://www.w3.org/1999/xlink">';
const FIXTURE_SVGS = {
foo: '<svg viewBox="0 0 100 100"><defs><linear-gradient style="fill: red;"/></defs><path style="fill: red;"/></svg>',
bar: '<svg viewBox="0 0 200 200"><defs><radial-gradient style="stroke: red;"/></defs><rect style="stroke: red;"/></svg>',
baz: '<svg viewBox="0 0 200 200"><defs><linear-gradient style="fill: red;"/></defs><path style="fill: red;"/></svg>',
qux: '<svg viewBox="0 0 200 200"><defs><radial-gradient style="stroke: red;" fill="blue"/></defs><rect style="stroke: red;" fill="blue"/></svg>',
quux: '<svg viewBox="0 0 200 200" aria-labelledby="titleId" role="img"><title id="titleId">A boxy shape</title><rect/></svg>',
corge: '<svg viewBox="0 0 200 200" aria-labelledby="titleId" role="img" preserveAspectRatio="xMinYMax" take-me-too="foo" count-me-out="bar">' +
'<title id="titleId">A boxy shape</title><rect/></svg>'
};
test('should create an svg document', async t => {
const store = svgstore();
const svg = store.toString();
t.is(svg.slice(0, 5), '<?xml');
});
test('should create an svg element', async t => {
const store = svgstore();
const svg = store.toString({inline: true});
t.is(svg.slice(0, 4), '<svg');
});
test('should combine svgs', async t => {
const store = svgstore()
.add('foo', doctype + FIXTURE_SVGS.foo)
.add('bar', doctype + FIXTURE_SVGS.bar);
const expected = doctype +
svgNs +
'<defs>' +
'<linear-gradient style="fill: red;"/>' +
'<radial-gradient style="stroke: red;"/>' +
'</defs>' +
'<symbol id="foo" viewBox="0 0 100 100"><path style="fill: red;"/></symbol>' +
'<symbol id="bar" viewBox="0 0 200 200"><rect style="stroke: red;"/></symbol>' +
'</svg>';
t.is(store.toString(), expected);
});
test('should clean defs', async t => {
const store = svgstore({cleanDefs: true})
.add('foo', doctype + FIXTURE_SVGS.foo)
.add('bar', doctype + FIXTURE_SVGS.bar)
.add('baz', doctype + FIXTURE_SVGS.baz, {
cleanDefs: []
})
.add('qux', doctype + FIXTURE_SVGS.qux, {
cleanDefs: ['fill']
});
const expected = doctype +
svgNs +
'<defs>' +
'<linear-gradient/><radial-gradient/>' +
'<linear-gradient style="fill: red;"/>' +
'<radial-gradient style="stroke: red;"/>' +
'</defs>' +
'<symbol id="foo" viewBox="0 0 100 100"><path style="fill: red;"/></symbol>' +
'<symbol id="bar" viewBox="0 0 200 200"><rect style="stroke: red;"/></symbol>' +
'<symbol id="baz" viewBox="0 0 200 200"><path style="fill: red;"/></symbol>' +
'<symbol id="qux" viewBox="0 0 200 200"><rect style="stroke: red;" fill="blue"/></symbol>' +
'</svg>';
t.is(store.toString(), expected);
});
test('should clean symbols', async t => {
const store = svgstore({cleanSymbols: true})
.add('foo', doctype + FIXTURE_SVGS.foo)
.add('bar', doctype + FIXTURE_SVGS.bar)
.add('baz', doctype + FIXTURE_SVGS.baz, {
cleanSymbols: []
})
.add('qux', doctype + FIXTURE_SVGS.qux, {
cleanSymbols: ['fill']
});
const expected = doctype +
svgNs +
'<defs>' +
'<linear-gradient style="fill: red;"/>' +
'<radial-gradient style="stroke: red;"/>' +
'<linear-gradient style="fill: red;"/>' +
'<radial-gradient style="stroke: red;" fill="blue"/>' +
'</defs>' +
'<symbol id="foo" viewBox="0 0 100 100"><path/></symbol>' +
'<symbol id="bar" viewBox="0 0 200 200"><rect/></symbol>' +
'<symbol id="baz" viewBox="0 0 200 200"><path style="fill: red;"/></symbol>' +
'<symbol id="qux" viewBox="0 0 200 200"><rect style="stroke: red;"/></symbol>' +
'</svg>';
t.is(store.toString(), expected);
});
test('should attempt to preserve the `viewBox`, `aria-labelledby`, and `role` attributes of the root SVG by default', async t => {
const store = svgstore()
.add('quux', FIXTURE_SVGS.quux);
const expected = doctype +
svgNs +
'<defs/>' +
'<symbol id="quux" viewBox="0 0 200 200" aria-labelledby="titleId" role="img">' +
'<title id="titleId">A boxy shape</title><rect/>' +
'</symbol>' +
'</svg>';
t.is(store.toString(), expected);
});
test('should support custom attribute preservation, on top of the defaults', async t => {
const copyAttrs = ['preserveAspectRatio', 'take-me-too', 'role'];
const store = svgstore({copyAttrs})
.add('corge', FIXTURE_SVGS.corge);
const expected = doctype +
svgNs +
'<defs/>' +
'<symbol id="corge" viewBox="0 0 200 200" aria-labelledby="titleId" role="img" preserveAspectRatio="xMinYMax" take-me-too="foo">' +
'<title id="titleId">A boxy shape</title><rect/>' +
'</symbol>' +
'</svg>';
t.is(store.toString(), expected);
});
test('should set symbol attributes', async t => {
const options = {
inline: true,
symbolAttrs: {
viewBox: null,
id: function (id) {
return 'icon-' + id;
}
}
};
const store = svgstore(options)
.add('foo', doctype + FIXTURE_SVGS.foo)
.add('bar', doctype + FIXTURE_SVGS.bar);
const expected = '<svg>' +
'<defs>' +
'<linear-gradient style="fill: red;"/>' +
'<radial-gradient style="stroke: red;"/>' +
'</defs>' +
'<symbol id="icon-foo"><path style="fill: red;"/></symbol>' +
'<symbol id="icon-bar"><rect style="stroke: red;"/></symbol>' +
'</svg>';
t.is(store.toString(), expected);
});
test('should set svg attributes', async t => {
const options = {
inline: true,
svgAttrs: {
id: 'spritesheet',
style: 'display: none'
}
};
const store = svgstore(options)
.add('foo', doctype + FIXTURE_SVGS.foo)
.add('bar', doctype + FIXTURE_SVGS.bar);
const expected = '<svg id="spritesheet" style="display: none">' +
'<defs>' +
'<linear-gradient style="fill: red;"/>' +
'<radial-gradient style="stroke: red;"/>' +
'</defs>' +
'<symbol id="foo" viewBox="0 0 100 100"><path style="fill: red;"/></symbol>' +
'<symbol id="bar" viewBox="0 0 200 200"><rect style="stroke: red;"/></symbol>' +
'</svg>';
t.is(store.toString(), expected);
});