@antv/g 5.16.26 → 5.16.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -7530,8 +7530,7 @@
7530
7530
  // );
7531
7531
  var getOrCreateUnitValue=function getOrCreateUnitValue(value,unitOrName){if(unitOrName===void 0){unitOrName=exports.UnitType.kNumber;}return new CSSUnitValue(value,unitOrName);};var PECENTAGE_50=new CSSUnitValue(50,'%');var canvasMap={};var defaultCanvasIdCounter=0;/**
7532
7532
  * destroy existed canvas with the same id
7533
- */function cleanExistedCanvas(container,canvas){if(container){var id=typeof container==='string'?container:container.id||defaultCanvasIdCounter++;if(canvasMap[id]){canvasMap[id].destroy();}canvasMap[id]=canvas;}}var isBrowser=typeof window!=='undefined'&&typeof window.document!=='undefined';function sortByZIndex(o1,o2){var zIndex1=Number(o1.parsedStyle.zIndex);var zIndex2=Number(o2.parsedStyle.zIndex);if(zIndex1===zIndex2){// return o1.entity.getComponent(Sortable).lastSortedIndex - o2.entity.getComponent(Sortable).lastSortedIndex;
7534
- var parent=o1.parentNode;if(parent){var children=parent.childNodes||[];return children.indexOf(o1)-children.indexOf(o2);}}return zIndex1-zIndex2;}function findClosestClipPathTarget(object){var el=object;do{var _el$parsedStyle;var clipPath=(_el$parsedStyle=el.parsedStyle)===null||_el$parsedStyle===void 0?void 0:_el$parsedStyle.clipPath;if(clipPath)return el;el=el.parentElement;}while(el!==null);return null;}var PX_SUFFIX='px';function setDOMSize($el,width,height){if(isBrowser&&$el.style){$el.style.width=width+PX_SUFFIX;$el.style.height=height+PX_SUFFIX;}}function getStyle($el,property){if(isBrowser){return document.defaultView.getComputedStyle($el,null).getPropertyValue(property);}}function getWidth($el){var width=getStyle($el,'width');if(width==='auto'){return $el.offsetWidth;}return parseFloat(width);}function getHeight($el){var height=getStyle($el,'height');if(height==='auto'){return $el.offsetHeight;}return parseFloat(height);}var ERROR_MSG_METHOD_NOT_IMPLEMENTED='Method not implemented.';var ERROR_MSG_USE_DOCUMENT_ELEMENT='Use document.documentElement instead.';var ERROR_MSG_APPEND_DESTROYED_ELEMENT='Cannot append a destroyed element.';// borrow from hammer.js
7533
+ */function cleanExistedCanvas(container,canvas){if(container){var id=typeof container==='string'?container:container.id||defaultCanvasIdCounter++;if(canvasMap[id]){canvasMap[id].destroy();}canvasMap[id]=canvas;}}var isBrowser=typeof window!=='undefined'&&typeof window.document!=='undefined';function sortByZIndex(o1,o2){var zIndex1=Number(o1.parsedStyle.zIndex);var zIndex2=Number(o2.parsedStyle.zIndex);if(zIndex1===zIndex2){var parent=o1.parentNode;if(parent){var children=parent.childNodes||[];return children.indexOf(o1)-children.indexOf(o2);}}return zIndex1-zIndex2;}function findClosestClipPathTarget(object){var el=object;do{var _el$parsedStyle;var clipPath=(_el$parsedStyle=el.parsedStyle)===null||_el$parsedStyle===void 0?void 0:_el$parsedStyle.clipPath;if(clipPath)return el;el=el.parentElement;}while(el!==null);return null;}var PX_SUFFIX='px';function setDOMSize($el,width,height){if(isBrowser&&$el.style){$el.style.width=width+PX_SUFFIX;$el.style.height=height+PX_SUFFIX;}}function getStyle($el,property){if(isBrowser){return document.defaultView.getComputedStyle($el,null).getPropertyValue(property);}}function getWidth($el){var width=getStyle($el,'width');if(width==='auto'){return $el.offsetWidth;}return parseFloat(width);}function getHeight($el){var height=getStyle($el,'height');if(height==='auto'){return $el.offsetHeight;}return parseFloat(height);}var ERROR_MSG_METHOD_NOT_IMPLEMENTED='Method not implemented.';var ERROR_MSG_USE_DOCUMENT_ELEMENT='Use document.documentElement instead.';var ERROR_MSG_APPEND_DESTROYED_ELEMENT='Cannot append a destroyed element.';// borrow from hammer.js
7535
7534
  var MOUSE_POINTER_ID=1;var TOUCH_TO_POINTER={touchstart:'pointerdown',touchend:'pointerup',touchendoutside:'pointerupoutside',touchmove:'pointermove',touchcancel:'pointercancel'};function copyVec3(a,b){a[0]=b[0];a[1]=b[1];a[2]=b[2];return a;}function subVec3(o,a,b){o[0]=a[0]-b[0];o[1]=a[1]-b[1];o[2]=a[2]-b[2];return o;}function addVec3(o,a,b){o[0]=a[0]+b[0];o[1]=a[1]+b[1];o[2]=a[2]+b[2];return o;}function scaleVec3(o,a,b){o[0]=a[0]*b;o[1]=a[1]*b;o[2]=a[2]*b;return o;}function maxVec3(o,a,b){o[0]=Math.max(a[0],b[0]);o[1]=Math.max(a[1],b[1]);o[2]=Math.max(a[2],b[2]);return o;}function minVec3(o,a,b){o[0]=Math.min(a[0],b[0]);o[1]=Math.min(a[1],b[1]);o[2]=Math.min(a[2],b[2]);return o;}function getAngle$1(angle){if(angle===undefined){return 0;}else if(angle>360||angle<-360){return angle%360;}return angle;}function createVec3(x,y,z){if(y===void 0){y=0;}if(z===void 0){z=0;}if(Array.isArray(x)&&x.length===3){return clone$1(x);}if(isNumber(x)){return fromValues$2(x,y,z);}return fromValues$2(x[0],x[1]||y,x[2]||z);}function deg2rad(deg){return deg*(Math.PI/180);}function rad2deg(rad){return rad*(180/Math.PI);}function grad2deg(grads){grads=grads%400;if(grads<0){grads+=400;}return grads/400*360;}function deg2turn(deg){return deg/360;}function turn2deg(turn){return 360*turn;}function getEulerFromQuat(out,quat){var x=quat[0];var y=quat[1];var z=quat[2];var w=quat[3];var x2=x*x;var y2=y*y;var z2=z*z;var w2=w*w;var unit=x2+y2+z2+w2;var test=x*w-y*z;if(test>0.499995*unit){// TODO: Use glmatrix.EPSILON
7536
7535
  // singularity at the north pole
7537
7536
  out[0]=Math.PI/2;out[1]=2*Math.atan2(y,x);out[2]=0;}else if(test<-0.499995*unit){//TODO: Use glmatrix.EPSILON
@@ -8035,8 +8034,10 @@
8035
8034
  * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-origin
8036
8035
  * @example
8037
8036
  * [10px, 10px] [10%, 10%]
8038
- */var CSSPropertyTransformOrigin=function CSSPropertyTransformOrigin(){this.parser=parseTransformOrigin;};var CSSPropertyZIndex=/*#__PURE__*/function(){function CSSPropertyZIndex(){this.parser=parseNumber;}var _proto=CSSPropertyZIndex.prototype;_proto.calculator=function calculator(name,oldParsed,computed,object){return computed.value;};_proto.postProcessor=function postProcessor(object){if(object.parentNode){var parentEntity=object.parentNode;var parentRenderable=parentEntity.renderable;var parentSortable=parentEntity.sortable;if(parentRenderable){parentRenderable.dirty=true;}// need re-sort on parent
8039
- if(parentSortable){parentSortable.dirty=true;}}};return CSSPropertyZIndex;}();/**
8037
+ */var CSSPropertyTransformOrigin=function CSSPropertyTransformOrigin(){this.parser=parseTransformOrigin;};/**
8038
+ * @see https://doc.babylonjs.com/how_to/optimizing_your_scene#changing-mesh-culling-strategy
8039
+ */(function(Strategy){Strategy[Strategy["Standard"]=0]="Standard";})(exports.Strategy||(exports.Strategy={}));(function(SortReason){SortReason[SortReason["ADDED"]=0]="ADDED";SortReason[SortReason["REMOVED"]=1]="REMOVED";SortReason[SortReason["Z_INDEX_CHANGED"]=2]="Z_INDEX_CHANGED";})(exports.SortReason||(exports.SortReason={}));var CSSPropertyZIndex=/*#__PURE__*/function(){function CSSPropertyZIndex(){this.parser=parseNumber;}var _proto=CSSPropertyZIndex.prototype;_proto.calculator=function calculator(name,oldParsed,computed,object){return computed.value;};_proto.postProcessor=function postProcessor(object){if(object.parentNode){var parentEntity=object.parentNode;var parentRenderable=parentEntity.renderable;var parentSortable=parentEntity.sortable;if(parentRenderable){parentRenderable.dirty=true;}// need re-sort on parent
8040
+ if(parentSortable){parentSortable.dirty=true;parentSortable.dirtyReason=exports.SortReason.Z_INDEX_CHANGED;}}};return CSSPropertyZIndex;}();/**
8040
8041
  * canvas.customElements
8041
8042
  *
8042
8043
  * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
@@ -8272,8 +8273,6 @@
8272
8273
  */;_proto.appendChild=function appendChild(newChild,index){throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);};_proto.insertBefore=function insertBefore(newChild,refChild){throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);};_proto.removeChild=function removeChild(oldChild,destroy){throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);};_proto.replaceChild=function replaceChild(newChild,oldChild,destroy){throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);};_proto.append=function append(){throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);};_proto.prepend=function prepend(){throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);}/**
8273
8274
  * Execute query on documentElement.
8274
8275
  */;_proto.getElementById=function getElementById(id){return this.documentElement.getElementById(id);};_proto.getElementsByName=function getElementsByName(name){return this.documentElement.getElementsByName(name);};_proto.getElementsByTagName=function getElementsByTagName(tagName){return this.documentElement.getElementsByTagName(tagName);};_proto.getElementsByClassName=function getElementsByClassName(className){return this.documentElement.getElementsByClassName(className);};_proto.querySelector=function querySelector(selectors){return this.documentElement.querySelector(selectors);};_proto.querySelectorAll=function querySelectorAll(selectors){return this.documentElement.querySelectorAll(selectors);};_proto.find=function find(filter){return this.documentElement.find(filter);};_proto.findAll=function findAll(filter){return this.documentElement.findAll(filter);};_createClass(Document,[{key:"children",get:function get(){return this.childNodes;}},{key:"childElementCount",get:function get(){return this.childNodes.length;}},{key:"firstElementChild",get:function get(){return this.firstChild;}},{key:"lastElementChild",get:function get(){return this.lastChild;}}]);return Document;}(Node);/**
8275
- * @see https://doc.babylonjs.com/how_to/optimizing_your_scene#changing-mesh-culling-strategy
8276
- */(function(Strategy){Strategy[Strategy["Standard"]=0]="Standard";})(exports.Strategy||(exports.Strategy={}));/**
8277
8276
  * built-in events for element
8278
8277
  * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent
8279
8278
  *
@@ -8291,27 +8290,14 @@
8291
8290
  * @see https://www.w3.org/TR/DOM-Level-3-Events/#domnodeinsertedintodocument
8292
8291
  */ElementEvent["MOUNTED"]="DOMNodeInsertedIntoDocument";/**
8293
8292
  * @see https://www.w3.org/TR/DOM-Level-3-Events/#domnoderemovedfromdocument
8294
- */ElementEvent["UNMOUNTED"]="DOMNodeRemovedFromDocument";ElementEvent["BOUNDS_CHANGED"]="bounds-changed";// GEOMETRY_BOUNDS_CHANGED = 'geometry-bounds-changed',
8295
- /**
8296
- * trigger when z-index changed
8297
- */ElementEvent["RENDER_ORDER_CHANGED"]="render-order-changed";ElementEvent["CULLED"]="culled";})(exports.ElementEvent||(exports.ElementEvent={}));var MutationEvent=/*#__PURE__*/function(_FederatedEvent){_inheritsLoose(MutationEvent,_FederatedEvent);function MutationEvent(typeArg,relatedNode,prevValue,newValue,attrName,attrChange,prevParsedValue,newParsedValue){var _this;_this=_FederatedEvent.call(this,null)||this;_this.relatedNode=void 0;_this.prevValue=void 0;_this.newValue=void 0;_this.attrName=void 0;_this.attrChange=void 0;_this.prevParsedValue=void 0;_this.newParsedValue=void 0;_this.relatedNode=relatedNode;_this.prevValue=prevValue;_this.newValue=newValue;_this.attrName=attrName;_this.attrChange=attrChange;_this.prevParsedValue=prevParsedValue;_this.newParsedValue=newParsedValue;_this.type=typeArg;return _this;}return MutationEvent;}(FederatedEvent);MutationEvent.ADDITION=2;MutationEvent.MODIFICATION=1;MutationEvent.REMOVAL=3;var entityCounter=0;function resetEntityCounter(){entityCounter=0;}var insertedEvent=new MutationEvent(exports.ElementEvent.INSERTED,null,'','','',0,'','');var removedEvent=new MutationEvent(exports.ElementEvent.REMOVED,null,'','','',0,'','');var destroyEvent=new CustomEvent(exports.ElementEvent.DESTROY);/**
8293
+ */ElementEvent["UNMOUNTED"]="DOMNodeRemovedFromDocument";ElementEvent["BOUNDS_CHANGED"]="bounds-changed";ElementEvent["CULLED"]="culled";})(exports.ElementEvent||(exports.ElementEvent={}));var MutationEvent=/*#__PURE__*/function(_FederatedEvent){_inheritsLoose(MutationEvent,_FederatedEvent);function MutationEvent(typeArg,relatedNode,prevValue,newValue,attrName,attrChange,prevParsedValue,newParsedValue){var _this;_this=_FederatedEvent.call(this,null)||this;_this.relatedNode=void 0;_this.prevValue=void 0;_this.newValue=void 0;_this.attrName=void 0;_this.attrChange=void 0;_this.prevParsedValue=void 0;_this.newParsedValue=void 0;_this.relatedNode=relatedNode;_this.prevValue=prevValue;_this.newValue=newValue;_this.attrName=attrName;_this.attrChange=attrChange;_this.prevParsedValue=prevParsedValue;_this.newParsedValue=newParsedValue;_this.type=typeArg;return _this;}return MutationEvent;}(FederatedEvent);MutationEvent.ADDITION=2;MutationEvent.MODIFICATION=1;MutationEvent.REMOVAL=3;var entityCounter=0;function resetEntityCounter(){entityCounter=0;}var insertedEvent=new MutationEvent(exports.ElementEvent.INSERTED,null,'','','',0,'','');var removedEvent=new MutationEvent(exports.ElementEvent.REMOVED,null,'','','',0,'','');var destroyEvent=new CustomEvent(exports.ElementEvent.DESTROY);/**
8298
8294
  * Has following capabilities:
8299
8295
  * * Node insert/remove, eg. appendChild, removeChild, remove...
8300
8296
  * * Query eg. querySelector getElementById...
8301
8297
  * * Animation
8302
8298
  */var Element=/*#__PURE__*/function(_Node){_inheritsLoose(Element,_Node);function Element(){var _this;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_Node.call.apply(_Node,[this].concat(args))||this;/**
8303
8299
  * Unique id.
8304
- */_this.entity=entityCounter++;_this.renderable={bounds:undefined,boundsDirty:true,renderBounds:undefined,renderBoundsDirty:true,dirtyRenderBounds:undefined,dirty:false,proxyNodeName:undefined};_this.cullable={strategy:exports.Strategy.Standard,visibilityPlaneMask:-1,visible:true,enable:true};_this.transformable={dirtyFlag:false,localDirtyFlag:false,frozen:false,// localPosition: vec3.fromValues(0, 0, 0),
8305
- // localRotation: quat.fromValues(0, 0, 0, 1),
8306
- // localScale: vec3.fromValues(1, 1, 1),
8307
- // localTransform: mat4.create(),
8308
- // localSkew: vec2.fromValues(0, 0),
8309
- // position: vec3.fromValues(0, 0, 0),
8310
- // rotation: quat.fromValues(0, 0, 0, 1),
8311
- // scaling: vec3.fromValues(1, 1, 1),
8312
- // worldTransform: mat4.create(),
8313
- // origin: vec3.fromValues(0, 0, 0),
8314
- localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]};_this.sortable={dirty:false,sorted:undefined,lastSortedIndex:undefined,renderOrder:0};_this.geometry={contentBounds:undefined,renderBounds:undefined};_this.rBushNode={aabb:undefined};/**
8300
+ */_this.entity=entityCounter++;_this.renderable={bounds:undefined,boundsDirty:true,renderBounds:undefined,renderBoundsDirty:true,dirtyRenderBounds:undefined,dirty:false,proxyNodeName:undefined};_this.cullable={strategy:exports.Strategy.Standard,visibilityPlaneMask:-1,visible:true,enable:true};_this.transformable={dirtyFlag:false,localDirtyFlag:false,frozen:false,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]};_this.sortable={dirty:false,sorted:undefined,renderOrder:0,dirtyChildren:[],dirtyReason:undefined};_this.geometry={contentBounds:undefined,renderBounds:undefined};_this.rBushNode={aabb:undefined};/**
8315
8301
  * used with `getElementById()`
8316
8302
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/id
8317
8303
  */_this.id=void 0;/**
@@ -9267,9 +9253,7 @@
9267
9253
  * total display objects in scenegraph
9268
9254
  */total:0,/**
9269
9255
  * number of display objects need to render in current frame
9270
- */rendered:0};this.zIndexCounter=0;/**
9271
- * avoid re-creating too many custom events
9272
- */this.renderOrderChangedEvent=new CustomEvent(exports.ElementEvent.RENDER_ORDER_CHANGED);this.hooks={/**
9256
+ */rendered:0};this.zIndexCounter=0;this.hooks={/**
9273
9257
  * called before any frame rendered
9274
9258
  */init:new AsyncParallelHook(),/**
9275
9259
  * only dirty object which has sth changed will be rendered
@@ -9299,9 +9283,12 @@
9299
9283
  };_proto.renderDisplayObject=function renderDisplayObject(displayObject,canvasConfig,renderingContext){var _this2=this;var _canvasConfig$rendere=canvasConfig.renderer.getConfig(),enableDirtyCheck=_canvasConfig$rendere.enableDirtyCheck,enableCulling=_canvasConfig$rendere.enableCulling;// recalc style values
9300
9284
  if(this.globalRuntime.enableCSSParsing){this.globalRuntime.styleValueRegistry.recalc(displayObject);}// TODO: relayout
9301
9285
  // dirtycheck first
9302
- var objectChanged=enableDirtyCheck?this.hooks.dirtycheck.call(displayObject):displayObject;if(objectChanged){var objectToRender=enableCulling?this.hooks.cull.call(objectChanged,this.context.camera):objectChanged;if(objectToRender){this.stats.rendered++;renderingContext.renderListCurrentFrame.push(objectToRender);}}displayObject.renderable.dirty=false;displayObject.sortable.renderOrder=this.zIndexCounter++;this.stats.total++;// sort is very expensive, use cached result if posible
9303
- var sortable=displayObject.sortable;var renderOrderChanged=false;if(sortable.dirty){sortable.sorted=displayObject.childNodes.slice().sort(sortByZIndex);renderOrderChanged=true;sortable.dirty=false;}// recursive rendering its children
9304
- (sortable.sorted||displayObject.childNodes).forEach(function(child){_this2.renderDisplayObject(child,canvasConfig,renderingContext);});if(renderOrderChanged){displayObject.forEach(function(child){_this2.renderOrderChangedEvent.target=child;_this2.renderOrderChangedEvent.detail={renderOrder:child.sortable.renderOrder};child.ownerDocument.defaultView.dispatchEvent(_this2.renderOrderChangedEvent,true);});}};_proto.destroy=function destroy(){this.inited=false;this.hooks.destroy.call();this.globalRuntime.sceneGraphService.clearPendingEvents();};_proto.dirtify=function dirtify(){// need re-render
9286
+ var objectChanged=enableDirtyCheck?this.hooks.dirtycheck.call(displayObject):displayObject;if(objectChanged){var objectToRender=enableCulling?this.hooks.cull.call(objectChanged,this.context.camera):objectChanged;if(objectToRender){this.stats.rendered++;renderingContext.renderListCurrentFrame.push(objectToRender);}}displayObject.renderable.dirty=false;displayObject.sortable.renderOrder=this.zIndexCounter++;this.stats.total++;// sort is very expensive, use cached result if possible
9287
+ var sortable=displayObject.sortable;if(sortable.dirty){this.sort(displayObject,sortable);sortable.dirty=false;sortable.dirtyChildren=[];sortable.dirtyReason=undefined;}// recursive rendering its children
9288
+ (sortable.sorted||displayObject.childNodes).forEach(function(child){_this2.renderDisplayObject(child,canvasConfig,renderingContext);});};_proto.sort=function sort(displayObject,sortable){if(sortable.sorted&&sortable.dirtyReason!==exports.SortReason.Z_INDEX_CHANGED){// avoid re-sorting the whole children list
9289
+ sortable.dirtyChildren.forEach(function(child){var index=displayObject.childNodes.indexOf(child);if(index===-1){// remove from sorted list
9290
+ var _index=sortable.sorted.indexOf(child);sortable.sorted.splice(_index,1);}else {if(sortable.sorted.length===0){sortable.sorted.push(child);}else {var zIndex=Number(child.parsedStyle.zIndex);var firstZIndex=Number(sortable.sorted[0].parsedStyle.zIndex);var lastZIndex=Number(sortable.sorted[sortable.sorted.length-1].parsedStyle.zIndex);if(zIndex<firstZIndex){sortable.sorted.unshift(child);}else if(zIndex>lastZIndex){sortable.sorted.push(child);}else {// insert into sorted list
9291
+ for(var i=0;i<sortable.sorted.length;i++){var _sortable$sorted,_sortable$sorted$i;var prevZIndex=Number((_sortable$sorted=sortable.sorted[i-1])===null||_sortable$sorted===void 0?void 0:_sortable$sorted.parsedStyle.zIndex)||-Infinity;var currentZIndex=Number((_sortable$sorted$i=sortable.sorted[i])===null||_sortable$sorted$i===void 0?void 0:_sortable$sorted$i.parsedStyle.zIndex);if(zIndex>prevZIndex&&zIndex<currentZIndex){sortable.sorted.splice(i,0,child);break;}if(zIndex===currentZIndex){var currentIndex=displayObject.childNodes.indexOf(sortable.sorted[i]);var nextIndex=displayObject.childNodes.indexOf(sortable.sorted[i+1])||Infinity;if(index>currentIndex&&index<nextIndex){sortable.sorted.splice(i+1,0,child);break;}}}}}}});}else {sortable.sorted=displayObject.childNodes.slice().sort(sortByZIndex);}};_proto.destroy=function destroy(){this.inited=false;this.hooks.destroy.call();this.globalRuntime.sceneGraphService.clearPendingEvents();};_proto.dirtify=function dirtify(){// need re-render
9305
9292
  this.context.renderingContext.renderReasons.add(exports.RenderReason.DISPLAY_OBJECT_CHANGED);};return RenderingService;}();var ATTRIBUTE_REGEXP=/\[\s*(.*)=(.*)\s*\]/;/**
9306
9293
  * support the following DOM API:
9307
9294
  * * getElementById
@@ -9362,9 +9349,9 @@
9362
9349
  if(transform.localSkew[0]!==0||transform.localSkew[1]!==0){var tmpMat4=identity(tmpMat);tmpMat4[4]=Math.tan(transform.localSkew[0]);tmpMat4[1]=Math.tan(transform.localSkew[1]);multiply(transform.localTransform,transform.localTransform,tmpMat4);}var scaling=fromRotationTranslationScaleOrigin(tmpMat,tmpQuat,tmpPosition,transform.localScale,transform.origin);multiply(transform.localTransform,transform.localTransform,scaling);}else {// @see https://github.com/mattdesl/css-mat4/blob/master/index.js
9363
9350
  fromRotationTranslationScaleOrigin(transform.localTransform,transform.localRotation,transform.localPosition,transform.localScale,transform.origin);}};}();this.runtime=runtime;}var _proto=DefaultSceneGraphService.prototype;_proto.matches=function matches(query,root){return this.runtime.sceneGraphSelector.is(query,root);};_proto.querySelector=function querySelector(query,root){return this.runtime.sceneGraphSelector.selectOne(query,root);};_proto.querySelectorAll=function querySelectorAll(query,root){return this.runtime.sceneGraphSelector.selectAll(query,root);// .filter((node) => !node.shadow);
9364
9351
  };_proto.attach=function attach(child,parent,index){var _sortable$sorted,_child$style;var detached=false;if(child.parentNode){detached=child.parentNode!==parent;this.detach(child);}child.parentNode=parent;if(!isNil(index)){child.parentNode.childNodes.splice(index,0,child);}else {child.parentNode.childNodes.push(child);}// parent needs re-sort
9365
- var sortable=parent.sortable;if((sortable===null||sortable===void 0?void 0:(_sortable$sorted=sortable.sorted)===null||_sortable$sorted===void 0?void 0:_sortable$sorted.length)||((_child$style=child.style)===null||_child$style===void 0?void 0:_child$style.zIndex)){// if (sortable) {
9352
+ var sortable=parent.sortable;if((sortable===null||sortable===void 0?void 0:(_sortable$sorted=sortable.sorted)===null||_sortable$sorted===void 0?void 0:_sortable$sorted.length)||((_child$style=child.style)===null||_child$style===void 0?void 0:_child$style.zIndex)){sortable.dirtyChildren.push(child);// if (sortable) {
9366
9353
  // only child has z-Index
9367
- sortable.dirty=true;}// this.updateGraphDepth(child);
9354
+ sortable.dirty=true;sortable.dirtyReason=exports.SortReason.ADDED;}// this.updateGraphDepth(child);
9368
9355
  var transform=child.transformable;if(transform){this.dirtifyWorld(child,transform);}if(transform.frozen){this.unfreezeParentToRoot(child);}if(detached){child.dispatchEvent(reparentEvent);}};_proto.detach=function detach(child){if(child.parentNode){var _sortable$sorted2,_child$style2;var transform=child.transformable;// if (transform) {
9369
9356
  // const worldTransform = this.getWorldTransform(child, transform);
9370
9357
  // mat4.getScaling(transform.localScale, worldTransform);
@@ -9374,7 +9361,7 @@
9374
9361
  // }
9375
9362
  // parent needs re-sort
9376
9363
  var sortable=child.parentNode.sortable;// if (sortable) {
9377
- if((sortable===null||sortable===void 0?void 0:(_sortable$sorted2=sortable.sorted)===null||_sortable$sorted2===void 0?void 0:_sortable$sorted2.length)||((_child$style2=child.style)===null||_child$style2===void 0?void 0:_child$style2.zIndex)){sortable.dirty=true;}var index=child.parentNode.childNodes.indexOf(child);if(index>-1){child.parentNode.childNodes.splice(index,1);}if(transform){this.dirtifyWorld(child,transform);}child.parentNode=null;}};_proto.getOrigin=function getOrigin(element){return element.transformable.origin;}/**
9364
+ if((sortable===null||sortable===void 0?void 0:(_sortable$sorted2=sortable.sorted)===null||_sortable$sorted2===void 0?void 0:_sortable$sorted2.length)||((_child$style2=child.style)===null||_child$style2===void 0?void 0:_child$style2.zIndex)){sortable.dirtyChildren.push(child);sortable.dirty=true;sortable.dirtyReason=exports.SortReason.REMOVED;}var index=child.parentNode.childNodes.indexOf(child);if(index>-1){child.parentNode.childNodes.splice(index,1);}if(transform){this.dirtifyWorld(child,transform);}child.parentNode=null;}};_proto.getOrigin=function getOrigin(element){return element.transformable.origin;}/**
9378
9365
  * same as pivot in Pixi.js
9379
9366
  *
9380
9367
  * @see https://stackoverflow.com/questions/40748452/how-to-change-css-transform-origin-but-preserve-transformation