@itwin/core-common 5.14.0-dev.8 → 5.15.0-dev.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 +31 -1
- package/lib/cjs/ConcurrentQuery.d.ts +2 -2
- package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
- package/lib/cjs/ConcurrentQuery.js +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ECSqlReader.d.ts +4 -4
- package/lib/cjs/ECSqlReader.js +4 -4
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlReaderBase.d.ts +3 -3
- package/lib/cjs/ECSqlReaderBase.js.map +1 -1
- package/lib/cjs/IpcAppProps.d.ts +23 -3
- package/lib/cjs/IpcAppProps.d.ts.map +1 -1
- package/lib/cjs/IpcAppProps.js +10 -2
- package/lib/cjs/IpcAppProps.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlock.js +7 -4
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextField.d.ts +76 -11
- package/lib/cjs/annotation/TextField.d.ts.map +1 -1
- package/lib/cjs/annotation/TextField.js.map +1 -1
- package/lib/cjs/internal/annotations/FieldFormatter.d.ts +32 -3
- package/lib/cjs/internal/annotations/FieldFormatter.d.ts.map +1 -1
- package/lib/cjs/internal/annotations/FieldFormatter.js +47 -17
- package/lib/cjs/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/cjs/internal/cross-package.d.ts +1 -1
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts +2 -2
- package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
- package/lib/esm/ConcurrentQuery.js +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ECSqlReader.d.ts +4 -4
- package/lib/esm/ECSqlReader.js +4 -4
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlReaderBase.d.ts +3 -3
- package/lib/esm/ECSqlReaderBase.js.map +1 -1
- package/lib/esm/IpcAppProps.d.ts +23 -3
- package/lib/esm/IpcAppProps.d.ts.map +1 -1
- package/lib/esm/IpcAppProps.js +8 -1
- package/lib/esm/IpcAppProps.js.map +1 -1
- package/lib/esm/annotation/TextBlock.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlock.js +7 -4
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextField.d.ts +76 -11
- package/lib/esm/annotation/TextField.d.ts.map +1 -1
- package/lib/esm/annotation/TextField.js.map +1 -1
- package/lib/esm/internal/annotations/FieldFormatter.d.ts +32 -3
- package/lib/esm/internal/annotations/FieldFormatter.d.ts.map +1 -1
- package/lib/esm/internal/annotations/FieldFormatter.js +47 -17
- package/lib/esm/internal/annotations/FieldFormatter.js.map +1 -1
- package/lib/esm/internal/cross-package.d.ts +1 -1
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/package.json +6 -6
package/lib/cjs/IpcAppProps.d.ts
CHANGED
|
@@ -21,10 +21,28 @@ export interface PullChangesOptions {
|
|
|
21
21
|
/** Enables checks for abort. */
|
|
22
22
|
enableCancellation?: boolean;
|
|
23
23
|
}
|
|
24
|
+
/** Options for pushing changes to iModel.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export interface PushChangesOptions {
|
|
28
|
+
/** Enables reporting the progress of downloading the changesets that must be merged before pushing. */
|
|
29
|
+
reportDownloadProgress?: boolean;
|
|
30
|
+
/** Interval for reporting download progress (in milliseconds). */
|
|
31
|
+
downloadProgressInterval?: number;
|
|
32
|
+
/** Enables checks for abort. Currently only observed while downloading. */
|
|
33
|
+
enableCancellation?: boolean;
|
|
34
|
+
}
|
|
24
35
|
/** Get IPC channel name used for reporting progress of pulling changes into iModel.
|
|
36
|
+
* @param key the key of the briefcase being pulled into.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export declare const getPullChangesIpcChannel: (key: string) => string;
|
|
40
|
+
/** Get IPC channel name used for reporting the progress of the changeset download that [[IpcAppFunctions.pushChanges]] performs before
|
|
41
|
+
* uploading. Kept distinct from [[getPullChangesIpcChannel]] so that a listener attached for a pull never observes a push's download.
|
|
42
|
+
* @param key the key of the briefcase being pushed from.
|
|
25
43
|
* @internal
|
|
26
44
|
*/
|
|
27
|
-
export declare const
|
|
45
|
+
export declare const getPushChangesIpcChannel: (key: string) => string;
|
|
28
46
|
/** Identifies a list of tile content Ids belonging to a single tile tree.
|
|
29
47
|
* @internal
|
|
30
48
|
*/
|
|
@@ -169,10 +187,12 @@ export interface IpcAppFunctions {
|
|
|
169
187
|
getRedoString: (key: string) => Promise<string>;
|
|
170
188
|
/** see BriefcaseConnection.pullChanges */
|
|
171
189
|
pullChanges: (key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions) => Promise<ChangesetIndexAndId>;
|
|
172
|
-
/** Cancels
|
|
190
|
+
/** Cancels the download of changesets initiated by [[pullChanges]]. */
|
|
173
191
|
cancelPullChangesRequest: (key: string) => Promise<void>;
|
|
174
192
|
/** see BriefcaseConnection.pushChanges */
|
|
175
|
-
pushChanges: (key: string, description: string) => Promise<ChangesetIndexAndId>;
|
|
193
|
+
pushChanges: (key: string, description: string, options?: PushChangesOptions) => Promise<ChangesetIndexAndId>;
|
|
194
|
+
/** Cancels the download of changesets that [[pushChanges]] performs before uploading. Has no effect once uploading has begun. */
|
|
195
|
+
cancelPushChangesRequest: (key: string) => Promise<void>;
|
|
176
196
|
/** Cancels currently pending or active generation of tile content. */
|
|
177
197
|
cancelTileContentRequests: (tokenProps: IModelRpcProps, _contentIds: TileTreeContentIds[]) => Promise<void>;
|
|
178
198
|
/** Cancel element graphics requests.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcAppProps.d.ts","sourceRoot":"","sources":["../../src/IpcAppProps.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC5K,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gCAAgC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"IpcAppProps.d.ts","sourceRoot":"","sources":["../../src/IpcAppProps.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/F,O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AErF,2BAA2B,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvF,2BAA2B,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE/D,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3E,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACrD,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD,4FAA4F;IAC5F,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3D"}
|
package/lib/cjs/IpcAppProps.js
CHANGED
|
@@ -7,12 +7,20 @@
|
|
|
7
7
|
* @module NativeApp
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ipcAppChannels = exports.getPullChangesIpcChannel = void 0;
|
|
10
|
+
exports.ipcAppChannels = exports.getPushChangesIpcChannel = exports.getPullChangesIpcChannel = void 0;
|
|
11
11
|
/** Get IPC channel name used for reporting progress of pulling changes into iModel.
|
|
12
|
+
* @param key the key of the briefcase being pulled into.
|
|
12
13
|
* @internal
|
|
13
14
|
*/
|
|
14
|
-
const getPullChangesIpcChannel = (
|
|
15
|
+
const getPullChangesIpcChannel = (key) => `${exports.ipcAppChannels.functions}/pullChanges/${key}`;
|
|
15
16
|
exports.getPullChangesIpcChannel = getPullChangesIpcChannel;
|
|
17
|
+
/** Get IPC channel name used for reporting the progress of the changeset download that [[IpcAppFunctions.pushChanges]] performs before
|
|
18
|
+
* uploading. Kept distinct from [[getPullChangesIpcChannel]] so that a listener attached for a pull never observes a push's download.
|
|
19
|
+
* @param key the key of the briefcase being pushed from.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
const getPushChangesIpcChannel = (key) => `${exports.ipcAppChannels.functions}/pushChanges/pullProgress/${key}`;
|
|
23
|
+
exports.getPushChangesIpcChannel = getPushChangesIpcChannel;
|
|
16
24
|
/** @internal */
|
|
17
25
|
exports.ipcAppChannels = {
|
|
18
26
|
functions: "itwinjs-core/ipc-app",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcAppProps.js","sourceRoot":"","sources":["../../src/IpcAppProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwBH;;GAEG;AACI,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,sBAAc,CAAC,SAAS,gBAAgB,QAAQ,EAAE,CAAC;AAAvG,QAAA,wBAAwB,4BAA+E;AAwBpH,gBAAgB;AACH,QAAA,cAAc,GAAG;IAC5B,SAAS,EAAE,sBAAsB;IACjC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,4BAA4B;CAClC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { GuidString, Id64String, IModelStatus, LogLevel, OpenMode } from \"@itwin/core-bentley\";\r\nimport { Range3dProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { OpenBriefcaseProps, OpenCheckpointArgs } from \"./BriefcaseTypes\";\r\nimport { ChangedEntities } from \"./ChangedEntities\";\r\nimport { ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexAndId, ChangesetProps } from \"./ChangesetProps\";\r\nimport { GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\r\nimport { BriefcaseConnectionProps, EcefLocationProps, IModelConnectionProps, IModelRpcProps, RootSubjectProps, SnapshotOpenOptions, StandaloneOpenOptions } from \"./IModel\";\r\nimport { ModelGeometryChangesProps } from \"./ModelGeometryChanges\";\r\nimport { ReinstateTxnArgs, ReverseTxnArgs, TxnProps } from \"./TxnProps\";\r\n\r\n/** Options for pulling changes into iModel.\r\n * @internal\r\n */\r\nexport interface PullChangesOptions {\r\n /** Enables progress reporting. */\r\n reportProgress?: boolean;\r\n /** Interval for reporting progress (in milliseconds). */\r\n progressInterval?: number;\r\n /** Enables checks for abort. */\r\n enableCancellation?: boolean;\r\n}\r\n\r\n/** Get IPC channel name used for reporting progress of pulling changes into iModel.\r\n * @internal\r\n */\r\nexport const getPullChangesIpcChannel = (iModelId: string) => `${ipcAppChannels.functions}/pullChanges/${iModelId}`;\r\n\r\n/** Identifies a list of tile content Ids belonging to a single tile tree.\r\n * @internal\r\n */\r\nexport interface TileTreeContentIds {\r\n treeId: string;\r\n contentIds: string[];\r\n}\r\n\r\n/** Specifies a [GeometricModel]($backend)'s Id and a Guid identifying the current state of the geometry contained within the model.\r\n * @see [TxnManager.onModelGeometryChanged]($backend) and [BriefcaseTxns.onModelGeometryChanged]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelIdAndGeometryGuid {\r\n /** The model's Id. */\r\n id: Id64String;\r\n /** A unique identifier for the current state of the model's geometry. If the guid differs between two revisions of the same iModel, it indicates that the geometry differs.\r\n * This is primarily an implementation detail used to determine whether [Tile]($frontend)s produced for one revision are compatible with another revision.\r\n */\r\n guid: GuidString;\r\n}\r\n\r\n/** @internal */\r\nexport const ipcAppChannels = {\r\n functions: \"itwinjs-core/ipc-app\",\r\n appNotify: \"itwinjs-core/ipcApp-notify\",\r\n txns: \"itwinjs-core/txns\",\r\n editingScope: \"itwinjs-core/editing-scope\",\r\n} as const;\r\n\r\n/**\r\n * Interface implemented by the frontend [NotificationHandler]($common) to be notified of events from IpcApp backend.\r\n * @internal\r\n */\r\nexport interface IpcAppNotifications {\r\n notifyApp: () => void;\r\n}\r\n\r\n/** @internal */\r\nexport interface NotifyEntitiesChangedMetadata {\r\n /** Class full name (\"Schema:Class\") */\r\n name: string;\r\n /** The indices in [[NotifyEntitiesChangedArgs.meta]] of each of this class's **direct** base classes. */\r\n bases: number[];\r\n}\r\n\r\n/** Arguments supplied to [[TxnNotifications.notifyElementsChanged]] and [[TxnNotifications.notifyModelsChanged]].\r\n * @internal\r\n */\r\nexport interface NotifyEntitiesChangedArgs extends ChangedEntities {\r\n /** An array of the same length as [[ChangedEntities.inserted]] (or empty if that array is undefined), containing the index in the [[meta]] array at which the\r\n * metadata for each entity's class is located.\r\n */\r\n insertedMeta: number[];\r\n /** See insertedMeta. */\r\n updatedMeta: number[];\r\n /** See insertedMeta. */\r\n deletedMeta: number[];\r\n\r\n /** Metadata describing each unique class of entity in this set of changes, followed by each unique direct or indirect base class of those classes. */\r\n meta: NotifyEntitiesChangedMetadata[];\r\n}\r\n\r\n/** Interface implemented by the frontend [NotificationHandler]($common) to be notified of changes to an iModel.\r\n * @see [TxnManager]($backend) for the source of these events.\r\n * @see [BriefcaseTxns]($frontend) for the frontend implementation.\r\n * @internal\r\n */\r\nexport interface TxnNotifications {\r\n notifyElementsChanged: (changes: NotifyEntitiesChangedArgs) => void;\r\n notifyModelsChanged: (changes: NotifyEntitiesChangedArgs) => void;\r\n notifyGeometryGuidsChanged: (changes: ModelIdAndGeometryGuid[]) => void;\r\n notifyCommit: () => void;\r\n notifyCommitted: (hasPendingTxns: boolean, time: number) => void;\r\n notifyReplayExternalTxns: () => void;\r\n notifyReplayedExternalTxns: () => void;\r\n notifyChangesApplied: () => void;\r\n notifyBeforeUndoRedo: (isUndo: boolean) => void;\r\n notifyAfterUndoRedo: (isUndo: boolean) => void;\r\n notifyPulledChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\r\n notifyPushedChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\r\n\r\n notifyIModelNameChanged: (name: string) => void;\r\n notifyRootSubjectChanged: (subject: RootSubjectProps) => void;\r\n notifyProjectExtentsChanged: (extents: Range3dProps) => void;\r\n notifyGlobalOriginChanged: (origin: XYZProps) => void;\r\n notifyEcefLocationChanged: (ecef: EcefLocationProps | undefined) => void;\r\n notifyGeographicCoordinateSystemChanged: (gcs: GeographicCRSProps | undefined) => void;\r\n\r\n notifyPullMergeBegin: (changeset: ChangesetIdWithIndex) => void;\r\n notifyRebaseBegin: (txns: TxnProps[]) => void;\r\n notifyRebaseTxnBegin: (txnProps: TxnProps) => void;\r\n notifyRebaseTxnEnd: (txnProps: TxnProps) => void;\r\n notifyRebaseEnd: (txns: TxnProps[]) => void;\r\n notifyPullMergeEnd: (changeset: ChangesetIdWithIndex) => void;\r\n notifyDownloadChangesetsBegin: () => void;\r\n notifyDownloadChangesetsEnd: () => void;\r\n notifyReverseLocalChangesBegin: () => void;\r\n notifyReverseLocalChangesEnd: (txns: TxnProps[]) => void;\r\n notifyApplyIncomingChangesBegin: (changes: ChangesetProps[]) => void;\r\n notifyApplyIncomingChangesEnd: (changes: ChangesetProps[]) => void;\r\n\r\n}\r\n\r\n/**\r\n * Interface registered by the frontend [NotificationHandler]($common) to be notified of changes to an iModel during an [GraphicalEditingScope]($frontend).\r\n * @internal\r\n */\r\nexport interface EditingScopeNotifications {\r\n notifyGeometryChanged: (modelProps: ModelGeometryChangesProps[]) => void;\r\n}\r\n\r\n/**\r\n * The methods that may be invoked via Ipc from the frontend of an IpcApp and are implemented on its backend.\r\n * @internal\r\n */\r\nexport interface IpcAppFunctions {\r\n /** Send frontend log to backend.\r\n * @param _level Specify log level.\r\n * @param _category Specify log category.\r\n * @param _message Specify log message.\r\n * @param _metaData metaData if any.\r\n */\r\n log: (_timestamp: number, _level: LogLevel, _category: string, _message: string, _metaData?: any) => Promise<void>;\r\n\r\n /** see BriefcaseConnection.openFile */\r\n openBriefcase: (args: OpenBriefcaseProps) => Promise<BriefcaseConnectionProps>;\r\n /** see BriefcaseConnection.openStandalone */\r\n openCheckpoint: (args: OpenCheckpointArgs) => Promise<IModelConnectionProps>;\r\n /** see BriefcaseConnection.openStandalone */\r\n openStandalone: (filePath: string, openMode: OpenMode, opts?: StandaloneOpenOptions) => Promise<IModelConnectionProps>;\r\n /** see SnapshotConnection.openFile */\r\n openSnapshot: (filePath: string, opts?: SnapshotOpenOptions) => Promise<IModelConnectionProps>;\r\n /** see BriefcaseConnection.close */\r\n closeIModel: (key: string) => Promise<void>;\r\n /**\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.\r\n * see BriefcaseConnection.saveChanges\r\n */\r\n saveChanges: (key: string, description?: string) => Promise<void>;\r\n /**\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.\r\n * see BriefcaseConnection.abandonChanges\r\n */\r\n abandonChanges: (key: string) => Promise<void>;\r\n /** see BriefcaseTxns.hasPendingTxns */\r\n hasPendingTxns: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.isUndoPossible */\r\n isUndoPossible: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.isRedoPossible */\r\n isRedoPossible: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.getUndoString */\r\n getUndoString: (key: string) => Promise<string>;\r\n /** see BriefcaseTxns.getRedoString */\r\n getRedoString: (key: string) => Promise<string>;\r\n\r\n /** see BriefcaseConnection.pullChanges */\r\n pullChanges: (key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions) => Promise<ChangesetIndexAndId>;\r\n /** Cancels pull of changes. */\r\n cancelPullChangesRequest: (key: string) => Promise<void>;\r\n /** see BriefcaseConnection.pushChanges */\r\n pushChanges: (key: string, description: string) => Promise<ChangesetIndexAndId>;\r\n /** Cancels currently pending or active generation of tile content. */\r\n cancelTileContentRequests: (tokenProps: IModelRpcProps, _contentIds: TileTreeContentIds[]) => Promise<void>;\r\n\r\n /** Cancel element graphics requests.\r\n * @see [[IModelTileRpcInterface.requestElementGraphics]].\r\n */\r\n cancelElementGraphicsRequests: (key: string, _requestIds: string[]) => Promise<void>;\r\n\r\n toggleGraphicalEditingScope: (key: string, _startSession: boolean) => Promise<boolean>;\r\n isGraphicalEditingSupported: (key: string) => Promise<boolean>;\r\n\r\n reverseTxns: (key: string, numOperations: number) => Promise<IModelStatus>;\r\n reverseAllTxn: (key: string) => Promise<IModelStatus>;\r\n reinstateTxn: (key: string) => Promise<IModelStatus>;\r\n reverseTxnsAsync: (key: string, numOperations: number, args?: ReverseTxnArgs) => Promise<void>;\r\n reverseAllTxnsAsync: (key: string, args?: ReverseTxnArgs) => Promise<void>;\r\n reinstateTxnAsync: (key: string, args?: ReinstateTxnArgs) => Promise<void>;\r\n restartTxnSession: (key: string) => Promise<void>;\r\n\r\n /** Query the number of concurrent threads supported by the host's IO or CPU thread pool. */\r\n queryConcurrency: (pool: \"io\" | \"cpu\") => Promise<number>;\r\n}\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"IpcAppProps.js","sourceRoot":"","sources":["../../src/IpcAppProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAoCH;;;GAGG;AACI,MAAM,wBAAwB,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,sBAAc,CAAC,SAAS,gBAAgB,GAAG,EAAE,CAAC;AAA7F,QAAA,wBAAwB,4BAAqE;AAE1G;;;;GAIG;AACI,MAAM,wBAAwB,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,sBAAc,CAAC,SAAS,6BAA6B,GAAG,EAAE,CAAC;AAA1G,QAAA,wBAAwB,4BAAkF;AAwBvH,gBAAgB;AACH,QAAA,cAAc,GAAG;IAC5B,SAAS,EAAE,sBAAsB;IACjC,SAAS,EAAE,4BAA4B;IACvC,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,4BAA4B;CAClC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module NativeApp\r\n */\r\n\r\nimport { GuidString, Id64String, IModelStatus, LogLevel, OpenMode } from \"@itwin/core-bentley\";\r\nimport { Range3dProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { OpenBriefcaseProps, OpenCheckpointArgs } from \"./BriefcaseTypes\";\r\nimport { ChangedEntities } from \"./ChangedEntities\";\r\nimport { ChangesetIdWithIndex, ChangesetIndex, ChangesetIndexAndId, ChangesetProps } from \"./ChangesetProps\";\r\nimport { GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\r\nimport { BriefcaseConnectionProps, EcefLocationProps, IModelConnectionProps, IModelRpcProps, RootSubjectProps, SnapshotOpenOptions, StandaloneOpenOptions } from \"./IModel\";\r\nimport { ModelGeometryChangesProps } from \"./ModelGeometryChanges\";\r\nimport { ReinstateTxnArgs, ReverseTxnArgs, TxnProps } from \"./TxnProps\";\r\n\r\n/** Options for pulling changes into iModel.\r\n * @internal\r\n */\r\nexport interface PullChangesOptions {\r\n /** Enables progress reporting. */\r\n reportProgress?: boolean;\r\n /** Interval for reporting progress (in milliseconds). */\r\n progressInterval?: number;\r\n /** Enables checks for abort. */\r\n enableCancellation?: boolean;\r\n}\r\n\r\n/** Options for pushing changes to iModel.\r\n * @internal\r\n */\r\nexport interface PushChangesOptions {\r\n /** Enables reporting the progress of downloading the changesets that must be merged before pushing. */\r\n reportDownloadProgress?: boolean;\r\n /** Interval for reporting download progress (in milliseconds). */\r\n downloadProgressInterval?: number;\r\n /** Enables checks for abort. Currently only observed while downloading. */\r\n enableCancellation?: boolean;\r\n}\r\n\r\n/** Get IPC channel name used for reporting progress of pulling changes into iModel.\r\n * @param key the key of the briefcase being pulled into.\r\n * @internal\r\n */\r\nexport const getPullChangesIpcChannel = (key: string) => `${ipcAppChannels.functions}/pullChanges/${key}`;\r\n\r\n/** Get IPC channel name used for reporting the progress of the changeset download that [[IpcAppFunctions.pushChanges]] performs before\r\n * uploading. Kept distinct from [[getPullChangesIpcChannel]] so that a listener attached for a pull never observes a push's download.\r\n * @param key the key of the briefcase being pushed from.\r\n * @internal\r\n */\r\nexport const getPushChangesIpcChannel = (key: string) => `${ipcAppChannels.functions}/pushChanges/pullProgress/${key}`;\r\n\r\n/** Identifies a list of tile content Ids belonging to a single tile tree.\r\n * @internal\r\n */\r\nexport interface TileTreeContentIds {\r\n treeId: string;\r\n contentIds: string[];\r\n}\r\n\r\n/** Specifies a [GeometricModel]($backend)'s Id and a Guid identifying the current state of the geometry contained within the model.\r\n * @see [TxnManager.onModelGeometryChanged]($backend) and [BriefcaseTxns.onModelGeometryChanged]($frontend).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ModelIdAndGeometryGuid {\r\n /** The model's Id. */\r\n id: Id64String;\r\n /** A unique identifier for the current state of the model's geometry. If the guid differs between two revisions of the same iModel, it indicates that the geometry differs.\r\n * This is primarily an implementation detail used to determine whether [Tile]($frontend)s produced for one revision are compatible with another revision.\r\n */\r\n guid: GuidString;\r\n}\r\n\r\n/** @internal */\r\nexport const ipcAppChannels = {\r\n functions: \"itwinjs-core/ipc-app\",\r\n appNotify: \"itwinjs-core/ipcApp-notify\",\r\n txns: \"itwinjs-core/txns\",\r\n editingScope: \"itwinjs-core/editing-scope\",\r\n} as const;\r\n\r\n/**\r\n * Interface implemented by the frontend [NotificationHandler]($common) to be notified of events from IpcApp backend.\r\n * @internal\r\n */\r\nexport interface IpcAppNotifications {\r\n notifyApp: () => void;\r\n}\r\n\r\n/** @internal */\r\nexport interface NotifyEntitiesChangedMetadata {\r\n /** Class full name (\"Schema:Class\") */\r\n name: string;\r\n /** The indices in [[NotifyEntitiesChangedArgs.meta]] of each of this class's **direct** base classes. */\r\n bases: number[];\r\n}\r\n\r\n/** Arguments supplied to [[TxnNotifications.notifyElementsChanged]] and [[TxnNotifications.notifyModelsChanged]].\r\n * @internal\r\n */\r\nexport interface NotifyEntitiesChangedArgs extends ChangedEntities {\r\n /** An array of the same length as [[ChangedEntities.inserted]] (or empty if that array is undefined), containing the index in the [[meta]] array at which the\r\n * metadata for each entity's class is located.\r\n */\r\n insertedMeta: number[];\r\n /** See insertedMeta. */\r\n updatedMeta: number[];\r\n /** See insertedMeta. */\r\n deletedMeta: number[];\r\n\r\n /** Metadata describing each unique class of entity in this set of changes, followed by each unique direct or indirect base class of those classes. */\r\n meta: NotifyEntitiesChangedMetadata[];\r\n}\r\n\r\n/** Interface implemented by the frontend [NotificationHandler]($common) to be notified of changes to an iModel.\r\n * @see [TxnManager]($backend) for the source of these events.\r\n * @see [BriefcaseTxns]($frontend) for the frontend implementation.\r\n * @internal\r\n */\r\nexport interface TxnNotifications {\r\n notifyElementsChanged: (changes: NotifyEntitiesChangedArgs) => void;\r\n notifyModelsChanged: (changes: NotifyEntitiesChangedArgs) => void;\r\n notifyGeometryGuidsChanged: (changes: ModelIdAndGeometryGuid[]) => void;\r\n notifyCommit: () => void;\r\n notifyCommitted: (hasPendingTxns: boolean, time: number) => void;\r\n notifyReplayExternalTxns: () => void;\r\n notifyReplayedExternalTxns: () => void;\r\n notifyChangesApplied: () => void;\r\n notifyBeforeUndoRedo: (isUndo: boolean) => void;\r\n notifyAfterUndoRedo: (isUndo: boolean) => void;\r\n notifyPulledChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\r\n notifyPushedChanges: (parentChangeSetId: ChangesetIndexAndId) => void;\r\n\r\n notifyIModelNameChanged: (name: string) => void;\r\n notifyRootSubjectChanged: (subject: RootSubjectProps) => void;\r\n notifyProjectExtentsChanged: (extents: Range3dProps) => void;\r\n notifyGlobalOriginChanged: (origin: XYZProps) => void;\r\n notifyEcefLocationChanged: (ecef: EcefLocationProps | undefined) => void;\r\n notifyGeographicCoordinateSystemChanged: (gcs: GeographicCRSProps | undefined) => void;\r\n\r\n notifyPullMergeBegin: (changeset: ChangesetIdWithIndex) => void;\r\n notifyRebaseBegin: (txns: TxnProps[]) => void;\r\n notifyRebaseTxnBegin: (txnProps: TxnProps) => void;\r\n notifyRebaseTxnEnd: (txnProps: TxnProps) => void;\r\n notifyRebaseEnd: (txns: TxnProps[]) => void;\r\n notifyPullMergeEnd: (changeset: ChangesetIdWithIndex) => void;\r\n notifyDownloadChangesetsBegin: () => void;\r\n notifyDownloadChangesetsEnd: () => void;\r\n notifyReverseLocalChangesBegin: () => void;\r\n notifyReverseLocalChangesEnd: (txns: TxnProps[]) => void;\r\n notifyApplyIncomingChangesBegin: (changes: ChangesetProps[]) => void;\r\n notifyApplyIncomingChangesEnd: (changes: ChangesetProps[]) => void;\r\n\r\n}\r\n\r\n/**\r\n * Interface registered by the frontend [NotificationHandler]($common) to be notified of changes to an iModel during an [GraphicalEditingScope]($frontend).\r\n * @internal\r\n */\r\nexport interface EditingScopeNotifications {\r\n notifyGeometryChanged: (modelProps: ModelGeometryChangesProps[]) => void;\r\n}\r\n\r\n/**\r\n * The methods that may be invoked via Ipc from the frontend of an IpcApp and are implemented on its backend.\r\n * @internal\r\n */\r\nexport interface IpcAppFunctions {\r\n /** Send frontend log to backend.\r\n * @param _level Specify log level.\r\n * @param _category Specify log category.\r\n * @param _message Specify log message.\r\n * @param _metaData metaData if any.\r\n */\r\n log: (_timestamp: number, _level: LogLevel, _category: string, _message: string, _metaData?: any) => Promise<void>;\r\n\r\n /** see BriefcaseConnection.openFile */\r\n openBriefcase: (args: OpenBriefcaseProps) => Promise<BriefcaseConnectionProps>;\r\n /** see BriefcaseConnection.openStandalone */\r\n openCheckpoint: (args: OpenCheckpointArgs) => Promise<IModelConnectionProps>;\r\n /** see BriefcaseConnection.openStandalone */\r\n openStandalone: (filePath: string, openMode: OpenMode, opts?: StandaloneOpenOptions) => Promise<IModelConnectionProps>;\r\n /** see SnapshotConnection.openFile */\r\n openSnapshot: (filePath: string, opts?: SnapshotOpenOptions) => Promise<IModelConnectionProps>;\r\n /** see BriefcaseConnection.close */\r\n closeIModel: (key: string) => Promise<void>;\r\n /**\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.\r\n * see BriefcaseConnection.saveChanges\r\n */\r\n saveChanges: (key: string, description?: string) => Promise<void>;\r\n /**\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.\r\n * see BriefcaseConnection.abandonChanges\r\n */\r\n abandonChanges: (key: string) => Promise<void>;\r\n /** see BriefcaseTxns.hasPendingTxns */\r\n hasPendingTxns: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.isUndoPossible */\r\n isUndoPossible: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.isRedoPossible */\r\n isRedoPossible: (key: string) => Promise<boolean>;\r\n /** see BriefcaseTxns.getUndoString */\r\n getUndoString: (key: string) => Promise<string>;\r\n /** see BriefcaseTxns.getRedoString */\r\n getRedoString: (key: string) => Promise<string>;\r\n\r\n /** see BriefcaseConnection.pullChanges */\r\n pullChanges: (key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions) => Promise<ChangesetIndexAndId>;\r\n /** Cancels the download of changesets initiated by [[pullChanges]]. */\r\n cancelPullChangesRequest: (key: string) => Promise<void>;\r\n /** see BriefcaseConnection.pushChanges */\r\n pushChanges: (key: string, description: string, options?: PushChangesOptions) => Promise<ChangesetIndexAndId>;\r\n /** Cancels the download of changesets that [[pushChanges]] performs before uploading. Has no effect once uploading has begun. */\r\n cancelPushChangesRequest: (key: string) => Promise<void>;\r\n /** Cancels currently pending or active generation of tile content. */\r\n cancelTileContentRequests: (tokenProps: IModelRpcProps, _contentIds: TileTreeContentIds[]) => Promise<void>;\r\n\r\n /** Cancel element graphics requests.\r\n * @see [[IModelTileRpcInterface.requestElementGraphics]].\r\n */\r\n cancelElementGraphicsRequests: (key: string, _requestIds: string[]) => Promise<void>;\r\n\r\n toggleGraphicalEditingScope: (key: string, _startSession: boolean) => Promise<boolean>;\r\n isGraphicalEditingSupported: (key: string) => Promise<boolean>;\r\n\r\n reverseTxns: (key: string, numOperations: number) => Promise<IModelStatus>;\r\n reverseAllTxn: (key: string) => Promise<IModelStatus>;\r\n reinstateTxn: (key: string) => Promise<IModelStatus>;\r\n reverseTxnsAsync: (key: string, numOperations: number, args?: ReverseTxnArgs) => Promise<void>;\r\n reverseAllTxnsAsync: (key: string, args?: ReverseTxnArgs) => Promise<void>;\r\n reinstateTxnAsync: (key: string, args?: ReinstateTxnArgs) => Promise<void>;\r\n restartTxnSession: (key: string) => Promise<void>;\r\n\r\n /** Query the number of concurrent threads supported by the host's IO or CPU thread pool. */\r\n queryConcurrency: (pool: \"io\" | \"cpu\") => Promise<number>;\r\n}\r\n\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextBlock.d.ts","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAA2C,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED;;GAEG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wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CA0BrE"}
|
|
@@ -247,6 +247,11 @@ class TabRun extends TextBlockComponent {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
exports.TabRun = TabRun;
|
|
250
|
+
function accessorsEqual(a, b) {
|
|
251
|
+
const lhs = a ?? [];
|
|
252
|
+
const rhs = b ?? [];
|
|
253
|
+
return lhs.length === rhs.length && lhs.every((value, index) => value === rhs[index]);
|
|
254
|
+
}
|
|
250
255
|
/** A [[Run]] that displays the formatted value of a property of some [Element]($backend).
|
|
251
256
|
* When a [[TextBlock]] containing a [[FieldRun]] is written into the iModel as an [ITextAnnotation]($backend) element,
|
|
252
257
|
* a dependency is established between the two elements via the [ElementDrivesTextAnnotation]($backend) relationship such that
|
|
@@ -336,12 +341,10 @@ class FieldRun extends TextBlockComponent {
|
|
|
336
341
|
if (this.propertyPath.propertyName !== other.propertyPath.propertyName) {
|
|
337
342
|
return false;
|
|
338
343
|
}
|
|
339
|
-
|
|
340
|
-
const otherAccessors = other.propertyPath.accessors ?? [];
|
|
341
|
-
if (thisAccessors.length !== otherAccessors.length) {
|
|
344
|
+
if (!accessorsEqual(this.propertyPath.accessors, other.propertyPath.accessors)) {
|
|
342
345
|
return false;
|
|
343
346
|
}
|
|
344
|
-
if (!
|
|
347
|
+
if (!accessorsEqual(this.propertyPath.jsonAccessors, other.propertyPath.jsonAccessors)) {
|
|
345
348
|
return false;
|
|
346
349
|
}
|
|
347
350
|
if (this.formatOptions && other.formatOptions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextBlock.js","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAgyBH,gEAOC;AAUD,sCA0BC;AAz0BD,2CAA0G;AA0D1G,SAAS,mBAAmB,CAAC,SAAuC,EAAE,OAA+B;IACnG,SAA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ED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,MAAM,GACV,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACzD,MAAM,OAAO,GACX,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IAC1E,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,OAAO,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YACxB,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;YACpB,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,YAAY,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,YAAY,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Annotation\r\n */\r\n\r\nimport { ListMarker, ListMarkerEnumerator, TextStyleSettings, TextStyleSettingsProps } from \"./TextStyle\";\r\nimport { FieldFormatOptions, FieldPropertyHost, FieldPropertyPath } from \"./TextField\";\r\n\r\n/** Options supplied to [[TextBlockComponent.clearStyleOverrides]] to control how the style overrides are cleared on the component and its child components.\r\n * @beta\r\n */\r\nexport interface ClearTextStyleOptions {\r\n /** Controls whether the styleOverrides of any child components are retained.\r\n * By default, all overrides are cleared.\r\n */\r\n preserveChildrenOverrides?: boolean;\r\n}\r\n\r\n/** The JSON representation of a [[TextBlockComponent]].\r\n * @beta\r\n */\r\nexport interface TextBlockComponentProps {\r\n /** Deviations from the base [[TextStyleSettings]] defined by the [AnnotationTextStyle]($backend) applied to this component.\r\n * This permits you to, e.g., create a [[TextBlock]] using \"Arial\" font and override one of its [[TextRun]]s to use \"Comic Sans\" instead.\r\n */\r\n styleOverrides?: TextStyleSettingsProps;\r\n}\r\n\r\n/** Options supplied to [[TextBlockComponent.stringify]] to control how the content is formatted.\r\n * @beta\r\n */\r\nexport interface TextBlockStringifyOptions {\r\n /** A string to insert in between each [[Paragraph]].\r\n * Default: \" \" - a single space.\r\n */\r\n paragraphBreak?: string;\r\n /** A string to insert for each [[LineBreakRun]].\r\n * Default: \" \" - a single space.\r\n */\r\n lineBreak?: string;\r\n /** A string to insert between the numerator and denominator of each [[FractionRun]].\r\n * Default: \"/\"\r\n */\r\n fractionSeparator?: string;\r\n /** The number of spaces to use for tabs. If not provided, tabs will be represented by a tab character: \"\\t\".\r\n * Default: \"undefined\" - use \"\\t\".\r\n */\r\n tabsAsSpaces?: number;\r\n /** A string to insert in between the list marker and the list item.\r\n * Default: \" \" - a single space.\r\n */\r\n listMarkerBreak?: string;\r\n}\r\n\r\n/**\r\n * Context information that may be useful when converting a [[TextBlock]] to a string.\r\n * @beta\r\n */\r\nexport interface TextBlockStringifyContext {\r\n /** The current depth of the text block in the document structure. */\r\n depth: number;\r\n}\r\n\r\nfunction clearStyleOverrides(component: StructuralTextBlockComponent, options?: ClearTextStyleOptions): void {\r\n component.styleOverrides = {};\r\n if (!options?.preserveChildrenOverrides) {\r\n for (const child of component.children) {\r\n child.clearStyleOverrides(options);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s and [[StructuralTextBlockComponent]]s.\r\n * The [[TextBlock]] can specify an [AnnotationTextStyle]($backend) that formats its contents.\r\n * Each component can specify an optional [[styleOverrides]] to customize that formatting.\r\n * @beta\r\n */\r\nexport abstract class TextBlockComponent {\r\n private _styleOverrides: TextStyleSettingsProps;\r\n\r\n /** @internal */\r\n protected constructor(props?: TextBlockComponentProps) {\r\n this._styleOverrides = structuredClone(props?.styleOverrides ?? {});\r\n }\r\n\r\n /** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).\r\n * For example, if the style uses the \"Arial\" font, you can override that by settings `styleOverrides.font.name` to \"Comic Sans\".\r\n * @see [[clearStyleOverrides]] to reset this to an empty object.\r\n */\r\n public get styleOverrides(): TextStyleSettingsProps {\r\n return this._styleOverrides;\r\n }\r\n\r\n public set styleOverrides(overrides: TextStyleSettingsProps) {\r\n this._styleOverrides = structuredClone(overrides);\r\n }\r\n\r\n /** Reset any [[styleOverrides]] applied to this component. */\r\n public clearStyleOverrides(_options?: ClearTextStyleOptions): void {\r\n this.styleOverrides = {};\r\n }\r\n\r\n /** Returns true if [[styleOverrides]] specifies any deviations from the [[TextBlock]]'s [AnnotationTextStyle]($backend). */\r\n public get overridesStyle(): boolean {\r\n return Object.keys(this.styleOverrides).length > 0;\r\n }\r\n\r\n /** Create a deep copy of this component. */\r\n public abstract clone(): TextBlockComponent;\r\n\r\n /** Compute a string representation of the contents of this component and all of its sub-components. */\r\n public abstract stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string;\r\n\r\n /** Returns true if this component has no content or children. */\r\n public abstract get isEmpty(): boolean;\r\n\r\n /**\r\n * Returns true if the string representation of this component consists only of whitespace characters.\r\n * Useful for checking if the component is visually empty (producing no graphics) or contains only spaces, tabs, or line breaks.\r\n */\r\n public get isWhitespace(): boolean {\r\n return /^\\s*$/g.test(this.stringify());\r\n };\r\n\r\n /** Convert this component to its JSON representation. */\r\n public toJSON(): TextBlockComponentProps {\r\n return {\r\n styleOverrides: structuredClone(this.styleOverrides),\r\n };\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other`. */\r\n public equals(other: TextBlockComponent): boolean {\r\n const mySettings = TextStyleSettings.fromJSON(this.styleOverrides);\r\n const otherSettings = TextStyleSettings.fromJSON(other.styleOverrides);\r\n return mySettings.equals(otherSettings);\r\n }\r\n}\r\n\r\n/** [[TextBlockComponent]]s contained within a [[Paragraph]].\r\n * @beta\r\n */\r\nexport type Run = TextRun | FractionRun | TabRun | LineBreakRun | FieldRun;\r\n\r\n/** The JSON representation of a [[Run]].\r\n * Use the `type` field to discriminate between the different kinds of runs.\r\n * @beta\r\n */\r\nexport type RunProps = TextRunProps | FractionRunProps | TabRunProps | LineBreakRunProps | FieldRunProps;\r\n\r\n/** A sequence of characters within a [[Paragraph]] that share a single style. Runs are the leaf nodes of a [[TextBlock]] document. When laid out for display, a single run may span\r\n * multiple lines, but it will never contain different styling.\r\n * Use the `type` field to discriminate between the different kinds of runs.\r\n * @beta\r\n */\r\nexport namespace Run { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Create a run from its JSON representation.\r\n * @see [[TextRun.create]], [[FractionRun.create]], [[FieldRun.create]], [[TabRun.create]], and [[LineBreakRun.create]] to create a run directly.\r\n */\r\n export function fromJSON(props: RunProps): Run {\r\n switch (props.type) {\r\n case \"field\": return FieldRun.create(props);\r\n case \"fraction\": return FractionRun.create(props);\r\n case \"linebreak\": return LineBreakRun.create(props);\r\n case \"tab\": return TabRun.create(props);\r\n case \"text\": return TextRun.create(props);\r\n }\r\n }\r\n}\r\n\r\n/** Describes whether the characters of a [[TextRun]] should be displayed normally, in subscript, or in superscript.\r\n * [[TextStyleSettings.superScriptScale]], [[TextStyleSettings.subScriptScale]], [[TextStyleSettings.superScriptOffsetFactor]], and [[TextStyleSettings.subScriptOffsetFactor]]\r\n * affect how the content is rendered.\r\n * @beta\r\n */\r\nexport type BaselineShift = \"subscript\" | \"superscript\" | \"none\";\r\n\r\n/** JSON representation of a [[TextRun]].\r\n * @beta\r\n */\r\nexport interface TextRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"text\";\r\n /** The characters displayed by the run.\r\n * Default: an empty string.\r\n */\r\n content?: string;\r\n /** Whether to display [[content]] as a subscript, superscript, or normally.\r\n * Default: \"none\"\r\n */\r\n baselineShift?: BaselineShift;\r\n}\r\n\r\n/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.\r\n * @beta\r\n */\r\nexport class TextRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"text\";\r\n /** The sequence of characters to be displayed by the run. */\r\n public content: string;\r\n /** Whether to display [[content]] as a subscript, superscript, or normally. */\r\n public baselineShift: BaselineShift;\r\n\r\n private constructor(props: TextRunProps) {\r\n super(props);\r\n this.content = props?.content ?? \"\";\r\n this.baselineShift = props?.baselineShift ?? \"none\";\r\n }\r\n\r\n public override clone(): TextRun {\r\n return new TextRun(this.toJSON());\r\n }\r\n\r\n public override toJSON(): TextRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"text\",\r\n content: this.content,\r\n baselineShift: this.baselineShift,\r\n };\r\n }\r\n\r\n public static create(props?: Omit<TextRunProps, \"type\">): TextRun {\r\n return new TextRun({ ...props, type: \"text\" });\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /** Simply returns [[content]]. */\r\n public override stringify(): string {\r\n return this.content;\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof TextRun && this.content === other.content && this.baselineShift === other.baselineShift && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[FractionRun]].\r\n * @beta\r\n */\r\nexport interface FractionRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"fraction\";\r\n /** The text displayed before or above the fraction separator, depending on [[TextStyleSettings.stackedFractionType]]. Default: an empty string. */\r\n numerator?: string;\r\n /** The text displayed after or below the fraction separator, depending on [[TextStyleSettings.stackedFractionType]]. Default: an empty string. */\r\n denominator?: string;\r\n}\r\n\r\n/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.\r\n * @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.\r\n * @beta\r\n */\r\nexport class FractionRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"fraction\";\r\n /** The fraction's numerator. */\r\n public numerator: string;\r\n /** The fraction's denominator. */\r\n public denominator: string;\r\n\r\n private constructor(props: FractionRunProps) {\r\n super(props);\r\n this.numerator = props?.numerator ?? \"\";\r\n this.denominator = props?.denominator ?? \"\";\r\n }\r\n\r\n public override toJSON(): FractionRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"fraction\",\r\n numerator: this.numerator,\r\n denominator: this.denominator,\r\n };\r\n }\r\n\r\n public override clone(): FractionRun {\r\n return new FractionRun(this.toJSON());\r\n }\r\n\r\n public static create(props?: Omit<FractionRunProps, \"type\">): FractionRun {\r\n return new FractionRun({ ...props, type: \"fraction\" });\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n const sep = options?.fractionSeparator ?? \"/\";\r\n return `${this.numerator}${sep}${this.denominator}`;\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof FractionRun && this.numerator === other.numerator && this.denominator === other.denominator && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[LineBreakRun]].\r\n * @beta\r\n */\r\nexport interface LineBreakRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"linebreak\";\r\n}\r\n\r\n/** A [[Run]] that represents the end of a line of text within a [[Paragraph]]. It contains no content of its own - it simply causes subsequent content to display on a new line.\r\n * @beta\r\n */\r\nexport class LineBreakRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"linebreak\";\r\n\r\n private constructor(props: LineBreakRunProps) {\r\n super(props);\r\n }\r\n\r\n public override toJSON(): LineBreakRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"linebreak\",\r\n };\r\n }\r\n\r\n public static create(props?: Omit<LineBreakRunProps, \"type\">) {\r\n return new LineBreakRun({ ...props, type: \"linebreak\" });\r\n }\r\n\r\n public override clone(): LineBreakRun {\r\n return new LineBreakRun(this.toJSON());\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n return options?.lineBreak ?? \" \";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof LineBreakRun && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[TabRun]].\r\n * @beta\r\n */\r\nexport interface TabRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"tab\";\r\n}\r\n\r\n/** A [[TabRun]] is used to shift the next tab stop.\r\n * @note Only left-justified tabs are supported at this tab.\r\n * @beta\r\n */\r\nexport class TabRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"tab\";\r\n\r\n public override toJSON(): TabRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"tab\",\r\n };\r\n }\r\n\r\n public override clone(): TabRun {\r\n return new TabRun(this.toJSON());\r\n }\r\n\r\n public static create(props?: Omit<TabRunProps, \"type\">): TabRun {\r\n return new TabRun(props);\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /**\r\n * Converts a [[TabRun]] to its string representation.\r\n * If the `tabsAsSpaces` option is provided, returns a string of spaces of the specified length.\r\n * Otherwise, returns a tab character (\"\\t\").\r\n */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n if (options?.tabsAsSpaces) {\r\n return \" \".repeat(options.tabsAsSpaces);\r\n }\r\n\r\n return \"\\t\";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof TabRun && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[FieldRun]].\r\n * @beta\r\n */\r\nexport interface FieldRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"field\";\r\n /** The element and BIS class containing the property described by [[propertyPath]]. */\r\n propertyHost: FieldPropertyHost;\r\n /** Describes how to obtain the property value from [[propertyHost]]. */\r\n propertyPath: FieldPropertyPath;\r\n /** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].\r\n * The specific options used depend upon the field's [[propertyType]].\r\n */\r\n formatOptions?: FieldFormatOptions;\r\n /** The field's most recently evaluated display string.\r\n * @note It is unnecessary to specify this when creating a field as part of an element like a [[TextAnnotation2d]], because\r\n * all of the element's fields will be re-evaluated when inserting or updating the element in the iModel.\r\n */\r\n cachedContent?: string;\r\n}\r\n\r\n/** A [[Run]] that displays the formatted value of a property of some [Element]($backend).\r\n * When a [[TextBlock]] containing a [[FieldRun]] is written into the iModel as an [ITextAnnotation]($backend) element,\r\n * a dependency is established between the two elements via the [ElementDrivesTextAnnotation]($backend) relationship such that\r\n * whenever the source element specified by [[propertyHost]] is modified or the `ITextAnnotation` element is inserted or updated in the iModel,\r\n * the field(s) in the `ITextAnnotation` element are automatically\r\n * recalculated, causing their [[cachedContent]] to update. If the field's display string cannot be evaluated (for example, because the specified element or\r\n * property does not exist), then its cached content is set to [[FieldRun.invalidContentIndicator]].\r\n * A [[FieldRun]] displays its [[cachedContent]] in the same way that [[TextRun]]s display their `content`, including word wrapping where appropriate.\r\n * @beta\r\n */\r\nexport class FieldRun extends TextBlockComponent {\r\n /** Display string used to signal an error in computing the field's value. */\r\n public static invalidContentIndicator = \"####\";\r\n\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"field\";\r\n /** The element and BIS class containing the property described by [[propertyPath]]. */\r\n public propertyHost: FieldPropertyHost;\r\n /** Describes how to obtain the property value from [[propertyHost]]. */\r\n public propertyPath: FieldPropertyPath;\r\n /** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].\r\n * The specific options used depend upon the [[FieldPropertyType]].\r\n */\r\n public formatOptions?: FieldFormatOptions;\r\n private _cachedContent: string;\r\n\r\n /** The field's most recently evaluated display string. */\r\n public get cachedContent(): string {\r\n return this._cachedContent;\r\n }\r\n\r\n /** @internal Used by core-backend when re-evaluating field content. */\r\n public setCachedContent(content: string | undefined): void {\r\n this._cachedContent = content ?? FieldRun.invalidContentIndicator;\r\n }\r\n\r\n private constructor(props: FieldRunProps) {\r\n super(props);\r\n\r\n this._cachedContent = props.cachedContent ?? FieldRun.invalidContentIndicator;\r\n this.propertyHost = props.propertyHost\r\n this.propertyPath = props.propertyPath;\r\n this.formatOptions = props.formatOptions;\r\n }\r\n\r\n /** Create a FieldRun from its JSON representation. */\r\n public static create(props: Omit<FieldRunProps, \"type\">): FieldRun {\r\n return new FieldRun({\r\n ...props,\r\n propertyHost: { ...props.propertyHost },\r\n propertyPath: structuredClone(props.propertyPath),\r\n formatOptions: structuredClone(props.formatOptions),\r\n type: \"field\",\r\n });\r\n }\r\n\r\n /** Convert the FieldRun to its JSON representation. */\r\n public override toJSON(): FieldRunProps {\r\n const json: FieldRunProps = {\r\n ...super.toJSON(),\r\n type: \"field\",\r\n propertyHost: { ...this.propertyHost },\r\n propertyPath: structuredClone(this.propertyPath),\r\n };\r\n\r\n if (this.cachedContent !== FieldRun.invalidContentIndicator) {\r\n json.cachedContent = this.cachedContent;\r\n }\r\n\r\n if (this.formatOptions) {\r\n json.formatOptions = structuredClone(this.formatOptions);\r\n }\r\n\r\n return json;\r\n }\r\n\r\n /** Create a deep copy of this FieldRun. */\r\n public override clone(): FieldRun {\r\n return new FieldRun(this.toJSON());\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /** Convert this FieldRun to a simple string representation. */\r\n public override stringify(): string {\r\n return this.cachedContent;\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other`. */\r\n public override equals(other: TextBlockComponent): boolean {\r\n if (!(other instanceof FieldRun) || !super.equals(other)) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.propertyHost.elementId !== other.propertyHost.elementId ||\r\n this.propertyHost.className !== other.propertyHost.className ||\r\n this.propertyHost.schemaName !== other.propertyHost.schemaName\r\n ) {\r\n return false;\r\n }\r\n\r\n if (this.propertyPath.propertyName !== other.propertyPath.propertyName) {\r\n return false;\r\n }\r\n\r\n const thisAccessors = this.propertyPath.accessors ?? [];\r\n const otherAccessors = other.propertyPath.accessors ?? [];\r\n\r\n if (thisAccessors.length !== otherAccessors.length) {\r\n return false;\r\n }\r\n\r\n if (!thisAccessors.every((value, index) => value === otherAccessors[index])) {\r\n return false;\r\n }\r\n\r\n if (this.formatOptions && other.formatOptions) {\r\n // We anticipate new formatting options being added in the future.\r\n // So to account for properties we don't know about, just compare the string representations.\r\n if (JSON.stringify(this.formatOptions) !== JSON.stringify(other.formatOptions)) {\r\n return false;\r\n }\r\n } else if (this.formatOptions || other.formatOptions) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[Paragraph]].\r\n * @beta\r\n */\r\nexport interface ParagraphProps extends TextBlockComponentProps {\r\n children?: Array<ListProps | RunProps>;\r\n}\r\n\r\n/** A collection of [[Run]]s and [[List]]s. Paragraphs can be appended to [[List]]s and [[TextBlock]]s.\r\n * Each paragraph is laid out on a separate line. If included in a [[List]], the paragraph will be treated as a list item.\r\n * @beta\r\n */\r\nexport class Paragraph extends TextBlockComponent {\r\n public readonly type = \"paragraph\";\r\n public readonly children: Array<List | Run>;\r\n\r\n private constructor(props?: ParagraphProps) {\r\n super(props);\r\n\r\n this.children = props?.children?.map((child) =>\r\n child.type === \"list\" ? List.create(child) : Run.fromJSON(child)\r\n ) ?? [];\r\n }\r\n\r\n /** Create a paragraph from its JSON representation. */\r\n public static create(props?: Omit<ParagraphProps, \"type\">): Paragraph {\r\n return new Paragraph(props);\r\n }\r\n\r\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\r\n clearStyleOverrides(this, options);\r\n }\r\n\r\n public override get isEmpty() {\r\n return this.children.length === 0;\r\n }\r\n\r\n public override clone(): Paragraph {\r\n return new Paragraph(this.toJSON());\r\n }\r\n\r\n public override toJSON(): ParagraphProps {\r\n return {\r\n ...super.toJSON(),\r\n children: this.children.map((child) => child.toJSON()),\r\n };\r\n }\r\n\r\n /** Compute a string representation of this paragraph by concatenating the string representations of all of its children. */\r\n public override stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string {\r\n return this.children.map((x, index) => (index > 0 && x.type === \"list\") ? `${options?.paragraphBreak ?? \" \"}${x.stringify(options, context)}` : x.stringify(options, context)).join(\"\") ?? \"\";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return (other instanceof Paragraph) && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[List]].\r\n * @beta\r\n */\r\nexport interface ListProps extends TextBlockComponentProps {\r\n readonly type: \"list\";\r\n children?: ParagraphProps[];\r\n}\r\n\r\n/** A collection of list items ([[Paragraph]]s). Lists can be appended to [[Paragraph]]s.\r\n * Lists will be laid out on a new line. Each item in a list is laid out on a separate line.\r\n * @beta\r\n */\r\nexport class List extends TextBlockComponent {\r\n public readonly type = \"list\";\r\n public readonly children: Paragraph[];\r\n\r\n protected constructor(props?: ListProps) {\r\n super(props);\r\n\r\n this.children = props?.children?.map((child) => Paragraph.create(child)) ?? [];\r\n }\r\n\r\n /** Create a list from its JSON representation. */\r\n public static create(props?: Omit<ListProps, \"type\">): List {\r\n return new List({ ...props, type: \"list\" });\r\n }\r\n\r\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\r\n clearStyleOverrides(this, options);\r\n }\r\n\r\n public override get isEmpty() {\r\n return this.children.length === 0;\r\n }\r\n\r\n public override clone(): List {\r\n return new List(this.toJSON());\r\n }\r\n\r\n public override toJSON(): ListProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"list\",\r\n children: this.children.map((run) => run.toJSON()),\r\n };\r\n }\r\n\r\n /** Compute a string representation of this list by concatenating the string representations of all of its [[children]]. */\r\n public override stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string {\r\n const children = this.children.map((x, index) => {\r\n const depth = context?.depth ?? 0;\r\n const marker = getMarkerText(this.styleOverrides.listMarker ?? TextStyleSettings.defaultProps.listMarker, index + 1);\r\n const tab = (options?.tabsAsSpaces ? \" \".repeat(options.tabsAsSpaces) : \"\\t\").repeat(depth);\r\n return `${tab}${marker}${options?.listMarkerBreak ?? \" \"}${x.stringify(options, { depth: depth + 1 })}`;\r\n });\r\n return children.join(options?.paragraphBreak ?? \" \") ?? \"\";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return (other instanceof List) && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[TextBlock]].\r\n * @beta\r\n */\r\nexport interface TextBlockProps extends TextBlockComponentProps {\r\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\r\n * A value less than or equal to zero indicates no wrapping is to be applied.\r\n * Default: 0\r\n */\r\n width?: number;\r\n children?: ParagraphProps[];\r\n}\r\n\r\n/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.\r\n * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.\r\n * @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.\r\n * @beta\r\n */\r\nexport class TextBlock extends TextBlockComponent {\r\n public readonly children: Paragraph[];\r\n\r\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\r\n * A value less than or equal to zero indicates no wrapping is to be applied.\r\n * Default: 0\r\n */\r\n public width: number;\r\n\r\n private constructor(props: TextBlockProps) {\r\n super(props);\r\n this.width = props.width ?? 0;\r\n\r\n this.children = props?.children?.map((para) => Paragraph.create(para)) ?? [];\r\n }\r\n\r\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\r\n clearStyleOverrides(this, options);\r\n }\r\n\r\n public override toJSON(): TextBlockProps {\r\n return {\r\n ...super.toJSON(),\r\n width: this.width,\r\n children: this.children.map((x) => x.toJSON()),\r\n };\r\n }\r\n\r\n /** Create a text block from its JSON representation. */\r\n public static create(props?: Omit<TextBlockProps, \"type\">): TextBlock {\r\n return new TextBlock(props ?? {});\r\n }\r\n\r\n /** Returns true if every paragraph in this text block is empty. */\r\n public override get isEmpty(): boolean {\r\n return !this.children || this.children.every((child) => child.isEmpty);\r\n }\r\n\r\n public override clone(): TextBlock {\r\n return new TextBlock(this.toJSON());\r\n }\r\n\r\n /** Compute a string representation of the document's contents by concatenating the string representations of each of its [[children]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */\r\n public stringify(options?: TextBlockStringifyOptions): string {\r\n return this.children.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? \" \") || \"\";\r\n }\r\n\r\n /** Add and return a new paragraph.\r\n * By default, the paragraph will be created with no [[styleOverrides]], so that it inherits the style of this block.\r\n * @param seedFromLast If true and [[children]] is not empty, the new paragraph will inherit the style overrides of the last child in this block.\r\n * @note Be sure you pass in [[ParagraphProps]] and not [[Paragraph]] or style overrides will be ignored.\r\n */\r\n public appendParagraph(props?: ParagraphProps, seedFromLast = false): Paragraph {\r\n const seed = seedFromLast ? this.children[this.children.length - 1] : undefined;\r\n const styleOverrides = { ...seed?.styleOverrides, ...props?.styleOverrides };\r\n const paragraph = Paragraph.create({ ...props, styleOverrides });\r\n this.children.push(paragraph);\r\n return paragraph;\r\n }\r\n\r\n /** Append a run to the last [[Paragraph]] in this block.\r\n * If the block contains no [[children]], a new [[Paragraph]] will first be created using [[appendParagraph]].\r\n */\r\n public appendRun(run: Run): void {\r\n const paragraph = this.children[this.children.length - 1] ?? this.appendParagraph();\r\n paragraph.children.push(run);\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n if (!(other instanceof TextBlock)) {\r\n return false;\r\n }\r\n\r\n if (!super.equals(other)) {\r\n return false;\r\n }\r\n\r\n if (this.width !== other.width) {\r\n return false;\r\n }\r\n\r\n if (this.children && other.children) {\r\n if (this.children.length !== other.children.length) {\r\n return false;\r\n }\r\n\r\n return this.children.every((child, index) => other.children && child.equals(other.children[index]));\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * A union of all the [[TextBlockComponent]]s that can contain other components.\r\n * @beta\r\n */\r\nexport type StructuralTextBlockComponent = List | Paragraph | TextBlock;\r\n\r\n/**\r\n * Recursively traverses a [[StructuralTextBlockComponent]] tree, yielding each child component along with its parent container.\r\n * This generator enables depth-first iteration over all components in a text block structure, including paragraphs, lists, and runs.\r\n *\r\n * @param parent The root container whose children should be traversed.\r\n * @returns An IterableIterator yielding objects with the child component and its parent container.\r\n * @beta\r\n */\r\nexport function* traverseTextBlockComponent(parent: StructuralTextBlockComponent): IterableIterator<{ parent: StructuralTextBlockComponent, child: List | Paragraph | Run }> {\r\n for (const child of parent.children) {\r\n yield { parent, child };\r\n if (child.type === \"list\" || child.type === \"paragraph\") {\r\n yield* traverseTextBlockComponent(child);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Returns the formatted marker text for a list item based on the marker type and item number.\r\n * Supports ordered and unordered list markers, including alphabetic, Roman numeral, and numeric formats.\r\n * @param marker The type of list marker to use.\r\n * @param num The item number in the list.\r\n * @returns The formatted marker string for the list item.\r\n * @beta\r\n */\r\nexport function getMarkerText(marker: ListMarker, num: number): string {\r\n let markerString = \"\";\r\n\r\n switch (marker.enumerator) {\r\n case undefined:\r\n case ListMarkerEnumerator.Number:\r\n markerString = `${num}`;\r\n break;\r\n case ListMarkerEnumerator.Letter:\r\n markerString = integerToAlpha(num);\r\n break;\r\n case ListMarkerEnumerator.RomanNumeral:\r\n markerString = integerToRoman(num);\r\n break;\r\n default:\r\n markerString = marker.enumerator;\r\n break;\r\n }\r\n\r\n if (marker.case) {\r\n markerString = marker.case === \"upper\" ? markerString.toUpperCase() : markerString.toLowerCase();\r\n }\r\n\r\n const terminator = marker.terminator === \"period\" ? \".\" : marker.terminator === \"parenthesis\" ? \")\" : \"\";\r\n\r\n return `${markerString}${terminator}`;\r\n}\r\n\r\n/**\r\n * Converts an integer to its Roman numeral representation.\r\n * Supports numbers from 1 and above.\r\n * @param num The integer to convert.\r\n * @returns The Roman numeral string.\r\n */\r\nfunction integerToRoman(num: number): string {\r\n const values =\r\n [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\r\n const symbols =\r\n ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\r\n let roman = '';\r\n for (let i = 0; i < values.length; i++) {\r\n while (num >= values[i]) {\r\n roman += symbols[i];\r\n num -= values[i];\r\n }\r\n }\r\n\r\n return roman;\r\n}\r\n\r\n/**\r\n * Converts an integer to its alphabetic representation (A-Z, AA-ZZ, etc.).\r\n * Used for ordered list markers with alphabetic styles.\r\n * @param num The integer to convert (1-based).\r\n * @returns The alphabetic string for the given number.\r\n */\r\nfunction integerToAlpha(num: number): string {\r\n const letterOffset = (num - 1) % 26;\r\n const letter = String.fromCharCode(65 + letterOffset);\r\n const depth = Math.ceil(num / 26);\r\n return letter.repeat(depth);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TextBlock.js","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAmyBH,gEAOC;AAUD,sCA0BC;AA50BD,2CAA0G;AA0D1G,SAAS,mBAAmB,CAAC,SAAuC,EAAE,OAA+B;IACnG,SAAS,CAAC,cAAc,GAAG,EAAE,CAAC;IAC9B,IAAI,CAAC,OAAO,EAAE,yBAAyB,EAAE,CAAC;QACxC,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;YACvC,KAAK,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAsB,kBAAkB;IAC9B,eAAe,CAAyB;IAEhD,gBAAgB;IAChB,YAAsB,KAA+B;QACnD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,KAAK,EAAE,cAAc,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,IAAW,cAAc,CAAC,SAAiC;QACzD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;IAED,8DAA8D;IACvD,mBAAmB,CAAC,QAAgC;QACzD,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED,4HAA4H;IAC5H,IAAW,cAAc;QACvB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACrD,CAAC;IAWD;;;MAGE;IACF,IAAW,YAAY;QACrB,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACzC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AAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,YAAY,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,YAAY,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Annotation\r\n */\r\n\r\nimport { ListMarker, ListMarkerEnumerator, TextStyleSettings, TextStyleSettingsProps } from \"./TextStyle\";\r\nimport { FieldFormatOptions, FieldPropertyHost, FieldPropertyPath } from \"./TextField\";\r\n\r\n/** Options supplied to [[TextBlockComponent.clearStyleOverrides]] to control how the style overrides are cleared on the component and its child components.\r\n * @beta\r\n */\r\nexport interface ClearTextStyleOptions {\r\n /** Controls whether the styleOverrides of any child components are retained.\r\n * By default, all overrides are cleared.\r\n */\r\n preserveChildrenOverrides?: boolean;\r\n}\r\n\r\n/** The JSON representation of a [[TextBlockComponent]].\r\n * @beta\r\n */\r\nexport interface TextBlockComponentProps {\r\n /** Deviations from the base [[TextStyleSettings]] defined by the [AnnotationTextStyle]($backend) applied to this component.\r\n * This permits you to, e.g., create a [[TextBlock]] using \"Arial\" font and override one of its [[TextRun]]s to use \"Comic Sans\" instead.\r\n */\r\n styleOverrides?: TextStyleSettingsProps;\r\n}\r\n\r\n/** Options supplied to [[TextBlockComponent.stringify]] to control how the content is formatted.\r\n * @beta\r\n */\r\nexport interface TextBlockStringifyOptions {\r\n /** A string to insert in between each [[Paragraph]].\r\n * Default: \" \" - a single space.\r\n */\r\n paragraphBreak?: string;\r\n /** A string to insert for each [[LineBreakRun]].\r\n * Default: \" \" - a single space.\r\n */\r\n lineBreak?: string;\r\n /** A string to insert between the numerator and denominator of each [[FractionRun]].\r\n * Default: \"/\"\r\n */\r\n fractionSeparator?: string;\r\n /** The number of spaces to use for tabs. If not provided, tabs will be represented by a tab character: \"\\t\".\r\n * Default: \"undefined\" - use \"\\t\".\r\n */\r\n tabsAsSpaces?: number;\r\n /** A string to insert in between the list marker and the list item.\r\n * Default: \" \" - a single space.\r\n */\r\n listMarkerBreak?: string;\r\n}\r\n\r\n/**\r\n * Context information that may be useful when converting a [[TextBlock]] to a string.\r\n * @beta\r\n */\r\nexport interface TextBlockStringifyContext {\r\n /** The current depth of the text block in the document structure. */\r\n depth: number;\r\n}\r\n\r\nfunction clearStyleOverrides(component: StructuralTextBlockComponent, options?: ClearTextStyleOptions): void {\r\n component.styleOverrides = {};\r\n if (!options?.preserveChildrenOverrides) {\r\n for (const child of component.children) {\r\n child.clearStyleOverrides(options);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s and [[StructuralTextBlockComponent]]s.\r\n * The [[TextBlock]] can specify an [AnnotationTextStyle]($backend) that formats its contents.\r\n * Each component can specify an optional [[styleOverrides]] to customize that formatting.\r\n * @beta\r\n */\r\nexport abstract class TextBlockComponent {\r\n private _styleOverrides: TextStyleSettingsProps;\r\n\r\n /** @internal */\r\n protected constructor(props?: TextBlockComponentProps) {\r\n this._styleOverrides = structuredClone(props?.styleOverrides ?? {});\r\n }\r\n\r\n /** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).\r\n * For example, if the style uses the \"Arial\" font, you can override that by settings `styleOverrides.font.name` to \"Comic Sans\".\r\n * @see [[clearStyleOverrides]] to reset this to an empty object.\r\n */\r\n public get styleOverrides(): TextStyleSettingsProps {\r\n return this._styleOverrides;\r\n }\r\n\r\n public set styleOverrides(overrides: TextStyleSettingsProps) {\r\n this._styleOverrides = structuredClone(overrides);\r\n }\r\n\r\n /** Reset any [[styleOverrides]] applied to this component. */\r\n public clearStyleOverrides(_options?: ClearTextStyleOptions): void {\r\n this.styleOverrides = {};\r\n }\r\n\r\n /** Returns true if [[styleOverrides]] specifies any deviations from the [[TextBlock]]'s [AnnotationTextStyle]($backend). */\r\n public get overridesStyle(): boolean {\r\n return Object.keys(this.styleOverrides).length > 0;\r\n }\r\n\r\n /** Create a deep copy of this component. */\r\n public abstract clone(): TextBlockComponent;\r\n\r\n /** Compute a string representation of the contents of this component and all of its sub-components. */\r\n public abstract stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string;\r\n\r\n /** Returns true if this component has no content or children. */\r\n public abstract get isEmpty(): boolean;\r\n\r\n /**\r\n * Returns true if the string representation of this component consists only of whitespace characters.\r\n * Useful for checking if the component is visually empty (producing no graphics) or contains only spaces, tabs, or line breaks.\r\n */\r\n public get isWhitespace(): boolean {\r\n return /^\\s*$/g.test(this.stringify());\r\n };\r\n\r\n /** Convert this component to its JSON representation. */\r\n public toJSON(): TextBlockComponentProps {\r\n return {\r\n styleOverrides: structuredClone(this.styleOverrides),\r\n };\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other`. */\r\n public equals(other: TextBlockComponent): boolean {\r\n const mySettings = TextStyleSettings.fromJSON(this.styleOverrides);\r\n const otherSettings = TextStyleSettings.fromJSON(other.styleOverrides);\r\n return mySettings.equals(otherSettings);\r\n }\r\n}\r\n\r\n/** [[TextBlockComponent]]s contained within a [[Paragraph]].\r\n * @beta\r\n */\r\nexport type Run = TextRun | FractionRun | TabRun | LineBreakRun | FieldRun;\r\n\r\n/** The JSON representation of a [[Run]].\r\n * Use the `type` field to discriminate between the different kinds of runs.\r\n * @beta\r\n */\r\nexport type RunProps = TextRunProps | FractionRunProps | TabRunProps | LineBreakRunProps | FieldRunProps;\r\n\r\n/** A sequence of characters within a [[Paragraph]] that share a single style. Runs are the leaf nodes of a [[TextBlock]] document. When laid out for display, a single run may span\r\n * multiple lines, but it will never contain different styling.\r\n * Use the `type` field to discriminate between the different kinds of runs.\r\n * @beta\r\n */\r\nexport namespace Run { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Create a run from its JSON representation.\r\n * @see [[TextRun.create]], [[FractionRun.create]], [[FieldRun.create]], [[TabRun.create]], and [[LineBreakRun.create]] to create a run directly.\r\n */\r\n export function fromJSON(props: RunProps): Run {\r\n switch (props.type) {\r\n case \"field\": return FieldRun.create(props);\r\n case \"fraction\": return FractionRun.create(props);\r\n case \"linebreak\": return LineBreakRun.create(props);\r\n case \"tab\": return TabRun.create(props);\r\n case \"text\": return TextRun.create(props);\r\n }\r\n }\r\n}\r\n\r\n/** Describes whether the characters of a [[TextRun]] should be displayed normally, in subscript, or in superscript.\r\n * [[TextStyleSettings.superScriptScale]], [[TextStyleSettings.subScriptScale]], [[TextStyleSettings.superScriptOffsetFactor]], and [[TextStyleSettings.subScriptOffsetFactor]]\r\n * affect how the content is rendered.\r\n * @beta\r\n */\r\nexport type BaselineShift = \"subscript\" | \"superscript\" | \"none\";\r\n\r\n/** JSON representation of a [[TextRun]].\r\n * @beta\r\n */\r\nexport interface TextRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"text\";\r\n /** The characters displayed by the run.\r\n * Default: an empty string.\r\n */\r\n content?: string;\r\n /** Whether to display [[content]] as a subscript, superscript, or normally.\r\n * Default: \"none\"\r\n */\r\n baselineShift?: BaselineShift;\r\n}\r\n\r\n/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.\r\n * @beta\r\n */\r\nexport class TextRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"text\";\r\n /** The sequence of characters to be displayed by the run. */\r\n public content: string;\r\n /** Whether to display [[content]] as a subscript, superscript, or normally. */\r\n public baselineShift: BaselineShift;\r\n\r\n private constructor(props: TextRunProps) {\r\n super(props);\r\n this.content = props?.content ?? \"\";\r\n this.baselineShift = props?.baselineShift ?? \"none\";\r\n }\r\n\r\n public override clone(): TextRun {\r\n return new TextRun(this.toJSON());\r\n }\r\n\r\n public override toJSON(): TextRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"text\",\r\n content: this.content,\r\n baselineShift: this.baselineShift,\r\n };\r\n }\r\n\r\n public static create(props?: Omit<TextRunProps, \"type\">): TextRun {\r\n return new TextRun({ ...props, type: \"text\" });\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /** Simply returns [[content]]. */\r\n public override stringify(): string {\r\n return this.content;\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof TextRun && this.content === other.content && this.baselineShift === other.baselineShift && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[FractionRun]].\r\n * @beta\r\n */\r\nexport interface FractionRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"fraction\";\r\n /** The text displayed before or above the fraction separator, depending on [[TextStyleSettings.stackedFractionType]]. Default: an empty string. */\r\n numerator?: string;\r\n /** The text displayed after or below the fraction separator, depending on [[TextStyleSettings.stackedFractionType]]. Default: an empty string. */\r\n denominator?: string;\r\n}\r\n\r\n/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.\r\n * @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.\r\n * @beta\r\n */\r\nexport class FractionRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"fraction\";\r\n /** The fraction's numerator. */\r\n public numerator: string;\r\n /** The fraction's denominator. */\r\n public denominator: string;\r\n\r\n private constructor(props: FractionRunProps) {\r\n super(props);\r\n this.numerator = props?.numerator ?? \"\";\r\n this.denominator = props?.denominator ?? \"\";\r\n }\r\n\r\n public override toJSON(): FractionRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"fraction\",\r\n numerator: this.numerator,\r\n denominator: this.denominator,\r\n };\r\n }\r\n\r\n public override clone(): FractionRun {\r\n return new FractionRun(this.toJSON());\r\n }\r\n\r\n public static create(props?: Omit<FractionRunProps, \"type\">): FractionRun {\r\n return new FractionRun({ ...props, type: \"fraction\" });\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n const sep = options?.fractionSeparator ?? \"/\";\r\n return `${this.numerator}${sep}${this.denominator}`;\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof FractionRun && this.numerator === other.numerator && this.denominator === other.denominator && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[LineBreakRun]].\r\n * @beta\r\n */\r\nexport interface LineBreakRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"linebreak\";\r\n}\r\n\r\n/** A [[Run]] that represents the end of a line of text within a [[Paragraph]]. It contains no content of its own - it simply causes subsequent content to display on a new line.\r\n * @beta\r\n */\r\nexport class LineBreakRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"linebreak\";\r\n\r\n private constructor(props: LineBreakRunProps) {\r\n super(props);\r\n }\r\n\r\n public override toJSON(): LineBreakRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"linebreak\",\r\n };\r\n }\r\n\r\n public static create(props?: Omit<LineBreakRunProps, \"type\">) {\r\n return new LineBreakRun({ ...props, type: \"linebreak\" });\r\n }\r\n\r\n public override clone(): LineBreakRun {\r\n return new LineBreakRun(this.toJSON());\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n return options?.lineBreak ?? \" \";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof LineBreakRun && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[TabRun]].\r\n * @beta\r\n */\r\nexport interface TabRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"tab\";\r\n}\r\n\r\n/** A [[TabRun]] is used to shift the next tab stop.\r\n * @note Only left-justified tabs are supported at this tab.\r\n * @beta\r\n */\r\nexport class TabRun extends TextBlockComponent {\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"tab\";\r\n\r\n public override toJSON(): TabRunProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"tab\",\r\n };\r\n }\r\n\r\n public override clone(): TabRun {\r\n return new TabRun(this.toJSON());\r\n }\r\n\r\n public static create(props?: Omit<TabRunProps, \"type\">): TabRun {\r\n return new TabRun(props);\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /**\r\n * Converts a [[TabRun]] to its string representation.\r\n * If the `tabsAsSpaces` option is provided, returns a string of spaces of the specified length.\r\n * Otherwise, returns a tab character (\"\\t\").\r\n */\r\n public override stringify(options?: TextBlockStringifyOptions): string {\r\n if (options?.tabsAsSpaces) {\r\n return \" \".repeat(options.tabsAsSpaces);\r\n }\r\n\r\n return \"\\t\";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return other instanceof TabRun && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[FieldRun]].\r\n * @beta\r\n */\r\nexport interface FieldRunProps extends TextBlockComponentProps {\r\n /** Discriminator field for the [[RunProps]] union. */\r\n readonly type: \"field\";\r\n /** The element and BIS class containing the property described by [[propertyPath]]. */\r\n propertyHost: FieldPropertyHost;\r\n /** Describes how to obtain the property value from [[propertyHost]]. */\r\n propertyPath: FieldPropertyPath;\r\n /** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].\r\n * The specific options used depend upon the field's [[propertyType]].\r\n */\r\n formatOptions?: FieldFormatOptions;\r\n /** The field's most recently evaluated display string.\r\n * @note It is unnecessary to specify this when creating a field as part of an element like a [[TextAnnotation2d]], because\r\n * all of the element's fields will be re-evaluated when inserting or updating the element in the iModel.\r\n */\r\n cachedContent?: string;\r\n}\r\n\r\nfunction accessorsEqual(a: ReadonlyArray<string | number> | undefined, b: ReadonlyArray<string | number> | undefined): boolean {\r\n const lhs = a ?? [];\r\n const rhs = b ?? [];\r\n return lhs.length === rhs.length && lhs.every((value, index) => value === rhs[index]);\r\n}\r\n\r\n/** A [[Run]] that displays the formatted value of a property of some [Element]($backend).\r\n * When a [[TextBlock]] containing a [[FieldRun]] is written into the iModel as an [ITextAnnotation]($backend) element,\r\n * a dependency is established between the two elements via the [ElementDrivesTextAnnotation]($backend) relationship such that\r\n * whenever the source element specified by [[propertyHost]] is modified or the `ITextAnnotation` element is inserted or updated in the iModel,\r\n * the field(s) in the `ITextAnnotation` element are automatically\r\n * recalculated, causing their [[cachedContent]] to update. If the field's display string cannot be evaluated (for example, because the specified element or\r\n * property does not exist), then its cached content is set to [[FieldRun.invalidContentIndicator]].\r\n * A [[FieldRun]] displays its [[cachedContent]] in the same way that [[TextRun]]s display their `content`, including word wrapping where appropriate.\r\n * @beta\r\n */\r\nexport class FieldRun extends TextBlockComponent {\r\n /** Display string used to signal an error in computing the field's value. */\r\n public static invalidContentIndicator = \"####\";\r\n\r\n /** Discriminator field for the [[Run]] union. */\r\n public readonly type = \"field\";\r\n /** The element and BIS class containing the property described by [[propertyPath]]. */\r\n public propertyHost: FieldPropertyHost;\r\n /** Describes how to obtain the property value from [[propertyHost]]. */\r\n public propertyPath: FieldPropertyPath;\r\n /** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].\r\n * The specific options used depend upon the [[FieldPropertyType]].\r\n */\r\n public formatOptions?: FieldFormatOptions;\r\n private _cachedContent: string;\r\n\r\n /** The field's most recently evaluated display string. */\r\n public get cachedContent(): string {\r\n return this._cachedContent;\r\n }\r\n\r\n /** @internal Used by core-backend when re-evaluating field content. */\r\n public setCachedContent(content: string | undefined): void {\r\n this._cachedContent = content ?? FieldRun.invalidContentIndicator;\r\n }\r\n\r\n private constructor(props: FieldRunProps) {\r\n super(props);\r\n\r\n this._cachedContent = props.cachedContent ?? FieldRun.invalidContentIndicator;\r\n this.propertyHost = props.propertyHost\r\n this.propertyPath = props.propertyPath;\r\n this.formatOptions = props.formatOptions;\r\n }\r\n\r\n /** Create a FieldRun from its JSON representation. */\r\n public static create(props: Omit<FieldRunProps, \"type\">): FieldRun {\r\n return new FieldRun({\r\n ...props,\r\n propertyHost: { ...props.propertyHost },\r\n propertyPath: structuredClone(props.propertyPath),\r\n formatOptions: structuredClone(props.formatOptions),\r\n type: \"field\",\r\n });\r\n }\r\n\r\n /** Convert the FieldRun to its JSON representation. */\r\n public override toJSON(): FieldRunProps {\r\n const json: FieldRunProps = {\r\n ...super.toJSON(),\r\n type: \"field\",\r\n propertyHost: { ...this.propertyHost },\r\n propertyPath: structuredClone(this.propertyPath),\r\n };\r\n\r\n if (this.cachedContent !== FieldRun.invalidContentIndicator) {\r\n json.cachedContent = this.cachedContent;\r\n }\r\n\r\n if (this.formatOptions) {\r\n json.formatOptions = structuredClone(this.formatOptions);\r\n }\r\n\r\n return json;\r\n }\r\n\r\n /** Create a deep copy of this FieldRun. */\r\n public override clone(): FieldRun {\r\n return new FieldRun(this.toJSON());\r\n }\r\n\r\n public override get isEmpty(): boolean {\r\n return this.stringify().length === 0;\r\n }\r\n\r\n /** Convert this FieldRun to a simple string representation. */\r\n public override stringify(): string {\r\n return this.cachedContent;\r\n }\r\n\r\n /** Returns true if `this` is equivalent to `other`. */\r\n public override equals(other: TextBlockComponent): boolean {\r\n if (!(other instanceof FieldRun) || !super.equals(other)) {\r\n return false;\r\n }\r\n\r\n if (\r\n this.propertyHost.elementId !== other.propertyHost.elementId ||\r\n this.propertyHost.className !== other.propertyHost.className ||\r\n this.propertyHost.schemaName !== other.propertyHost.schemaName\r\n ) {\r\n return false;\r\n }\r\n\r\n if (this.propertyPath.propertyName !== other.propertyPath.propertyName) {\r\n return false;\r\n }\r\n\r\n if (!accessorsEqual(this.propertyPath.accessors, other.propertyPath.accessors)) {\r\n return false;\r\n }\r\n\r\n if (!accessorsEqual(this.propertyPath.jsonAccessors, other.propertyPath.jsonAccessors)) {\r\n return false;\r\n }\r\n\r\n if (this.formatOptions && other.formatOptions) {\r\n // We anticipate new formatting options being added in the future.\r\n // So to account for properties we don't know about, just compare the string representations.\r\n if (JSON.stringify(this.formatOptions) !== JSON.stringify(other.formatOptions)) {\r\n return false;\r\n }\r\n } else if (this.formatOptions || other.formatOptions) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** JSON representation of a [[Paragraph]].\r\n * @beta\r\n */\r\nexport interface ParagraphProps extends TextBlockComponentProps {\r\n children?: Array<ListProps | RunProps>;\r\n}\r\n\r\n/** A collection of [[Run]]s and [[List]]s. Paragraphs can be appended to [[List]]s and [[TextBlock]]s.\r\n * Each paragraph is laid out on a separate line. If included in a [[List]], the paragraph will be treated as a list item.\r\n * @beta\r\n */\r\nexport class Paragraph extends TextBlockComponent {\r\n public readonly type = \"paragraph\";\r\n public readonly children: Array<List | Run>;\r\n\r\n private constructor(props?: ParagraphProps) {\r\n super(props);\r\n\r\n this.children = props?.children?.map((child) =>\r\n child.type === \"list\" ? List.create(child) : Run.fromJSON(child)\r\n ) ?? [];\r\n }\r\n\r\n /** Create a paragraph from its JSON representation. */\r\n public static create(props?: Omit<ParagraphProps, \"type\">): Paragraph {\r\n return new Paragraph(props);\r\n }\r\n\r\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\r\n clearStyleOverrides(this, options);\r\n }\r\n\r\n public override get isEmpty() {\r\n return this.children.length === 0;\r\n }\r\n\r\n public override clone(): Paragraph {\r\n return new Paragraph(this.toJSON());\r\n }\r\n\r\n public override toJSON(): ParagraphProps {\r\n return {\r\n ...super.toJSON(),\r\n children: this.children.map((child) => child.toJSON()),\r\n };\r\n }\r\n\r\n /** Compute a string representation of this paragraph by concatenating the string representations of all of its children. */\r\n public override stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string {\r\n return this.children.map((x, index) => (index > 0 && x.type === \"list\") ? `${options?.paragraphBreak ?? \" \"}${x.stringify(options, context)}` : x.stringify(options, context)).join(\"\") ?? \"\";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return (other instanceof Paragraph) && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[List]].\r\n * @beta\r\n */\r\nexport interface ListProps extends TextBlockComponentProps {\r\n readonly type: \"list\";\r\n children?: ParagraphProps[];\r\n}\r\n\r\n/** A collection of list items ([[Paragraph]]s). Lists can be appended to [[Paragraph]]s.\r\n * Lists will be laid out on a new line. Each item in a list is laid out on a separate line.\r\n * @beta\r\n */\r\nexport class List extends TextBlockComponent {\r\n public readonly type = \"list\";\r\n public readonly children: Paragraph[];\r\n\r\n protected constructor(props?: ListProps) {\r\n super(props);\r\n\r\n this.children = props?.children?.map((child) => Paragraph.create(child)) ?? [];\r\n }\r\n\r\n /** Create a list from its JSON representation. */\r\n public static create(props?: Omit<ListProps, \"type\">): List {\r\n return new List({ ...props, type: \"list\" });\r\n }\r\n\r\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\r\n clearStyleOverrides(this, options);\r\n }\r\n\r\n public override get isEmpty() {\r\n return this.children.length === 0;\r\n }\r\n\r\n public override clone(): List {\r\n return new List(this.toJSON());\r\n }\r\n\r\n public override toJSON(): ListProps {\r\n return {\r\n ...super.toJSON(),\r\n type: \"list\",\r\n children: this.children.map((run) => run.toJSON()),\r\n };\r\n }\r\n\r\n /** Compute a string representation of this list by concatenating the string representations of all of its [[children]]. */\r\n public override stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string {\r\n const children = this.children.map((x, index) => {\r\n const depth = context?.depth ?? 0;\r\n const marker = getMarkerText(this.styleOverrides.listMarker ?? TextStyleSettings.defaultProps.listMarker, index + 1);\r\n const tab = (options?.tabsAsSpaces ? \" \".repeat(options.tabsAsSpaces) : \"\\t\").repeat(depth);\r\n return `${tab}${marker}${options?.listMarkerBreak ?? \" \"}${x.stringify(options, { depth: depth + 1 })}`;\r\n });\r\n return children.join(options?.paragraphBreak ?? \" \") ?? \"\";\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n return (other instanceof List) && super.equals(other);\r\n }\r\n}\r\n\r\n/** JSON representation of a [[TextBlock]].\r\n * @beta\r\n */\r\nexport interface TextBlockProps extends TextBlockComponentProps {\r\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\r\n * A value less than or equal to zero indicates no wrapping is to be applied.\r\n * Default: 0\r\n */\r\n width?: number;\r\n children?: ParagraphProps[];\r\n}\r\n\r\n/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.\r\n * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.\r\n * @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.\r\n * @beta\r\n */\r\nexport class TextBlock extends TextBlockComponent {\r\n public readonly children: Paragraph[];\r\n\r\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\r\n * A value less than or equal to zero indicates no wrapping is to be applied.\r\n * Default: 0\r\n */\r\n public width: number;\r\n\r\n private constructor(props: TextBlockProps) {\r\n super(props);\r\n this.width = props.width ?? 0;\r\n\r\n this.children = props?.children?.map((para) => Paragraph.create(para)) ?? [];\r\n }\r\n\r\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\r\n clearStyleOverrides(this, options);\r\n }\r\n\r\n public override toJSON(): TextBlockProps {\r\n return {\r\n ...super.toJSON(),\r\n width: this.width,\r\n children: this.children.map((x) => x.toJSON()),\r\n };\r\n }\r\n\r\n /** Create a text block from its JSON representation. */\r\n public static create(props?: Omit<TextBlockProps, \"type\">): TextBlock {\r\n return new TextBlock(props ?? {});\r\n }\r\n\r\n /** Returns true if every paragraph in this text block is empty. */\r\n public override get isEmpty(): boolean {\r\n return !this.children || this.children.every((child) => child.isEmpty);\r\n }\r\n\r\n public override clone(): TextBlock {\r\n return new TextBlock(this.toJSON());\r\n }\r\n\r\n /** Compute a string representation of the document's contents by concatenating the string representations of each of its [[children]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */\r\n public stringify(options?: TextBlockStringifyOptions): string {\r\n return this.children.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? \" \") || \"\";\r\n }\r\n\r\n /** Add and return a new paragraph.\r\n * By default, the paragraph will be created with no [[styleOverrides]], so that it inherits the style of this block.\r\n * @param seedFromLast If true and [[children]] is not empty, the new paragraph will inherit the style overrides of the last child in this block.\r\n * @note Be sure you pass in [[ParagraphProps]] and not [[Paragraph]] or style overrides will be ignored.\r\n */\r\n public appendParagraph(props?: ParagraphProps, seedFromLast = false): Paragraph {\r\n const seed = seedFromLast ? this.children[this.children.length - 1] : undefined;\r\n const styleOverrides = { ...seed?.styleOverrides, ...props?.styleOverrides };\r\n const paragraph = Paragraph.create({ ...props, styleOverrides });\r\n this.children.push(paragraph);\r\n return paragraph;\r\n }\r\n\r\n /** Append a run to the last [[Paragraph]] in this block.\r\n * If the block contains no [[children]], a new [[Paragraph]] will first be created using [[appendParagraph]].\r\n */\r\n public appendRun(run: Run): void {\r\n const paragraph = this.children[this.children.length - 1] ?? this.appendParagraph();\r\n paragraph.children.push(run);\r\n }\r\n\r\n public override equals(other: TextBlockComponent): boolean {\r\n if (!(other instanceof TextBlock)) {\r\n return false;\r\n }\r\n\r\n if (!super.equals(other)) {\r\n return false;\r\n }\r\n\r\n if (this.width !== other.width) {\r\n return false;\r\n }\r\n\r\n if (this.children && other.children) {\r\n if (this.children.length !== other.children.length) {\r\n return false;\r\n }\r\n\r\n return this.children.every((child, index) => other.children && child.equals(other.children[index]));\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * A union of all the [[TextBlockComponent]]s that can contain other components.\r\n * @beta\r\n */\r\nexport type StructuralTextBlockComponent = List | Paragraph | TextBlock;\r\n\r\n/**\r\n * Recursively traverses a [[StructuralTextBlockComponent]] tree, yielding each child component along with its parent container.\r\n * This generator enables depth-first iteration over all components in a text block structure, including paragraphs, lists, and runs.\r\n *\r\n * @param parent The root container whose children should be traversed.\r\n * @returns An IterableIterator yielding objects with the child component and its parent container.\r\n * @beta\r\n */\r\nexport function* traverseTextBlockComponent(parent: StructuralTextBlockComponent): IterableIterator<{ parent: StructuralTextBlockComponent, child: List | Paragraph | Run }> {\r\n for (const child of parent.children) {\r\n yield { parent, child };\r\n if (child.type === \"list\" || child.type === \"paragraph\") {\r\n yield* traverseTextBlockComponent(child);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Returns the formatted marker text for a list item based on the marker type and item number.\r\n * Supports ordered and unordered list markers, including alphabetic, Roman numeral, and numeric formats.\r\n * @param marker The type of list marker to use.\r\n * @param num The item number in the list.\r\n * @returns The formatted marker string for the list item.\r\n * @beta\r\n */\r\nexport function getMarkerText(marker: ListMarker, num: number): string {\r\n let markerString = \"\";\r\n\r\n switch (marker.enumerator) {\r\n case undefined:\r\n case ListMarkerEnumerator.Number:\r\n markerString = `${num}`;\r\n break;\r\n case ListMarkerEnumerator.Letter:\r\n markerString = integerToAlpha(num);\r\n break;\r\n case ListMarkerEnumerator.RomanNumeral:\r\n markerString = integerToRoman(num);\r\n break;\r\n default:\r\n markerString = marker.enumerator;\r\n break;\r\n }\r\n\r\n if (marker.case) {\r\n markerString = marker.case === \"upper\" ? markerString.toUpperCase() : markerString.toLowerCase();\r\n }\r\n\r\n const terminator = marker.terminator === \"period\" ? \".\" : marker.terminator === \"parenthesis\" ? \")\" : \"\";\r\n\r\n return `${markerString}${terminator}`;\r\n}\r\n\r\n/**\r\n * Converts an integer to its Roman numeral representation.\r\n * Supports numbers from 1 and above.\r\n * @param num The integer to convert.\r\n * @returns The Roman numeral string.\r\n */\r\nfunction integerToRoman(num: number): string {\r\n const values =\r\n [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\r\n const symbols =\r\n ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\r\n let roman = '';\r\n for (let i = 0; i < values.length; i++) {\r\n while (num >= values[i]) {\r\n roman += symbols[i];\r\n num -= values[i];\r\n }\r\n }\r\n\r\n return roman;\r\n}\r\n\r\n/**\r\n * Converts an integer to its alphabetic representation (A-Z, AA-ZZ, etc.).\r\n * Used for ordered list markers with alphabetic styles.\r\n * @param num The integer to convert (1-based).\r\n * @returns The alphabetic string for the given number.\r\n */\r\nfunction integerToAlpha(num: number): string {\r\n const letterOffset = (num - 1) % 26;\r\n const letter = String.fromCharCode(65 + letterOffset);\r\n const depth = Math.ceil(num / 26);\r\n return letter.repeat(depth);\r\n}\r\n"]}
|
|
@@ -8,12 +8,15 @@ import { Id64String } from "@itwin/core-bentley";
|
|
|
8
8
|
* The following types are currently recognized:
|
|
9
9
|
* - "quantity": an often-unitized scalar value like a distance or area, formatted using a quantity [Format]($core-quantity).
|
|
10
10
|
* - "coordinate": a 2- or 3-dimensional point, with each component formatted as a "quantity".
|
|
11
|
-
* - "boolean": a true or false value.
|
|
11
|
+
* - "boolean": a true or false value; currently converted via `toString()` (localized formatting not yet implemented).
|
|
12
12
|
* - "datetime": an ECMAScript [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date).
|
|
13
|
-
* - "int-enum": an integer [EnumerationProperty]($ecschema-metadata)
|
|
14
|
-
* - "string-enum": a string [EnumerationProperty]($ecschema-metadata)
|
|
13
|
+
* - "int-enum": an integer [EnumerationProperty]($ecschema-metadata); currently converted via `toString()` (display-label lookup not yet implemented).
|
|
14
|
+
* - "string-enum": a string [EnumerationProperty]($ecschema-metadata); currently converted via `toString()` (display-label lookup not yet implemented).
|
|
15
15
|
* - "string": a value convertible to a string.
|
|
16
|
-
* @note
|
|
16
|
+
* @note `"quantity"` and `"coordinate"` values format through the quantity pipeline when a
|
|
17
|
+
* [Format]($core-quantity) resolves for the field, from the FormatSets configured via
|
|
18
|
+
* [ElementDrivesTextAnnotation.registerFieldFormatting]($backend) or from the iModel's schemas.
|
|
19
|
+
* Otherwise they render as `value.toString()` — a bare number, or `(x, y[, z])` for a coordinate.
|
|
17
20
|
* @beta
|
|
18
21
|
*/
|
|
19
22
|
export type FieldPropertyType = "quantity" | "coordinate" | "string" | "boolean" | "datetime" | "int-enum" | "string-enum";
|
|
@@ -22,14 +25,29 @@ export type FieldPropertyType = "quantity" | "coordinate" | "string" | "boolean"
|
|
|
22
25
|
* The simplest property paths consist of a [[propertyName]] and nothing else, where `propertyName` identifies
|
|
23
26
|
* a primitive property.
|
|
24
27
|
* If `propertyName` identifies a struct or array property, then additional [[accessors]] are required to identify the specific value.
|
|
28
|
+
* If `propertyName` (including any [[accessors]]) resolves to a string property of extended type `Json`, such as `JsonProperties`,
|
|
29
|
+
* then additional [[jsonAccessors]] are required to identify a specific value within the serialized JSON.
|
|
25
30
|
* Some examples:
|
|
26
31
|
* ```
|
|
27
|
-
* | Access String | propertyName | accessors |
|
|
28
|
-
* | ------------- | ------------ | --------- |
|
|
29
|
-
* | name | "name" | undefined |
|
|
30
|
-
* | spouse.name | "spouse" | [name] |
|
|
31
|
-
* | colors[2] | "colors" | [2] |
|
|
32
|
-
* | spouse.favoriteRestaurants[1].address | "spouse" | ["favoriteRestaurants", 1, "address"] |
|
|
32
|
+
* | Access String | propertyName | accessors | jsonAccessors |
|
|
33
|
+
* | ------------- | ------------ | --------- | ------------- |
|
|
34
|
+
* | name | "name" | undefined | undefined |
|
|
35
|
+
* | spouse.name | "spouse" | [name] | undefined |
|
|
36
|
+
* | colors[2] | "colors" | [2] | undefined |
|
|
37
|
+
* | spouse.favoriteRestaurants[1].address | "spouse" | ["favoriteRestaurants", 1, "address"] | undefined |
|
|
38
|
+
* | jsonProperties.contactInfo.email | "jsonProperties" | undefined | ["contactInfo", "email"] |
|
|
39
|
+
* | spouse.jsonProperties.contactInfo.phoneNumbers[0].areaCode | "spouse" | ["jsonProperties"] | ["contactInfo", "phoneNumbers", 0, "areaCode"] |
|
|
40
|
+
* ```
|
|
41
|
+
* A path using `jsonAccessors` must end on a scalar (string, number, or boolean); a path that ends on an object, an array,
|
|
42
|
+
* or a JSON `null` resolves to no value.
|
|
43
|
+
*
|
|
44
|
+
* For example, to display a value stored in an element's `JsonProperties`:
|
|
45
|
+
* ```ts
|
|
46
|
+
* [[include:TextFields_JsonAccessors]]
|
|
47
|
+
* ```
|
|
48
|
+
* Or, when the JSON property is reached through a struct member:
|
|
49
|
+
* ```ts
|
|
50
|
+
* [[include:TextFields_NestedJsonAccessors]]
|
|
33
51
|
* ```
|
|
34
52
|
* @beta
|
|
35
53
|
*/
|
|
@@ -38,6 +56,10 @@ export interface FieldPropertyPath {
|
|
|
38
56
|
propertyName: string;
|
|
39
57
|
/** Property names and/or array indices describing the path from [[propertyName]] to the ultimate BIS property. */
|
|
40
58
|
accessors?: Array<string | number>;
|
|
59
|
+
/** If [[propertyName]] and [[accessors]] (if defined) resolve to a BIS string property of extended type `Json`, property names and/or
|
|
60
|
+
* array indices for selecting a primitive value within the JSON.
|
|
61
|
+
*/
|
|
62
|
+
jsonAccessors?: Array<string | number>;
|
|
41
63
|
}
|
|
42
64
|
/** Describes the source of the property value against which a [[FieldPropertyPath]] is evaluated.
|
|
43
65
|
* A field property is always hosted by an [Element]($backend). It may refer to a property belonging to any of the following:
|
|
@@ -55,7 +77,7 @@ export interface FieldPropertyHost {
|
|
|
55
77
|
/** The name of the exact class (not a subclass) containing the property identified by [[FieldPropertyPath.propertyName]]. */
|
|
56
78
|
className: string;
|
|
57
79
|
}
|
|
58
|
-
/** As part of [[FieldFormatOptions]], specifies how to modify the case of the display string.
|
|
80
|
+
/** As part of a [[FieldFormatOptions]], specifies how to modify the case of the display string.
|
|
59
81
|
* "as-is" leaves it unmodified. "upper" and "lower" convert it to all upper-case or all lower-case, respectively.
|
|
60
82
|
* @beta
|
|
61
83
|
*/
|
|
@@ -71,6 +93,47 @@ export interface DateTimeFieldFormatOptions {
|
|
|
71
93
|
/** Describes how to produce the display string. */
|
|
72
94
|
formatOptions?: Intl.DateTimeFormatOptions;
|
|
73
95
|
}
|
|
96
|
+
/** As part of a [[FieldFormatOptions]], specifies how to format [[FieldPropertyType]]
|
|
97
|
+
* `"quantity"` or `"coordinate"` values.
|
|
98
|
+
*
|
|
99
|
+
* [[kindOfQuantity]] and [[persistenceUnit]] are independent overrides: setting one falls
|
|
100
|
+
* through to the property for the other, and an empty string counts as unset. A name the iModel's
|
|
101
|
+
* schemas define may use any case and either `Schema.Item` or `Schema:Item` spelling; a
|
|
102
|
+
* KindOfQuantity defined only by a FormatSet must match its key exactly. A field that resolves
|
|
103
|
+
* no format renders its raw value.
|
|
104
|
+
*
|
|
105
|
+
* These property names are also the persisted form — a [[FieldRun]] serializes them verbatim
|
|
106
|
+
* into its element's `TextAnnotationData` — so applications can query for annotations carrying
|
|
107
|
+
* quantity overrides by the literal strings `"kindOfQuantity"` and `"persistenceUnit"`.
|
|
108
|
+
* @see [Quantity formatting for text annotation fields]($docs/learning/backend/TextAnnotationFields.md)
|
|
109
|
+
* for the full resolution order.
|
|
110
|
+
* @beta
|
|
111
|
+
*/
|
|
112
|
+
export interface QuantityFieldFormatOptions {
|
|
113
|
+
/** Full name of a [Unit]($ecschema-metadata) (e.g. `"Units.M"`) the magnitude is expressed in,
|
|
114
|
+
* for a property that has no persistence unit of its own — a coordinate, a plain `double`, or a
|
|
115
|
+
* JSON leaf.
|
|
116
|
+
*
|
|
117
|
+
* Because this states what the value *means* rather than how it looks, the property's own
|
|
118
|
+
* persistence unit is authoritative when it has one: a `persistenceUnit` that names a different
|
|
119
|
+
* unit is ignored and a warning is logged.
|
|
120
|
+
*/
|
|
121
|
+
persistenceUnit?: string;
|
|
122
|
+
/** Full name of a [KindOfQuantity]($ecschema-metadata) (e.g. `"AecUnits.LENGTH"`) to format
|
|
123
|
+
* through, overriding the property's own.
|
|
124
|
+
*/
|
|
125
|
+
kindOfQuantity?: string;
|
|
126
|
+
/** Identifier of a FormatSet whose formats take precedence for this field, letting one iModel
|
|
127
|
+
* mix presentations such as metric and imperial callouts.
|
|
128
|
+
*
|
|
129
|
+
* Application-chosen, and matched against the ids supplied to
|
|
130
|
+
* [ElementDrivesTextAnnotation.registerFieldFormatting]($backend); iTwin.js does not
|
|
131
|
+
* resolve it against anything persisted in the iModel. A field naming an id that was never
|
|
132
|
+
* supplied resolves as if it named none: through the iModel's adopted FormatSet, then the
|
|
133
|
+
* schema presentation format.
|
|
134
|
+
*/
|
|
135
|
+
formatSet?: string;
|
|
136
|
+
}
|
|
74
137
|
/** Customizes how to format the raw property value resolved by a [[FieldPropertyPath]] into a [[FieldRun]]'s display string.
|
|
75
138
|
* The exact options used depend upon the [[FieldPropertyType]].
|
|
76
139
|
* @beta
|
|
@@ -84,5 +147,7 @@ export interface FieldFormatOptions {
|
|
|
84
147
|
case?: FieldCase;
|
|
85
148
|
/** Formatting options for [[FieldPropertyType]] "datetime". */
|
|
86
149
|
dateTime?: DateTimeFieldFormatOptions;
|
|
150
|
+
/** Formatting options for [[FieldPropertyType]] `"quantity"` and `"coordinate"`. */
|
|
151
|
+
quantity?: QuantityFieldFormatOptions;
|
|
87
152
|
}
|
|
88
153
|
//# sourceMappingURL=TextField.d.ts.map
|