@roomle/embedding-lib 5.7.0-alpha.1 → 5.7.0-alpha.3
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/docs/md/web/embedding/CHANGELOG.md +32 -3
- package/drag-in-CYmR1HFI.mjs +7 -0
- package/drag-in-Do47zdKL.mjs +141 -0
- package/from-custom-view-BVWf7SQ7.mjs +1 -0
- package/from-custom-view-DYkvyOw3.mjs +163 -0
- package/from-website-DDMDPp-F.mjs +206 -0
- package/from-website-Dx2SUftr.mjs +4 -0
- package/index.d.ts +105 -40
- package/package.json +2 -2
- package/roomle-embedding-lib.es.js +343 -261
- package/roomle-embedding-lib.es.min.js +8 -8
- package/roomle-embedding-lib.umd.js +17 -14
- package/roomle-embedding-lib.umd.min.js +14 -11
- package/touch-drag-C1SsZtt4.mjs +1 -0
- package/touch-drag-DNDPwZ-_.mjs +149 -0
- package/drag-in-BKrnFtmJ.mjs +0 -7
- package/drag-in-DC-05b4s.mjs +0 -265
package/index.d.ts
CHANGED
|
@@ -1,54 +1,131 @@
|
|
|
1
|
-
import { default as default_2 } from '@roomle/web-sdk/lib/definitions/
|
|
2
|
-
import { default as default_3 } from '@roomle/web-sdk/lib/definitions/
|
|
3
|
-
import { default as default_4 } from '@roomle/web-sdk/lib/definitions/configurator-core/src/
|
|
1
|
+
import { default as default_2 } from '@roomle/web-sdk/lib/definitions/configurator-core/src/roomle-configurator';
|
|
2
|
+
import { default as default_3 } from '@roomle/web-sdk/lib/definitions/planner-core/src/roomle-planner';
|
|
3
|
+
import { default as default_4 } from '@roomle/web-sdk/lib/definitions/configurator-core/src/services/configurator-ui-callback';
|
|
4
4
|
import { default as default_5 } from '@roomle/web-sdk/lib/definitions/glb-viewer-core/src/roomle-glb-viewer';
|
|
5
|
+
import { EmbeddingCommand } from '../../common/src/utils/message-handler';
|
|
5
6
|
import { ExposedAnalyticsCallbacks } from '../../../src/configurator/embedding/exposed-analytics-callbacks';
|
|
6
7
|
import { ExposedApi } from '../../../../src/configurator/embedding/exposed-api';
|
|
7
8
|
import { ExposedApi as ExposedApi_2 } from '../../../src/configurator/embedding/exposed-api';
|
|
8
9
|
import { GlobalCallback } from '@roomle/web-sdk/lib/definitions/common-core/src/services/global-callback';
|
|
10
|
+
import { MessageHandler } from '../../common/src/utils/message-handler';
|
|
11
|
+
import { Nullable } from '../../../src/common/utils/types';
|
|
12
|
+
import { OnBeforeUpdateDragGhost } from '../../../../common/src/utils/drag';
|
|
13
|
+
import { OnBeforeUpdateDragGhost as OnBeforeUpdateDragGhost_2 } from '../../../common/src/utils/drag';
|
|
14
|
+
import { PossibleCustomViews } from '../../../src/configurator/embedding/types';
|
|
15
|
+
import { PossibleCustomViewsAndMain } from '../../../src/configurator/embedding/types';
|
|
16
|
+
import { PossibleCustomViewsAndMain as PossibleCustomViewsAndMain_2 } from '../../../../src/configurator/embedding/types';
|
|
9
17
|
import { RapiId } from '@roomle/web-sdk/lib/definitions/typings/rapi-types';
|
|
10
18
|
import { UiInitData } from '../../../src/configurator/embedding/types';
|
|
11
19
|
|
|
12
|
-
declare
|
|
13
|
-
|
|
14
|
-
}
|
|
20
|
+
declare type AvailablePlugins = {
|
|
21
|
+
[K in keyof PluginMap]?: InstanceType<PluginMap[K]>;
|
|
22
|
+
};
|
|
15
23
|
|
|
16
|
-
declare class
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
touchDragEpsilon?: number;
|
|
24
|
+
declare class Connector<SdkType, SdkCallbacks> implements RoomleEmbeddingApiKeys {
|
|
25
|
+
protected _messageHandler: Nullable<MessageHandler>;
|
|
26
|
+
isSetupDone: boolean;
|
|
27
|
+
viewName: PossibleCustomViewsAndMain;
|
|
28
|
+
plugins: AvailablePlugins;
|
|
29
|
+
pluginsLoaded: Array<Promise<void>>;
|
|
30
|
+
ui: ExposedApi_2;
|
|
31
|
+
extended: SdkType;
|
|
32
|
+
configurator: default_2;
|
|
33
|
+
analytics: {
|
|
34
|
+
callbacks: ExposedAnalyticsCallbacks;
|
|
28
35
|
};
|
|
36
|
+
global: {
|
|
37
|
+
callbacks: GlobalCallback;
|
|
38
|
+
};
|
|
39
|
+
setMessageHandler(messageHandler: MessageHandler): void;
|
|
40
|
+
handleSetup(methodsAndCallbacks: {
|
|
41
|
+
methods: string[];
|
|
42
|
+
callbacks: string[];
|
|
43
|
+
}): void;
|
|
44
|
+
executeMessage({ message, args }: EmbeddingCommand): Promise<{
|
|
45
|
+
result: any;
|
|
46
|
+
}>;
|
|
47
|
+
setupPlugins(plugins: PluginDefinitions, iframe: HTMLIFrameElement | HTMLBodyElement, mode?: EmbeddingPluginMode): void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare class DragIn extends EmbeddingPlugin implements DragInStrategy {
|
|
51
|
+
options: DragInSettings;
|
|
52
|
+
private _strategy;
|
|
53
|
+
private _customDragSignal;
|
|
29
54
|
private _injectStyles;
|
|
30
55
|
private _initializeDragGhost;
|
|
31
|
-
constructor(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
dragStart(id: RapiId, event: DragEvent | TouchEvent, type?: string): void;
|
|
35
|
-
dragUpdate(event: DragEvent | TouchEvent): void;
|
|
56
|
+
constructor(instance: ExposedApi, mainDomElement: HTMLIFrameElement | HTMLBodyElement, mode: EmbeddingPluginMode, viewName: PossibleCustomViewsAndMain_2);
|
|
57
|
+
init(): Promise<void>;
|
|
58
|
+
get isDragging(): boolean;
|
|
59
|
+
dragStart(id: RapiId, event: DragEvent | TouchEvent | MouseEvent, type?: string): void;
|
|
60
|
+
dragUpdate(event: DragEvent | TouchEvent | MouseEvent): void;
|
|
36
61
|
dragEnd(): void;
|
|
37
62
|
touchStart(id: RapiId, event: TouchEvent, type?: string): void;
|
|
38
63
|
touchMove(event: TouchEvent): void;
|
|
39
64
|
touchEnd(): void;
|
|
40
65
|
dispose(): void;
|
|
66
|
+
beforeUpdateGhost(handler: OnBeforeUpdateDragGhost_2): void;
|
|
67
|
+
registerCustomDrag({ customDragStart, customDragEnd, customDragUpdate, beforeUpdateGhost, }: {
|
|
68
|
+
customDragStart: (event: MouseEvent | TouchEvent) => void;
|
|
69
|
+
customDragEnd: (event: MouseEvent | TouchEvent) => void;
|
|
70
|
+
customDragUpdate: (event: MouseEvent | TouchEvent) => void;
|
|
71
|
+
beforeUpdateGhost?: OnBeforeUpdateDragGhost_2;
|
|
72
|
+
}): void;
|
|
73
|
+
unregisterCustomDrag(): void;
|
|
74
|
+
releaseInput(event: DragEvent | TouchEvent | MouseEvent): void;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare interface DragInSettings {
|
|
78
|
+
dragInOverlapX?: number;
|
|
79
|
+
dragInOverlapY?: number;
|
|
80
|
+
fingerSize?: number;
|
|
81
|
+
touchDragDelay?: number;
|
|
82
|
+
touchDragEpsilon?: number;
|
|
83
|
+
customDragDelay?: number;
|
|
84
|
+
customDragEpsilon?: number;
|
|
41
85
|
}
|
|
42
86
|
|
|
87
|
+
declare interface DragInStrategy {
|
|
88
|
+
isDragging: boolean;
|
|
89
|
+
dragStart(id: RapiId, event: DragEvent | TouchEvent | MouseEvent, type: string): void;
|
|
90
|
+
dragUpdate(event: DragEvent | TouchEvent | MouseEvent): void;
|
|
91
|
+
dragEnd(): void;
|
|
92
|
+
touchStart(id: RapiId, event: TouchEvent, type: string): void;
|
|
93
|
+
touchMove(event: TouchEvent): void;
|
|
94
|
+
touchEnd(): void;
|
|
95
|
+
beforeUpdateGhost(handler: OnBeforeUpdateDragGhost): void;
|
|
96
|
+
releaseInput(event: DragEvent | TouchEvent | MouseEvent): void;
|
|
97
|
+
dispose(): void;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare class EmbeddingPlugin {
|
|
101
|
+
protected _mainDomElement: HTMLIFrameElement | HTMLBodyElement;
|
|
102
|
+
protected _instance: ExposedApi;
|
|
103
|
+
protected _mode: EmbeddingPluginMode;
|
|
104
|
+
protected _viewName: PossibleCustomViewsAndMain_2;
|
|
105
|
+
constructor(instance: ExposedApi, iframe: HTMLIFrameElement | HTMLBodyElement, mode: EmbeddingPluginMode, viewName: PossibleCustomViewsAndMain_2);
|
|
106
|
+
init(): Promise<void>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare type EmbeddingPluginMode = 'website' | 'custom-view';
|
|
110
|
+
|
|
111
|
+
declare type PluginConstructors = {
|
|
112
|
+
[K in keyof PluginMap]: PluginMap[K];
|
|
113
|
+
};
|
|
114
|
+
|
|
43
115
|
declare type PluginDefinitions = Array<keyof AvailablePlugins | {
|
|
44
116
|
name: keyof AvailablePlugins;
|
|
45
|
-
loader: () => Promise<
|
|
117
|
+
loader: () => Promise<PluginConstructors[keyof PluginConstructors]>;
|
|
46
118
|
}>;
|
|
47
119
|
|
|
48
|
-
declare
|
|
120
|
+
declare interface PluginMap {
|
|
121
|
+
dragIn: typeof DragIn;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare type RoomleConfiguratorApi = RoomleEmbeddingApi<default_2, default_4>;
|
|
49
125
|
|
|
50
|
-
declare class RoomleEmbeddingApi<SdkType, SdkCallbacks>
|
|
126
|
+
declare class RoomleEmbeddingApi<SdkType, SdkCallbacks> extends Connector<SdkType, SdkCallbacks> {
|
|
51
127
|
static createPlanner(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: PluginDefinitions): Promise<RoomlePlannerApi>;
|
|
128
|
+
static connect(customView: PossibleCustomViews, plugins?: PluginDefinitions): Promise<Connector<default_2, default_4>>;
|
|
52
129
|
/**
|
|
53
130
|
* Method to create a new instance of a Roomle Configurator
|
|
54
131
|
* @param configuratorId the id which identifies your configurator, you will get this ID from your Roomle Contact Person
|
|
@@ -72,23 +149,11 @@ declare class RoomleEmbeddingApi<SdkType, SdkCallbacks> implements RoomleEmbeddi
|
|
|
72
149
|
*/
|
|
73
150
|
static createViewer(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: PluginDefinitions): Promise<RoomleViewerApi>;
|
|
74
151
|
private static _create;
|
|
75
|
-
ui: ExposedApi_2;
|
|
76
|
-
extended: SdkType;
|
|
77
|
-
configurator: default_4;
|
|
78
|
-
analytics: {
|
|
79
|
-
callbacks: ExposedAnalyticsCallbacks;
|
|
80
|
-
};
|
|
81
|
-
global: {
|
|
82
|
-
callbacks: GlobalCallback;
|
|
83
|
-
};
|
|
84
|
-
plugins: AvailablePlugins;
|
|
85
152
|
private _waitForIframe;
|
|
86
153
|
private _container;
|
|
87
|
-
private _messageHandler;
|
|
88
154
|
private _configuratorSettings;
|
|
89
155
|
private _initData;
|
|
90
156
|
private _iframe;
|
|
91
|
-
pluginsLoaded: Array<Promise<void>>;
|
|
92
157
|
private constructor();
|
|
93
158
|
teardown(): void;
|
|
94
159
|
private _createIframe;
|
|
@@ -107,8 +172,8 @@ declare interface RoomleEmbeddingApiKeys {
|
|
|
107
172
|
global: any;
|
|
108
173
|
}
|
|
109
174
|
|
|
110
|
-
declare type RoomlePlannerApi = RoomleEmbeddingApi<
|
|
175
|
+
declare type RoomlePlannerApi = RoomleEmbeddingApi<default_3, default_4>;
|
|
111
176
|
|
|
112
|
-
declare type RoomleViewerApi = RoomleEmbeddingApi<default_5,
|
|
177
|
+
declare type RoomleViewerApi = RoomleEmbeddingApi<default_5, default_4>;
|
|
113
178
|
|
|
114
179
|
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "5.7.0-alpha.
|
|
3
|
+
"version": "5.7.0-alpha.3",
|
|
4
4
|
"description": "This is a small library which can be used to communicate with the Roomle Configurator",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./roomle-embedding-lib.umd.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"npm": "8.3.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@roomle/web-sdk": "2.
|
|
32
|
+
"@roomle/web-sdk": "2.89.0-alpha.5"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|