@digipair/skill-web-editor 0.4.26 → 0.4.30
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/index.cjs.js +2 -2
- package/index.cjs2.js +15 -30
- package/index.esm.js +1 -1
- package/index.esm2.js +15 -30
- package/libs/skill-web-editor/src/lib/editor.element.d.ts +3 -5
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -6,9 +6,9 @@ var index = require('./index.cjs2.js');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
Object.defineProperty(exports, '
|
|
9
|
+
Object.defineProperty(exports, 'EditorElement', {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return index.
|
|
11
|
+
get: function () { return index.EditorElement; }
|
|
12
12
|
});
|
|
13
13
|
exports.error = index.error;
|
|
14
14
|
exports.information = index.information;
|
package/index.cjs2.js
CHANGED
|
@@ -3054,7 +3054,7 @@ const Toastify$1 = toastify;
|
|
|
3054
3054
|
const BASE_URL = 'https://cdn.jsdelivr.net/npm';
|
|
3055
3055
|
const BLOCKLY_VERSION = '10.4.3';
|
|
3056
3056
|
let jsonGenerator, generateBlocklyBlockFromLibraries, generateToolboxFromLibraries, initializeMutator;
|
|
3057
|
-
class
|
|
3057
|
+
class EditorElement extends s {
|
|
3058
3058
|
createRenderRoot() {
|
|
3059
3059
|
return this;
|
|
3060
3060
|
}
|
|
@@ -3104,20 +3104,6 @@ class GenericSceneElement extends s {
|
|
|
3104
3104
|
initializeWorkspaceFromPinsAndLibraries(reasoning, this.workspace, this.librariesToLoad);
|
|
3105
3105
|
Blockly.Events.enable();
|
|
3106
3106
|
}
|
|
3107
|
-
async getReasoning(digipair, reasoning) {
|
|
3108
|
-
const response = await fetch(`${window.location.origin}/admin/service-reasoning-read`, {
|
|
3109
|
-
headers: {
|
|
3110
|
-
'content-type': 'application/json'
|
|
3111
|
-
},
|
|
3112
|
-
body: JSON.stringify({
|
|
3113
|
-
digipair,
|
|
3114
|
-
reasoning
|
|
3115
|
-
}),
|
|
3116
|
-
method: 'POST'
|
|
3117
|
-
});
|
|
3118
|
-
const content = await response.json();
|
|
3119
|
-
return content;
|
|
3120
|
-
}
|
|
3121
3107
|
async getLibraries(libraries) {
|
|
3122
3108
|
const list = [
|
|
3123
3109
|
schemas,
|
|
@@ -3126,9 +3112,8 @@ class GenericSceneElement extends s {
|
|
|
3126
3112
|
return list;
|
|
3127
3113
|
}
|
|
3128
3114
|
async loadScene(digipair, reasoning) {
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
this.librariesToLoad = await this.getLibraries(this.reasoningData.libraries);
|
|
3115
|
+
const scene = reasoning;
|
|
3116
|
+
this.librariesToLoad = await this.getLibraries(digipair.libraries);
|
|
3132
3117
|
this.loadBlockly(scene);
|
|
3133
3118
|
if (!scene) {
|
|
3134
3119
|
return;
|
|
@@ -3139,8 +3124,8 @@ class GenericSceneElement extends s {
|
|
|
3139
3124
|
const code = jsonGenerator.workspaceToCode(this.workspace);
|
|
3140
3125
|
try {
|
|
3141
3126
|
this.codeInWorkspace = _extends({
|
|
3142
|
-
|
|
3143
|
-
description: this.
|
|
3127
|
+
name: this.reasoning.name,
|
|
3128
|
+
description: this.reasoning.description
|
|
3144
3129
|
}, JSON.parse(code));
|
|
3145
3130
|
return true;
|
|
3146
3131
|
} catch (e) {
|
|
@@ -3151,8 +3136,8 @@ class GenericSceneElement extends s {
|
|
|
3151
3136
|
if (this.canSave == true) {
|
|
3152
3137
|
this.dispatchEvent(new CustomEvent('save', {
|
|
3153
3138
|
detail: {
|
|
3154
|
-
digipair: this.digipair,
|
|
3155
|
-
reasoning: this.reasoning,
|
|
3139
|
+
digipair: this.digipair.id,
|
|
3140
|
+
reasoning: this.reasoning.id,
|
|
3156
3141
|
value: this.codeInWorkspace
|
|
3157
3142
|
}
|
|
3158
3143
|
}));
|
|
@@ -3323,18 +3308,18 @@ class GenericSceneElement extends s {
|
|
|
3323
3308
|
}
|
|
3324
3309
|
__decorate([
|
|
3325
3310
|
n(),
|
|
3326
|
-
__metadata("design:type",
|
|
3327
|
-
],
|
|
3311
|
+
__metadata("design:type", Object)
|
|
3312
|
+
], EditorElement.prototype, "digipair", void 0);
|
|
3328
3313
|
__decorate([
|
|
3329
3314
|
n(),
|
|
3330
|
-
__metadata("design:type",
|
|
3331
|
-
],
|
|
3315
|
+
__metadata("design:type", Object)
|
|
3316
|
+
], EditorElement.prototype, "reasoning", void 0);
|
|
3332
3317
|
__decorate([
|
|
3333
3318
|
r()
|
|
3334
|
-
],
|
|
3335
|
-
|
|
3319
|
+
], EditorElement.prototype, "canSave", void 0);
|
|
3320
|
+
EditorElement = __decorate([
|
|
3336
3321
|
t('digipair-editor')
|
|
3337
|
-
],
|
|
3322
|
+
], EditorElement);
|
|
3338
3323
|
|
|
3339
3324
|
const Toastify = toastify;
|
|
3340
3325
|
let EditorService = class EditorService {
|
|
@@ -3366,7 +3351,7 @@ let EditorService = class EditorService {
|
|
|
3366
3351
|
const information = (params, pinsSettingsList, context)=>new EditorService().information(params, pinsSettingsList, context);
|
|
3367
3352
|
const error = (params, pinsSettingsList, context)=>new EditorService().error(params, pinsSettingsList, context);
|
|
3368
3353
|
|
|
3369
|
-
exports.
|
|
3354
|
+
exports.EditorElement = EditorElement;
|
|
3370
3355
|
exports._extends = _extends;
|
|
3371
3356
|
exports.error = error;
|
|
3372
3357
|
exports.information = information;
|
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { E as EditorElement, e as error, i as information } from './index.esm2.js';
|
package/index.esm2.js
CHANGED
|
@@ -3052,7 +3052,7 @@ const Toastify$1 = toastify;
|
|
|
3052
3052
|
const BASE_URL = 'https://cdn.jsdelivr.net/npm';
|
|
3053
3053
|
const BLOCKLY_VERSION = '10.4.3';
|
|
3054
3054
|
let jsonGenerator, generateBlocklyBlockFromLibraries, generateToolboxFromLibraries, initializeMutator;
|
|
3055
|
-
class
|
|
3055
|
+
class EditorElement extends s {
|
|
3056
3056
|
createRenderRoot() {
|
|
3057
3057
|
return this;
|
|
3058
3058
|
}
|
|
@@ -3102,20 +3102,6 @@ class GenericSceneElement extends s {
|
|
|
3102
3102
|
initializeWorkspaceFromPinsAndLibraries(reasoning, this.workspace, this.librariesToLoad);
|
|
3103
3103
|
Blockly.Events.enable();
|
|
3104
3104
|
}
|
|
3105
|
-
async getReasoning(digipair, reasoning) {
|
|
3106
|
-
const response = await fetch(`${window.location.origin}/admin/service-reasoning-read`, {
|
|
3107
|
-
headers: {
|
|
3108
|
-
'content-type': 'application/json'
|
|
3109
|
-
},
|
|
3110
|
-
body: JSON.stringify({
|
|
3111
|
-
digipair,
|
|
3112
|
-
reasoning
|
|
3113
|
-
}),
|
|
3114
|
-
method: 'POST'
|
|
3115
|
-
});
|
|
3116
|
-
const content = await response.json();
|
|
3117
|
-
return content;
|
|
3118
|
-
}
|
|
3119
3105
|
async getLibraries(libraries) {
|
|
3120
3106
|
const list = [
|
|
3121
3107
|
schemas,
|
|
@@ -3124,9 +3110,8 @@ class GenericSceneElement extends s {
|
|
|
3124
3110
|
return list;
|
|
3125
3111
|
}
|
|
3126
3112
|
async loadScene(digipair, reasoning) {
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
this.librariesToLoad = await this.getLibraries(this.reasoningData.libraries);
|
|
3113
|
+
const scene = reasoning;
|
|
3114
|
+
this.librariesToLoad = await this.getLibraries(digipair.libraries);
|
|
3130
3115
|
this.loadBlockly(scene);
|
|
3131
3116
|
if (!scene) {
|
|
3132
3117
|
return;
|
|
@@ -3137,8 +3122,8 @@ class GenericSceneElement extends s {
|
|
|
3137
3122
|
const code = jsonGenerator.workspaceToCode(this.workspace);
|
|
3138
3123
|
try {
|
|
3139
3124
|
this.codeInWorkspace = _extends({
|
|
3140
|
-
|
|
3141
|
-
description: this.
|
|
3125
|
+
name: this.reasoning.name,
|
|
3126
|
+
description: this.reasoning.description
|
|
3142
3127
|
}, JSON.parse(code));
|
|
3143
3128
|
return true;
|
|
3144
3129
|
} catch (e) {
|
|
@@ -3149,8 +3134,8 @@ class GenericSceneElement extends s {
|
|
|
3149
3134
|
if (this.canSave == true) {
|
|
3150
3135
|
this.dispatchEvent(new CustomEvent('save', {
|
|
3151
3136
|
detail: {
|
|
3152
|
-
digipair: this.digipair,
|
|
3153
|
-
reasoning: this.reasoning,
|
|
3137
|
+
digipair: this.digipair.id,
|
|
3138
|
+
reasoning: this.reasoning.id,
|
|
3154
3139
|
value: this.codeInWorkspace
|
|
3155
3140
|
}
|
|
3156
3141
|
}));
|
|
@@ -3321,18 +3306,18 @@ class GenericSceneElement extends s {
|
|
|
3321
3306
|
}
|
|
3322
3307
|
__decorate([
|
|
3323
3308
|
n(),
|
|
3324
|
-
__metadata("design:type",
|
|
3325
|
-
],
|
|
3309
|
+
__metadata("design:type", Object)
|
|
3310
|
+
], EditorElement.prototype, "digipair", void 0);
|
|
3326
3311
|
__decorate([
|
|
3327
3312
|
n(),
|
|
3328
|
-
__metadata("design:type",
|
|
3329
|
-
],
|
|
3313
|
+
__metadata("design:type", Object)
|
|
3314
|
+
], EditorElement.prototype, "reasoning", void 0);
|
|
3330
3315
|
__decorate([
|
|
3331
3316
|
r()
|
|
3332
|
-
],
|
|
3333
|
-
|
|
3317
|
+
], EditorElement.prototype, "canSave", void 0);
|
|
3318
|
+
EditorElement = __decorate([
|
|
3334
3319
|
t('digipair-editor')
|
|
3335
|
-
],
|
|
3320
|
+
], EditorElement);
|
|
3336
3321
|
|
|
3337
3322
|
const Toastify = toastify;
|
|
3338
3323
|
let EditorService = class EditorService {
|
|
@@ -3364,4 +3349,4 @@ let EditorService = class EditorService {
|
|
|
3364
3349
|
const information = (params, pinsSettingsList, context)=>new EditorService().information(params, pinsSettingsList, context);
|
|
3365
3350
|
const error = (params, pinsSettingsList, context)=>new EditorService().error(params, pinsSettingsList, context);
|
|
3366
3351
|
|
|
3367
|
-
export {
|
|
3352
|
+
export { EditorElement as E, _extends as _, error as e, information as i };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
-
export declare class
|
|
3
|
-
digipair:
|
|
4
|
-
reasoning:
|
|
2
|
+
export declare class EditorElement extends LitElement {
|
|
3
|
+
digipair: any;
|
|
4
|
+
reasoning: any;
|
|
5
5
|
private canSave;
|
|
6
|
-
private reasoningData;
|
|
7
6
|
private workspace;
|
|
8
7
|
private blocks;
|
|
9
8
|
private toolbox;
|
|
@@ -13,7 +12,6 @@ export declare class GenericSceneElement extends LitElement {
|
|
|
13
12
|
connectedCallback(): void;
|
|
14
13
|
private initialize;
|
|
15
14
|
private loadReasoning;
|
|
16
|
-
private getReasoning;
|
|
17
15
|
private getLibraries;
|
|
18
16
|
private loadScene;
|
|
19
17
|
private verifyCanSaveAndGetCode;
|