@visactor/vrender-core 1.1.8 → 1.1.9-alpha.0
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/color-string/colorName.js +1 -1
- package/cjs/color-string/index.js +1 -1
- package/cjs/color-string/interpolate.js +1 -1
- package/cjs/color-string/store.js +1 -1
- package/cjs/common/contribution-store-state.js +2 -1
- package/cjs/common/custom-path2d.js +1 -2
- package/cjs/common/module-guard.js +1 -1
- package/cjs/common/morphing-utils.js +1 -1
- package/cjs/common/path-svg.js +1 -1
- package/cjs/common/performance-raf.js +1 -1
- package/cjs/common/polygon.js +1 -1
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +2 -1
- package/cjs/common/render-curve.js +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -2
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +1 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.js +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/graphic/graphic.d.ts +1 -8
- package/cjs/graphic/graphic.js +6 -21
- package/cjs/graphic/graphic.js.map +1 -1
- package/dist/index.es.js +3 -16
- package/es/color-string/colorName.js +1 -1
- package/es/color-string/index.js +1 -1
- package/es/color-string/interpolate.js +1 -1
- package/es/color-string/store.js +1 -1
- package/es/common/contribution-store-state.js +2 -1
- package/es/common/custom-path2d.js +1 -2
- package/es/common/module-guard.js +1 -1
- package/es/common/morphing-utils.js +1 -1
- package/es/common/path-svg.js +1 -1
- package/es/common/performance-raf.js +1 -1
- package/es/common/polygon.js +1 -1
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +2 -1
- package/es/common/render-curve.js +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +1 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/text.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -2
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +1 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.js +1 -1
- package/es/core/window.js +1 -1
- package/es/graphic/graphic.d.ts +1 -8
- package/es/graphic/graphic.js +2 -21
- package/es/graphic/graphic.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,4 +10,4 @@ Object.keys(vutils_1.DEFAULT_COLORS).forEach((k => {
|
|
|
10
10
|
const c = vutils_1.DEFAULT_COLORS[k];
|
|
11
11
|
parsedColors[k] = [ c >> 16 & 255, c >> 8 & 255, 255 & c ];
|
|
12
12
|
})), exports.default = parsedColors;
|
|
13
|
-
//# sourceMappingURL=colorName.js.map
|
|
13
|
+
//# sourceMappingURL=colorName.js.map
|
|
@@ -19,4 +19,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
19
19
|
value: !0
|
|
20
20
|
}), __exportStar(require("./interpolate"), exports), __exportStar(require("./store"), exports),
|
|
21
21
|
__exportStar(require("./colorName"), exports);
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -16,4 +16,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
16
|
value: !0
|
|
17
17
|
}), exports.getContributionStoreState = exports.CONTRIBUTION_STORE_STATE_SYMBOL = void 0,
|
|
18
18
|
exports.CONTRIBUTION_STORE_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/contribution-store-state"),
|
|
19
|
-
exports.getContributionStoreState = getContributionStoreState;
|
|
19
|
+
exports.getContributionStoreState = getContributionStoreState;
|
|
20
|
+
//# sourceMappingURL=contribution-store-state.js.map
|
|
@@ -367,5 +367,4 @@ function scale(current, sX, sY) {
|
|
|
367
367
|
temp[3] = current[3], temp[4] = current[4], temp[5] = current[5], temp[6] = sX * current[6],
|
|
368
368
|
temp[7] = sY * current[7]; else if ("h" === c || "H" === c) temp[1] = sX * current[1]; else if ("v" === c || "V" === c) temp[1] = sY * current[1]; else for (let i = 1, n = current.length; i < n; ++i) temp[i] = (i % 2 == 1 ? sX : sY) * current[i];
|
|
369
369
|
return temp;
|
|
370
|
-
}
|
|
371
|
-
//# sourceMappingURL=custom-path2d.js.map
|
|
370
|
+
}
|
|
@@ -8,4 +8,4 @@ function isBindingContextLoaded(loadedContexts, context) {
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", {
|
|
9
9
|
value: !0
|
|
10
10
|
}), exports.isBindingContextLoaded = void 0, exports.isBindingContextLoaded = isBindingContextLoaded;
|
|
11
|
-
//# sourceMappingURL=module-guard.js.map
|
|
11
|
+
//# sourceMappingURL=module-guard.js.map
|
|
@@ -200,4 +200,4 @@ exports.cubicSubdivide = cubicSubdivide, exports.alignSubpath = alignSubpath, ex
|
|
|
200
200
|
exports.findBestMorphingRotation = findBestMorphingRotation, exports.alignBezierCurves = alignBezierCurves,
|
|
201
201
|
exports.pathToBezierCurves = pathToBezierCurves, exports.applyTransformOnBezierCurves = applyTransformOnBezierCurves,
|
|
202
202
|
exports.bezierCurversToPath = bezierCurversToPath;
|
|
203
|
-
//# sourceMappingURL=morphing-utils.js.map
|
|
203
|
+
//# sourceMappingURL=morphing-utils.js.map
|
package/cjs/common/path-svg.js
CHANGED
package/cjs/common/polygon.js
CHANGED
|
@@ -149,4 +149,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
149
149
|
exports.drawPolygon = drawPolygon, exports.drawRoundedPolygon = drawRoundedPolygon,
|
|
150
150
|
exports.normalizePolygonPoints = normalizePolygonPoints, exports.getPolygonWinding = getPolygonWinding,
|
|
151
151
|
exports.offsetPolygonPoints = offsetPolygonPoints;
|
|
152
|
-
//# sourceMappingURL=polygon.js.map
|
|
152
|
+
//# sourceMappingURL=polygon.js.map
|
package/cjs/common/rect-utils.js
CHANGED
|
@@ -99,4 +99,4 @@ function drawIncrementalAreaSegments(path, lastSeg, segments, params) {
|
|
|
99
99
|
|
|
100
100
|
exports.drawSegments = drawSegments, exports.drawIncrementalSegments = drawIncrementalSegments,
|
|
101
101
|
exports.drawIncrementalAreaSegments = drawIncrementalAreaSegments;
|
|
102
|
-
//# sourceMappingURL=render-curve.js.map
|
|
102
|
+
//# sourceMappingURL=render-curve.js.map
|
package/cjs/common/simplify.js
CHANGED
|
@@ -36,4 +36,4 @@ function flatten_simplify(points, tolerance, highestQuality) {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", {
|
|
37
37
|
value: !0
|
|
38
38
|
}), exports.flatten_simplify = void 0, exports.flatten_simplify = flatten_simplify;
|
|
39
|
-
//# sourceMappingURL=simplify.js.map
|
|
39
|
+
//# sourceMappingURL=simplify.js.map
|
package/cjs/common/sort.js
CHANGED
|
@@ -101,4 +101,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
101
101
|
value: !0
|
|
102
102
|
}), exports.findNextGraphic = exports.foreachAsync = exports.foreach = void 0, exports.foreach = foreach,
|
|
103
103
|
exports.foreachAsync = foreachAsync, exports.findNextGraphic = findNextGraphic;
|
|
104
|
-
//# sourceMappingURL=sort.js.map
|
|
104
|
+
//# sourceMappingURL=sort.js.map
|
package/cjs/common/split-path.js
CHANGED
package/cjs/common/text.js
CHANGED
|
@@ -34,4 +34,4 @@ function textAttributesToStyle(attrs) {
|
|
|
34
34
|
|
|
35
35
|
exports.textDrawOffsetY = textDrawOffsetY, exports.textDrawOffsetX = textDrawOffsetX,
|
|
36
36
|
exports.textLayoutOffsetY = textLayoutOffsetY, exports.textAttributesToStyle = textAttributesToStyle;
|
|
37
|
-
//# sourceMappingURL=text.js.map
|
|
37
|
+
//# sourceMappingURL=text.js.map
|
package/cjs/core/camera.js
CHANGED
package/cjs/core/constants.js
CHANGED
|
@@ -7,4 +7,4 @@ exports.TransformUtil = Symbol.for("TransformUtil"), exports.GraphicUtil = Symbo
|
|
|
7
7
|
exports.LayerService = Symbol.for("LayerService"), exports.StaticLayerHandlerContribution = Symbol.for("StaticLayerHandlerContribution"),
|
|
8
8
|
exports.DynamicLayerHandlerContribution = Symbol.for("DynamicLayerHandlerContribution"),
|
|
9
9
|
exports.VirtualLayerHandlerContribution = Symbol.for("VirtualLayerHandlerContribution");
|
|
10
|
-
//# sourceMappingURL=constants.js.map
|
|
10
|
+
//# sourceMappingURL=constants.js.map
|
package/cjs/core/core-modules.js
CHANGED
|
@@ -15,5 +15,4 @@ function bindCoreModules({bind: bind}) {
|
|
|
15
15
|
bind(constants_1.LayerService).to(layer_service_1.DefaultLayerService).inSingletonScope();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
exports.bindCoreModules = bindCoreModules, exports.default = bindCoreModules;
|
|
19
|
-
//# sourceMappingURL=core-modules.js.map
|
|
18
|
+
exports.bindCoreModules = bindCoreModules, exports.default = bindCoreModules;
|
package/cjs/core/global.js
CHANGED
package/cjs/core/index.js
CHANGED
|
@@ -22,4 +22,4 @@ __exportStar(require("./layer"), exports), __exportStar(require("./stage"), expo
|
|
|
22
22
|
__exportStar(require("./graphic-utils"), exports), __exportStar(require("./contributions"), exports),
|
|
23
23
|
__exportStar(require("./layer-service"), exports), __exportStar(require("./constants"), exports),
|
|
24
24
|
__exportStar(require("../interface/core"), exports);
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/core/layer.js
CHANGED
package/cjs/core/light.js
CHANGED
package/cjs/core/stage.js
CHANGED
package/cjs/core/window.js
CHANGED
package/cjs/graphic/graphic.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export declare const NOWORK_ANIMATE_ATTR: {
|
|
|
57
57
|
cursor: number;
|
|
58
58
|
html: number;
|
|
59
59
|
};
|
|
60
|
-
declare abstract class
|
|
60
|
+
export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> extends Node implements IGraphic<T>, IAnimateTarget {
|
|
61
61
|
static mixin(source: Dict<any>): void;
|
|
62
62
|
_events?: any;
|
|
63
63
|
context?: Record<string, any>;
|
|
@@ -327,11 +327,4 @@ declare abstract class GraphicImpl<T extends Partial<IGraphicAttribute> = Partia
|
|
|
327
327
|
abstract clone(): IGraphic<any>;
|
|
328
328
|
toCustomPath(): ICustomPath2D;
|
|
329
329
|
}
|
|
330
|
-
export type Graphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> = GraphicImpl<T>;
|
|
331
|
-
export declare const GRAPHIC_CLASS_SYMBOL: unique symbol;
|
|
332
|
-
export interface IGraphicClassState {
|
|
333
|
-
Graphic: typeof GraphicImpl;
|
|
334
|
-
}
|
|
335
|
-
export declare function getGraphicClassState(): IGraphicClassState;
|
|
336
|
-
export declare const Graphic: typeof GraphicImpl;
|
|
337
330
|
export {};
|
package/cjs/graphic/graphic.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
|
-
}), exports.Graphic = exports.
|
|
5
|
+
}), exports.Graphic = exports.NOWORK_ANIMATE_ATTR = exports.GRAPHIC_UPDATE_TAG_KEY = exports.PURE_STYLE_KEY = void 0;
|
|
6
6
|
|
|
7
7
|
const vutils_1 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), canvas_1 = require("../canvas"), state_definition_compiler_1 = require("./state/state-definition-compiler"), state_engine_1 = require("./state/state-engine"), attribute_update_classifier_1 = require("./state/attribute-update-classifier"), state_transition_orchestrator_1 = require("./state/state-transition-orchestrator"), shared_state_scope_1 = require("./state/shared-state-scope"), shared_state_refresh_1 = require("./state/shared-state-refresh"), _tempBounds = new vutils_1.AABBBounds, loadShadowRootFactory = () => require("./shadow-root"), tempMatrix = new vutils_1.Matrix;
|
|
8
8
|
|
|
@@ -78,7 +78,7 @@ exports.NOWORK_ANIMATE_ATTR = {
|
|
|
78
78
|
html: 1
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
class
|
|
81
|
+
class Graphic extends node_tree_1.Node {
|
|
82
82
|
static mixin(source) {
|
|
83
83
|
const keys = Object.keys(source);
|
|
84
84
|
for (let i = 0; i < keys.length; ++i) {
|
|
@@ -533,7 +533,7 @@ class GraphicImpl extends node_tree_1.Node {
|
|
|
533
533
|
if (!symbolType) return null;
|
|
534
534
|
let path = builtin_symbol_1.builtinSymbolsMap[symbolType];
|
|
535
535
|
if (path) return path;
|
|
536
|
-
if (path =
|
|
536
|
+
if (path = Graphic.userSymbolMap[symbolType], path) return path;
|
|
537
537
|
symbolType = builtin_symbol_1.builtInSymbolStrMap[symbolType] || symbolType;
|
|
538
538
|
if (!0 === (0, xml_1.isSvg)(symbolType)) {
|
|
539
539
|
const parser = new xml_1.XMLParser, {svg: svg} = parser.parse(symbolType);
|
|
@@ -554,13 +554,13 @@ class GraphicImpl extends node_tree_1.Node {
|
|
|
554
554
|
vutils_1.max)(width, height);
|
|
555
555
|
cacheList.forEach((cache => cache.path.transform(0, 0, scale, scale)));
|
|
556
556
|
const _parsedPath = new builtin_symbol_1.CustomSymbolClass(symbolType, cacheList, !0);
|
|
557
|
-
return
|
|
557
|
+
return Graphic.userSymbolMap[symbolType] = _parsedPath, _parsedPath;
|
|
558
558
|
}
|
|
559
559
|
const cache = (new custom_path2d_1.CustomPath2D).fromString(symbolType), width = cache.bounds.width(), height = cache.bounds.height(), scale = 1 / (0,
|
|
560
560
|
vutils_1.max)(width, height);
|
|
561
561
|
cache.transform(0, 0, scale, scale);
|
|
562
562
|
const _parsedPath = new builtin_symbol_1.CustomSymbolClass(symbolType, cache);
|
|
563
|
-
return
|
|
563
|
+
return Graphic.userSymbolMap[symbolType] = _parsedPath, _parsedPath;
|
|
564
564
|
}
|
|
565
565
|
doUpdateAABBBounds(full, graphicTheme) {
|
|
566
566
|
this.updateAABBBoundsStamp++;
|
|
@@ -1357,19 +1357,6 @@ class GraphicImpl extends node_tree_1.Node {
|
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
1359
|
|
|
1360
|
-
function createGraphicClassState() {
|
|
1361
|
-
return {
|
|
1362
|
-
Graphic: GraphicImpl
|
|
1363
|
-
};
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
function getGraphicClassState() {
|
|
1367
|
-
var _a;
|
|
1368
|
-
const globalScope = globalThis;
|
|
1369
|
-
return null !== (_a = globalScope[exports.GRAPHIC_CLASS_SYMBOL]) && void 0 !== _a || (globalScope[exports.GRAPHIC_CLASS_SYMBOL] = createGraphicClassState()),
|
|
1370
|
-
globalScope[exports.GRAPHIC_CLASS_SYMBOL];
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
1360
|
function backgroundNotImage(image) {
|
|
1374
1361
|
return "string" == typeof image ? !(image.startsWith("<svg") || (0, vutils_1.isValidUrl)(image) || image.includes("/") || (0,
|
|
1375
1362
|
vutils_1.isBase64)(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
|
|
@@ -1381,7 +1368,5 @@ function isExternalTexture(texture) {
|
|
|
1381
1368
|
vutils_1.isObject)(texture));
|
|
1382
1369
|
}
|
|
1383
1370
|
|
|
1384
|
-
|
|
1385
|
-
exports.getGraphicClassState = getGraphicClassState, exports.Graphic = getGraphicClassState().Graphic,
|
|
1386
|
-
exports.Graphic.mixin(event_1.EventTarget);
|
|
1371
|
+
exports.Graphic = Graphic, Graphic.userSymbolMap = {}, Graphic.mixin(event_1.EventTarget);
|
|
1387
1372
|
//# sourceMappingURL=graphic.js.map
|