zrender-nightly 5.5.0-dev.20230326 → 5.5.0-dev.20230328

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.
@@ -344,16 +344,19 @@ function pushTokens(block, str, style, wrapInfo, styleName) {
344
344
  }
345
345
  }
346
346
  }
347
- function isLatin(ch) {
347
+ function isAlphabeticLetter(ch) {
348
348
  var code = ch.charCodeAt(0);
349
- return code >= 0x21 && code <= 0x17F;
349
+ return code >= 0x20 && code <= 0x24F
350
+ || code >= 0x370 && code <= 0x10FF
351
+ || code >= 0x1200 && code <= 0x13FF
352
+ || code >= 0x1E00 && code <= 0x206F;
350
353
  }
351
354
  var breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {
352
355
  obj[ch] = true;
353
356
  return obj;
354
357
  }, {});
355
358
  function isWordBreakChar(ch) {
356
- if (isLatin(ch)) {
359
+ if (isAlphabeticLetter(ch)) {
357
360
  if (breakCharMap[ch]) {
358
361
  return true;
359
362
  }
package/lib/svg/core.js CHANGED
@@ -41,9 +41,9 @@ export function vNodeToString(el, opts) {
41
41
  opts = opts || {};
42
42
  var S = opts.newline ? '\n' : '';
43
43
  function convertElToString(el) {
44
- var children = el.children, tag = el.tag, attrs = el.attrs;
44
+ var children = el.children, tag = el.tag, attrs = el.attrs, text = el.text;
45
45
  return createElementOpen(tag, attrs)
46
- + encodeHTML(el.text)
46
+ + (tag !== 'style' ? encodeHTML(text) : text || '')
47
47
  + (children ? "" + S + map(children, function (child) { return convertElToString(child); }).join(S) + S : '')
48
48
  + createElementClose(tag);
49
49
  }
package/lib/zrender.d.ts CHANGED
@@ -84,7 +84,7 @@ export declare function dispose(zr: ZRender): void;
84
84
  export declare function disposeAll(): void;
85
85
  export declare function getInstance(id: number): ZRender;
86
86
  export declare function registerPainter(name: string, Ctor: PainterBaseCtor): void;
87
- export declare const version = "5.5.0-dev.20230326";
87
+ export declare const version = "5.5.0-dev.20230328";
88
88
  export interface ZRenderType extends ZRender {
89
89
  }
90
90
  export {};
package/lib/zrender.js CHANGED
@@ -261,5 +261,5 @@ export function getInstance(id) {
261
261
  export function registerPainter(name, Ctor) {
262
262
  painterCtors[name] = Ctor;
263
263
  }
264
- export var version = '5.5.0-dev.20230326';
264
+ export var version = '5.5.0-dev.20230328';
265
265
  ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zrender-nightly",
3
- "version": "5.5.0-dev.20230326",
3
+ "version": "5.5.0-dev.20230328",
4
4
  "description": "A lightweight graphic library providing 2d draw for Apache ECharts",
5
5
  "keywords": [
6
6
  "canvas",
@@ -14,9 +14,10 @@
14
14
  "url": "https://github.com/ecomfe/zrender.git"
15
15
  },
16
16
  "scripts": {
17
- "prepublish": "npm run release",
17
+ "prepare": "npm run build:lib",
18
18
  "build": "npm run build:bundle && npm run build:lib",
19
19
  "release": "node build/build.js --minify && npm run build:lib",
20
+ "prepublishOnly": "node build/prepublish.js",
20
21
  "prepare:nightly": "node build/prepareNightly.js",
21
22
  "prepare:nightly-next": "node build/prepareNightly.js --next",
22
23
  "build:bundle": "node build/build.js",
@@ -591,9 +591,17 @@ function pushTokens(
591
591
  }
592
592
 
593
593
 
594
- function isLatin(ch: string) {
594
+ function isAlphabeticLetter(ch: string) {
595
+ // Unicode Character Ranges
596
+ // https://jrgraphix.net/research/unicode_blocks.php
597
+ // The following ranges may not cover all letter ranges but only the more
598
+ // popular ones. Developers could make pull requests when they find those
599
+ // not covered.
595
600
  let code = ch.charCodeAt(0);
596
- return code >= 0x21 && code <= 0x17F;
601
+ return code >= 0x20 && code <= 0x24F // Latin
602
+ || code >= 0x370 && code <= 0x10FF // Greek, Coptic, Cyrilic, and etc.
603
+ || code >= 0x1200 && code <= 0x13FF // Ethiopic and Cherokee
604
+ || code >= 0x1E00 && code <= 0x206F; // Latin and Greek extended
597
605
  }
598
606
 
599
607
  const breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {
@@ -604,7 +612,7 @@ const breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {
604
612
  * If break by word. For latin languages.
605
613
  */
606
614
  function isWordBreakChar(ch: string) {
607
- if (isLatin(ch)) {
615
+ if (isAlphabeticLetter(ch)) {
608
616
  if (breakCharMap[ch]) {
609
617
  return true;
610
618
  }
package/src/svg/core.ts CHANGED
@@ -70,9 +70,9 @@ export function vNodeToString(el: SVGVNode, opts?: {
70
70
  opts = opts || {};
71
71
  const S = opts.newline ? '\n' : '';
72
72
  function convertElToString(el: SVGVNode): string {
73
- const {children, tag, attrs} = el;
73
+ const {children, tag, attrs, text} = el;
74
74
  return createElementOpen(tag, attrs)
75
- + encodeHTML(el.text)
75
+ + (tag !== 'style' ? encodeHTML(text) : text || '')
76
76
  + (children ? `${S}${map(children, child => convertElToString(child)).join(S)}${S}` : '')
77
77
  + createElementClose(tag);
78
78
  }
package/src/zrender.ts CHANGED
@@ -485,7 +485,7 @@ export function registerPainter(name: string, Ctor: PainterBaseCtor) {
485
485
  /**
486
486
  * @type {string}
487
487
  */
488
- export const version = '5.5.0-dev.20230326';
488
+ export const version = '5.5.0-dev.20230328';
489
489
 
490
490
 
491
491
  export interface ZRenderType extends ZRender {};