- Refactoring: Clean-up

- Fix: Race condition with svgicons and seticonsize
- Embedded editor: Use module form for now; drop unused inline attribute
- Embedded editor: Fix PNG export; work toward restoring PDF (add `getUIStrings` method to editor for assisting)
- canvg and importScript fixes
This commit is contained in:
Brett Zamir
2018-05-25 22:43:01 +08:00
parent 52268c4324
commit 5ad83b9b87
13 changed files with 1108 additions and 1448 deletions

745
dist/index-es.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

745
dist/index-umd.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

304
dist/locale/lang.en.js vendored
View File

@@ -11,37 +11,37 @@
key_del: 'Del',
key_down: 'Down',
key_up: 'Up',
more_opts: 'more_opts',
more_opts: 'More options',
url: 'url',
width: 'width',
height: 'height'
},
misc: {
powered_by: 'powered_by'
powered_by: 'Powered by'
},
ui: {
toggle_stroke_tools: 'toggle_stroke_tools',
palette_info: 'palette_info',
zoom_level: 'zoom_level',
panel_drag: 'panel_drag',
toggle_stroke_tools: 'Show/hide more stroke tools',
palette_info: 'Click to change fill color, shift-click to change stroke color',
zoom_level: 'Change zoom level',
panel_drag: 'Drag left/right to resize side panel',
quality: 'Quality:',
pathNodeTooltip: 'Drag node to move it. Double-click node to change segment type',
pathCtrlPtTooltip: 'Drag control point to adjust curve properties'
},
properties: {
id: 'id',
fill_color: 'fill_color',
stroke_color: 'stroke_color',
stroke_style: 'stroke_style',
stroke_width: 'stroke_width',
pos_x: 'pos_x',
pos_y: 'pos_y',
linecap_butt: 'linecap_butt',
linecap_round: 'linecap_round',
linecap_square: 'linecap_square',
linejoin_bevel: 'linejoin_bevel',
linejoin_miter: 'linejoin_miter',
linejoin_round: 'linejoin_round',
fill_color: 'Change fill color',
stroke_color: 'Change stroke color',
stroke_style: 'Change stroke dash style',
stroke_width: 'Change stroke width by 1, shift-click to change by 0.1',
pos_x: 'Change X coordinate',
pos_y: 'Change Y coordinate',
linecap_butt: 'Linecap: Butt',
linecap_round: 'Linecap: Round',
linecap_square: 'Linecap: Square',
linejoin_bevel: 'Linejoin: Bevel',
linejoin_miter: 'Linejoin: Miter',
linejoin_round: 'Linejoin: Round',
angle: 'angle',
blur: 'blur',
opacity: 'opacity',
@@ -56,140 +56,140 @@
line_x2: "Change line's ending x coordinate",
line_y1: "Change line's starting y coordinate",
line_y2: "Change line's ending y coordinate",
rect_height: 'rect_height',
rect_width: 'rect_width',
corner_radius: 'corner_radius',
image_width: 'image_width',
image_height: 'image_height',
image_url: 'image_url',
rect_height: 'Change rectangle height',
rect_width: 'Change rectangle width',
corner_radius: 'Change Rectangle Corner Radius',
image_width: 'Change image width',
image_height: 'Change image height',
image_url: 'Change URL',
node_x: "Change node's x coordinate",
node_y: "Change node's y coordinate",
seg_type: 'seg_type',
straight_segments: 'straight_segments',
curve_segments: 'curve_segments',
seg_type: 'Change Segment type',
straight_segments: 'Straight',
curve_segments: 'Curve',
text_contents: 'text_contents',
font_family: 'font_family',
font_size: 'font_size',
bold: 'bold',
italic: 'italic'
font_family: 'Change Font Family',
font_size: 'Change Font Size',
bold: 'Bold Text [B]',
italic: 'Italic Text [I]'
},
tools: {
main_menu: 'main_menu',
main_menu: 'Main Menu',
bkgnd_color_opac: 'bkgnd_color_opac',
connector_no_arrow: 'connector_no_arrow',
fitToContent: 'fitToContent',
fit_to_all: 'fit_to_all',
fit_to_canvas: 'fit_to_canvas',
fit_to_layer_content: 'fit_to_layer_content',
fit_to_sel: 'fit_to_sel',
align_relative_to: 'align_relative_to',
relativeTo: 'relativeTo',
connector_no_arrow: 'No arrow',
fitToContent: 'Fit to Content',
fit_to_all: 'Fit to all content',
fit_to_canvas: 'Fit to canvas',
fit_to_layer_content: 'Fit to layer content',
fit_to_sel: 'Fit to selection',
align_relative_to: 'Align relative to ...',
relativeTo: 'relative to:',
page: 'page',
largest_object: 'largest_object',
selected_objects: 'selected_objects',
smallest_object: 'smallest_object',
new_doc: 'new_doc',
open_doc: 'open_doc',
export_img: 'export_img',
save_doc: 'save_doc',
import_doc: 'import_doc',
align_to_page: 'align_to_page',
align_bottom: 'align_bottom',
align_center: 'align_center',
align_left: 'align_left',
align_middle: 'align_middle',
align_right: 'align_right',
align_top: 'align_top',
mode_select: 'mode_select',
mode_fhpath: 'mode_fhpath',
mode_line: 'mode_line',
mode_connect: 'mode_connect',
mode_rect: 'mode_rect',
mode_square: 'mode_square',
mode_fhrect: 'mode_fhrect',
mode_ellipse: 'mode_ellipse',
mode_circle: 'mode_circle',
mode_fhellipse: 'mode_fhellipse',
mode_path: 'mode_path',
mode_shapelib: 'mode_shapelib',
mode_text: 'mode_text',
mode_image: 'mode_image',
mode_zoom: 'mode_zoom',
mode_eyedropper: 'mode_eyedropper',
no_embed: 'no_embed',
undo: 'undo',
redo: 'redo',
tool_source: 'tool_source',
wireframe_mode: 'wireframe_mode',
toggle_grid: 'toggle_grid',
clone: 'clone',
del: 'del',
group_elements: 'group_elements',
make_link: 'make_link',
set_link_url: 'set_link_url',
to_path: 'to_path',
reorient_path: 'reorient_path',
ungroup: 'ungroup',
docprops: 'docprops',
imagelib: 'imagelib',
move_bottom: 'move_bottom',
move_top: 'move_top',
node_clone: 'node_clone',
node_delete: 'node_delete',
node_link: 'node_link',
add_subpath: 'add_subpath',
openclose_path: 'openclose_path',
source_save: 'source_save',
cut: 'cut',
copy: 'copy',
paste: 'paste',
paste_in_place: 'paste_in_place',
delete: 'delete',
group: 'group',
move_front: 'move_front',
move_up: 'move_up',
move_down: 'move_down',
move_back: 'move_back'
largest_object: 'largest object',
selected_objects: 'selected objects',
smallest_object: 'smallest object',
new_doc: 'New Image',
open_doc: 'Open SVG',
export_img: 'Export',
save_doc: 'Save Image',
import_doc: 'Import Image',
align_to_page: 'Align Element to Page',
align_bottom: 'Align Bottom',
align_center: 'Align Center',
align_left: 'Align Left',
align_middle: 'Align Middle',
align_right: 'Align Right',
align_top: 'Align Top',
mode_select: 'Select Tool',
mode_fhpath: 'Pencil Tool',
mode_line: 'Line Tool',
mode_connect: 'Connect two objects',
mode_rect: 'Rectangle',
mode_square: 'Square',
mode_fhrect: 'Free-Hand Rectangle',
mode_ellipse: 'Ellipse',
mode_circle: 'Circle',
mode_fhellipse: 'Free-Hand Ellipse',
mode_path: 'Path Tool',
mode_shapelib: 'Shape library',
mode_text: 'Text Tool',
mode_image: 'Image Tool',
mode_zoom: 'Zoom Tool [Ctrl+Up/Down]',
mode_eyedropper: 'Eye Dropper Tool',
no_embed: 'NOTE: This image cannot be embedded. It will depend on this path to be displayed',
undo: 'Undo [Z]',
redo: 'Redo [Y]',
tool_source: 'Edit Source [U]',
wireframe_mode: 'Wireframe Mode [F]',
toggle_grid: 'Show/Hide Grid',
clone: 'Duplicate Element [D]',
del: 'Delete Element [Delete/Backspace]',
group_elements: 'Group Elements [G]',
make_link: 'Make (hyper)link',
set_link_url: 'Set link URL (leave empty to remove)',
to_path: 'Convert to Path',
reorient_path: 'Reorient path',
ungroup: 'Ungroup Elements [G]',
docprops: 'Document Properties (D)',
imagelib: 'Image library',
move_bottom: 'Send to Back [ Ctrl+Shift+[ ]',
move_top: 'Bring to Front [ Ctrl+Shift+] ]',
node_clone: 'Clone Node',
node_delete: 'Delete Node',
node_link: 'Link Control Points',
add_subpath: 'Add sub-path',
openclose_path: 'Open/close sub-path',
source_save: 'Apply Changes',
cut: 'Cut',
copy: 'Copy',
paste: 'Paste',
paste_in_place: 'Paste in Place',
delete: 'Delete',
group: 'Group',
move_front: 'Bring to Front (SHFT+CTRL+])',
move_up: 'Bring Forward (CTRL+])',
move_down: 'Send Backward (CTRL+[)',
move_back: 'Send to Back (SHFT+CTRL+[)'
},
layers: {
layer: 'Layer',
layers: 'layers',
del: 'del',
move_down: 'move_down',
new: 'new',
rename: 'rename',
move_up: 'move_up',
dupe: 'dupe',
merge_down: 'merge_down',
merge_all: 'merge_all',
move_elems_to: 'move_elems_to',
move_selected: 'move_selected'
layers: 'Layers',
del: 'Delete Layer',
move_down: 'Move Layer Down',
new: 'New Layer',
rename: 'Rename Layer',
move_up: 'Move Layer Up',
dupe: 'Duplicate Layer...',
merge_down: 'Merge Down',
merge_all: 'Merge All',
move_elems_to: 'Move elements to:',
move_selected: 'Move selected elements to a different layer'
},
config: {
image_props: 'image_props',
doc_title: 'doc_title',
doc_dims: 'doc_dims',
included_images: 'included_images',
image_opt_embed: 'image_opt_embed',
image_opt_ref: 'image_opt_ref',
editor_prefs: 'editor_prefs',
icon_size: 'icon_size',
language: 'language',
background: 'background',
editor_img_url: 'editor_img_url',
editor_bg_note: 'editor_bg_note',
icon_large: 'icon_large',
icon_medium: 'icon_medium',
icon_small: 'icon_small',
icon_xlarge: 'icon_xlarge',
select_predefined: 'select_predefined',
units_and_rulers: 'units_and_rulers',
show_rulers: 'show_rulers',
base_unit: 'base_unit',
grid: 'grid',
snapping_onoff: 'snapping_onoff',
snapping_stepsize: 'snapping_stepsize',
grid_color: 'grid_color'
image_props: 'Image Properties',
doc_title: 'Title:',
doc_dims: 'Canvas Dimensions',
included_images: 'Included Images',
image_opt_embed: 'Embed data (local files)',
image_opt_ref: 'Use file reference',
editor_prefs: 'Editor Preferences',
icon_size: 'Icon size:',
language: 'Language:',
background: 'Editor Background',
editor_img_url: 'URL:',
editor_bg_note: 'Note: Background will not be saved with image.',
icon_large: 'Large',
icon_medium: 'Medium',
icon_small: 'Small',
icon_xlarge: 'Extra Large',
select_predefined: 'Select predefined:',
units_and_rulers: 'Units & Rulers',
show_rulers: 'Show rulers',
base_unit: 'Base Unit:',
grid: 'Grid',
snapping_onoff: 'Snapping on/off',
snapping_stepsize: 'Snapping Step-Size:',
grid_color: 'Grid color:'
},
shape_cats: {
basic: 'basic',
@@ -199,20 +199,20 @@
flowchart: 'flowchart',
animal: 'animal',
game: 'game',
dialog_balloon: 'dialog_balloon',
electronics: 'electronics',
math: 'math',
music: 'music',
misc: 'misc',
raphael_1: 'raphael_1',
raphael_2: 'raphael_2'
dialog_balloon: 'Dialog balloons',
electronics: 'Electronics',
math: 'Mathematical',
music: 'Music',
misc: 'Miscellaneous',
raphael_1: 'raphaeljs.com set 1',
raphael_2: 'raphaeljs.com set 2'
},
imagelib: {
select_lib: 'select_lib',
show_list: 'show_list',
import_single: 'import_single',
import_multi: 'import_multi',
open: 'open'
select_lib: 'Select an image library',
show_list: 'Show library list',
import_single: 'Import single',
import_multi: 'Import multiple',
open: 'Open as new document'
},
notification: {
invalidAttrValGiven: 'Invalid value given',