@mlightcad/cad-simple-viewer 1.7.8 → 1.8.0-preview.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/LICENSE +21 -21
- package/README.md +204 -190
- package/dist/cad-simple-viewer-AcUiFileOpenSession-BCcqBAH9.js +2427 -0
- package/dist/cad-simple-viewer-AcUiFileOpenSession-drptdOYc.js +324 -0
- package/dist/cad-simple-viewer-file-open-panel.js +32 -0
- package/dist/cad-simple-viewer-file-open-panel.umd.cjs +1 -0
- package/dist/cad-simple-viewer.js +7938 -9803
- package/dist/cad-simple-viewer.umd.cjs +122 -444
- package/file-open-panel.ts +6 -0
- package/find.ts +7 -7
- package/icons.ts +7 -7
- package/lib/app/AcApOpenDatabaseOptions.d.ts +1 -1
- package/lib/app/AcApOpenDatabaseOptions.d.ts.map +1 -1
- package/lib/app/dataSource/AcApDataSourceIds.d.ts +5 -0
- package/lib/app/dataSource/AcApDataSourceIds.d.ts.map +1 -0
- package/lib/app/dataSource/AcApDataSourceIds.js +5 -0
- package/lib/app/dataSource/AcApDataSourceIds.js.map +1 -0
- package/lib/app/dataSource/AcApLocalDataSource.d.ts +1 -2
- package/lib/app/dataSource/AcApLocalDataSource.d.ts.map +1 -1
- package/lib/app/dataSource/AcApLocalDataSource.js +2 -2
- package/lib/app/dataSource/AcApLocalDataSource.js.map +1 -1
- package/lib/app/dataSource/AcApUrlDataSource.d.ts +1 -2
- package/lib/app/dataSource/AcApUrlDataSource.d.ts.map +1 -1
- package/lib/app/dataSource/AcApUrlDataSource.js +2 -2
- package/lib/app/dataSource/AcApUrlDataSource.js.map +1 -1
- package/lib/app/dataSource/acapBuildDataSourceMenu.js +1 -1
- package/lib/app/dataSource/acapBuildDataSourceMenu.js.map +1 -1
- package/lib/app/dataSource/index.d.ts +3 -2
- package/lib/app/dataSource/index.d.ts.map +1 -1
- package/lib/app/dataSource/index.js +3 -2
- package/lib/app/dataSource/index.js.map +1 -1
- package/lib/editor/input/handler/AcEdInputHandler.d.ts +7 -2
- package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +8 -7
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.js +126 -30
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +28 -3
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +92 -26
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +6 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +32 -6
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +19 -2
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +23 -5
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +18 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts +22 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +56 -5
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdKeyboardUtil.d.ts +28 -0
- package/lib/editor/input/ui/AcEdKeyboardUtil.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdKeyboardUtil.js +59 -0
- package/lib/editor/input/ui/AcEdKeyboardUtil.js.map +1 -0
- package/lib/file-open-panel.d.ts +15 -0
- package/lib/file-open-panel.d.ts.map +1 -0
- package/lib/file-open-panel.js +33 -0
- package/lib/file-open-panel.js.map +1 -0
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +18 -9
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/ar/jig.d.ts +11 -0
- package/lib/i18n/ar/jig.d.ts.map +1 -1
- package/lib/i18n/ar/jig.js +9 -1
- package/lib/i18n/ar/jig.js.map +1 -1
- package/lib/i18n/cs/jig.d.ts +11 -0
- package/lib/i18n/cs/jig.d.ts.map +1 -1
- package/lib/i18n/cs/jig.js +11 -0
- package/lib/i18n/cs/jig.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +11 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +11 -0
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/tr/jig.d.ts +11 -0
- package/lib/i18n/tr/jig.d.ts.map +1 -1
- package/lib/i18n/tr/jig.js +11 -0
- package/lib/i18n/tr/jig.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +11 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +11 -0
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/ui/AcUiFileOpenLanding.d.ts +131 -0
- package/lib/ui/AcUiFileOpenLanding.d.ts.map +1 -0
- package/lib/ui/AcUiFileOpenLanding.js +248 -0
- package/lib/ui/AcUiFileOpenLanding.js.map +1 -0
- package/lib/ui/AcUiFileOpenPanel.d.ts +25 -5
- package/lib/ui/AcUiFileOpenPanel.d.ts.map +1 -1
- package/lib/ui/AcUiFileOpenPanel.js +25 -13
- package/lib/ui/AcUiFileOpenPanel.js.map +1 -1
- package/lib/ui/AcUiFileOpenSession.d.ts +119 -0
- package/lib/ui/AcUiFileOpenSession.d.ts.map +1 -0
- package/lib/ui/AcUiFileOpenSession.js +294 -0
- package/lib/ui/AcUiFileOpenSession.js.map +1 -0
- package/lib/ui/index.d.ts +2 -0
- package/lib/ui/index.d.ts.map +1 -1
- package/lib/ui/index.js +2 -0
- package/lib/ui/index.js.map +1 -1
- package/lib/view/AcEdViewKeyHandler.d.ts +17 -0
- package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -1
- package/lib/view/AcEdViewKeyHandler.js +44 -1
- package/lib/view/AcEdViewKeyHandler.js.map +1 -1
- package/package.json +15 -5
- package/src/file-open-panel.ts +89 -0
- package/src/find/AcApFindNavigator.ts +190 -190
- package/src/find/findDrawing.ts +211 -211
- package/src/find/findText.ts +624 -624
- package/src/find/index.ts +2 -2
- package/src/ui/icons.ts +411 -411
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { AcApDataSource } from '../app/dataSource/AcApDataSource';
|
|
2
|
+
import type { AcApDataSourceManager } from '../app/dataSource/AcApDataSourceManager';
|
|
3
|
+
import type { AcEdUiTheme } from '../editor/global/AcEdUiTheme';
|
|
4
|
+
import { AcUiFileOpenLanding, type AcUiFileOpenLandingOptions, type AcUiFileOpenRequest } from './AcUiFileOpenLanding';
|
|
5
|
+
/**
|
|
6
|
+
* Minimal DocManager surface needed by {@link AcUiFileOpenSession}.
|
|
7
|
+
*
|
|
8
|
+
* Hosts typically return `AcApDocManager.instance` after a dynamic import of
|
|
9
|
+
* `@mlightcad/cad-simple-viewer`. Keeping this structural avoids pulling the
|
|
10
|
+
* viewer into the `/file-open-panel` entry graph.
|
|
11
|
+
*/
|
|
12
|
+
export interface AcUiFileOpenDocManager {
|
|
13
|
+
readonly dataSourceManager: AcApDataSourceManager;
|
|
14
|
+
openDocument(fileName: string, content: ArrayBuffer, options?: unknown): Promise<boolean>;
|
|
15
|
+
openUrl(url: string, options?: unknown): Promise<boolean>;
|
|
16
|
+
newDocument(options?: unknown): Promise<boolean>;
|
|
17
|
+
}
|
|
18
|
+
/** Outcome of {@link AcUiFileOpenSession.open}. */
|
|
19
|
+
export type AcUiFileOpenSessionResult = {
|
|
20
|
+
ok: true;
|
|
21
|
+
} | {
|
|
22
|
+
ok: false;
|
|
23
|
+
error?: unknown;
|
|
24
|
+
};
|
|
25
|
+
export type AcUiFileOpenSessionOptions = Omit<AcUiFileOpenLandingOptions, 'onOpen'> & {
|
|
26
|
+
/**
|
|
27
|
+
* Lazily creates (or returns) the viewer DocManager.
|
|
28
|
+
* Called once on the first open; subsequent opens reuse the instance.
|
|
29
|
+
*/
|
|
30
|
+
createDocManager: () => Promise<AcUiFileOpenDocManager>;
|
|
31
|
+
/** Optional options object passed to openDocument / openUrl / newDocument. */
|
|
32
|
+
getOpenOptions?: () => unknown;
|
|
33
|
+
/** Runs before ensure/open (e.g. show a loading indicator). */
|
|
34
|
+
onBeforeOpen?: (request: AcUiFileOpenRequest) => void | Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Runs after DocManager is ready and sources are attached, immediately
|
|
37
|
+
* before `openDocument` / `openUrl` / `newDocument` (e.g. set OPENPROF).
|
|
38
|
+
*/
|
|
39
|
+
onPrepareOpen?: (request: AcUiFileOpenRequest, docManager: AcUiFileOpenDocManager) => void | Promise<void>;
|
|
40
|
+
/** Runs after open settles (success or failure). */
|
|
41
|
+
onAfterOpen?: (request: AcUiFileOpenRequest, result: AcUiFileOpenSessionResult) => void | Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Landing + lazy DocManager session.
|
|
45
|
+
*
|
|
46
|
+
* On each open request the session:
|
|
47
|
+
* 1. Calls {@link AcUiFileOpenSessionOptions.createDocManager} once
|
|
48
|
+
* 2. Attaches landing cloud sources onto the DocManager registry
|
|
49
|
+
* 3. Runs `openDocument` / `openUrl` / `newDocument`
|
|
50
|
+
*
|
|
51
|
+
* The `/file-open-panel` entry stays light — the host supplies DocManager via
|
|
52
|
+
* dynamic `import('@mlightcad/cad-simple-viewer')` inside `createDocManager`.
|
|
53
|
+
*/
|
|
54
|
+
export declare class AcUiFileOpenSession {
|
|
55
|
+
readonly landing: AcUiFileOpenLanding;
|
|
56
|
+
private readonly options;
|
|
57
|
+
private docManager;
|
|
58
|
+
private ensurePromise;
|
|
59
|
+
/** Bumped on {@link dispose} so in-flight `createDocManager` results are dropped. */
|
|
60
|
+
private ensureGeneration;
|
|
61
|
+
/** Chains {@link open} calls so overlapping picks do not interleave. */
|
|
62
|
+
private openTail;
|
|
63
|
+
private disposed;
|
|
64
|
+
constructor(options: AcUiFileOpenSessionOptions);
|
|
65
|
+
/** Landing data-source registry. */
|
|
66
|
+
get manager(): AcApDataSourceManager;
|
|
67
|
+
/** Effective card theme. */
|
|
68
|
+
get theme(): AcEdUiTheme;
|
|
69
|
+
/** Cached DocManager after the first successful {@link ensureDocManager}. */
|
|
70
|
+
get docManagerInstance(): AcUiFileOpenDocManager | null;
|
|
71
|
+
/**
|
|
72
|
+
* Registers a cloud (or custom) data source on the landing registry.
|
|
73
|
+
*
|
|
74
|
+
* When DocManager already exists, the same instance is attached there too
|
|
75
|
+
* so late async plugin registration still reaches in-viewer File → Open.
|
|
76
|
+
*
|
|
77
|
+
* @param source - Source to register
|
|
78
|
+
*/
|
|
79
|
+
registerSource(source: AcApDataSource): void;
|
|
80
|
+
/**
|
|
81
|
+
* Removes a data source from the landing registry (and DocManager when ready).
|
|
82
|
+
*
|
|
83
|
+
* @param id - Source id
|
|
84
|
+
*/
|
|
85
|
+
unregisterSource(id: string): void;
|
|
86
|
+
setTheme(theme: AcEdUiTheme | undefined): void;
|
|
87
|
+
refreshSourceButtons(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Ensures DocManager exists and landing sources are attached.
|
|
90
|
+
*
|
|
91
|
+
* @returns The DocManager instance
|
|
92
|
+
*/
|
|
93
|
+
ensureDocManager(): Promise<AcUiFileOpenDocManager>;
|
|
94
|
+
/**
|
|
95
|
+
* Opens a normalized landing request (also used by the panel `onOpen` path).
|
|
96
|
+
*
|
|
97
|
+
* Concurrent calls are serialized so overlapping picks do not interleave
|
|
98
|
+
* against the same DocManager.
|
|
99
|
+
*
|
|
100
|
+
* @param request - File / URL / new drawing intent
|
|
101
|
+
*/
|
|
102
|
+
open(request: AcUiFileOpenRequest): Promise<AcUiFileOpenSessionResult>;
|
|
103
|
+
private openExclusive;
|
|
104
|
+
/**
|
|
105
|
+
* Disposes the landing panel.
|
|
106
|
+
*
|
|
107
|
+
* In-flight {@link ensureDocManager} / {@link open} calls observe disposal and
|
|
108
|
+
* stop attaching sources or opening; the host still owns any DocManager that
|
|
109
|
+
* `createDocManager` already constructed.
|
|
110
|
+
*/
|
|
111
|
+
dispose(): void;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Creates a landing + lazy DocManager session.
|
|
115
|
+
*
|
|
116
|
+
* @param options - Session options including {@link createDocManager}
|
|
117
|
+
*/
|
|
118
|
+
export declare function acuiCreateFileOpenSession(options: AcUiFileOpenSessionOptions): AcUiFileOpenSession;
|
|
119
|
+
//# sourceMappingURL=AcUiFileOpenSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcUiFileOpenSession.d.ts","sourceRoot":"","sources":["../../src/ui/AcUiFileOpenSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EACL,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAA;AAE9B;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,iBAAiB,EAAE,qBAAqB,CAAA;IACjD,YAAY,CACV,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,OAAO,CAAC,CAAA;IACnB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,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AAO,EAAE,0BAA0B;IAmB/C,oCAAoC;IACpC,IAAI,OAAO,IAAI,qBAAqB,CAEnC;IAED,4BAA4B;IAC5B,IAAI,KAAK,IAAI,WAAW,CAEvB;IAED,6EAA6E;IAC7E,IAAI,kBAAkB,IAAI,sBAAsB,GAAG,IAAI,CAEtD;IAED;;;;;;;OAOG;IACH,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;IAS5C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAMlC,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI;IAI9C,oBAAoB,IAAI,IAAI;IAI5B;;;;OAIG;IACG,gBAAgB,IAAI,OAAO,CAAC,sBAAsB,CAAC;IA0BzD;;;;;;;OAOG;IACG,IAAI,CACR,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,yBAAyB,CAAC;YAUvB,aAAa;IA8C3B;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;CAOhB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,0BAA0B,GAClC,mBAAmB,CAErB"}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
49
|
+
var t = {};
|
|
50
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
51
|
+
t[p] = s[p];
|
|
52
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
53
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
54
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
55
|
+
t[p[i]] = s[p[i]];
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
};
|
|
59
|
+
import { AcUiFileOpenLanding } from './AcUiFileOpenLanding';
|
|
60
|
+
/**
|
|
61
|
+
* Landing + lazy DocManager session.
|
|
62
|
+
*
|
|
63
|
+
* On each open request the session:
|
|
64
|
+
* 1. Calls {@link AcUiFileOpenSessionOptions.createDocManager} once
|
|
65
|
+
* 2. Attaches landing cloud sources onto the DocManager registry
|
|
66
|
+
* 3. Runs `openDocument` / `openUrl` / `newDocument`
|
|
67
|
+
*
|
|
68
|
+
* The `/file-open-panel` entry stays light — the host supplies DocManager via
|
|
69
|
+
* dynamic `import('@mlightcad/cad-simple-viewer')` inside `createDocManager`.
|
|
70
|
+
*/
|
|
71
|
+
var AcUiFileOpenSession = /** @class */ (function () {
|
|
72
|
+
function AcUiFileOpenSession(options) {
|
|
73
|
+
var _this = this;
|
|
74
|
+
this.docManager = null;
|
|
75
|
+
this.ensurePromise = null;
|
|
76
|
+
/** Bumped on {@link dispose} so in-flight `createDocManager` results are dropped. */
|
|
77
|
+
this.ensureGeneration = 0;
|
|
78
|
+
/** Chains {@link open} calls so overlapping picks do not interleave. */
|
|
79
|
+
this.openTail = Promise.resolve();
|
|
80
|
+
this.disposed = false;
|
|
81
|
+
this.options = options;
|
|
82
|
+
var _createDocManager = options.createDocManager, _getOpenOptions = options.getOpenOptions, _onBeforeOpen = options.onBeforeOpen, _onPrepareOpen = options.onPrepareOpen, _onAfterOpen = options.onAfterOpen, landingOptions = __rest(options, ["createDocManager", "getOpenOptions", "onBeforeOpen", "onPrepareOpen", "onAfterOpen"]);
|
|
83
|
+
this.landing = new AcUiFileOpenLanding(__assign(__assign({}, landingOptions), { onOpen: function (request) {
|
|
84
|
+
void _this.open(request);
|
|
85
|
+
} }));
|
|
86
|
+
}
|
|
87
|
+
Object.defineProperty(AcUiFileOpenSession.prototype, "manager", {
|
|
88
|
+
/** Landing data-source registry. */
|
|
89
|
+
get: function () {
|
|
90
|
+
return this.landing.manager;
|
|
91
|
+
},
|
|
92
|
+
enumerable: false,
|
|
93
|
+
configurable: true
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(AcUiFileOpenSession.prototype, "theme", {
|
|
96
|
+
/** Effective card theme. */
|
|
97
|
+
get: function () {
|
|
98
|
+
return this.landing.theme;
|
|
99
|
+
},
|
|
100
|
+
enumerable: false,
|
|
101
|
+
configurable: true
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(AcUiFileOpenSession.prototype, "docManagerInstance", {
|
|
104
|
+
/** Cached DocManager after the first successful {@link ensureDocManager}. */
|
|
105
|
+
get: function () {
|
|
106
|
+
return this.docManager;
|
|
107
|
+
},
|
|
108
|
+
enumerable: false,
|
|
109
|
+
configurable: true
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* Registers a cloud (or custom) data source on the landing registry.
|
|
113
|
+
*
|
|
114
|
+
* When DocManager already exists, the same instance is attached there too
|
|
115
|
+
* so late async plugin registration still reaches in-viewer File → Open.
|
|
116
|
+
*
|
|
117
|
+
* @param source - Source to register
|
|
118
|
+
*/
|
|
119
|
+
AcUiFileOpenSession.prototype.registerSource = function (source) {
|
|
120
|
+
if (this.disposed)
|
|
121
|
+
return;
|
|
122
|
+
this.landing.registerSource(source);
|
|
123
|
+
if (this.docManager) {
|
|
124
|
+
this.landing.attachSourcesTo(this.docManager.dataSourceManager);
|
|
125
|
+
this.landing.refreshSourceButtons();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Removes a data source from the landing registry (and DocManager when ready).
|
|
130
|
+
*
|
|
131
|
+
* @param id - Source id
|
|
132
|
+
*/
|
|
133
|
+
AcUiFileOpenSession.prototype.unregisterSource = function (id) {
|
|
134
|
+
var _a;
|
|
135
|
+
if (this.disposed)
|
|
136
|
+
return;
|
|
137
|
+
this.landing.unregisterSource(id);
|
|
138
|
+
(_a = this.docManager) === null || _a === void 0 ? void 0 : _a.dataSourceManager.unregister(id);
|
|
139
|
+
};
|
|
140
|
+
AcUiFileOpenSession.prototype.setTheme = function (theme) {
|
|
141
|
+
this.landing.setTheme(theme);
|
|
142
|
+
};
|
|
143
|
+
AcUiFileOpenSession.prototype.refreshSourceButtons = function () {
|
|
144
|
+
this.landing.refreshSourceButtons();
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Ensures DocManager exists and landing sources are attached.
|
|
148
|
+
*
|
|
149
|
+
* @returns The DocManager instance
|
|
150
|
+
*/
|
|
151
|
+
AcUiFileOpenSession.prototype.ensureDocManager = function () {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
153
|
+
var generation_1;
|
|
154
|
+
var _this = this;
|
|
155
|
+
return __generator(this, function (_a) {
|
|
156
|
+
if (this.disposed) {
|
|
157
|
+
throw new Error('AcUiFileOpenSession is disposed');
|
|
158
|
+
}
|
|
159
|
+
if (this.docManager)
|
|
160
|
+
return [2 /*return*/, this.docManager];
|
|
161
|
+
if (!this.ensurePromise) {
|
|
162
|
+
generation_1 = this.ensureGeneration;
|
|
163
|
+
this.ensurePromise = this.options
|
|
164
|
+
.createDocManager()
|
|
165
|
+
.then(function (dm) {
|
|
166
|
+
if (_this.disposed || generation_1 !== _this.ensureGeneration) {
|
|
167
|
+
throw new Error('AcUiFileOpenSession is disposed');
|
|
168
|
+
}
|
|
169
|
+
_this.docManager = dm;
|
|
170
|
+
_this.landing.attachSourcesTo(dm.dataSourceManager);
|
|
171
|
+
_this.landing.refreshSourceButtons();
|
|
172
|
+
return dm;
|
|
173
|
+
})
|
|
174
|
+
.catch(function (error) {
|
|
175
|
+
_this.ensurePromise = null;
|
|
176
|
+
throw error;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return [2 /*return*/, this.ensurePromise];
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Opens a normalized landing request (also used by the panel `onOpen` path).
|
|
185
|
+
*
|
|
186
|
+
* Concurrent calls are serialized so overlapping picks do not interleave
|
|
187
|
+
* against the same DocManager.
|
|
188
|
+
*
|
|
189
|
+
* @param request - File / URL / new drawing intent
|
|
190
|
+
*/
|
|
191
|
+
AcUiFileOpenSession.prototype.open = function (request) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
193
|
+
var run, resultPromise;
|
|
194
|
+
var _this = this;
|
|
195
|
+
return __generator(this, function (_a) {
|
|
196
|
+
run = function () { return _this.openExclusive(request); };
|
|
197
|
+
resultPromise = this.openTail.then(run, run);
|
|
198
|
+
this.openTail = resultPromise.then(function () { return undefined; }, function () { return undefined; });
|
|
199
|
+
return [2 /*return*/, resultPromise];
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
AcUiFileOpenSession.prototype.openExclusive = function (request) {
|
|
204
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
205
|
+
var result, dm, openOptions, success, content, error_1;
|
|
206
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
207
|
+
return __generator(this, function (_j) {
|
|
208
|
+
switch (_j.label) {
|
|
209
|
+
case 0:
|
|
210
|
+
if (this.disposed) {
|
|
211
|
+
return [2 /*return*/, { ok: false, error: new Error('AcUiFileOpenSession is disposed') }];
|
|
212
|
+
}
|
|
213
|
+
return [4 /*yield*/, ((_b = (_a = this.options).onBeforeOpen) === null || _b === void 0 ? void 0 : _b.call(_a, request))];
|
|
214
|
+
case 1:
|
|
215
|
+
_j.sent();
|
|
216
|
+
_j.label = 2;
|
|
217
|
+
case 2:
|
|
218
|
+
_j.trys.push([2, 12, , 13]);
|
|
219
|
+
return [4 /*yield*/, this.ensureDocManager()];
|
|
220
|
+
case 3:
|
|
221
|
+
dm = _j.sent();
|
|
222
|
+
if (this.disposed) {
|
|
223
|
+
return [2 /*return*/, {
|
|
224
|
+
ok: false,
|
|
225
|
+
error: new Error('AcUiFileOpenSession is disposed')
|
|
226
|
+
}];
|
|
227
|
+
}
|
|
228
|
+
return [4 /*yield*/, ((_d = (_c = this.options).onPrepareOpen) === null || _d === void 0 ? void 0 : _d.call(_c, request, dm))];
|
|
229
|
+
case 4:
|
|
230
|
+
_j.sent();
|
|
231
|
+
openOptions = (_f = (_e = this.options).getOpenOptions) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
232
|
+
success = false;
|
|
233
|
+
if (!(request.kind === 'file')) return [3 /*break*/, 7];
|
|
234
|
+
return [4 /*yield*/, request.file.arrayBuffer()];
|
|
235
|
+
case 5:
|
|
236
|
+
content = _j.sent();
|
|
237
|
+
return [4 /*yield*/, dm.openDocument(request.file.name, content, openOptions)];
|
|
238
|
+
case 6:
|
|
239
|
+
success = _j.sent();
|
|
240
|
+
return [3 /*break*/, 11];
|
|
241
|
+
case 7:
|
|
242
|
+
if (!(request.kind === 'url')) return [3 /*break*/, 9];
|
|
243
|
+
return [4 /*yield*/, dm.openUrl(request.url, openOptions)];
|
|
244
|
+
case 8:
|
|
245
|
+
success = _j.sent();
|
|
246
|
+
return [3 /*break*/, 11];
|
|
247
|
+
case 9: return [4 /*yield*/, dm.newDocument(openOptions)];
|
|
248
|
+
case 10:
|
|
249
|
+
success = _j.sent();
|
|
250
|
+
_j.label = 11;
|
|
251
|
+
case 11:
|
|
252
|
+
// `false` usually means the viewer already reported via event bus
|
|
253
|
+
// (`failed-to-open-file`); avoid inventing a duplicate error here.
|
|
254
|
+
result = success ? { ok: true } : { ok: false };
|
|
255
|
+
return [3 /*break*/, 13];
|
|
256
|
+
case 12:
|
|
257
|
+
error_1 = _j.sent();
|
|
258
|
+
result = { ok: false, error: error_1 };
|
|
259
|
+
return [3 /*break*/, 13];
|
|
260
|
+
case 13: return [4 /*yield*/, ((_h = (_g = this.options).onAfterOpen) === null || _h === void 0 ? void 0 : _h.call(_g, request, result))];
|
|
261
|
+
case 14:
|
|
262
|
+
_j.sent();
|
|
263
|
+
return [2 /*return*/, result];
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Disposes the landing panel.
|
|
270
|
+
*
|
|
271
|
+
* In-flight {@link ensureDocManager} / {@link open} calls observe disposal and
|
|
272
|
+
* stop attaching sources or opening; the host still owns any DocManager that
|
|
273
|
+
* `createDocManager` already constructed.
|
|
274
|
+
*/
|
|
275
|
+
AcUiFileOpenSession.prototype.dispose = function () {
|
|
276
|
+
if (this.disposed)
|
|
277
|
+
return;
|
|
278
|
+
this.disposed = true;
|
|
279
|
+
this.ensureGeneration += 1;
|
|
280
|
+
this.ensurePromise = null;
|
|
281
|
+
this.landing.dispose();
|
|
282
|
+
};
|
|
283
|
+
return AcUiFileOpenSession;
|
|
284
|
+
}());
|
|
285
|
+
export { AcUiFileOpenSession };
|
|
286
|
+
/**
|
|
287
|
+
* Creates a landing + lazy DocManager session.
|
|
288
|
+
*
|
|
289
|
+
* @param options - Session options including {@link createDocManager}
|
|
290
|
+
*/
|
|
291
|
+
export function acuiCreateFileOpenSession(options) {
|
|
292
|
+
return new AcUiFileOpenSession(options);
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=AcUiFileOpenSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcUiFileOpenSession.js","sourceRoot":"","sources":["../../src/ui/AcUiFileOpenSession.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,OAAO,EACL,mBAAmB,EAGpB,MAAM,uBAAuB,CAAA;AAqD9B;;;;;;;;;;GAUG;AACH;IAYE,6BAAY,OAAmC;QAA/C,iBAiBC;QAzBO,eAAU,GAAkC,IAAI,CAAA;QAChD,kBAAa,GAA2C,IAAI,CAAA;QACpE,qFAAqF;QAC7E,qBAAgB,GAAG,CAAC,CAAA;QAC5B,wEAAwE;QAChE,aAAQ,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAA;QAC3C,aAAQ,GAAG,KAAK,CAAA;QAGtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QAEpB,IAAkB,iBAAiB,GAMjC,OAAO,iBAN0B,EACnB,eAAe,GAK7B,OAAO,eALsB,EACjB,aAAa,GAIzB,OAAO,aAJkB,EACZ,cAAc,GAG3B,OAAO,cAHoB,EAChB,YAAY,GAEvB,OAAO,YAFgB,EACtB,cAAc,UACf,OAAO,EAPL,sFAOL,CADkB,CACR;QAEX,IAAI,CAAC,OAAO,GAAG,IAAI,mBAAmB,uBACjC,cAAc,KACjB,MAAM,EAAE,UAAA,OAAO;gBACb,KAAK,KAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACzB,CAAC,IACD,CAAA;IACJ,CAAC;IAGD,sBAAI,wCAAO;QADX,oCAAoC;aACpC;YACE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAA;QAC7B,CAAC;;;OAAA;IAGD,sBAAI,sCAAK;QADT,4BAA4B;aAC5B;YACE,OAAO,IAAI,CAAC,OA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BAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,SAAS,CAAA"}
|
package/lib/ui/index.js
CHANGED
package/lib/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,SAAS,CAAA"}
|
|
@@ -14,6 +14,10 @@ export type AcEdUndoRedoShortcut = 'undo' | 'redo';
|
|
|
14
14
|
* Shortcuts are suppressed while the user is typing in editable fields, during
|
|
15
15
|
* IME composition, while a command is acquiring input, or while MText is being
|
|
16
16
|
* edited inline.
|
|
17
|
+
*
|
|
18
|
+
* Printable keys pressed on the view are typed into the command line so a
|
|
19
|
+
* command can be started without clicking it first, and Space on an idle view
|
|
20
|
+
* repeats the last command (AutoCAD behavior).
|
|
17
21
|
*/
|
|
18
22
|
export declare class AcEdViewKeyHandler {
|
|
19
23
|
private readonly view;
|
|
@@ -25,6 +29,19 @@ export declare class AcEdViewKeyHandler {
|
|
|
25
29
|
* @returns `true` when the event was consumed and default action prevented.
|
|
26
30
|
*/
|
|
27
31
|
handleKeyDown(e: KeyboardEvent): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Routes a printable key pressed on the view to the command line.
|
|
34
|
+
*
|
|
35
|
+
* Space repeats the last command when no prompt is active; prompts handle
|
|
36
|
+
* Space themselves (as Enter). Other characters start typing in the command
|
|
37
|
+
* line, which also covers keywords of the active prompt.
|
|
38
|
+
*/
|
|
39
|
+
private handleTypedKey;
|
|
40
|
+
/**
|
|
41
|
+
* Whether a modal dialog is showing; its controls own the keyboard even when
|
|
42
|
+
* the dialog is mounted inside the view container.
|
|
43
|
+
*/
|
|
44
|
+
private isModalDialogOpen;
|
|
28
45
|
private resolveUndoRedoShortcut;
|
|
29
46
|
private shouldIgnoreEditableTargetShortcut;
|
|
30
47
|
private shouldHandleUndoRedoShortcut;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdViewKeyHandler.d.ts","sourceRoot":"","sources":["../../src/view/AcEdViewKeyHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcEdViewKeyHandler.d.ts","sourceRoot":"","sources":["../../src/view/AcEdViewKeyHandler.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAA;AAElD;;;;;;;;;;GAUG;AACH,qBAAa,kBAAkB;IAGjB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAgB;gBAEnC,IAAI,EAAE,UAAU;IAE7C;;;;OAIG;IACH,aAAa,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO;IA6ExC;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAuBtB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,uBAAuB;IAkB/B,OAAO,CAAC,kCAAkC;IAmB1C,OAAO,CAAC,4BAA4B;CA4BrC"}
|
|
@@ -13,6 +13,7 @@ import { AcApDocManager } from '../app';
|
|
|
13
13
|
import { runMarkupEdit } from '../command/markup/AcApMarkupHistory';
|
|
14
14
|
import { runMeasurementEdit } from '../command/measure/AcApMeasurementHistory';
|
|
15
15
|
import { MEASUREMENT_LAYER } from '../command/measure/AcApMeasurementStore';
|
|
16
|
+
import { acedIsSpaceActivatedTarget } from '../editor/input/ui/AcEdKeyboardUtil';
|
|
16
17
|
import { AcEdMTextEditor } from '../editor/input/ui/AcEdMTextEditor';
|
|
17
18
|
/**
|
|
18
19
|
* Handles global keyboard shortcuts for a CAD view.
|
|
@@ -20,6 +21,10 @@ import { AcEdMTextEditor } from '../editor/input/ui/AcEdMTextEditor';
|
|
|
20
21
|
* Shortcuts are suppressed while the user is typing in editable fields, during
|
|
21
22
|
* IME composition, while a command is acquiring input, or while MText is being
|
|
22
23
|
* edited inline.
|
|
24
|
+
*
|
|
25
|
+
* Printable keys pressed on the view are typed into the command line so a
|
|
26
|
+
* command can be started without clicking it first, and Space on an idle view
|
|
27
|
+
* repeats the last command (AutoCAD behavior).
|
|
23
28
|
*/
|
|
24
29
|
var AcEdViewKeyHandler = /** @class */ (function () {
|
|
25
30
|
function AcEdViewKeyHandler(view) {
|
|
@@ -105,7 +110,45 @@ var AcEdViewKeyHandler = /** @class */ (function () {
|
|
|
105
110
|
}
|
|
106
111
|
return false;
|
|
107
112
|
}
|
|
108
|
-
return
|
|
113
|
+
return this.handleTypedKey(e);
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Routes a printable key pressed on the view to the command line.
|
|
117
|
+
*
|
|
118
|
+
* Space repeats the last command when no prompt is active; prompts handle
|
|
119
|
+
* Space themselves (as Enter). Other characters start typing in the command
|
|
120
|
+
* line, which also covers keywords of the active prompt.
|
|
121
|
+
*/
|
|
122
|
+
AcEdViewKeyHandler.prototype.handleTypedKey = function (e) {
|
|
123
|
+
if (e.ctrlKey || e.metaKey || e.altKey)
|
|
124
|
+
return false;
|
|
125
|
+
if (typeof e.key !== 'string' || e.key.length !== 1)
|
|
126
|
+
return false;
|
|
127
|
+
if (AcEdMTextEditor.getActiveInputBox() || this.isModalDialogOpen()) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
var editor = this.view.editor;
|
|
131
|
+
if (e.key === ' ') {
|
|
132
|
+
// A held Space must not relaunch the command on every auto-repeat.
|
|
133
|
+
if (e.repeat || editor.isActive || acedIsSpaceActivatedTarget(e.target)) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
editor.inputManager.repeatLastCommand();
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
if (!editor.inputManager.typeIntoCommandLine(e.key))
|
|
141
|
+
return false;
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
return true;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Whether a modal dialog is showing; its controls own the keyboard even when
|
|
147
|
+
* the dialog is mounted inside the view container.
|
|
148
|
+
*/
|
|
149
|
+
AcEdViewKeyHandler.prototype.isModalDialogOpen = function () {
|
|
150
|
+
var candidates = document.querySelectorAll('.ml-ui-dialog-backdrop, [aria-modal="true"]');
|
|
151
|
+
return Array.from(candidates).some(function (el) { return el.getClientRects().length > 0; });
|
|
109
152
|
};
|
|
110
153
|
AcEdViewKeyHandler.prototype.resolveUndoRedoShortcut = function (e) {
|
|
111
154
|
if (!e.ctrlKey && !e.metaKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdViewKeyHandler.js","sourceRoot":"","sources":["../../src/view/AcEdViewKeyHandler.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ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IACE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,EACrE,CAAC;gBACD,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;YACrD,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IA/LuB,2CAAwB,GAAG,aAAa,CAAA;IAgMlE,yBAAC;CAAA,AAjMD,IAiMC;SAjMY,kBAAkB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/cad-simple-viewer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-preview.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -23,8 +23,10 @@
|
|
|
23
23
|
"lib",
|
|
24
24
|
"icons.ts",
|
|
25
25
|
"find.ts",
|
|
26
|
+
"file-open-panel.ts",
|
|
26
27
|
"src/ui/icons.ts",
|
|
27
28
|
"src/find",
|
|
29
|
+
"src/file-open-panel.ts",
|
|
28
30
|
"README.md",
|
|
29
31
|
"package.json"
|
|
30
32
|
],
|
|
@@ -37,6 +39,14 @@
|
|
|
37
39
|
"import": "./dist/cad-simple-viewer.js",
|
|
38
40
|
"require": "./dist/cad-simple-viewer.umd.cjs"
|
|
39
41
|
},
|
|
42
|
+
"./file-open-panel": {
|
|
43
|
+
"types": "./lib/file-open-panel.d.ts",
|
|
44
|
+
"import": {
|
|
45
|
+
"development": "./src/file-open-panel.ts",
|
|
46
|
+
"default": "./dist/cad-simple-viewer-file-open-panel.js"
|
|
47
|
+
},
|
|
48
|
+
"default": "./dist/cad-simple-viewer-file-open-panel.js"
|
|
49
|
+
},
|
|
40
50
|
"./icons": {
|
|
41
51
|
"types": "./src/ui/icons.ts",
|
|
42
52
|
"import": "./src/ui/icons.ts",
|
|
@@ -49,7 +59,7 @@
|
|
|
49
59
|
}
|
|
50
60
|
},
|
|
51
61
|
"devDependencies": {
|
|
52
|
-
"@mlightcad/data-model": "1.15.
|
|
62
|
+
"@mlightcad/data-model": "1.15.22",
|
|
53
63
|
"@mlightcad/mtext-input-box": "0.3.7",
|
|
54
64
|
"@mlightcad/mtext-parser": "1.5.7",
|
|
55
65
|
"@mlightcad/mtext-renderer": "0.13.7",
|
|
@@ -61,15 +71,15 @@
|
|
|
61
71
|
"mitt": "^3.0.1",
|
|
62
72
|
"rbush": "^4.0.1",
|
|
63
73
|
"three": "^0.186.1",
|
|
64
|
-
"@mlightcad/three-renderer": "1.
|
|
74
|
+
"@mlightcad/three-renderer": "1.8.0-preview.1"
|
|
65
75
|
},
|
|
66
76
|
"peerDependencies": {
|
|
67
|
-
"@mlightcad/data-model": "1.15.
|
|
77
|
+
"@mlightcad/data-model": "1.15.22",
|
|
68
78
|
"@mlightcad/mtext-parser": "1.5.7",
|
|
69
79
|
"@mlightcad/mtext-renderer": "0.13.7",
|
|
70
80
|
"lodash-es": "4.17.21",
|
|
71
81
|
"three": "^0.186.1",
|
|
72
|
-
"@mlightcad/three-renderer": "1.
|
|
82
|
+
"@mlightcad/three-renderer": "^1.8.0-preview.1"
|
|
73
83
|
},
|
|
74
84
|
"scripts": {
|
|
75
85
|
"clean": "rimraf dist lib tsconfig.tsbuildinfo",
|