@mlightcad/cad-simple-viewer 1.4.12 → 1.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/index.js +15901 -10590
  2. package/dist/index.umd.cjs +55 -48
  3. package/dist/libredwg-parser-worker.js +4724 -4762
  4. package/lib/app/AcApDocManager.d.ts +60 -4
  5. package/lib/app/AcApDocManager.d.ts.map +1 -1
  6. package/lib/app/AcApDocManager.js +160 -33
  7. package/lib/app/AcApDocManager.js.map +1 -1
  8. package/lib/command/AcApArcCmd.d.ts.map +1 -1
  9. package/lib/command/AcApArcCmd.js +1 -1
  10. package/lib/command/AcApArcCmd.js.map +1 -1
  11. package/lib/command/AcApCircleCmd.d.ts +59 -0
  12. package/lib/command/AcApCircleCmd.d.ts.map +1 -1
  13. package/lib/command/AcApCircleCmd.js +489 -18
  14. package/lib/command/AcApCircleCmd.js.map +1 -1
  15. package/lib/command/AcApConvertToPngCmd.d.ts +35 -0
  16. package/lib/command/AcApConvertToPngCmd.d.ts.map +1 -0
  17. package/lib/command/{AcApZoomToBoxCmd.js → AcApConvertToPngCmd.js} +50 -26
  18. package/lib/command/AcApConvertToPngCmd.js.map +1 -0
  19. package/lib/command/AcApEllipseCmd.d.ts +87 -0
  20. package/lib/command/AcApEllipseCmd.d.ts.map +1 -0
  21. package/lib/command/AcApEllipseCmd.js +583 -0
  22. package/lib/command/AcApEllipseCmd.js.map +1 -0
  23. package/lib/command/AcApHatchCmd.d.ts +210 -0
  24. package/lib/command/AcApHatchCmd.d.ts.map +1 -0
  25. package/lib/command/AcApHatchCmd.js +808 -0
  26. package/lib/command/AcApHatchCmd.js.map +1 -0
  27. package/lib/command/AcApLayerCmd.d.ts +217 -0
  28. package/lib/command/AcApLayerCmd.d.ts.map +1 -0
  29. package/lib/command/AcApLayerCmd.js +768 -0
  30. package/lib/command/AcApLayerCmd.js.map +1 -0
  31. package/lib/command/AcApLineCmd.d.ts +36 -1
  32. package/lib/command/AcApLineCmd.d.ts.map +1 -1
  33. package/lib/command/AcApLineCmd.js +157 -20
  34. package/lib/command/AcApLineCmd.js.map +1 -1
  35. package/lib/command/AcApMeasureAreaCmd.d.ts.map +1 -1
  36. package/lib/command/AcApMeasureAreaCmd.js +3 -0
  37. package/lib/command/AcApMeasureAreaCmd.js.map +1 -1
  38. package/lib/command/AcApMoveCmd.d.ts +16 -0
  39. package/lib/command/AcApMoveCmd.d.ts.map +1 -0
  40. package/lib/command/AcApMoveCmd.js +278 -0
  41. package/lib/command/AcApMoveCmd.js.map +1 -0
  42. package/lib/command/AcApPngConvertor.d.ts +95 -0
  43. package/lib/command/AcApPngConvertor.d.ts.map +1 -0
  44. package/lib/command/AcApPngConvertor.js +205 -0
  45. package/lib/command/AcApPngConvertor.js.map +1 -0
  46. package/lib/command/AcApPolygonCmd.d.ts +69 -0
  47. package/lib/command/AcApPolygonCmd.d.ts.map +1 -0
  48. package/lib/command/AcApPolygonCmd.js +422 -0
  49. package/lib/command/AcApPolygonCmd.js.map +1 -0
  50. package/lib/command/AcApRectCmd.d.ts +149 -4
  51. package/lib/command/AcApRectCmd.d.ts.map +1 -1
  52. package/lib/command/AcApRectCmd.js +716 -34
  53. package/lib/command/AcApRectCmd.js.map +1 -1
  54. package/lib/command/AcApRevCircleCmd.d.ts +8 -0
  55. package/lib/command/AcApRevCircleCmd.d.ts.map +1 -1
  56. package/lib/command/AcApRevCircleCmd.js +30 -6
  57. package/lib/command/AcApRevCircleCmd.js.map +1 -1
  58. package/lib/command/AcApRevRectCmd.d.ts +8 -0
  59. package/lib/command/AcApRevRectCmd.d.ts.map +1 -1
  60. package/lib/command/AcApRevRectCmd.js +78 -6
  61. package/lib/command/AcApRevRectCmd.js.map +1 -1
  62. package/lib/command/AcApSplineCmd.d.ts +66 -1
  63. package/lib/command/AcApSplineCmd.d.ts.map +1 -1
  64. package/lib/command/AcApSplineCmd.js +466 -59
  65. package/lib/command/AcApSplineCmd.js.map +1 -1
  66. package/lib/command/AcApZoomCmd.d.ts +91 -20
  67. package/lib/command/AcApZoomCmd.d.ts.map +1 -1
  68. package/lib/command/AcApZoomCmd.js +288 -23
  69. package/lib/command/AcApZoomCmd.js.map +1 -1
  70. package/lib/command/index.d.ts +7 -1
  71. package/lib/command/index.d.ts.map +1 -1
  72. package/lib/command/index.js +7 -1
  73. package/lib/command/index.js.map +1 -1
  74. package/lib/editor/command/AcEdCommandStack.d.ts +54 -1
  75. package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
  76. package/lib/editor/command/AcEdCommandStack.js +207 -25
  77. package/lib/editor/command/AcEdCommandStack.js.map +1 -1
  78. package/lib/editor/input/AcEdSelectionFilter.d.ts +79 -0
  79. package/lib/editor/input/AcEdSelectionFilter.d.ts.map +1 -0
  80. package/lib/editor/input/AcEdSelectionFilter.js +231 -0
  81. package/lib/editor/input/AcEdSelectionFilter.js.map +1 -0
  82. package/lib/editor/input/AcEditor.d.ts +20 -2
  83. package/lib/editor/input/AcEditor.d.ts.map +1 -1
  84. package/lib/editor/input/AcEditor.js +66 -0
  85. package/lib/editor/input/AcEditor.js.map +1 -1
  86. package/lib/editor/input/index.d.ts +1 -0
  87. package/lib/editor/input/index.d.ts.map +1 -1
  88. package/lib/editor/input/index.js +1 -0
  89. package/lib/editor/input/index.js.map +1 -1
  90. package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts +47 -0
  91. package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts.map +1 -1
  92. package/lib/editor/input/prompt/AcEdKeywordCollection.js +19 -0
  93. package/lib/editor/input/prompt/AcEdKeywordCollection.js.map +1 -1
  94. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +7 -0
  95. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
  96. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +17 -0
  97. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -1
  98. package/lib/editor/input/prompt/AcEdPromptEntityOptions.d.ts +17 -0
  99. package/lib/editor/input/prompt/AcEdPromptEntityOptions.d.ts.map +1 -1
  100. package/lib/editor/input/prompt/AcEdPromptEntityOptions.js +30 -3
  101. package/lib/editor/input/prompt/AcEdPromptEntityOptions.js.map +1 -1
  102. package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +6 -1
  103. package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -1
  104. package/lib/editor/input/prompt/AcEdPromptOptions.js +7 -0
  105. package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -1
  106. package/lib/editor/input/session/AcEdKeywordSession.d.ts +65 -0
  107. package/lib/editor/input/session/AcEdKeywordSession.d.ts.map +1 -1
  108. package/lib/editor/input/session/AcEdKeywordSession.js +71 -0
  109. package/lib/editor/input/session/AcEdKeywordSession.js.map +1 -1
  110. package/lib/editor/input/ui/AcEdCommandLine.d.ts +23 -0
  111. package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
  112. package/lib/editor/input/ui/AcEdCommandLine.js +42 -6
  113. package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
  114. package/lib/editor/input/ui/AcEdFloatingInput.d.ts +1 -0
  115. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  116. package/lib/editor/input/ui/AcEdFloatingInput.js +8 -2
  117. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  118. package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +23 -1
  119. package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
  120. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +32 -9
  121. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -1
  122. package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +28 -0
  123. package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
  124. package/lib/editor/input/ui/AcEdInputManager.d.ts +356 -16
  125. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  126. package/lib/editor/input/ui/AcEdInputManager.js +964 -529
  127. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  128. package/lib/editor/input/ui/AcEdRubberBand.d.ts +15 -1
  129. package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -1
  130. package/lib/editor/input/ui/AcEdRubberBand.js +42 -10
  131. package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -1
  132. package/lib/i18n/en/command.d.ts +21 -3
  133. package/lib/i18n/en/command.d.ts.map +1 -1
  134. package/lib/i18n/en/command.js +21 -3
  135. package/lib/i18n/en/command.js.map +1 -1
  136. package/lib/i18n/en/jig.d.ts +443 -0
  137. package/lib/i18n/en/jig.d.ts.map +1 -1
  138. package/lib/i18n/en/jig.js +452 -9
  139. package/lib/i18n/en/jig.js.map +1 -1
  140. package/lib/i18n/zh/command.d.ts +21 -3
  141. package/lib/i18n/zh/command.d.ts.map +1 -1
  142. package/lib/i18n/zh/command.js +21 -3
  143. package/lib/i18n/zh/command.js.map +1 -1
  144. package/lib/i18n/zh/jig.d.ts +443 -0
  145. package/lib/i18n/zh/jig.d.ts.map +1 -1
  146. package/lib/i18n/zh/jig.js +452 -9
  147. package/lib/i18n/zh/jig.js.map +1 -1
  148. package/lib/plugin/AcApPluginManager.d.ts.map +1 -1
  149. package/lib/plugin/AcApPluginManager.js.map +1 -1
  150. package/lib/view/AcTrLayer.d.ts.map +1 -1
  151. package/lib/view/AcTrLayer.js +5 -3
  152. package/lib/view/AcTrLayer.js.map +1 -1
  153. package/lib/view/AcTrView2d.d.ts +0 -1
  154. package/lib/view/AcTrView2d.d.ts.map +1 -1
  155. package/lib/view/AcTrView2d.js +17 -4
  156. package/lib/view/AcTrView2d.js.map +1 -1
  157. package/package.json +11 -9
  158. package/lib/command/AcApZoomToBoxCmd.d.ts +0 -29
  159. package/lib/command/AcApZoomToBoxCmd.d.ts.map +0 -1
  160. package/lib/command/AcApZoomToBoxCmd.js.map +0 -1
@@ -79,37 +79,236 @@ export declare class AcEdInputManager {
79
79
  * @param type Optional type: 'point' | 'distance' | 'angle'
80
80
  */
81
81
  private formatNumber;
82
+ /**
83
+ * Returns whether the supplied prompt defines any keywords.
84
+ *
85
+ * Keyword-aware prompts need extra command-line wiring so textual input can
86
+ * be interpreted as keyword picks instead of free-form values. This helper
87
+ * centralizes the check and gracefully handles prompts that expose no keyword
88
+ * collection.
89
+ *
90
+ * @param options - Prompt options to inspect
91
+ * @returns `true` when at least one keyword is registered on the prompt
92
+ */
82
93
  private hasKeywords;
94
+ /**
95
+ * Builds a keyword-only prompt options object from a general prompt.
96
+ *
97
+ * Several input flows support optional keywords in parallel with their main
98
+ * acquisition mode. Rather than duplicating keyword definitions manually, the
99
+ * original prompt's keyword metadata is cloned into a dedicated
100
+ * `AcEdPromptKeywordOptions` instance that can be passed to the command-line
101
+ * keyword session.
102
+ *
103
+ * @typeParam T - Value type produced by the source prompt
104
+ * @param options - Source prompt whose keyword definitions should be copied
105
+ * @returns A keyword prompt configured with the same message and keyword set
106
+ */
83
107
  private buildKeywordOptions;
108
+ /**
109
+ * Copies keyword definitions from one prompt options object to another.
110
+ *
111
+ * This is primarily used by composite prompts such as `getBox()`, which break
112
+ * a higher-level workflow into multiple sub-prompts while preserving the same
113
+ * keyword vocabulary and default keyword behavior across each stage.
114
+ *
115
+ * @param source - Prompt options providing the keyword definitions
116
+ * @param target - Prompt options receiving the cloned keyword definitions
117
+ */
84
118
  private copyKeywords;
119
+ /**
120
+ * Resolves a picked object id back to its database entity instance.
121
+ *
122
+ * View-level picking only returns lightweight hit-test data such as object
123
+ * ids and bounding information. Prompt validation, however, needs access to
124
+ * the backing `AcDbEntity` so it can inspect runtime metadata like the entity
125
+ * type and layer.
126
+ *
127
+ * @param objectId - Object id returned by the spatial pick query
128
+ * @returns The matching database entity, or `undefined` if it can no longer be found
129
+ */
130
+ private getEntityById;
131
+ /**
132
+ * Returns whether the specified entity belongs to a locked layer.
133
+ *
134
+ * The entity itself only stores its layer name, so this helper resolves the
135
+ * layer record from the current drawing database and inspects its lock state.
136
+ * Missing layer records are treated as unlocked to avoid rejecting input due
137
+ * to incomplete metadata.
138
+ *
139
+ * @param entity - Entity being evaluated for prompt selection
140
+ * @returns `true` if the entity's layer exists and is locked; otherwise `false`
141
+ */
142
+ private isEntityOnLockedLayer;
143
+ /**
144
+ * Checks whether a picked entity satisfies the prompt's allowed-class filter.
145
+ *
146
+ * Different parts of the stack expose the entity type in slightly different
147
+ * forms. The data-model layer provides a short CAD type name through
148
+ * `entity.type` (for example `Line`), while runtime inspection exposes the
149
+ * TypeScript constructor name (for example `AcDbLine`). To maximize
150
+ * compatibility with existing caller expectations, both forms are tested
151
+ * against the prompt's allow-list.
152
+ *
153
+ * @param entity - Picked entity being validated
154
+ * @param options - Prompt options containing the configured allowed classes
155
+ * @returns `true` when the entity matches at least one allowed class, or when
156
+ * no class restriction has been configured
157
+ */
158
+ private isEntityClassAllowed;
159
+ /**
160
+ * Starts a command-line keyword session for the given prompt when needed.
161
+ *
162
+ * Many interactive prompts accept both mouse-driven input and typed keywords
163
+ * at the same time. This helper lazily creates the command-line keyword
164
+ * session only when keywords are actually configured, and returns a small
165
+ * control object that lets callers await or cancel that session.
166
+ *
167
+ * @param options - Prompt options that may define keywords
168
+ * @param allowTyping - Whether arbitrary typing is allowed alongside keyword completion
169
+ * @returns An object containing the keyword promise and cancel callback, or
170
+ * `undefined` when the prompt has no keywords
171
+ */
85
172
  private startKeywordSession;
173
+ /**
174
+ * Narrows an unknown error value to the internal keyword control-flow error.
175
+ *
176
+ * Prompt implementations use {@link AcEdKeywordInputError} as a private
177
+ * mechanism for bubbling a keyword pick out of deeply nested async UI flows.
178
+ * This type guard keeps the outer prompt wrappers readable while preserving
179
+ * strong typing for the extracted keyword token.
180
+ *
181
+ * @param error - Unknown error value thrown from an input workflow
182
+ * @returns `true` if the error represents a keyword selection
183
+ */
86
184
  private isPromptKeyword;
87
185
  /**
88
- * Public point input API.
186
+ * Converts internal prompt control-flow errors to typed prompt results.
187
+ *
188
+ * @typeParam T - Prompt result type to construct
189
+ * @param error - Unknown error thrown from prompt workflow
190
+ * @param handlers - Result factories for mapped prompt statuses
191
+ * @returns Mapped prompt result when recognized; otherwise `undefined`
192
+ */
193
+ private mapPromptError;
194
+ /**
195
+ * Attaches keyword text to a prompt result and returns it.
196
+ */
197
+ private withKeywordResult;
198
+ /**
199
+ * Maps internal control-flow errors to prompt results by status constructor.
200
+ *
201
+ * @typeParam T - Prompt result type
202
+ * @param error - Unknown error thrown from prompt workflow
203
+ * @param create - Factory creating a result from target status
204
+ * @param options - Toggles for supported mapped statuses
205
+ */
206
+ private mapPromptErrorToResult;
207
+ /**
208
+ * Executes prompt workflow with centralized try/catch mapping.
209
+ *
210
+ * @typeParam T - Raw successful value from prompt workflow
211
+ * @typeParam R - Prompt result type
212
+ * @param run - Async prompt workflow that may throw control-flow errors
213
+ * @param onOk - Maps successful workflow value to result object
214
+ * @param create - Creates a result object from mapped prompt status
215
+ * @param options - Toggles for supported mapped statuses
216
+ */
217
+ private executePrompt;
218
+ /**
219
+ * Extracts default-value behavior from prompt options when supported.
220
+ */
221
+ private resolvePromptDefaultValue;
222
+ /**
223
+ * Prompts the user to specify a point.
224
+ *
225
+ * The point may be supplied by clicking in the view, typing coordinates into
226
+ * the floating input, or consuming a queued scripted input token. Keywords are
227
+ * also supported when configured on the prompt options.
228
+ *
229
+ * @param options - Point prompt options controlling messaging, base-point
230
+ * behavior, jig integration, and keywords
231
+ * @returns A prompt result containing the picked point, cancel status, or keyword
89
232
  */
90
233
  getPoint(options: AcEdPromptPointOptions): Promise<AcEdPromptPointResult>;
91
234
  /**
92
- * Prompt the user to type a numeric value. If integerOnly is true, integers
93
- * are enforced. The input is validated and the box will be marked invalid if
94
- * the typed value does not conform, allowing the user to retype.
235
+ * Prompts the user for a purely typed numeric value through floating input.
236
+ *
237
+ * This helper is shared by distance, angle, double, and integer prompts when
238
+ * no mouse-driven geometric reference is needed. Validation is delegated to
239
+ * the supplied handler so the floating UI can mark invalid values and keep
240
+ * the prompt alive until the user enters an acceptable number.
241
+ *
242
+ * @param options - Numeric prompt options describing the message and keyword set
243
+ * @param handler - Parser/validator responsible for converting raw text into a number
244
+ * @returns A promise that resolves to the parsed numeric value
95
245
  */
96
246
  private getNumberTyped;
97
- /** Request a distance (number) from the user. */
247
+ /**
248
+ * Prompts the user to specify a distance value.
249
+ *
250
+ * When a base point is available, the floating input previews the live
251
+ * distance from that reference point to the current cursor. Otherwise, the
252
+ * method falls back to typed numeric entry only. Scripted inputs and keywords
253
+ * are supported as well.
254
+ *
255
+ * @param options - Distance prompt options controlling base-point behavior and messaging
256
+ * @returns A prompt result containing the resolved distance, cancel status, or keyword
257
+ */
98
258
  getDistance(options: AcEdPromptDistanceOptions): Promise<AcEdPromptDoubleResult>;
99
- /** Request an angle in degrees from the user. */
259
+ /**
260
+ * Prompts the user to specify an angle in degrees.
261
+ *
262
+ * If a base point is available, the cursor position is converted into a live
263
+ * angular preview relative to that point and the optional prompt base angle.
264
+ * Without a geometric reference, the method accepts typed numeric input only.
265
+ *
266
+ * @param options - Angle prompt options controlling base point, base angle, and messaging
267
+ * @returns A prompt result containing the resolved angle, cancel status, or keyword
268
+ */
100
269
  getAngle(options: AcEdPromptAngleOptions): Promise<AcEdPromptDoubleResult>;
101
- /** Request a double/float from the user. */
270
+ /**
271
+ * Prompts the user for a floating-point number.
272
+ *
273
+ * This is the generic free-form numeric entry path used when no geometric
274
+ * interpretation such as distance or angle is required.
275
+ *
276
+ * @param options - Double prompt options controlling validation and messaging
277
+ * @returns A prompt result containing the parsed number, cancel status, or keyword
278
+ */
102
279
  getDouble(options: AcEdPromptDoubleOptions): Promise<AcEdPromptDoubleResult>;
103
- /** Request an integer from the user. */
280
+ /**
281
+ * Prompts the user for an integer value.
282
+ *
283
+ * The supplied integer handler enforces integer-only parsing for both typed
284
+ * input and scripted command input.
285
+ *
286
+ * @param options - Integer prompt options controlling validation and messaging
287
+ * @returns A prompt result containing the parsed integer, cancel status, or keyword
288
+ */
104
289
  getInteger(options: AcEdPromptIntegerOptions): Promise<AcEdPromptIntegerResult>;
105
290
  /**
106
- * Prompt the user to type an arbitrary string. Resolved when Enter is pressed.
291
+ * Prompts the user to type an arbitrary string.
292
+ *
293
+ * The value is collected through the shared floating-input pipeline so it can
294
+ * participate in the same cancellation, keyword, and scripted-input behavior
295
+ * as the other prompt types.
296
+ *
297
+ * @param options - String prompt options controlling the prompt message and keywords
298
+ * @returns A prompt result containing the entered string, cancel status, or keyword
107
299
  */
108
300
  getString(options: AcEdPromptStringOptions): Promise<AcEdPromptResult>;
109
301
  /**
110
- * Prompt the user to type a keyword. Resolved when Enter is pressed.
302
+ * Prompts the user to enter one of the configured keywords.
303
+ *
304
+ * Unlike the mixed-mode keyword sessions used by other prompt types, this
305
+ * method runs a dedicated keyword prompt and returns the chosen keyword as the
306
+ * result value.
307
+ *
308
+ * @param options - Keyword prompt options describing the allowed keywords
309
+ * @returns A prompt result containing the chosen keyword or cancel status
111
310
  */
112
- getKeywords(options: AcEdPromptKeywordOptions): Promise<string>;
311
+ getKeywords(options: AcEdPromptKeywordOptions): Promise<AcEdPromptResult>;
113
312
  /**
114
313
  * Prompts the user to select one or more entities by mouse interaction.
115
314
  *
@@ -141,43 +340,184 @@ export declare class AcEdInputManager {
141
340
  getSelection(options: AcEdPromptSelectionOptions): Promise<AcEdPromptSelectionResult>;
142
341
  /**
143
342
  * Prompts the user to select a single entity.
144
- * Similar to Editor.GetEntity() in AutoCAD.
343
+ *
344
+ * Selection is performed by clicking in the view and validating the first
345
+ * hit-tested entity under the cursor. The picked entity may be rejected when
346
+ * it belongs to a locked layer or does not satisfy the prompt's allowed-class
347
+ * filter, in which case the rejection message is shown and the prompt remains
348
+ * active. Keywords and `AllowNone` behavior are also supported.
349
+ *
350
+ * @param options - Entity prompt options controlling filtering, messaging, and keywords
351
+ * @returns A prompt result containing the selected entity id, picked point,
352
+ * cancel status, or keyword
145
353
  */
146
354
  getEntity(options: AcEdPromptEntityOptions): Promise<AcEdPromptEntityResult>;
147
355
  /**
148
356
  * Prompt the user to specify a rectangular box by selecting two corners.
149
357
  * Each corner may be specified by clicking on the canvas or typing "x,y".
150
358
  * A live HTML overlay rectangle previews the box as the user moves the mouse.
359
+ *
360
+ * The box prompt is implemented as two chained point prompts. Keywords from
361
+ * the original box prompt are copied into each corner prompt so the caller
362
+ * sees a consistent interaction model across both stages.
363
+ *
364
+ * @param options - Box prompt options controlling corner messages, preview behavior, and keywords
365
+ * @returns A prompt result containing the final 2D box, cancel status, or keyword
151
366
  */
152
367
  getBox(options: AcEdPromptBoxOptions): Promise<AcEdPromptBoxResult>;
153
368
  /**
154
369
  * Shared point input logic used by getPoint() and getBox(). Accepts "x,y"
155
370
  * typed input OR mouse click.
371
+ *
372
+ * This helper optionally wires extra cleanup and preview callbacks so
373
+ * higher-level workflows can overlay additional temporary graphics while
374
+ * reusing the same point acquisition behavior.
375
+ *
376
+ * @param options - Point prompt options controlling the interaction
377
+ * @param cleanup - Optional callback invoked when the point prompt ends
378
+ * @param drawPreview - Optional callback invoked as the cursor moves for live preview rendering
379
+ * @returns A promise that resolves to the chosen point
156
380
  */
157
381
  private getPointInternal;
158
382
  /**
159
383
  * Attempts to consume one scripted input and parse it as a point.
160
384
  * Supported forms: "x,y", "x,y,z", or "x y".
385
+ *
386
+ * Successful scripted points also update `lastPoint` so subsequent prompts
387
+ * that rely on prior geometric context behave the same way as with manual
388
+ * point picking.
389
+ *
390
+ * @param options - Point prompt options used to validate the scripted coordinates
391
+ * @returns Parsed point value, or `undefined` when no scripted token is queued
392
+ * @throws Error if a queued scripted token cannot be parsed as a valid point
161
393
  */
162
394
  private tryGetScriptedPoint;
163
395
  /**
164
396
  * Attempts to consume one scripted input and parse it with the supplied handler.
397
+ *
398
+ * Scripted input is used to emulate command-line entry in automated or
399
+ * replayed workflows. This helper keeps the parsing path consistent with
400
+ * interactive input by delegating to the same handler implementation used by
401
+ * the floating-input UI.
402
+ *
403
+ * @typeParam T - Parsed value type
404
+ * @param handler - Input handler used to parse the queued token
405
+ * @returns Parsed value, or `undefined` when no scripted token is available
406
+ * @throws Error if a queued token exists but fails validation
165
407
  */
166
408
  private tryGetScriptedValue;
409
+ /**
410
+ * Attempts to consume one scripted numeric token.
411
+ *
412
+ * This is a thin specialization of {@link tryGetScriptedValue} that narrows
413
+ * the accepted handler types to those used by numeric-style prompts.
414
+ *
415
+ * @param handler - Numeric handler used to parse the queued token
416
+ * @returns Parsed numeric value, or `undefined` when no scripted token is queued
417
+ */
167
418
  private tryGetScriptedNumber;
419
+ /**
420
+ * Removes and returns the next queued scripted input token.
421
+ *
422
+ * @returns The next scripted token, or `undefined` when the queue is empty
423
+ */
168
424
  private dequeueScriptInput;
425
+ /**
426
+ * Splits a scripted point token into x/y coordinate components.
427
+ *
428
+ * The accepted formats intentionally mirror common CAD command-line point
429
+ * entry conventions, including comma-separated coordinates and whitespace-
430
+ * separated coordinates. An optional third `z` component is tolerated for
431
+ * compatibility, but only the `x` and `y` values are used by 2D prompts.
432
+ *
433
+ * @param token - Raw scripted point token
434
+ * @returns Extracted x/y string pair, or `undefined` if the token is malformed
435
+ */
169
436
  private splitScriptedPoint;
437
+ /**
438
+ * Returns whether an unknown error value represents prompt cancellation.
439
+ *
440
+ * Prompt flows normalize cancellation to a regular `Error` with the message
441
+ * `'cancelled'`. This helper keeps the outer result-conversion code concise
442
+ * and consistent across prompt types.
443
+ *
444
+ * @param error - Unknown error value thrown from an input workflow
445
+ * @returns `true` if the error represents prompt cancellation
446
+ */
170
447
  private isPromptCancelled;
448
+ /**
449
+ * Returns whether an unknown error value represents PromptStatus.None.
450
+ *
451
+ * @param error - Unknown error value thrown from an input workflow
452
+ * @returns `true` if the error represents "no input" confirmation
453
+ */
454
+ private isPromptNone;
455
+ /**
456
+ * Reads SHORTCUTMENU value from current working database.
457
+ *
458
+ * @returns Normalized 0..3 shortcut-menu mode
459
+ */
460
+ private getShortcutMenuMode;
461
+ /**
462
+ * Resolves right-click behavior for current prompt session.
463
+ *
464
+ * SHORTCUTMENU:
465
+ * 0 => always Enter
466
+ * 1 => Enter in command, menu when idle
467
+ * 2 => menu in command
468
+ * 3 => always menu
469
+ */
470
+ private shouldUseRightClickEnter;
471
+ /**
472
+ * Synchronizes the stored modifier-key snapshot with a DOM keyboard event.
473
+ *
474
+ * Floating preview rendering depends on modifier state for behaviors such as
475
+ * temporary mode switches. This helper updates the cached modifier snapshot
476
+ * and reports whether anything actually changed so callers can avoid
477
+ * unnecessary preview refreshes.
478
+ *
479
+ * @param e - Keyboard-like event carrying modifier-key flags
480
+ * @returns `true` if any modifier flag changed; otherwise `false`
481
+ */
171
482
  private updateModifierStateFromEvent;
483
+ /**
484
+ * Handles the sticky Ctrl toggle used by certain jig interactions.
485
+ *
486
+ * Instead of tracking Ctrl as a purely held modifier, some commands treat a
487
+ * Ctrl key press as a persistent toggle. This helper flips that toggle on the
488
+ * first non-repeating keydown event for the Control key.
489
+ *
490
+ * @param e - Keyboard event to inspect
491
+ * @returns `true` if the toggle state changed and previews should refresh
492
+ */
172
493
  private handleCtrlToggleKey;
173
494
  /**
174
- * Creates a promise for floating input that will be resolved or rejected by user input.
495
+ * Extracts cross-prompt defaults from a prompt options object.
175
496
  *
176
- * This method centralizes the lifecycle of an interactive input operation,
177
- * including handling the Escape key to cancel, resolving with user-provided
178
- * values, and guaranteeing cleanup of UI elements and event handlers.
497
+ * Not every prompt type exposes the same optional properties, but the
498
+ * floating-input pipeline needs a normalized shape for values such as base
499
+ * point, dashed-baseline behavior, jig, and base angle. This helper performs
500
+ * those property-existence checks in one place.
501
+ *
502
+ * @typeParam T - Value type produced by the prompt
503
+ * @param options - Prompt options to normalize
504
+ * @returns A normalized object containing only the floating-input defaults it understands
179
505
  */
180
506
  private resolvePromptDefaults;
507
+ /**
508
+ * Runs a floating-input prompt and resolves it to a parsed value.
509
+ *
510
+ * This is the core interaction primitive used by most non-selection prompts.
511
+ * It wires together command-line keyword handling, floating input creation,
512
+ * validation, preview refreshes, jig updates, cancellation handling, and
513
+ * cleanup. The method guarantees that temporary UI and event listeners are
514
+ * torn down no matter how the prompt completes.
515
+ *
516
+ * @typeParam T - Value type produced by the prompt
517
+ * @param options - Configuration describing how the floating prompt should parse,
518
+ * validate, preview, and commit its value
519
+ * @returns A promise that resolves with the committed value or rejects on cancel/keyword
520
+ */
181
521
  private makeFloatingInputPromise;
182
522
  }
183
523
  //# sourceMappingURL=AcEdInputManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AcEdInputManager.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/ui/AcEdInputManager.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAatD,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EAGxB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EAEzB,uBAAuB,EACxB,MAAM,WAAW,CAAA;AAqBlB;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAC3B,8BAA8B;IAC9B,OAAO,CAAC,MAAM,CAAC,cAAc,CAAQ;IAErC,oDAAoD;IACpD,SAAS,CAAC,IAAI,EAAE,YAAY,CAAA;IAE5B,8DAA8D;IAC9D,OAAO,CAAC,SAAS,CAA+B;IAEhD,gCAAgC;IAChC,OAAO,CAAC,YAAY,CAAiB;IACrC,mFAAmF;IACnF,OAAO,CAAC,aAAa,CAAe;IACpC,wDAAwD;IACxD,OAAO,CAAC,cAAc,CAKrB;IACD,4EAA4E;IAC5E,OAAO,CAAC,YAAY,CAA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