svgedit-pl 7.3.7 → 7.3.12
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 +1 -1
- package/dist/editor/Editor.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 +1 -1
- package/dist/editor/iife-Editor.js.map +1 -1
- package/dist/editor/xdomain-Editor.js +1 -1
- 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 +1 -1
- package/docs/jsdoc/EditorStartup.html +1 -1
- package/docs/jsdoc/EditorStartup.js.html +1 -1
- 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 +1 -1
- package/docs/jsdoc/extensions_ext-overview_window_ext-overview_window.js.html +1 -1
- package/docs/jsdoc/extensions_ext-panning_ext-panning.js.html +1 -1
- 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 +22 -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 +1 -1
- package/docs/jsdoc/module-SVGEditor.Config.html +1 -1
- package/docs/jsdoc/module-SVGEditor.Prefs.html +1 -1
- package/docs/jsdoc/module-SVGEditor.html +1 -1
- 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/MainMenu.js +11 -11
- package/src/editor/extensions/ext-storage/ext-storage.js +21 -6
- package/src/editor/extensions/ext-storage/storageDialog.js +7 -7
package/src/editor/MainMenu.js
CHANGED
|
@@ -12,7 +12,7 @@ class MainMenu {
|
|
|
12
12
|
/**
|
|
13
13
|
* @param {PlainObject} editor svgedit handler
|
|
14
14
|
*/
|
|
15
|
-
constructor
|
|
15
|
+
constructor(editor) {
|
|
16
16
|
this.editor = editor
|
|
17
17
|
/**
|
|
18
18
|
* @type {Integer}
|
|
@@ -24,7 +24,7 @@ class MainMenu {
|
|
|
24
24
|
*
|
|
25
25
|
* @returns {void}
|
|
26
26
|
*/
|
|
27
|
-
hideDocProperties
|
|
27
|
+
hideDocProperties() {
|
|
28
28
|
const $imgDialog = $id('se-img-prop')
|
|
29
29
|
$imgDialog.setAttribute('dialog', 'close')
|
|
30
30
|
$imgDialog.setAttribute('save', this.editor.configObj.pref('img_save'))
|
|
@@ -35,7 +35,7 @@ class MainMenu {
|
|
|
35
35
|
*
|
|
36
36
|
* @returns {void}
|
|
37
37
|
*/
|
|
38
|
-
hidePreferences
|
|
38
|
+
hidePreferences() {
|
|
39
39
|
const $editDialog = $id('se-edit-prefs')
|
|
40
40
|
$editDialog.setAttribute('dialog', 'close')
|
|
41
41
|
this.editor.configObj.preferences = false
|
|
@@ -45,7 +45,7 @@ class MainMenu {
|
|
|
45
45
|
* @param {Event} e
|
|
46
46
|
* @returns {boolean} Whether there were problems saving the document properties
|
|
47
47
|
*/
|
|
48
|
-
saveDocProperties
|
|
48
|
+
saveDocProperties(e) {
|
|
49
49
|
// set title
|
|
50
50
|
const { title, w, h, save } = e.detail
|
|
51
51
|
// set document title
|
|
@@ -76,7 +76,7 @@ class MainMenu {
|
|
|
76
76
|
* @function module:SVGthis.savePreferences
|
|
77
77
|
* @returns {Promise<void>}
|
|
78
78
|
*/
|
|
79
|
-
async savePreferences
|
|
79
|
+
async savePreferences(e) {
|
|
80
80
|
const {
|
|
81
81
|
lang,
|
|
82
82
|
bgcolor,
|
|
@@ -93,7 +93,7 @@ class MainMenu {
|
|
|
93
93
|
// set language
|
|
94
94
|
if (lang && lang !== this.editor.configObj.pref('lang')) {
|
|
95
95
|
this.editor.configObj.pref('lang', lang)
|
|
96
|
-
seAlert('Changing the language needs reload')
|
|
96
|
+
// seAlert('Changing the language needs reload')
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// set grid setting
|
|
@@ -115,7 +115,7 @@ class MainMenu {
|
|
|
115
115
|
* @param e
|
|
116
116
|
* @returns {Promise<void>} Resolves to `undefined`
|
|
117
117
|
*/
|
|
118
|
-
async clickExport
|
|
118
|
+
async clickExport(e) {
|
|
119
119
|
if (e?.detail?.trigger !== 'ok' || e?.detail?.imgType === undefined) {
|
|
120
120
|
return
|
|
121
121
|
}
|
|
@@ -157,7 +157,7 @@ class MainMenu {
|
|
|
157
157
|
*
|
|
158
158
|
* @returns {void}
|
|
159
159
|
*/
|
|
160
|
-
showDocProperties
|
|
160
|
+
showDocProperties() {
|
|
161
161
|
if (this.editor.docprops) {
|
|
162
162
|
return
|
|
163
163
|
}
|
|
@@ -183,7 +183,7 @@ class MainMenu {
|
|
|
183
183
|
*
|
|
184
184
|
* @returns {void}
|
|
185
185
|
*/
|
|
186
|
-
showPreferences
|
|
186
|
+
showPreferences() {
|
|
187
187
|
if (this.editor.configObj.preferences) {
|
|
188
188
|
return
|
|
189
189
|
}
|
|
@@ -215,14 +215,14 @@ class MainMenu {
|
|
|
215
215
|
*
|
|
216
216
|
* @returns {void}
|
|
217
217
|
*/
|
|
218
|
-
openHomePage
|
|
218
|
+
openHomePage() {
|
|
219
219
|
window.open(homePage, '_blank')
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* @type {module}
|
|
224
224
|
*/
|
|
225
|
-
init
|
|
225
|
+
init() {
|
|
226
226
|
// add Top panel
|
|
227
227
|
const template = document.createElement('template')
|
|
228
228
|
template.innerHTML = `
|
|
@@ -180,7 +180,6 @@ export default {
|
|
|
180
180
|
* @returns {void}
|
|
181
181
|
*/
|
|
182
182
|
const setupBeforeUnloadListener = () => {
|
|
183
|
-
return;
|
|
184
183
|
window.addEventListener('beforeunload', function () {
|
|
185
184
|
// Don't save anything unless the user opted in to storage
|
|
186
185
|
if (
|
|
@@ -224,8 +223,6 @@ export default {
|
|
|
224
223
|
return {
|
|
225
224
|
name: 'storage',
|
|
226
225
|
callback() {
|
|
227
|
-
// Prevent from showing storage dialog
|
|
228
|
-
return;
|
|
229
226
|
const storagePrompt = new URL(top.location).searchParams.get(
|
|
230
227
|
'storagePrompt'
|
|
231
228
|
)
|
|
@@ -261,9 +258,27 @@ export default {
|
|
|
261
258
|
// Open select-with-checkbox dialog
|
|
262
259
|
// From svg-editor.js
|
|
263
260
|
svgEditor.storagePromptState = 'waiting'
|
|
264
|
-
const $storageDialog = document.getElementById('se-storage-dialog')
|
|
265
|
-
|
|
266
|
-
|
|
261
|
+
const $storageDialog = document.getElementById('se-storage-dialog');
|
|
262
|
+
|
|
263
|
+
const forceSavePreferencesLocally = true;
|
|
264
|
+
|
|
265
|
+
if (forceSavePreferencesLocally) {
|
|
266
|
+
$storageDialog.dispatchEvent(
|
|
267
|
+
new CustomEvent(
|
|
268
|
+
'change',
|
|
269
|
+
{
|
|
270
|
+
detail: {
|
|
271
|
+
"trigger": "ok",
|
|
272
|
+
"select": "prefsOnly",
|
|
273
|
+
"checkbox": true
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
)
|
|
278
|
+
} else {
|
|
279
|
+
$storageDialog.setAttribute('dialog', 'open');
|
|
280
|
+
$storageDialog.setAttribute('storage', options);
|
|
281
|
+
}
|
|
267
282
|
} else if (!noStorageOnLoad || forceStorage) {
|
|
268
283
|
setupBeforeUnloadListener()
|
|
269
284
|
}
|
|
@@ -10,7 +10,7 @@ export class SeStorageDialog extends HTMLElement {
|
|
|
10
10
|
/**
|
|
11
11
|
* @function constructor
|
|
12
12
|
*/
|
|
13
|
-
constructor
|
|
13
|
+
constructor() {
|
|
14
14
|
super()
|
|
15
15
|
// create the shadowDom and insert the template
|
|
16
16
|
this._shadowRoot = this.attachShadow({ mode: 'open' })
|
|
@@ -28,7 +28,7 @@ export class SeStorageDialog extends HTMLElement {
|
|
|
28
28
|
* @param {any} name
|
|
29
29
|
* @returns {void}
|
|
30
30
|
*/
|
|
31
|
-
init
|
|
31
|
+
init(i18next) {
|
|
32
32
|
this.setAttribute('common-ok', i18next.t('common.ok'))
|
|
33
33
|
this.setAttribute('common-cancel', i18next.t('common.cancel'))
|
|
34
34
|
this.setAttribute('notify-editor_pref_msg', i18next.t('notification.editorPreferencesMsg'))
|
|
@@ -43,7 +43,7 @@ export class SeStorageDialog extends HTMLElement {
|
|
|
43
43
|
* @function observedAttributes
|
|
44
44
|
* @returns {any} observed
|
|
45
45
|
*/
|
|
46
|
-
static get observedAttributes
|
|
46
|
+
static get observedAttributes() {
|
|
47
47
|
return ['dialog', 'storage', 'common-ok', 'common-cancel', 'notify-editor_pref_msg', 'properties-prefs_and_content', 'tools-remember_this_choice', 'tools-remember_this_choice_title', 'properties-prefs_only', 'properties-no_prefs_or_content']
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -54,7 +54,7 @@ export class SeStorageDialog extends HTMLElement {
|
|
|
54
54
|
* @param {string} newValue
|
|
55
55
|
* @returns {void}
|
|
56
56
|
*/
|
|
57
|
-
attributeChangedCallback
|
|
57
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
58
58
|
let node
|
|
59
59
|
switch (name) {
|
|
60
60
|
case 'dialog':
|
|
@@ -111,7 +111,7 @@ export class SeStorageDialog extends HTMLElement {
|
|
|
111
111
|
* @function get
|
|
112
112
|
* @returns {any}
|
|
113
113
|
*/
|
|
114
|
-
get dialog
|
|
114
|
+
get dialog() {
|
|
115
115
|
return this.getAttribute('dialog')
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -119,7 +119,7 @@ export class SeStorageDialog extends HTMLElement {
|
|
|
119
119
|
* @function set
|
|
120
120
|
* @returns {void}
|
|
121
121
|
*/
|
|
122
|
-
set dialog
|
|
122
|
+
set dialog(value) {
|
|
123
123
|
this.setAttribute('dialog', value)
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -127,7 +127,7 @@ export class SeStorageDialog extends HTMLElement {
|
|
|
127
127
|
* @function connectedCallback
|
|
128
128
|
* @returns {void}
|
|
129
129
|
*/
|
|
130
|
-
connectedCallback
|
|
130
|
+
connectedCallback() {
|
|
131
131
|
const onSubmitHandler = (e, action) => {
|
|
132
132
|
const triggerEvent = new CustomEvent('change',
|
|
133
133
|
{
|