@digipair/skill-web-editor 0.4.25 → 0.4.27
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.cjs2.js
CHANGED
|
@@ -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,11 +3308,11 @@ class GenericSceneElement extends s {
|
|
|
3323
3308
|
}
|
|
3324
3309
|
__decorate([
|
|
3325
3310
|
n(),
|
|
3326
|
-
__metadata("design:type",
|
|
3311
|
+
__metadata("design:type", Object)
|
|
3327
3312
|
], GenericSceneElement.prototype, "digipair", void 0);
|
|
3328
3313
|
__decorate([
|
|
3329
3314
|
n(),
|
|
3330
|
-
__metadata("design:type",
|
|
3315
|
+
__metadata("design:type", Object)
|
|
3331
3316
|
], GenericSceneElement.prototype, "reasoning", void 0);
|
|
3332
3317
|
__decorate([
|
|
3333
3318
|
r()
|
package/index.esm2.js
CHANGED
|
@@ -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,11 +3306,11 @@ class GenericSceneElement extends s {
|
|
|
3321
3306
|
}
|
|
3322
3307
|
__decorate([
|
|
3323
3308
|
n(),
|
|
3324
|
-
__metadata("design:type",
|
|
3309
|
+
__metadata("design:type", Object)
|
|
3325
3310
|
], GenericSceneElement.prototype, "digipair", void 0);
|
|
3326
3311
|
__decorate([
|
|
3327
3312
|
n(),
|
|
3328
|
-
__metadata("design:type",
|
|
3313
|
+
__metadata("design:type", Object)
|
|
3329
3314
|
], GenericSceneElement.prototype, "reasoning", void 0);
|
|
3330
3315
|
__decorate([
|
|
3331
3316
|
r()
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { LitElement, TemplateResult } from 'lit';
|
|
2
2
|
export declare class GenericSceneElement extends LitElement {
|
|
3
|
-
digipair:
|
|
4
|
-
reasoning:
|
|
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;
|