@itwin/core-frontend 5.9.0-dev.9 → 5.9.1
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/CHANGELOG.md +37 -1
- package/lib/cjs/BriefcaseConnection.d.ts +2 -2
- package/lib/cjs/BriefcaseConnection.js +2 -2
- package/lib/cjs/BriefcaseConnection.js.map +1 -1
- package/lib/cjs/PerModelCategoryVisibility.d.ts.map +1 -1
- package/lib/cjs/PerModelCategoryVisibility.js +83 -81
- package/lib/cjs/PerModelCategoryVisibility.js.map +1 -1
- package/lib/cjs/SpatialViewState.d.ts.map +1 -1
- package/lib/cjs/SpatialViewState.js +3 -1
- package/lib/cjs/SpatialViewState.js.map +1 -1
- package/lib/cjs/ViewState.d.ts +32 -0
- package/lib/cjs/ViewState.d.ts.map +1 -1
- package/lib/cjs/ViewState.js +41 -4
- package/lib/cjs/ViewState.js.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/cjs/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/cjs/internal/render/webgl/RenderCommands.js.map +1 -1
- package/lib/cjs/quantity-formatting/AlternateUnitLabels.d.ts +8 -0
- package/lib/cjs/quantity-formatting/AlternateUnitLabels.d.ts.map +1 -0
- package/lib/cjs/quantity-formatting/AlternateUnitLabels.js +26 -0
- package/lib/cjs/quantity-formatting/AlternateUnitLabels.js.map +1 -0
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts +119 -22
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.js +271 -65
- package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/cjs/tile/GltfReader.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/cjs/tools/PrimitiveTool.d.ts +1 -1
- package/lib/cjs/tools/PrimitiveTool.js +1 -1
- package/lib/cjs/tools/PrimitiveTool.js.map +1 -1
- package/lib/cjs/tools/ToolAdmin.d.ts +16 -1
- package/lib/cjs/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/cjs/tools/ToolAdmin.js +52 -5
- package/lib/cjs/tools/ToolAdmin.js.map +1 -1
- package/lib/cjs/tools/ToolSettings.d.ts +4 -0
- package/lib/cjs/tools/ToolSettings.d.ts.map +1 -1
- package/lib/cjs/tools/ToolSettings.js +4 -0
- package/lib/cjs/tools/ToolSettings.js.map +1 -1
- package/lib/esm/BriefcaseConnection.d.ts +2 -2
- package/lib/esm/BriefcaseConnection.js +2 -2
- package/lib/esm/BriefcaseConnection.js.map +1 -1
- package/lib/esm/PerModelCategoryVisibility.d.ts.map +1 -1
- package/lib/esm/PerModelCategoryVisibility.js +84 -82
- package/lib/esm/PerModelCategoryVisibility.js.map +1 -1
- package/lib/esm/SpatialViewState.d.ts.map +1 -1
- package/lib/esm/SpatialViewState.js +3 -1
- package/lib/esm/SpatialViewState.js.map +1 -1
- package/lib/esm/ViewState.d.ts +32 -0
- package/lib/esm/ViewState.d.ts.map +1 -1
- package/lib/esm/ViewState.js +42 -5
- package/lib/esm/ViewState.js.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.d.ts.map +1 -1
- package/lib/esm/internal/render/webgl/FrustumUniforms.js.map +1 -1
- package/lib/esm/internal/render/webgl/RenderCommands.js.map +1 -1
- package/lib/esm/quantity-formatting/AlternateUnitLabels.d.ts +8 -0
- package/lib/esm/quantity-formatting/AlternateUnitLabels.d.ts.map +1 -0
- package/lib/esm/quantity-formatting/AlternateUnitLabels.js +23 -0
- package/lib/esm/quantity-formatting/AlternateUnitLabels.js.map +1 -0
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts +119 -22
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.js +269 -63
- package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/esm/tile/GltfReader.js.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/esm/tools/PrimitiveTool.d.ts +1 -1
- package/lib/esm/tools/PrimitiveTool.js +1 -1
- package/lib/esm/tools/PrimitiveTool.js.map +1 -1
- package/lib/esm/tools/ToolAdmin.d.ts +16 -1
- package/lib/esm/tools/ToolAdmin.d.ts.map +1 -1
- package/lib/esm/tools/ToolAdmin.js +52 -5
- package/lib/esm/tools/ToolAdmin.js.map +1 -1
- package/lib/esm/tools/ToolSettings.d.ts +4 -0
- package/lib/esm/tools/ToolSettings.d.ts.map +1 -1
- package/lib/esm/tools/ToolSettings.js +4 -0
- package/lib/esm/tools/ToolSettings.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +20 -20
- package/lib/cjs/quantity-formatting/BasicUnitsProvider.d.ts +0 -38
- package/lib/cjs/quantity-formatting/BasicUnitsProvider.d.ts.map +0 -1
- package/lib/cjs/quantity-formatting/BasicUnitsProvider.js +0 -160
- package/lib/cjs/quantity-formatting/BasicUnitsProvider.js.map +0 -1
- package/lib/esm/quantity-formatting/BasicUnitsProvider.d.ts +0 -38
- package/lib/esm/quantity-formatting/BasicUnitsProvider.d.ts.map +0 -1
- package/lib/esm/quantity-formatting/BasicUnitsProvider.js +0 -155
- package/lib/esm/quantity-formatting/BasicUnitsProvider.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayerFormatRegistry.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAgC,8BAA8B,EAA6E,cAAc,EAAE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AAQ,CAAC,CAAC;YAC1C,MAAM,GAAG,KAAK,EAAE,IAAI,CAAC;YACrB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,MAAM,MAAM,GAAI,cAAc,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAC,CAAC,CAAC;gBACnE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;oBACzB,IAAI,GAAG,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC;oBAC7B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;oBAC3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBAC7B,CAAC;YAEH,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAChE,MAAM,GAAG,KAAK,EAAE,IAAI,CAAC;YACrB,IAAI,GAAG,cAAc,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;YAClB,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAAC;QAExD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayers\n */\n\nimport { assert, expectDefined, Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, MapLayerKey, MapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { IModelConnection } from \"../../IModelConnection\";\nimport { ImageryMapLayerTreeReference, internalMapLayerImageryFormats, MapLayerAccessClient, MapLayerAuthenticationInfo, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerTileTreeReference } from \"../internal\";\nconst loggerCategory = \"ArcGISFeatureProvider\";\n\n/**\n * Class representing a map-layer format.\n * Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].\n * When creating an [[ImageMapLayerSettings]] object, a format needs to be specified this 'formatId'.\n * The MapLayerFormat object can later be used to validate a source, or create a provider.\n *\n * Subclasses should override formatId, [[MapLayerFormat.createImageryProvider]], and [[MapLayerFormat.createMapLayerTree]].\n * @public\n */\nexport class MapLayerFormat {\n public static formatId: string;\n\n /** Register the current format in the [[MapLayerFormatRegistry]]. */\n public static register() { IModelApp.mapLayerFormatRegistry.register(this); }\n\n /**\n * Allow a source of a specific format to be validated before being attached as a map-layer.\n * @param _url The URL of the source.\n * @param _userName The username to access the source if needed.\n * @param _password The password to access the source if needed.\n * @param _ignoreCache Flag to skip cache lookup (i.e. force a new server request).\n * @returns Validation Status. If successful, a list of available sub-layers may also be returned.\n */\n public static async validateSource(_url: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _accesKey?: MapLayerKey): Promise<MapLayerSourceValidation> { return { status: MapLayerSourceStatus.Valid }; }\n\n /** Allow a source object to be validated before being attached as a map-layer.\n * @beta\n */\n public static async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\n return this.validateSource(args.source.url, args.source.userName, args.source.password, args.ignoreCache);\n }\n\n /**\n * Create a [[MapLayerImageryProvider]] that will be used to feed data in a map-layer tile tree.\n * @param _settings The map layer settings to be applied to the imagery provider.\n * @returns Returns the new imagery provider.\n * @beta\n */\n public static createImageryProvider(_settings: MapLayerSettings): MapLayerImageryProvider | undefined { assert(false); }\n\n /**\n * Creates a MapLayerTileTreeReference for this map layer format.\n * @param _layerSettings Map layer settings that are applied to the MapLayerTileTreeReference.\n * @param _layerIndex The index of the associated map layer.\n * @param _iModel The iModel containing the MapLayerTileTreeReference.\n * @returns Returns the new tile tree reference.\n * @beta\n */\n public static createMapLayerTree(_layerSettings: MapLayerSettings, _layerIndex: number, _iModel: IModelConnection): MapLayerTileTreeReference | undefined {\n assert(false);\n return undefined;\n }\n\n}\n\n/** Options for validating sources\n * @beta\n */\nexport interface ValidateSourceArgs {\n source: MapLayerSource;\n /** Disable cache lookup during validate process */\n ignoreCache?: boolean;\n}\n\n/**\n * The type of a map layer format.\n * @public\n */\nexport type MapLayerFormatType = typeof MapLayerFormat;\n\n/** @public */\nexport interface MapLayerSourceValidation {\n status: MapLayerSourceStatus;\n subLayers?: MapSubLayerProps[];\n\n /** @beta */\n authInfo?: MapLayerAuthenticationInfo;\n}\n\n/**\n * Options supplied at startup via [[IModelAppOptions.mapLayerOptions]] to specify access keys for various map layer formats.\n * 'BingMaps' must have it's key value set to 'key'\n * 'MapboxImagery' must have it's key value set to 'access_token'\n *\n * @public\n */\nexport interface MapLayerOptions {\n /** Access key for Azure Maps in the format `{ key: \"subscription-key\", value: \"your-azure-maps-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n AzureMaps?: MapLayerKey;\n /** Access key for Mapbox in the format `{ key: \"access_token\", value: \"your-mapbox-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MapboxImagery?: MapLayerKey;\n /** Access key for Bing Maps in the format `{ key: \"key\", value: \"your-bing-maps-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n BingMaps?: MapLayerKey;\n /** Access keys for additional map layer formats. */\n [format: string]: MapLayerKey | undefined;\n}\n\n/** @internal */\nexport interface MapLayerFormatEntry {\n type: MapLayerFormatType;\n accessClient?: MapLayerAccessClient;\n}\n\n/**\n * A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].\n * @public\n */\nexport class MapLayerFormatRegistry {\n private _configOptions: MapLayerOptions;\n constructor(opts?: MapLayerOptions) {\n this._configOptions = opts ?? {};\n internalMapLayerImageryFormats.forEach((format) => this.register(format));\n }\n private _formats = new Map<string, MapLayerFormatEntry>();\n\n public isRegistered(formatId: string) { return this._formats.get(formatId) !== undefined; }\n\n public register(formatClass: MapLayerFormatType) {\n if (formatClass.formatId.length === 0)\n return; // must be an abstract class, ignore it\n\n this._formats.set(formatClass.formatId, { type: formatClass });\n }\n\n /** @beta */\n public setAccessClient(formatId: string, accessClient: MapLayerAccessClient): boolean {\n const entry = this._formats.get(formatId);\n if (entry !== undefined) {\n entry.accessClient = accessClient;\n return true;\n }\n return false;\n }\n\n /** @beta */\n public getAccessClient(formatId: string): MapLayerAccessClient | undefined {\n if (formatId.length === 0)\n return undefined;\n\n return this._formats.get(formatId)?.accessClient;\n }\n\n public get configOptions(): MapLayerOptions {\n return this._configOptions;\n }\n\n /** @internal */\n public createImageryMapLayerTree(layerSettings: ImageMapLayerSettings, layerIndex: number, iModel: IModelConnection): ImageryMapLayerTreeReference | undefined {\n const entry = this._formats.get(layerSettings.formatId);\n const format = entry?.type;\n if (format === undefined) {\n Logger.logError(loggerCategory, `Could not find format '${layerSettings.formatId}' in registry`);\n return undefined;\n }\n return format.createMapLayerTree(layerSettings, layerIndex, iModel) as ImageryMapLayerTreeReference;\n }\n\n /**\n * Returns a [[MapLayerImageryProvider]] based on the provided [[ImageMapLayerSettings]] object.\n * @internal\n */\n public createImageryProvider(layerSettings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\n const entry = this._formats.get(layerSettings.formatId);\n const format = entry?.type;\n if (this._configOptions[layerSettings.formatId] !== undefined) {\n const keyValuePair = expectDefined(this._configOptions[layerSettings.formatId]);\n const key: MapLayerKey = { key: keyValuePair.key, value: keyValuePair.value };\n layerSettings = layerSettings.clone({ accessKey: key });\n }\n return (format === undefined) ? undefined : format.createImageryProvider(layerSettings);\n }\n\n /** @beta*/\n public async validateSource(opts: ValidateSourceArgs): Promise<MapLayerSourceValidation>;\n\n public async validateSource(formatId: string, url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation>;\n\n /** @internal*/\n public async validateSource(formatIdOrArgs: string|ValidateSourceArgs, url?: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\n let format: typeof MapLayerFormat | undefined;\n let args: ValidateSourceArgs | undefined;\n\n if (typeof formatIdOrArgs == \"string\" && url !== undefined) {\n const formatId = formatIdOrArgs;\n const entry = this._formats.get(formatId);\n format = entry?.type;\n if (format !== undefined) {\n const source = MapLayerSource.fromJSON({name: \"\", formatId, url});\n if (source !== undefined) {\n args = {source, ignoreCache};\n source.userName = userName;\n source.password = password;\n }\n\n }\n } else if (typeof formatIdOrArgs !== \"string\") {\n const entry = this._formats.get(formatIdOrArgs.source.formatId);\n format = entry?.type;\n args = formatIdOrArgs;\n }\n\n if (!args || !format)\n return { status: MapLayerSourceStatus.InvalidFormat };\n\n return format.validate(args);\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"MapLayerFormatRegistry.js","sourceRoot":"","sources":["../../../../src/tile/map/MapLayerFormatRegistry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAgC,8BAA8B,EAA6E,cAAc,EAAE,oBAAoB,EAA6B,MAAM,aAAa,CAAC;AACvO,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,OAAO,cAAc;IAClB,MAAM,CAAC,QAAQ,CAAS;IAE/B,qEAAqE;IAC9D,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE7E;;;;;;;OAOG;IACI,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,IAAY,EAAE,SAAkB,EAAE,SAAkB,EAAE,YAAsB,EAAE,SA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AC,QAAQ,GAAG,QAAQ,CAAC;gBAC7B,CAAC;YAEH,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAChE,MAAM,GAAG,KAAK,EAAE,IAAI,CAAC;YACrB,IAAI,GAAG,cAAc,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;YAClB,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAAC;QAExD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module MapLayers\n */\n\nimport { assert, expectDefined, Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, MapLayerKey, MapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { IModelConnection } from \"../../IModelConnection\";\nimport { ImageryMapLayerTreeReference, internalMapLayerImageryFormats, MapLayerAccessClient, MapLayerAuthenticationInfo, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerTileTreeReference } from \"../internal\";\nconst loggerCategory = \"ArcGISFeatureProvider\";\n\n/**\n * Class representing a map-layer format.\n * Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].\n * When creating an [[ImageMapLayerSettings]] object, a format needs to be specified this 'formatId'.\n * The MapLayerFormat object can later be used to validate a source, or create a provider.\n *\n * Subclasses should override formatId, [[MapLayerFormat.createImageryProvider]], and [[MapLayerFormat.createMapLayerTree]].\n * @public\n */\nexport class MapLayerFormat {\n public static formatId: string;\n\n /** Register the current format in the [[MapLayerFormatRegistry]]. */\n public static register() { IModelApp.mapLayerFormatRegistry.register(this); }\n\n /**\n * Allow a source of a specific format to be validated before being attached as a map-layer.\n * @param _url The URL of the source.\n * @param _userName The username to access the source if needed.\n * @param _password The password to access the source if needed.\n * @param _ignoreCache Flag to skip cache lookup (i.e. force a new server request).\n * @returns Validation Status. If successful, a list of available sub-layers may also be returned.\n */\n public static async validateSource(_url: string, _userName?: string, _password?: string, _ignoreCache?: boolean, _accesKey?: MapLayerKey): Promise<MapLayerSourceValidation> { return { status: MapLayerSourceStatus.Valid }; }\n\n /** Allow a source object to be validated before being attached as a map-layer.\n * @beta\n */\n public static async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\n return this.validateSource(args.source.url, args.source.userName, args.source.password, args.ignoreCache);\n }\n\n /**\n * Create a [[MapLayerImageryProvider]] that will be used to feed data in a map-layer tile tree.\n * @param _settings The map layer settings to be applied to the imagery provider.\n * @returns Returns the new imagery provider.\n * @beta\n */\n public static createImageryProvider(_settings: MapLayerSettings): MapLayerImageryProvider | undefined { assert(false); }\n\n /**\n * Creates a MapLayerTileTreeReference for this map layer format.\n * @param _layerSettings Map layer settings that are applied to the MapLayerTileTreeReference.\n * @param _layerIndex The index of the associated map layer.\n * @param _iModel The iModel containing the MapLayerTileTreeReference.\n * @returns Returns the new tile tree reference.\n * @beta\n */\n public static createMapLayerTree(_layerSettings: MapLayerSettings, _layerIndex: number, _iModel: IModelConnection): MapLayerTileTreeReference | undefined {\n assert(false);\n return undefined;\n }\n\n}\n\n/** Options for validating sources\n * @beta\n */\nexport interface ValidateSourceArgs {\n source: MapLayerSource;\n /** Disable cache lookup during validate process */\n ignoreCache?: boolean;\n}\n\n/**\n * The type of a map layer format.\n * @public\n */\nexport type MapLayerFormatType = typeof MapLayerFormat;\n\n/** @public */\nexport interface MapLayerSourceValidation {\n status: MapLayerSourceStatus;\n subLayers?: MapSubLayerProps[];\n\n /** @beta */\n authInfo?: MapLayerAuthenticationInfo;\n}\n\n/**\n * Options supplied at startup via [[IModelAppOptions.mapLayerOptions]] to specify access keys for various map layer formats.\n * 'BingMaps' must have it's key value set to 'key'\n * 'MapboxImagery' must have it's key value set to 'access_token'\n *\n * @public\n */\nexport interface MapLayerOptions {\n /** Access key for Azure Maps in the format `{ key: \"subscription-key\", value: \"your-azure-maps-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n AzureMaps?: MapLayerKey;\n /** Access key for Mapbox in the format `{ key: \"access_token\", value: \"your-mapbox-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n MapboxImagery?: MapLayerKey;\n /** Access key for Bing Maps in the format `{ key: \"key\", value: \"your-bing-maps-key\" }`. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n BingMaps?: MapLayerKey;\n /** Access keys for additional map layer formats. */\n [format: string]: MapLayerKey | undefined;\n}\n\n/** @internal */\nexport interface MapLayerFormatEntry {\n type: MapLayerFormatType;\n accessClient?: MapLayerAccessClient;\n}\n\n/**\n * A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].\n * @public\n */\nexport class MapLayerFormatRegistry {\n private _configOptions: MapLayerOptions;\n constructor(opts?: MapLayerOptions) {\n this._configOptions = opts ?? {};\n internalMapLayerImageryFormats.forEach((format) => this.register(format));\n }\n private _formats = new Map<string, MapLayerFormatEntry>();\n\n public isRegistered(formatId: string) { return this._formats.get(formatId) !== undefined; }\n\n public register(formatClass: MapLayerFormatType) {\n if (formatClass.formatId.length === 0)\n return; // must be an abstract class, ignore it\n\n this._formats.set(formatClass.formatId, { type: formatClass });\n }\n\n /** @beta */\n public setAccessClient(formatId: string, accessClient: MapLayerAccessClient): boolean {\n const entry = this._formats.get(formatId);\n if (entry !== undefined) {\n entry.accessClient = accessClient;\n return true;\n }\n return false;\n }\n\n /** @beta */\n public getAccessClient(formatId: string): MapLayerAccessClient | undefined {\n if (formatId.length === 0)\n return undefined;\n\n return this._formats.get(formatId)?.accessClient;\n }\n\n public get configOptions(): MapLayerOptions {\n return this._configOptions;\n }\n\n /** @internal */\n public createImageryMapLayerTree(layerSettings: ImageMapLayerSettings, layerIndex: number, iModel: IModelConnection): ImageryMapLayerTreeReference | undefined {\n const entry = this._formats.get(layerSettings.formatId);\n const format = entry?.type;\n if (format === undefined) {\n Logger.logError(loggerCategory, `Could not find format '${layerSettings.formatId}' in registry`);\n return undefined;\n }\n return format.createMapLayerTree(layerSettings, layerIndex, iModel);\n }\n\n /**\n * Returns a [[MapLayerImageryProvider]] based on the provided [[ImageMapLayerSettings]] object.\n * @internal\n */\n public createImageryProvider(layerSettings: ImageMapLayerSettings): MapLayerImageryProvider | undefined {\n const entry = this._formats.get(layerSettings.formatId);\n const format = entry?.type;\n if (this._configOptions[layerSettings.formatId] !== undefined) {\n const keyValuePair = expectDefined(this._configOptions[layerSettings.formatId]);\n const key: MapLayerKey = { key: keyValuePair.key, value: keyValuePair.value };\n layerSettings = layerSettings.clone({ accessKey: key });\n }\n return (format === undefined) ? undefined : format.createImageryProvider(layerSettings);\n }\n\n /** @beta*/\n public async validateSource(opts: ValidateSourceArgs): Promise<MapLayerSourceValidation>;\n\n public async validateSource(formatId: string, url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation>;\n\n /** @internal*/\n public async validateSource(formatIdOrArgs: string|ValidateSourceArgs, url?: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\n let format: typeof MapLayerFormat | undefined;\n let args: ValidateSourceArgs | undefined;\n\n if (typeof formatIdOrArgs == \"string\" && url !== undefined) {\n const formatId = formatIdOrArgs;\n const entry = this._formats.get(formatId);\n format = entry?.type;\n if (format !== undefined) {\n const source = MapLayerSource.fromJSON({name: \"\", formatId, url});\n if (source !== undefined) {\n args = {source, ignoreCache};\n source.userName = userName;\n source.password = password;\n }\n\n }\n } else if (typeof formatIdOrArgs !== \"string\") {\n const entry = this._formats.get(formatIdOrArgs.source.formatId);\n format = entry?.type;\n args = formatIdOrArgs;\n }\n\n if (!args || !format)\n return { status: MapLayerSourceStatus.InvalidFormat };\n\n return format.validate(args);\n }\n}\n\n"]}
|
|
@@ -86,7 +86,7 @@ export declare abstract class PrimitiveTool extends InteractiveTool {
|
|
|
86
86
|
redoPreviousStep(): Promise<boolean>;
|
|
87
87
|
/**
|
|
88
88
|
* If this tool is editing a briefcase, commits any elements that the tool has changed, supplying the tool flyover for the undo description.
|
|
89
|
-
* @deprecated Use methods on [[EditCommand]] IPC instead.
|
|
89
|
+
* @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use methods on [[EditCommand]] IPC instead.
|
|
90
90
|
*/
|
|
91
91
|
saveChanges(): Promise<void>;
|
|
92
92
|
}
|
|
@@ -166,7 +166,7 @@ export class PrimitiveTool extends InteractiveTool {
|
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
168
|
* If this tool is editing a briefcase, commits any elements that the tool has changed, supplying the tool flyover for the undo description.
|
|
169
|
-
* @deprecated Use methods on [[EditCommand]] IPC instead.
|
|
169
|
+
* @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use methods on [[EditCommand]] IPC instead.
|
|
170
170
|
*/
|
|
171
171
|
async saveChanges() {
|
|
172
172
|
if (this.iModel.isBriefcaseConnection())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitiveTool.js","sourceRoot":"","sources":["../../../src/tools/PrimitiveTool.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAiB,uBAAuB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D,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,8CAA8C;QAE9G,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW;QACtB,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;YACrC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,uDAAuD;IACzG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { BriefcaseConnection } from \"../BriefcaseConnection\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../NotificationManager\";\nimport { Viewport } from \"../Viewport\";\nimport { AccuDrawShortcuts } from \"./AccuDrawTool\";\nimport { BeButton, BeButtonEvent, CoordinateLockOverrides, CoreTools, InteractiveTool } from \"./Tool\";\n\n/** The PrimitiveTool class can be used to implement tools to create or modify geometric elements.\n * @see [Writing a PrimitiveTool]($docs/learning/frontend/primitivetools.md)\n * @public\n * @extensions\n */\nexport abstract class PrimitiveTool extends InteractiveTool {\n /** The viewport within which the tool operates.\n * @note This property is only initialized if [[run]] returns `true`, causing the tool to be installed.\n */\n public targetView?: Viewport;\n private _targetModelId?: string;\n public get targetModelId() { return this._targetModelId; }\n public set targetModelId(v: string | undefined) { this._targetModelId = v; }\n public targetIsLocked: boolean = false; // If target model is known, set this to true in constructor and override getTargetModel.\n\n /** Get the iModel on which this tool operates.\n * @note The iModel is obtained from [[targetView]], so should only be invoked if the tool installed successfully.\n */\n public get iModel(): IModelConnection {\n assert(undefined !== this.targetView);\n return this.targetView.view.iModel;\n }\n\n /** Get the briefcase on which this tool operates, if the tool has successfully installed and the target [[iModel]] is a briefcase. */\n public get briefcase(): BriefcaseConnection | undefined {\n const iModel = this.targetView?.view.iModel;\n return iModel?.isBriefcaseConnection() ? iModel : undefined;\n }\n\n /**\n * Establish this tool as the active PrimitiveTool.\n * @return true if this tool was installed (though it may have exited too)\n * @note If you override this method you **must** call `super.run` and return false if it returns false.\n */\n public override async run(..._args: any[]): Promise<boolean> {\n const { toolAdmin, viewManager } = IModelApp;\n if (!this.isCompatibleViewport(viewManager.selectedView, false))\n return false;\n\n if (!await toolAdmin.onInstallTool(this))\n return false;\n\n await toolAdmin.startPrimitiveTool(this);\n // If another tool was installed at the same time (due to concurrent run calls),\n // the last start to complete wins. Detect that situation and return false.\n if (toolAdmin.primitiveTool !== this)\n return false;\n\n await toolAdmin.onPostInstallTool(this);\n return true;\n }\n\n /** Determine whether the supplied Viewport is compatible with this tool.\n * @param vp the Viewport to check\n */\n public override isCompatibleViewport(vp: Viewport | undefined, isSelectedViewChange: boolean): boolean {\n if (undefined === vp)\n return false; // No views are open...\n\n const view = vp.view;\n const iModel = view.iModel;\n\n if (this.requireWriteableTarget() && iModel.isReadonly)\n return false; // this Tool can't be used when iModel is read only.\n\n if (undefined === this.targetView || (!this.targetIsLocked && isSelectedViewChange))\n this.targetView = vp; // Update target to new view if undefined or still free to change.\n\n if (undefined === this.targetModelId && (!this.targetIsLocked || vp === this.targetView))\n return true; // Accept if this view is current target or any type of model/view is still ok as target is still free to change.\n\n if (iModel !== this.iModel)\n return false; // Once a ViewState has been established, only accept viewport showing the same iModel.\n\n if (this.targetModelId)\n return view.viewsModel(this.targetModelId); // If a specific target model is specified, only allow view that shows it.\n\n if (view.isSpatialView() && this.targetView.view.isSpatialView())\n return true; // No specific target, two spatial views are considered compatible.\n\n let allowView = false;\n const targetView = this.targetView;\n view.forEachModel((model) => {\n if (!allowView && targetView.view.viewsModel(model.id))\n allowView = true;\n });\n\n return allowView; // Accept if this view shares a model in common with target.\n }\n\n /**\n * Checks that the adjusted point from the supplied button event is within the project extents for spatial views. The range of physical geometry\n * should always be fully inside the project extents. Only checking the adjusted point won't absolutely guarantee that a tool doesn't create/move geometry\n * outside the project extents, but it will be sufficient to handle most cases and provide good feedback to the user.\n * @return true if ev is acceptable.\n */\n public override isValidLocation(ev: BeButtonEvent, isButtonEvent: boolean): boolean {\n const vp = ev.viewport;\n if (undefined === vp)\n return false;\n\n if (isButtonEvent && BeButton.Data !== ev.button)\n return true;\n\n const view = vp.view;\n if (!view.isSpatialView())\n return true;\n\n // NOTE: If points aren't being adjusted then the tool shouldn't be creating geometry currently (ex. locating elements) and we shouldn't filter point...\n if (0 !== (IModelApp.toolAdmin.toolState.coordLockOvr & CoordinateLockOverrides.ACS))\n return true;\n\n // We know the tool isn't doing a locate, we don't know what it will do with this point. Minimize erroneous filtering by restricting the check to when AccuSnap is tool enable (not user enabled)...\n if (!IModelApp.accuSnap.isSnapEnabled)\n return true;\n\n const extents = view.iModel.projectExtents;\n if (extents.containsPoint(ev.point))\n return true;\n\n if (isButtonEvent && ev.isDown)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, CoreTools.translate(\"ElementSet.Error.ProjectExtents\")));\n\n return false;\n }\n\n /** Called on data button down event to lock the tool to its current target model. */\n public autoLockTarget(): void {\n if (undefined === this.targetView)\n return;\n\n this.targetIsLocked = true;\n }\n\n /** Returns the prompt based on the tool's current state. */\n public getPrompt(): string { return \"\"; }\n\n /** Called from isCompatibleViewport to check for a read only iModel, which is not a valid target for tools that create or modify elements. */\n public requireWriteableTarget(): boolean { return true; }\n\n /**\n * Called when active view changes. Tool may choose to restart or exit based on current view type.\n * @param _previous The previously active view.\n * @param current The new active view.\n */\n public override async onSelectedViewportChanged(_previous: Viewport | undefined, current: Viewport | undefined): Promise<void> {\n if (this.isCompatibleViewport(current, true))\n return;\n return this.onRestartTool();\n }\n\n /**\n * Called when an external event may invalidate the current tool's state.\n * Examples are undo, which may invalidate any references to elements, or an incompatible active view change.\n * The active tool is expected to call installTool with a new instance, or exitTool to start the default tool.\n * ```ts\n * const tool = new MyPrimitiveTool();\n * if (!await tool.run())\n * return this.exitTool(); // Don't leave current instance active if new instance rejects install...\n * ```\n */\n public abstract onRestartTool(): Promise<void>;\n\n /**\n * Called to reset tool to initial state. PrimitiveTool implements this method to call onRestartTool.\n */\n public override async onReinitialize(): Promise<void> { return this.onRestartTool(); }\n\n public async exitTool() { return IModelApp.toolAdmin.startDefaultTool(); }\n\n /**\n * Called to reverse to a previous tool state (ex. undo last data button).\n * @return false to instead reverse the most recent transaction.\n */\n public async onUndoPreviousStep(): Promise<boolean> { return false; }\n\n /** @internal */\n public async undoPreviousStep(): Promise<boolean> {\n if (!await this.onUndoPreviousStep())\n return false;\n\n AccuDrawShortcuts.processPendingHints(); // Process pending hints from onUndoPreviousStep before calling updateDynamics...\n IModelApp.viewManager.invalidateDecorationsAllViews();\n IModelApp.toolAdmin.updateDynamics(undefined, undefined, true); // Don't wait for motion to update dynamics...\n\n return true;\n }\n\n /**\n * Called to reinstate to a previous tool state (ex. redo last data button).\n * @return false to instead reinstate the most recent transaction.\n */\n public async onRedoPreviousStep(): Promise<boolean> { return false; }\n\n /** @internal */\n public async redoPreviousStep(): Promise<boolean> {\n if (!await this.onRedoPreviousStep())\n return false;\n\n AccuDrawShortcuts.processPendingHints(); // Process pending hints from onRedoPreviousStep before calling updateDynamics...\n IModelApp.viewManager.invalidateDecorationsAllViews();\n IModelApp.toolAdmin.updateDynamics(undefined, undefined, true); // Don't wait for motion to update dynamics...\n\n return true;\n }\n\n /**\n * If this tool is editing a briefcase, commits any elements that the tool has changed, supplying the tool flyover for the undo description.\n * @deprecated Use methods on [[EditCommand]] IPC instead.\n */\n public async saveChanges(): Promise<void> {\n if (this.iModel.isBriefcaseConnection())\n return this.iModel.saveChanges(this.flyover); // eslint-disable-line @typescript-eslint/no-deprecated\n }\n}\n"]}
|
|
1
|
+
{"version":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I,CAAC,CAAC,CAAC,8CAA8C;QAE9G,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,kBAAkB,KAAuB,OAAO,KAAK,CAAC,CAAC,CAAC;IAErE,gBAAgB;IACT,KAAK,CAAC,gBAAgB;QAC3B,IAAI,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE;YAClC,OAAO,KAAK,CAAC;QAEf,iBAAiB,CAAC,mBAAmB,EAAE,CAAC,CAAC,iFAAiF;QAC1H,SAAS,CAAC,WAAW,CAAC,6BAA6B,EAAE,CAAC;QACtD,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,8CAA8C;QAE9G,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,WAAW;QACtB,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;YACrC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,uDAAuD;IACzG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tools\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { BriefcaseConnection } from \"../BriefcaseConnection\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { NotifyMessageDetails, OutputMessagePriority } from \"../NotificationManager\";\nimport { Viewport } from \"../Viewport\";\nimport { AccuDrawShortcuts } from \"./AccuDrawTool\";\nimport { BeButton, BeButtonEvent, CoordinateLockOverrides, CoreTools, InteractiveTool } from \"./Tool\";\n\n/** The PrimitiveTool class can be used to implement tools to create or modify geometric elements.\n * @see [Writing a PrimitiveTool]($docs/learning/frontend/primitivetools.md)\n * @public\n * @extensions\n */\nexport abstract class PrimitiveTool extends InteractiveTool {\n /** The viewport within which the tool operates.\n * @note This property is only initialized if [[run]] returns `true`, causing the tool to be installed.\n */\n public targetView?: Viewport;\n private _targetModelId?: string;\n public get targetModelId() { return this._targetModelId; }\n public set targetModelId(v: string | undefined) { this._targetModelId = v; }\n public targetIsLocked: boolean = false; // If target model is known, set this to true in constructor and override getTargetModel.\n\n /** Get the iModel on which this tool operates.\n * @note The iModel is obtained from [[targetView]], so should only be invoked if the tool installed successfully.\n */\n public get iModel(): IModelConnection {\n assert(undefined !== this.targetView);\n return this.targetView.view.iModel;\n }\n\n /** Get the briefcase on which this tool operates, if the tool has successfully installed and the target [[iModel]] is a briefcase. */\n public get briefcase(): BriefcaseConnection | undefined {\n const iModel = this.targetView?.view.iModel;\n return iModel?.isBriefcaseConnection() ? iModel : undefined;\n }\n\n /**\n * Establish this tool as the active PrimitiveTool.\n * @return true if this tool was installed (though it may have exited too)\n * @note If you override this method you **must** call `super.run` and return false if it returns false.\n */\n public override async run(..._args: any[]): Promise<boolean> {\n const { toolAdmin, viewManager } = IModelApp;\n if (!this.isCompatibleViewport(viewManager.selectedView, false))\n return false;\n\n if (!await toolAdmin.onInstallTool(this))\n return false;\n\n await toolAdmin.startPrimitiveTool(this);\n // If another tool was installed at the same time (due to concurrent run calls),\n // the last start to complete wins. Detect that situation and return false.\n if (toolAdmin.primitiveTool !== this)\n return false;\n\n await toolAdmin.onPostInstallTool(this);\n return true;\n }\n\n /** Determine whether the supplied Viewport is compatible with this tool.\n * @param vp the Viewport to check\n */\n public override isCompatibleViewport(vp: Viewport | undefined, isSelectedViewChange: boolean): boolean {\n if (undefined === vp)\n return false; // No views are open...\n\n const view = vp.view;\n const iModel = view.iModel;\n\n if (this.requireWriteableTarget() && iModel.isReadonly)\n return false; // this Tool can't be used when iModel is read only.\n\n if (undefined === this.targetView || (!this.targetIsLocked && isSelectedViewChange))\n this.targetView = vp; // Update target to new view if undefined or still free to change.\n\n if (undefined === this.targetModelId && (!this.targetIsLocked || vp === this.targetView))\n return true; // Accept if this view is current target or any type of model/view is still ok as target is still free to change.\n\n if (iModel !== this.iModel)\n return false; // Once a ViewState has been established, only accept viewport showing the same iModel.\n\n if (this.targetModelId)\n return view.viewsModel(this.targetModelId); // If a specific target model is specified, only allow view that shows it.\n\n if (view.isSpatialView() && this.targetView.view.isSpatialView())\n return true; // No specific target, two spatial views are considered compatible.\n\n let allowView = false;\n const targetView = this.targetView;\n view.forEachModel((model) => {\n if (!allowView && targetView.view.viewsModel(model.id))\n allowView = true;\n });\n\n return allowView; // Accept if this view shares a model in common with target.\n }\n\n /**\n * Checks that the adjusted point from the supplied button event is within the project extents for spatial views. The range of physical geometry\n * should always be fully inside the project extents. Only checking the adjusted point won't absolutely guarantee that a tool doesn't create/move geometry\n * outside the project extents, but it will be sufficient to handle most cases and provide good feedback to the user.\n * @return true if ev is acceptable.\n */\n public override isValidLocation(ev: BeButtonEvent, isButtonEvent: boolean): boolean {\n const vp = ev.viewport;\n if (undefined === vp)\n return false;\n\n if (isButtonEvent && BeButton.Data !== ev.button)\n return true;\n\n const view = vp.view;\n if (!view.isSpatialView())\n return true;\n\n // NOTE: If points aren't being adjusted then the tool shouldn't be creating geometry currently (ex. locating elements) and we shouldn't filter point...\n if (0 !== (IModelApp.toolAdmin.toolState.coordLockOvr & CoordinateLockOverrides.ACS))\n return true;\n\n // We know the tool isn't doing a locate, we don't know what it will do with this point. Minimize erroneous filtering by restricting the check to when AccuSnap is tool enable (not user enabled)...\n if (!IModelApp.accuSnap.isSnapEnabled)\n return true;\n\n const extents = view.iModel.projectExtents;\n if (extents.containsPoint(ev.point))\n return true;\n\n if (isButtonEvent && ev.isDown)\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, CoreTools.translate(\"ElementSet.Error.ProjectExtents\")));\n\n return false;\n }\n\n /** Called on data button down event to lock the tool to its current target model. */\n public autoLockTarget(): void {\n if (undefined === this.targetView)\n return;\n\n this.targetIsLocked = true;\n }\n\n /** Returns the prompt based on the tool's current state. */\n public getPrompt(): string { return \"\"; }\n\n /** Called from isCompatibleViewport to check for a read only iModel, which is not a valid target for tools that create or modify elements. */\n public requireWriteableTarget(): boolean { return true; }\n\n /**\n * Called when active view changes. Tool may choose to restart or exit based on current view type.\n * @param _previous The previously active view.\n * @param current The new active view.\n */\n public override async onSelectedViewportChanged(_previous: Viewport | undefined, current: Viewport | undefined): Promise<void> {\n if (this.isCompatibleViewport(current, true))\n return;\n return this.onRestartTool();\n }\n\n /**\n * Called when an external event may invalidate the current tool's state.\n * Examples are undo, which may invalidate any references to elements, or an incompatible active view change.\n * The active tool is expected to call installTool with a new instance, or exitTool to start the default tool.\n * ```ts\n * const tool = new MyPrimitiveTool();\n * if (!await tool.run())\n * return this.exitTool(); // Don't leave current instance active if new instance rejects install...\n * ```\n */\n public abstract onRestartTool(): Promise<void>;\n\n /**\n * Called to reset tool to initial state. PrimitiveTool implements this method to call onRestartTool.\n */\n public override async onReinitialize(): Promise<void> { return this.onRestartTool(); }\n\n public async exitTool() { return IModelApp.toolAdmin.startDefaultTool(); }\n\n /**\n * Called to reverse to a previous tool state (ex. undo last data button).\n * @return false to instead reverse the most recent transaction.\n */\n public async onUndoPreviousStep(): Promise<boolean> { return false; }\n\n /** @internal */\n public async undoPreviousStep(): Promise<boolean> {\n if (!await this.onUndoPreviousStep())\n return false;\n\n AccuDrawShortcuts.processPendingHints(); // Process pending hints from onUndoPreviousStep before calling updateDynamics...\n IModelApp.viewManager.invalidateDecorationsAllViews();\n IModelApp.toolAdmin.updateDynamics(undefined, undefined, true); // Don't wait for motion to update dynamics...\n\n return true;\n }\n\n /**\n * Called to reinstate to a previous tool state (ex. redo last data button).\n * @return false to instead reinstate the most recent transaction.\n */\n public async onRedoPreviousStep(): Promise<boolean> { return false; }\n\n /** @internal */\n public async redoPreviousStep(): Promise<boolean> {\n if (!await this.onRedoPreviousStep())\n return false;\n\n AccuDrawShortcuts.processPendingHints(); // Process pending hints from onRedoPreviousStep before calling updateDynamics...\n IModelApp.viewManager.invalidateDecorationsAllViews();\n IModelApp.toolAdmin.updateDynamics(undefined, undefined, true); // Don't wait for motion to update dynamics...\n\n return true;\n }\n\n /**\n * If this tool is editing a briefcase, commits any elements that the tool has changed, supplying the tool flyover for the undo description.\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use methods on [[EditCommand]] IPC instead.\n */\n public async saveChanges(): Promise<void> {\n if (this.iModel.isBriefcaseConnection())\n return this.iModel.saveChanges(this.flyover); // eslint-disable-line @typescript-eslint/no-deprecated\n }\n}\n"]}
|
|
@@ -206,6 +206,8 @@ export declare class ToolAdmin {
|
|
|
206
206
|
set toolSyncUiEventDispatcher(handler: ((syncEventId: string, useImmediateDispatch?: boolean) => void) | undefined);
|
|
207
207
|
/** Handler for keyboard events. */
|
|
208
208
|
private static _keyEventHandler;
|
|
209
|
+
/** Handler for modifier key transitions captured before focused UI elements can stop propagation. */
|
|
210
|
+
private static _keyEventCaptureHandler;
|
|
209
211
|
/** @internal */
|
|
210
212
|
onInitialized(): void;
|
|
211
213
|
/** @internal */
|
|
@@ -306,14 +308,27 @@ export declare class ToolAdmin {
|
|
|
306
308
|
private onButtonUp;
|
|
307
309
|
/** Called when any *modifier* (Shift, Alt, or Control) key is pressed or released. */
|
|
308
310
|
private onModifierKeyTransition;
|
|
311
|
+
private get _isFocusHome();
|
|
312
|
+
private _setFocusHome;
|
|
309
313
|
private static getModifierKey;
|
|
310
314
|
/** Process key down events while the Ctrl key is pressed */
|
|
311
315
|
onCtrlKeyPressed(keyEvent: KeyboardEvent): Promise<{
|
|
312
316
|
handled: boolean;
|
|
313
317
|
result: boolean;
|
|
314
318
|
}>;
|
|
315
|
-
/**
|
|
319
|
+
/** Sub-classes should override to process shortcut key events.
|
|
320
|
+
* @return true if handled and no further processing of event should occur.
|
|
321
|
+
*/
|
|
316
322
|
processShortcutKey(_keyEvent: KeyboardEvent, _wentDown: boolean): Promise<boolean>;
|
|
323
|
+
/** Event for every key down and up transition.
|
|
324
|
+
* @note Called before processShortcutKey.
|
|
325
|
+
* @return true if handled and no further processing of event should occur.
|
|
326
|
+
*/
|
|
327
|
+
protected processKeyboardEvent(keyEvent: KeyboardEvent, _wentDown: boolean): boolean;
|
|
328
|
+
/** Need to check for modifier changes on capture phase as a ui element that calls stopPropagation
|
|
329
|
+
* prevents onKeyTransition from being called when bubbling.
|
|
330
|
+
*/
|
|
331
|
+
private onKeyTransitionCaptured;
|
|
317
332
|
/** Event for every key down and up transition. */
|
|
318
333
|
private onKeyTransition;
|
|
319
334
|
/** Called to undo previous data button for primitive tools or undo last write operation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolAdmin.d.ts","sourceRoot":"","sources":["../../../src/tools/ToolAdmin.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA0B,OAAO,EAAuB,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAY,OAAO,EAAE,OAAO,EAAuB,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAU,mBAAmB,EAAa,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAIpG,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAOzC,OAAO,EAAE,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,uBAAuB,EAAe,YAAY,EACtI,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EACnD,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,QAAQ,EAAE,MAA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V,OAAO,CAAC,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;mBAa1D,MAAM;CA4F5B"}
|
|
@@ -406,12 +406,26 @@ export class ToolAdmin {
|
|
|
406
406
|
if (!ev.repeat) // we don't want repeated keyboard events. If we keep them they interfere with replacing mouse motion events, since they come as a stream.
|
|
407
407
|
ToolAdmin.addEvent(ev);
|
|
408
408
|
};
|
|
409
|
+
/** Handler for modifier key transitions captured before focused UI elements can stop propagation. */
|
|
410
|
+
static _keyEventCaptureHandler = async (event) => {
|
|
411
|
+
const ev = event;
|
|
412
|
+
if (!ev.repeat) {
|
|
413
|
+
try {
|
|
414
|
+
await IModelApp.toolAdmin.onKeyTransitionCaptured(ev);
|
|
415
|
+
}
|
|
416
|
+
catch (err) {
|
|
417
|
+
await ToolAdmin.exceptionHandler(err);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
};
|
|
409
421
|
/** @internal */
|
|
410
422
|
onInitialized() {
|
|
411
423
|
if (typeof document === "undefined")
|
|
412
424
|
return; // if document isn't defined, we're probably running in a test environment. At any rate, we can't have interactive tools.
|
|
413
425
|
this._idleTool = IModelApp.tools.create("Idle");
|
|
414
426
|
["keydown", "keyup"].forEach((type) => {
|
|
427
|
+
document.addEventListener(type, ToolAdmin._keyEventCaptureHandler, true);
|
|
428
|
+
ToolAdmin._removals.push(() => document.removeEventListener(type, ToolAdmin._keyEventCaptureHandler, true));
|
|
415
429
|
document.addEventListener(type, ToolAdmin._keyEventHandler, false);
|
|
416
430
|
ToolAdmin._removals.push(() => document.removeEventListener(type, ToolAdmin._keyEventHandler, false));
|
|
417
431
|
});
|
|
@@ -1175,6 +1189,15 @@ export class ToolAdmin {
|
|
|
1175
1189
|
this.updateDynamics(undefined, undefined, true); // Don't wait for motion to update dynamics...
|
|
1176
1190
|
}
|
|
1177
1191
|
}
|
|
1192
|
+
get _isFocusHome() {
|
|
1193
|
+
return (document.body === document.activeElement);
|
|
1194
|
+
}
|
|
1195
|
+
_setFocusHome() {
|
|
1196
|
+
const element = document.activeElement;
|
|
1197
|
+
if (element && element !== document.body)
|
|
1198
|
+
element.blur();
|
|
1199
|
+
document.body.focus();
|
|
1200
|
+
}
|
|
1178
1201
|
static getModifierKey(event) {
|
|
1179
1202
|
switch (event.key) {
|
|
1180
1203
|
case "Alt": return BeModifierKeys.Alt;
|
|
@@ -1205,17 +1228,41 @@ export class ToolAdmin {
|
|
|
1205
1228
|
}
|
|
1206
1229
|
return { handled, result };
|
|
1207
1230
|
}
|
|
1208
|
-
/**
|
|
1231
|
+
/** Sub-classes should override to process shortcut key events.
|
|
1232
|
+
* @return true if handled and no further processing of event should occur.
|
|
1233
|
+
*/
|
|
1209
1234
|
async processShortcutKey(_keyEvent, _wentDown) {
|
|
1210
1235
|
return false;
|
|
1211
1236
|
}
|
|
1212
|
-
/** Event for every key down and up transition.
|
|
1213
|
-
|
|
1214
|
-
|
|
1237
|
+
/** Event for every key down and up transition.
|
|
1238
|
+
* @note Called before processShortcutKey.
|
|
1239
|
+
* @return true if handled and no further processing of event should occur.
|
|
1240
|
+
*/
|
|
1241
|
+
processKeyboardEvent(keyEvent, _wentDown) {
|
|
1242
|
+
if (this._isFocusHome || undefined !== IModelApp.accuDraw.getFocusItem())
|
|
1243
|
+
return false; // Focus is Home or AccuDraw, allow shortcuts...
|
|
1244
|
+
// NOTE: Provide a convenient way for the user to move focus to Home to use shortcuts.
|
|
1245
|
+
// Escape is the only practical choice with its default behavior that can cancel/close/blur.
|
|
1246
|
+
// Intentionally not checking wentDown as some ui elements stop propagation of down but not up (moving to capture is not a good option).
|
|
1247
|
+
// Apps that want to use Escape to start the default tool still can with Home focus in processShortcutKey.
|
|
1248
|
+
if (keyEvent.key === "Escape" && ToolSettings.escapeMovesFocusToHome && !keyEvent.defaultPrevented && !keyEvent.isComposing)
|
|
1249
|
+
this._setFocusHome();
|
|
1250
|
+
return true;
|
|
1251
|
+
}
|
|
1252
|
+
/** Need to check for modifier changes on capture phase as a ui element that calls stopPropagation
|
|
1253
|
+
* prevents onKeyTransition from being called when bubbling.
|
|
1254
|
+
*/
|
|
1255
|
+
async onKeyTransitionCaptured(keyEvent) {
|
|
1215
1256
|
this.currentInputState.setKeyQualifiers(keyEvent);
|
|
1216
1257
|
const modifierKey = ToolAdmin.getModifierKey(keyEvent);
|
|
1217
1258
|
if (BeModifierKeys.None !== modifierKey)
|
|
1218
|
-
return this.onModifierKeyTransition(
|
|
1259
|
+
return this.onModifierKeyTransition("keydown" === keyEvent.type, modifierKey, keyEvent);
|
|
1260
|
+
}
|
|
1261
|
+
/** Event for every key down and up transition. */
|
|
1262
|
+
async onKeyTransition(event, wentDown) {
|
|
1263
|
+
const keyEvent = event.ev;
|
|
1264
|
+
if (this.processKeyboardEvent(keyEvent, wentDown))
|
|
1265
|
+
return EventHandled.Yes;
|
|
1219
1266
|
if (wentDown && keyEvent.ctrlKey) {
|
|
1220
1267
|
const { handled, result } = await this.onCtrlKeyPressed(keyEvent);
|
|
1221
1268
|
if (handled)
|