@mlightcad/cad-simple-viewer 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13000 -10094
- package/dist/index.umd.cjs +327 -24
- package/dist/libredwg-parser-worker.js +7267 -7238
- package/dist/mtext-renderer-worker.js +81 -41
- package/lib/app/AcApContext.js +1 -1
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +20 -3
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +67 -12
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApProgress.d.ts +133 -0
- package/lib/app/AcApProgress.d.ts.map +1 -0
- package/lib/app/AcApProgress.js +148 -0
- package/lib/app/AcApProgress.js.map +1 -0
- package/lib/app/AcApSettingManager.d.ts +42 -0
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +63 -0
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/app/index.d.ts +0 -1
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +0 -1
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApCircleCmd.d.ts +21 -0
- package/lib/command/AcApCircleCmd.d.ts.map +1 -0
- package/lib/command/AcApCircleCmd.js +115 -0
- package/lib/command/AcApCircleCmd.js.map +1 -0
- package/lib/command/AcApDimCmd.d.ts +57 -0
- package/lib/command/AcApDimCmd.d.ts.map +1 -0
- package/lib/command/AcApDimCmd.js +228 -0
- package/lib/command/AcApDimCmd.js.map +1 -0
- package/lib/command/AcApLogCmd.d.ts +13 -0
- package/lib/command/AcApLogCmd.d.ts.map +1 -0
- package/lib/command/AcApLogCmd.js +97 -0
- package/lib/command/AcApLogCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts +15 -0
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -0
- package/lib/command/AcApSysVarCmd.js +94 -0
- package/lib/command/AcApSysVarCmd.js.map +1 -0
- package/lib/command/AcApZoomCmd.js +1 -1
- package/lib/command/AcApZoomCmd.js.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.d.ts +0 -36
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.js +4 -61
- package/lib/command/AcApZoomToBoxCmd.js.map +1 -1
- package/lib/command/index.d.ts +4 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +4 -0
- package/lib/command/index.js.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +19 -1
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +40 -0
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +14 -30
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
- package/lib/editor/input/AcEdCursorManager.js +32 -31
- package/lib/editor/input/AcEdCursorManager.js.map +1 -1
- package/lib/editor/input/AcEdPreviewJig.d.ts +103 -0
- package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -0
- package/lib/editor/input/AcEdPreviewJig.js +82 -0
- package/lib/editor/input/AcEdPreviewJig.js.map +1 -0
- package/lib/editor/input/AcEditor.d.ts +58 -11
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +86 -22
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js +25 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts +8 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js +29 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts +7 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js +28 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts +14 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.js +2 -0
- package/lib/editor/input/handler/AcEdInputHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js +44 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js +24 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +16 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.js +19 -0
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.js +24 -0
- package/lib/editor/input/handler/AcEdStringHandler.js.map +1 -0
- package/lib/editor/input/handler/index.d.ts +9 -0
- package/lib/editor/input/handler/index.d.ts.map +1 -0
- package/lib/editor/input/handler/index.js +9 -0
- package/lib/editor/input/handler/index.js.map +1 -0
- package/lib/editor/input/index.d.ts +4 -1
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +4 -1
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts +72 -0
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdMarker.js +124 -0
- package/lib/editor/input/marker/AcEdMarker.js.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts +52 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +91 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -0
- package/lib/editor/input/marker/index.d.ts +3 -0
- package/lib/editor/input/marker/index.d.ts.map +1 -0
- package/lib/editor/input/marker/index.js +3 -0
- package/lib/editor/input/marker/index.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts +63 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.js +120 -0
- package/lib/editor/input/prompt/AcEdKeyword.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts +52 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js +103 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +75 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +182 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js +114 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts +10 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js +31 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts +39 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js +84 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts +59 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js +140 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts +19 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js +36 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +61 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js +179 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +113 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts +25 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js +38 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts +27 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js +19 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts +22 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js +23 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts +54 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js +124 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js.map +1 -0
- package/lib/editor/input/prompt/index.d.ts +11 -0
- package/lib/editor/input/prompt/index.d.ts.map +1 -0
- package/lib/editor/input/prompt/index.js +11 -0
- package/lib/editor/input/prompt/index.js.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +116 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.js +481 -0
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +151 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js +239 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts +60 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +104 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +154 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js +2 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts +132 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.js +477 -0
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts +66 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.js +276 -0
- package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -0
- package/lib/editor/input/ui/index.d.ts +3 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -0
- package/lib/editor/input/ui/index.js +3 -0
- package/lib/editor/input/ui/index.js.map +1 -0
- package/lib/editor/view/AcEdBaseView.d.ts +54 -16
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +14 -11
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdLayerInfo.d.ts +5 -0
- package/lib/editor/view/AcEdLayerInfo.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +135 -0
- package/lib/i18n/AcApI18n.d.ts.map +1 -0
- package/lib/i18n/AcApI18n.js +208 -0
- package/lib/i18n/AcApI18n.js.map +1 -0
- package/lib/i18n/en/command.d.ts +18 -0
- package/lib/i18n/en/command.d.ts.map +1 -0
- package/lib/i18n/en/command.js +17 -0
- package/lib/i18n/en/command.js.map +1 -0
- package/lib/i18n/en/jig.d.ts +11 -0
- package/lib/i18n/en/jig.d.ts.map +1 -0
- package/lib/i18n/en/jig.js +10 -0
- package/lib/i18n/en/jig.js.map +1 -0
- package/lib/i18n/en/main.d.ts +37 -0
- package/lib/i18n/en/main.d.ts.map +1 -0
- package/lib/i18n/en/main.js +36 -0
- package/lib/i18n/en/main.js.map +1 -0
- package/lib/i18n/index.d.ts +6 -0
- package/lib/i18n/index.d.ts.map +1 -0
- package/lib/i18n/index.js +31 -0
- package/lib/i18n/index.js.map +1 -0
- package/lib/i18n/zh/command.d.ts +18 -0
- package/lib/i18n/zh/command.d.ts.map +1 -0
- package/lib/i18n/zh/command.js +17 -0
- package/lib/i18n/zh/command.js.map +1 -0
- package/lib/i18n/zh/jig.d.ts +11 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -0
- package/lib/i18n/zh/jig.js +10 -0
- package/lib/i18n/zh/jig.js.map +1 -0
- package/lib/i18n/zh/main.d.ts +37 -0
- package/lib/i18n/zh/main.d.ts.map +1 -0
- package/lib/i18n/zh/main.js +36 -0
- package/lib/i18n/zh/main.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +29 -5
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +44 -6
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +13 -7
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +29 -21
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +22 -8
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +36 -9
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +19 -4
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +135 -43
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +7 -7
- package/lib/editor/input/AcEdBaseInput.d.ts +0 -89
- package/lib/editor/input/AcEdBaseInput.d.ts.map +0 -1
- package/lib/editor/input/AcEdBaseInput.js +0 -166
- package/lib/editor/input/AcEdBaseInput.js.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.d.ts +0 -108
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.js +0 -220
- package/lib/editor/input/AcEdBoxSelector.js.map +0 -1
- package/lib/editor/input/AcEdInputPoint.d.ts +0 -51
- package/lib/editor/input/AcEdInputPoint.d.ts.map +0 -1
- package/lib/editor/input/AcEdInputPoint.js +0 -78
- package/lib/editor/input/AcEdInputPoint.js.map +0 -1
- package/lib/editor/input/AcEdJig.d.ts +0 -180
- package/lib/editor/input/AcEdJig.d.ts.map +0 -1
- package/lib/editor/input/AcEdJig.js +0 -256
- package/lib/editor/input/AcEdJig.js.map +0 -1
- package/lib/editor/input/AcEdJigLoop.d.ts +0 -63
- package/lib/editor/input/AcEdJigLoop.d.ts.map +0 -1
- package/lib/editor/input/AcEdJigLoop.js +0 -91
- package/lib/editor/input/AcEdJigLoop.js.map +0 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
2
|
+
/**
|
|
3
|
+
* Language/locale id used in the application.
|
|
4
|
+
* Matches the naming style used by vue-i18n ("Locale").
|
|
5
|
+
*/
|
|
6
|
+
export type AcApLocale = 'en' | 'zh';
|
|
7
|
+
/**
|
|
8
|
+
* A single locale message tree.
|
|
9
|
+
* Leaf values are strings, inner nodes are nested objects of the same shape.
|
|
10
|
+
* This mirrors vue-i18n's LocaleMessage structure.
|
|
11
|
+
*/
|
|
12
|
+
export interface AcApLocaleMessage {
|
|
13
|
+
[key: string]: string | AcApLocaleMessage;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The whole messages map: locale -> locale message tree.
|
|
17
|
+
* This mirrors vue-i18n's "LocaleMessages".
|
|
18
|
+
*/
|
|
19
|
+
export type AcApLocaleMessages = Record<AcApLocale, AcApLocaleMessage>;
|
|
20
|
+
/**
|
|
21
|
+
* Options for translation lookup.
|
|
22
|
+
*/
|
|
23
|
+
export interface AcApTranslateOptions {
|
|
24
|
+
fallback?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Event arguments for locale changed events.
|
|
28
|
+
*/
|
|
29
|
+
export interface AcApLocaleChangedEventArgs {
|
|
30
|
+
/** The old locale value */
|
|
31
|
+
old: AcApLocale;
|
|
32
|
+
/** The new locale value */
|
|
33
|
+
new: AcApLocale;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A framework-agnostic i18n registry with vue-i18n-like API names.
|
|
37
|
+
*
|
|
38
|
+
* Key methods:
|
|
39
|
+
* - getLocaleMessages(): returns all messages (for vue-i18n { messages })
|
|
40
|
+
* - getLocaleMessage(locale): returns single locale messages
|
|
41
|
+
* - setLocaleMessage(locale, messages): replace locale messages
|
|
42
|
+
* - mergeLocaleMessage(locale, messages): deep-merge into existing locale (fixed)
|
|
43
|
+
* - t(locale, key, options): translation helper for core code (no Vue required)
|
|
44
|
+
*/
|
|
45
|
+
export declare class AcApI18n {
|
|
46
|
+
private static _messages;
|
|
47
|
+
/**
|
|
48
|
+
* @private
|
|
49
|
+
*
|
|
50
|
+
* Stores the currently active locale used by the translation
|
|
51
|
+
* system. Defaults to `"en"`.
|
|
52
|
+
*
|
|
53
|
+
* This value is used by `t(key, options)` when no locale
|
|
54
|
+
* parameter is provided.
|
|
55
|
+
*/
|
|
56
|
+
private static _currentLocale;
|
|
57
|
+
/**
|
|
58
|
+
* Return the whole messages map (for vue-i18n initialisation).
|
|
59
|
+
*/
|
|
60
|
+
static get messages(): Readonly<AcApLocaleMessages>;
|
|
61
|
+
/** Supported events */
|
|
62
|
+
static readonly events: {
|
|
63
|
+
/** Fired when locale changed */
|
|
64
|
+
localeChanged: AcCmEventManager<AcApLocaleChangedEventArgs>;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Return the messages object for a single locale.
|
|
68
|
+
*/
|
|
69
|
+
static getLocaleMessage(locale: AcApLocale): Readonly<AcApLocaleMessage>;
|
|
70
|
+
/**
|
|
71
|
+
* Deep-merge a message dictionary into an existing locale.
|
|
72
|
+
*/
|
|
73
|
+
static mergeLocaleMessage<L extends AcApLocale>(locale: L, messages: AcApLocaleMessage): void;
|
|
74
|
+
/**
|
|
75
|
+
* Register a plugin's messages.
|
|
76
|
+
* Alias for mergeLocaleMessage for consistency with vue-i18n.
|
|
77
|
+
*/
|
|
78
|
+
static registerMessage<L extends AcApLocale>(locale: L, messages: AcApLocaleMessage): void;
|
|
79
|
+
/**
|
|
80
|
+
* Set the current active locale for translation.
|
|
81
|
+
*
|
|
82
|
+
* @param locale - Locale to activate (`"en"` or `"zh"`)
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* This method updates the internal locale state used by all
|
|
86
|
+
* future calls to `t(key, options)`. After calling this method,
|
|
87
|
+
* the entire application will use the new locale automatically.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* AcApI18n.setCurrentLocale('zh')
|
|
92
|
+
* console.log(AcApI18n.t('core.start')) // uses Chinese messages
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
static setCurrentLocale(locale: AcApLocale): void;
|
|
96
|
+
/**
|
|
97
|
+
* Get the currently active locale.
|
|
98
|
+
*
|
|
99
|
+
* @returns The locale currently used for translation.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* console.log(AcApI18n.currentLocale) // "en" or "zh"
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
static get currentLocale(): AcApLocale;
|
|
107
|
+
/**
|
|
108
|
+
* Translate a dotted key path using the registry (no Vue required).
|
|
109
|
+
*
|
|
110
|
+
* @param key - dotted path, e.g. "core.start" or "pluginX.button.ok"
|
|
111
|
+
* @param options - optional fallback
|
|
112
|
+
* @returns translated string or fallback/key if not found
|
|
113
|
+
*/
|
|
114
|
+
static t(key: string, options?: AcApTranslateOptions): string;
|
|
115
|
+
/**
|
|
116
|
+
* Get localized command description
|
|
117
|
+
* @param groupName - Command group name
|
|
118
|
+
* @param cmdName - Global command name
|
|
119
|
+
* @returns - The localized command description.
|
|
120
|
+
*/
|
|
121
|
+
static cmdDescription(groupName: string, cmdName: string): string;
|
|
122
|
+
/**
|
|
123
|
+
* Tries to find command in system group and gets its localized command description
|
|
124
|
+
* @param cmdName - Global command name
|
|
125
|
+
* @returns - The localized command description
|
|
126
|
+
*/
|
|
127
|
+
static sysCmdDescription(name: string): string;
|
|
128
|
+
/**
|
|
129
|
+
* Tries to find command in user group and gets its localized command description
|
|
130
|
+
* @param cmdName - Global command name
|
|
131
|
+
* @returns - The localized command description
|
|
132
|
+
*/
|
|
133
|
+
static userCmdDescription: (name: string) => string;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=AcApI18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApI18n.d.ts","sourceRoot":"","sources":["../../src/i18n/AcApI18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAIxD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAA;AAEpC;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,iBAAiB,CAAA;CAC1C;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;AAEtE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,2BAA2B;IAC3B,GAAG,EAAE,UAAU,CAAA;IACf,2BAA2B;IAC3B,GAAG,EAAE,UAAU,CAAA;CAChB;AAED;;;;;;;;;GASG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAC,SAAS,CAGvB;IAED;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc,CAAmB;IAEhD;;OAEG;IACH,WAAkB,QAAQ,IAAI,QAAQ,CAAC,kBAAkB,CAAC,CAEzD;IAED,uBAAuB;IACvB,gBAAuB,MAAM;QAC3B,gCAAgC;;MAEjC;IAED;;OAEG;WACW,gBAAgB,CAC5B,MAAM,EAAE,UAAU,GACjB,QAAQ,CAAC,iBAAiB,CAAC;IAI9B;;OAEG;WACW,kBAAkB,CAAC,CAAC,SAAS,UAAU,EACnD,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,iBAAiB,GAC1B,IAAI;IAIP;;;OAGG;WACW,eAAe,CAAC,CAAC,SAAS,UAAU,EAChD,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,iBAAiB,GAC1B,IAAI;IAIP;;;;;;;;;;;;;;;OAeG;WACW,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAMxD;;;;;;;;;OASG;IACH,WAAkB,aAAa,IAAI,UAAU,CAE5C;IAED;;;;;;OAMG;WACW,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM;IAgBpE;;;;;OAKG;WACW,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAK/D;;;;OAIG;WACW,iBAAiB,CAAC,IAAI,EAAE,MAAM;IAO5C;;;;OAIG;IACH,OAAc,kBAAkB,GAAI,MAAM,MAAM,YAE/C;CACF"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function(o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
if (o && typeof o.length === "number") return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
+
};
|
|
12
|
+
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
13
|
+
import { AcEdCommandStack } from '../editor';
|
|
14
|
+
/**
|
|
15
|
+
* A framework-agnostic i18n registry with vue-i18n-like API names.
|
|
16
|
+
*
|
|
17
|
+
* Key methods:
|
|
18
|
+
* - getLocaleMessages(): returns all messages (for vue-i18n { messages })
|
|
19
|
+
* - getLocaleMessage(locale): returns single locale messages
|
|
20
|
+
* - setLocaleMessage(locale, messages): replace locale messages
|
|
21
|
+
* - mergeLocaleMessage(locale, messages): deep-merge into existing locale (fixed)
|
|
22
|
+
* - t(locale, key, options): translation helper for core code (no Vue required)
|
|
23
|
+
*/
|
|
24
|
+
var AcApI18n = /** @class */ (function () {
|
|
25
|
+
function AcApI18n() {
|
|
26
|
+
}
|
|
27
|
+
Object.defineProperty(AcApI18n, "messages", {
|
|
28
|
+
/**
|
|
29
|
+
* Return the whole messages map (for vue-i18n initialisation).
|
|
30
|
+
*/
|
|
31
|
+
get: function () {
|
|
32
|
+
return this._messages;
|
|
33
|
+
},
|
|
34
|
+
enumerable: false,
|
|
35
|
+
configurable: true
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Return the messages object for a single locale.
|
|
39
|
+
*/
|
|
40
|
+
AcApI18n.getLocaleMessage = function (locale) {
|
|
41
|
+
return this._messages[locale];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Deep-merge a message dictionary into an existing locale.
|
|
45
|
+
*/
|
|
46
|
+
AcApI18n.mergeLocaleMessage = function (locale, messages) {
|
|
47
|
+
deepMerge(this._messages[locale], messages);
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Register a plugin's messages.
|
|
51
|
+
* Alias for mergeLocaleMessage for consistency with vue-i18n.
|
|
52
|
+
*/
|
|
53
|
+
AcApI18n.registerMessage = function (locale, messages) {
|
|
54
|
+
this.mergeLocaleMessage(locale, messages);
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Set the current active locale for translation.
|
|
58
|
+
*
|
|
59
|
+
* @param locale - Locale to activate (`"en"` or `"zh"`)
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* This method updates the internal locale state used by all
|
|
63
|
+
* future calls to `t(key, options)`. After calling this method,
|
|
64
|
+
* the entire application will use the new locale automatically.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* AcApI18n.setCurrentLocale('zh')
|
|
69
|
+
* console.log(AcApI18n.t('core.start')) // uses Chinese messages
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
AcApI18n.setCurrentLocale = function (locale) {
|
|
73
|
+
var old = this._currentLocale;
|
|
74
|
+
this._currentLocale = locale;
|
|
75
|
+
this.events.localeChanged.dispatch({ old: old, new: this._currentLocale });
|
|
76
|
+
};
|
|
77
|
+
Object.defineProperty(AcApI18n, "currentLocale", {
|
|
78
|
+
/**
|
|
79
|
+
* Get the currently active locale.
|
|
80
|
+
*
|
|
81
|
+
* @returns The locale currently used for translation.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* console.log(AcApI18n.currentLocale) // "en" or "zh"
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
get: function () {
|
|
89
|
+
return this._currentLocale;
|
|
90
|
+
},
|
|
91
|
+
enumerable: false,
|
|
92
|
+
configurable: true
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* Translate a dotted key path using the registry (no Vue required).
|
|
96
|
+
*
|
|
97
|
+
* @param key - dotted path, e.g. "core.start" or "pluginX.button.ok"
|
|
98
|
+
* @param options - optional fallback
|
|
99
|
+
* @returns translated string or fallback/key if not found
|
|
100
|
+
*/
|
|
101
|
+
AcApI18n.t = function (key, options) {
|
|
102
|
+
var e_1, _b;
|
|
103
|
+
var _c, _d;
|
|
104
|
+
var locale = this._currentLocale;
|
|
105
|
+
var root = this._messages[locale];
|
|
106
|
+
var parts = key.split('.');
|
|
107
|
+
var cur = root;
|
|
108
|
+
try {
|
|
109
|
+
for (var parts_1 = __values(parts), parts_1_1 = parts_1.next(); !parts_1_1.done; parts_1_1 = parts_1.next()) {
|
|
110
|
+
var part = parts_1_1.value;
|
|
111
|
+
if (!cur || typeof cur !== 'object') {
|
|
112
|
+
return (_c = options === null || options === void 0 ? void 0 : options.fallback) !== null && _c !== void 0 ? _c : key;
|
|
113
|
+
}
|
|
114
|
+
cur = cur[part];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
118
|
+
finally {
|
|
119
|
+
try {
|
|
120
|
+
if (parts_1_1 && !parts_1_1.done && (_b = parts_1.return)) _b.call(parts_1);
|
|
121
|
+
}
|
|
122
|
+
finally { if (e_1) throw e_1.error; }
|
|
123
|
+
}
|
|
124
|
+
return typeof cur === 'string' ? cur : ((_d = options === null || options === void 0 ? void 0 : options.fallback) !== null && _d !== void 0 ? _d : key);
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Get localized command description
|
|
128
|
+
* @param groupName - Command group name
|
|
129
|
+
* @param cmdName - Global command name
|
|
130
|
+
* @returns - The localized command description.
|
|
131
|
+
*/
|
|
132
|
+
AcApI18n.cmdDescription = function (groupName, cmdName) {
|
|
133
|
+
var key = "command.".concat(groupName, ".").concat(cmdName.toLowerCase());
|
|
134
|
+
return this.t(key);
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Tries to find command in system group and gets its localized command description
|
|
138
|
+
* @param cmdName - Global command name
|
|
139
|
+
* @returns - The localized command description
|
|
140
|
+
*/
|
|
141
|
+
AcApI18n.sysCmdDescription = function (name) {
|
|
142
|
+
return this.cmdDescription(AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME, name);
|
|
143
|
+
};
|
|
144
|
+
var _a;
|
|
145
|
+
_a = AcApI18n;
|
|
146
|
+
AcApI18n._messages = {
|
|
147
|
+
en: {},
|
|
148
|
+
zh: {}
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* @private
|
|
152
|
+
*
|
|
153
|
+
* Stores the currently active locale used by the translation
|
|
154
|
+
* system. Defaults to `"en"`.
|
|
155
|
+
*
|
|
156
|
+
* This value is used by `t(key, options)` when no locale
|
|
157
|
+
* parameter is provided.
|
|
158
|
+
*/
|
|
159
|
+
AcApI18n._currentLocale = 'en';
|
|
160
|
+
/** Supported events */
|
|
161
|
+
AcApI18n.events = {
|
|
162
|
+
/** Fired when locale changed */
|
|
163
|
+
localeChanged: new AcCmEventManager()
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Tries to find command in user group and gets its localized command description
|
|
167
|
+
* @param cmdName - Global command name
|
|
168
|
+
* @returns - The localized command description
|
|
169
|
+
*/
|
|
170
|
+
AcApI18n.userCmdDescription = function (name) {
|
|
171
|
+
return _a.cmdDescription(AcEdCommandStack.DEFAUT_COMMAND_GROUP_NAME, name);
|
|
172
|
+
};
|
|
173
|
+
return AcApI18n;
|
|
174
|
+
}());
|
|
175
|
+
export { AcApI18n };
|
|
176
|
+
/**
|
|
177
|
+
* Utility: deep merge two LocaleMessage objects.
|
|
178
|
+
* - Returns a new object (immutability-friendly).
|
|
179
|
+
* - If both values are plain objects, merge recursively.
|
|
180
|
+
* - Otherwise prefer `source`'s value.
|
|
181
|
+
*/
|
|
182
|
+
function deepMerge(target, source) {
|
|
183
|
+
var e_2, _b;
|
|
184
|
+
try {
|
|
185
|
+
for (var _c = __values(Object.keys(source)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
186
|
+
var key = _d.value;
|
|
187
|
+
var src = source[key];
|
|
188
|
+
var tgt = target[key];
|
|
189
|
+
if (isObject(tgt) && isObject(src)) {
|
|
190
|
+
deepMerge(tgt, src);
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
target[key] = src;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
198
|
+
finally {
|
|
199
|
+
try {
|
|
200
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
201
|
+
}
|
|
202
|
+
finally { if (e_2) throw e_2.error; }
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function isObject(value) {
|
|
206
|
+
return typeof value === 'object' && value !== null;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=AcApI18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApI18n.js","sourceRoot":"","sources":["../../src/i18n/AcApI18n.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
ACAD: {
|
|
3
|
+
circle: string;
|
|
4
|
+
csvg: string;
|
|
5
|
+
log: string;
|
|
6
|
+
open: string;
|
|
7
|
+
pan: string;
|
|
8
|
+
pickbox: string;
|
|
9
|
+
qnew: string;
|
|
10
|
+
regen: string;
|
|
11
|
+
select: string;
|
|
12
|
+
zoom: string;
|
|
13
|
+
zoomw: string;
|
|
14
|
+
};
|
|
15
|
+
USER: {};
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/i18n/en/command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wBAgBC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
ACAD: {
|
|
3
|
+
circle: 'Creates one circle by center and radius',
|
|
4
|
+
csvg: 'Converts current drawing to SVG',
|
|
5
|
+
log: 'Logs debug information in console',
|
|
6
|
+
open: 'Opens an existing drawing file',
|
|
7
|
+
pan: 'Shifts the view without changing the viewing direction or magnification',
|
|
8
|
+
pickbox: 'Sets the size (in pixels) of the selection box used to pick objects',
|
|
9
|
+
qnew: 'Starts a new drawing',
|
|
10
|
+
regen: 'Redraw the current drawing',
|
|
11
|
+
select: 'Selects entities',
|
|
12
|
+
zoom: 'Zooms to display the maximum extents of all entities',
|
|
13
|
+
zoomw: 'Zooms to display an area specified by a rectangular window'
|
|
14
|
+
},
|
|
15
|
+
USER: {}
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/i18n/en/command.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,EAAE;QACJ,MAAM,EAAE,yCAAyC;QACjD,IAAI,EAAE,iCAAiC;QACvC,GAAG,EAAE,mCAAmC;QACxC,IAAI,EAAE,gCAAgC;QACtC,GAAG,EAAE,yEAAyE;QAC9E,OAAO,EACL,qEAAqE;QACvE,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,4BAA4B;QACnC,MAAM,EAAE,kBAAkB;QAC1B,IAAI,EAAE,sDAAsD;QAC5D,KAAK,EAAE,4DAA4D;KACpE;IACD,IAAI,EAAE,EAAE;CACT,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jig.d.ts","sourceRoot":"","sources":["../../../src/i18n/en/jig.ts"],"names":[],"mappings":";;;;;;;;;AAAA,wBAQC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jig.js","sourceRoot":"","sources":["../../../src/i18n/en/jig.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,MAAM,EAAE;QACN,MAAM,EAAE,+BAA+B;QACvC,MAAM,EAAE,+BAA+B;KACxC;IACD,MAAM,EAAE;QACN,MAAM,EAAE,wBAAwB;KACjC;CACF,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
commandLine: {
|
|
3
|
+
noLast: string;
|
|
4
|
+
unknownCommand: string;
|
|
5
|
+
executed: string;
|
|
6
|
+
showHistory: string;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
showMessages: string;
|
|
9
|
+
canceled: string;
|
|
10
|
+
noHistory: string;
|
|
11
|
+
};
|
|
12
|
+
inputManager: {
|
|
13
|
+
firstCorner: string;
|
|
14
|
+
secondCorner: string;
|
|
15
|
+
};
|
|
16
|
+
message: {
|
|
17
|
+
fetchingDrawingFile: string;
|
|
18
|
+
};
|
|
19
|
+
progress: {
|
|
20
|
+
start: string;
|
|
21
|
+
parse: string;
|
|
22
|
+
font: string;
|
|
23
|
+
ltype: string;
|
|
24
|
+
style: string;
|
|
25
|
+
dimstyle: string;
|
|
26
|
+
layer: string;
|
|
27
|
+
vport: string;
|
|
28
|
+
blockrecord: string;
|
|
29
|
+
header: string;
|
|
30
|
+
block: string;
|
|
31
|
+
entity: string;
|
|
32
|
+
object: string;
|
|
33
|
+
end: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
37
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/i18n/en/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAkCC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
commandLine: {
|
|
3
|
+
noLast: '(no last command)',
|
|
4
|
+
unknownCommand: 'Unknown command',
|
|
5
|
+
executed: 'Executed command',
|
|
6
|
+
showHistory: 'Show command history',
|
|
7
|
+
placeholder: 'Type command',
|
|
8
|
+
showMessages: 'Show message history',
|
|
9
|
+
canceled: '*Canceled*',
|
|
10
|
+
noHistory: '(no history)'
|
|
11
|
+
},
|
|
12
|
+
inputManager: {
|
|
13
|
+
firstCorner: 'Specify the first corner or',
|
|
14
|
+
secondCorner: 'Specify the second corner or'
|
|
15
|
+
},
|
|
16
|
+
message: {
|
|
17
|
+
fetchingDrawingFile: 'Fetching file ...'
|
|
18
|
+
},
|
|
19
|
+
progress: {
|
|
20
|
+
start: 'Start parsing file ...',
|
|
21
|
+
parse: 'Parsing file ...',
|
|
22
|
+
font: 'Downloading fonts needed by this drawing ...',
|
|
23
|
+
ltype: 'Parsing line types ...',
|
|
24
|
+
style: 'Parsing text syltes ...',
|
|
25
|
+
dimstyle: 'Parsing dimension styles ...',
|
|
26
|
+
layer: 'Parsing layers ...',
|
|
27
|
+
vport: 'Parsing viewports ...',
|
|
28
|
+
blockrecord: 'Parsing block record ...',
|
|
29
|
+
header: 'Parsing header ...',
|
|
30
|
+
block: 'Parsing blocks ...',
|
|
31
|
+
entity: 'Parsing entities ...',
|
|
32
|
+
object: 'Parsing named dictionaries ...',
|
|
33
|
+
end: 'Finished!'
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/i18n/en/main.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,WAAW,EAAE;QACX,MAAM,EAAE,mBAAmB;QAC3B,cAAc,EAAE,iBAAiB;QACjC,QAAQ,EAAE,kBAAkB;QAC5B,WAAW,EAAE,sBAAsB;QACnC,WAAW,EAAE,cAAc;QAC3B,YAAY,EAAE,sBAAsB;QACpC,QAAQ,EAAE,YAAY;QACtB,SAAS,EAAE,cAAc;KAC1B;IACD,YAAY,EAAE;QACZ,WAAW,EAAE,6BAA6B;QAC1C,YAAY,EAAE,8BAA8B;KAC7C;IACD,OAAO,EAAE;QACP,mBAAmB,EAAE,mBAAmB;KACzC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,wBAAwB;QAC/B,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,8CAA8C;QACpD,KAAK,EAAE,wBAAwB;QAC/B,KAAK,EAAE,yBAAyB;QAChC,QAAQ,EAAE,8BAA8B;QACxC,KAAK,EAAE,oBAAoB;QAC3B,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,0BAA0B;QACvC,MAAM,EAAE,oBAAoB;QAC5B,KAAK,EAAE,oBAAoB;QAC3B,MAAM,EAAE,sBAAsB;QAC9B,MAAM,EAAE,gCAAgC;QACxC,GAAG,EAAE,WAAW;KACjB;CACF,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AcApI18n, AcApLocale } from './AcApI18n';
|
|
2
|
+
export declare const cmdDescription: (groupName: string, cmdName: string) => string;
|
|
3
|
+
export declare const sysCmdDescription: (name: string) => string;
|
|
4
|
+
export declare const userCmdDescription: (name: string) => string;
|
|
5
|
+
export { AcApI18n, type AcApLocale };
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAoBjD,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,EAAE,SAAS,MAAM,WAGhE,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,WAE7C,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,WAE9C,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AcEdCommandStack } from '../editor';
|
|
2
|
+
import { AcApI18n } from './AcApI18n';
|
|
3
|
+
import enCommand from './en/command';
|
|
4
|
+
import enJig from './en/jig';
|
|
5
|
+
import enMain from './en/main';
|
|
6
|
+
import zhCommand from './zh/command';
|
|
7
|
+
import zhJig from './zh/jig';
|
|
8
|
+
import zhMain from './zh/main';
|
|
9
|
+
// Register core locale messages
|
|
10
|
+
AcApI18n.mergeLocaleMessage('en', {
|
|
11
|
+
command: enCommand,
|
|
12
|
+
jig: enJig,
|
|
13
|
+
main: enMain
|
|
14
|
+
});
|
|
15
|
+
AcApI18n.mergeLocaleMessage('zh', {
|
|
16
|
+
command: zhCommand,
|
|
17
|
+
jig: zhJig,
|
|
18
|
+
main: zhMain
|
|
19
|
+
});
|
|
20
|
+
export var cmdDescription = function (groupName, cmdName) {
|
|
21
|
+
var key = "command.".concat(groupName, ".").concat(cmdName);
|
|
22
|
+
return AcApI18n.t(key);
|
|
23
|
+
};
|
|
24
|
+
export var sysCmdDescription = function (name) {
|
|
25
|
+
return cmdDescription(AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME, name);
|
|
26
|
+
};
|
|
27
|
+
export var userCmdDescription = function (name) {
|
|
28
|
+
return cmdDescription(AcEdCommandStack.DEFAUT_COMMAND_GROUP_NAME, name);
|
|
29
|
+
};
|
|
30
|
+
export { AcApI18n };
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAc,MAAM,YAAY,CAAA;AACjD,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,MAAM,MAAM,WAAW,CAAA;AAE9B,gCAAgC;AAChC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,EAAE;IAChC,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAC,CAAA;AACF,QAAQ,CAAC,kBAAkB,CAAC,IAAI,EAAE;IAChC,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAC,CAAA;AAEF,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,SAAiB,EAAE,OAAe;IAC/D,IAAM,GAAG,GAAG,kBAAW,SAAS,cAAI,OAAO,CAAE,CAAA;IAC7C,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,IAAY;IAC5C,OAAO,cAAc,CAAC,gBAAgB,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAA;AAC1E,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,IAAY;IAC7C,OAAO,cAAc,CAAC,gBAAgB,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAA;AACzE,CAAC,CAAA;AAED,OAAO,EAAE,QAAQ,EAAmB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
ACAD: {
|
|
3
|
+
circle: string;
|
|
4
|
+
csvg: string;
|
|
5
|
+
log: string;
|
|
6
|
+
open: string;
|
|
7
|
+
pan: string;
|
|
8
|
+
pickbox: string;
|
|
9
|
+
qnew: string;
|
|
10
|
+
regen: string;
|
|
11
|
+
select: string;
|
|
12
|
+
zoom: string;
|
|
13
|
+
zoomw: string;
|
|
14
|
+
};
|
|
15
|
+
USER: {};
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/i18n/zh/command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wBAeC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
ACAD: {
|
|
3
|
+
circle: '使用圆心和半径创建圆',
|
|
4
|
+
csvg: '转换当前图纸为SVG格式',
|
|
5
|
+
log: '在控制台输出调试信息',
|
|
6
|
+
open: '打开图纸',
|
|
7
|
+
pan: '平移视图',
|
|
8
|
+
pickbox: '控制用于选择对象的拾取框大小(像素)',
|
|
9
|
+
qnew: '创建新图纸',
|
|
10
|
+
regen: '重绘图纸',
|
|
11
|
+
select: '选择图元',
|
|
12
|
+
zoom: '缩放以显示所有对象',
|
|
13
|
+
zoomw: '缩放以显示矩形窗口内的对象'
|
|
14
|
+
},
|
|
15
|
+
USER: {}
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/i18n/zh/command.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,EAAE;QACJ,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,YAAY;QACjB,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,MAAM;QACX,OAAO,EAAE,oBAAoB;QAC7B,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,eAAe;KACvB;IACD,IAAI,EAAE,EAAE;CACT,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jig.d.ts","sourceRoot":"","sources":["../../../src/i18n/zh/jig.ts"],"names":[],"mappings":";;;;;;;;;AAAA,wBAQC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jig.js","sourceRoot":"","sources":["../../../src/i18n/zh/jig.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,MAAM,EAAE;QACN,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;KAClB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,QAAQ;KACjB;CACF,CAAA"}
|