@blocklet/pages-kit 0.2.352 → 0.2.353
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/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Output.js +3 -5
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +2 -3
- package/lib/cjs/components/CustomComponentRenderer/state.js +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Output.js +3 -5
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +2 -3
- package/lib/esm/components/CustomComponentRenderer/state.js +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.d.ts +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -116,7 +116,7 @@ function V0Output() {
|
|
|
116
116
|
onClick: (e) => __awaiter(this, void 0, void 0, function* () {
|
|
117
117
|
var _c;
|
|
118
118
|
const { taskid: taskId } = ((_c = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _c === void 0 ? void 0 : _c.dataset) || {};
|
|
119
|
-
const currentCode = (0, CodePreview_1.getCurrentCodeByTaskId)(message
|
|
119
|
+
const currentCode = (0, CodePreview_1.getCurrentCodeByTaskId)(message);
|
|
120
120
|
try {
|
|
121
121
|
yield (0, CustomComponentRenderer_1.transpileAndLoadScript)(currentCode).then((m) => {
|
|
122
122
|
var _a, _b, _c;
|
|
@@ -183,10 +183,8 @@ function V0Output() {
|
|
|
183
183
|
disabled,
|
|
184
184
|
variant: 'contained',
|
|
185
185
|
color: 'primary',
|
|
186
|
-
onClick: (
|
|
187
|
-
|
|
188
|
-
const { taskid: taskId } = ((_a = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _a === void 0 ? void 0 : _a.dataset) || {};
|
|
189
|
-
setCode((0, CodePreview_1.getCurrentCodeByTaskId)(message, taskId));
|
|
186
|
+
onClick: () => {
|
|
187
|
+
setCode((0, CodePreview_1.getCurrentCodeByTaskId)(message));
|
|
190
188
|
},
|
|
191
189
|
},
|
|
192
190
|
group: 'codePreview',
|
|
@@ -148,9 +148,8 @@ function CodeRenderByMessage({ zoom, message, minHeight = 200, sx, propertiesVal
|
|
|
148
148
|
}
|
|
149
149
|
exports.CodeRenderByMessage = CodeRenderByMessage;
|
|
150
150
|
exports.CodeRenderByMessageMemo = (0, react_2.memo)(CodeRenderByMessage);
|
|
151
|
-
function getCurrentCodeByTaskId(message
|
|
151
|
+
function getCurrentCodeByTaskId(message) {
|
|
152
152
|
var _a, _b, _c;
|
|
153
|
-
|
|
154
|
-
return (_c = (_b = (_a = message === null || message === void 0 ? void 0 : message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b.find((item) => item.taskId === taskId)) === null || _c === void 0 ? void 0 : _c[codeField];
|
|
153
|
+
return (_c = (_b = (_a = message === null || message === void 0 ? void 0 : message.outputs) === null || _a === void 0 ? void 0 : _a.objects) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c[codeField];
|
|
155
154
|
}
|
|
156
155
|
exports.getCurrentCodeByTaskId = getCurrentCodeByTaskId;
|
|
@@ -239,7 +239,7 @@ function useTranspileComponent({ componentId, locale, properties, dev: { default
|
|
|
239
239
|
function transpileAndLoadScript(script) {
|
|
240
240
|
return __awaiter(this, void 0, void 0, function* () {
|
|
241
241
|
const [ts, { createBuiltinModuleTransformer }] = yield Promise.all([
|
|
242
|
-
Promise.resolve().then(() => __importStar(require('typescript'))),
|
|
242
|
+
Promise.resolve().then(() => __importStar(require('typescript'))).then((m) => m.default || m),
|
|
243
243
|
Promise.resolve().then(() => __importStar(require('../../utils/typescript/builtin-module-transformer'))),
|
|
244
244
|
]);
|
|
245
245
|
const compiled = ts.transpileModule(script, {
|