@rxdrag/website-studio 0.0.43 → 0.0.44

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 (46) hide show
  1. package/dist/ThemeStudio.d.ts +1 -0
  2. package/dist/WebsiteStudio.d.ts +1 -1
  3. package/dist/components/StudioRoot/StudioRoot.d.ts +1 -1
  4. package/dist/components/StudioRoot/contexts.d.ts +2 -0
  5. package/dist/components/WebsiteDesigner/Toolbar/index.d.ts +3 -1
  6. package/dist/components/WebsiteDesigner/index.d.ts +1 -0
  7. package/dist/components/utils/uploadDeploymentFile.d.ts +1 -0
  8. package/dist/{cssMode-f11274aa.js → cssMode-f6ed7ab1.js} +3 -2
  9. package/dist/{cssMode-f11274aa.js.map → cssMode-f6ed7ab1.js.map} +1 -1
  10. package/dist/{freemarker2-fa37c278.js → freemarker2-0b5a20e1.js} +3 -2
  11. package/dist/{freemarker2-fa37c278.js.map → freemarker2-0b5a20e1.js.map} +1 -1
  12. package/dist/generator/hooks/useGetFrontComponents.d.ts +2 -0
  13. package/dist/generator/hooks/useGetPages.d.ts +2 -0
  14. package/dist/{handlebars-fd006403.js → handlebars-3e804cdc.js} +3 -2
  15. package/dist/{handlebars-fd006403.js.map → handlebars-3e804cdc.js.map} +1 -1
  16. package/dist/hooks/index.d.ts +1 -0
  17. package/dist/hooks/useTranslateTheme.d.ts +1 -0
  18. package/dist/{html-3604e3ba.js → html-bef31e01.js} +3 -2
  19. package/dist/{html-3604e3ba.js.map → html-bef31e01.js.map} +1 -1
  20. package/dist/{htmlMode-89afac94.js → htmlMode-190446f0.js} +3 -2
  21. package/dist/{htmlMode-89afac94.js.map → htmlMode-190446f0.js.map} +1 -1
  22. package/dist/{index-716d5730.js → index-add86284.js} +61 -51
  23. package/dist/{index-716d5730.js.map → index-add86284.js.map} +1 -1
  24. package/dist/index.mjs +2 -1
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/{javascript-318c4e10.js → javascript-a482a18d.js} +4 -3
  27. package/dist/{javascript-318c4e10.js.map → javascript-a482a18d.js.map} +1 -1
  28. package/dist/{jsonMode-45023839.js → jsonMode-36321e55.js} +3 -2
  29. package/dist/{jsonMode-45023839.js.map → jsonMode-36321e55.js.map} +1 -1
  30. package/dist/{liquid-fc2531a6.js → liquid-91f2b334.js} +3 -2
  31. package/dist/{liquid-fc2531a6.js.map → liquid-91f2b334.js.map} +1 -1
  32. package/dist/{mdx-91f5933a.js → mdx-5b3f4043.js} +3 -2
  33. package/dist/{mdx-91f5933a.js.map → mdx-5b3f4043.js.map} +1 -1
  34. package/dist/{python-a455e25d.js → python-5ab24881.js} +3 -2
  35. package/dist/{python-a455e25d.js.map → python-5ab24881.js.map} +1 -1
  36. package/dist/{razor-8f4c02a1.js → razor-e2cba756.js} +3 -2
  37. package/dist/{razor-8f4c02a1.js.map → razor-e2cba756.js.map} +1 -1
  38. package/dist/{tsMode-b18c77cc.js → tsMode-a884ed37.js} +3 -2
  39. package/dist/{tsMode-b18c77cc.js.map → tsMode-a884ed37.js.map} +1 -1
  40. package/dist/{typescript-b387ecba.js → typescript-47724791.js} +3 -2
  41. package/dist/{typescript-b387ecba.js.map → typescript-47724791.js.map} +1 -1
  42. package/dist/{xml-df668467.js → xml-3d847f47.js} +3 -2
  43. package/dist/{xml-df668467.js.map → xml-3d847f47.js.map} +1 -1
  44. package/dist/{yaml-44a8e644.js → yaml-f547855f.js} +3 -2
  45. package/dist/{yaml-44a8e644.js.map → yaml-f547855f.js.map} +1 -1
  46. package/package.json +19 -18
@@ -37,6 +37,7 @@ 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";
40
41
  import { ComponentRender } from "@rxdrag/react-runner-pro";
41
42
  import tinycolor from "tinycolor2";
42
43
  var jsxRuntime = { exports: {} };
@@ -1280,7 +1281,7 @@ function newComponentCategoryQueryOptions(themeId) {
1280
1281
  }
1281
1282
  function StudioRoot(props) {
1282
1283
  var _a3, _b3;
1283
- const { theme, previewUrl, children } = props;
1284
+ const { theme, deployUrl, children } = props;
1284
1285
  const website = useWebsite();
1285
1286
  const { data: baseLangThemeData, isLoading: baseLangThemeLoading } = useOneTheme(
1286
1287
  new ThemeQueryOptions([ThemeFields.id, ThemeFields.parentThemeId], {
@@ -1409,20 +1410,9 @@ function StudioRoot(props) {
1409
1410
  parentTheme,
1410
1411
  baseLangThemeId: baseLangThemeData == null ? void 0 : baseLangThemeData.id,
1411
1412
  loading,
1412
- previewUrl
1413
+ deployUrl
1413
1414
  };
1414
- }, [
1415
- theme,
1416
- templateCategories,
1417
- templatesData == null ? void 0 : templatesData.items,
1418
- componentCategories,
1419
- componentsData == null ? void 0 : componentsData.items,
1420
- pagesData == null ? void 0 : pagesData.items,
1421
- parentTheme,
1422
- baseLangThemeData == null ? void 0 : baseLangThemeData.id,
1423
- loading,
1424
- previewUrl
1425
- ]);
1415
+ }, [theme, templateCategories, templatesData == null ? void 0 : templatesData.items, componentCategories, componentsData == null ? void 0 : componentsData.items, pagesData == null ? void 0 : pagesData.items, parentTheme, baseLangThemeData == null ? void 0 : baseLangThemeData.id, loading, deployUrl]);
1426
1416
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(StudioContext.Provider, { value: studioData, children: [
1427
1417
  children,
1428
1418
  /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalLoading, { loading })
@@ -138172,7 +138162,7 @@ registerLanguage({
138172
138162
  aliases: ["FreeMarker2", "Apache FreeMarker2"],
138173
138163
  loader: () => {
138174
138164
  {
138175
- return import("./freemarker2-fa37c278.js").then((m2) => m2.TagAutoInterpolationDollar);
138165
+ return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAutoInterpolationDollar);
138176
138166
  }
138177
138167
  }
138178
138168
  });
@@ -138181,7 +138171,7 @@ registerLanguage({
138181
138171
  aliases: ["FreeMarker2 (Angle/Dollar)", "Apache FreeMarker2 (Angle/Dollar)"],
138182
138172
  loader: () => {
138183
138173
  {
138184
- return import("./freemarker2-fa37c278.js").then((m2) => m2.TagAngleInterpolationDollar);
138174
+ return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAngleInterpolationDollar);
138185
138175
  }
138186
138176
  }
138187
138177
  });
@@ -138190,7 +138180,7 @@ registerLanguage({
138190
138180
  aliases: ["FreeMarker2 (Bracket/Dollar)", "Apache FreeMarker2 (Bracket/Dollar)"],
138191
138181
  loader: () => {
138192
138182
  {
138193
- return import("./freemarker2-fa37c278.js").then((m2) => m2.TagBracketInterpolationDollar);
138183
+ return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagBracketInterpolationDollar);
138194
138184
  }
138195
138185
  }
138196
138186
  });
@@ -138199,7 +138189,7 @@ registerLanguage({
138199
138189
  aliases: ["FreeMarker2 (Angle/Bracket)", "Apache FreeMarker2 (Angle/Bracket)"],
138200
138190
  loader: () => {
138201
138191
  {
138202
- return import("./freemarker2-fa37c278.js").then((m2) => m2.TagAngleInterpolationBracket);
138192
+ return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAngleInterpolationBracket);
138203
138193
  }
138204
138194
  }
138205
138195
  });
@@ -138208,7 +138198,7 @@ registerLanguage({
138208
138198
  aliases: ["FreeMarker2 (Bracket/Bracket)", "Apache FreeMarker2 (Bracket/Bracket)"],
138209
138199
  loader: () => {
138210
138200
  {
138211
- return import("./freemarker2-fa37c278.js").then((m2) => m2.TagBracketInterpolationBracket);
138201
+ return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagBracketInterpolationBracket);
138212
138202
  }
138213
138203
  }
138214
138204
  });
@@ -138217,7 +138207,7 @@ registerLanguage({
138217
138207
  aliases: ["FreeMarker2 (Auto/Dollar)", "Apache FreeMarker2 (Auto/Dollar)"],
138218
138208
  loader: () => {
138219
138209
  {
138220
- return import("./freemarker2-fa37c278.js").then((m2) => m2.TagAutoInterpolationDollar);
138210
+ return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAutoInterpolationDollar);
138221
138211
  }
138222
138212
  }
138223
138213
  });
@@ -138226,7 +138216,7 @@ registerLanguage({
138226
138216
  aliases: ["FreeMarker2 (Auto/Bracket)", "Apache FreeMarker2 (Auto/Bracket)"],
138227
138217
  loader: () => {
138228
138218
  {
138229
- return import("./freemarker2-fa37c278.js").then((m2) => m2.TagAutoInterpolationBracket);
138219
+ return import("./freemarker2-0b5a20e1.js").then((m2) => m2.TagAutoInterpolationBracket);
138230
138220
  }
138231
138221
  }
138232
138222
  });
@@ -138276,7 +138266,7 @@ registerLanguage({
138276
138266
  mimetypes: ["text/x-handlebars-template"],
138277
138267
  loader: () => {
138278
138268
  {
138279
- return import("./handlebars-fd006403.js");
138269
+ return import("./handlebars-3e804cdc.js");
138280
138270
  }
138281
138271
  }
138282
138272
  });
@@ -138309,7 +138299,7 @@ registerLanguage({
138309
138299
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
138310
138300
  loader: () => {
138311
138301
  {
138312
- return import("./html-3604e3ba.js");
138302
+ return import("./html-bef31e01.js");
138313
138303
  }
138314
138304
  }
138315
138305
  });
@@ -138362,7 +138352,7 @@ registerLanguage({
138362
138352
  mimetypes: ["text/javascript"],
138363
138353
  loader: () => {
138364
138354
  {
138365
- return import("./javascript-318c4e10.js");
138355
+ return import("./javascript-a482a18d.js");
138366
138356
  }
138367
138357
  }
138368
138358
  });
@@ -138461,7 +138451,7 @@ registerLanguage({
138461
138451
  mimetypes: ["application/liquid"],
138462
138452
  loader: () => {
138463
138453
  {
138464
- return import("./liquid-fc2531a6.js");
138454
+ return import("./liquid-91f2b334.js");
138465
138455
  }
138466
138456
  }
138467
138457
  });
@@ -138509,7 +138499,7 @@ registerLanguage({
138509
138499
  aliases: ["MDX", "mdx"],
138510
138500
  loader: () => {
138511
138501
  {
138512
- return import("./mdx-91f5933a.js");
138502
+ return import("./mdx-5b3f4043.js");
138513
138503
  }
138514
138504
  }
138515
138505
  });
@@ -138768,7 +138758,7 @@ registerLanguage({
138768
138758
  firstLine: "^#!/.*\\bpython[0-9.-]*\\b",
138769
138759
  loader: () => {
138770
138760
  {
138771
- return import("./python-a455e25d.js");
138761
+ return import("./python-5ab24881.js");
138772
138762
  }
138773
138763
  }
138774
138764
  });
@@ -138817,7 +138807,7 @@ registerLanguage({
138817
138807
  mimetypes: ["text/x-cshtml"],
138818
138808
  loader: () => {
138819
138809
  {
138820
- return import("./razor-8f4c02a1.js");
138810
+ return import("./razor-e2cba756.js");
138821
138811
  }
138822
138812
  }
138823
138813
  });
@@ -139153,7 +139143,7 @@ registerLanguage({
139153
139143
  mimetypes: ["text/typescript"],
139154
139144
  loader: () => {
139155
139145
  {
139156
- return import("./typescript-b387ecba.js");
139146
+ return import("./typescript-47724791.js");
139157
139147
  }
139158
139148
  }
139159
139149
  });
@@ -139237,7 +139227,7 @@ registerLanguage({
139237
139227
  mimetypes: ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"],
139238
139228
  loader: () => {
139239
139229
  {
139240
- return import("./xml-df668467.js");
139230
+ return import("./xml-3d847f47.js");
139241
139231
  }
139242
139232
  }
139243
139233
  });
@@ -139254,7 +139244,7 @@ registerLanguage({
139254
139244
  mimetypes: ["application/x-yaml", "text/x-yaml"],
139255
139245
  loader: () => {
139256
139246
  {
139257
- return import("./yaml-44a8e644.js");
139247
+ return import("./yaml-f547855f.js");
139258
139248
  }
139259
139249
  }
139260
139250
  });
@@ -139378,7 +139368,7 @@ var lessDefaults = new LanguageServiceDefaultsImpl$3(
139378
139368
  monaco_editor_core_exports$3.languages.css = { cssDefaults, lessDefaults, scssDefaults };
139379
139369
  function getMode$3() {
139380
139370
  {
139381
- return import("./cssMode-f11274aa.js");
139371
+ return import("./cssMode-f6ed7ab1.js");
139382
139372
  }
139383
139373
  }
139384
139374
  monaco_editor_core_exports$3.languages.onLanguage("less", () => {
@@ -139509,7 +139499,7 @@ monaco_editor_core_exports$2.languages.html = {
139509
139499
  };
139510
139500
  function getMode$2() {
139511
139501
  {
139512
- return import("./htmlMode-89afac94.js");
139502
+ return import("./htmlMode-190446f0.js");
139513
139503
  }
139514
139504
  }
139515
139505
  function registerHTMLLanguageService(languageId, options = optionsDefault, modeConfiguration = getConfigurationDefault(languageId)) {
@@ -139607,7 +139597,7 @@ var getWorker = () => getMode$1().then((mode) => mode.getWorker());
139607
139597
  monaco_editor_core_exports$1.languages.json = { jsonDefaults, getWorker };
139608
139598
  function getMode$1() {
139609
139599
  {
139610
- return import("./jsonMode-45023839.js");
139600
+ return import("./jsonMode-36321e55.js");
139611
139601
  }
139612
139602
  }
139613
139603
  monaco_editor_core_exports$1.languages.register({
@@ -139883,7 +139873,7 @@ monaco_editor_core_exports.languages.typescript = {
139883
139873
  };
139884
139874
  function getMode() {
139885
139875
  {
139886
- return import("./tsMode-b18c77cc.js");
139876
+ return import("./tsMode-a884ed37.js");
139887
139877
  }
139888
139878
  }
139889
139879
  monaco_editor_core_exports.languages.onLanguage("typescript", () => {
@@ -198170,8 +198160,23 @@ function Welcome(props) {
198170
198160
  ] })
198171
198161
  ] });
198172
198162
  }
198173
- const WebsiteToolbar = memo(() => {
198163
+ async function uploadDeploymentFile(formData, deployURL) {
198164
+ console.log("uploadDeploymentFile to", deployURL);
198165
+ if (!deployURL) {
198166
+ throw new Error("No deploy URL");
198167
+ }
198168
+ const response = await fetch(deployURL, {
198169
+ method: "POST",
198170
+ body: formData
198171
+ });
198172
+ if (!response.ok) {
198173
+ throw new Error("Network response was not ok");
198174
+ }
198175
+ return await Promise.resolve();
198176
+ }
198177
+ const WebsiteToolbar = memo((props) => {
198174
198178
  var _a3, _b3;
198179
+ const { deployUrl } = props;
198175
198180
  const [isDeploying, setIsDeploying] = useState(false);
198176
198181
  const setError = useEntifyWrapperStore((state) => state.setGlobalError);
198177
198182
  const website = useWebsite();
@@ -198186,15 +198191,20 @@ const WebsiteToolbar = memo(() => {
198186
198191
  const deployWebsite = useCallback(async () => {
198187
198192
  try {
198188
198193
  setIsDeploying(true);
198194
+ const content = "hello world";
198195
+ const blob = new Blob([content], { type: "text/plain" });
198196
+ const formData = new FormData();
198197
+ formData.append("websiteId", (website == null ? void 0 : website.id) || "");
198198
+ formData.append("file", blob, "test.txt");
198199
+ uploadDeploymentFile(formData, deployUrl).then(() => {
198200
+ setIsDeploying(false);
198201
+ });
198189
198202
  } catch (e) {
198190
198203
  const typedE = e;
198191
- console.error(e);
198192
- setError(typedE instanceof Error ? typedE.message : typedE);
198193
- } finally {
198194
198204
  setIsDeploying(false);
198205
+ setError(typedE instanceof Error ? typedE.message : typedE);
198195
198206
  }
198196
- console.log("deployWebsite");
198197
- }, [setError]);
198207
+ }, [deployUrl, setError, website == null ? void 0 : website.id]);
198198
198208
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
198199
198209
  "div",
198200
198210
  {
@@ -202864,7 +202874,7 @@ function useCapabilities() {
202864
202874
  useCapabilityTheme();
202865
202875
  }
202866
202876
  function WebsiteDesigner(props) {
202867
- const { themeLoading } = props;
202877
+ const { themeLoading, deployUrl } = props;
202868
202878
  const aiAgent = useAiAgent();
202869
202879
  const [selected, setSelected] = useState("local");
202870
202880
  const drawerType = useStudioStore((state) => state.drawerType);
@@ -202980,7 +202990,7 @@ function WebsiteDesigner(props) {
202980
202990
  className: `dark flex-1 flex flex-col min-h-screen`,
202981
202991
  ref: handleRefChange,
202982
202992
  children: [
202983
- /* @__PURE__ */ jsxRuntimeExports.jsx(WebsiteToolbar, {}),
202993
+ /* @__PURE__ */ jsxRuntimeExports.jsx(WebsiteToolbar, { deployUrl }),
202984
202994
  /* @__PURE__ */ jsxRuntimeExports.jsx(DocumentRoot, { doc, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "website-studio-core flex flex-1 h-full min-h-0 relative", children: [
202985
202995
  /* @__PURE__ */ jsxRuntimeExports.jsx(
202986
202996
  LeftBar,
@@ -203031,20 +203041,20 @@ function WebsiteDesigner(props) {
203031
203041
  );
203032
203042
  }
203033
203043
  const WebsiteStudio = (props) => {
203034
- const { previewUrl, aiUrl, params } = props;
203044
+ const { deployUrl, aiUrl, params } = props;
203035
203045
  const { websiteId } = params;
203036
- return /* @__PURE__ */ jsxRuntimeExports.jsx(SiteRoot, { websiteId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(WebsiteStudioInner, { aiUrl, previewUrl }) });
203046
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SiteRoot, { websiteId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(WebsiteStudioInner, { aiUrl, deployUrl }) });
203037
203047
  };
203038
203048
  function WebsiteStudioInner(props) {
203039
203049
  var _a3, _b3;
203040
- const { aiUrl, previewUrl } = props;
203050
+ const { aiUrl, deployUrl } = props;
203041
203051
  const website = useWebsite();
203042
203052
  const langId = ((_a3 = useCurrentLang()) == null ? void 0 : _a3.id) || ((_b3 = website == null ? void 0 : website.baseLang) == null ? void 0 : _b3.id);
203043
203053
  const { data: theme, isLoading: themeLoading } = useOneTheme(
203044
203054
  newThemeQueryOptions(website == null ? void 0 : website.id, langId)
203045
203055
  );
203046
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(StudioRoot, { theme, previewUrl, children: [
203047
- /* @__PURE__ */ jsxRuntimeExports.jsx(EditorScope, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AiAgentRoot, { endpoint: aiUrl, globalProvider: WEBSITE_DESIGN_PROMPT, children: /* @__PURE__ */ jsxRuntimeExports.jsx(WebsiteDesigner, { themeLoading }) }) }),
203056
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(StudioRoot, { theme, deployUrl, children: [
203057
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EditorScope, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AiAgentRoot, { endpoint: aiUrl, globalProvider: WEBSITE_DESIGN_PROMPT, children: /* @__PURE__ */ jsxRuntimeExports.jsx(WebsiteDesigner, { themeLoading, deployUrl }) }) }),
203048
203058
  /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalLoading, { loading: themeLoading })
203049
203059
  ] });
203050
203060
  }
@@ -203913,12 +203923,12 @@ function ThemeDesigner(props) {
203913
203923
  ] });
203914
203924
  }
203915
203925
  const ThemeStudio = (props) => {
203916
- const { aiUrl, themeId } = props;
203926
+ const { aiUrl, deployURL, themeId } = props;
203917
203927
  const { data: theme, isLoading: themeLoading } = useOneThemeById(
203918
203928
  themeId,
203919
203929
  newThemeByIdQueryOptions()
203920
203930
  );
203921
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(StudioRoot, { theme, children: [
203931
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(StudioRoot, { theme, deployUrl: deployURL, children: [
203922
203932
  /* @__PURE__ */ jsxRuntimeExports.jsx(EditorScope, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AiAgentRoot, { endpoint: aiUrl, globalProvider: WEBSITE_DESIGN_PROMPT, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeDesigner, {}) }) }),
203923
203933
  /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalLoading, { loading: themeLoading })
203924
203934
  ] });
@@ -203937,4 +203947,4 @@ export {
203937
203947
  typescriptDefaults as t,
203938
203948
  useCustomizedMaterials as u
203939
203949
  };
203940
- //# sourceMappingURL=index-716d5730.js.map
203950
+ //# sourceMappingURL=index-add86284.js.map