@rxdrag/website-studio 0.0.45 → 0.0.47

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.
Files changed (37) hide show
  1. package/dist/components/StatusBar/TaskManger.d.ts +1 -0
  2. package/dist/components/StatusBar/TaskTable.d.ts +1 -0
  3. package/dist/{cssMode-8a633359.js → cssMode-f01e76a3.js} +3 -3
  4. package/dist/{cssMode-8a633359.js.map → cssMode-f01e76a3.js.map} +1 -1
  5. package/dist/{freemarker2-160c0ddc.js → freemarker2-150b7f6f.js} +3 -3
  6. package/dist/{freemarker2-160c0ddc.js.map → freemarker2-150b7f6f.js.map} +1 -1
  7. package/dist/{handlebars-b83294de.js → handlebars-db028e5f.js} +3 -3
  8. package/dist/{handlebars-b83294de.js.map → handlebars-db028e5f.js.map} +1 -1
  9. package/dist/hooks/useTranslateTheme.d.ts +1 -1
  10. package/dist/{html-e465efce.js → html-88b581e7.js} +3 -3
  11. package/dist/{html-e465efce.js.map → html-88b581e7.js.map} +1 -1
  12. package/dist/{htmlMode-fed923b3.js → htmlMode-beb480ee.js} +3 -3
  13. package/dist/{htmlMode-fed923b3.js.map → htmlMode-beb480ee.js.map} +1 -1
  14. package/dist/{index-6ddf2099.js → index-f82df144.js} +328 -45
  15. package/dist/{index-6ddf2099.js.map → index-f82df144.js.map} +1 -1
  16. package/dist/index.mjs +2 -2
  17. package/dist/{javascript-a1dcfc76.js → javascript-ae528407.js} +4 -4
  18. package/dist/{javascript-a1dcfc76.js.map → javascript-ae528407.js.map} +1 -1
  19. package/dist/{jsonMode-92034391.js → jsonMode-b53dd865.js} +3 -3
  20. package/dist/{jsonMode-92034391.js.map → jsonMode-b53dd865.js.map} +1 -1
  21. package/dist/{liquid-8e298ea5.js → liquid-f0927f78.js} +3 -3
  22. package/dist/{liquid-8e298ea5.js.map → liquid-f0927f78.js.map} +1 -1
  23. package/dist/{mdx-65c6fe0f.js → mdx-f143f913.js} +3 -3
  24. package/dist/{mdx-65c6fe0f.js.map → mdx-f143f913.js.map} +1 -1
  25. package/dist/{python-55e87814.js → python-aa6deb94.js} +3 -3
  26. package/dist/{python-55e87814.js.map → python-aa6deb94.js.map} +1 -1
  27. package/dist/{razor-34386182.js → razor-3120b1d8.js} +3 -3
  28. package/dist/{razor-34386182.js.map → razor-3120b1d8.js.map} +1 -1
  29. package/dist/{tsMode-67ddf297.js → tsMode-5445108e.js} +3 -3
  30. package/dist/{tsMode-67ddf297.js.map → tsMode-5445108e.js.map} +1 -1
  31. package/dist/{typescript-48be5bbc.js → typescript-2c76a3d1.js} +3 -3
  32. package/dist/{typescript-48be5bbc.js.map → typescript-2c76a3d1.js.map} +1 -1
  33. package/dist/{xml-1520dcee.js → xml-ee85ffe4.js} +3 -3
  34. package/dist/{xml-1520dcee.js.map → xml-ee85ffe4.js.map} +1 -1
  35. package/dist/{yaml-b01c807c.js → yaml-2503ced6.js} +3 -3
  36. package/dist/{yaml-b01c807c.js.map → yaml-2503ced6.js.map} +1 -1
  37. package/package.json +17 -17
@@ -7,8 +7,8 @@ var __publicField = (obj, key2, value) => {
7
7
  var _a, _b, _c, _d, _e, _f, _g, _h, _i2, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$2, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa;
8
8
  import * as React from "react";
9
9
  import React__default, { createContext, useContext, useMemo, memo, useEffect, useCallback, useState, useRef, forwardRef as forwardRef$2, Component, useImperativeHandle, isValidElement, cloneElement } from "react";
10
- import { ThemeFields, PageQueryOptions, PageFields, FrontComponentQueryOptions, FrontComponentFields, ComponentCategoryFields, SectionTemplateQueryOptions, SectionTemplateFields, ComponentCategoryQueryOptions, TemplateCategoryQueryOptions, TemplateCategoryFields, ThemeQueryOptions, StyleConfigFields, LangFields, ThemeConfigQueryOptions, ThemeConfigFields, PageAssciations, PageType, ProductCategoryEntityName, ProductCategoryQueryOptions, ProductCategoryFields, ProductQueryOptions, ProductFields, PublishableStatus, websiteToInput, TaskOwner, LangQueryOptions, WebsiteAssciations, ExtendFieldType, ThemeConfigAssciations, MediaQueryOptions, WebsiteSettingsQueryOptions, WebsiteSettingsFields, themeConfigToInputCascade, ThemeConfigEntityName, MediaType, themeConfigToInput, websiteSettingsToInput, WebsiteSettingsEntityName, WebsiteSettingsAssciations, PageEntityName, ThemeEntityName, themeToInputCascade, ThemeCategoryFields, themeToInput, frontComponentToInput, sectionTemplateToInput, pageToInputCascade, ComponentCategoryEntityName, SectionTemplateEntityName, FrontComponentEntityName, PageMetaFields, pageToInput, PageMetaAssciations, componentCategoryToInput, TemplateCategoryEntityName, templateCategoryToInput } from "@rxdrag/rxcms-models";
11
- import { GlobalLoading, EntityForm, SubmitButton, useListData, SearchInput, EntityPagination, useIsLoading, QueryListScope, useRemoveRow, useEditRow, EntityEditModal, useSelectionsState, EntityTable, EntityListScope, NewButton, EntityRowScope, EntitySelectField, useNewRow } from "@rxdrag/rxcms-models-ui";
10
+ import { ThemeFields, PageQueryOptions, PageFields, FrontComponentQueryOptions, FrontComponentFields, ComponentCategoryFields, SectionTemplateQueryOptions, SectionTemplateFields, ComponentCategoryQueryOptions, TemplateCategoryQueryOptions, TemplateCategoryFields, ThemeQueryOptions, StyleConfigFields, LangFields, ThemeConfigQueryOptions, ThemeConfigFields, PageAssciations, PageType, ProductCategoryEntityName, ProductCategoryQueryOptions, ProductCategoryFields, ProductQueryOptions, ProductFields, PublishableStatus, websiteToInput, LangQueryOptions, WebsiteAssciations, ExtendFieldType, ThemeConfigAssciations, MediaQueryOptions, WebsiteSettingsQueryOptions, WebsiteSettingsFields, themeConfigToInputCascade, ThemeConfigEntityName, MediaType, themeConfigToInput, websiteSettingsToInput, WebsiteSettingsEntityName, WebsiteSettingsAssciations, PageEntityName, ThemeEntityName, themeToInputCascade, ThemeCategoryFields, themeToInput, frontComponentToInput, sectionTemplateToInput, pageToInputCascade, ComponentCategoryEntityName, SectionTemplateEntityName, FrontComponentEntityName, UserFields, TaskQueryOptions, TaskFields, AppModule, PageMetaFields, pageToInput, PageMetaAssciations, componentCategoryToInput, TemplateCategoryEntityName, templateCategoryToInput } from "@rxdrag/rxcms-models";
11
+ import { GlobalLoading, EntityForm, SubmitButton, useListData, SearchInput, EntityPagination, useIsLoading, QueryListScope, EditButton, RemoveButton, EntityTable, useRemoveRow, useEditRow, EntityEditModal, useSelectionsState, EntityListScope, NewButton, EntityRowScope, EntitySelectField, useNewRow } from "@rxdrag/rxcms-models-ui";
12
12
  import { useOneTheme, usePageList, useTemplateCategoryList, useSectionTemplateList, useComponentCategoryList, useFrontComponentList, useOneThemeById, useUpsertOneWebsite, useDeleteThemeById, useUpsertOneTheme, useLangList, useOneWebsiteSettings, useOneThemeConfig, useUpsertOneThemeConfig, useUpsertOneWebsiteSettings, useUpsertOnePage, useUpsertOneFrontComponent, useUpsertOneSectionTemplate, useDeletePageById } from "@rxdrag/rxcms-model-hooks";
13
13
  import { newPageMetaOptions, useWebsite, useCurrentLang, ComponentType, currentLangState, useCurrentLangId, MediaSingleSelectField, FullImageSelectField, useSiteId, usePreviewUrl, LangSelect, TitleAndSlug, TitleViewField, DescriptionViewField, SiteRoot } from "@rxdrag/biz-components";
14
14
  import { parseExpressionValue, isExpression, extractVariables, compileCode, AsyncFunction, transformCodeToSchema, transformSchemaToCode } from "@rxdrag/astro-compiler";
@@ -20,7 +20,7 @@ import { isHTMLElement as isHTMLElement$1, isStr } from "@rxdrag/shared";
20
20
  import { isFunction as isFunction$2, debounce, keys, uniqueId } from "lodash-es";
21
21
  import { useEntifyEndpoint, useEntifyToken, useLazyQueryEntityList, useLazyQueryOneEntity, emitEntityChange, useCreateEntityClient } from "@rxdrag/entify-hooks";
22
22
  import dayjs from "dayjs";
23
- import { ErrorBoundary, ColorPicker, useSave, CheckCircleIcon as CheckCircleIcon$1, CloseIcon, ModalBody, AddIcon as AddIcon$1, AiStarIcon, ConfirmDialog, SettingsIcon, ModalFooter, FavouriteIcon, LightIcon, DarkIcon, EditIcon, TextInput, Drawer, ModalHeader, ModalClose, SearchIcon, ModalContent as ModalContent$1, Modal as Modal$1, ModalOverlay as ModalOverlay$1, MonacoEditor, getTheFile, MoreIcon, LanguageIcon, SeoIcon, AiIcon, SettingsMinimalisticIcon, CodeSquareIcon, DownloadIcon, UploadIcon, StyledTooltip, PlayIcon, Logo, GlobalIcon, SnsIcon, LightBoltIcon, WarningIcon, PinIcon, PredefinedColorPicker, PagesIcon, WidgetIcon, LeafNode, GroupNode, TreeView, DesignIcon, RemoveIcon, ResetIcon, TaskStopIcon, ImportIcon, AstroIcon, AddFolderIcon, TemplateIcon, AddTemplateIcon } from "@rxdrag/rxcms-common";
23
+ import { ErrorBoundary, ColorPicker, useSave, CheckCircleIcon as CheckCircleIcon$1, CloseIcon, ModalBody, AddIcon as AddIcon$1, AiStarIcon, ConfirmDialog, SettingsIcon, ModalFooter, FavouriteIcon, LightIcon, DarkIcon, EditIcon, TextInput, Drawer, ModalHeader, ModalClose, SearchIcon, ModalContent as ModalContent$1, Modal as Modal$1, ModalOverlay as ModalOverlay$1, MonacoEditor, getTheFile, MoreIcon, LanguageIcon, SeoIcon, AiIcon, SettingsMinimalisticIcon, CodeSquareIcon, DownloadIcon, UploadIcon, StyledTooltip, PlayIcon, Logo, GlobalIcon, SnsIcon, LightBoltIcon, TaskIcon, WarningIcon, PinIcon, PredefinedColorPicker, PagesIcon, WidgetIcon, LeafNode, GroupNode, TreeView, DesignIcon, RemoveIcon, ResetIcon, TaskStopIcon, ImportIcon, AstroIcon, AddFolderIcon, TemplateIcon, AddTemplateIcon } from "@rxdrag/rxcms-common";
24
24
  import { PageLoader, PopoverController, ModalController, AnimateController, TabsController, NumberController, FlipController, CollapseController, AosController } from "@rxdrag/website-lib-core";
25
25
  import gsap$2 from "gsap";
26
26
  import { Input, Textarea, StringArrayInput, ImageSelect, TargetSetter, propSetters, DeviceBreakpoints, DeviceContext } from "@rxdrag/schema-setters";
@@ -38,8 +38,8 @@ import { motion, AnimatePresence, LazyMotion, m } from "framer-motion";
38
38
  import $4AOtR$reactdom, { createPortal } from "react-dom";
39
39
  import { DeployType, useExportWebsite as useExportWebsite$1 } from "@rxdrag/code-generator";
40
40
  import { ComponentRender } from "@rxdrag/react-runner-pro";
41
- import { TaskManager, useInprogressTaskByKey, useUpdateTask, taskPool, ResetPageTask, ImportPagesTask, ImportComponentsTask } from "@rxdrag/ai-tasks";
42
41
  import tinycolor from "tinycolor2";
42
+ import { useInprogressTaskByKey, useUpdateTask, taskPool, ResetPageTask, ImportPagesTask, ImportComponentsTask } from "@rxdrag/ai-tasks";
43
43
  var jsxRuntime = { exports: {} };
44
44
  var reactJsxRuntime_production_min = {};
45
45
  /**
@@ -6676,18 +6676,76 @@ function useTranslateTheme() {
6676
6676
  const website = useWebsite();
6677
6677
  const translate = useCallback(
6678
6678
  async (langId, title) => {
6679
- if (!token || !(website == null ? void 0 : website.id)) {
6680
- console.error("No token or website id");
6681
- return;
6679
+ var _a3, _b3;
6680
+ if (!(langId == null ? void 0 : langId.trim())) {
6681
+ throw new Error("语言ID不能为空");
6682
+ }
6683
+ if (!(title == null ? void 0 : title.trim())) {
6684
+ throw new Error("标题不能为空");
6685
+ }
6686
+ if (!token) {
6687
+ throw new Error("用户未登录或token已过期");
6688
+ }
6689
+ if (!(website == null ? void 0 : website.id)) {
6690
+ throw new Error("未找到网站信息");
6691
+ }
6692
+ if (!baseURL) {
6693
+ throw new Error("AI服务URL未配置");
6694
+ }
6695
+ try {
6696
+ const http = createHttpClient({ baseURL, token });
6697
+ const response = await http.post("/api/studio/translate-theme", {
6698
+ websiteId: website.id,
6699
+ langId: langId.trim(),
6700
+ title: title.trim()
6701
+ });
6702
+ console.log("翻译主题成功:", response);
6703
+ return response;
6704
+ } catch (error) {
6705
+ const isErrorObject = (err) => {
6706
+ return typeof err === "object" && err !== null;
6707
+ };
6708
+ if (isErrorObject(error) && (error.code === "NETWORK_ERROR" || ((_a3 = error.message) == null ? void 0 : _a3.includes("fetch")))) {
6709
+ console.error("翻译主题网络错误:", error);
6710
+ throw new Error("网络连接失败,请检查网络连接");
6711
+ }
6712
+ if (isErrorObject(error) && ((_b3 = error.response) == null ? void 0 : _b3.status)) {
6713
+ const status2 = error.response.status;
6714
+ let errorMsg2 = "翻译请求失败";
6715
+ switch (status2) {
6716
+ case 400:
6717
+ errorMsg2 = "请求参数错误";
6718
+ break;
6719
+ case 401:
6720
+ errorMsg2 = "认证失败,请重新登录";
6721
+ break;
6722
+ case 403:
6723
+ errorMsg2 = "没有权限执行此操作";
6724
+ break;
6725
+ case 404:
6726
+ errorMsg2 = "翻译服务不存在";
6727
+ break;
6728
+ case 429:
6729
+ errorMsg2 = "请求过于频繁,请稍后再试";
6730
+ break;
6731
+ case 500:
6732
+ errorMsg2 = "服务器内部错误";
6733
+ break;
6734
+ case 502:
6735
+ case 503:
6736
+ case 504:
6737
+ errorMsg2 = "服务暂时不可用,请稍后再试";
6738
+ break;
6739
+ default:
6740
+ errorMsg2 = `请求失败 (${status2})`;
6741
+ }
6742
+ console.error("翻译主题HTTP错误:", { status: status2, error });
6743
+ throw new Error(errorMsg2);
6744
+ }
6745
+ const errorMsg = isErrorObject(error) && error.message ? error.message : "翻译过程中发生未知错误";
6746
+ console.error("翻译主题未知错误:", error);
6747
+ throw new Error(errorMsg);
6682
6748
  }
6683
- const http = createHttpClient({ baseURL, token });
6684
- const response = await http.post("/api/translate-theme", {
6685
- websiteId: website == null ? void 0 : website.id,
6686
- langId,
6687
- title,
6688
- taskOwnerType: TaskOwner.Studio
6689
- });
6690
- console.log("translate response", response);
6691
6749
  },
6692
6750
  [baseURL, token, website == null ? void 0 : website.id]
6693
6751
  );
@@ -6763,6 +6821,7 @@ function MultiLangPanel() {
6763
6821
  const [linkType, setLinkType] = useState("subdomain");
6764
6822
  const [confirmOpen, setConfirmOpen] = useState(false);
6765
6823
  const [currentLangId, setCurrentLangId] = useCurrentLangId();
6824
+ const setError = useEntifyWrapperStore((state) => state.setGlobalError);
6766
6825
  const selectedContent = useStudioStore((state) => state.selectedContent);
6767
6826
  const setSelectedContent = useStudioStore(
6768
6827
  (state) => state.setSelectedContent
@@ -6862,16 +6921,22 @@ function MultiLangPanel() {
6862
6921
  const handleCloseConfirm = useCallback(() => {
6863
6922
  setConfirmOpen(false);
6864
6923
  }, []);
6865
- const handleConfirm = useCallback(() => {
6924
+ const handleConfirm = useCallback(async () => {
6866
6925
  var _a4;
6867
6926
  if (!currentLangId) {
6868
6927
  console.error("No currentLang");
6869
6928
  return;
6870
6929
  }
6871
- const lang = (_a4 = allLangs == null ? void 0 : allLangs.items) == null ? void 0 : _a4.find((lang2) => lang2.id === currentLangId);
6872
- const title = `网站代码翻译到:${(lang == null ? void 0 : lang.cnName) || (lang == null ? void 0 : lang.enName) || (lang == null ? void 0 : lang.localName) || (lang == null ? void 0 : lang.abbr) || ""}`;
6873
- translateTheme(currentLangId, title);
6874
- }, [translateTheme, currentLangId, allLangs == null ? void 0 : allLangs.items]);
6930
+ try {
6931
+ const lang = (_a4 = allLangs == null ? void 0 : allLangs.items) == null ? void 0 : _a4.find((lang2) => lang2.id === currentLangId);
6932
+ const title = `网站代码翻译到:${(lang == null ? void 0 : lang.cnName) || (lang == null ? void 0 : lang.enName) || (lang == null ? void 0 : lang.localName) || (lang == null ? void 0 : lang.abbr) || ""}`;
6933
+ await translateTheme(currentLangId, title);
6934
+ } catch (error) {
6935
+ console.error("翻译主题失败:", error);
6936
+ const errorString = error instanceof Error ? error.message : String(error);
6937
+ setError(errorString);
6938
+ }
6939
+ }, [currentLangId, allLangs == null ? void 0 : allLangs.items, translateTheme, setError]);
6875
6940
  const isRunning = false;
6876
6941
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
6877
6942
  /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: "flex-1 p-4 min-h-0 overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-4", children: [
@@ -138223,7 +138288,7 @@ registerLanguage({
138223
138288
  aliases: ["FreeMarker2", "Apache FreeMarker2"],
138224
138289
  loader: () => {
138225
138290
  {
138226
- return import("./freemarker2-160c0ddc.js").then((m2) => m2.TagAutoInterpolationDollar);
138291
+ return import("./freemarker2-150b7f6f.js").then((m2) => m2.TagAutoInterpolationDollar);
138227
138292
  }
138228
138293
  }
138229
138294
  });
@@ -138232,7 +138297,7 @@ registerLanguage({
138232
138297
  aliases: ["FreeMarker2 (Angle/Dollar)", "Apache FreeMarker2 (Angle/Dollar)"],
138233
138298
  loader: () => {
138234
138299
  {
138235
- return import("./freemarker2-160c0ddc.js").then((m2) => m2.TagAngleInterpolationDollar);
138300
+ return import("./freemarker2-150b7f6f.js").then((m2) => m2.TagAngleInterpolationDollar);
138236
138301
  }
138237
138302
  }
138238
138303
  });
@@ -138241,7 +138306,7 @@ registerLanguage({
138241
138306
  aliases: ["FreeMarker2 (Bracket/Dollar)", "Apache FreeMarker2 (Bracket/Dollar)"],
138242
138307
  loader: () => {
138243
138308
  {
138244
- return import("./freemarker2-160c0ddc.js").then((m2) => m2.TagBracketInterpolationDollar);
138309
+ return import("./freemarker2-150b7f6f.js").then((m2) => m2.TagBracketInterpolationDollar);
138245
138310
  }
138246
138311
  }
138247
138312
  });
@@ -138250,7 +138315,7 @@ registerLanguage({
138250
138315
  aliases: ["FreeMarker2 (Angle/Bracket)", "Apache FreeMarker2 (Angle/Bracket)"],
138251
138316
  loader: () => {
138252
138317
  {
138253
- return import("./freemarker2-160c0ddc.js").then((m2) => m2.TagAngleInterpolationBracket);
138318
+ return import("./freemarker2-150b7f6f.js").then((m2) => m2.TagAngleInterpolationBracket);
138254
138319
  }
138255
138320
  }
138256
138321
  });
@@ -138259,7 +138324,7 @@ registerLanguage({
138259
138324
  aliases: ["FreeMarker2 (Bracket/Bracket)", "Apache FreeMarker2 (Bracket/Bracket)"],
138260
138325
  loader: () => {
138261
138326
  {
138262
- return import("./freemarker2-160c0ddc.js").then((m2) => m2.TagBracketInterpolationBracket);
138327
+ return import("./freemarker2-150b7f6f.js").then((m2) => m2.TagBracketInterpolationBracket);
138263
138328
  }
138264
138329
  }
138265
138330
  });
@@ -138268,7 +138333,7 @@ registerLanguage({
138268
138333
  aliases: ["FreeMarker2 (Auto/Dollar)", "Apache FreeMarker2 (Auto/Dollar)"],
138269
138334
  loader: () => {
138270
138335
  {
138271
- return import("./freemarker2-160c0ddc.js").then((m2) => m2.TagAutoInterpolationDollar);
138336
+ return import("./freemarker2-150b7f6f.js").then((m2) => m2.TagAutoInterpolationDollar);
138272
138337
  }
138273
138338
  }
138274
138339
  });
@@ -138277,7 +138342,7 @@ registerLanguage({
138277
138342
  aliases: ["FreeMarker2 (Auto/Bracket)", "Apache FreeMarker2 (Auto/Bracket)"],
138278
138343
  loader: () => {
138279
138344
  {
138280
- return import("./freemarker2-160c0ddc.js").then((m2) => m2.TagAutoInterpolationBracket);
138345
+ return import("./freemarker2-150b7f6f.js").then((m2) => m2.TagAutoInterpolationBracket);
138281
138346
  }
138282
138347
  }
138283
138348
  });
@@ -138327,7 +138392,7 @@ registerLanguage({
138327
138392
  mimetypes: ["text/x-handlebars-template"],
138328
138393
  loader: () => {
138329
138394
  {
138330
- return import("./handlebars-b83294de.js");
138395
+ return import("./handlebars-db028e5f.js");
138331
138396
  }
138332
138397
  }
138333
138398
  });
@@ -138360,7 +138425,7 @@ registerLanguage({
138360
138425
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
138361
138426
  loader: () => {
138362
138427
  {
138363
- return import("./html-e465efce.js");
138428
+ return import("./html-88b581e7.js");
138364
138429
  }
138365
138430
  }
138366
138431
  });
@@ -138413,7 +138478,7 @@ registerLanguage({
138413
138478
  mimetypes: ["text/javascript"],
138414
138479
  loader: () => {
138415
138480
  {
138416
- return import("./javascript-a1dcfc76.js");
138481
+ return import("./javascript-ae528407.js");
138417
138482
  }
138418
138483
  }
138419
138484
  });
@@ -138512,7 +138577,7 @@ registerLanguage({
138512
138577
  mimetypes: ["application/liquid"],
138513
138578
  loader: () => {
138514
138579
  {
138515
- return import("./liquid-8e298ea5.js");
138580
+ return import("./liquid-f0927f78.js");
138516
138581
  }
138517
138582
  }
138518
138583
  });
@@ -138560,7 +138625,7 @@ registerLanguage({
138560
138625
  aliases: ["MDX", "mdx"],
138561
138626
  loader: () => {
138562
138627
  {
138563
- return import("./mdx-65c6fe0f.js");
138628
+ return import("./mdx-f143f913.js");
138564
138629
  }
138565
138630
  }
138566
138631
  });
@@ -138819,7 +138884,7 @@ registerLanguage({
138819
138884
  firstLine: "^#!/.*\\bpython[0-9.-]*\\b",
138820
138885
  loader: () => {
138821
138886
  {
138822
- return import("./python-55e87814.js");
138887
+ return import("./python-aa6deb94.js");
138823
138888
  }
138824
138889
  }
138825
138890
  });
@@ -138868,7 +138933,7 @@ registerLanguage({
138868
138933
  mimetypes: ["text/x-cshtml"],
138869
138934
  loader: () => {
138870
138935
  {
138871
- return import("./razor-34386182.js");
138936
+ return import("./razor-3120b1d8.js");
138872
138937
  }
138873
138938
  }
138874
138939
  });
@@ -139204,7 +139269,7 @@ registerLanguage({
139204
139269
  mimetypes: ["text/typescript"],
139205
139270
  loader: () => {
139206
139271
  {
139207
- return import("./typescript-48be5bbc.js");
139272
+ return import("./typescript-2c76a3d1.js");
139208
139273
  }
139209
139274
  }
139210
139275
  });
@@ -139288,7 +139353,7 @@ registerLanguage({
139288
139353
  mimetypes: ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"],
139289
139354
  loader: () => {
139290
139355
  {
139291
- return import("./xml-1520dcee.js");
139356
+ return import("./xml-ee85ffe4.js");
139292
139357
  }
139293
139358
  }
139294
139359
  });
@@ -139305,7 +139370,7 @@ registerLanguage({
139305
139370
  mimetypes: ["application/x-yaml", "text/x-yaml"],
139306
139371
  loader: () => {
139307
139372
  {
139308
- return import("./yaml-b01c807c.js");
139373
+ return import("./yaml-2503ced6.js");
139309
139374
  }
139310
139375
  }
139311
139376
  });
@@ -139429,7 +139494,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3(
139429
139494
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
139430
139495
  function getMode$3() {
139431
139496
  {
139432
- return import("./cssMode-8a633359.js");
139497
+ return import("./cssMode-f01e76a3.js");
139433
139498
  }
139434
139499
  }
139435
139500
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
@@ -139560,7 +139625,7 @@ monaco_editor_core_exports$2.languages.html = {
139560
139625
  };
139561
139626
  function getMode$2() {
139562
139627
  {
139563
- return import("./htmlMode-fed923b3.js");
139628
+ return import("./htmlMode-beb480ee.js");
139564
139629
  }
139565
139630
  }
139566
139631
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
@@ -139658,7 +139723,7 @@ var getWorker = () => getMode$1().then((mode) => mode.getWorker());
139658
139723
  monaco_editor_core_exports$1.languages.json = { jsonDefaults, getWorker };
139659
139724
  function getMode$1() {
139660
139725
  {
139661
- return import("./jsonMode-92034391.js");
139726
+ return import("./jsonMode-b53dd865.js");
139662
139727
  }
139663
139728
  }
139664
139729
  monaco_editor_core_exports$1.languages.register({
@@ -139934,7 +139999,7 @@ monaco_editor_core_exports.languages.typescript = {
139934
139999
  };
139935
140000
  function getMode() {
139936
140001
  {
139937
- return import("./tsMode-67ddf297.js");
140002
+ return import("./tsMode-5445108e.js");
139938
140003
  }
139939
140004
  }
139940
140005
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -198456,11 +198521,198 @@ const RightPanel = memo(() => {
198456
198521
  }
198457
198522
  ) }) });
198458
198523
  });
198524
+ function TaskTable() {
198525
+ var _a3, _b3;
198526
+ const data = useListData();
198527
+ const cols = React.useMemo(() => {
198528
+ return [
198529
+ {
198530
+ dataIndex: UserFields.name,
198531
+ key: UserFields.name,
198532
+ title: "任务",
198533
+ width: 240,
198534
+ sortable: false,
198535
+ editable: false,
198536
+ cellRender: (text2, row) => {
198537
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
198538
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TaskIcon, { className: "size-5 text-primary" }) }),
198539
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
198540
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm", children: text2 }),
198541
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs text-default-500 flex items-center gap-1", children: [
198542
+ "运行中",
198543
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
198544
+ "svg",
198545
+ {
198546
+ xmlns: "http://www.w3.org/2000/svg",
198547
+ className: "size-4",
198548
+ viewBox: "0 0 24 24",
198549
+ children: [
198550
+ /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "4", cy: "12", r: "3", fill: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
198551
+ "animate",
198552
+ {
198553
+ id: "SVG7x14Dcom",
198554
+ fill: "freeze",
198555
+ attributeName: "opacity",
198556
+ begin: "0;SVGqSjG0dUp.end-0.25s",
198557
+ dur: "0.75s",
198558
+ values: "1;0.2"
198559
+ }
198560
+ ) }),
198561
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
198562
+ "circle",
198563
+ {
198564
+ cx: "12",
198565
+ cy: "12",
198566
+ r: "3",
198567
+ fill: "currentColor",
198568
+ opacity: "0.4",
198569
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
198570
+ "animate",
198571
+ {
198572
+ fill: "freeze",
198573
+ attributeName: "opacity",
198574
+ begin: "SVG7x14Dcom.begin+0.15s",
198575
+ dur: "0.75s",
198576
+ values: "1;0.2"
198577
+ }
198578
+ )
198579
+ }
198580
+ ),
198581
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
198582
+ "circle",
198583
+ {
198584
+ cx: "20",
198585
+ cy: "12",
198586
+ r: "3",
198587
+ fill: "currentColor",
198588
+ opacity: "0.3",
198589
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
198590
+ "animate",
198591
+ {
198592
+ id: "SVGqSjG0dUp",
198593
+ fill: "freeze",
198594
+ attributeName: "opacity",
198595
+ begin: "SVG7x14Dcom.begin+0.3s",
198596
+ dur: "0.75s",
198597
+ values: "1;0.2"
198598
+ }
198599
+ )
198600
+ }
198601
+ )
198602
+ ]
198603
+ }
198604
+ )
198605
+ ] })
198606
+ ] })
198607
+ ] });
198608
+ }
198609
+ },
198610
+ // {
198611
+ // dataIndex: UserFields.createdAt,
198612
+ // key: UserFields.createdAt,
198613
+ // title: "创建日期",
198614
+ // width: 160,
198615
+ // sortable: false,
198616
+ // cellRender: formatTimeCell,
198617
+ // },
198618
+ // {
198619
+ // dataIndex: UserFields.updatedAt,
198620
+ // key: UserFields.updatedAt,
198621
+ // title: "更新日期",
198622
+ // width: 160,
198623
+ // sortable: false,
198624
+ // cellRender: formatTimeCell,
198625
+ // },
198626
+ {
198627
+ key: "operate",
198628
+ width: 120,
198629
+ title: "操作",
198630
+ cellRender: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-0.5 items-center", children: [
198631
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EditButton, { isIconOnly: true, size: "sm", variant: "light", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
198632
+ Icon,
198633
+ {
198634
+ icon: "solar:pen-linear",
198635
+ className: "size-4 text-default-500"
198636
+ }
198637
+ ) }),
198638
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RemoveButton, { isIconOnly: true, size: "sm", variant: "light", color: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
198639
+ Icon,
198640
+ {
198641
+ icon: "solar:trash-bin-minimalistic-linear",
198642
+ className: "size-4"
198643
+ }
198644
+ ) })
198645
+ ] })
198646
+ }
198647
+ ];
198648
+ }, []);
198649
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(React.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
198650
+ EntityTable,
198651
+ {
198652
+ "aria-label": "用户列表",
198653
+ columns: cols,
198654
+ removeWrapper: true,
198655
+ headerProps: {
198656
+ style: {
198657
+ padding: "12px 6px",
198658
+ display: "none"
198659
+ }
198660
+ },
198661
+ bottomContent: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
198662
+ !!((_a3 = data == null ? void 0 : data.items) == null ? void 0 : _a3.length) && ((_b3 = data == null ? void 0 : data.items) == null ? void 0 : _b3.length) < (data.total || 0) && /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { className: "opacity-30" }),
198663
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EntityPagination, {})
198664
+ ] })
198665
+ }
198666
+ ) });
198667
+ }
198668
+ function TaskManager() {
198669
+ const [open, setOpen] = useState();
198670
+ const handleClose = useCallback(() => {
198671
+ setOpen(false);
198672
+ }, []);
198673
+ const handlePress = useCallback(() => {
198674
+ setOpen(true);
198675
+ }, []);
198676
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
198677
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
198678
+ Button$2,
198679
+ {
198680
+ variant: "light",
198681
+ size: "sm",
198682
+ className: cn(
198683
+ "px-1 py-1 shrink-0"
198684
+ //runningTasks.length ? "text-default-600" : "text-default-500"
198685
+ ),
198686
+ startContent: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-1" }),
198687
+ onPress: handlePress,
198688
+ children: "任务"
198689
+ }
198690
+ ),
198691
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
198692
+ Drawer,
198693
+ {
198694
+ isOpen: open,
198695
+ placement: "right",
198696
+ width: 600,
198697
+ className: "min-h-0",
198698
+ noOverlay: true,
198699
+ onClose: handleClose,
198700
+ children: [
198701
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(ModalHeader, { className: "pr-2 h-12", children: [
198702
+ "任务管理器",
198703
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ModalClose, {})
198704
+ ] }),
198705
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {}),
198706
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: "flex flex-col gap-4 min-h-0 overflow-auto py-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TaskTable, {}) })
198707
+ ]
198708
+ }
198709
+ )
198710
+ ] });
198711
+ }
198459
198712
  function StatusBar({ doc }) {
198460
198713
  const viewMode = useStudioStore((state) => state.viewMode);
198461
198714
  const selectedContent = useStudioStore((state) => state.selectedContent);
198462
- const theme = useStudioTheme();
198463
- const stableAppKey = useMemo(() => (theme == null ? void 0 : theme.id) || "", [theme == null ? void 0 : theme.id]);
198715
+ const website = useWebsite();
198464
198716
  const breadcrumbsText = useMemo(() => {
198465
198717
  var _a3;
198466
198718
  return ((_a3 = selectedContent == null ? void 0 : selectedContent.breadcrumbs) == null ? void 0 : _a3.join("/")) || "";
@@ -198481,7 +198733,38 @@ function StatusBar({ doc }) {
198481
198733
  ] }),
198482
198734
  /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { className: "h-5 w-[2px]" })
198483
198735
  ] }),
198484
- /* @__PURE__ */ jsxRuntimeExports.jsx(TaskManager, { appKey: stableAppKey })
198736
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
198737
+ QueryListScope,
198738
+ {
198739
+ defaultPageSize: 20,
198740
+ options: new TaskQueryOptions(
198741
+ [
198742
+ TaskFields.id,
198743
+ TaskFields.name,
198744
+ TaskFields.type,
198745
+ TaskFields.status,
198746
+ TaskFields.createdAt,
198747
+ TaskFields.updatedAt
198748
+ ],
198749
+ {
198750
+ where: {
198751
+ [TaskFields.websiteId]: {
198752
+ _eq: website == null ? void 0 : website.id
198753
+ },
198754
+ [TaskFields.module]: {
198755
+ _eq: AppModule.Studio
198756
+ }
198757
+ },
198758
+ orderBy: [
198759
+ {
198760
+ createdAt: "desc"
198761
+ }
198762
+ ]
198763
+ }
198764
+ ).setNoQuery(!(website == null ? void 0 : website.id)),
198765
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(TaskManager, {})
198766
+ }
198767
+ )
198485
198768
  ] })
198486
198769
  ]
198487
198770
  }
@@ -203920,4 +204203,4 @@ export {
203920
204203
  typescriptDefaults as t,
203921
204204
  useCustomizedMaterials as u
203922
204205
  };
203923
- //# sourceMappingURL=index-6ddf2099.js.map
204206
+ //# sourceMappingURL=index-f82df144.js.map