@visactor/vrender-core 0.22.0-vstory.1 → 0.22.0-vstory.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/cjs/core/global.d.ts +0 -3
- package/cjs/core/global.js +1 -7
- package/cjs/core/global.js.map +1 -1
- package/cjs/graphic/builtin-symbol/utils.js +1 -1
- package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
- package/cjs/graphic/config.js +1 -0
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +1 -1
- package/cjs/graphic/graphic.js +9 -9
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +1 -0
- package/cjs/graphic/group.js +6 -1
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/richtext/line.js +13 -1
- package/cjs/graphic/richtext/line.js.map +1 -1
- package/cjs/graphic/richtext/paragraph.d.ts +9 -1
- package/cjs/graphic/richtext/paragraph.js +50 -11
- package/cjs/graphic/richtext/paragraph.js.map +1 -1
- package/cjs/graphic/richtext/utils.js +4 -4
- package/cjs/graphic/richtext/utils.js.map +1 -1
- package/cjs/graphic/richtext.d.ts +2 -1
- package/cjs/graphic/richtext.js +10 -1
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/interface/global.d.ts +0 -1
- package/cjs/interface/global.js.map +1 -1
- package/cjs/interface/graphic/richText.d.ts +11 -0
- package/cjs/interface/graphic/richText.js.map +1 -1
- package/cjs/interface/graphic.d.ts +1 -1
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/plugins/builtin-plugin/edit-module.d.ts +2 -1
- package/cjs/plugins/builtin-plugin/edit-module.js +20 -15
- package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +37 -11
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +329 -136
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.js +3 -2
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/image-render.js.map +1 -1
- package/cjs/resource-loader/loader.js +1 -1
- package/cjs/resource-loader/loader.js.map +1 -1
- package/dist/index.es.js +521 -113
- package/es/core/global.d.ts +0 -3
- package/es/core/global.js +1 -8
- package/es/core/global.js.map +1 -1
- package/es/graphic/builtin-symbol/utils.js +1 -1
- package/es/graphic/builtin-symbol/utils.js.map +1 -1
- package/es/graphic/config.js +1 -0
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/graphic.d.ts +1 -1
- package/es/graphic/graphic.js +10 -10
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +1 -0
- package/es/graphic/group.js +6 -1
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/richtext/line.js +13 -1
- package/es/graphic/richtext/line.js.map +1 -1
- package/es/graphic/richtext/paragraph.d.ts +9 -1
- package/es/graphic/richtext/paragraph.js +50 -11
- package/es/graphic/richtext/paragraph.js.map +1 -1
- package/es/graphic/richtext/utils.js +4 -4
- package/es/graphic/richtext/utils.js.map +1 -1
- package/es/graphic/richtext.d.ts +2 -1
- package/es/graphic/richtext.js +10 -1
- package/es/graphic/richtext.js.map +1 -1
- package/es/interface/global.d.ts +0 -1
- package/es/interface/global.js.map +1 -1
- package/es/interface/graphic/richText.d.ts +11 -0
- package/es/interface/graphic/richText.js.map +1 -1
- package/es/interface/graphic.d.ts +1 -1
- package/es/interface/graphic.js.map +1 -1
- package/es/plugins/builtin-plugin/edit-module.d.ts +2 -1
- package/es/plugins/builtin-plugin/edit-module.js +17 -13
- package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
- package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +37 -11
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js +327 -135
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js +2 -2
- package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.js +2 -2
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/es/resource-loader/loader.js +1 -1
- package/es/resource-loader/loader.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -855,12 +855,6 @@ let DefaultGlobal = class DefaultGlobal {
|
|
|
855
855
|
get env() {
|
|
856
856
|
return this._env;
|
|
857
857
|
}
|
|
858
|
-
get isImageAnonymous() {
|
|
859
|
-
return this._isImageAnonymous;
|
|
860
|
-
}
|
|
861
|
-
set isImageAnonymous(isImageAnonymous) {
|
|
862
|
-
this._isImageAnonymous = isImageAnonymous;
|
|
863
|
-
}
|
|
864
858
|
get devicePixelRatio() {
|
|
865
859
|
if (!this._env) {
|
|
866
860
|
this.setEnv(defaultEnv);
|
|
@@ -929,7 +923,6 @@ let DefaultGlobal = class DefaultGlobal {
|
|
|
929
923
|
}
|
|
930
924
|
constructor(contributions) {
|
|
931
925
|
this.contributions = contributions;
|
|
932
|
-
this._isImageAnonymous = true;
|
|
933
926
|
this.id = Generator.GenAutoIncrementId();
|
|
934
927
|
this.hooks = {
|
|
935
928
|
onSetEnv: new SyncHook(['lastEnv', 'env', 'global'])
|
|
@@ -3314,7 +3307,7 @@ const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute),
|
|
|
3314
3307
|
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, cornerRadius: 0, length: 0, cornerType: 'round' });
|
|
3315
3308
|
const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), { symbolType: 'circle', size: 10, keepDirIn3d: true, clipRange: 1 });
|
|
3316
3309
|
const DefaultTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { strokeBoundsBuffer: 0, keepDirIn3d: true });
|
|
3317
|
-
const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { editable: false, width: 300, height: 300, ellipsis: true, wordBreak: 'break-word', verticalDirection: 'top', textAlign: 'left', textBaseline: 'top', layoutDirection: 'horizontal', textConfig: [], disableAutoWrapLine: false, maxHeight: undefined, maxWidth: undefined, singleLine: false });
|
|
3310
|
+
const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { editable: false, editOptions: null, width: 300, height: 300, ellipsis: true, wordBreak: 'break-word', verticalDirection: 'top', textAlign: 'left', textBaseline: 'top', layoutDirection: 'horizontal', textConfig: [], disableAutoWrapLine: false, maxHeight: undefined, maxWidth: undefined, singleLine: false });
|
|
3318
3311
|
const DefaultImageAttribute = Object.assign(Object.assign({ repeatX: 'no-repeat', repeatY: 'no-repeat', image: '', width: 0, height: 0 }, DefaultAttribute), { fill: true, cornerRadius: 0, cornerType: 'round' });
|
|
3319
3312
|
const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), { backgroundShowMode: 'never', backgroundWidth: 0, backgroundHeight: 0, textAlign: 'left', textBaseline: 'middle', direction: 'horizontal', margin: 0, id: '', width: 20, height: 20, backgroundFill: 'rgba(101, 117, 168, 0.1)', backgroundFillOpacity: 1, backgroundStroke: false, backgroundStrokeOpacity: 1, backgroundRadius: 4, opacity: 1 });
|
|
3320
3313
|
|
|
@@ -3938,17 +3931,16 @@ function measureTextCanvas(text, character) {
|
|
|
3938
3931
|
descent: 0,
|
|
3939
3932
|
width: 0
|
|
3940
3933
|
};
|
|
3941
|
-
if (typeof measurement.
|
|
3942
|
-
|
|
3943
|
-
result.width = Math.floor(measurement.width);
|
|
3934
|
+
if (typeof measurement.fontBoundingBoxAscent !== 'number' || typeof measurement.fontBoundingBoxDescent !== 'number') {
|
|
3935
|
+
result.width = measurement.width;
|
|
3944
3936
|
result.height = character.fontSize || 0;
|
|
3945
3937
|
result.ascent = result.height;
|
|
3946
3938
|
result.descent = 0;
|
|
3947
3939
|
}
|
|
3948
3940
|
else {
|
|
3949
|
-
result.width =
|
|
3950
|
-
result.height = Math.floor(measurement.
|
|
3951
|
-
result.ascent = Math.floor(measurement.
|
|
3941
|
+
result.width = measurement.width;
|
|
3942
|
+
result.height = Math.floor(measurement.fontBoundingBoxAscent + measurement.fontBoundingBoxDescent);
|
|
3943
|
+
result.ascent = Math.floor(measurement.fontBoundingBoxAscent);
|
|
3952
3944
|
result.descent = result.height - result.ascent;
|
|
3953
3945
|
}
|
|
3954
3946
|
return result;
|
|
@@ -11737,10 +11729,10 @@ class ResourceLoader {
|
|
|
11737
11729
|
static GetFile(url, type) {
|
|
11738
11730
|
let data = ResourceLoader.cache.get(url);
|
|
11739
11731
|
if (data) {
|
|
11740
|
-
if (data.loadState === 'fail') {
|
|
11732
|
+
if (data.loadState === 'init' || data.loadState === 'fail') {
|
|
11741
11733
|
return Promise.reject();
|
|
11742
11734
|
}
|
|
11743
|
-
else if (data.loadState === '
|
|
11735
|
+
else if (data.loadState === 'loading') {
|
|
11744
11736
|
return data.dataPromise.then(data => data.data);
|
|
11745
11737
|
}
|
|
11746
11738
|
return Promise.resolve(data.data);
|
|
@@ -11909,7 +11901,7 @@ class Graphic extends Node {
|
|
|
11909
11901
|
}
|
|
11910
11902
|
}
|
|
11911
11903
|
get AABBBounds() {
|
|
11912
|
-
return this.tryUpdateAABBBounds(
|
|
11904
|
+
return this.tryUpdateAABBBounds();
|
|
11913
11905
|
}
|
|
11914
11906
|
get OBBBounds() {
|
|
11915
11907
|
return this.tryUpdateOBBBounds();
|
|
@@ -11964,7 +11956,8 @@ class Graphic extends Node {
|
|
|
11964
11956
|
onAnimateBind(animate) {
|
|
11965
11957
|
this._emitCustomEvent('animate-bind', animate);
|
|
11966
11958
|
}
|
|
11967
|
-
tryUpdateAABBBounds(
|
|
11959
|
+
tryUpdateAABBBounds() {
|
|
11960
|
+
const full = this.attribute.boundsMode === 'imprecise';
|
|
11968
11961
|
if (!this.shouldUpdateAABBBounds()) {
|
|
11969
11962
|
return this._AABBBounds;
|
|
11970
11963
|
}
|
|
@@ -11975,6 +11968,9 @@ class Graphic extends Node {
|
|
|
11975
11968
|
application.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);
|
|
11976
11969
|
const bounds = this.doUpdateAABBBounds(full);
|
|
11977
11970
|
application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);
|
|
11971
|
+
if (this.attribute.boundsMode === 'empty') {
|
|
11972
|
+
bounds.clear();
|
|
11973
|
+
}
|
|
11978
11974
|
return bounds;
|
|
11979
11975
|
}
|
|
11980
11976
|
tryUpdateOBBBounds() {
|
|
@@ -12389,6 +12385,7 @@ class Graphic extends Node {
|
|
|
12389
12385
|
}
|
|
12390
12386
|
this.animates.set(animate.id, animate);
|
|
12391
12387
|
animate.onRemove(() => {
|
|
12388
|
+
animate.stop();
|
|
12392
12389
|
this.animates.delete(animate.id);
|
|
12393
12390
|
});
|
|
12394
12391
|
return animate;
|
|
@@ -12402,11 +12399,11 @@ class Graphic extends Node {
|
|
|
12402
12399
|
}
|
|
12403
12400
|
update(d) {
|
|
12404
12401
|
if (d) {
|
|
12405
|
-
d.bounds && this.tryUpdateAABBBounds(
|
|
12402
|
+
d.bounds && this.tryUpdateAABBBounds();
|
|
12406
12403
|
d.trans && this.tryUpdateLocalTransMatrix();
|
|
12407
12404
|
}
|
|
12408
12405
|
else {
|
|
12409
|
-
this.tryUpdateAABBBounds(
|
|
12406
|
+
this.tryUpdateAABBBounds();
|
|
12410
12407
|
this.tryUpdateLocalTransMatrix();
|
|
12411
12408
|
}
|
|
12412
12409
|
}
|
|
@@ -12689,7 +12686,9 @@ class Graphic extends Node {
|
|
|
12689
12686
|
if (this.animates && this.animates.size) {
|
|
12690
12687
|
const timeline = stage.getTimeline();
|
|
12691
12688
|
this.animates.forEach(a => {
|
|
12692
|
-
a.
|
|
12689
|
+
if (a.timeline === defaultTimeline) {
|
|
12690
|
+
a.setTimeline(timeline);
|
|
12691
|
+
}
|
|
12693
12692
|
});
|
|
12694
12693
|
}
|
|
12695
12694
|
this._onSetStage && this._onSetStage(this, stage, layer);
|
|
@@ -12863,6 +12862,7 @@ class Graphic extends Node {
|
|
|
12863
12862
|
detachShadow() {
|
|
12864
12863
|
if (this.shadowRoot) {
|
|
12865
12864
|
this.addUpdateBoundTag();
|
|
12865
|
+
this.shadowRoot.release(true);
|
|
12866
12866
|
this.shadowRoot = null;
|
|
12867
12867
|
}
|
|
12868
12868
|
}
|
|
@@ -12970,6 +12970,7 @@ class Graphic extends Node {
|
|
|
12970
12970
|
}
|
|
12971
12971
|
release() {
|
|
12972
12972
|
this.releaseStatus = 'released';
|
|
12973
|
+
this.stopAnimates();
|
|
12973
12974
|
application.graphicService.onRelease(this);
|
|
12974
12975
|
}
|
|
12975
12976
|
_emitCustomEvent(type, context) {
|
|
@@ -13591,6 +13592,9 @@ class Group extends Graphic {
|
|
|
13591
13592
|
const bounds = this.doUpdateAABBBounds();
|
|
13592
13593
|
this.addUpdateLayoutTag();
|
|
13593
13594
|
application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange);
|
|
13595
|
+
if (this.attribute.boundsMode === 'empty') {
|
|
13596
|
+
bounds.clear();
|
|
13597
|
+
}
|
|
13594
13598
|
return bounds;
|
|
13595
13599
|
}
|
|
13596
13600
|
doUpdateLocalMatrix() {
|
|
@@ -13781,6 +13785,14 @@ class Group extends Graphic {
|
|
|
13781
13785
|
getNoWorkAnimateAttr() {
|
|
13782
13786
|
return Group.NOWORK_ANIMATE_ATTR;
|
|
13783
13787
|
}
|
|
13788
|
+
release(all) {
|
|
13789
|
+
if (all) {
|
|
13790
|
+
this.forEachChildren((g) => {
|
|
13791
|
+
g.release(all);
|
|
13792
|
+
});
|
|
13793
|
+
}
|
|
13794
|
+
super.release();
|
|
13795
|
+
}
|
|
13784
13796
|
}
|
|
13785
13797
|
Group.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
13786
13798
|
function createGroup(attributes) {
|
|
@@ -16918,6 +16930,7 @@ class CustomSymbolClass {
|
|
|
16918
16930
|
return isNumber(size) ? size : Math.min(size[0], size[1]);
|
|
16919
16931
|
}
|
|
16920
16932
|
drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
|
|
16933
|
+
size = this.parseSize(size);
|
|
16921
16934
|
if (this.isSvg) {
|
|
16922
16935
|
if (!this.svgCache) {
|
|
16923
16936
|
return false;
|
|
@@ -17839,6 +17852,18 @@ class Frame {
|
|
|
17839
17852
|
}
|
|
17840
17853
|
}
|
|
17841
17854
|
|
|
17855
|
+
function getFixedLRTB(left, right, top, bottom) {
|
|
17856
|
+
const leftInt = Math.round(left);
|
|
17857
|
+
const topInt = Math.round(top);
|
|
17858
|
+
const rightInt = Math.round(right);
|
|
17859
|
+
const bottomInt = Math.round(bottom);
|
|
17860
|
+
return {
|
|
17861
|
+
left: leftInt,
|
|
17862
|
+
top: topInt,
|
|
17863
|
+
right: rightInt,
|
|
17864
|
+
bottom: bottomInt
|
|
17865
|
+
};
|
|
17866
|
+
}
|
|
17842
17867
|
class Paragraph {
|
|
17843
17868
|
constructor(text, newLine, character) {
|
|
17844
17869
|
this.fontSize = character.fontSize || 16;
|
|
@@ -17905,7 +17930,47 @@ class Paragraph {
|
|
|
17905
17930
|
this.height = this.widthOrigin;
|
|
17906
17931
|
}
|
|
17907
17932
|
}
|
|
17908
|
-
|
|
17933
|
+
drawBackground(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
17934
|
+
if (!(this.character.background && (!this.character.backgroundOpacity || this.character.backgroundOpacity > 0))) {
|
|
17935
|
+
return;
|
|
17936
|
+
}
|
|
17937
|
+
let baseline = top + ascent;
|
|
17938
|
+
let text = this.text;
|
|
17939
|
+
let left = this.left + deltaLeft;
|
|
17940
|
+
baseline += this.top;
|
|
17941
|
+
let direction = this.direction;
|
|
17942
|
+
if (this.verticalEllipsis) {
|
|
17943
|
+
text = this.ellipsisStr;
|
|
17944
|
+
direction = 'vertical';
|
|
17945
|
+
baseline -= this.ellipsisWidth / 2;
|
|
17946
|
+
}
|
|
17947
|
+
else if (this.ellipsis === 'hide') {
|
|
17948
|
+
return;
|
|
17949
|
+
}
|
|
17950
|
+
else if (this.ellipsis === 'add') {
|
|
17951
|
+
text += this.ellipsisStr;
|
|
17952
|
+
if (textAlign === 'right' || textAlign === 'end') {
|
|
17953
|
+
left -= this.ellipsisWidth;
|
|
17954
|
+
}
|
|
17955
|
+
}
|
|
17956
|
+
else if (this.ellipsis === 'replace') {
|
|
17957
|
+
const index = getStrByWithCanvas(text, (direction === 'vertical' ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
17958
|
+
text = text.slice(0, index);
|
|
17959
|
+
text += this.ellipsisStr;
|
|
17960
|
+
if (textAlign === 'right' || textAlign === 'end') {
|
|
17961
|
+
const { width } = measureTextCanvas(this.text.slice(index), this.character);
|
|
17962
|
+
if (direction === 'vertical') ;
|
|
17963
|
+
else {
|
|
17964
|
+
left -= this.ellipsisWidth - width;
|
|
17965
|
+
}
|
|
17966
|
+
}
|
|
17967
|
+
}
|
|
17968
|
+
const right = left + (this.widthOrigin || this.width);
|
|
17969
|
+
const bottom = top + lineHeight;
|
|
17970
|
+
const lrtb = getFixedLRTB(left, right, top, bottom);
|
|
17971
|
+
return Object.assign(Object.assign({}, lrtb), { fillStyle: this.character.background, globalAlpha: this.character.backgroundOpacity });
|
|
17972
|
+
}
|
|
17973
|
+
draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
17909
17974
|
let baseline = top + ascent;
|
|
17910
17975
|
let text = this.text;
|
|
17911
17976
|
let left = this.left + deltaLeft;
|
|
@@ -17953,19 +18018,6 @@ class Paragraph {
|
|
|
17953
18018
|
left = 0;
|
|
17954
18019
|
baseline = 0;
|
|
17955
18020
|
}
|
|
17956
|
-
if (this.character.fill) {
|
|
17957
|
-
if (this.character.background && (!this.character.backgroundOpacity || this.character.backgroundOpacity > 0)) {
|
|
17958
|
-
const fillStyle = ctx.fillStyle;
|
|
17959
|
-
const globalAlpha = ctx.globalAlpha;
|
|
17960
|
-
ctx.fillStyle = this.character.background;
|
|
17961
|
-
if (this.character.backgroundOpacity !== void 0) {
|
|
17962
|
-
ctx.globalAlpha = this.character.backgroundOpacity;
|
|
17963
|
-
}
|
|
17964
|
-
ctx.fillRect(left, top, this.widthOrigin || this.width, this.lineHeight);
|
|
17965
|
-
ctx.fillStyle = fillStyle;
|
|
17966
|
-
ctx.globalAlpha = globalAlpha;
|
|
17967
|
-
}
|
|
17968
|
-
}
|
|
17969
18021
|
const { lineWidth = 1 } = this.character;
|
|
17970
18022
|
if (this.character.stroke && lineWidth) {
|
|
17971
18023
|
ctx.strokeText(text, left, baseline);
|
|
@@ -17974,19 +18026,35 @@ class Paragraph {
|
|
|
17974
18026
|
ctx.fillText(text, left, baseline);
|
|
17975
18027
|
}
|
|
17976
18028
|
if (this.character.fill) {
|
|
17977
|
-
if (
|
|
18029
|
+
if (this.character.lineThrough || this.character.underline) {
|
|
17978
18030
|
if (this.character.underline) {
|
|
17979
|
-
|
|
18031
|
+
const top = 1 + baseline;
|
|
18032
|
+
const right = left + (this.widthOrigin || this.width);
|
|
18033
|
+
const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
18034
|
+
const lrtb = getFixedLRTB(left, right, top, bottom);
|
|
18035
|
+
ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
|
|
17980
18036
|
}
|
|
17981
18037
|
if (this.character.lineThrough) {
|
|
17982
|
-
|
|
18038
|
+
const top = 1 + baseline - this.ascent / 2;
|
|
18039
|
+
const right = left + (this.widthOrigin || this.width);
|
|
18040
|
+
const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
18041
|
+
const lrtb = getFixedLRTB(left, right, top, bottom);
|
|
18042
|
+
ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
|
|
17983
18043
|
}
|
|
17984
18044
|
}
|
|
17985
18045
|
else if (this.character.textDecoration === 'underline') {
|
|
17986
|
-
|
|
18046
|
+
const top = 1 + baseline;
|
|
18047
|
+
const right = left + (this.widthOrigin || this.width);
|
|
18048
|
+
const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
18049
|
+
const lrtb = getFixedLRTB(left, right, top, bottom);
|
|
18050
|
+
ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
|
|
17987
18051
|
}
|
|
17988
18052
|
else if (this.character.textDecoration === 'line-through') {
|
|
17989
|
-
|
|
18053
|
+
const top = 1 + baseline - this.ascent / 2;
|
|
18054
|
+
const right = left + (this.widthOrigin || this.width);
|
|
18055
|
+
const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
18056
|
+
const lrtb = getFixedLRTB(left, right, top, bottom);
|
|
18057
|
+
ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
|
|
17990
18058
|
}
|
|
17991
18059
|
}
|
|
17992
18060
|
if (direction === 'vertical') {
|
|
@@ -18325,6 +18393,36 @@ class Line {
|
|
|
18325
18393
|
}
|
|
18326
18394
|
}
|
|
18327
18395
|
}
|
|
18396
|
+
let fillStyle = '';
|
|
18397
|
+
let globalAlpha = -1;
|
|
18398
|
+
let currBgList = [];
|
|
18399
|
+
const bgList = [currBgList];
|
|
18400
|
+
this.paragraphs.forEach((paragraph, index) => {
|
|
18401
|
+
if (paragraph instanceof RichTextIcon) {
|
|
18402
|
+
return;
|
|
18403
|
+
}
|
|
18404
|
+
const data = paragraph.drawBackground(ctx, y, this.ascent, x, index === 0, this.textAlign, this.height);
|
|
18405
|
+
if (!data) {
|
|
18406
|
+
return;
|
|
18407
|
+
}
|
|
18408
|
+
if (!(fillStyle === data.fillStyle && globalAlpha === data.globalAlpha)) {
|
|
18409
|
+
currBgList = [];
|
|
18410
|
+
bgList.push(currBgList);
|
|
18411
|
+
fillStyle = data.fillStyle;
|
|
18412
|
+
globalAlpha = data.globalAlpha;
|
|
18413
|
+
}
|
|
18414
|
+
currBgList.push(data);
|
|
18415
|
+
});
|
|
18416
|
+
bgList.forEach(bg => {
|
|
18417
|
+
if (bg.length === 0) {
|
|
18418
|
+
return;
|
|
18419
|
+
}
|
|
18420
|
+
const data = bg[0];
|
|
18421
|
+
const end = bg[bg.length - 1];
|
|
18422
|
+
ctx.fillStyle = data.fillStyle;
|
|
18423
|
+
ctx.globalAlpha = data.globalAlpha;
|
|
18424
|
+
ctx.fillRect(data.left, data.top, end.right - data.left, end.bottom - data.top);
|
|
18425
|
+
});
|
|
18328
18426
|
this.paragraphs.forEach((paragraph, index) => {
|
|
18329
18427
|
if (paragraph instanceof RichTextIcon) {
|
|
18330
18428
|
paragraph.setAttributes({
|
|
@@ -18342,7 +18440,7 @@ class Line {
|
|
|
18342
18440
|
};
|
|
18343
18441
|
applyStrokeStyle(ctx, paragraph.character);
|
|
18344
18442
|
applyFillStyle(ctx, paragraph.character, b);
|
|
18345
|
-
paragraph.draw(ctx, y, this.ascent, x, index === 0, this.textAlign);
|
|
18443
|
+
paragraph.draw(ctx, y, this.ascent, x, index === 0, this.textAlign, this.height);
|
|
18346
18444
|
});
|
|
18347
18445
|
}
|
|
18348
18446
|
getWidthWithEllips(ellipsis) {
|
|
@@ -18672,7 +18770,16 @@ class RichText extends Graphic {
|
|
|
18672
18770
|
return tc.every(item => item.isComposing ||
|
|
18673
18771
|
!(item.text && isString(item.text) && RichText.splitText(item.text).length > 1));
|
|
18674
18772
|
}
|
|
18773
|
+
static splitEmoji(text) {
|
|
18774
|
+
return [...new Intl.Segmenter().segment(text)].map(x => x.segment);
|
|
18775
|
+
}
|
|
18675
18776
|
static splitText(text) {
|
|
18777
|
+
try {
|
|
18778
|
+
const arr = this.splitEmoji(text);
|
|
18779
|
+
return arr;
|
|
18780
|
+
}
|
|
18781
|
+
catch (e) {
|
|
18782
|
+
}
|
|
18676
18783
|
return Array.from(text);
|
|
18677
18784
|
}
|
|
18678
18785
|
static TransformTextConfig2SingleCharacter(textConfig) {
|
|
@@ -18692,7 +18799,8 @@ class RichText extends Graphic {
|
|
|
18692
18799
|
return tc;
|
|
18693
18800
|
}
|
|
18694
18801
|
updateAABBBounds(attribute, richtextTheme, aabbBounds) {
|
|
18695
|
-
|
|
18802
|
+
var _a, _b;
|
|
18803
|
+
const { width = richtextTheme.width, height = richtextTheme.height, maxWidth = richtextTheme.maxWidth, maxHeight = richtextTheme.maxHeight, textAlign = richtextTheme.textAlign, textBaseline = richtextTheme.textBaseline, editOptions } = attribute;
|
|
18696
18804
|
if (width > 0 && height > 0) {
|
|
18697
18805
|
aabbBounds.set(0, 0, width, height);
|
|
18698
18806
|
}
|
|
@@ -18705,6 +18813,10 @@ class RichText extends Graphic {
|
|
|
18705
18813
|
contentWidth = typeof maxWidth === 'number' && contentWidth > maxWidth ? maxWidth : contentWidth || 0;
|
|
18706
18814
|
aabbBounds.set(0, 0, contentWidth, contentHeight);
|
|
18707
18815
|
}
|
|
18816
|
+
if (editOptions && editOptions.keepHeightWhileEmpty && !aabbBounds.height() && !((_a = attribute.textConfig) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
18817
|
+
aabbBounds.y2 = aabbBounds.y1 + ((_b = attribute.fontSize) !== null && _b !== void 0 ? _b : 12);
|
|
18818
|
+
aabbBounds.x2 = aabbBounds.x1 + 2;
|
|
18819
|
+
}
|
|
18708
18820
|
let deltaY = 0;
|
|
18709
18821
|
switch (textBaseline) {
|
|
18710
18822
|
case 'top':
|
|
@@ -20726,8 +20838,8 @@ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
|
|
|
20726
20838
|
this.useStyle = true;
|
|
20727
20839
|
this.order = 0;
|
|
20728
20840
|
}
|
|
20729
|
-
drawShape(
|
|
20730
|
-
return super.drawShape(
|
|
20841
|
+
drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
|
|
20842
|
+
return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
20731
20843
|
}
|
|
20732
20844
|
}
|
|
20733
20845
|
const defaultImageRenderContribution = new DefaultImageRenderContribution();
|
|
@@ -24323,7 +24435,9 @@ let DefaultDrawContribution = class DefaultDrawContribution {
|
|
|
24323
24435
|
this._increaseRender(group, drawContext);
|
|
24324
24436
|
return;
|
|
24325
24437
|
}
|
|
24326
|
-
if (this.useDirtyBounds &&
|
|
24438
|
+
if (this.useDirtyBounds &&
|
|
24439
|
+
!isRectIntersect(group.AABBBounds, this.dirtyBounds, false) &&
|
|
24440
|
+
group.attribute.boundsMode !== 'empty') {
|
|
24327
24441
|
return;
|
|
24328
24442
|
}
|
|
24329
24443
|
let nextM = parentMatrix;
|
|
@@ -24445,7 +24559,9 @@ let DefaultDrawContribution = class DefaultDrawContribution {
|
|
|
24445
24559
|
tempBounds = this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix);
|
|
24446
24560
|
}
|
|
24447
24561
|
if (this.useDirtyBounds &&
|
|
24448
|
-
!(graphic.isContainer ||
|
|
24562
|
+
!(graphic.isContainer ||
|
|
24563
|
+
graphic.attribute.boundsMode === 'empty' ||
|
|
24564
|
+
isRectIntersect(graphic.AABBBounds, tempBounds !== null && tempBounds !== void 0 ? tempBounds : this.dirtyBounds, false))) {
|
|
24449
24565
|
if (retrans && graphic.parent) {
|
|
24450
24566
|
const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;
|
|
24451
24567
|
this.scrollMatrix && this.scrollMatrix.translate(scrollX, scrollY);
|
|
@@ -26935,6 +27051,20 @@ function flatten_simplify(points, tolerance, highestQuality) {
|
|
|
26935
27051
|
return points;
|
|
26936
27052
|
}
|
|
26937
27053
|
|
|
27054
|
+
function getDefaultCharacterConfig(attribute) {
|
|
27055
|
+
const { fill = 'black', stroke = false, fontWeight = 'normal', fontFamily = 'Arial' } = attribute;
|
|
27056
|
+
let { fontSize = 12 } = attribute;
|
|
27057
|
+
if (!isFinite(fontSize)) {
|
|
27058
|
+
fontSize = 12;
|
|
27059
|
+
}
|
|
27060
|
+
return {
|
|
27061
|
+
fill,
|
|
27062
|
+
stroke,
|
|
27063
|
+
fontSize,
|
|
27064
|
+
fontWeight,
|
|
27065
|
+
fontFamily
|
|
27066
|
+
};
|
|
27067
|
+
}
|
|
26938
27068
|
function findConfigIndexByCursorIdx(textConfig, cursorIndex) {
|
|
26939
27069
|
if (cursorIndex < 0) {
|
|
26940
27070
|
return 0;
|
|
@@ -27016,7 +27146,7 @@ class EditModule {
|
|
|
27016
27146
|
this.composingConfigIdx = this.cursorIndex < 0 ? 0 : findConfigIndexByCursorIdx(textConfig, this.cursorIndex);
|
|
27017
27147
|
if (this.cursorIndex < 0) {
|
|
27018
27148
|
const config = textConfig[0];
|
|
27019
|
-
textConfig.unshift(Object.assign(Object.assign({
|
|
27149
|
+
textConfig.unshift(Object.assign(Object.assign(Object.assign({}, getDefaultCharacterConfig(this.currRt.attribute)), config), { text: '' }));
|
|
27020
27150
|
}
|
|
27021
27151
|
else {
|
|
27022
27152
|
const configIdx = this.composingConfigIdx;
|
|
@@ -27033,14 +27163,13 @@ class EditModule {
|
|
|
27033
27163
|
});
|
|
27034
27164
|
};
|
|
27035
27165
|
this.handleInput = (ev) => {
|
|
27036
|
-
var _a, _b, _c, _d;
|
|
27037
27166
|
if (!this.currRt) {
|
|
27038
27167
|
return;
|
|
27039
27168
|
}
|
|
27040
27169
|
if (ev.inputType === 'historyUndo') {
|
|
27041
27170
|
return;
|
|
27042
27171
|
}
|
|
27043
|
-
const
|
|
27172
|
+
const _a = this.currRt.attribute, { textConfig = [] } = _a, rest = __rest(_a, ["textConfig"]);
|
|
27044
27173
|
if (ev.type === 'Backspace' && !textConfig.length) {
|
|
27045
27174
|
return;
|
|
27046
27175
|
}
|
|
@@ -27056,12 +27185,7 @@ class EditModule {
|
|
|
27056
27185
|
const lastConfigIdx = this.isComposing ? this.composingConfigIdx : Math.max(startIdx - 1, 0);
|
|
27057
27186
|
let lastConfig = textConfig[lastConfigIdx];
|
|
27058
27187
|
if (!lastConfig) {
|
|
27059
|
-
lastConfig =
|
|
27060
|
-
fill: (_a = rest.fill) !== null && _a !== void 0 ? _a : 'black',
|
|
27061
|
-
stroke: (_b = rest.stroke) !== null && _b !== void 0 ? _b : false,
|
|
27062
|
-
fontSize: (_c = rest.fontSize) !== null && _c !== void 0 ? _c : 12,
|
|
27063
|
-
fontWeight: (_d = rest.fontWeight) !== null && _d !== void 0 ? _d : 'normal'
|
|
27064
|
-
};
|
|
27188
|
+
lastConfig = getDefaultCharacterConfig(rest);
|
|
27065
27189
|
}
|
|
27066
27190
|
let nextConfig = lastConfig;
|
|
27067
27191
|
if (startIdx !== endIdx) {
|
|
@@ -27157,7 +27281,7 @@ class EditModule {
|
|
|
27157
27281
|
const text = lastConfig.text;
|
|
27158
27282
|
const textList = text ? Array.from(text.toString()) : [];
|
|
27159
27283
|
for (let i = 0; i < textList.length; i++) {
|
|
27160
|
-
textConfig.splice(i + configIdx, 0, Object.assign(Object.assign({ fill: 'black' }, lastConfig), { isComposing: false, text: textList[i] }));
|
|
27284
|
+
textConfig.splice(i + configIdx, 0, Object.assign(Object.assign(Object.assign(Object.assign({}, getDefaultCharacterConfig(this.currRt.attribute)), { fill: 'black' }), lastConfig), { isComposing: false, text: textList[i] }));
|
|
27161
27285
|
}
|
|
27162
27286
|
this.currRt.setAttributes({ textConfig });
|
|
27163
27287
|
const nextConfigIdx = configIdx + textList.length;
|
|
@@ -27219,6 +27343,9 @@ class Selection {
|
|
|
27219
27343
|
}
|
|
27220
27344
|
let idx = Math.round(cursorIdx);
|
|
27221
27345
|
const config = this.rt.attribute.textConfig;
|
|
27346
|
+
if (!config.length) {
|
|
27347
|
+
return null;
|
|
27348
|
+
}
|
|
27222
27349
|
for (let i = 0; i < config.length; i++) {
|
|
27223
27350
|
if (config[i].text !== '\n') {
|
|
27224
27351
|
idx--;
|
|
@@ -27232,7 +27359,7 @@ class Selection {
|
|
|
27232
27359
|
getFormat(key) {
|
|
27233
27360
|
return this.getAllFormat(key)[0];
|
|
27234
27361
|
}
|
|
27235
|
-
getAllFormat(key) {
|
|
27362
|
+
getAllFormat(key, includeUndefined) {
|
|
27236
27363
|
const valSet = new Set();
|
|
27237
27364
|
const minCursorIdx = Math.min(this.selectionStartCursorIdx, this.curCursorIdx);
|
|
27238
27365
|
const maxCursorIdx = Math.max(this.selectionStartCursorIdx, this.curCursorIdx);
|
|
@@ -27241,12 +27368,18 @@ class Selection {
|
|
|
27241
27368
|
}
|
|
27242
27369
|
for (let i = Math.ceil(minCursorIdx); i <= Math.floor(maxCursorIdx); i++) {
|
|
27243
27370
|
const val = this._getFormat(key, i);
|
|
27244
|
-
|
|
27371
|
+
if (includeUndefined) {
|
|
27372
|
+
valSet.add(val);
|
|
27373
|
+
}
|
|
27374
|
+
else {
|
|
27375
|
+
val !== undefined && valSet.add(val);
|
|
27376
|
+
}
|
|
27245
27377
|
}
|
|
27246
27378
|
return Array.from(valSet.values());
|
|
27247
27379
|
}
|
|
27248
27380
|
}
|
|
27249
27381
|
const FORMAT_TEXT_COMMAND = 'FORMAT_TEXT_COMMAND';
|
|
27382
|
+
const FORMAT_ALL_TEXT_COMMAND = 'FORMAT_ALL_TEXT_COMMAND';
|
|
27250
27383
|
const FORMAT_ELEMENT_COMMAND = 'FORMAT_ELEMENT_COMMAND';
|
|
27251
27384
|
class RichTextEditPlugin {
|
|
27252
27385
|
static tryUpdateRichtext(richtext) {
|
|
@@ -27270,7 +27403,33 @@ class RichTextEditPlugin {
|
|
|
27270
27403
|
this._uid = Generator.GenAutoIncrementId();
|
|
27271
27404
|
this.key = this.name + this._uid;
|
|
27272
27405
|
this.editing = false;
|
|
27406
|
+
this.focusing = false;
|
|
27273
27407
|
this.pointerDown = false;
|
|
27408
|
+
this.formatTextCommandCb = (payload, p) => {
|
|
27409
|
+
const rt = p.currRt;
|
|
27410
|
+
if (!rt) {
|
|
27411
|
+
return;
|
|
27412
|
+
}
|
|
27413
|
+
const selectionData = p.getSelection();
|
|
27414
|
+
if (!selectionData) {
|
|
27415
|
+
return;
|
|
27416
|
+
}
|
|
27417
|
+
const { selectionStartCursorIdx, curCursorIdx } = selectionData;
|
|
27418
|
+
const minCursorIdx = Math.min(selectionStartCursorIdx, curCursorIdx);
|
|
27419
|
+
const maxCursorIdx = Math.max(selectionStartCursorIdx, curCursorIdx);
|
|
27420
|
+
const minConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, minCursorIdx);
|
|
27421
|
+
const maxConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, maxCursorIdx);
|
|
27422
|
+
const config = rt.attribute.textConfig.slice(minConfigIdx, maxConfigIdx);
|
|
27423
|
+
this._formatTextCommand(payload, config, rt);
|
|
27424
|
+
};
|
|
27425
|
+
this.formatAllTextCommandCb = (payload, p) => {
|
|
27426
|
+
const rt = p.currRt;
|
|
27427
|
+
if (!rt) {
|
|
27428
|
+
return;
|
|
27429
|
+
}
|
|
27430
|
+
const config = rt.attribute.textConfig;
|
|
27431
|
+
this._formatTextCommand(payload, config, rt);
|
|
27432
|
+
};
|
|
27274
27433
|
this.handleKeyDown = (e) => {
|
|
27275
27434
|
if (!(this.currRt && this.editing)) {
|
|
27276
27435
|
return;
|
|
@@ -27286,10 +27445,20 @@ class RichTextEditPlugin {
|
|
|
27286
27445
|
}
|
|
27287
27446
|
};
|
|
27288
27447
|
this.handleInput = (text, isComposing, cursorIdx, rt) => {
|
|
27448
|
+
if (!this.currRt) {
|
|
27449
|
+
return;
|
|
27450
|
+
}
|
|
27451
|
+
this.tryShowShadowPlaceholder();
|
|
27452
|
+
this.tryShowInputBounds();
|
|
27289
27453
|
this.hideSelection();
|
|
27290
27454
|
this.updateCbs.forEach(cb => cb('input', this));
|
|
27291
27455
|
};
|
|
27292
27456
|
this.handleChange = (text, isComposing, cursorIdx, rt) => {
|
|
27457
|
+
if (!this.currRt) {
|
|
27458
|
+
return;
|
|
27459
|
+
}
|
|
27460
|
+
this.tryShowShadowPlaceholder();
|
|
27461
|
+
this.tryShowInputBounds();
|
|
27293
27462
|
this.curCursorIdx = cursorIdx;
|
|
27294
27463
|
this.selectionStartCursorIdx = cursorIdx;
|
|
27295
27464
|
const p = this.computedCursorPosByCursorIdx(cursorIdx, rt);
|
|
@@ -27298,37 +27467,37 @@ class RichTextEditPlugin {
|
|
|
27298
27467
|
this.updateCbs.forEach(cb => cb('change', this));
|
|
27299
27468
|
};
|
|
27300
27469
|
this.handleFocusIn = () => {
|
|
27470
|
+
throw new Error('不会走到这里 handleFocusIn');
|
|
27301
27471
|
};
|
|
27302
27472
|
this.handleFocusOut = () => {
|
|
27303
|
-
|
|
27304
|
-
this.deFocus();
|
|
27305
|
-
this.pointerDown = false;
|
|
27306
|
-
this.triggerRender();
|
|
27307
|
-
this.updateCbs.forEach(cb => cb('defocus', this));
|
|
27473
|
+
throw new Error('不会走到这里 handleFocusOut');
|
|
27308
27474
|
};
|
|
27309
27475
|
this.handleMove = (e) => {
|
|
27310
|
-
if (!this.
|
|
27476
|
+
if (this.currRt && !this.currRt.attribute.editable) {
|
|
27477
|
+
this.deFocus(true);
|
|
27478
|
+
}
|
|
27479
|
+
if (!this.isEditableRichtext(e)) {
|
|
27480
|
+
this.handleLeave();
|
|
27311
27481
|
return;
|
|
27312
27482
|
}
|
|
27313
|
-
this.
|
|
27314
|
-
this.handleEnter(e);
|
|
27483
|
+
this.handleEnter();
|
|
27315
27484
|
e.target.once('pointerleave', this.handleLeave);
|
|
27316
27485
|
this.tryShowSelection(e, false);
|
|
27317
27486
|
};
|
|
27318
|
-
this.handleEnter = (
|
|
27487
|
+
this.handleEnter = () => {
|
|
27319
27488
|
this.editing = true;
|
|
27320
27489
|
this.pluginService.stage.setCursor('text');
|
|
27321
27490
|
};
|
|
27322
|
-
this.handleLeave = (
|
|
27491
|
+
this.handleLeave = () => {
|
|
27323
27492
|
this.editing = false;
|
|
27324
27493
|
this.pluginService.stage.setCursor('default');
|
|
27325
27494
|
};
|
|
27326
27495
|
this.handlePointerDown = (e) => {
|
|
27327
|
-
if (this.editing) {
|
|
27328
|
-
this.
|
|
27496
|
+
if (!this.editing || !this.isEditableRichtext(e)) {
|
|
27497
|
+
this.deFocus(true);
|
|
27329
27498
|
}
|
|
27330
27499
|
else {
|
|
27331
|
-
this.
|
|
27500
|
+
this.onFocus(e);
|
|
27332
27501
|
}
|
|
27333
27502
|
this.triggerRender();
|
|
27334
27503
|
this.pointerDown = true;
|
|
@@ -27345,27 +27514,14 @@ class RichTextEditPlugin {
|
|
|
27345
27514
|
};
|
|
27346
27515
|
this.commandCbs = new Map();
|
|
27347
27516
|
this.commandCbs.set(FORMAT_TEXT_COMMAND, [this.formatTextCommandCb]);
|
|
27517
|
+
this.commandCbs.set(FORMAT_ALL_TEXT_COMMAND, [this.formatAllTextCommandCb]);
|
|
27348
27518
|
this.updateCbs = [];
|
|
27349
27519
|
this.timeline = new DefaultTimeline();
|
|
27350
27520
|
this.ticker = new DefaultTicker([this.timeline]);
|
|
27351
27521
|
this.deltaX = 0;
|
|
27352
27522
|
this.deltaY = 0;
|
|
27353
27523
|
}
|
|
27354
|
-
|
|
27355
|
-
const rt = p.currRt;
|
|
27356
|
-
if (!rt) {
|
|
27357
|
-
return;
|
|
27358
|
-
}
|
|
27359
|
-
const selectionData = p.getSelection();
|
|
27360
|
-
if (!selectionData) {
|
|
27361
|
-
return;
|
|
27362
|
-
}
|
|
27363
|
-
const { selectionStartCursorIdx, curCursorIdx } = selectionData;
|
|
27364
|
-
const minCursorIdx = Math.min(selectionStartCursorIdx, curCursorIdx);
|
|
27365
|
-
const maxCursorIdx = Math.max(selectionStartCursorIdx, curCursorIdx);
|
|
27366
|
-
const minConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, minCursorIdx);
|
|
27367
|
-
const maxConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, maxCursorIdx);
|
|
27368
|
-
const config = rt.attribute.textConfig.slice(minConfigIdx, maxConfigIdx);
|
|
27524
|
+
_formatTextCommand(payload, config, rt) {
|
|
27369
27525
|
if (payload === 'bold') {
|
|
27370
27526
|
config.forEach((item) => (item.fontWeight = 'bold'));
|
|
27371
27527
|
}
|
|
@@ -27382,6 +27538,12 @@ class RichTextEditPlugin {
|
|
|
27382
27538
|
config.forEach((item) => merge(item, payload));
|
|
27383
27539
|
}
|
|
27384
27540
|
rt.setAttributes(rt.attribute);
|
|
27541
|
+
const cache = rt.getFrameCache();
|
|
27542
|
+
if (!cache) {
|
|
27543
|
+
return;
|
|
27544
|
+
}
|
|
27545
|
+
this.selectionRangeByCursorIdx(this.selectionStartCursorIdx, this.curCursorIdx, cache);
|
|
27546
|
+
this.tryShowInputBounds();
|
|
27385
27547
|
}
|
|
27386
27548
|
dispatchCommand(command, payload) {
|
|
27387
27549
|
const cbs = this.commandCbs.get(command);
|
|
@@ -27392,10 +27554,24 @@ class RichTextEditPlugin {
|
|
|
27392
27554
|
const cbs = this.commandCbs.get(command) || [];
|
|
27393
27555
|
cbs.push(cb);
|
|
27394
27556
|
}
|
|
27557
|
+
removeCommand(command, cb) {
|
|
27558
|
+
const cbs = this.commandCbs.get(command) || [];
|
|
27559
|
+
const idx = cbs.indexOf(cb);
|
|
27560
|
+
if (idx > -1) {
|
|
27561
|
+
cbs.splice(idx, 1);
|
|
27562
|
+
}
|
|
27563
|
+
}
|
|
27395
27564
|
registerUpdateListener(cb) {
|
|
27396
27565
|
const cbs = this.updateCbs || [];
|
|
27397
27566
|
cbs.push(cb);
|
|
27398
27567
|
}
|
|
27568
|
+
removeUpdateListener(cb) {
|
|
27569
|
+
const cbs = this.updateCbs || [];
|
|
27570
|
+
const idx = cbs.indexOf(cb);
|
|
27571
|
+
if (idx > -1) {
|
|
27572
|
+
cbs.splice(idx, 1);
|
|
27573
|
+
}
|
|
27574
|
+
}
|
|
27399
27575
|
activate(context) {
|
|
27400
27576
|
this.pluginService = context;
|
|
27401
27577
|
this.editModule = new EditModule();
|
|
@@ -27436,8 +27612,11 @@ class RichTextEditPlugin {
|
|
|
27436
27612
|
}
|
|
27437
27613
|
startIdx = Math.min(Math.max(startIdx, -0.1), totalCursorCount + 0.1);
|
|
27438
27614
|
endIdx = Math.min(Math.max(endIdx, -0.1), totalCursorCount + 0.1);
|
|
27439
|
-
this.
|
|
27440
|
-
|
|
27615
|
+
this.selectionRangeByCursorIdx(startIdx, endIdx, cache);
|
|
27616
|
+
}
|
|
27617
|
+
selectionRangeByCursorIdx(startCursorIdx, endCursorIdx, cache) {
|
|
27618
|
+
this.curCursorIdx = endCursorIdx;
|
|
27619
|
+
this.selectionStartCursorIdx = startCursorIdx;
|
|
27441
27620
|
const { x, y1, y2 } = this.computedCursorPosByCursorIdx(this.selectionStartCursorIdx, this.currRt);
|
|
27442
27621
|
this.startCursorPos = { x, y: (y1 + y2) / 2 };
|
|
27443
27622
|
const pos = this.computedCursorPosByCursorIdx(this.curCursorIdx, this.currRt);
|
|
@@ -27456,6 +27635,12 @@ class RichTextEditPlugin {
|
|
|
27456
27635
|
return;
|
|
27457
27636
|
}
|
|
27458
27637
|
const { lines } = cache;
|
|
27638
|
+
if (lines.length === 0) {
|
|
27639
|
+
return;
|
|
27640
|
+
}
|
|
27641
|
+
if (!lines[0].paragraphs || lines[0].paragraphs.length === 0) {
|
|
27642
|
+
return;
|
|
27643
|
+
}
|
|
27459
27644
|
const totalCursorCount = lines.reduce((total, line) => total + line.paragraphs.length, 0) - 1;
|
|
27460
27645
|
this.selectionRange(-0.1, totalCursorCount + 0.1);
|
|
27461
27646
|
e.preventDefault();
|
|
@@ -27514,6 +27699,7 @@ class RichTextEditPlugin {
|
|
|
27514
27699
|
else if (this.curCursorIdx > totalCursorCount + 0.1) {
|
|
27515
27700
|
this.curCursorIdx = totalCursorCount + 0.1;
|
|
27516
27701
|
}
|
|
27702
|
+
this.selectionStartCursorIdx = this.curCursorIdx;
|
|
27517
27703
|
const pos = this.computedCursorPosByCursorIdx(this.curCursorIdx, this.currRt);
|
|
27518
27704
|
this.setCursorAndTextArea(pos.x, pos.y1, pos.y2, this.currRt);
|
|
27519
27705
|
this.hideSelection();
|
|
@@ -27552,6 +27738,87 @@ class RichTextEditPlugin {
|
|
|
27552
27738
|
}
|
|
27553
27739
|
return true;
|
|
27554
27740
|
}
|
|
27741
|
+
tryShowShadowPlaceholder() {
|
|
27742
|
+
if (!this.currRt) {
|
|
27743
|
+
return;
|
|
27744
|
+
}
|
|
27745
|
+
const shadowRoot = this.currRt.shadowRoot;
|
|
27746
|
+
if (shadowRoot) {
|
|
27747
|
+
const placeholder = shadowRoot.getElementsByType('richtext')[0];
|
|
27748
|
+
placeholder && shadowRoot.removeChild(placeholder);
|
|
27749
|
+
}
|
|
27750
|
+
const { textConfig, editOptions } = this.currRt.attribute;
|
|
27751
|
+
if (textConfig && textConfig.length) {
|
|
27752
|
+
return;
|
|
27753
|
+
}
|
|
27754
|
+
if (!(editOptions && editOptions.placeholder)) {
|
|
27755
|
+
return;
|
|
27756
|
+
}
|
|
27757
|
+
const { placeholder, placeholderColor = 'rgba(0, 0, 0, 0.6)', placeholderFontFamily, placeholderFontSize } = editOptions;
|
|
27758
|
+
const shadow = this.getShadow(this.currRt);
|
|
27759
|
+
const textConfigItem = Object.assign(Object.assign({}, getDefaultCharacterConfig(this.currRt.attribute)), { text: placeholder });
|
|
27760
|
+
if (placeholderColor) {
|
|
27761
|
+
textConfigItem.fill = placeholderColor;
|
|
27762
|
+
}
|
|
27763
|
+
if (placeholderFontFamily) {
|
|
27764
|
+
textConfigItem.fontFamily = placeholderFontFamily;
|
|
27765
|
+
}
|
|
27766
|
+
if (placeholderFontSize) {
|
|
27767
|
+
textConfigItem.fontSize = placeholderFontSize;
|
|
27768
|
+
}
|
|
27769
|
+
this.shadowPlaceHolder = createRichText(Object.assign(Object.assign({}, this.currRt.attribute), { x: 0, y: 0, pickable: false, editable: false, editOptions: null, angle: 0, _debug_bounds: false, textConfig: [textConfigItem] }));
|
|
27770
|
+
shadow.add(this.shadowPlaceHolder);
|
|
27771
|
+
}
|
|
27772
|
+
tryShowInputBounds() {
|
|
27773
|
+
if (!(this.currRt && this.focusing)) {
|
|
27774
|
+
return;
|
|
27775
|
+
}
|
|
27776
|
+
const { editOptions = {} } = this.currRt.attribute;
|
|
27777
|
+
const { boundsStrokeWhenInput } = editOptions;
|
|
27778
|
+
if (!editOptions || !boundsStrokeWhenInput) {
|
|
27779
|
+
return;
|
|
27780
|
+
}
|
|
27781
|
+
const { attribute } = this.currRt;
|
|
27782
|
+
let b = this.currRt.AABBBounds;
|
|
27783
|
+
let h = b.height();
|
|
27784
|
+
if (!attribute.textConfig.length && this.editLine) {
|
|
27785
|
+
const { points } = this.editLine.attribute;
|
|
27786
|
+
h = points[1].y - points[0].y;
|
|
27787
|
+
b = getRichTextBounds(Object.assign({}, this.shadowPlaceHolder.attribute));
|
|
27788
|
+
}
|
|
27789
|
+
this.shadowBounds = this.shadowBounds || createRect({});
|
|
27790
|
+
this.shadowBounds.setAttributes({
|
|
27791
|
+
x: 0,
|
|
27792
|
+
y: 0,
|
|
27793
|
+
width: b.width(),
|
|
27794
|
+
height: h,
|
|
27795
|
+
fill: false,
|
|
27796
|
+
stroke: boundsStrokeWhenInput,
|
|
27797
|
+
lineWidth: 1,
|
|
27798
|
+
zIndex: -1
|
|
27799
|
+
});
|
|
27800
|
+
const shadow = this.getShadow(this.currRt);
|
|
27801
|
+
shadow.add(this.shadowBounds);
|
|
27802
|
+
this.offsetLineBgAndShadowBounds();
|
|
27803
|
+
}
|
|
27804
|
+
trySyncPlaceholderToTextConfig() {
|
|
27805
|
+
if (!this.currRt) {
|
|
27806
|
+
return;
|
|
27807
|
+
}
|
|
27808
|
+
const { textConfig, editOptions } = this.currRt.attribute;
|
|
27809
|
+
if (textConfig && textConfig.length) {
|
|
27810
|
+
return;
|
|
27811
|
+
}
|
|
27812
|
+
if (!(editOptions && editOptions.placeholder && editOptions.syncPlaceHolderToTextConfig)) {
|
|
27813
|
+
return;
|
|
27814
|
+
}
|
|
27815
|
+
const { placeholder } = editOptions;
|
|
27816
|
+
this.currRt.setAttributes({
|
|
27817
|
+
textConfig: [
|
|
27818
|
+
Object.assign({ text: placeholder }, getDefaultCharacterConfig(this.currRt.attribute))
|
|
27819
|
+
]
|
|
27820
|
+
});
|
|
27821
|
+
}
|
|
27555
27822
|
deactivate(context) {
|
|
27556
27823
|
context.stage.off('pointermove', this.handleMove);
|
|
27557
27824
|
context.stage.off('pointerdown', this.handlePointerDown);
|
|
@@ -27560,12 +27827,17 @@ class RichTextEditPlugin {
|
|
|
27560
27827
|
context.stage.off('dblclick', this.handleDBLClick);
|
|
27561
27828
|
application.global.addEventListener('keydown', this.handleKeyDown);
|
|
27562
27829
|
}
|
|
27563
|
-
onFocus(e) {
|
|
27564
|
-
this.
|
|
27565
|
-
this.
|
|
27830
|
+
onFocus(e, data) {
|
|
27831
|
+
this.updateCbs && this.updateCbs.forEach(cb => cb('beforeOnfocus', this));
|
|
27832
|
+
this.deFocus(false);
|
|
27833
|
+
this.focusing = true;
|
|
27566
27834
|
const target = e.target;
|
|
27835
|
+
if (!(target && target.type === 'richtext')) {
|
|
27836
|
+
return;
|
|
27837
|
+
}
|
|
27838
|
+
this.currRt = target;
|
|
27567
27839
|
RichTextEditPlugin.tryUpdateRichtext(target);
|
|
27568
|
-
const shadowRoot =
|
|
27840
|
+
const shadowRoot = this.getShadow(target);
|
|
27569
27841
|
const cache = target.getFrameCache();
|
|
27570
27842
|
if (!cache) {
|
|
27571
27843
|
return;
|
|
@@ -27582,7 +27854,7 @@ class RichTextEditPlugin {
|
|
|
27582
27854
|
shadowRoot.add(this.editLine);
|
|
27583
27855
|
shadowRoot.add(this.editBg);
|
|
27584
27856
|
}
|
|
27585
|
-
|
|
27857
|
+
data = data || this.computedCursorPosByEvent(e, cache);
|
|
27586
27858
|
if (data) {
|
|
27587
27859
|
const { x, y1, y2, cursorIndex } = data;
|
|
27588
27860
|
this.startCursorPos = { x, y: (y1 + y2) / 2 };
|
|
@@ -27590,31 +27862,96 @@ class RichTextEditPlugin {
|
|
|
27590
27862
|
this.selectionStartCursorIdx = cursorIndex;
|
|
27591
27863
|
this.setCursorAndTextArea(x, y1, y2, target);
|
|
27592
27864
|
}
|
|
27865
|
+
else {
|
|
27866
|
+
const x = 0;
|
|
27867
|
+
const y1 = 0;
|
|
27868
|
+
const y2 = getRichTextBounds(Object.assign(Object.assign({}, target.attribute), { textConfig: [{ text: 'a' }] })).height();
|
|
27869
|
+
this.startCursorPos = { x, y: (y1 + y2) / 2 };
|
|
27870
|
+
this.curCursorIdx = -0.1;
|
|
27871
|
+
this.selectionStartCursorIdx = -0.1;
|
|
27872
|
+
this.setCursorAndTextArea(x, y1, y2, target);
|
|
27873
|
+
}
|
|
27874
|
+
this.tryShowShadowPlaceholder();
|
|
27875
|
+
this.tryShowInputBounds();
|
|
27876
|
+
this.currRt.addUpdateBoundTag();
|
|
27593
27877
|
}
|
|
27594
|
-
|
|
27595
|
-
const
|
|
27596
|
-
|
|
27878
|
+
offsetLineBgAndShadowBounds() {
|
|
27879
|
+
const rt = this.currRt;
|
|
27880
|
+
const { textBaseline } = rt.attribute;
|
|
27881
|
+
let dy = 0;
|
|
27882
|
+
let attr = rt.attribute;
|
|
27883
|
+
let b;
|
|
27884
|
+
if (textBaseline === 'middle' || textBaseline === 'bottom') {
|
|
27885
|
+
if (!attr.textConfig.length) {
|
|
27886
|
+
attr = Object.assign(Object.assign({}, attr), { textConfig: [{ text: 'a' }] });
|
|
27887
|
+
}
|
|
27888
|
+
b = getRichTextBounds(attr);
|
|
27889
|
+
}
|
|
27890
|
+
if (textBaseline === 'middle') {
|
|
27891
|
+
dy = -b.height() / 2;
|
|
27892
|
+
}
|
|
27893
|
+
else if (textBaseline === 'bottom') {
|
|
27894
|
+
dy = -b.height();
|
|
27895
|
+
}
|
|
27896
|
+
this.editLine && this.editLine.setAttributes({ dy });
|
|
27897
|
+
this.editBg && this.editBg.setAttributes({ dy });
|
|
27898
|
+
if (this.shadowBounds) {
|
|
27899
|
+
this.shadowBounds.setAttributes({ dy });
|
|
27900
|
+
}
|
|
27901
|
+
}
|
|
27902
|
+
deFocus(trulyDeFocus = false) {
|
|
27903
|
+
const currRt = this.currRt;
|
|
27904
|
+
if (!currRt) {
|
|
27597
27905
|
return;
|
|
27598
27906
|
}
|
|
27599
|
-
|
|
27907
|
+
this.updateCbs && this.updateCbs.forEach(cb => cb('beforeDefocus', this, { trulyDeFocus }));
|
|
27908
|
+
if (trulyDeFocus) {
|
|
27909
|
+
this.trySyncPlaceholderToTextConfig();
|
|
27910
|
+
currRt.detachShadow();
|
|
27911
|
+
}
|
|
27600
27912
|
this.currRt = null;
|
|
27601
27913
|
if (this.editLine) {
|
|
27602
|
-
this.editLine.parent.removeChild(this.editLine);
|
|
27914
|
+
this.editLine.parent && this.editLine.parent.removeChild(this.editLine);
|
|
27603
27915
|
this.editLine.release();
|
|
27604
27916
|
this.editLine = null;
|
|
27605
|
-
this.editBg.parent.removeChild(this.editBg);
|
|
27917
|
+
this.editBg.parent && this.editBg.parent.removeChild(this.editBg);
|
|
27606
27918
|
this.editBg.release();
|
|
27607
27919
|
this.editBg = null;
|
|
27608
27920
|
}
|
|
27921
|
+
if (trulyDeFocus) {
|
|
27922
|
+
if (this.shadowBounds) {
|
|
27923
|
+
this.shadowBounds.parent && this.shadowBounds.parent.removeChild(this.shadowBounds);
|
|
27924
|
+
this.shadowBounds.release();
|
|
27925
|
+
this.shadowBounds = null;
|
|
27926
|
+
}
|
|
27927
|
+
if (this.shadowPlaceHolder) {
|
|
27928
|
+
this.shadowPlaceHolder.parent && this.shadowPlaceHolder.parent.removeChild(this.shadowPlaceHolder);
|
|
27929
|
+
this.shadowPlaceHolder.release();
|
|
27930
|
+
this.shadowPlaceHolder = null;
|
|
27931
|
+
}
|
|
27932
|
+
}
|
|
27933
|
+
this.focusing = false;
|
|
27934
|
+
const textConfig = currRt.attribute.textConfig;
|
|
27935
|
+
let lastConfig = textConfig[textConfig.length - 1];
|
|
27936
|
+
let cleared = false;
|
|
27937
|
+
while (lastConfig && lastConfig.text === '\n') {
|
|
27938
|
+
textConfig.pop();
|
|
27939
|
+
lastConfig = textConfig[textConfig.length - 1];
|
|
27940
|
+
cleared = true;
|
|
27941
|
+
}
|
|
27942
|
+
cleared && currRt.setAttributes({ textConfig });
|
|
27943
|
+
currRt.removeEventListener('pointerleave', this.handleLeave);
|
|
27609
27944
|
}
|
|
27610
27945
|
addAnimateToLine(line) {
|
|
27946
|
+
line.setAttributes({ opacity: 1 });
|
|
27611
27947
|
line.animates &&
|
|
27612
27948
|
line.animates.forEach(animate => {
|
|
27613
27949
|
animate.stop();
|
|
27614
27950
|
animate.release();
|
|
27615
27951
|
});
|
|
27616
|
-
const animate = line.animate(
|
|
27617
|
-
|
|
27952
|
+
const animate = line.animate({
|
|
27953
|
+
timeline: this.timeline
|
|
27954
|
+
});
|
|
27618
27955
|
animate.to({ opacity: 1 }, 10, 'linear').wait(700).to({ opacity: 0 }, 10, 'linear').wait(700).loop(Infinity);
|
|
27619
27956
|
}
|
|
27620
27957
|
tryShowSelection(e, dblclick) {
|
|
@@ -27665,6 +28002,9 @@ class RichTextEditPlugin {
|
|
|
27665
28002
|
};
|
|
27666
28003
|
let line0Info = this.getLineByPoint(cache, startCursorPos);
|
|
27667
28004
|
let line1Info = this.getLineByPoint(cache, endCursorPos);
|
|
28005
|
+
if (!line0Info || !line1Info) {
|
|
28006
|
+
return;
|
|
28007
|
+
}
|
|
27668
28008
|
if (startCursorPos.y > endCursorPos.y ||
|
|
27669
28009
|
(startCursorPos.y === endCursorPos.y && startCursorPos.x > endCursorPos.x)) {
|
|
27670
28010
|
[startCursorPos, endCursorPos] = [endCursorPos, startCursorPos];
|
|
@@ -27725,7 +28065,7 @@ class RichTextEditPlugin {
|
|
|
27725
28065
|
y += line.height;
|
|
27726
28066
|
}
|
|
27727
28067
|
}
|
|
27728
|
-
this.setCursorAndTextArea(currCursorData.x, currCursorData.y1
|
|
28068
|
+
this.setCursorAndTextArea(currCursorData.x, currCursorData.y1, currCursorData.y2, this.currRt);
|
|
27729
28069
|
this.triggerRender();
|
|
27730
28070
|
this.updateCbs.forEach(cb => cb('selection', this));
|
|
27731
28071
|
}
|
|
@@ -27735,6 +28075,11 @@ class RichTextEditPlugin {
|
|
|
27735
28075
|
this.editBg.setAttributes({ fill: 'transparent' });
|
|
27736
28076
|
}
|
|
27737
28077
|
}
|
|
28078
|
+
getShadow(rt) {
|
|
28079
|
+
const sr = rt.shadowRoot || rt.attachShadow();
|
|
28080
|
+
sr.setAttributes({ boundsMode: 'empty' });
|
|
28081
|
+
return sr;
|
|
28082
|
+
}
|
|
27738
28083
|
getLineByPoint(cache, p1) {
|
|
27739
28084
|
let lineInfo = cache.lines[0];
|
|
27740
28085
|
for (let i = 0; i < cache.lines.length; i++) {
|
|
@@ -27793,7 +28138,10 @@ class RichTextEditPlugin {
|
|
|
27793
28138
|
return -1;
|
|
27794
28139
|
}
|
|
27795
28140
|
isRichtext(e) {
|
|
27796
|
-
return !!(e.target && e.target.type === 'richtext'
|
|
28141
|
+
return !!(e.target && e.target.type === 'richtext');
|
|
28142
|
+
}
|
|
28143
|
+
isEditableRichtext(e) {
|
|
28144
|
+
return this.isRichtext(e) && !!e.target.attribute.editable;
|
|
27797
28145
|
}
|
|
27798
28146
|
triggerRender() {
|
|
27799
28147
|
this.pluginService.stage.renderNextFrame();
|
|
@@ -27823,6 +28171,18 @@ class RichTextEditPlugin {
|
|
|
27823
28171
|
e.target.globalTransMatrix.transformPoint(p, p1);
|
|
27824
28172
|
p1.x -= this.deltaX;
|
|
27825
28173
|
p1.y -= this.deltaY;
|
|
28174
|
+
const rt = this.currRt;
|
|
28175
|
+
const { textBaseline } = rt.attribute;
|
|
28176
|
+
let dy = 0;
|
|
28177
|
+
if (textBaseline === 'middle') {
|
|
28178
|
+
const b = getRichTextBounds(rt.attribute);
|
|
28179
|
+
dy = b.height() / 2;
|
|
28180
|
+
}
|
|
28181
|
+
else if (textBaseline === 'bottom') {
|
|
28182
|
+
const b = getRichTextBounds(rt.attribute);
|
|
28183
|
+
dy = b.height();
|
|
28184
|
+
}
|
|
28185
|
+
p1.y += dy;
|
|
27826
28186
|
return p1;
|
|
27827
28187
|
}
|
|
27828
28188
|
setCursorAndTextArea(x, y1, y2, rt) {
|
|
@@ -27838,6 +28198,7 @@ class RichTextEditPlugin {
|
|
|
27838
28198
|
const { left, top } = this.pluginService.stage.window.getBoundingClientRect();
|
|
27839
28199
|
out.x += left;
|
|
27840
28200
|
out.y += top;
|
|
28201
|
+
this.offsetLineBgAndShadowBounds();
|
|
27841
28202
|
this.editModule.moveTo(out.x, out.y, rt, this.curCursorIdx, this.selectionStartCursorIdx);
|
|
27842
28203
|
}
|
|
27843
28204
|
computedCursorPosByEvent(e, cache) {
|
|
@@ -27850,10 +28211,8 @@ class RichTextEditPlugin {
|
|
|
27850
28211
|
if (!columnInfo) {
|
|
27851
28212
|
return;
|
|
27852
28213
|
}
|
|
27853
|
-
|
|
27854
|
-
|
|
27855
|
-
y1 += 2;
|
|
27856
|
-
y2 -= 2;
|
|
28214
|
+
const y1 = lineInfo.top;
|
|
28215
|
+
const y2 = lineInfo.top + lineInfo.height;
|
|
27857
28216
|
let cursorIndex = this.getColumnIndex(cache, columnInfo);
|
|
27858
28217
|
cursorIndex += delta;
|
|
27859
28218
|
const x = columnInfo.left + (delta > 0 ? columnInfo.width : 0);
|
|
@@ -27874,6 +28233,14 @@ class RichTextEditPlugin {
|
|
|
27874
28233
|
const column = this.getColumnByIndex(cache, idx);
|
|
27875
28234
|
const height = (_a = rt.attribute.fontSize) !== null && _a !== void 0 ? _a : (_c = (_b = rt.attribute.textConfig) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.fontSize;
|
|
27876
28235
|
if (!column) {
|
|
28236
|
+
if (!cache.lines.length) {
|
|
28237
|
+
const b = getRichTextBounds(Object.assign(Object.assign({}, rt.attribute), { textConfig: [{ text: 'a' }] }));
|
|
28238
|
+
return {
|
|
28239
|
+
x: 0,
|
|
28240
|
+
y1: 0,
|
|
28241
|
+
y2: b.height()
|
|
28242
|
+
};
|
|
28243
|
+
}
|
|
27877
28244
|
return {
|
|
27878
28245
|
x: 0,
|
|
27879
28246
|
y1: 0,
|
|
@@ -27881,12 +28248,10 @@ class RichTextEditPlugin {
|
|
|
27881
28248
|
};
|
|
27882
28249
|
}
|
|
27883
28250
|
const { lineInfo, columnInfo } = column;
|
|
27884
|
-
|
|
27885
|
-
|
|
28251
|
+
const y1 = lineInfo.top;
|
|
28252
|
+
const y2 = lineInfo.top + lineInfo.height;
|
|
27886
28253
|
const x = columnInfo.left + (leftRight < 0 ? 0 : columnInfo.width);
|
|
27887
|
-
y1
|
|
27888
|
-
y2 -= 2;
|
|
27889
|
-
return { x, y1, y2 };
|
|
28254
|
+
return { x, y1, y2, lineInfo, columnInfo };
|
|
27890
28255
|
}
|
|
27891
28256
|
getColumnByIndex(cache, index) {
|
|
27892
28257
|
for (let i = 0, inputIndex = 0; i < cache.lines.length; i++) {
|
|
@@ -27921,6 +28286,49 @@ class RichTextEditPlugin {
|
|
|
27921
28286
|
}
|
|
27922
28287
|
return null;
|
|
27923
28288
|
}
|
|
28289
|
+
forceFocus(params) {
|
|
28290
|
+
const { target, e, cursorIndex } = params;
|
|
28291
|
+
if (!target) {
|
|
28292
|
+
return;
|
|
28293
|
+
}
|
|
28294
|
+
this.currRt = target;
|
|
28295
|
+
if (e) {
|
|
28296
|
+
this._forceFocusByEvent(e);
|
|
28297
|
+
}
|
|
28298
|
+
else {
|
|
28299
|
+
this._forceFocusByCursorIndex(cursorIndex !== null && cursorIndex !== void 0 ? cursorIndex : -0.1);
|
|
28300
|
+
}
|
|
28301
|
+
}
|
|
28302
|
+
_forceFocusByEvent(e) {
|
|
28303
|
+
this.handleEnter();
|
|
28304
|
+
this.handlePointerDown(e);
|
|
28305
|
+
this.handlePointerUp(e);
|
|
28306
|
+
}
|
|
28307
|
+
_forceFocusByCursorIndex(cursorIndex) {
|
|
28308
|
+
const richtext = this.currRt;
|
|
28309
|
+
if (!richtext) {
|
|
28310
|
+
return;
|
|
28311
|
+
}
|
|
28312
|
+
let x = 0;
|
|
28313
|
+
let y1 = 0;
|
|
28314
|
+
let y2 = 2;
|
|
28315
|
+
let lineInfo = null;
|
|
28316
|
+
let columnInfo = null;
|
|
28317
|
+
const data = this.computedCursorPosByCursorIdx(cursorIndex, richtext);
|
|
28318
|
+
x = data.x;
|
|
28319
|
+
y1 = data.y1;
|
|
28320
|
+
y2 = data.y2;
|
|
28321
|
+
lineInfo = data.lineInfo;
|
|
28322
|
+
columnInfo = data.columnInfo;
|
|
28323
|
+
this.onFocus({ target: this.currRt }, {
|
|
28324
|
+
x,
|
|
28325
|
+
y1,
|
|
28326
|
+
y2,
|
|
28327
|
+
cursorIndex,
|
|
28328
|
+
lineInfo,
|
|
28329
|
+
columnInfo
|
|
28330
|
+
});
|
|
28331
|
+
}
|
|
27924
28332
|
}
|
|
27925
28333
|
|
|
27926
28334
|
class DefaultGraphicAllocate {
|
|
@@ -29696,4 +30104,4 @@ function generatorPathEasingFunc(path) {
|
|
|
29696
30104
|
};
|
|
29697
30105
|
}
|
|
29698
30106
|
|
|
29699
|
-
export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolClipRangeStrokeRenderContribution, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Easing, Edge, EditModule, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, MeasureModeEnum, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickServiceInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowPickServiceInterceptorContribution, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolClipRangeStrokeRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findConfigIndexByCursorIdx, findCursorIdxByConfigIndex, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, generatorPathEasingFunc, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, quadCalc, quadLength, quadPointAt, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|
|
30107
|
+
export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolClipRangeStrokeRenderContribution, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Easing, Edge, EditModule, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ALL_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, MeasureModeEnum, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickServiceInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowPickServiceInterceptorContribution, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolClipRangeStrokeRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findConfigIndexByCursorIdx, findCursorIdxByConfigIndex, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, generatorPathEasingFunc, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getDefaultCharacterConfig, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, quadCalc, quadLength, quadPointAt, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|