architwin 1.4.8 → 1.4.9
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/lib/atwinui/events.js +2 -1
- package/lib/tag.d.ts +1 -1
- package/lib/tag.js +14 -1
- package/package.json +1 -1
package/lib/atwinui/events.js
CHANGED
|
@@ -563,7 +563,8 @@ function handleDisposeTag() {
|
|
|
563
563
|
cancelTagFormBtn.addEventListener('click', onDisposeTag);
|
|
564
564
|
document.addEventListener('keydown', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
565
565
|
if (event.key === 'Escape') {
|
|
566
|
-
if (iTag !== null) {
|
|
566
|
+
if (iTag !== null || tagFormMode === "EDIT" /* FORM_MODE.EDIT */) {
|
|
567
|
+
console.log("onDisposeTag()");
|
|
567
568
|
yield onDisposeTag();
|
|
568
569
|
}
|
|
569
570
|
if (_currentPaneId === 'at-library-pane') {
|
package/lib/tag.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MpSdk } from "../bundle/sdk";
|
|
2
|
-
import { IAtwinFloor, IAtwinLabel, ITag, EmbedlyData } from "./types";
|
|
2
|
+
import type { IAtwinFloor, IAtwinLabel, ITag, EmbedlyData } from "./types";
|
|
3
3
|
import { AxiosInstance } from "axios";
|
|
4
4
|
declare function renderTag({ tag, sdk, isTagSharing }: {
|
|
5
5
|
tag: MpSdk.Tag.Descriptor;
|
package/lib/tag.js
CHANGED
|
@@ -14,8 +14,9 @@ import { getTagColorImageSrc } from "./color";
|
|
|
14
14
|
//@ts-ignore
|
|
15
15
|
import mergeImages from 'merge-images';
|
|
16
16
|
import log from 'loglevel';
|
|
17
|
-
import { _mpConfig } from "./architwin";
|
|
17
|
+
import { _mpConfig, getAtwinSdk } from "./architwin";
|
|
18
18
|
import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3";
|
|
19
|
+
import { selectedTag, tagFormMode } from "./atwinui/components/toolbar";
|
|
19
20
|
let _tagPointer;
|
|
20
21
|
let _inputNode;
|
|
21
22
|
const api = axios.create({
|
|
@@ -392,6 +393,18 @@ function cancelMoveTag() {
|
|
|
392
393
|
_tagPointer.cancel();
|
|
393
394
|
if (_inputNode)
|
|
394
395
|
_inputNode.stop();
|
|
396
|
+
if (tagFormMode === "EDIT" /* FORM_MODE.EDIT */) {
|
|
397
|
+
if (selectedTag) {
|
|
398
|
+
const tag = selectedTag;
|
|
399
|
+
const sdk = getAtwinSdk();
|
|
400
|
+
if (sdk !== null) {
|
|
401
|
+
sdk.Tag.editPosition(tag.json_data.id, {
|
|
402
|
+
anchorPosition: tag.json_data.anchorPosition,
|
|
403
|
+
stemVector: Object.assign({}, tag.json_data.stemVector),
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
395
408
|
//Reset values
|
|
396
409
|
_tagPointer = undefined;
|
|
397
410
|
_inputNode = undefined;
|