@rxdrag/website-studio 0.0.44 → 0.0.46

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 (36) hide show
  1. package/dist/{cssMode-f6ed7ab1.js → cssMode-93ea5c72.js} +4 -4
  2. package/dist/{cssMode-f6ed7ab1.js.map → cssMode-93ea5c72.js.map} +1 -1
  3. package/dist/{freemarker2-0b5a20e1.js → freemarker2-38ffe93b.js} +4 -4
  4. package/dist/{freemarker2-0b5a20e1.js.map → freemarker2-38ffe93b.js.map} +1 -1
  5. package/dist/{handlebars-3e804cdc.js → handlebars-03fa2b48.js} +4 -4
  6. package/dist/{handlebars-3e804cdc.js.map → handlebars-03fa2b48.js.map} +1 -1
  7. package/dist/hooks/useTranslateTheme.d.ts +1 -1
  8. package/dist/{html-bef31e01.js → html-98032dab.js} +4 -4
  9. package/dist/{html-bef31e01.js.map → html-98032dab.js.map} +1 -1
  10. package/dist/{htmlMode-190446f0.js → htmlMode-17c79d22.js} +4 -4
  11. package/dist/{htmlMode-190446f0.js.map → htmlMode-17c79d22.js.map} +1 -1
  12. package/dist/{index-add86284.js → index-a36e35b9.js} +156 -184
  13. package/dist/{index-add86284.js.map → index-a36e35b9.js.map} +1 -1
  14. package/dist/index.mjs +3 -3
  15. package/dist/{javascript-a482a18d.js → javascript-59dea486.js} +5 -5
  16. package/dist/{javascript-a482a18d.js.map → javascript-59dea486.js.map} +1 -1
  17. package/dist/{jsonMode-36321e55.js → jsonMode-e0ecfacb.js} +4 -4
  18. package/dist/{jsonMode-36321e55.js.map → jsonMode-e0ecfacb.js.map} +1 -1
  19. package/dist/{liquid-91f2b334.js → liquid-82e66f78.js} +4 -4
  20. package/dist/{liquid-91f2b334.js.map → liquid-82e66f78.js.map} +1 -1
  21. package/dist/{mdx-5b3f4043.js → mdx-1bea00b6.js} +4 -4
  22. package/dist/{mdx-5b3f4043.js.map → mdx-1bea00b6.js.map} +1 -1
  23. package/dist/{python-5ab24881.js → python-cb42d146.js} +4 -4
  24. package/dist/{python-5ab24881.js.map → python-cb42d146.js.map} +1 -1
  25. package/dist/{razor-e2cba756.js → razor-88e2f64e.js} +4 -4
  26. package/dist/{razor-e2cba756.js.map → razor-88e2f64e.js.map} +1 -1
  27. package/dist/{tsMode-a884ed37.js → tsMode-7ddadd61.js} +4 -4
  28. package/dist/{tsMode-a884ed37.js.map → tsMode-7ddadd61.js.map} +1 -1
  29. package/dist/{typescript-47724791.js → typescript-c6ee2621.js} +4 -4
  30. package/dist/{typescript-47724791.js.map → typescript-c6ee2621.js.map} +1 -1
  31. package/dist/{xml-3d847f47.js → xml-366a61e0.js} +4 -4
  32. package/dist/{xml-3d847f47.js.map → xml-366a61e0.js.map} +1 -1
  33. package/dist/{yaml-f547855f.js → yaml-d854ca5f.js} +4 -4
  34. package/dist/{yaml-f547855f.js.map → yaml-d854ca5f.js.map} +1 -1
  35. package/package.json +18 -18
  36. package/dist/components/ConfigDrawer/MultiLangPanel/useTranslateThemeTask.d.ts +0 -7
@@ -18,9 +18,9 @@ import { NodeMountedEvent, RXID_ATTR_NAME, HistoryableActionType, IFrameCanvasIm
18
18
  import { useVariables, useExecuteExpression, VariableProvider, expressionAndName, expressionTernaryName, expressionLoopName, useViewKey, createSchema, ENTIFY_SERVER_URL, staticMaterials, ViewKeyProvider, slotContentName, expressionName } from "@rxdrag/website-materials";
19
19
  import { isHTMLElement as isHTMLElement$1, isStr } from "@rxdrag/shared";
20
20
  import { isFunction as isFunction$2, debounce, keys, uniqueId } from "lodash-es";
21
- import { useEntifyEndpoint, useEntifyToken, useLazyQueryEntityList, useLazyQueryOneEntity, useCreateEntityClient, emitEntityChange } from "@rxdrag/entify-hooks";
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, 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, 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, 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, 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";
@@ -29,16 +29,16 @@ import { useEntifyWrapperStore, useUpsertEntityWithIndicator } from "@rxdrag/rxc
29
29
  import JSZip from "jszip";
30
30
  import { create as create$4 } from "zustand";
31
31
  import { Icon } from "@iconify/react";
32
- import { useInprogressTaskByKey, useUpdateTask, taskPool, TranslateThemeTask, TaskManager, ResetPageTask, ImportPagesTask, ImportComponentsTask } from "@rxdrag/ai-tasks";
33
32
  import { useAiUrl, useAiAgent, AiWidget, AiAgentRoot } from "@rxdrag/ai-agent";
33
+ import { createHttpClient } from "@rxdrag/entify-lib";
34
34
  import { InputField, TextareaField, toField, ColorField, SwitchField, SelectField, PasswordField, Form } from "@rxdrag/fieldy-heroui";
35
35
  import { ObjectField, useFormValue, useForm, VirtualForm } from "@rxdrag/react-fieldy-pro";
36
36
  import "react-colorful";
37
37
  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
- import "@rxdrag/entify-lib";
41
40
  import { ComponentRender } from "@rxdrag/react-runner-pro";
41
+ import { TaskManager, useInprogressTaskByKey, useUpdateTask, taskPool, ResetPageTask, ImportPagesTask, ImportComponentsTask } from "@rxdrag/ai-tasks";
42
42
  import tinycolor from "tinycolor2";
43
43
  var jsxRuntime = { exports: {} };
44
44
  var reactJsxRuntime_production_min = {};
@@ -6582,53 +6582,115 @@ function LangCard(props) {
6582
6582
  }
6583
6583
  );
6584
6584
  }
6585
- const TRANSLATE_THEME_KEY = "translate-theme";
6586
- function useTranslateThemeTask() {
6587
- const theme = useStudioTheme();
6588
- const lang = useCurrentLang();
6589
- const baseThemeId = useBaseLangThemeId();
6590
- const appKey = (theme == null ? void 0 : theme.id) || "";
6591
- const taskState = useInprogressTaskByKey(TRANSLATE_THEME_KEY, appKey);
6592
- const setTask = useUpdateTask(appKey);
6593
- const entifyClient = useCreateEntityClient();
6594
- const task = taskState && taskState.status !== "done" ? taskPool[taskState.taskId] : void 0;
6595
- const aiUrl = useAiUrl();
6596
- const handleTaskChange = useCallback(
6597
- (data) => {
6598
- setTask(data);
6599
- },
6600
- [setTask]
6601
- );
6602
- const translateAndReset = useCallback(() => {
6603
- if (!(theme == null ? void 0 : theme.id)) {
6604
- console.error("没设置Theme");
6605
- return;
6606
- }
6607
- if (!entifyClient) {
6608
- console.error("entifyClient 创建失败");
6609
- return;
6585
+ const defaultSchema = {
6586
+ componentName: "Root"
6587
+ };
6588
+ const emptyValue = { schema: void 0, config: void 0 };
6589
+ function useSchema(selectedContent) {
6590
+ const [schema, setSchema] = useState(emptyValue);
6591
+ const components = useFrontComponents();
6592
+ const pages = usePages();
6593
+ const componentsRef = useRef(components);
6594
+ const pagesRef = useRef(pages);
6595
+ componentsRef.current = components;
6596
+ pagesRef.current = pages;
6597
+ const templates = useTemplates();
6598
+ const templatesRef = useRef(templates);
6599
+ templatesRef.current = templates;
6600
+ useEffect(() => {
6601
+ var _a3, _b3, _c2, _d2, _e2, _f2, _g2, _h2, _i3, _j2;
6602
+ let code;
6603
+ let hasContent = false;
6604
+ let defaultConfig2;
6605
+ if ((selectedContent == null ? void 0 : selectedContent.type) === ContentType.Component) {
6606
+ const component = (_a3 = componentsRef.current) == null ? void 0 : _a3.find(
6607
+ (component2) => component2.id === selectedContent.id
6608
+ );
6609
+ if (component) {
6610
+ code = component.code;
6611
+ hasContent = true;
6612
+ }
6613
+ } else if ((selectedContent == null ? void 0 : selectedContent.type) === ContentType.PredefinedPage || (selectedContent == null ? void 0 : selectedContent.type) === ContentType.Page) {
6614
+ const page = (_b3 = pagesRef.current) == null ? void 0 : _b3.find(
6615
+ (item) => item.id === selectedContent.id
6616
+ );
6617
+ defaultConfig2 = {
6618
+ pageMeta: {
6619
+ seoTitle: (_c2 = page == null ? void 0 : page.meta) == null ? void 0 : _c2.seoTitle,
6620
+ seoDescription: (_d2 = page == null ? void 0 : page.meta) == null ? void 0 : _d2.seoDescription,
6621
+ seoKeywords: (_e2 = page == null ? void 0 : page.meta) == null ? void 0 : _e2.seoKeywords,
6622
+ ogTitle: (_f2 = page == null ? void 0 : page.meta) == null ? void 0 : _f2.ogTitle,
6623
+ ogDescription: (_g2 = page == null ? void 0 : page.meta) == null ? void 0 : _g2.ogDescription,
6624
+ ogType: (_h2 = page == null ? void 0 : page.meta) == null ? void 0 : _h2.ogType,
6625
+ ogImage: (_i3 = page == null ? void 0 : page.meta) == null ? void 0 : _i3.ogImage
6626
+ }
6627
+ };
6628
+ if (page) {
6629
+ code = page.code;
6630
+ hasContent = true;
6631
+ }
6632
+ } else if ((selectedContent == null ? void 0 : selectedContent.type) === ContentType.Template) {
6633
+ const template = (_j2 = templatesRef.current) == null ? void 0 : _j2.find(
6634
+ (template2) => template2.id === selectedContent.id
6635
+ );
6636
+ if (template) {
6637
+ code = template.code;
6638
+ hasContent = true;
6639
+ }
6610
6640
  }
6611
- if (!aiUrl) {
6612
- console.error("没设置aiUrl");
6613
- return;
6641
+ if (code) {
6642
+ transformCodeToSchema(code).then((value) => {
6643
+ setSchema({
6644
+ schema: { ...defaultSchema, children: (value == null ? void 0 : value.template) || [] },
6645
+ config: { ...defaultConfig2, ...value.resources }
6646
+ });
6647
+ });
6648
+ } else if (hasContent) {
6649
+ setSchema({
6650
+ schema: { ...defaultSchema, children: [] }
6651
+ });
6614
6652
  }
6615
- if (!baseThemeId) {
6616
- console.error("没设置baseThemeId");
6617
- return;
6653
+ }, [selectedContent == null ? void 0 : selectedContent.id, selectedContent == null ? void 0 : selectedContent.type]);
6654
+ console.log("===>schema", schema);
6655
+ return schema;
6656
+ }
6657
+ function useCloseDrawer() {
6658
+ const setDrawerType = useStudioStore((state) => state.setDrawerType);
6659
+ const drawerDocked = useStudioStore((state) => state.drawerDocked);
6660
+ const close = useCallback(() => {
6661
+ if (!drawerDocked) {
6662
+ setDrawerType(void 0);
6618
6663
  }
6619
- const task2 = new TranslateThemeTask({
6620
- key: TRANSLATE_THEME_KEY,
6621
- entifyClient,
6622
- baseThemeId,
6623
- themeId: theme == null ? void 0 : theme.id,
6624
- lang,
6625
- aiUrl
6626
- });
6627
- taskPool[task2.id] = task2;
6628
- task2.onDataChange(handleTaskChange);
6629
- task2.start();
6630
- }, [aiUrl, baseThemeId, entifyClient, handleTaskChange, lang, theme == null ? void 0 : theme.id]);
6631
- return { taskState, translateAndReset, task };
6664
+ }, [drawerDocked, setDrawerType]);
6665
+ return close;
6666
+ }
6667
+ function useIsBaseLangTheme() {
6668
+ var _a3, _b3;
6669
+ const theme = useStudioTheme();
6670
+ const website = useWebsite();
6671
+ return ((_a3 = theme == null ? void 0 : theme.lang) == null ? void 0 : _a3.id) === ((_b3 = website == null ? void 0 : website.baseLang) == null ? void 0 : _b3.id);
6672
+ }
6673
+ function useTranslateTheme() {
6674
+ const baseURL = useAiUrl();
6675
+ const token = useEntifyToken();
6676
+ const website = useWebsite();
6677
+ const translate = useCallback(
6678
+ async (langId, title) => {
6679
+ if (!token || !(website == null ? void 0 : website.id)) {
6680
+ console.error("No token or website id");
6681
+ return;
6682
+ }
6683
+ const http = createHttpClient({ baseURL, token });
6684
+ const response = await http.post("/api/studio/translate-theme", {
6685
+ websiteId: website == null ? void 0 : website.id,
6686
+ langId,
6687
+ title
6688
+ });
6689
+ console.log("translate response", response);
6690
+ },
6691
+ [baseURL, token, website == null ? void 0 : website.id]
6692
+ );
6693
+ return translate;
6632
6694
  }
6633
6695
  const linkTypes = [
6634
6696
  {
@@ -6699,7 +6761,7 @@ function MultiLangPanel() {
6699
6761
  var _a3, _b3, _c2, _d2, _e2, _f2;
6700
6762
  const [linkType, setLinkType] = useState("subdomain");
6701
6763
  const [confirmOpen, setConfirmOpen] = useState(false);
6702
- const [currentLang, setCurrentLang] = useCurrentLangId();
6764
+ const [currentLangId, setCurrentLangId] = useCurrentLangId();
6703
6765
  const selectedContent = useStudioStore((state) => state.selectedContent);
6704
6766
  const setSelectedContent = useStudioStore(
6705
6767
  (state) => state.setSelectedContent
@@ -6707,13 +6769,13 @@ function MultiLangPanel() {
6707
6769
  const website = useWebsite();
6708
6770
  const isChanginBaseLangRef = useRef(false);
6709
6771
  const [upsertTheme, { isMutating: isCreating }] = useUpsertOneTheme();
6710
- const { taskState, task, translateAndReset } = useTranslateThemeTask();
6772
+ const translateTheme = useTranslateTheme();
6711
6773
  useEffect(() => {
6712
6774
  var _a4;
6713
- if (website && !currentLang) {
6714
- setCurrentLang((_a4 = website.baseLang) == null ? void 0 : _a4.id);
6775
+ if (website && !currentLangId) {
6776
+ setCurrentLangId((_a4 = website.baseLang) == null ? void 0 : _a4.id);
6715
6777
  }
6716
- }, [currentLang, setCurrentLang, website]);
6778
+ }, [currentLangId, setCurrentLangId, website]);
6717
6779
  const { data: allLangs, isLoading: allLangsLoading } = useLangList(
6718
6780
  new LangQueryOptions([
6719
6781
  LangFields.id,
@@ -6746,12 +6808,12 @@ function MultiLangPanel() {
6746
6808
  );
6747
6809
  const handleLangSelect = useCallback(
6748
6810
  (langId) => {
6749
- setCurrentLang(langId);
6750
- if ((selectedContent == null ? void 0 : selectedContent.id) && langId !== currentLang) {
6811
+ setCurrentLangId(langId);
6812
+ if ((selectedContent == null ? void 0 : selectedContent.id) && langId !== currentLangId) {
6751
6813
  setSelectedContent(void 0);
6752
6814
  }
6753
6815
  },
6754
- [selectedContent == null ? void 0 : selectedContent.id, setCurrentLang, setSelectedContent, currentLang]
6816
+ [selectedContent == null ? void 0 : selectedContent.id, setCurrentLangId, setSelectedContent, currentLangId]
6755
6817
  );
6756
6818
  const leftLangs = useMemo(() => {
6757
6819
  var _a4;
@@ -6794,16 +6856,22 @@ function MultiLangPanel() {
6794
6856
  const handleTranslate = useCallback(() => {
6795
6857
  setConfirmOpen(true);
6796
6858
  }, []);
6797
- const handleStop = useCallback(() => {
6798
- task == null ? void 0 : task.stop();
6799
- }, [task]);
6859
+ useCallback(() => {
6860
+ }, []);
6800
6861
  const handleCloseConfirm = useCallback(() => {
6801
6862
  setConfirmOpen(false);
6802
6863
  }, []);
6803
6864
  const handleConfirm = useCallback(() => {
6804
- translateAndReset();
6805
- }, [translateAndReset]);
6806
- const isRunning = (taskState == null ? void 0 : taskState.status) === "in-progress";
6865
+ var _a4;
6866
+ if (!currentLangId) {
6867
+ console.error("No currentLang");
6868
+ return;
6869
+ }
6870
+ const lang = (_a4 = allLangs == null ? void 0 : allLangs.items) == null ? void 0 : _a4.find((lang2) => lang2.id === currentLangId);
6871
+ 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) || ""}`;
6872
+ translateTheme(currentLangId, title);
6873
+ }, [translateTheme, currentLangId, allLangs == null ? void 0 : allLangs.items]);
6874
+ const isRunning = false;
6807
6875
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
6808
6876
  /* @__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: [
6809
6877
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "bg-default-50", children: [
@@ -6863,7 +6931,7 @@ function MultiLangPanel() {
6863
6931
  LangCard,
6864
6932
  {
6865
6933
  lang,
6866
- isSelected: currentLang === lang.id,
6934
+ isSelected: currentLangId === lang.id,
6867
6935
  isBaseLang: ((_a4 = website == null ? void 0 : website.baseLang) == null ? void 0 : _a4.id) === lang.id,
6868
6936
  onSelect: handleLangSelect
6869
6937
  },
@@ -6911,23 +6979,15 @@ function MultiLangPanel() {
6911
6979
  ] })
6912
6980
  ] }),
6913
6981
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-6 flex items-center justify-between", children: [
6914
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-default-500", children: taskState == null ? void 0 : taskState.infoMessage }),
6982
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-default-500" }),
6915
6983
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
6916
- isRunning && /* @__PURE__ */ jsxRuntimeExports.jsx(
6917
- Button$2,
6918
- {
6919
- variant: "flat",
6920
- startContent: /* @__PURE__ */ jsxRuntimeExports.jsx(TaskStopIcon, { className: "size-5" }),
6921
- onPress: handleStop,
6922
- children: "停止"
6923
- }
6924
- ),
6984
+ isRunning,
6925
6985
  /* @__PURE__ */ jsxRuntimeExports.jsx(
6926
6986
  Button$2,
6927
6987
  {
6928
6988
  color: "primary",
6929
6989
  startContent: /* @__PURE__ */ jsxRuntimeExports.jsx(AiStarIcon, { className: "size-5" }),
6930
- isDisabled: currentLang === ((_d2 = website == null ? void 0 : website.baseLang) == null ? void 0 : _d2.id),
6990
+ isDisabled: currentLangId === ((_d2 = website == null ? void 0 : website.baseLang) == null ? void 0 : _d2.id),
6931
6991
  isLoading: isRunning,
6932
6992
  onPress: handleTranslate,
6933
6993
  children: "翻译 & 重置"
@@ -138162,7 +138222,7 @@ registerLanguage({
138162
138222
  aliases: ["FreeMarker2", "Apache FreeMarker2"],
138163
138223
  loader: () => {
138164
138224
  {
138165
- return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAutoInterpolationDollar);
138225
+ return import("./freemarker2-38ffe93b.js").then((m2) => m2.TagAutoInterpolationDollar);
138166
138226
  }
138167
138227
  }
138168
138228
  });
@@ -138171,7 +138231,7 @@ registerLanguage({
138171
138231
  aliases: ["FreeMarker2 (Angle/Dollar)", "Apache FreeMarker2 (Angle/Dollar)"],
138172
138232
  loader: () => {
138173
138233
  {
138174
- return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAngleInterpolationDollar);
138234
+ return import("./freemarker2-38ffe93b.js").then((m2) => m2.TagAngleInterpolationDollar);
138175
138235
  }
138176
138236
  }
138177
138237
  });
@@ -138180,7 +138240,7 @@ registerLanguage({
138180
138240
  aliases: ["FreeMarker2 (Bracket/Dollar)", "Apache FreeMarker2 (Bracket/Dollar)"],
138181
138241
  loader: () => {
138182
138242
  {
138183
- return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagBracketInterpolationDollar);
138243
+ return import("./freemarker2-38ffe93b.js").then((m2) => m2.TagBracketInterpolationDollar);
138184
138244
  }
138185
138245
  }
138186
138246
  });
@@ -138189,7 +138249,7 @@ registerLanguage({
138189
138249
  aliases: ["FreeMarker2 (Angle/Bracket)", "Apache FreeMarker2 (Angle/Bracket)"],
138190
138250
  loader: () => {
138191
138251
  {
138192
- return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAngleInterpolationBracket);
138252
+ return import("./freemarker2-38ffe93b.js").then((m2) => m2.TagAngleInterpolationBracket);
138193
138253
  }
138194
138254
  }
138195
138255
  });
@@ -138198,7 +138258,7 @@ registerLanguage({
138198
138258
  aliases: ["FreeMarker2 (Bracket/Bracket)", "Apache FreeMarker2 (Bracket/Bracket)"],
138199
138259
  loader: () => {
138200
138260
  {
138201
- return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagBracketInterpolationBracket);
138261
+ return import("./freemarker2-38ffe93b.js").then((m2) => m2.TagBracketInterpolationBracket);
138202
138262
  }
138203
138263
  }
138204
138264
  });
@@ -138207,7 +138267,7 @@ registerLanguage({
138207
138267
  aliases: ["FreeMarker2 (Auto/Dollar)", "Apache FreeMarker2 (Auto/Dollar)"],
138208
138268
  loader: () => {
138209
138269
  {
138210
- return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAutoInterpolationDollar);
138270
+ return import("./freemarker2-38ffe93b.js").then((m2) => m2.TagAutoInterpolationDollar);
138211
138271
  }
138212
138272
  }
138213
138273
  });
@@ -138216,7 +138276,7 @@ registerLanguage({
138216
138276
  aliases: ["FreeMarker2 (Auto/Bracket)", "Apache FreeMarker2 (Auto/Bracket)"],
138217
138277
  loader: () => {
138218
138278
  {
138219
- return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAutoInterpolationBracket);
138279
+ return import("./freemarker2-38ffe93b.js").then((m2) => m2.TagAutoInterpolationBracket);
138220
138280
  }
138221
138281
  }
138222
138282
  });
@@ -138266,7 +138326,7 @@ registerLanguage({
138266
138326
  mimetypes: ["text/x-handlebars-template"],
138267
138327
  loader: () => {
138268
138328
  {
138269
- return import("./handlebars-3e804cdc.js");
138329
+ return import("./handlebars-03fa2b48.js");
138270
138330
  }
138271
138331
  }
138272
138332
  });
@@ -138299,7 +138359,7 @@ registerLanguage({
138299
138359
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
138300
138360
  loader: () => {
138301
138361
  {
138302
- return import("./html-bef31e01.js");
138362
+ return import("./html-98032dab.js");
138303
138363
  }
138304
138364
  }
138305
138365
  });
@@ -138352,7 +138412,7 @@ registerLanguage({
138352
138412
  mimetypes: ["text/javascript"],
138353
138413
  loader: () => {
138354
138414
  {
138355
- return import("./javascript-a482a18d.js");
138415
+ return import("./javascript-59dea486.js");
138356
138416
  }
138357
138417
  }
138358
138418
  });
@@ -138451,7 +138511,7 @@ registerLanguage({
138451
138511
  mimetypes: ["application/liquid"],
138452
138512
  loader: () => {
138453
138513
  {
138454
- return import("./liquid-91f2b334.js");
138514
+ return import("./liquid-82e66f78.js");
138455
138515
  }
138456
138516
  }
138457
138517
  });
@@ -138499,7 +138559,7 @@ registerLanguage({
138499
138559
  aliases: ["MDX", "mdx"],
138500
138560
  loader: () => {
138501
138561
  {
138502
- return import("./mdx-5b3f4043.js");
138562
+ return import("./mdx-1bea00b6.js");
138503
138563
  }
138504
138564
  }
138505
138565
  });
@@ -138758,7 +138818,7 @@ registerLanguage({
138758
138818
  firstLine: "^#!/.*\\bpython[0-9.-]*\\b",
138759
138819
  loader: () => {
138760
138820
  {
138761
- return import("./python-5ab24881.js");
138821
+ return import("./python-cb42d146.js");
138762
138822
  }
138763
138823
  }
138764
138824
  });
@@ -138807,7 +138867,7 @@ registerLanguage({
138807
138867
  mimetypes: ["text/x-cshtml"],
138808
138868
  loader: () => {
138809
138869
  {
138810
- return import("./razor-e2cba756.js");
138870
+ return import("./razor-88e2f64e.js");
138811
138871
  }
138812
138872
  }
138813
138873
  });
@@ -139143,7 +139203,7 @@ registerLanguage({
139143
139203
  mimetypes: ["text/typescript"],
139144
139204
  loader: () => {
139145
139205
  {
139146
- return import("./typescript-47724791.js");
139206
+ return import("./typescript-c6ee2621.js");
139147
139207
  }
139148
139208
  }
139149
139209
  });
@@ -139227,7 +139287,7 @@ registerLanguage({
139227
139287
  mimetypes: ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"],
139228
139288
  loader: () => {
139229
139289
  {
139230
- return import("./xml-3d847f47.js");
139290
+ return import("./xml-366a61e0.js");
139231
139291
  }
139232
139292
  }
139233
139293
  });
@@ -139244,7 +139304,7 @@ registerLanguage({
139244
139304
  mimetypes: ["application/x-yaml", "text/x-yaml"],
139245
139305
  loader: () => {
139246
139306
  {
139247
- return import("./yaml-f547855f.js");
139307
+ return import("./yaml-d854ca5f.js");
139248
139308
  }
139249
139309
  }
139250
139310
  });
@@ -139368,7 +139428,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3(
139368
139428
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
139369
139429
  function getMode$3() {
139370
139430
  {
139371
- return import("./cssMode-f6ed7ab1.js");
139431
+ return import("./cssMode-93ea5c72.js");
139372
139432
  }
139373
139433
  }
139374
139434
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
@@ -139499,7 +139559,7 @@ monaco_editor_core_exports$2.languages.html = {
139499
139559
  };
139500
139560
  function getMode$2() {
139501
139561
  {
139502
- return import("./htmlMode-190446f0.js");
139562
+ return import("./htmlMode-17c79d22.js");
139503
139563
  }
139504
139564
  }
139505
139565
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
@@ -139597,7 +139657,7 @@ var getWorker = () => getMode$1().then((mode) => mode.getWorker());
139597
139657
  monaco_editor_core_exports$1.languages.json = { jsonDefaults, getWorker };
139598
139658
  function getMode$1() {
139599
139659
  {
139600
- return import("./jsonMode-36321e55.js");
139660
+ return import("./jsonMode-e0ecfacb.js");
139601
139661
  }
139602
139662
  }
139603
139663
  monaco_editor_core_exports$1.languages.register({
@@ -139873,7 +139933,7 @@ monaco_editor_core_exports.languages.typescript = {
139873
139933
  };
139874
139934
  function getMode() {
139875
139935
  {
139876
- return import("./tsMode-a884ed37.js");
139936
+ return import("./tsMode-7ddadd61.js");
139877
139937
  }
139878
139938
  }
139879
139939
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -190746,94 +190806,6 @@ const ThemeIcon = (props) => {
190746
190806
  }
190747
190807
  ) });
190748
190808
  };
190749
- const defaultSchema = {
190750
- componentName: "Root"
190751
- };
190752
- const emptyValue = { schema: void 0, config: void 0 };
190753
- function useSchema(selectedContent) {
190754
- const [schema, setSchema] = useState(emptyValue);
190755
- const components = useFrontComponents();
190756
- const pages = usePages();
190757
- const componentsRef = useRef(components);
190758
- const pagesRef = useRef(pages);
190759
- componentsRef.current = components;
190760
- pagesRef.current = pages;
190761
- const templates = useTemplates();
190762
- const templatesRef = useRef(templates);
190763
- templatesRef.current = templates;
190764
- useEffect(() => {
190765
- var _a3, _b3, _c2, _d2, _e2, _f2, _g2, _h2, _i3, _j2;
190766
- let code;
190767
- let hasContent = false;
190768
- let defaultConfig2;
190769
- if ((selectedContent == null ? void 0 : selectedContent.type) === ContentType.Component) {
190770
- const component = (_a3 = componentsRef.current) == null ? void 0 : _a3.find(
190771
- (component2) => component2.id === selectedContent.id
190772
- );
190773
- if (component) {
190774
- code = component.code;
190775
- hasContent = true;
190776
- }
190777
- } else if ((selectedContent == null ? void 0 : selectedContent.type) === ContentType.PredefinedPage || (selectedContent == null ? void 0 : selectedContent.type) === ContentType.Page) {
190778
- const page = (_b3 = pagesRef.current) == null ? void 0 : _b3.find(
190779
- (item) => item.id === selectedContent.id
190780
- );
190781
- defaultConfig2 = {
190782
- pageMeta: {
190783
- seoTitle: (_c2 = page == null ? void 0 : page.meta) == null ? void 0 : _c2.seoTitle,
190784
- seoDescription: (_d2 = page == null ? void 0 : page.meta) == null ? void 0 : _d2.seoDescription,
190785
- seoKeywords: (_e2 = page == null ? void 0 : page.meta) == null ? void 0 : _e2.seoKeywords,
190786
- ogTitle: (_f2 = page == null ? void 0 : page.meta) == null ? void 0 : _f2.ogTitle,
190787
- ogDescription: (_g2 = page == null ? void 0 : page.meta) == null ? void 0 : _g2.ogDescription,
190788
- ogType: (_h2 = page == null ? void 0 : page.meta) == null ? void 0 : _h2.ogType,
190789
- ogImage: (_i3 = page == null ? void 0 : page.meta) == null ? void 0 : _i3.ogImage
190790
- }
190791
- };
190792
- if (page) {
190793
- code = page.code;
190794
- hasContent = true;
190795
- }
190796
- } else if ((selectedContent == null ? void 0 : selectedContent.type) === ContentType.Template) {
190797
- const template = (_j2 = templatesRef.current) == null ? void 0 : _j2.find(
190798
- (template2) => template2.id === selectedContent.id
190799
- );
190800
- if (template) {
190801
- code = template.code;
190802
- hasContent = true;
190803
- }
190804
- }
190805
- if (code) {
190806
- transformCodeToSchema(code).then((value) => {
190807
- setSchema({
190808
- schema: { ...defaultSchema, children: (value == null ? void 0 : value.template) || [] },
190809
- config: { ...defaultConfig2, ...value.resources }
190810
- });
190811
- });
190812
- } else if (hasContent) {
190813
- setSchema({
190814
- schema: { ...defaultSchema, children: [] }
190815
- });
190816
- }
190817
- }, [selectedContent == null ? void 0 : selectedContent.id, selectedContent == null ? void 0 : selectedContent.type]);
190818
- console.log("===>schema", schema);
190819
- return schema;
190820
- }
190821
- function useCloseDrawer() {
190822
- const setDrawerType = useStudioStore((state) => state.setDrawerType);
190823
- const drawerDocked = useStudioStore((state) => state.drawerDocked);
190824
- const close = useCallback(() => {
190825
- if (!drawerDocked) {
190826
- setDrawerType(void 0);
190827
- }
190828
- }, [drawerDocked, setDrawerType]);
190829
- return close;
190830
- }
190831
- function useIsBaseLangTheme() {
190832
- var _a3, _b3;
190833
- const theme = useStudioTheme();
190834
- const website = useWebsite();
190835
- return ((_a3 = theme == null ? void 0 : theme.lang) == null ? void 0 : _a3.id) === ((_b3 = website == null ? void 0 : website.baseLang) == null ? void 0 : _b3.id);
190836
- }
190837
190809
  function useImportTheme() {
190838
190810
  const [isUploading, setIsUploading] = useState(false);
190839
190811
  const [isImporting, setIsImporting] = useState(false);
@@ -203947,4 +203919,4 @@ export {
203947
203919
  typescriptDefaults as t,
203948
203920
  useCustomizedMaterials as u
203949
203921
  };
203950
- //# sourceMappingURL=index-add86284.js.map
203922
+ //# sourceMappingURL=index-a36e35b9.js.map