@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.
@@ -111,7 +111,7 @@ export default function V0Output() {
111
111
  onClick: (e) => __awaiter(this, void 0, void 0, function* () {
112
112
  var _c;
113
113
  const { taskid: taskId } = ((_c = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _c === void 0 ? void 0 : _c.dataset) || {};
114
- const currentCode = getCurrentCodeByTaskId(message, taskId);
114
+ const currentCode = getCurrentCodeByTaskId(message);
115
115
  try {
116
116
  yield transpileAndLoadScript(currentCode).then((m) => {
117
117
  var _a, _b, _c;
@@ -178,10 +178,8 @@ export default function V0Output() {
178
178
  disabled,
179
179
  variant: 'contained',
180
180
  color: 'primary',
181
- onClick: (e) => {
182
- var _a;
183
- const { taskid: taskId } = ((_a = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _a === void 0 ? void 0 : _a.dataset) || {};
184
- setCode(getCurrentCodeByTaskId(message, taskId));
181
+ onClick: () => {
182
+ setCode(getCurrentCodeByTaskId(message));
185
183
  },
186
184
  },
187
185
  group: 'codePreview',
@@ -140,8 +140,7 @@ export function CodeRenderByMessage({ zoom, message, minHeight = 200, sx, proper
140
140
  } }), children: _jsx(ContentRender, {}) }, message === null || message === void 0 ? void 0 : message.id));
141
141
  }
142
142
  export const CodeRenderByMessageMemo = memo(CodeRenderByMessage);
143
- export function getCurrentCodeByTaskId(message, taskId) {
143
+ export function getCurrentCodeByTaskId(message) {
144
144
  var _a, _b, _c;
145
- // @ts-ignore
146
- 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];
145
+ 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];
147
146
  }
@@ -208,7 +208,7 @@ function useTranspileComponent({ componentId, locale, properties, dev: { default
208
208
  export function transpileAndLoadScript(script) {
209
209
  return __awaiter(this, void 0, void 0, function* () {
210
210
  const [ts, { createBuiltinModuleTransformer }] = yield Promise.all([
211
- import('typescript'),
211
+ import('typescript').then((m) => m.default || m),
212
212
  import('../../utils/typescript/builtin-module-transformer'),
213
213
  ]);
214
214
  const compiled = ts.transpileModule(script, {