@servicetitan/dte-unlayer 0.26.0 → 0.27.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/api-core.d.ts +1 -10
- package/dist/api-core.d.ts.map +1 -1
- package/dist/api-core.js +8 -67
- package/dist/api-core.js.map +1 -1
- package/dist/editor-core-source.d.ts +4 -0
- package/dist/editor-core-source.d.ts.map +1 -0
- package/dist/editor-core-source.js +5 -0
- package/dist/editor-core-source.js.map +1 -0
- package/dist/editor-core.d.ts +9 -0
- package/dist/editor-core.d.ts.map +1 -0
- package/dist/editor-core.js +9 -0
- package/dist/editor-core.js.map +1 -0
- package/dist/loadScript.d.ts +1 -0
- package/dist/loadScript.d.ts.map +1 -1
- package/dist/loadScript.js +5 -0
- package/dist/loadScript.js.map +1 -1
- package/dist/unlayer-interface.d.ts +0 -2
- package/dist/unlayer-interface.d.ts.map +1 -1
- package/dist/unlayer.d.ts +1 -1
- package/dist/unlayer.d.ts.map +1 -1
- package/dist/unlayer.js +5 -4
- package/dist/unlayer.js.map +1 -1
- package/package.json +1 -1
- package/src/api-core.ts +4 -35
- package/src/editor-core-source.ts +4 -0
- package/src/editor-core.ts +8 -0
- package/src/loadScript.ts +6 -0
- package/src/unlayer-interface.tsx +0 -2
- package/src/unlayer.tsx +5 -13
- package/dist/editor-core/core.bundle.js +0 -17354
- package/dist/editor-core/custom.css +0 -1
- package/dist/editor-core/tools.bundle.js +0 -34761
package/dist/api-core.d.ts
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { UnlayerDesignTool } from './unlayer-interface';
|
|
2
2
|
export declare class UnlayerCoreApi {
|
|
3
|
-
private baseUrl;
|
|
4
|
-
customCss: string;
|
|
5
3
|
private loaded;
|
|
6
|
-
private core;
|
|
7
|
-
private coreTools;
|
|
8
|
-
constructor(baseUrl: string);
|
|
9
4
|
private get dteStore();
|
|
10
|
-
get pathsCore(): string[];
|
|
11
|
-
get pathsCoreTools(): string[];
|
|
12
|
-
init(): Promise<void>;
|
|
13
5
|
clean(): void;
|
|
14
|
-
preloadCore():
|
|
15
|
-
preloadCoreTools(): Promise<void>;
|
|
6
|
+
preloadCore(): void;
|
|
16
7
|
getCustomToolModel(key: string): object;
|
|
17
8
|
getCustomToolDataSources(tool: UnlayerDesignTool): string[];
|
|
18
9
|
}
|
package/dist/api-core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-core.d.ts","sourceRoot":"","sources":["../src/api-core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-core.d.ts","sourceRoot":"","sources":["../src/api-core.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAYxD,qBAAa,cAAc;IACvB,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,KAAK,QAAQ,GAEnB;IAED,KAAK;IAIL,WAAW;IASX,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAcvC,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,EAAE;CAa9D"}
|
package/dist/api-core.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { loadScript } from './loadScript';
|
|
1
|
+
import { editorCoreScript } from './editor-core';
|
|
2
|
+
import { loadScriptSource } from './loadScript';
|
|
11
3
|
const dummyStore = {
|
|
12
4
|
renderHtml() {
|
|
13
5
|
return '';
|
|
@@ -18,78 +10,27 @@ const dummyStore = {
|
|
|
18
10
|
},
|
|
19
11
|
};
|
|
20
12
|
export class UnlayerCoreApi {
|
|
21
|
-
constructor(
|
|
22
|
-
Object.defineProperty(this, "baseUrl", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
configurable: true,
|
|
25
|
-
writable: true,
|
|
26
|
-
value: baseUrl
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(this, "customCss", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: ''
|
|
33
|
-
});
|
|
13
|
+
constructor() {
|
|
34
14
|
Object.defineProperty(this, "loaded", {
|
|
35
15
|
enumerable: true,
|
|
36
16
|
configurable: true,
|
|
37
17
|
writable: true,
|
|
38
18
|
value: new Set()
|
|
39
19
|
});
|
|
40
|
-
Object.defineProperty(this, "core", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true,
|
|
44
|
-
value: ['core.bundle.js']
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(this, "coreTools", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
configurable: true,
|
|
49
|
-
writable: true,
|
|
50
|
-
value: ['tools.bundle.js']
|
|
51
|
-
});
|
|
52
20
|
}
|
|
53
21
|
get dteStore() {
|
|
54
22
|
var _a;
|
|
55
23
|
return (_a = window.dteStore) !== null && _a !== void 0 ? _a : dummyStore;
|
|
56
24
|
}
|
|
57
|
-
get pathsCore() {
|
|
58
|
-
return this.core.map(c => `${this.baseUrl}/${c}`);
|
|
59
|
-
}
|
|
60
|
-
get pathsCoreTools() {
|
|
61
|
-
return this.coreTools.map(c => `${this.baseUrl}/${c}`);
|
|
62
|
-
}
|
|
63
|
-
init() {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
return Promise.all([
|
|
66
|
-
fetch(`${this.baseUrl}/custom.css`).then(response => response.text()),
|
|
67
|
-
]).then(([customCSS]) => {
|
|
68
|
-
this.customCss = customCSS;
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
25
|
clean() {
|
|
73
|
-
this.customCss = '';
|
|
74
26
|
this.loaded = new Set();
|
|
75
27
|
}
|
|
76
28
|
preloadCore() {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
yield Promise.all(this.core.map(c => loadScript(`${this.baseUrl}/${c}`)));
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
preloadCoreTools() {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
if (this.loaded.has('_coreTools')) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
this.loaded.add('_coreTools');
|
|
91
|
-
yield Promise.all(this.coreTools.map(c => loadScript(`${this.baseUrl}/${c}`)));
|
|
92
|
-
});
|
|
29
|
+
if (this.loaded.has('_core')) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.loaded.add('_core');
|
|
33
|
+
loadScriptSource(editorCoreScript);
|
|
93
34
|
}
|
|
94
35
|
getCustomToolModel(key) {
|
|
95
36
|
var _a;
|
package/dist/api-core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-core.js","sourceRoot":"","sources":["../src/api-core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-core.js","sourceRoot":"","sources":["../src/api-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,MAAM,UAAU,GAAiB;IAC7B,UAAU;QACN,OAAO,EAAE,CAAC;IACd,CAAC;IACD,QAAQ,KAAI,CAAC;IACb,OAAO;QACH,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ,CAAC;AAEF,MAAM,OAAO,cAAc;IAA3B;QACI;;;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