lucid-extension-sdk 0.0.232 → 0.0.234
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/commandtypes.d.ts +1 -1
- package/document/linedefinition.d.ts +12 -0
- package/document/linedefinition.js +39 -0
- package/package.json +1 -1
- package/ui/modal.d.ts +1 -1
- package/ui/modal.js +2 -2
package/commandtypes.d.ts
CHANGED
|
@@ -1540,7 +1540,7 @@ export type ShowModalQuery = {
|
|
|
1540
1540
|
/** URL to display in the modal (this or c is required). Can be relative to /public directory in the package */
|
|
1541
1541
|
'u'?: string | undefined;
|
|
1542
1542
|
};
|
|
1543
|
-
export type ShowModalResult = undefined
|
|
1543
|
+
export type ShowModalResult = Promise<undefined>;
|
|
1544
1544
|
export type ShowPackageSettingsModalQuery = undefined;
|
|
1545
1545
|
export type ShowPackageSettingsModalResult = Promise<void>;
|
|
1546
1546
|
export type ShowPanelQuery = {
|
|
@@ -20,6 +20,10 @@ export interface BlockEndpointDefinition extends EndpointStyle {
|
|
|
20
20
|
/** If set, the distance from the connected block this endpoint should be */
|
|
21
21
|
padding?: number;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Checks if the endpoint is a BlockEndpointDefinition.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isBlockEndpointDefinition(endpoint: EndpointDefinition): endpoint is BlockEndpointDefinition;
|
|
23
27
|
/**
|
|
24
28
|
* A line endpoint that is connected to another line at some distance along that other
|
|
25
29
|
* line, where 0 is at that line's endpoint1, and 1 is at that line's endpoint2.
|
|
@@ -29,6 +33,10 @@ export interface LineEndpointDefinition extends EndpointStyle {
|
|
|
29
33
|
/** 0 to 1, distance along the target line */
|
|
30
34
|
position: number;
|
|
31
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Checks if the endpoint is a LineEndpointDefinition.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isLineEndpointDefinition(endpoint: EndpointDefinition): endpoint is LineEndpointDefinition;
|
|
32
40
|
/**
|
|
33
41
|
* A line endpoint that is free-floating at the given x/y location on the page
|
|
34
42
|
*/
|
|
@@ -37,6 +45,10 @@ export interface PositionEndpointDefinition extends EndpointStyle {
|
|
|
37
45
|
x: number;
|
|
38
46
|
y: number;
|
|
39
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Checks if the endpoint is a PositionEndpointDefinition.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isPositionEndpointDefinition(endpoint: EndpointDefinition): endpoint is PositionEndpointDefinition;
|
|
40
52
|
/**
|
|
41
53
|
* The definition of one line endpoint, which may be free-floating at a given location, or attached
|
|
42
54
|
* to another block or line
|
|
@@ -1,2 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPositionEndpointDefinition = exports.isLineEndpointDefinition = exports.isBlockEndpointDefinition = void 0;
|
|
4
|
+
const checks_1 = require("../core/checks");
|
|
5
|
+
const validators_1 = require("../core/validators/validators");
|
|
6
|
+
const blockproxy_1 = require("./blockproxy");
|
|
7
|
+
const lineproxy_1 = require("./lineproxy");
|
|
8
|
+
/**
|
|
9
|
+
* Checks if the endpoint is a BlockEndpointDefinition.
|
|
10
|
+
*/
|
|
11
|
+
function isBlockEndpointDefinition(endpoint) {
|
|
12
|
+
return (0, validators_1.objectValidator)({
|
|
13
|
+
connection: (0, checks_1.isInstanceOf)(blockproxy_1.BlockProxy),
|
|
14
|
+
linkX: checks_1.isNumber,
|
|
15
|
+
linkY: checks_1.isNumber,
|
|
16
|
+
inside: (0, validators_1.option)(checks_1.isBoolean),
|
|
17
|
+
autoLink: (0, validators_1.option)(checks_1.isBoolean),
|
|
18
|
+
padding: (0, validators_1.option)(checks_1.isNumber),
|
|
19
|
+
})(endpoint);
|
|
20
|
+
}
|
|
21
|
+
exports.isBlockEndpointDefinition = isBlockEndpointDefinition;
|
|
22
|
+
/**
|
|
23
|
+
* Checks if the endpoint is a LineEndpointDefinition.
|
|
24
|
+
*/
|
|
25
|
+
function isLineEndpointDefinition(endpoint) {
|
|
26
|
+
return (0, validators_1.objectValidator)({
|
|
27
|
+
connection: (0, checks_1.isInstanceOf)(lineproxy_1.LineProxy),
|
|
28
|
+
position: checks_1.isNumber,
|
|
29
|
+
})(endpoint);
|
|
30
|
+
}
|
|
31
|
+
exports.isLineEndpointDefinition = isLineEndpointDefinition;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if the endpoint is a PositionEndpointDefinition.
|
|
34
|
+
*/
|
|
35
|
+
function isPositionEndpointDefinition(endpoint) {
|
|
36
|
+
return (0, validators_1.objectValidator)({
|
|
37
|
+
x: checks_1.isNumber,
|
|
38
|
+
y: checks_1.isNumber,
|
|
39
|
+
})(endpoint);
|
|
40
|
+
}
|
|
41
|
+
exports.isPositionEndpointDefinition = isPositionEndpointDefinition;
|
package/package.json
CHANGED
package/ui/modal.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export declare abstract class Modal extends IframeUI {
|
|
|
57
57
|
private visible;
|
|
58
58
|
constructor(client: EditorClient, config: ModalConfig);
|
|
59
59
|
protected frameClosed(): void;
|
|
60
|
-
show(): void
|
|
60
|
+
show(): Promise<void>;
|
|
61
61
|
/**
|
|
62
62
|
* If this modal is currently visible, close it, destroying the iframe.
|
|
63
63
|
*/
|
package/ui/modal.js
CHANGED
|
@@ -22,10 +22,10 @@ class Modal extends iframeui_1.IframeUI {
|
|
|
22
22
|
this.visible = false;
|
|
23
23
|
this.unhookMessages();
|
|
24
24
|
}
|
|
25
|
-
show() {
|
|
25
|
+
async show() {
|
|
26
26
|
if (!this.visible) {
|
|
27
27
|
this.hookMessages();
|
|
28
|
-
this.client.sendCommand("sm" /* CommandName.ShowModal */, {
|
|
28
|
+
await this.client.sendCommand("sm" /* CommandName.ShowModal */, {
|
|
29
29
|
'n': this.messageActionName,
|
|
30
30
|
't': this.config.title,
|
|
31
31
|
'w': this.config.width,
|