svgedit-pl 7.3.6 → 7.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editor/Editor.js +2 -2
- package/dist/editor/Editor.js.map +1 -1
- package/dist/editor/extensions/ext-opensave/ext-opensave.js +1 -1
- package/dist/editor/extensions/ext-opensave/ext-opensave.js.map +1 -1
- package/dist/editor/extensions/ext-panning/ext-panning.js +1 -1
- package/dist/editor/extensions/ext-panning/ext-panning.js.map +1 -1
- package/dist/editor/extensions/ext-storage/ext-storage.js +1 -1
- package/dist/editor/extensions/ext-storage/ext-storage.js.map +1 -1
- package/dist/editor/iife-Editor.js +2 -2
- package/dist/editor/iife-Editor.js.map +1 -1
- package/dist/editor/xdomain-Editor.js +2 -2
- package/dist/editor/xdomain-Editor.js.map +1 -1
- package/docs/jsdoc/BottomPanel.html +1 -1
- package/docs/jsdoc/ConfigObj.js.html +11 -11
- package/docs/jsdoc/Dropdown.html +1 -1
- package/docs/jsdoc/Editor.js.html +54 -55
- package/docs/jsdoc/EditorStartup.html +5 -5
- package/docs/jsdoc/EditorStartup.js.html +12 -11
- package/docs/jsdoc/ElixMenuButton.html +1 -1
- package/docs/jsdoc/ElixNumberSpinBox.html +1 -1
- package/docs/jsdoc/ExplorerButton.html +1 -1
- package/docs/jsdoc/FlyingButton.html +1 -1
- package/docs/jsdoc/LayersPanel.html +1 -1
- package/docs/jsdoc/LeftPanel.html +1 -1
- package/docs/jsdoc/MainMenu.html +1 -1
- package/docs/jsdoc/MainMenu.js.html +12 -12
- package/docs/jsdoc/NumberSpinBox.html +1 -1
- package/docs/jsdoc/PaintBox.html +1 -1
- package/docs/jsdoc/PlainNumberSpinBox.html +1 -1
- package/docs/jsdoc/Rulers.html +1 -1
- package/docs/jsdoc/Rulers.js.html +1 -1
- package/docs/jsdoc/SEInput.html +1 -1
- package/docs/jsdoc/SEPalette.html +1 -1
- package/docs/jsdoc/SESpinInput.html +1 -1
- package/docs/jsdoc/SeCMenuDialog.html +1 -1
- package/docs/jsdoc/SeCMenuLayerDialog.html +1 -1
- package/docs/jsdoc/SeColorPicker.html +1 -1
- package/docs/jsdoc/SeEditPrefsDialog.html +1 -1
- package/docs/jsdoc/SeExportDialog.html +1 -1
- package/docs/jsdoc/SeImgPropDialog.html +1 -1
- package/docs/jsdoc/SeList.html +1 -1
- package/docs/jsdoc/SeMenu.html +1 -1
- package/docs/jsdoc/SeMenuItem.html +1 -1
- package/docs/jsdoc/SePlainAlertDialog.html +1 -1
- package/docs/jsdoc/SePlainBorderButton.html +1 -1
- package/docs/jsdoc/SePromptDialog.html +1 -1
- package/docs/jsdoc/SeStorageDialog.html +1 -1
- package/docs/jsdoc/SeSvgSourceEditorDialog.html +1 -1
- package/docs/jsdoc/SeText.html +1 -1
- package/docs/jsdoc/ToolButton.html +1 -1
- package/docs/jsdoc/TopPanel.html +1 -1
- package/docs/jsdoc/components_PaintBox.js.html +1 -1
- package/docs/jsdoc/components_jgraduate_ColorValuePicker.js.html +1 -1
- package/docs/jsdoc/components_jgraduate_Slider.js.html +1 -1
- package/docs/jsdoc/components_jgraduate_jQuery.jGraduate.js.html +1 -1
- package/docs/jsdoc/components_jgraduate_jQuery.jPicker.js.html +1 -1
- package/docs/jsdoc/components_seButton.js.html +1 -1
- package/docs/jsdoc/components_seColorPicker.js.html +1 -1
- package/docs/jsdoc/components_seDropdown.js.html +1 -1
- package/docs/jsdoc/components_seExplorerButton.js.html +1 -1
- package/docs/jsdoc/components_seFlyingButton.js.html +1 -1
- package/docs/jsdoc/components_seInput.js.html +1 -1
- package/docs/jsdoc/components_seList.js.html +1 -1
- package/docs/jsdoc/components_seListItem.js.html +1 -1
- package/docs/jsdoc/components_seMenu.js.html +1 -1
- package/docs/jsdoc/components_seMenuItem.js.html +1 -1
- package/docs/jsdoc/components_sePalette.js.html +1 -1
- package/docs/jsdoc/components_sePlainBorderButton.js.html +1 -1
- package/docs/jsdoc/components_sePlainMenuButton.js.html +1 -1
- package/docs/jsdoc/components_seSelect.js.html +1 -1
- package/docs/jsdoc/components_seSpinInput.js.html +1 -1
- package/docs/jsdoc/components_seText.js.html +1 -1
- package/docs/jsdoc/components_seZoom.js.html +1 -1
- package/docs/jsdoc/configObj.html +1 -1
- package/docs/jsdoc/contextmenu.js.html +1 -1
- package/docs/jsdoc/dialogs_SePlainAlertDialog.js.html +1 -1
- package/docs/jsdoc/dialogs_cmenuDialog.js.html +1 -1
- package/docs/jsdoc/dialogs_cmenuLayersDialog.js.html +1 -1
- package/docs/jsdoc/dialogs_editorPreferencesDialog.js.html +1 -1
- package/docs/jsdoc/dialogs_exportDialog.js.html +1 -1
- package/docs/jsdoc/dialogs_imagePropertiesDialog.js.html +1 -1
- package/docs/jsdoc/dialogs_se-elix_define_NumberSpinBox.js.html +1 -1
- package/docs/jsdoc/dialogs_se-elix_src_base_NumberSpinBox.js.html +1 -1
- package/docs/jsdoc/dialogs_se-elix_src_plain_PlainNumberSpinBox.js.html +1 -1
- package/docs/jsdoc/dialogs_sePromptDialog.js.html +1 -1
- package/docs/jsdoc/dialogs_svgSourceDialog.js.html +1 -1
- package/docs/jsdoc/extensions_ext-connector_ext-connector.js.html +1 -1
- package/docs/jsdoc/extensions_ext-eyedropper_ext-eyedropper.js.html +1 -1
- package/docs/jsdoc/extensions_ext-grid_ext-grid.js.html +1 -1
- package/docs/jsdoc/extensions_ext-helloworld_ext-helloworld.js.html +1 -1
- package/docs/jsdoc/extensions_ext-layer_view_ext-layer_view.js.html +1 -1
- package/docs/jsdoc/extensions_ext-markers_ext-markers.js.html +1 -1
- package/docs/jsdoc/extensions_ext-opensave_ext-opensave.js.html +5 -5
- package/docs/jsdoc/extensions_ext-overview_window_ext-overview_window.js.html +1 -1
- package/docs/jsdoc/extensions_ext-panning_ext-panning.js.html +6 -6
- package/docs/jsdoc/extensions_ext-polystar_ext-polystar.js.html +1 -1
- package/docs/jsdoc/extensions_ext-shapes_ext-shapes.js.html +1 -1
- package/docs/jsdoc/extensions_ext-storage_ext-storage.js.html +26 -7
- package/docs/jsdoc/extensions_ext-storage_storageDialog.js.html +8 -8
- package/docs/jsdoc/external-JamilihArray.html +1 -1
- package/docs/jsdoc/external-Math.html +1 -1
- package/docs/jsdoc/external-Window.html +1 -1
- package/docs/jsdoc/external-jQuery.fn.$.fn.jPicker.defaults.html +1 -1
- package/docs/jsdoc/external-jQuery.fn.exports.jPickerMethod.html +1 -1
- package/docs/jsdoc/external-jQuery.fn.html +1 -1
- package/docs/jsdoc/external-jQuery.fn.jGraduateDefaults.html +1 -1
- package/docs/jsdoc/external-jQuery.fn.jGraduateDefaults.images.html +1 -1
- package/docs/jsdoc/external-jQuery.fn.jGraduateDefaults.window.html +1 -1
- package/docs/jsdoc/external-jQuery.html +1 -1
- package/docs/jsdoc/external-jQuery.jGraduate.Paint.html +1 -1
- package/docs/jsdoc/external-jQuery.jGraduate.html +1 -1
- package/docs/jsdoc/external-jQuery.jPicker.Color.html +1 -1
- package/docs/jsdoc/external-jQuery.jPicker.ColorMethods.html +1 -1
- package/docs/jsdoc/external-jQuery.jPicker.html +1 -1
- package/docs/jsdoc/global.html +1 -1
- package/docs/jsdoc/index.html +1 -1
- package/docs/jsdoc/locale.js.html +1 -1
- package/docs/jsdoc/module-SVGEditor-Editor.html +30 -30
- package/docs/jsdoc/module-SVGEditor.Config.html +1 -1
- package/docs/jsdoc/module-SVGEditor.Prefs.html +1 -1
- package/docs/jsdoc/module-SVGEditor.html +3 -3
- package/docs/jsdoc/module-SVGthis.CustomHandler.html +1 -1
- package/docs/jsdoc/module-contextmenu.html +1 -1
- package/docs/jsdoc/module-jGraduate.html +1 -1
- package/docs/jsdoc/module-jPicker.html +1 -1
- package/docs/jsdoc/module-jPicker.module.exports.html +1 -1
- package/docs/jsdoc/module-locale.LocaleEditorInit.html +1 -1
- package/docs/jsdoc/module-locale.html +1 -1
- package/docs/jsdoc/module.exports.html +1 -1
- package/docs/jsdoc/module.exports_module.exports.html +1 -1
- package/docs/jsdoc/panels_BottomPanel.js.html +1 -1
- package/docs/jsdoc/panels_LayersPanel.js.html +1 -1
- package/docs/jsdoc/panels_LeftPanel.js.html +1 -1
- package/docs/jsdoc/panels_TopPanel.js.html +1 -1
- package/docs/jsdoc/tutorial-CanvasAPI.html +1 -1
- package/docs/jsdoc/tutorial-ConfigOptions.html +1 -1
- package/docs/jsdoc/tutorial-Editor.html +1 -1
- package/docs/jsdoc/tutorial-EditorAPI.html +1 -1
- package/docs/jsdoc/tutorial-Events.html +1 -1
- package/docs/jsdoc/tutorial-ExtensionDocs.html +1 -1
- package/docs/jsdoc/tutorial-FrequentlyAskedQuestions.html +1 -1
- package/docs/jsdoc/tutorial-LocaleDocs.html +1 -1
- package/docs/jsdoc/typedefs.js.html +1 -1
- package/package.json +1 -1
- package/src/editor/ConfigObj.js +10 -10
- package/src/editor/Editor.js +53 -54
- package/src/editor/EditorStartup.js +11 -10
- package/src/editor/MainMenu.js +11 -11
- package/src/editor/extensions/ext-opensave/ext-opensave.js +4 -4
- package/src/editor/extensions/ext-panning/ext-panning.js +5 -5
- package/src/editor/extensions/ext-storage/ext-storage.js +25 -6
- package/src/editor/extensions/ext-storage/storageDialog.js +7 -7
- package/src/editor/panels/TopPanel.html +1 -1
|
@@ -1133,7 +1133,7 @@ value as a string.</a></li><li><a href="global.html#get">get</a></li><li><a href
|
|
|
1133
1133
|
<br class="clear">
|
|
1134
1134
|
|
|
1135
1135
|
<footer>
|
|
1136
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
|
1136
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Wed Jan 15 2025 12:33:56 GMT+0100 (czas środkowoeuropejski standardowy)
|
|
1137
1137
|
</footer>
|
|
1138
1138
|
|
|
1139
1139
|
<script> prettyPrint(); </script>
|
|
@@ -45,7 +45,7 @@ export default class ConfigObj {
|
|
|
45
45
|
/**
|
|
46
46
|
* @param {PlainObject} editor
|
|
47
47
|
*/
|
|
48
|
-
constructor
|
|
48
|
+
constructor(editor) {
|
|
49
49
|
/**
|
|
50
50
|
* Preferences.
|
|
51
51
|
* @interface module:SVGEditor.Prefs
|
|
@@ -245,7 +245,7 @@ export default class ConfigObj {
|
|
|
245
245
|
* @function setupCurPrefs
|
|
246
246
|
* @returns {void}
|
|
247
247
|
*/
|
|
248
|
-
setupCurPrefs
|
|
248
|
+
setupCurPrefs() {
|
|
249
249
|
const curPrefs = { ...this.defaultPrefs, ...this.curPrefs } // Now safe to merge with priority for curPrefs in the event any are already set
|
|
250
250
|
// Export updated prefs
|
|
251
251
|
this.curPrefs = curPrefs
|
|
@@ -255,7 +255,7 @@ export default class ConfigObj {
|
|
|
255
255
|
* Sets up current config based on defaults.
|
|
256
256
|
* @returns {void}
|
|
257
257
|
*/
|
|
258
|
-
setupCurConfig
|
|
258
|
+
setupCurConfig() {
|
|
259
259
|
const curConfig = { ...this.defaultConfig, ...this.curConfig } // Now safe to merge with priority for curConfig in the event any are already set
|
|
260
260
|
|
|
261
261
|
// Now deal with extensions and other array config
|
|
@@ -270,7 +270,7 @@ export default class ConfigObj {
|
|
|
270
270
|
* @function loadFromURL Load config/data from URL if given
|
|
271
271
|
* @returns {void}
|
|
272
272
|
*/
|
|
273
|
-
loadFromURL
|
|
273
|
+
loadFromURL() {
|
|
274
274
|
const self = this
|
|
275
275
|
const { search, searchParams } = new URL(location)
|
|
276
276
|
if (search) {
|
|
@@ -365,10 +365,10 @@ export default class ConfigObj {
|
|
|
365
365
|
* that, it will then be subject to tampering
|
|
366
366
|
* @returns {void}
|
|
367
367
|
*/
|
|
368
|
-
loadContentAndPrefs
|
|
368
|
+
loadContentAndPrefs() {
|
|
369
369
|
if (!this.curConfig.forceStorage &&
|
|
370
370
|
(this.curConfig.noStorageOnLoad ||
|
|
371
|
-
|
|
371
|
+
!(/(?:^|;\s*)svgeditstore=(?:prefsAndContent|prefsOnly)/).test(document.cookie)
|
|
372
372
|
)
|
|
373
373
|
) {
|
|
374
374
|
return
|
|
@@ -416,7 +416,7 @@ export default class ConfigObj {
|
|
|
416
416
|
* not be needed in `svgedit-config-iife.js`.
|
|
417
417
|
* @returns {void}
|
|
418
418
|
*/
|
|
419
|
-
setConfig
|
|
419
|
+
setConfig(opts, cfgCfg = {}) {
|
|
420
420
|
/**
|
|
421
421
|
*
|
|
422
422
|
* @param {module:SVGEditor.Config|module:SVGEditor.Prefs} cfgObj
|
|
@@ -456,7 +456,7 @@ export default class ConfigObj {
|
|
|
456
456
|
return
|
|
457
457
|
}
|
|
458
458
|
this.curConfig[key] = this.curConfig[key].concat(val) // We will handle any dupes later
|
|
459
|
-
|
|
459
|
+
// Only allow other configObj.curConfig if defined in configObj.defaultConfig
|
|
460
460
|
} else if ({}.hasOwnProperty.call(this.defaultConfig, key)) {
|
|
461
461
|
if (cfgCfg.overwrite === false && (
|
|
462
462
|
this.curConfig.preventAllURLConfig ||
|
|
@@ -498,7 +498,7 @@ export default class ConfigObj {
|
|
|
498
498
|
* button to auto-calculate background, but otherwise uses `svgEditor.configObj.pref()` to
|
|
499
499
|
* be able to get default prefs or overridable settings
|
|
500
500
|
*/
|
|
501
|
-
pref
|
|
501
|
+
pref(key, val, mayBeEmpty) {
|
|
502
502
|
if (mayBeEmpty || val) {
|
|
503
503
|
this.curPrefs[key] = val
|
|
504
504
|
return undefined
|
|
@@ -510,7 +510,7 @@ export default class ConfigObj {
|
|
|
510
510
|
* @function load load Config
|
|
511
511
|
* @returns {void}
|
|
512
512
|
*/
|
|
513
|
-
load
|
|
513
|
+
load() {
|
|
514
514
|
this.loadFromURL(this.editor)
|
|
515
515
|
this.setupCurPrefs(this.editor)
|
|
516
516
|
}
|
|
@@ -535,7 +535,7 @@ value as a string.</a></li><li><a href="global.html#get">get</a></li><li><a href
|
|
|
535
535
|
<br class="clear">
|
|
536
536
|
|
|
537
537
|
<footer>
|
|
538
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
|
538
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Wed Jan 15 2025 12:33:55 GMT+0100 (czas środkowoeuropejski standardowy)
|
|
539
539
|
</footer>
|
|
540
540
|
|
|
541
541
|
<script> prettyPrint(); </script>
|
package/docs/jsdoc/Dropdown.html
CHANGED
|
@@ -161,7 +161,7 @@ value as a string.</a></li><li><a href="global.html#get">get</a></li><li><a href
|
|
|
161
161
|
<br class="clear">
|
|
162
162
|
|
|
163
163
|
<footer>
|
|
164
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
|
164
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Wed Jan 15 2025 12:33:56 GMT+0100 (czas środkowoeuropejski standardowy)
|
|
165
165
|
</footer>
|
|
166
166
|
|
|
167
167
|
<script> prettyPrint(); </script>
|
|
@@ -65,7 +65,7 @@ class Editor extends EditorStartup {
|
|
|
65
65
|
/**
|
|
66
66
|
*
|
|
67
67
|
*/
|
|
68
|
-
constructor
|
|
68
|
+
constructor(div = null) {
|
|
69
69
|
super(div)
|
|
70
70
|
/**
|
|
71
71
|
* @type {boolean}
|
|
@@ -83,7 +83,7 @@ class Editor extends EditorStartup {
|
|
|
83
83
|
/**
|
|
84
84
|
* document title
|
|
85
85
|
*/
|
|
86
|
-
this.title = '
|
|
86
|
+
this.title = 'bez_tytulu.svg'
|
|
87
87
|
|
|
88
88
|
this.svgCanvas = null
|
|
89
89
|
this.$click = $click
|
|
@@ -360,7 +360,7 @@ class Editor extends EditorStartup {
|
|
|
360
360
|
* @throws {Error} Upon failure to load SVG
|
|
361
361
|
* @returns {void}
|
|
362
362
|
*/
|
|
363
|
-
loadSvgString
|
|
363
|
+
loadSvgString(str, { noAlert } = {}) {
|
|
364
364
|
const success = this.svgCanvas.setSvgString(str) !== false
|
|
365
365
|
if (success) {
|
|
366
366
|
this.updateCanvas()
|
|
@@ -421,7 +421,7 @@ class Editor extends EditorStartup {
|
|
|
421
421
|
* @param {boolean} arg
|
|
422
422
|
* @returns {void}
|
|
423
423
|
*/
|
|
424
|
-
randomizeIds
|
|
424
|
+
randomizeIds(arg) {
|
|
425
425
|
this.svgCanvas.randomizeIds(arg)
|
|
426
426
|
}
|
|
427
427
|
|
|
@@ -431,7 +431,7 @@ class Editor extends EditorStartup {
|
|
|
431
431
|
* editor shortcuts init
|
|
432
432
|
* @returns {void}
|
|
433
433
|
*/
|
|
434
|
-
setAll
|
|
434
|
+
setAll() {
|
|
435
435
|
const keyHandler = {} // will contain the action for each pressed key
|
|
436
436
|
|
|
437
437
|
this.shortcuts.forEach((shortcut) => {
|
|
@@ -459,9 +459,8 @@ class Editor extends EditorStartup {
|
|
|
459
459
|
// only track keyboard shortcuts for the body containing the SVG-Editor
|
|
460
460
|
if (e.target.nodeName !== 'BODY') return
|
|
461
461
|
// normalize key
|
|
462
|
-
const key = `${e.altKey ? 'alt+' : ''}${e.shiftKey ? 'shift+' : ''}${
|
|
463
|
-
e.
|
|
464
|
-
}${e.ctrlKey ? 'ctrl+' : ''}${e.key.toLowerCase()}`
|
|
462
|
+
const key = `${e.altKey ? 'alt+' : ''}${e.shiftKey ? 'shift+' : ''}${e.metaKey ? 'meta+' : ''
|
|
463
|
+
}${e.ctrlKey ? 'ctrl+' : ''}${e.key.toLowerCase()}`
|
|
465
464
|
// return if no shortcut defined for this key
|
|
466
465
|
if (!keyHandler[key]) return
|
|
467
466
|
// launch associated handler and preventDefault if necessary
|
|
@@ -488,7 +487,7 @@ class Editor extends EditorStartup {
|
|
|
488
487
|
}
|
|
489
488
|
|
|
490
489
|
// parents() https://stackoverflow.com/a/12981248
|
|
491
|
-
getParents
|
|
490
|
+
getParents(el, parentSelector /* optional */) {
|
|
492
491
|
// If no parentSelector defined will bubble up all the way to *document*
|
|
493
492
|
if (parentSelector === undefined) {
|
|
494
493
|
parentSelector = document
|
|
@@ -511,7 +510,7 @@ class Editor extends EditorStartup {
|
|
|
511
510
|
* @param {string} sel Selector to match
|
|
512
511
|
* @returns {module:SVGthis.ToolButton}
|
|
513
512
|
*/
|
|
514
|
-
getButtonData
|
|
513
|
+
getButtonData(sel) {
|
|
515
514
|
return Object.values(this.shortcuts).find((btn) => {
|
|
516
515
|
return btn.sel === sel
|
|
517
516
|
})
|
|
@@ -523,7 +522,7 @@ class Editor extends EditorStartup {
|
|
|
523
522
|
* @listens module:svgcanvas.SvgCanvas#event:exported
|
|
524
523
|
* @returns {void}
|
|
525
524
|
*/
|
|
526
|
-
exportHandler
|
|
525
|
+
exportHandler(win, data) {
|
|
527
526
|
const { issues, exportWindowName } = data
|
|
528
527
|
this.exportWindow = window.open('', exportWindowName) // A hack to get the window via JSON-able name without opening a new one
|
|
529
528
|
if (!this.exportWindow || this.exportWindow.closed) {
|
|
@@ -560,7 +559,7 @@ class Editor extends EditorStartup {
|
|
|
560
559
|
* @param {string} url
|
|
561
560
|
* @returns {void}
|
|
562
561
|
*/
|
|
563
|
-
setBackground
|
|
562
|
+
setBackground(color, url) {
|
|
564
563
|
// if (color == this.configObj.pref('bkgd_color') && url == this.configObj.pref('bkgd_url')) { return; }
|
|
565
564
|
this.configObj.pref('bkgd_color', color)
|
|
566
565
|
this.configObj.pref('bkgd_url', url, true)
|
|
@@ -575,7 +574,7 @@ class Editor extends EditorStartup {
|
|
|
575
574
|
* @param {module:math.XYObject} newCtr
|
|
576
575
|
* @returns {void}
|
|
577
576
|
*/
|
|
578
|
-
updateCanvas
|
|
577
|
+
updateCanvas(center, newCtr) {
|
|
579
578
|
const zoom = this.svgCanvas.getZoom()
|
|
580
579
|
const { workarea } = this
|
|
581
580
|
const cnvs = $id('svgcanvas')
|
|
@@ -669,7 +668,7 @@ class Editor extends EditorStartup {
|
|
|
669
668
|
*
|
|
670
669
|
* @returns {void}
|
|
671
670
|
*/
|
|
672
|
-
updateWireFrame
|
|
671
|
+
updateWireFrame() {
|
|
673
672
|
const rule = `
|
|
674
673
|
#workarea.wireframe #svgcontent * {
|
|
675
674
|
stroke-width: ${1 / this.svgCanvas.getZoom()}px;
|
|
@@ -690,7 +689,7 @@ class Editor extends EditorStartup {
|
|
|
690
689
|
* @fires module:svgcanvas.SvgCanvas#event:ext_selectedChanged
|
|
691
690
|
* @returns {void}
|
|
692
691
|
*/
|
|
693
|
-
selectedChanged
|
|
692
|
+
selectedChanged(win, elems) {
|
|
694
693
|
const mode = this.svgCanvas.getMode()
|
|
695
694
|
if (mode === 'select') {
|
|
696
695
|
this.leftPanel.clickSelect()
|
|
@@ -725,7 +724,7 @@ class Editor extends EditorStartup {
|
|
|
725
724
|
* @fires module:svgcanvas.SvgCanvas#event:ext_elementTransition
|
|
726
725
|
* @returns {void}
|
|
727
726
|
*/
|
|
728
|
-
elementTransition
|
|
727
|
+
elementTransition(win, elems) {
|
|
729
728
|
const mode = this.svgCanvas.getMode()
|
|
730
729
|
const elem = elems[0]
|
|
731
730
|
|
|
@@ -763,7 +762,7 @@ class Editor extends EditorStartup {
|
|
|
763
762
|
* @fires module:svgcanvas.SvgCanvas#event:ext_elementChanged
|
|
764
763
|
* @returns {void}
|
|
765
764
|
*/
|
|
766
|
-
elementChanged
|
|
765
|
+
elementChanged(win, elems) {
|
|
767
766
|
const mode = this.svgCanvas.getMode()
|
|
768
767
|
if (mode === 'select') {
|
|
769
768
|
this.leftPanel.clickSelect()
|
|
@@ -811,7 +810,7 @@ class Editor extends EditorStartup {
|
|
|
811
810
|
/**
|
|
812
811
|
* @returns {void}
|
|
813
812
|
*/
|
|
814
|
-
elementRenamed
|
|
813
|
+
elementRenamed(win, renameObj) {
|
|
815
814
|
this.svgCanvas.runExtensions(
|
|
816
815
|
'elementRenamed',
|
|
817
816
|
/** @type {module:svgcanvas.SvgCanvas#event:ext_elementRenamed} */ {
|
|
@@ -823,21 +822,21 @@ class Editor extends EditorStartup {
|
|
|
823
822
|
/**
|
|
824
823
|
* @returns {void}
|
|
825
824
|
*/
|
|
826
|
-
afterClear
|
|
825
|
+
afterClear(win) {
|
|
827
826
|
this.svgCanvas.runExtensions('afterClear')
|
|
828
827
|
}
|
|
829
828
|
|
|
830
829
|
/**
|
|
831
830
|
* @returns {void}
|
|
832
831
|
*/
|
|
833
|
-
beforeClear
|
|
832
|
+
beforeClear(win) {
|
|
834
833
|
this.svgCanvas.runExtensions('beforeClear')
|
|
835
834
|
}
|
|
836
835
|
|
|
837
836
|
/**
|
|
838
837
|
* @returns {void}
|
|
839
838
|
*/
|
|
840
|
-
zoomDone
|
|
839
|
+
zoomDone() {
|
|
841
840
|
for (const el of this.svgCanvas.selectedElements) {
|
|
842
841
|
this.svgCanvas.selectorManager.requestSelector(el).resize()
|
|
843
842
|
}
|
|
@@ -864,7 +863,7 @@ class Editor extends EditorStartup {
|
|
|
864
863
|
* @fires module:svgcanvas.SvgCanvas#event:ext_zoomChanged
|
|
865
864
|
* @returns {void}
|
|
866
865
|
*/
|
|
867
|
-
zoomChanged
|
|
866
|
+
zoomChanged(win, bbox, autoCenter) {
|
|
868
867
|
const scrbar = 15
|
|
869
868
|
const zInfo = this.svgCanvas.setBBoxZoom(
|
|
870
869
|
bbox,
|
|
@@ -916,7 +915,7 @@ class Editor extends EditorStartup {
|
|
|
916
915
|
* @listens module:svgcanvas.SvgCanvas#event:contextset
|
|
917
916
|
* @returns {void}
|
|
918
917
|
*/
|
|
919
|
-
contextChanged
|
|
918
|
+
contextChanged(win, context) {
|
|
920
919
|
let linkStr = ''
|
|
921
920
|
if (context) {
|
|
922
921
|
let str = ''
|
|
@@ -949,7 +948,7 @@ class Editor extends EditorStartup {
|
|
|
949
948
|
* @param {string|external:jQuery} iconId
|
|
950
949
|
* @returns {void}
|
|
951
950
|
*/
|
|
952
|
-
setIcon
|
|
951
|
+
setIcon(elem, iconId) {
|
|
953
952
|
const img = document.createElement('img')
|
|
954
953
|
img.src = this.configObj.curConfig.imgPath + iconId
|
|
955
954
|
const icon = typeof iconId === 'string' ? img : iconId.cloneNode(true)
|
|
@@ -971,7 +970,7 @@ class Editor extends EditorStartup {
|
|
|
971
970
|
* @listens module:svgcanvas.SvgCanvas#event:extension_added
|
|
972
971
|
* @returns {Promise<void>|void} Resolves to `undefined`
|
|
973
972
|
*/
|
|
974
|
-
async extAdded
|
|
973
|
+
async extAdded(win, ext) {
|
|
975
974
|
if (!ext) {
|
|
976
975
|
return undefined
|
|
977
976
|
}
|
|
@@ -998,7 +997,7 @@ class Editor extends EditorStartup {
|
|
|
998
997
|
* @param {Float} multiplier
|
|
999
998
|
* @returns {void}
|
|
1000
999
|
*/
|
|
1001
|
-
zoomImage
|
|
1000
|
+
zoomImage(multiplier) {
|
|
1002
1001
|
const resolution = this.svgCanvas.getResolution()
|
|
1003
1002
|
multiplier = multiplier ? resolution.zoom * multiplier : 1
|
|
1004
1003
|
// setResolution(res.w * multiplier, res.h * multiplier, true);
|
|
@@ -1012,7 +1011,7 @@ class Editor extends EditorStartup {
|
|
|
1012
1011
|
*
|
|
1013
1012
|
* @returns {void}
|
|
1014
1013
|
*/
|
|
1015
|
-
cutSelected
|
|
1014
|
+
cutSelected() {
|
|
1016
1015
|
if (this.selectedElement || this.multiselected) {
|
|
1017
1016
|
this.svgCanvas.cutSelectedElements()
|
|
1018
1017
|
}
|
|
@@ -1022,7 +1021,7 @@ class Editor extends EditorStartup {
|
|
|
1022
1021
|
* @function copySelected
|
|
1023
1022
|
* @returns {void}
|
|
1024
1023
|
*/
|
|
1025
|
-
copySelected
|
|
1024
|
+
copySelected() {
|
|
1026
1025
|
if (this.selectedElement || this.multiselected) {
|
|
1027
1026
|
this.svgCanvas.copySelectedElements()
|
|
1028
1027
|
}
|
|
@@ -1032,20 +1031,20 @@ class Editor extends EditorStartup {
|
|
|
1032
1031
|
*
|
|
1033
1032
|
* @returns {void}
|
|
1034
1033
|
*/
|
|
1035
|
-
pasteInCenter
|
|
1034
|
+
pasteInCenter() {
|
|
1036
1035
|
const { workarea } = this
|
|
1037
1036
|
const zoom = this.svgCanvas.getZoom()
|
|
1038
1037
|
const x =
|
|
1039
1038
|
(workarea.scrollLeft +
|
|
1040
1039
|
parseFloat(getComputedStyle(workarea, null).width.replace('px', '')) /
|
|
1041
|
-
|
|
1042
|
-
|
|
1040
|
+
2) /
|
|
1041
|
+
zoom -
|
|
1043
1042
|
this.svgCanvas.contentW
|
|
1044
1043
|
const y =
|
|
1045
1044
|
(workarea.scrollTop +
|
|
1046
1045
|
parseFloat(getComputedStyle(workarea, null).height.replace('px', '')) /
|
|
1047
|
-
|
|
1048
|
-
|
|
1046
|
+
2) /
|
|
1047
|
+
zoom -
|
|
1049
1048
|
this.svgCanvas.contentH
|
|
1050
1049
|
this.svgCanvas.pasteElements('point', x, y)
|
|
1051
1050
|
}
|
|
@@ -1054,7 +1053,7 @@ class Editor extends EditorStartup {
|
|
|
1054
1053
|
* @param {"Up"|"Down"} dir
|
|
1055
1054
|
* @returns {void}
|
|
1056
1055
|
*/
|
|
1057
|
-
moveUpDownSelected
|
|
1056
|
+
moveUpDownSelected(dir) {
|
|
1058
1057
|
if (this.selectedElement) {
|
|
1059
1058
|
this.svgCanvas.moveUpDownSelected(dir)
|
|
1060
1059
|
}
|
|
@@ -1065,7 +1064,7 @@ class Editor extends EditorStartup {
|
|
|
1065
1064
|
* @param {Float} dy
|
|
1066
1065
|
* @returns {void}
|
|
1067
1066
|
*/
|
|
1068
|
-
moveSelected
|
|
1067
|
+
moveSelected(dx, dy) {
|
|
1069
1068
|
if (this.selectedElement || this.multiselected) {
|
|
1070
1069
|
if (this.configObj.curConfig.gridSnapping) {
|
|
1071
1070
|
// Use grid snap value regardless of zoom level
|
|
@@ -1082,7 +1081,7 @@ class Editor extends EditorStartup {
|
|
|
1082
1081
|
*
|
|
1083
1082
|
* @returns {void}
|
|
1084
1083
|
*/
|
|
1085
|
-
selectNext
|
|
1084
|
+
selectNext() {
|
|
1086
1085
|
this.svgCanvas.cycleElement(1)
|
|
1087
1086
|
}
|
|
1088
1087
|
|
|
@@ -1090,7 +1089,7 @@ class Editor extends EditorStartup {
|
|
|
1090
1089
|
*
|
|
1091
1090
|
* @returns {void}
|
|
1092
1091
|
*/
|
|
1093
|
-
selectPrev
|
|
1092
|
+
selectPrev() {
|
|
1094
1093
|
this.svgCanvas.cycleElement(0)
|
|
1095
1094
|
}
|
|
1096
1095
|
|
|
@@ -1099,7 +1098,7 @@ class Editor extends EditorStartup {
|
|
|
1099
1098
|
* @param {Integer} step
|
|
1100
1099
|
* @returns {void}
|
|
1101
1100
|
*/
|
|
1102
|
-
rotateSelected
|
|
1101
|
+
rotateSelected(cw, step) {
|
|
1103
1102
|
if (!this.selectedElement || this.multiselected) {
|
|
1104
1103
|
return
|
|
1105
1104
|
}
|
|
@@ -1115,7 +1114,7 @@ class Editor extends EditorStartup {
|
|
|
1115
1114
|
*
|
|
1116
1115
|
* @returns {void}
|
|
1117
1116
|
*/
|
|
1118
|
-
hideSourceEditor
|
|
1117
|
+
hideSourceEditor() {
|
|
1119
1118
|
const $editorDialog = $id('se-svg-editor-dialog')
|
|
1120
1119
|
$editorDialog.setAttribute('dialog', 'closed')
|
|
1121
1120
|
}
|
|
@@ -1124,7 +1123,7 @@ class Editor extends EditorStartup {
|
|
|
1124
1123
|
* @param {Event} e
|
|
1125
1124
|
* @returns {void} Resolves to `undefined`
|
|
1126
1125
|
*/
|
|
1127
|
-
async saveSourceEditor
|
|
1126
|
+
async saveSourceEditor(e) {
|
|
1128
1127
|
const $editorDialog = $id('se-svg-editor-dialog')
|
|
1129
1128
|
if ($editorDialog.getAttribute('dialog') !== 'open') return
|
|
1130
1129
|
const saveChanges = () => {
|
|
@@ -1152,7 +1151,7 @@ class Editor extends EditorStartup {
|
|
|
1152
1151
|
* @param {Event} e
|
|
1153
1152
|
* @returns {void} Resolves to `undefined`
|
|
1154
1153
|
*/
|
|
1155
|
-
cancelOverlays
|
|
1154
|
+
cancelOverlays(e) {
|
|
1156
1155
|
if ($id('dialog_box') != null) $id('dialog_box').style.display = 'none'
|
|
1157
1156
|
const $editorDialog = $id('se-svg-editor-dialog')
|
|
1158
1157
|
const editingsource = $editorDialog.getAttribute('dialog') === 'open'
|
|
@@ -1181,7 +1180,7 @@ class Editor extends EditorStartup {
|
|
|
1181
1180
|
/**
|
|
1182
1181
|
* @returns {void}
|
|
1183
1182
|
*/
|
|
1184
|
-
toggleDynamicOutput
|
|
1183
|
+
toggleDynamicOutput(e) {
|
|
1185
1184
|
this.configObj.curConfig.dynamicOutput = e.detail.dynamic
|
|
1186
1185
|
this.svgCanvas.setConfig(this.configObj.curConfig)
|
|
1187
1186
|
const $editorDialog = document.getElementById('se-svg-editor-dialog')
|
|
@@ -1193,7 +1192,7 @@ class Editor extends EditorStartup {
|
|
|
1193
1192
|
/**
|
|
1194
1193
|
* @returns {void}
|
|
1195
1194
|
*/
|
|
1196
|
-
enableOrDisableClipboard
|
|
1195
|
+
enableOrDisableClipboard() {
|
|
1197
1196
|
let svgeditClipboard
|
|
1198
1197
|
try {
|
|
1199
1198
|
svgeditClipboard = this.localStorage.getItem('svgedit_clipboard')
|
|
@@ -1211,7 +1210,7 @@ class Editor extends EditorStartup {
|
|
|
1211
1210
|
* @returns {boolean|Promise<boolean>} Resolves to boolean indicating `true` if there were no changes
|
|
1212
1211
|
* and `false` after the user confirms.
|
|
1213
1212
|
*/
|
|
1214
|
-
async openPrep
|
|
1213
|
+
async openPrep() {
|
|
1215
1214
|
if (this.svgCanvas.undoMgr.getUndoStackSize() === 0) {
|
|
1216
1215
|
return true
|
|
1217
1216
|
}
|
|
@@ -1223,7 +1222,7 @@ class Editor extends EditorStartup {
|
|
|
1223
1222
|
* @param {Event} e
|
|
1224
1223
|
* @returns {void}
|
|
1225
1224
|
*/
|
|
1226
|
-
onDragEnter
|
|
1225
|
+
onDragEnter(e) {
|
|
1227
1226
|
e.stopPropagation()
|
|
1228
1227
|
e.preventDefault()
|
|
1229
1228
|
// and indicator should be displayed here, such as "drop files here"
|
|
@@ -1234,7 +1233,7 @@ class Editor extends EditorStartup {
|
|
|
1234
1233
|
* @param {Event} e
|
|
1235
1234
|
* @returns {void}
|
|
1236
1235
|
*/
|
|
1237
|
-
onDragOver
|
|
1236
|
+
onDragOver(e) {
|
|
1238
1237
|
e.stopPropagation()
|
|
1239
1238
|
e.preventDefault()
|
|
1240
1239
|
}
|
|
@@ -1244,7 +1243,7 @@ class Editor extends EditorStartup {
|
|
|
1244
1243
|
* @param {Event} e
|
|
1245
1244
|
* @returns {void}
|
|
1246
1245
|
*/
|
|
1247
|
-
onDragLeave
|
|
1246
|
+
onDragLeave(e) {
|
|
1248
1247
|
e.stopPropagation()
|
|
1249
1248
|
e.preventDefault()
|
|
1250
1249
|
// hypothetical indicator should be removed here
|
|
@@ -1258,7 +1257,7 @@ class Editor extends EditorStartup {
|
|
|
1258
1257
|
* @fires module:svgcanvas.SvgCanvas#event:ext_langChanged
|
|
1259
1258
|
* @returns {void} A Promise which resolves to `undefined`
|
|
1260
1259
|
*/
|
|
1261
|
-
setLang
|
|
1260
|
+
setLang(lang) {
|
|
1262
1261
|
this.langChanged = true
|
|
1263
1262
|
this.configObj.pref('lang', lang)
|
|
1264
1263
|
const $editDialog = $id('se-edit-prefs')
|
|
@@ -1296,7 +1295,7 @@ class Editor extends EditorStartup {
|
|
|
1296
1295
|
* @param {module:SVGthis.ReadyCallback} cb Callback to be queued to invoke
|
|
1297
1296
|
* @returns {Promise<ArbitraryCallbackResult>} Resolves when all callbacks, including the supplied have resolved
|
|
1298
1297
|
*/
|
|
1299
|
-
ready
|
|
1298
|
+
ready(cb) {
|
|
1300
1299
|
return new Promise((resolve, reject) => {
|
|
1301
1300
|
if (this.isReady) {
|
|
1302
1301
|
resolve(cb())
|
|
@@ -1311,7 +1310,7 @@ class Editor extends EditorStartup {
|
|
|
1311
1310
|
* @function module:SVGthis.runCallbacks
|
|
1312
1311
|
* @returns {Promise<void>} Resolves to `undefined` if all callbacks succeeded and rejects otherwise
|
|
1313
1312
|
*/
|
|
1314
|
-
async runCallbacks
|
|
1313
|
+
async runCallbacks() {
|
|
1315
1314
|
try {
|
|
1316
1315
|
await Promise.all(
|
|
1317
1316
|
this.callbacks.map(([cb]) => {
|
|
@@ -1337,7 +1336,7 @@ class Editor extends EditorStartup {
|
|
|
1337
1336
|
* @param {boolean} [opts.noAlert=false] Option to avoid alert to user and instead get rejected promise
|
|
1338
1337
|
* @returns {Promise<void>}
|
|
1339
1338
|
*/
|
|
1340
|
-
loadFromString
|
|
1339
|
+
loadFromString(str, { noAlert } = {}) {
|
|
1341
1340
|
return this.ready(async () => {
|
|
1342
1341
|
try {
|
|
1343
1342
|
await this.loadSvgString(str, { noAlert })
|
|
@@ -1364,7 +1363,7 @@ class Editor extends EditorStartup {
|
|
|
1364
1363
|
* the SVG (or upon failure to parse the loaded string) when `noAlert` is
|
|
1365
1364
|
* enabled
|
|
1366
1365
|
*/
|
|
1367
|
-
loadFromURL
|
|
1366
|
+
loadFromURL(url, { cache, noAlert } = {}) {
|
|
1368
1367
|
return this.ready(() => {
|
|
1369
1368
|
return new Promise((resolve, reject) => {
|
|
1370
1369
|
fetch(url, { cache: cache ? 'force-cache' : 'no-cache' })
|
|
@@ -1404,7 +1403,7 @@ class Editor extends EditorStartup {
|
|
|
1404
1403
|
* @param {boolean} [opts.noAlert]
|
|
1405
1404
|
* @returns {Promise<void>} Resolves to `undefined` and rejects if loading SVG string fails and `noAlert` is enabled
|
|
1406
1405
|
*/
|
|
1407
|
-
loadFromDataURI
|
|
1406
|
+
loadFromDataURI(str, { noAlert } = {}) {
|
|
1408
1407
|
return this.ready(() => {
|
|
1409
1408
|
let base64 = false
|
|
1410
1409
|
let pre = str.match(/^data:image\/svg\+xml;base64,/)
|
|
@@ -1432,7 +1431,7 @@ class Editor extends EditorStartup {
|
|
|
1432
1431
|
* @throws {Error} If called too early
|
|
1433
1432
|
* @returns {Promise<void>} Resolves to `undefined`
|
|
1434
1433
|
*/
|
|
1435
|
-
addExtension
|
|
1434
|
+
addExtension(name, initfn, initArgs) {
|
|
1436
1435
|
// Note that we don't want this on this.ready since some extensions
|
|
1437
1436
|
// may want to run before then (like server_opensave).
|
|
1438
1437
|
if (!this.svgCanvas) {
|
|
@@ -1463,7 +1462,7 @@ value as a string.</a></li><li><a href="global.html#get">get</a></li><li><a href
|
|
|
1463
1462
|
<br class="clear">
|
|
1464
1463
|
|
|
1465
1464
|
<footer>
|
|
1466
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
|
1465
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Wed Jan 15 2025 12:33:55 GMT+0100 (czas środkowoeuropejski standardowy)
|
|
1467
1466
|
</footer>
|
|
1468
1467
|
|
|
1469
1468
|
<script> prettyPrint(); </script>
|
|
@@ -264,7 +264,7 @@ disables on dragging (mousedown) to avoid changing mode in the middle of drawing
|
|
|
264
264
|
|
|
265
265
|
<dt class="tag-source">Source:</dt>
|
|
266
266
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
267
|
-
<a href="EditorStartup.js.html">EditorStartup.js</a>, <a href="EditorStartup.js.html#
|
|
267
|
+
<a href="EditorStartup.js.html">EditorStartup.js</a>, <a href="EditorStartup.js.html#line781">line 781</a>
|
|
268
268
|
</li></ul></dd>
|
|
269
269
|
|
|
270
270
|
|
|
@@ -348,7 +348,7 @@ disables on dragging (mousedown) to avoid changing mode in the middle of drawing
|
|
|
348
348
|
|
|
349
349
|
<dt class="tag-source">Source:</dt>
|
|
350
350
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
351
|
-
<a href="EditorStartup.js.html">EditorStartup.js</a>, <a href="EditorStartup.js.html#
|
|
351
|
+
<a href="EditorStartup.js.html">EditorStartup.js</a>, <a href="EditorStartup.js.html#line650">line 650</a>
|
|
352
352
|
</li></ul></dd>
|
|
353
353
|
|
|
354
354
|
|
|
@@ -518,7 +518,7 @@ disables on dragging (mousedown) to avoid changing mode in the middle of drawing
|
|
|
518
518
|
|
|
519
519
|
<dt class="tag-source">Source:</dt>
|
|
520
520
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
521
|
-
<a href="EditorStartup.js.html">EditorStartup.js</a>, <a href="EditorStartup.js.html#
|
|
521
|
+
<a href="EditorStartup.js.html">EditorStartup.js</a>, <a href="EditorStartup.js.html#line739">line 739</a>
|
|
522
522
|
</li></ul></dd>
|
|
523
523
|
|
|
524
524
|
|
|
@@ -655,7 +655,7 @@ disables on dragging (mousedown) to avoid changing mode in the middle of drawing
|
|
|
655
655
|
|
|
656
656
|
<dt class="tag-source">Source:</dt>
|
|
657
657
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
658
|
-
<a href="EditorStartup.js.html">EditorStartup.js</a>, <a href="EditorStartup.js.html#
|
|
658
|
+
<a href="EditorStartup.js.html">EditorStartup.js</a>, <a href="EditorStartup.js.html#line749">line 749</a>
|
|
659
659
|
</li></ul></dd>
|
|
660
660
|
|
|
661
661
|
|
|
@@ -711,7 +711,7 @@ value as a string.</a></li><li><a href="global.html#get">get</a></li><li><a href
|
|
|
711
711
|
<br class="clear">
|
|
712
712
|
|
|
713
713
|
<footer>
|
|
714
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
|
714
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Wed Jan 15 2025 12:33:56 GMT+0100 (czas środkowoeuropejski standardowy)
|
|
715
715
|
</footer>
|
|
716
716
|
|
|
717
717
|
<script> prettyPrint(); </script>
|