@geoscene/core 4.23.12 → 4.23.13

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.
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
4
4
  */
5
- import{schema_definitions as e}from"./definitions.js";const i={title:"Scene Layer config on layer item",type:"object",properties:{layers:{type:"array",items:{properties:{disablePopup:{type:"boolean",description:"disablePopups allows a client to ignore popups defined by the service item."},id:{type:"integer",description:"ID of the service layer."},layerDefinition:{type:"object",description:"A layerDefinition object defining the attribute schema and drawing information for the layer.",allOf:[{$ref:"#/definitions/layerDefinition_schema.json"},{properties:{definitionExpression:{},drawingInfo:{allOf:[{$ref:"#/definitions/drawingInfo_schema.json"},{properties:{labelingInfo:{},renderer:{},transparency:{}},additionalProperties:!1}]},elevationInfo:{},excludeObjectIds:{},featureReduction:{},floorInfo:{},maxScale:{},minScale:{},rangeInfos:{}},additionalProperties:!1}]},listMode:{type:"string",description:"To show or hide layers in the layer list",enum:["hide","show"],default:"show"},opacity:{type:"number",description:"The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.",minimum:0,maximum:1,default:1},popupInfo:{description:"A popupInfo object defining the content of pop-up windows when you click or query a feature.",$ref:"#/definitions/popupInfo_schema.json"},screenSizePerspective:{type:"boolean",description:"Apply [perspective scaling](https://developers.geoscene.cn/javascript/latest/api-reference/geoscene-layers-FeatureLayer.html#screenSizePerspectiveEnabled) to screen-size symbols.",default:!0},showLabels:{type:"boolean",description:"If the layer has a labelingInfo property then labels show on the scene only if the showLabels property it true.",default:!1},showLegend:{type:"boolean",description:"Boolean value indicating whether to display the layer in the legend. Default value is `true`.",default:!0},visibility:{type:"boolean",description:"Boolean property determining whether the layer is initially visible in the web scene",default:!0}},additionalProperties:!1}}},additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema",definitions:e};export{i as json};
5
+ import{schema_definitions as e}from"./definitions.js";const i={title:"Scene Layer config on layer item",type:"object",properties:{layers:{type:"array",items:{properties:{disablePopup:{type:"boolean",description:"disablePopups allows a client to ignore popups defined by the service item."},id:{type:"integer",description:"ID of the service layer."},layerDefinition:{type:"object",description:"A layerDefinition object defining the attribute schema and drawing information for the layer.",allOf:[{$ref:"#/definitions/layerDefinition_schema.json"},{properties:{definitionExpression:{},drawingInfo:{allOf:[{$ref:"#/definitions/drawingInfo_schema.json"},{properties:{labelingInfo:{},renderer:{},transparency:{}},additionalProperties:!1}]},elevationInfo:{},excludeObjectIds:{},featureReduction:{},floorInfo:{},maxScale:{},minScale:{},rangeInfos:{}},additionalProperties:!1}]},listMode:{type:"string",description:"To show or hide layers in the layer list",enum:["hide","show"],default:"show"},opacity:{type:"number",description:"The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.",minimum:0,maximum:1,default:1},popupInfo:{description:"A popupInfo object defining the content of pop-up windows when you click or query a feature.",$ref:"#/definitions/popupInfo_schema.json"},screenSizePerspective:{type:"boolean",description:"Apply [perspective scaling](https://doc.geoscene.cn/javascript/4.23/api-reference/geoscene-layers-FeatureLayer.html#screenSizePerspectiveEnabled) to screen-size symbols.",default:!0},showLabels:{type:"boolean",description:"If the layer has a labelingInfo property then labels show on the scene only if the showLabels property it true.",default:!1},showLegend:{type:"boolean",description:"Boolean value indicating whether to display the layer in the legend. Default value is `true`.",default:!0},visibility:{type:"boolean",description:"Boolean property determining whether the layer is initially visible in the web scene",default:!0}},additionalProperties:!1}}},additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema",definitions:e};export{i as json};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
4
4
  */
5
- import{deprecated as e}from"../../core/deprecate.js";function t(t,r,s){e(t,"`"+r+"` is deprecated, because it instantiates the deprecated class 'geoscene.widgets.Editor.CreateWorkflow'",{replacement:s,version:"4.23",see:"https://developers.geoscene.cn/javascript/latest/api-reference/geoscene-widgets-Editor-CreateFeaturesWorkflow.html"})}export{t as workflowDeprecation};
5
+ import{deprecated as e}from"../../core/deprecate.js";function t(t,r,s){e(t,"`"+r+"` is deprecated, because it instantiates the deprecated class 'geoscene.widgets.Editor.CreateWorkflow'",{replacement:s,version:"4.23",see:"https://doc.geoscene.cn/javascript/4.23/api-reference/geoscene-widgets-Editor-CreateFeaturesWorkflow.html"})}export{t as workflowDeprecation};
package/widgets/Widget.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecated as t}from"../core/deprecate.js";import{byId as r}from"../core/domUtils.js";import o from"../core/Evented.js";import s from"../core/Handles.js";import"../core/has.js";import{clone as i}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as a}from"../core/maybe.js";import{EsriPromiseMixin as d}from"../core/Promise.js";import{debounce as l,throwIfNotAbortError as c,eachAlways as p}from"../core/promiseUtils.js";import{watch as h,when as m,initial as u}from"../core/reactiveUtils.js";import{generateUUID as g}from"../core/uuid.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import{cast as v}from"../core/accessorSupport/decorators/cast.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import{runTracked as f}from"../core/accessorSupport/tracking.js";import{SimpleTrackingTarget as j}from"../core/accessorSupport/tracking/SimpleTrackingTarget.js";import{createAdvancedProjector as w}from"../libs/maquette-advanced-projector/projector.js";import{commitAssetPath as k}from"./support/componentsUtils.js";import{isWidgetConstructor as b,processWidgets as R,WIDGET_SYMBOL as S}from"./support/jsxWidgetSupport.js";import{getVNodeCache as C,setVNodeCache as T,deleteVNodeCache as H,clearVNodeCache as P}from"./support/vnodeCache.js";import{classes as E}from"./support/widgetUtils.js";import{getThemeName as L}from"./support/widgetThemeUtils.js";import{onLocaleChange as N}from"../intl/locale.js";import{fetchMessageBundle as I}from"../intl/messages.js";const U="geoscene.widgets.Widget",F=n.getLogger(U);let $=0;const x={widgetIcon:"geoscene-icon-checkbox-unchecked"};function z(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?z(e[r],t[r]):e[r]=t[r]);return e}const A=w({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,o,s,i)=>{const n=t(e,o,s,i),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in s)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>n.call(s,e);s.addEventListener(t,r,a);const o=()=>s.removeEventListener(t,r,a),d=i.afterRemoved;i.afterRemoved=e=>{null==d||d(e),o()}}return n}},handleInterceptedEvent(e,t,r,o){const{eventPhase:s,type:i}=o,n=s===Event.CAPTURING_PHASE;let a=`on${i}${n?"capture":""}`;const d=t.properties;(a in d||(a=`on${i[0].toUpperCase()}${i.slice(1)}${n?"Capture":""}`,a in d))&&(P(),e.scheduleRender(),d[a].call(d.bind||r,o))}});let M=!1,O=class extends(d(o.EventedAccessor)){constructor(e,r){super(e,r),this._attached=!1,this._internalHandles=new s,this._projector=A,this._readyForTrueRender=!1,this.domNode=null,this.iconClass=x.widgetIcon,this.label=this.declaredClass.split(".").pop(),this.visible=!0,this.key=this,this._loadLocale=l((async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const e=await p(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{let r=await I(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=z(i(r),this.uiStrings)),this[t]=r})));for(const t of e)t.error&&F.error("widget-intl:locale-error",this.declaredClass,t.error)}await this.loadLocale()})),k();const o=["light","dark"],n=L()||"light";o.includes(n)||t(F,"The following themes are deprecated: light-blue, dark-blue, light-green, dark-green, light-purple, dark-purple, light-red, and dark-red.",{version:"4.19",warnOnce:!0,see:"https://developers.geoscene.cn/javascript/latest/styling/"});const a="geoscene-widget-uid-"+g(),d=this.render.bind(this);this._trackingTarget=new j((()=>this.scheduleRender()));const c=()=>{var e;if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:a,class:"",styles:{display:"none"}},domNode:void 0,children:void 0,text:void 0};const t=d();let{properties:r}=t;r||(t.properties=r={});let{key:o,styles:s}=r;o||(r.key=a),s||(r.styles=s={}),s.display||(s.display="");let i=0;return null==(e=t.children)||e.forEach((e=>{if(b(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${i++}`)})),R(this,t)};this.render=()=>{if(M)return c();let e=C(this);if(e)return e;this._trackingTarget.clear(),M=!0;try{e=f(this._trackingTarget,c)}finally{M=!1}return T(this,e),e},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then((()=>{this._readyForTrueRender=!0,this._postInitialize()})))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then((()=>{})).catch(c)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||(this._trackingTarget=a(this._trackingTarget),this.viewModel=a(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,H(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return r(e)}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+$++}set id(e){e&&this._set("id",e)}get renderable(){return this._resourcesFetch}get test(){return{projector:this._projector,handles:this._internalHandles}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(H(this),this._projector.scheduleRender())}classes(...e){return E.apply(this,e)}own(e){arguments.length>1&&(e=Array.prototype.slice.call(arguments)),this._internalHandles.add(e)}renderNow(){H(this),this._projector.renderNow()}_postInitialize(){var e;if(this.destroyed)return;this.scheduleRender(),null!=(e=this._delegatedEventNames)&&e.length&&this._internalHandles.add(h((()=>this.viewModel),((e,t)=>{t&&this._internalHandles.remove("delegated-events"),e&&this._internalHandles.add(this._delegatedEventNames.map((t=>e.on(t,(e=>{this.emit(t,e)})))),"delegated-events")}),u)),this.postInitialize();const t=async()=>{await this._loadLocale().catch(c),this.scheduleRender()};this._internalHandles.add([N(t),h((()=>this.uiStrings),t),m((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){e&&this._attached&&(this._projector.detach(this.render),e.parentNode&&e.parentNode.removeChild(e),this._attached=!1)}};O[S]=!0,e([y()],O.prototype,"_readyForTrueRender",void 0),e([y({value:null})],O.prototype,"container",null),e([v("container")],O.prototype,"castContainer",null),e([y({aliasOf:"container"})],O.prototype,"domNode",void 0),e([y()],O.prototype,"iconClass",void 0),e([y()],O.prototype,"id",null),e([y()],O.prototype,"label",void 0),e([y()],O.prototype,"renderable",null),e([y()],O.prototype,"uiStrings",void 0),e([y()],O.prototype,"viewModel",void 0),e([y()],O.prototype,"visible",void 0),e([y()],O.prototype,"key",void 0),e([y()],O.prototype,"children",void 0),e([y()],O.prototype,"afterCreate",void 0),e([y()],O.prototype,"afterUpdate",void 0),e([y()],O.prototype,"afterRemoved",void 0),O=e([_(U)],O);const B=O;export{B as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecated as t}from"../core/deprecate.js";import{byId as r}from"../core/domUtils.js";import o from"../core/Evented.js";import s from"../core/Handles.js";import"../core/has.js";import{clone as i}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as a}from"../core/maybe.js";import{EsriPromiseMixin as d}from"../core/Promise.js";import{debounce as l,throwIfNotAbortError as c,eachAlways as p}from"../core/promiseUtils.js";import{watch as h,when as m,initial as u}from"../core/reactiveUtils.js";import{generateUUID as g}from"../core/uuid.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import{cast as v}from"../core/accessorSupport/decorators/cast.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import{runTracked as f}from"../core/accessorSupport/tracking.js";import{SimpleTrackingTarget as j}from"../core/accessorSupport/tracking/SimpleTrackingTarget.js";import{createAdvancedProjector as w}from"../libs/maquette-advanced-projector/projector.js";import{commitAssetPath as k}from"./support/componentsUtils.js";import{isWidgetConstructor as b,processWidgets as R,WIDGET_SYMBOL as S}from"./support/jsxWidgetSupport.js";import{getVNodeCache as C,setVNodeCache as T,deleteVNodeCache as H,clearVNodeCache as P}from"./support/vnodeCache.js";import{classes as E}from"./support/widgetUtils.js";import{getThemeName as L}from"./support/widgetThemeUtils.js";import{onLocaleChange as N}from"../intl/locale.js";import{fetchMessageBundle as I}from"../intl/messages.js";const U="geoscene.widgets.Widget",F=n.getLogger(U);let $=0;const x={widgetIcon:"geoscene-icon-checkbox-unchecked"};function z(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?z(e[r],t[r]):e[r]=t[r]);return e}const A=w({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,o,s,i)=>{const n=t(e,o,s,i),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in s)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>n.call(s,e);s.addEventListener(t,r,a);const o=()=>s.removeEventListener(t,r,a),d=i.afterRemoved;i.afterRemoved=e=>{null==d||d(e),o()}}return n}},handleInterceptedEvent(e,t,r,o){const{eventPhase:s,type:i}=o,n=s===Event.CAPTURING_PHASE;let a=`on${i}${n?"capture":""}`;const d=t.properties;(a in d||(a=`on${i[0].toUpperCase()}${i.slice(1)}${n?"Capture":""}`,a in d))&&(P(),e.scheduleRender(),d[a].call(d.bind||r,o))}});let M=!1,O=class extends(d(o.EventedAccessor)){constructor(e,r){super(e,r),this._attached=!1,this._internalHandles=new s,this._projector=A,this._readyForTrueRender=!1,this.domNode=null,this.iconClass=x.widgetIcon,this.label=this.declaredClass.split(".").pop(),this.visible=!0,this.key=this,this._loadLocale=l((async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const e=await p(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{let r=await I(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=z(i(r),this.uiStrings)),this[t]=r})));for(const t of e)t.error&&F.error("widget-intl:locale-error",this.declaredClass,t.error)}await this.loadLocale()})),k();const o=["light","dark"],n=L()||"light";o.includes(n)||t(F,"The following themes are deprecated: light-blue, dark-blue, light-green, dark-green, light-purple, dark-purple, light-red, and dark-red.",{version:"4.19",warnOnce:!0,see:"https://doc.geoscene.cn/javascript/4.23/styling/"});const a="geoscene-widget-uid-"+g(),d=this.render.bind(this);this._trackingTarget=new j((()=>this.scheduleRender()));const c=()=>{var e;if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:a,class:"",styles:{display:"none"}},domNode:void 0,children:void 0,text:void 0};const t=d();let{properties:r}=t;r||(t.properties=r={});let{key:o,styles:s}=r;o||(r.key=a),s||(r.styles=s={}),s.display||(s.display="");let i=0;return null==(e=t.children)||e.forEach((e=>{if(b(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${i++}`)})),R(this,t)};this.render=()=>{if(M)return c();let e=C(this);if(e)return e;this._trackingTarget.clear(),M=!0;try{e=f(this._trackingTarget,c)}finally{M=!1}return T(this,e),e},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then((()=>{this._readyForTrueRender=!0,this._postInitialize()})))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then((()=>{})).catch(c)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||(this._trackingTarget=a(this._trackingTarget),this.viewModel=a(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,H(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return r(e)}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+$++}set id(e){e&&this._set("id",e)}get renderable(){return this._resourcesFetch}get test(){return{projector:this._projector,handles:this._internalHandles}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(H(this),this._projector.scheduleRender())}classes(...e){return E.apply(this,e)}own(e){arguments.length>1&&(e=Array.prototype.slice.call(arguments)),this._internalHandles.add(e)}renderNow(){H(this),this._projector.renderNow()}_postInitialize(){var e;if(this.destroyed)return;this.scheduleRender(),null!=(e=this._delegatedEventNames)&&e.length&&this._internalHandles.add(h((()=>this.viewModel),((e,t)=>{t&&this._internalHandles.remove("delegated-events"),e&&this._internalHandles.add(this._delegatedEventNames.map((t=>e.on(t,(e=>{this.emit(t,e)})))),"delegated-events")}),u)),this.postInitialize();const t=async()=>{await this._loadLocale().catch(c),this.scheduleRender()};this._internalHandles.add([N(t),h((()=>this.uiStrings),t),m((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){e&&this._attached&&(this._projector.detach(this.render),e.parentNode&&e.parentNode.removeChild(e),this._attached=!1)}};O[S]=!0,e([y()],O.prototype,"_readyForTrueRender",void 0),e([y({value:null})],O.prototype,"container",null),e([v("container")],O.prototype,"castContainer",null),e([y({aliasOf:"container"})],O.prototype,"domNode",void 0),e([y()],O.prototype,"iconClass",void 0),e([y()],O.prototype,"id",null),e([y()],O.prototype,"label",void 0),e([y()],O.prototype,"renderable",null),e([y()],O.prototype,"uiStrings",void 0),e([y()],O.prototype,"viewModel",void 0),e([y()],O.prototype,"visible",void 0),e([y()],O.prototype,"key",void 0),e([y()],O.prototype,"children",void 0),e([y()],O.prototype,"afterCreate",void 0),e([y()],O.prototype,"afterUpdate",void 0),e([y()],O.prototype,"afterRemoved",void 0),O=e([_(U)],O);const B=O;export{B as default};