@cesdk/engine 1.68.0-nightly.20260123 → 1.68.0-rc.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/.browserslistrc +8 -0
- package/angular/index.d.ts +38 -0
- package/angular/index.js +146 -0
- package/assets/core/{cesdk-v1.68.0-nightly.20260123-2BTUQ2I7.wasm → cesdk-v1.68.0-rc.0-XJEVETUW.wasm} +0 -0
- package/assets/core/{worker-host-v1.68.0-nightly.20260123.js → worker-host-v1.68.0-rc.0.js} +1 -1
- package/cesdk.umd.js +1 -0
- package/index.d.ts +2 -2
- package/index.html +152 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +115 -0
- package/react/index.js +1 -0
- package/vue/index.d.ts +162 -0
- package/vue/index.js +1 -0
- /package/assets/core/{cesdk-v1.68.0-nightly.20260123-MLEZSZ4D.data → cesdk-v1.68.0-rc.0-MLEZSZ4D.data} +0 -0
package/.browserslistrc
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { AfterViewInit, OnDestroy, OnChanges, ElementRef, SimpleChanges } from '@angular/core';
|
|
3
|
+
import CreativeEditorSDK, { Configuration } from '@cesdk/cesdk-js';
|
|
4
|
+
|
|
5
|
+
interface CreativeEditorError {
|
|
6
|
+
message: string;
|
|
7
|
+
cause?: unknown;
|
|
8
|
+
}
|
|
9
|
+
type CreativeEditorLoadingState = 'idle' | 'loading' | 'loaded' | 'error';
|
|
10
|
+
declare class CreativeEditor implements AfterViewInit, OnDestroy, OnChanges {
|
|
11
|
+
containerRef: ElementRef<HTMLDivElement>;
|
|
12
|
+
config: Configuration;
|
|
13
|
+
init?: (cesdk: CreativeEditorSDK) => void | Promise<void>;
|
|
14
|
+
width: number | string;
|
|
15
|
+
height: number | string;
|
|
16
|
+
className?: string;
|
|
17
|
+
onLoadingStateChange?: (state: CreativeEditorLoadingState) => void;
|
|
18
|
+
onError?: (error: CreativeEditorError) => void;
|
|
19
|
+
private instance;
|
|
20
|
+
private loadingState;
|
|
21
|
+
private isInitializing;
|
|
22
|
+
ngAfterViewInit(): Promise<void>;
|
|
23
|
+
ngOnChanges(changes: SimpleChanges): Promise<void>;
|
|
24
|
+
ngOnDestroy(): void;
|
|
25
|
+
private handleLoadingStateChange;
|
|
26
|
+
private handleError;
|
|
27
|
+
private validateConfig;
|
|
28
|
+
private validateInit;
|
|
29
|
+
private initializeEditor;
|
|
30
|
+
private reinitializeEditor;
|
|
31
|
+
private destroyEditor;
|
|
32
|
+
getEditorInstance(): CreativeEditorSDK | null;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CreativeEditor, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CreativeEditor, "creative-editor", never, { "config": { "alias": "config"; "required": false; }; "init": { "alias": "init"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "className": { "alias": "className"; "required": false; }; "onLoadingStateChange": { "alias": "onLoadingStateChange"; "required": false; }; "onError": { "alias": "onError"; "required": false; }; }, {}, never, never, true, never>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { CreativeEditor };
|
|
38
|
+
export type { CreativeEditorError, CreativeEditorLoadingState };
|
package/angular/index.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Input, ViewChild, Component } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
class CreativeEditor {
|
|
6
|
+
containerRef;
|
|
7
|
+
config;
|
|
8
|
+
init;
|
|
9
|
+
width = '100%';
|
|
10
|
+
height = '100%';
|
|
11
|
+
className;
|
|
12
|
+
onLoadingStateChange;
|
|
13
|
+
onError;
|
|
14
|
+
instance = null;
|
|
15
|
+
loadingState = 'idle';
|
|
16
|
+
isInitializing = false;
|
|
17
|
+
async ngAfterViewInit() {
|
|
18
|
+
await this.initializeEditor();
|
|
19
|
+
}
|
|
20
|
+
async ngOnChanges(changes) {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
22
|
+
if (changes['config'] && !changes['config'].firstChange) {
|
|
23
|
+
await this.reinitializeEditor();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
ngOnDestroy() {
|
|
27
|
+
this.destroyEditor();
|
|
28
|
+
}
|
|
29
|
+
handleLoadingStateChange(state) {
|
|
30
|
+
this.loadingState = state;
|
|
31
|
+
this.onLoadingStateChange?.(state);
|
|
32
|
+
}
|
|
33
|
+
handleError(errorMessage, cause) {
|
|
34
|
+
const editorError = {
|
|
35
|
+
message: errorMessage,
|
|
36
|
+
cause,
|
|
37
|
+
};
|
|
38
|
+
this.handleLoadingStateChange('error');
|
|
39
|
+
this.onError?.(editorError);
|
|
40
|
+
}
|
|
41
|
+
validateConfig(cfg) {
|
|
42
|
+
if (!cfg || typeof cfg !== 'object') {
|
|
43
|
+
throw new Error('Configuration must be a valid object');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
validateInit(initFn) {
|
|
47
|
+
if (initFn && typeof initFn !== 'function') {
|
|
48
|
+
throw new Error('Init must be a valid function');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async initializeEditor() {
|
|
52
|
+
if (this.isInitializing || this.loadingState !== 'idle' || this.instance) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.isInitializing = true;
|
|
56
|
+
try {
|
|
57
|
+
this.handleLoadingStateChange('loading');
|
|
58
|
+
this.validateConfig(this.config);
|
|
59
|
+
this.validateInit(this.init);
|
|
60
|
+
const CreativeEditorSDKModule = (await import('@cesdk/cesdk-js')).default;
|
|
61
|
+
this.instance = await CreativeEditorSDKModule.create(this.containerRef.nativeElement, this.config);
|
|
62
|
+
this.handleLoadingStateChange('loaded');
|
|
63
|
+
if (this.init) {
|
|
64
|
+
try {
|
|
65
|
+
await this.init(this.instance);
|
|
66
|
+
}
|
|
67
|
+
catch (initError) {
|
|
68
|
+
this.handleError('Initialization function failed', initError);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (creationError) {
|
|
73
|
+
this.handleError('Failed to create Creative Editor SDK instance', creationError);
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
this.isInitializing = false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async reinitializeEditor() {
|
|
80
|
+
this.destroyEditor();
|
|
81
|
+
await this.initializeEditor();
|
|
82
|
+
}
|
|
83
|
+
destroyEditor() {
|
|
84
|
+
if (this.instance) {
|
|
85
|
+
try {
|
|
86
|
+
this.instance.dispose();
|
|
87
|
+
}
|
|
88
|
+
catch (cleanupError) {
|
|
89
|
+
this.handleError('Error during CreativeEditor cleanup', cleanupError);
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
this.instance = null;
|
|
93
|
+
this.handleLoadingStateChange('idle');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
getEditorInstance() {
|
|
98
|
+
return this.instance;
|
|
99
|
+
}
|
|
100
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: CreativeEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
101
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: CreativeEditor, isStandalone: true, selector: "creative-editor", inputs: { config: "config", init: "init", width: "width", height: "height", className: "className", onLoadingStateChange: "onLoadingStateChange", onError: "onError" }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["cesdk_container"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
102
|
+
<div
|
|
103
|
+
#cesdk_container
|
|
104
|
+
[style.width]="width"
|
|
105
|
+
[style.height]="height"
|
|
106
|
+
[class]="className"
|
|
107
|
+
data-testid="creative-editor-container"
|
|
108
|
+
></div>
|
|
109
|
+
`, isInline: true, styles: [":host{display:block;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
110
|
+
}
|
|
111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: CreativeEditor, decorators: [{
|
|
112
|
+
type: Component,
|
|
113
|
+
args: [{ selector: 'creative-editor', standalone: true, imports: [CommonModule], template: `
|
|
114
|
+
<div
|
|
115
|
+
#cesdk_container
|
|
116
|
+
[style.width]="width"
|
|
117
|
+
[style.height]="height"
|
|
118
|
+
[class]="className"
|
|
119
|
+
data-testid="creative-editor-container"
|
|
120
|
+
></div>
|
|
121
|
+
`, styles: [":host{display:block;position:relative}\n"] }]
|
|
122
|
+
}], propDecorators: { containerRef: [{
|
|
123
|
+
type: ViewChild,
|
|
124
|
+
args: ['cesdk_container', { static: true }]
|
|
125
|
+
}], config: [{
|
|
126
|
+
type: Input
|
|
127
|
+
}], init: [{
|
|
128
|
+
type: Input
|
|
129
|
+
}], width: [{
|
|
130
|
+
type: Input
|
|
131
|
+
}], height: [{
|
|
132
|
+
type: Input
|
|
133
|
+
}], className: [{
|
|
134
|
+
type: Input
|
|
135
|
+
}], onLoadingStateChange: [{
|
|
136
|
+
type: Input
|
|
137
|
+
}], onError: [{
|
|
138
|
+
type: Input
|
|
139
|
+
}] } });
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Generated bundle index. Do not edit.
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
export { CreativeEditor };
|
|
146
|
+
//# sourceMappingURL=cesdk-angular.mjs.map
|