@rxdrag/website-studio 0.0.75 → 0.0.77

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 (39) hide show
  1. package/dist/astro-component/render/ModuleManager.d.ts +5 -2
  2. package/dist/astro-component/render/createDesigner.d.ts +4 -0
  3. package/dist/astro-component/render/factory.d.ts +1 -0
  4. package/dist/astro-component/render/index.d.ts +0 -2
  5. package/dist/astro-component/render/useModuleManager.d.ts +1 -1
  6. package/dist/{cssMode-3f92f4fd.js → cssMode-2fab6fd8.js} +4 -4
  7. package/dist/{cssMode-3f92f4fd.js.map → cssMode-2fab6fd8.js.map} +1 -1
  8. package/dist/{freemarker2-69b6ffda.js → freemarker2-985c1aab.js} +4 -4
  9. package/dist/{freemarker2-69b6ffda.js.map → freemarker2-985c1aab.js.map} +1 -1
  10. package/dist/{handlebars-8734dff3.js → handlebars-41f9e3d5.js} +4 -4
  11. package/dist/{handlebars-8734dff3.js.map → handlebars-41f9e3d5.js.map} +1 -1
  12. package/dist/{html-7079f47c.js → html-4e07dfcb.js} +4 -4
  13. package/dist/{html-7079f47c.js.map → html-4e07dfcb.js.map} +1 -1
  14. package/dist/{htmlMode-730fac31.js → htmlMode-f2256fc7.js} +4 -4
  15. package/dist/{htmlMode-730fac31.js.map → htmlMode-f2256fc7.js.map} +1 -1
  16. package/dist/{index-57fb0e65.js → index-c56cb64e.js} +209 -107
  17. package/dist/{index-57fb0e65.js.map → index-c56cb64e.js.map} +1 -1
  18. package/dist/index.mjs +3 -3
  19. package/dist/{javascript-f13d0738.js → javascript-b8a057c6.js} +5 -5
  20. package/dist/{javascript-f13d0738.js.map → javascript-b8a057c6.js.map} +1 -1
  21. package/dist/{jsonMode-ed6e2469.js → jsonMode-a93a3066.js} +4 -4
  22. package/dist/{jsonMode-ed6e2469.js.map → jsonMode-a93a3066.js.map} +1 -1
  23. package/dist/{liquid-dae34526.js → liquid-545fa7e1.js} +4 -4
  24. package/dist/{liquid-dae34526.js.map → liquid-545fa7e1.js.map} +1 -1
  25. package/dist/{mdx-b73e34f7.js → mdx-23212856.js} +4 -4
  26. package/dist/{mdx-b73e34f7.js.map → mdx-23212856.js.map} +1 -1
  27. package/dist/{python-e9a25850.js → python-571a1d38.js} +4 -4
  28. package/dist/{python-e9a25850.js.map → python-571a1d38.js.map} +1 -1
  29. package/dist/{razor-e614d2cc.js → razor-5d3d8972.js} +4 -4
  30. package/dist/{razor-e614d2cc.js.map → razor-5d3d8972.js.map} +1 -1
  31. package/dist/{tsMode-216c78a7.js → tsMode-715919b3.js} +4 -4
  32. package/dist/{tsMode-216c78a7.js.map → tsMode-715919b3.js.map} +1 -1
  33. package/dist/{typescript-898ace2f.js → typescript-70b501c4.js} +4 -4
  34. package/dist/{typescript-898ace2f.js.map → typescript-70b501c4.js.map} +1 -1
  35. package/dist/{xml-6fbbdc9d.js → xml-e3501494.js} +4 -4
  36. package/dist/{xml-6fbbdc9d.js.map → xml-e3501494.js.map} +1 -1
  37. package/dist/{yaml-4f60abdc.js → yaml-9cffb366.js} +4 -4
  38. package/dist/{yaml-4f60abdc.js.map → yaml-9cffb366.js.map} +1 -1
  39. package/package.json +17 -17
@@ -10,17 +10,18 @@ import React__default, { createContext, useContext, useMemo, useState, useRef, u
10
10
  import { ThemeBranchFields, PageQueryOptions, PageFields, FrontComponentQueryOptions, FrontComponentFields, MediaQueryOptions, ComponentCategoryFields, SectionTemplateQueryOptions, SectionTemplateFields, ComponentCategoryQueryOptions, TemplateCategoryQueryOptions, TemplateCategoryFields, ThemeBranchQueryOptions, StyleConfigFields, LangFields, ThemeConfigQueryOptions, ThemeConfigFields, ThemeFields, WebsiteQueryOptions, WebsiteFields, PageAssciations, TaskQueryOptions, TaskFields, AppModule, TaskStatus, websiteToInput, TaskType, LangQueryOptions, WebsiteAssciations, ExtendFieldType, ThemeConfigAssciations, WebsiteSettingsQueryOptions, WebsiteSettingsFields, themeConfigToInputCascade, ThemeConfigEntityName, MediaType, themeConfigToInput, websiteSettingsToInput, WebsiteSettingsEntityName, WebsiteSettingsAssciations, PageEntityName, ThemeBranchEntityName, PageType, themeBranchToInputCascade, ThemeQueryOptions, ThemeCategoryFields, FrontComponentEntityName, pageToInputCascade, sectionTemplateToInput, ProductCategoryEntityName, ProductCategoryQueryOptions, ProductCategoryFields, ProductQueryOptions, ProductFields, PublishableStatus, TaskEntityName, ComponentCategoryEntityName, themeBranchToInput, frontComponentToInput, SectionTemplateEntityName, pageToInput, PageMetaQueryOptions, PageMetaFields, PageMetaAssciations, FrontComponentAssciations, componentCategoryToInput } from "@rxdrag/rxcms-models";
11
11
  import { GlobalLoading, EntityForm, SubmitButton, useListData, SearchInput, EntityPagination, useIsLoading, QueryListScope, EntitySelect, useRemoveRow, useEditRow, EntityEditModal, useSelectionsState, EntityTable, EntityListScope, NewButton, EntityRowScope, EntitySelectField, useNewRow } from "@rxdrag/rxcms-models-ui";
12
12
  import { useOneThemeBranch, usePageList, useTemplateCategoryList, useSectionTemplateList, useComponentCategoryList, useFrontComponentList, useOneThemeBranchById, useTaskList, useUpsertOneWebsite, useDeleteThemeBranchById, useUpsertOneThemeBranch, useLangList, useOneWebsiteSettings, useOneThemeConfig, useUpsertOneThemeConfig, useUpsertOneWebsiteSettings, useUpsertOnePage, useUpsertOneSectionTemplate, useUpsertOneFrontComponent, useDeletePageById } from "@rxdrag/rxcms-model-hooks";
13
- import { newPageMetaOptions, useWebsite, useCurrentLangId, ComponentType, MediaSingleSelectField, FullImageSelectField, useSiteId, useCurrentLang, TitleAndSlug, TitleViewField, DescriptionViewField, RxcmsMedias, SiteRoot, usePreviewUrl, LangSelect } from "@rxdrag/biz-components";
13
+ import { newPageMetaOptions, useWebsite, useCurrentLang, useCurrentLangId, ComponentType, MediaSingleSelectField, FullImageSelectField, useSiteId, TitleAndSlug, TitleViewField, DescriptionViewField, RxcmsMedias, SiteRoot, usePreviewUrl, LangSelect } from "@rxdrag/biz-components";
14
14
  import { compileAstroToReact, transformSchemaToCode, extractVariables, isExpression, parseExpressionValue, convertHtmlAttrToJsxAttr, compileCode, AsyncFunction, transformCodeToSchema } from "@rxdrag/astro-compiler";
15
15
  import clsx$1 from "clsx";
16
16
  import { useDesignerEngine, useActivedDocumentId, Designer, useDocumentModified, useClearModified, useDocConfig, useDocumentCode, useViewMode, useGetDocSchemaTree, ViewMode, useRootNode, IFrameCanvasImpl, KeyboardDriver, DragDropDriver, DragOverDriver, MouseClickDriver, MouseMoveDriver, MouseOverOutDriver, CanvasResizeDriver, CanvasScrollDriver, MouseUpDriver, useDragStore, RelativePosition, AcceptType, useCurrentNode, useSelectedElementsRectsInIframe, useActivedElementRect, useActivedId, useTreeNode, useChangeNodeMeta, useNodeMeta, createNodeHandlerProps, useSelection, useBackup, useSetInsertTargetWithPosition, useComponentOperationStore, NodeRelativePosition, TabType, InsertMode, useGetNode, useNodeMove, useClone, useRemoveSelectedNodes, useSelectedNode, useSelectedParent, useSelectParent, MouseMoveEvent, useCodeModified, RXID_ATTR_NAME, useSchemaTree, useSetChildren, useSetDocConfig, useDeviceType, DeviceType, useHistory, useResourceNode, useCanAccept, useConfigModified, useCreateDocument, useRemoveDocument, ContainerImpl, DocumentRoot } from "@rxdrag/rxcraft";
17
17
  import { staticMaterials, AddablePlaceHolder, ViewKeyProvider, ComponentTreeWidget, VariableProvider, setters, DEFUALT_DEVICE_MAP, DEFAULT_SMALLEST_DEVICE, MetaEdittingProvider, useVariables, useExecuteExpression, classListToClassName, expressionAndName, expressionTernaryName, expressionLoopName, useViewKey, slotContentName } from "@rxdrag/website-materials";
18
- import { Icon, PageLoader, PopoverController, ModalController, AnimateController, TabsController, NumberController, FlipController, CollapseController, AosController, DEFAULT_SAMLL, DEFAULT_MEDIUM, DEFAULT_LARGE, DEFAULT_PRODUCT_IMAGE_SIZE, DEFAULT_PRODUCT_THUMBNAIL_IMAGE_SIZE, DEFAULT_POST_IMAGE_SIZE, DEFAULT_POST_THUMBNAIL_IMAGE_SIZE } from "@rxdrag/website-lib-core";
18
+ import { Icon, Entify, PageLoader, PopoverController, ModalController, AnimateController, TabsController, NumberController, FlipController, CollapseController, AosController, DEFAULT_SAMLL, DEFAULT_MEDIUM, DEFAULT_LARGE, DEFAULT_PRODUCT_IMAGE_SIZE, DEFAULT_PRODUCT_THUMBNAIL_IMAGE_SIZE, DEFAULT_POST_IMAGE_SIZE, DEFAULT_POST_THUMBNAIL_IMAGE_SIZE } from "@rxdrag/website-lib-core";
19
+ import gsap$2 from "gsap";
20
+ import { useCreateEntityClient, useLazyQueryOneEntity, emitEntityChange, useEntifyEndpoint, useEntifyToken } from "@rxdrag/entify-hooks";
19
21
  import { CheckCircleIcon as CheckCircleIcon$1, CloseIcon, ModalBody, AddIcon as AddIcon$1, TaskStopIcon, 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, WarningIcon, PinIcon, ErrorBoundary, CloneIcon, RemoveIcon, MonacoEditor, RunningIcon, StyledTooltip, PlayIcon, getTheFile, useSave, MoreIcon, CodeSyncIcon, Logo, PagesIcon, WidgetIcon, SeoIcon, TextIcon, HeadingIcon, StarIcon, ImageIcon, VideoIcon, SplineIcon, CardIcon, TableIcon, GridIcon, BoxIcon, DividerIcon, SpacerIcon, SlotIcon, LinkIcon, BreadcrumbIcon, TabsIcon, PopoverIcon, ModalIcon, FormIcon, LeafNode, GroupNode, TreeView, DesignIcon, ResetIcon, ImportIcon, AstroIcon, AddFolderIcon, MediasIcon, LanguageIcon, SettingsMinimalisticIcon, CodeSquareIcon, DownloadIcon, UploadIcon } from "@rxdrag/rxcms-common";
20
22
  import { create as create$4 } from "zustand";
21
23
  import { Card, CardBody, Button as Button$2, CircularProgress, addToast, CardHeader, Select, SelectItem, Dropdown, DropdownTrigger, DropdownMenu as DropdownMenu$1, DropdownItem, Accordion, AccordionItem, Input, Tabs, Tab, Divider, cn, Checkbox, Chip, Skeleton, CardFooter, Image, useDisclosure, Modal as Modal$2, ModalContent as ModalContent$2, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, ModalFooter as ModalFooter$1, Tooltip, RadioGroup, Radio } from "@heroui/react";
22
24
  import { Icon as Icon$1 } from "@iconify/react";
23
- import { useLazyQueryOneEntity, emitEntityChange, useEntifyEndpoint, useEntifyToken, useCreateEntityClient } from "@rxdrag/entify-hooks";
24
25
  import { useTranslateTheme, TaskManager, useSubscribeTaskEvents, useTranslateBuiltinPage, useTranslateCustomizedPages, useTranlateComponents, useUploadDeploymentFile, WebsiteAddonContext } from "@rxdrag/website-addon";
25
26
  import { InputField, TextareaField, toField, ColorField, SwitchField, SelectField, PasswordField, Form, CheckboxField } from "@rxdrag/fieldy-heroui";
26
27
  import { ObjectField, useFormValue, useForm } from "@rxdrag/react-fieldy-pro";
@@ -35,7 +36,6 @@ import dayjs from "dayjs";
35
36
  import { cn as cn$1, Tabs as Tabs$1, TabsList, TabsTrigger, TabsContent, Button as Button$3, Label as Label$1, Input as Input$1, AccordionTrigger, Accordion as Accordion$1, AccordionItem as AccordionItem$1, AccordionContent, DialogHeader, DialogTitle, DialogFooter, Dialog, DialogContent } from "@rxdrag/shadcn";
36
37
  import { isObj, isStr } from "@rxdrag/shared";
37
38
  import { TextNodeName, CommentNodeName } from "@rxdrag/schema-pro";
38
- import gsap$2 from "gsap";
39
39
  import { emit, EVENT_ENTITY_POSTED } from "@rxdrag/entify-lib";
40
40
  import JSZip from "jszip";
41
41
  import { useExportWebsite, useGenerateWebsiteFiles, traverseFiles as traverseFiles$1 } from "@rxdrag/code-generator";
@@ -703,7 +703,10 @@ function newComponentCategoryQueryOptions(themeId) {
703
703
  },
704
704
  orderBy: [
705
705
  {
706
- [ComponentCategoryFields.seqValue]: "asc"
706
+ [ComponentCategoryFields.title]: "asc"
707
+ },
708
+ {
709
+ [ComponentCategoryFields.name]: "asc"
707
710
  },
708
711
  {
709
712
  [ComponentCategoryFields.updatedAt]: "asc"
@@ -717,20 +720,23 @@ function StudioRoot(props) {
717
720
  const { theme, children, rootPath, navigate } = props;
718
721
  const website = useWebsite();
719
722
  const { data: baseLangThemeData, isLoading: baseLangThemeLoading } = useOneThemeBranch(
720
- new ThemeBranchQueryOptions([ThemeBranchFields.id, ThemeBranchFields.parentThemeId], {
721
- where: {
722
- website: {
723
- id: {
724
- _eq: website == null ? void 0 : website.id
725
- }
726
- },
727
- lang: {
728
- id: {
729
- _eq: (_a3 = website == null ? void 0 : website.baseLang) == null ? void 0 : _a3.id
723
+ new ThemeBranchQueryOptions(
724
+ [ThemeBranchFields.id, ThemeBranchFields.parentThemeId],
725
+ {
726
+ where: {
727
+ website: {
728
+ id: {
729
+ _eq: website == null ? void 0 : website.id
730
+ }
731
+ },
732
+ lang: {
733
+ id: {
734
+ _eq: (_a3 = website == null ? void 0 : website.baseLang) == null ? void 0 : _a3.id
735
+ }
730
736
  }
731
737
  }
732
738
  }
733
- }).setNoQuery(!(website == null ? void 0 : website.id) || !((_b3 = website == null ? void 0 : website.baseLang) == null ? void 0 : _b3.id))
739
+ ).setNoQuery(!(website == null ? void 0 : website.id) || !((_b3 = website == null ? void 0 : website.baseLang) == null ? void 0 : _b3.id))
734
740
  );
735
741
  const { data: pagesData, isLoading: pagesLoading } = usePageList(
736
742
  new PageQueryOptions(
@@ -753,7 +759,10 @@ function StudioRoot(props) {
753
759
  },
754
760
  orderBy: [
755
761
  {
756
- createdAt: "desc"
762
+ [PageFields.title]: "asc"
763
+ },
764
+ {
765
+ [PageFields.slug]: "asc"
757
766
  }
758
767
  ]
759
768
  }
@@ -821,7 +830,10 @@ function StudioRoot(props) {
821
830
  },
822
831
  orderBy: [
823
832
  {
824
- [FrontComponentFields.seqValue]: "asc"
833
+ [FrontComponentFields.title]: "asc"
834
+ },
835
+ {
836
+ [FrontComponentFields.name]: "asc"
825
837
  },
826
838
  {
827
839
  [FrontComponentFields.createdAt]: "asc"
@@ -909,6 +921,43 @@ function StudioRoot(props) {
909
921
  ] });
910
922
  }
911
923
  const createAstroRuntime = () => {
924
+ const AsyncRender = ({ promise }) => {
925
+ const [node, setNode] = React__default.useState(null);
926
+ React__default.useEffect(() => {
927
+ let mounted = true;
928
+ Promise.resolve(promise).then((res) => {
929
+ if (!mounted)
930
+ return;
931
+ if (React__default.isValidElement(res)) {
932
+ setNode(res);
933
+ } else if (res === null || res === void 0) {
934
+ setNode(React__default.createElement(React__default.Fragment));
935
+ } else if (typeof res === "string") {
936
+ setNode(
937
+ React__default.createElement("div", {
938
+ style: { display: "contents" },
939
+ dangerouslySetInnerHTML: { __html: res }
940
+ })
941
+ );
942
+ } else {
943
+ setNode(
944
+ React__default.createElement("div", {
945
+ style: { display: "contents" },
946
+ dangerouslySetInnerHTML: { __html: String(res) }
947
+ })
948
+ );
949
+ }
950
+ }).catch(() => {
951
+ if (!mounted)
952
+ return;
953
+ setNode(React__default.createElement(React__default.Fragment));
954
+ });
955
+ return () => {
956
+ mounted = false;
957
+ };
958
+ }, [promise]);
959
+ return node || React__default.createElement(React__default.Fragment);
960
+ };
912
961
  const astroRuntime = {
913
962
  // 创建元数据
914
963
  createMetadata: (fileURL, metadata) => {
@@ -955,6 +1004,12 @@ const createAstroRuntime = () => {
955
1004
  if (React__default.isValidElement(renderResult)) {
956
1005
  return renderResult;
957
1006
  }
1007
+ if (renderResult) {
1008
+ const maybePromise = renderResult;
1009
+ if (typeof maybePromise.then === "function") {
1010
+ return React__default.createElement(AsyncRender, { promise: renderResult });
1011
+ }
1012
+ }
958
1013
  console.warn("Render result is not a React element:", renderResult);
959
1014
  return React__default.createElement(React__default.Fragment);
960
1015
  };
@@ -1148,6 +1203,19 @@ const createAstroRuntime = () => {
1148
1203
  }
1149
1204
  delete finalProps["class:list"];
1150
1205
  }
1206
+ if ("class" in finalProps) {
1207
+ const cls = String(finalProps["class"]).trim();
1208
+ if (cls) {
1209
+ const existed = finalProps.className ? String(finalProps.className).trim() : "";
1210
+ finalProps.className = existed ? `${existed} ${cls}` : cls;
1211
+ }
1212
+ delete finalProps["class"];
1213
+ }
1214
+ Object.keys(finalProps).forEach((key2) => {
1215
+ if (key2.includes(":") && key2 !== "class:list") {
1216
+ delete finalProps[key2];
1217
+ }
1218
+ });
1151
1219
  if (Component2 && typeof Component2 === "object" && "$$typeof" in Component2) {
1152
1220
  return React__default.createElement(
1153
1221
  Component2,
@@ -1155,17 +1223,27 @@ const createAstroRuntime = () => {
1155
1223
  );
1156
1224
  }
1157
1225
  if (typeof Component2 === "function") {
1158
- if (Component2.prototype && Component2.prototype.isReactComponent) {
1159
- return React__default.createElement(
1160
- Component2,
1161
- finalProps
1162
- );
1163
- }
1164
- const output = Component2(finalProps);
1165
- if (React__default.isValidElement(output)) {
1166
- return output;
1167
- }
1168
- return output;
1226
+ const Wrapped = (p2) => {
1227
+ const out = Component2(p2);
1228
+ if (React__default.isValidElement(out))
1229
+ return out;
1230
+ if (out) {
1231
+ const maybePromise = out;
1232
+ if (typeof maybePromise.then === "function") {
1233
+ return React__default.createElement(AsyncRender, { promise: out });
1234
+ }
1235
+ }
1236
+ if (out === null || out === void 0)
1237
+ return React__default.createElement(React__default.Fragment);
1238
+ if (typeof out === "string") {
1239
+ return React__default.createElement("div", {
1240
+ style: { display: "contents" },
1241
+ dangerouslySetInnerHTML: { __html: out }
1242
+ });
1243
+ }
1244
+ return React__default.createElement(React__default.Fragment);
1245
+ };
1246
+ return React__default.createElement(Wrapped, finalProps);
1169
1247
  }
1170
1248
  return Component2;
1171
1249
  },
@@ -1195,24 +1273,31 @@ const createAstroRuntime = () => {
1195
1273
  if (key2.includes(":")) {
1196
1274
  if (key2 === "class:list") {
1197
1275
  const toClassString = (v2) => {
1198
- if (!v2)
1199
- return "";
1200
- if (typeof v2 === "string")
1201
- return v2;
1202
- if (Array.isArray(v2)) {
1203
- return v2.flatMap(
1204
- (item) => Array.isArray(item) ? item : [item]
1205
- ).filter(Boolean).map((it) => String(it)).join(" ");
1206
- }
1207
- if (typeof v2 === "object") {
1208
- const classes = [];
1209
- for (const [k2, val] of Object.entries(v2)) {
1210
- if (val)
1211
- classes.push(k2);
1276
+ const acc = [];
1277
+ const walk2 = (val) => {
1278
+ if (!val)
1279
+ return;
1280
+ if (typeof val === "string" || typeof val === "number") {
1281
+ const s = String(val).trim();
1282
+ if (s)
1283
+ acc.push(s);
1284
+ return;
1212
1285
  }
1213
- return classes.join(" ");
1214
- }
1215
- return String(v2);
1286
+ if (Array.isArray(val)) {
1287
+ for (const item of val)
1288
+ walk2(item);
1289
+ return;
1290
+ }
1291
+ if (typeof val === "object") {
1292
+ for (const [k2, truth] of Object.entries(val)) {
1293
+ if (truth)
1294
+ acc.push(k2);
1295
+ }
1296
+ return;
1297
+ }
1298
+ };
1299
+ walk2(v2);
1300
+ return acc.join(" ");
1216
1301
  };
1217
1302
  const cls = toClassString(value).replace(/\s*,\s*/g, " ").trim();
1218
1303
  return cls ? ` class="${cls.replace(/"/g, """)}"` : "";
@@ -1291,6 +1376,9 @@ function codeToReact(compiledCode, moduleMgr) {
1291
1376
  if (module2) {
1292
1377
  return module2;
1293
1378
  }
1379
+ if (moduleName.includes("?astro&type=style") || moduleName.endsWith(".css")) {
1380
+ return {};
1381
+ }
1294
1382
  throw new Error(
1295
1383
  `模块未找到: "${moduleName}"
1296
1384
  请确保:
@@ -1335,10 +1423,7 @@ function createAsyncComponent(component, moduleMgr) {
1335
1423
  const cached = componentCache.get(componentName);
1336
1424
  if (cached && updatedAt) {
1337
1425
  if (cached.compiledAt >= updatedAt) {
1338
- console.log(`[createAsyncComponent] 使用缓存: ${componentName} (cached: ${cached.compiledAt}, updated: ${updatedAt})`);
1339
1426
  return cached.component;
1340
- } else {
1341
- console.log(`[createAsyncComponent] 缓存过期: ${componentName} (cached: ${cached.compiledAt}, updated: ${updatedAt})`);
1342
1427
  }
1343
1428
  }
1344
1429
  return function AsyncComponentWrapper(props) {
@@ -1358,12 +1443,10 @@ function createAsyncComponent(component, moduleMgr) {
1358
1443
  let cancelled = false;
1359
1444
  setIsCompiling(true);
1360
1445
  setError(null);
1361
- console.log(`[createAsyncComponent] 开始编译: ${componentName}, updatedAt: ${updatedAt}`);
1362
1446
  compileAstroToReact(component.code).then((result) => {
1363
1447
  if (!cancelled) {
1364
1448
  setCompileResult(result);
1365
1449
  setIsCompiling(false);
1366
- console.log(`[createAsyncComponent] 编译完成: ${componentName}`);
1367
1450
  }
1368
1451
  }).catch((err) => {
1369
1452
  if (!cancelled) {
@@ -1473,7 +1556,6 @@ ${code}
1473
1556
  component: Component2,
1474
1557
  compiledAt: updatedAt
1475
1558
  });
1476
- console.log(`[createAsyncComponent] 缓存组件: ${componentName}`);
1477
1559
  }
1478
1560
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: containerRef, style: { display: "contents" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Component2, { ...props }) });
1479
1561
  } catch (err) {
@@ -1490,21 +1572,23 @@ const websiteLibCore = {
1490
1572
  const websiteLib = {};
1491
1573
  const _ModuleManager = class _ModuleManager {
1492
1574
  // 私有构造函数,防止外部直接实例化
1493
- constructor() {
1575
+ constructor(rx) {
1494
1576
  __publicField(this, "components");
1495
1577
  __publicField(this, "parentTheme");
1496
1578
  __publicField(this, "websiteLib");
1497
1579
  __publicField(this, "websiteLibCore");
1580
+ __publicField(this, "lib");
1498
1581
  this.websiteLib = websiteLib;
1499
1582
  this.websiteLibCore = websiteLibCore;
1583
+ this.lib = { rx };
1500
1584
  for (const material of staticMaterials) {
1501
1585
  this.websiteLib[material.componentName] = (material == null ? void 0 : material.preview) || (material == null ? void 0 : material.designer);
1502
1586
  }
1503
1587
  }
1504
1588
  // 获取单例实例
1505
- static getInstance() {
1589
+ static getInstance(rx) {
1506
1590
  if (!_ModuleManager.instance) {
1507
- _ModuleManager.instance = new _ModuleManager();
1591
+ _ModuleManager.instance = new _ModuleManager(rx);
1508
1592
  }
1509
1593
  return _ModuleManager.instance;
1510
1594
  }
@@ -1537,6 +1621,18 @@ const _ModuleManager = class _ModuleManager {
1537
1621
  if (moduleName === "@rxdrag/website-lib") {
1538
1622
  return this.websiteLib;
1539
1623
  }
1624
+ if (moduleName === "../lib" || moduleName === "@/lib") {
1625
+ return this.lib;
1626
+ }
1627
+ if (moduleName === "../config/consts" || moduleName === "@/config/consts") {
1628
+ return { FORM_SALT: "" };
1629
+ }
1630
+ if (moduleName === "clsx") {
1631
+ return clsx$1;
1632
+ }
1633
+ if (moduleName === "gsap") {
1634
+ return gsap$2;
1635
+ }
1540
1636
  return null;
1541
1637
  }
1542
1638
  covertComToReact(com) {
@@ -1546,14 +1642,28 @@ const _ModuleManager = class _ModuleManager {
1546
1642
  __publicField(_ModuleManager, "instance");
1547
1643
  let ModuleManager = _ModuleManager;
1548
1644
  function useModuleManager() {
1645
+ var _a3;
1549
1646
  const components = useAllComponents();
1550
1647
  const parentTheme = useParentTheme();
1648
+ const lang = useCurrentLang();
1649
+ const websiteId = (_a3 = useWebsite()) == null ? void 0 : _a3.id;
1650
+ const entifyClient = useCreateEntityClient();
1651
+ const themeStyle = useThemeStyleConfig();
1551
1652
  const moduleMgr = useMemo(() => {
1552
- const ins = ModuleManager.getInstance();
1653
+ if (!entifyClient) {
1654
+ return null;
1655
+ }
1656
+ const rx = Entify.getInstance({
1657
+ websiteId,
1658
+ entifyServerUrl: entifyClient.getEndpoint(),
1659
+ entifyGuestToken: entifyClient.getToken(),
1660
+ language: lang == null ? void 0 : lang.abbr
1661
+ }, (themeStyle == null ? void 0 : themeStyle.imageSizes) || {});
1662
+ const ins = ModuleManager.getInstance(rx);
1553
1663
  ins.setComponents(components);
1554
1664
  ins.setParentTheme(parentTheme);
1555
1665
  return ins;
1556
- }, [components, parentTheme]);
1666
+ }, [components, entifyClient, lang == null ? void 0 : lang.abbr, parentTheme, themeStyle == null ? void 0 : themeStyle.imageSizes, websiteId]);
1557
1667
  return moduleMgr;
1558
1668
  }
1559
1669
  const ErrorDisplay = ({ title, message, details }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border border-red-300 bg-red-50 text-red-700 rounded", children: [
@@ -1576,7 +1686,7 @@ function AstroComponentRender(props) {
1576
1686
  const Component2 = useMemo(() => {
1577
1687
  if (!fCom)
1578
1688
  return null;
1579
- return createAsyncComponent(fCom, moduleMgr);
1689
+ return createAsyncComponent(fCom, moduleMgr || void 0);
1580
1690
  }, [fCom, moduleMgr]);
1581
1691
  if (!fCom) {
1582
1692
  return /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingDisplay, { message: "组件加载中..." });
@@ -133366,7 +133476,7 @@ registerLanguage({
133366
133476
  aliases: ["FreeMarker2", "Apache FreeMarker2"],
133367
133477
  loader: () => {
133368
133478
  {
133369
- return import("./freemarker2-69b6ffda.js").then((m2) => m2.TagAutoInterpolationDollar);
133479
+ return import("./freemarker2-985c1aab.js").then((m2) => m2.TagAutoInterpolationDollar);
133370
133480
  }
133371
133481
  }
133372
133482
  });
@@ -133375,7 +133485,7 @@ registerLanguage({
133375
133485
  aliases: ["FreeMarker2 (Angle/Dollar)", "Apache FreeMarker2 (Angle/Dollar)"],
133376
133486
  loader: () => {
133377
133487
  {
133378
- return import("./freemarker2-69b6ffda.js").then((m2) => m2.TagAngleInterpolationDollar);
133488
+ return import("./freemarker2-985c1aab.js").then((m2) => m2.TagAngleInterpolationDollar);
133379
133489
  }
133380
133490
  }
133381
133491
  });
@@ -133384,7 +133494,7 @@ registerLanguage({
133384
133494
  aliases: ["FreeMarker2 (Bracket/Dollar)", "Apache FreeMarker2 (Bracket/Dollar)"],
133385
133495
  loader: () => {
133386
133496
  {
133387
- return import("./freemarker2-69b6ffda.js").then((m2) => m2.TagBracketInterpolationDollar);
133497
+ return import("./freemarker2-985c1aab.js").then((m2) => m2.TagBracketInterpolationDollar);
133388
133498
  }
133389
133499
  }
133390
133500
  });
@@ -133393,7 +133503,7 @@ registerLanguage({
133393
133503
  aliases: ["FreeMarker2 (Angle/Bracket)", "Apache FreeMarker2 (Angle/Bracket)"],
133394
133504
  loader: () => {
133395
133505
  {
133396
- return import("./freemarker2-69b6ffda.js").then((m2) => m2.TagAngleInterpolationBracket);
133506
+ return import("./freemarker2-985c1aab.js").then((m2) => m2.TagAngleInterpolationBracket);
133397
133507
  }
133398
133508
  }
133399
133509
  });
@@ -133402,7 +133512,7 @@ registerLanguage({
133402
133512
  aliases: ["FreeMarker2 (Bracket/Bracket)", "Apache FreeMarker2 (Bracket/Bracket)"],
133403
133513
  loader: () => {
133404
133514
  {
133405
- return import("./freemarker2-69b6ffda.js").then((m2) => m2.TagBracketInterpolationBracket);
133515
+ return import("./freemarker2-985c1aab.js").then((m2) => m2.TagBracketInterpolationBracket);
133406
133516
  }
133407
133517
  }
133408
133518
  });
@@ -133411,7 +133521,7 @@ registerLanguage({
133411
133521
  aliases: ["FreeMarker2 (Auto/Dollar)", "Apache FreeMarker2 (Auto/Dollar)"],
133412
133522
  loader: () => {
133413
133523
  {
133414
- return import("./freemarker2-69b6ffda.js").then((m2) => m2.TagAutoInterpolationDollar);
133524
+ return import("./freemarker2-985c1aab.js").then((m2) => m2.TagAutoInterpolationDollar);
133415
133525
  }
133416
133526
  }
133417
133527
  });
@@ -133420,7 +133530,7 @@ registerLanguage({
133420
133530
  aliases: ["FreeMarker2 (Auto/Bracket)", "Apache FreeMarker2 (Auto/Bracket)"],
133421
133531
  loader: () => {
133422
133532
  {
133423
- return import("./freemarker2-69b6ffda.js").then((m2) => m2.TagAutoInterpolationBracket);
133533
+ return import("./freemarker2-985c1aab.js").then((m2) => m2.TagAutoInterpolationBracket);
133424
133534
  }
133425
133535
  }
133426
133536
  });
@@ -133470,7 +133580,7 @@ registerLanguage({
133470
133580
  mimetypes: ["text/x-handlebars-template"],
133471
133581
  loader: () => {
133472
133582
  {
133473
- return import("./handlebars-8734dff3.js");
133583
+ return import("./handlebars-41f9e3d5.js");
133474
133584
  }
133475
133585
  }
133476
133586
  });
@@ -133503,7 +133613,7 @@ registerLanguage({
133503
133613
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
133504
133614
  loader: () => {
133505
133615
  {
133506
- return import("./html-7079f47c.js");
133616
+ return import("./html-4e07dfcb.js");
133507
133617
  }
133508
133618
  }
133509
133619
  });
@@ -133556,7 +133666,7 @@ registerLanguage({
133556
133666
  mimetypes: ["text/javascript"],
133557
133667
  loader: () => {
133558
133668
  {
133559
- return import("./javascript-f13d0738.js");
133669
+ return import("./javascript-b8a057c6.js");
133560
133670
  }
133561
133671
  }
133562
133672
  });
@@ -133655,7 +133765,7 @@ registerLanguage({
133655
133765
  mimetypes: ["application/liquid"],
133656
133766
  loader: () => {
133657
133767
  {
133658
- return import("./liquid-dae34526.js");
133768
+ return import("./liquid-545fa7e1.js");
133659
133769
  }
133660
133770
  }
133661
133771
  });
@@ -133703,7 +133813,7 @@ registerLanguage({
133703
133813
  aliases: ["MDX", "mdx"],
133704
133814
  loader: () => {
133705
133815
  {
133706
- return import("./mdx-b73e34f7.js");
133816
+ return import("./mdx-23212856.js");
133707
133817
  }
133708
133818
  }
133709
133819
  });
@@ -133962,7 +134072,7 @@ registerLanguage({
133962
134072
  firstLine: "^#!/.*\\bpython[0-9.-]*\\b",
133963
134073
  loader: () => {
133964
134074
  {
133965
- return import("./python-e9a25850.js");
134075
+ return import("./python-571a1d38.js");
133966
134076
  }
133967
134077
  }
133968
134078
  });
@@ -134011,7 +134121,7 @@ registerLanguage({
134011
134121
  mimetypes: ["text/x-cshtml"],
134012
134122
  loader: () => {
134013
134123
  {
134014
- return import("./razor-e614d2cc.js");
134124
+ return import("./razor-5d3d8972.js");
134015
134125
  }
134016
134126
  }
134017
134127
  });
@@ -134347,7 +134457,7 @@ registerLanguage({
134347
134457
  mimetypes: ["text/typescript"],
134348
134458
  loader: () => {
134349
134459
  {
134350
- return import("./typescript-898ace2f.js");
134460
+ return import("./typescript-70b501c4.js");
134351
134461
  }
134352
134462
  }
134353
134463
  });
@@ -134431,7 +134541,7 @@ registerLanguage({
134431
134541
  mimetypes: ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"],
134432
134542
  loader: () => {
134433
134543
  {
134434
- return import("./xml-6fbbdc9d.js");
134544
+ return import("./xml-e3501494.js");
134435
134545
  }
134436
134546
  }
134437
134547
  });
@@ -134448,7 +134558,7 @@ registerLanguage({
134448
134558
  mimetypes: ["application/x-yaml", "text/x-yaml"],
134449
134559
  loader: () => {
134450
134560
  {
134451
- return import("./yaml-4f60abdc.js");
134561
+ return import("./yaml-9cffb366.js");
134452
134562
  }
134453
134563
  }
134454
134564
  });
@@ -134572,7 +134682,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3(
134572
134682
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
134573
134683
  function getMode$3() {
134574
134684
  {
134575
- return import("./cssMode-3f92f4fd.js");
134685
+ return import("./cssMode-2fab6fd8.js");
134576
134686
  }
134577
134687
  }
134578
134688
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
@@ -134703,7 +134813,7 @@ monaco_editor_core_exports$2.languages.html = {
134703
134813
  };
134704
134814
  function getMode$2() {
134705
134815
  {
134706
- return import("./htmlMode-730fac31.js");
134816
+ return import("./htmlMode-f2256fc7.js");
134707
134817
  }
134708
134818
  }
134709
134819
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
@@ -134801,7 +134911,7 @@ var getWorker = () => getMode$1().then((mode) => mode.getWorker());
134801
134911
  monaco_editor_core_exports$1.languages.json = { jsonDefaults, getWorker };
134802
134912
  function getMode$1() {
134803
134913
  {
134804
- return import("./jsonMode-ed6e2469.js");
134914
+ return import("./jsonMode-a93a3066.js");
134805
134915
  }
134806
134916
  }
134807
134917
  monaco_editor_core_exports$1.languages.register({
@@ -135077,7 +135187,7 @@ monaco_editor_core_exports.languages.typescript = {
135077
135187
  };
135078
135188
  function getMode() {
135079
135189
  {
135080
- return import("./tsMode-216c78a7.js");
135190
+ return import("./tsMode-715919b3.js");
135081
135191
  }
135082
135192
  }
135083
135193
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -185856,16 +185966,18 @@ function useFrameInitialHTML(option2) {
185856
185966
  ></div>
185857
185967
  </div>`
185858
185968
  } = option2;
185969
+ const tailwindConfigCode = useMemo(() => {
185970
+ const raw2 = (styleConfig == null ? void 0 : styleConfig.tailwindConfig) || "const theme = {}";
185971
+ return raw2.replace(/^\s*export\s+/, "");
185972
+ }, [styleConfig == null ? void 0 : styleConfig.tailwindConfig]);
185859
185973
  const initialHTML = useMemo(
185860
185974
  () => `
185861
185975
  <!DOCTYPE html>
185862
185976
  <html>
185863
185977
  <head>
185864
- <script src="/tailwind.3.4.16.min.js"><\/script>
185865
- <link href="/typography.min.css" rel="stylesheet">
185866
185978
  <title>${title || "Canvas"}</title>
185867
185979
  <script>
185868
- ${(styleConfig == null ? void 0 : styleConfig.tailwindConfig) || "const theme = {}"}
185980
+ ${tailwindConfigCode}
185869
185981
  tailwind.config = {
185870
185982
  darkMode: "class",
185871
185983
  theme: theme,
@@ -185883,6 +185995,8 @@ function useFrameInitialHTML(option2) {
185883
185995
  ],
185884
185996
  }
185885
185997
  <\/script>
185998
+ <script src="/tailwind.3.4.16.min.js"><\/script>
185999
+ <link href="/typography.min.css" rel="stylesheet">
185886
186000
  <style type="text/tailwindcss">
185887
186001
  ${(styleConfig == null ? void 0 : styleConfig.cssVariants) || ""}
185888
186002
  .rx-node-margin {
@@ -186002,7 +186116,7 @@ function useFrameInitialHTML(option2) {
186002
186116
  `,
186003
186117
  [
186004
186118
  title,
186005
- styleConfig == null ? void 0 : styleConfig.tailwindConfig,
186119
+ tailwindConfigCode,
186006
186120
  styleConfig == null ? void 0 : styleConfig.cssVariants,
186007
186121
  styleConfig == null ? void 0 : styleConfig.css,
186008
186122
  headPlaceholder,
@@ -198525,6 +198639,10 @@ function PreviewContent(props) {
198525
198639
  };
198526
198640
  }, []);
198527
198641
  const scale = containerWidth ? containerWidth / 800 : 1;
198642
+ const sanitizedTailwindConfig = useMemo(() => {
198643
+ const raw2 = tailwindConfig || "const theme = {}";
198644
+ return raw2.replace(/^\s*export\s+/, "");
198645
+ }, [tailwindConfig]);
198528
198646
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
198529
198647
  "div",
198530
198648
  {
@@ -198560,7 +198678,7 @@ function PreviewContent(props) {
198560
198678
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
198561
198679
  <title>ThemeBranch Preview</title>
198562
198680
  <script>
198563
- ${tailwindConfig || "const theme = {}"}
198681
+ ${sanitizedTailwindConfig}
198564
198682
  tailwind.config = {
198565
198683
  darkMode: "class",
198566
198684
  theme: theme,
@@ -199376,7 +199494,10 @@ function CodeSyncModal(props) {
199376
199494
  "代码同步链接",
199377
199495
  /* @__PURE__ */ jsxRuntimeExports.jsx(ModalClose, {})
199378
199496
  ] }),
199379
- /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: "flex-1 p-3 border-t border-b border-divider gap-4 flex min-h-0 ", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-default-500 border border-divider rounded-md p-2 w-full", children: syncUrl }) }),
199497
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(ModalBody, { className: "flex-1 p-3 border-t border-b border-divider gap-4 flex flex-col min-h-0 ", children: [
199498
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "flex-1 text-sm text-default-500 border border-divider rounded-md p-2 w-full", children: syncUrl }),
199499
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-default-500", children: "每个语言,不同的代码" })
199500
+ ] }),
199380
199501
  /* @__PURE__ */ jsxRuntimeExports.jsxs(ModalFooter, { children: [
199381
199502
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button$2, { onPress: onClose, variant: "flat", children: "关闭" }),
199382
199503
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -203076,16 +203197,7 @@ function ComponentModal(props) {
203076
203197
  ).setNoQuery(!themeId)
203077
203198
  }
203078
203199
  ),
203079
- /* @__PURE__ */ jsxRuntimeExports.jsx(
203080
- InputField,
203081
- {
203082
- name: "seqValue",
203083
- label: "顺序",
203084
- type: "number",
203085
- labelPlacement: "outside",
203086
- placeholder: "请输入顺序"
203087
- }
203088
- ),
203200
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}),
203089
203201
  /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxField, { label: "区块", name: "isSectionBlock", children: "是区块" })
203090
203202
  ] })
203091
203203
  }
@@ -203421,16 +203533,6 @@ function ComponentCategoryModal(props) {
203421
203533
  labelPlacement: "outside",
203422
203534
  placeholder: "请输入标题"
203423
203535
  }
203424
- ),
203425
- /* @__PURE__ */ jsxRuntimeExports.jsx(
203426
- InputField,
203427
- {
203428
- name: "seqValue",
203429
- label: "顺序",
203430
- type: "number",
203431
- labelPlacement: "outside",
203432
- placeholder: "请输入顺序"
203433
- }
203434
203536
  )
203435
203537
  ] })
203436
203538
  }
@@ -204316,7 +204418,7 @@ function MoreActions() {
204316
204418
  handleConfirm,
204317
204419
  confirmText
204318
204420
  } = useImportTheme();
204319
- const syncUrl = `${enfityEndPoint}$website$${website == null ? void 0 : website.id}`;
204421
+ const syncUrl = `${enfityEndPoint}$website-theme$${theme == null ? void 0 : theme.id}`;
204320
204422
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
204321
204423
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Dropdown, { children: [
204322
204424
  /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -204875,4 +204977,4 @@ export {
204875
204977
  typescriptDefaults as t,
204876
204978
  useCustomizedMaterials as u
204877
204979
  };
204878
- //# sourceMappingURL=index-57fb0e65.js.map
204980
+ //# sourceMappingURL=index-c56cb64e.js.map