@rxdrag/website-studio 0.0.6 → 0.0.8
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.
|
@@ -2,7 +2,7 @@ import { ListResult } from "@rxdrag/entify-hooks";
|
|
|
2
2
|
import { FrontComponent, Page, Template, Theme, WebsiteFrame } from "@rxdrag/rxcms-models";
|
|
3
3
|
import React from "react";
|
|
4
4
|
export type StudioContextProps = {
|
|
5
|
-
websiteId?: string;
|
|
5
|
+
websiteId?: string | null;
|
|
6
6
|
templates?: Template[];
|
|
7
7
|
components?: FrontComponent[];
|
|
8
8
|
pages?: ListResult<Page>;
|
|
@@ -5,7 +5,8 @@ import { StudioContextProps } from "../../components/StudioRoot";
|
|
|
5
5
|
export declare class WebsiteGenerator {
|
|
6
6
|
protected studioProps: StudioContextProps;
|
|
7
7
|
protected materials: IMaterial[];
|
|
8
|
-
|
|
8
|
+
protected endpoint: string | undefined;
|
|
9
|
+
constructor(studioProps: StudioContextProps, materials: IMaterial[], endpoint: string | undefined);
|
|
9
10
|
getComponents(): import("@rxdrag/rxcms-models").FrontComponent[];
|
|
10
11
|
getPages(): Page[] | undefined;
|
|
11
12
|
get404Page(): Page | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const TAILWIND_CONFIG = "#tailwindConfig#";
|
|
1
2
|
export declare const FRAME_CONTENT = "#frameContent#";
|
|
2
3
|
export declare const FRAME_IMPORTS = "#frameImports#";
|
|
3
4
|
export declare const FRAME_404 = "#frame404#";
|
|
@@ -8,6 +9,7 @@ export declare const APP_NAME = "#appName#";
|
|
|
8
9
|
export declare const APP_VERSION = "#appVersion#";
|
|
9
10
|
export declare const APP_PPACKAGES = "#appPackages#";
|
|
10
11
|
export declare const WEBSITE_ID = "#websiteId#";
|
|
12
|
+
export declare const ENTIFY_SERVER_URL = "#entifyServerUrl#";
|
|
11
13
|
export declare const LOADER_FUNCTION = "#loader#";
|
|
12
14
|
export declare const USE_LOADER_DATA = "#useLoaderData#";
|
|
13
15
|
export declare const rxcmsModelsVersion = "0.3.36";
|
package/dist/index.mjs
CHANGED
|
@@ -4,18 +4,18 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
var _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, _A, _B, _C, _D, _E, _F
|
|
7
|
+
var _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, _A, _B, _C, _D, _E, _F;
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import React__default, { createContext, useContext, useMemo, memo, Fragment, useCallback, useState, useEffect, forwardRef as forwardRef$1, useRef, useImperativeHandle, isValidElement, cloneElement } from "react";
|
|
10
10
|
import { useFilterMeta, useDesignerEngine, ComponentDesignersRoot, useComponentDesigners, useNode, Designer, useDocument, useDocumentChangedState, useCurrentNode, useGetNode, useChangeNodeMeta, useNodeMeta, useUndo, useRedo, useLanguage, useSetters, useResourceNode, useActiveIdState, useActions, useCurrentTree, useSelectedNodeIds, ComponentTreeWidget, useSelect, DocumentRoot } from "@rxdrag/react-core-pro";
|
|
11
11
|
import { RXID_ATTR_NAME, TOOLBAR_HEIGHT, CanvasScrollEvent, CanvasResizeEvent, numbToPx, getMaxZIndex, HistoryableActionType, MARGIN_DECORATOR_NAME, LINE_DECORTOR_NAME, LineDecorator, MarginDecorator, IFrameCanvasImpl, KeyboardDriver, DragDropDriver, DragOverDriver, MouseClickDriver, MouseMoveDriver, MouseOverOutDriver, CanvasResizeDriver, CanvasScrollDriver, MouseUpDriver, ContainerImpl } from "@rxdrag/core-pro";
|
|
12
12
|
import { TextNodeName } from "@rxdrag/schema-pro";
|
|
13
13
|
import { propSetters, Input, Textarea, ImageSelect, TargetSetter, DeviceBreakpoints, DeviceContext } from "@rxdrag/schema-setters";
|
|
14
|
-
import { createSchema as createSchema$1, staticMaterials, attachmentNameResource, XAttachmentIconMaterial, attachmentLinkResource, websiteSettingsContactResource, websiteSettingsAvatarResource, websiteSettingsAddressResource, webisteSettingsEmailResource, webisteSettingsTelResource, webisteSettingsFaxResource, webisteSettingMobileResource, userNameResource, userAvatarResource, userPositionResource, userProfileResource, userEmailResource, userTelResource, userMobileResource, userLinkedInResource, userTwitterResource, userFacebookResource, userInstagramResource, userLinkResource, productCategoryNameResource, productCategoryMediaResource, productCategoryDescriptionResource, productCategoryCreatedAtResource, productCategoryUpdatedAtResource, productCategoryProductsResource, proudctCategoryLinkResource, postCategoryNameResource, postCategoryDescriptionResource, postCategoryCreatedAtResource, postCategoryUpdatedAtResource, postCategoryPostsResource, postCategoryLinkResource, productTitleResource, productShortTitleResource, productCoverResource, productMediasResource, productDescriptionResource, productFeaturesResource, productContentResource, productContent2Resource, productContent3Resource, productPublishedAtResource, productCreatedAtResource, productUpdatedAtResource, productAssociationCategoryResource, productAttachmentsResource, productRelatedResource, productLinkResource, postCoverResource, postAuthorResource, postTitleResource, postDescriptionResource, postContentResource, postPublishedAtResource, postCreatedAtResource, postUpdatedAtResource, postAssociationCategoryResource, postOutlineResource, postLinkResource, productResource, productListResource, postResource, postListResource, productCategoryResource, productCategoryListResource, postCategoryResource, postCategoryListResource, searchListResource, featuredProductsResource, latestPostsResource, XPaginationMaterial, XPaginationPrevButtonMaterial, XPaginationNextButtonMaterial, XPaginationPagesMaterial, XPaginationPageIndexMaterial, XPaginationTotalMaterial, pageTitleResource, XBreadcrumbsMaterial, xHeading1Resource, xHeading2Resource, xHeading3Resource, xHeading4Resource, XParagraphMaterial, XDateMaterial, ImgMaterial, XIconMaterial, XMenuMaterial, XModalMaterial, XModalCloseMaterial, RouteLinkMaterial, XSearchMaterial, XShareMaterial, XToTopMaterial, XAnimationNumberMaterial, XSectionMaterial, XBoxMaterial, xRowName, xColName, XPageOutletMaterial, XTabsMaterial, XTabsNavTitleMaterial, XTabPanelMaterial, XFormMaterial,
|
|
14
|
+
import { createSchema as createSchema$1, staticMaterials, attachmentNameResource, XAttachmentIconMaterial, attachmentLinkResource, websiteSettingsContactResource, websiteSettingsAvatarResource, websiteSettingsAddressResource, webisteSettingsEmailResource, webisteSettingsTelResource, webisteSettingsFaxResource, webisteSettingMobileResource, userNameResource, userAvatarResource, userPositionResource, userProfileResource, userEmailResource, userTelResource, userMobileResource, userLinkedInResource, userTwitterResource, userFacebookResource, userInstagramResource, userLinkResource, productCategoryNameResource, productCategoryMediaResource, productCategoryDescriptionResource, productCategoryCreatedAtResource, productCategoryUpdatedAtResource, productCategoryProductsResource, proudctCategoryLinkResource, postCategoryNameResource, postCategoryDescriptionResource, postCategoryCreatedAtResource, postCategoryUpdatedAtResource, postCategoryPostsResource, postCategoryLinkResource, productTitleResource, productShortTitleResource, productCoverResource, productMediasResource, productDescriptionResource, productFeaturesResource, productContentResource, productContent2Resource, productContent3Resource, productPublishedAtResource, productCreatedAtResource, productUpdatedAtResource, productAssociationCategoryResource, productAttachmentsResource, productRelatedResource, productLinkResource, postCoverResource, postAuthorResource, postTitleResource, postDescriptionResource, postContentResource, postPublishedAtResource, postCreatedAtResource, postUpdatedAtResource, postAssociationCategoryResource, postOutlineResource, postLinkResource, productResource, productListResource, postResource, postListResource, productCategoryResource, productCategoryListResource, postCategoryResource, postCategoryListResource, searchListResource, featuredProductsResource, latestPostsResource, XPaginationMaterial, XPaginationPrevButtonMaterial, XPaginationNextButtonMaterial, XPaginationPagesMaterial, XPaginationPageIndexMaterial, XPaginationTotalMaterial, pageTitleResource, XBreadcrumbsMaterial, xHeading1Resource, xHeading2Resource, xHeading3Resource, xHeading4Resource, XParagraphMaterial, XDateMaterial, ImgMaterial, XIconMaterial, XMenuMaterial, XModalMaterial, XModalCloseMaterial, RouteLinkMaterial, XSearchMaterial, XShareMaterial, XToTopMaterial, XAnimationNumberMaterial, XSectionMaterial, XBoxMaterial, xRowName, xColName, XPageOutletMaterial, XTabsMaterial, XTabsNavTitleMaterial, XTabPanelMaterial, XFormMaterial, formEmailResource, formNameResource, formCompanyResource, formTelResource, formMessageResource, XSubmitMaterial, AMaterial, creatHtmlMaterial } from "@rxdrag/website-materials";
|
|
15
15
|
import { ThemeQueryOptions, ThemeFields, WebsiteFrameQueryOptions, WebsiteFrameFields, TemplateQueryOptions, TemplateFields, TemplateCategoryFields, PageQueryOptions, PageFields, PageAssciations, MediaQueryOptions, FrontComponentQueryOptions, FrontComponentFields, ComponentCategoryFields, MediaFields, WebsiteSettingsFields, ProductCategoryAssciations, ProductCategoryFields, ProductFields, PostFields, PostAssciations, UserFields, UserAssciations, ComponentType, FrontComponentEntityName, TemplateEntityName, mediaToInput, templateToInput, TemplateCategoryQueryOptions, frontComponentToInput, ComponentCategoryQueryOptions, ExtendFieldType, PageEntityName, PageType, pageToInput, ComponentCategoryEntityName, componentCategoryToInput, TemplateCategoryEntityName, templateCategoryToInput, MediaType, ProductAssciations, PostCategoryAssciations } from "@rxdrag/rxcms-models";
|
|
16
16
|
import { GlobalLoading, EntityEditModal, EntitySelectField, EditingPopoverScope, useRemoveRow, useEditRow, EntityListScope, EntityRowScope, useListData, QueryListScope, useNewRow, useIsLoading, NewButton } from "@rxdrag/rxcms-models-ui";
|
|
17
17
|
import { useOneTheme, useOneWebsiteFrame, useTemplateList, usePageList, useFrontComponentList, useUpsertOnePage, useUpsertOneWebsiteFrame, useUpsertOneTheme, useDeletePageById, useDeleteWebsiteFrameById } from "@rxdrag/rxcms-model-hooks";
|
|
18
|
-
import { OrderBy, useCreateEntityClient } from "@rxdrag/entify-hooks";
|
|
18
|
+
import { OrderBy, useCreateEntityClient, useEntifyEndpoint } from "@rxdrag/entify-hooks";
|
|
19
19
|
import { RecoilRoot, atom, selector, useRecoilValue, useRecoilState, useSetRecoilState } from "recoil";
|
|
20
20
|
import { cn, Switch, Button as Button$1, Popover, PopoverTrigger, PopoverContent, Input as Input$1, Divider, Tabs, Tab, Autocomplete, AutocompleteItem, Accordion, AccordionItem, Select, SelectItem, Dropdown, DropdownTrigger, DropdownMenu, DropdownItem, Textarea as Textarea$1, Badge, Image, Tooltip, CircularProgress } from "@nextui-org/react";
|
|
21
21
|
import { motion, LazyMotion, domAnimation, AnimatePresence, m } from "framer-motion";
|
|
@@ -1546,6 +1546,7 @@ function StudioRoot(props) {
|
|
|
1546
1546
|
const loading = isLoading || componentsLoading || themeLoading || pagesLoading || frameLoading;
|
|
1547
1547
|
const studioData = useMemo(() => {
|
|
1548
1548
|
return {
|
|
1549
|
+
websiteId,
|
|
1549
1550
|
theme,
|
|
1550
1551
|
frame,
|
|
1551
1552
|
templates: themplatesData == null ? void 0 : themplatesData.items,
|
|
@@ -1553,7 +1554,7 @@ function StudioRoot(props) {
|
|
|
1553
1554
|
pages: pagesData,
|
|
1554
1555
|
loading
|
|
1555
1556
|
};
|
|
1556
|
-
}, [componentsData == null ? void 0 : componentsData.items, frame, loading, pagesData, theme, themplatesData == null ? void 0 : themplatesData.items]);
|
|
1557
|
+
}, [componentsData == null ? void 0 : componentsData.items, frame, loading, pagesData, theme, themplatesData == null ? void 0 : themplatesData.items, websiteId]);
|
|
1557
1558
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(RecoilRoot, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(StudioContext.Provider, { value: studioData, children: [
|
|
1558
1559
|
children,
|
|
1559
1560
|
/* @__PURE__ */ jsxRuntimeExports.jsx(GlobalLoading, { loading })
|
|
@@ -12415,27 +12416,27 @@ const resourceTreeNodes = [
|
|
|
12415
12416
|
},
|
|
12416
12417
|
{
|
|
12417
12418
|
title: "邮箱",
|
|
12418
|
-
resource:
|
|
12419
|
+
resource: formEmailResource
|
|
12419
12420
|
},
|
|
12420
12421
|
{
|
|
12421
12422
|
title: "姓名",
|
|
12422
|
-
resource:
|
|
12423
|
+
resource: formNameResource
|
|
12423
12424
|
},
|
|
12424
12425
|
{
|
|
12425
12426
|
title: "公司",
|
|
12426
|
-
resource:
|
|
12427
|
+
resource: formCompanyResource
|
|
12427
12428
|
},
|
|
12428
12429
|
{
|
|
12429
12430
|
title: "电话",
|
|
12430
|
-
resource:
|
|
12431
|
+
resource: formTelResource
|
|
12431
12432
|
},
|
|
12432
12433
|
{
|
|
12433
12434
|
title: "内容",
|
|
12434
|
-
resource:
|
|
12435
|
+
resource: formMessageResource
|
|
12435
12436
|
},
|
|
12436
12437
|
{
|
|
12437
12438
|
title: "提交",
|
|
12438
|
-
resource: (
|
|
12439
|
+
resource: (_C = XSubmitMaterial.resource) == null ? void 0 : _C.name
|
|
12439
12440
|
}
|
|
12440
12441
|
]
|
|
12441
12442
|
},
|
|
@@ -12452,15 +12453,15 @@ const resourceTreeNodes = [
|
|
|
12452
12453
|
children: [
|
|
12453
12454
|
{
|
|
12454
12455
|
title: "a",
|
|
12455
|
-
resource: (
|
|
12456
|
+
resource: (_D = AMaterial.resource) == null ? void 0 : _D.name
|
|
12456
12457
|
},
|
|
12457
12458
|
{
|
|
12458
12459
|
title: "div",
|
|
12459
|
-
resource: (
|
|
12460
|
+
resource: (_E = creatHtmlMaterial("div").resource) == null ? void 0 : _E.name
|
|
12460
12461
|
},
|
|
12461
12462
|
{
|
|
12462
12463
|
title: "span",
|
|
12463
|
-
resource: (
|
|
12464
|
+
resource: (_F = creatHtmlMaterial("span").resource) == null ? void 0 : _F.name
|
|
12464
12465
|
},
|
|
12465
12466
|
{
|
|
12466
12467
|
title: "button"
|
|
@@ -15412,6 +15413,7 @@ const MenuContent = memo((props) => {
|
|
|
15412
15413
|
}
|
|
15413
15414
|
);
|
|
15414
15415
|
});
|
|
15416
|
+
const TAILWIND_CONFIG = "#tailwindConfig#";
|
|
15415
15417
|
const FRAME_CONTENT = "#frameContent#";
|
|
15416
15418
|
const FRAME_IMPORTS = "#frameImports#";
|
|
15417
15419
|
const FRAME_404 = "#frame404#";
|
|
@@ -15420,6 +15422,7 @@ const APP_NAME = "#appName#";
|
|
|
15420
15422
|
const APP_VERSION = "#appVersion#";
|
|
15421
15423
|
const APP_PPACKAGES = "#appPackages#";
|
|
15422
15424
|
const WEBSITE_ID = "#websiteId#";
|
|
15425
|
+
const ENTIFY_SERVER_URL = "#entifyServerUrl#";
|
|
15423
15426
|
const LOADER_FUNCTION = "#loader#";
|
|
15424
15427
|
const USE_LOADER_DATA = "#useLoaderData#";
|
|
15425
15428
|
const rxcmsModelsVersion = "0.3.36";
|
|
@@ -15427,8 +15430,11 @@ const entifyHooksVersion = "0.2.30";
|
|
|
15427
15430
|
const modelRemixLibVersion = "0.1.47";
|
|
15428
15431
|
const envTemplate = {
|
|
15429
15432
|
name: ".env",
|
|
15430
|
-
content: `
|
|
15431
|
-
|
|
15433
|
+
content: `ENTIFY_SERVER_URL = ${ENTIFY_SERVER_URL}
|
|
15434
|
+
WEBSITE_ID = ${WEBSITE_ID}
|
|
15435
|
+
ENTIFY_GUEST_TOKEN = "17bD#4!fG8^2wS*0z"
|
|
15436
|
+
#系统token,用于数据导入
|
|
15437
|
+
ENTIFY_SYSTEM_TOKEN="eyJhb3in87ds#5kdfjg"
|
|
15432
15438
|
`
|
|
15433
15439
|
};
|
|
15434
15440
|
const eslintrcTemplate = {
|
|
@@ -15577,6 +15583,7 @@ ${APP_PPACKAGES}
|
|
|
15577
15583
|
"devDependencies": {
|
|
15578
15584
|
"@remix-run/dev": "^2.9.1",
|
|
15579
15585
|
"@tailwindcss/forms": "^0.5.7",
|
|
15586
|
+
"@tailwindcss/typography": "^0.5.13",
|
|
15580
15587
|
"@types/cookie": "^0.6.0",
|
|
15581
15588
|
"@types/lodash-es": "^4.17.12",
|
|
15582
15589
|
"@types/react": "^18.2.20",
|
|
@@ -15636,16 +15643,17 @@ const remixEnvTemplate = {
|
|
|
15636
15643
|
const tailwindConfigTemplate = {
|
|
15637
15644
|
name: "tailwind.config.ts",
|
|
15638
15645
|
content: `import type { Config } from 'tailwindcss'
|
|
15646
|
+
import plugin from 'tailwindcss/plugin'
|
|
15647
|
+
import { colors } from 'tailwindcss/defaultTheme'
|
|
15639
15648
|
|
|
15640
15649
|
export default {
|
|
15641
15650
|
darkMode: 'class',
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
plugins: [
|
|
15647
|
-
require('@tailwindcss/forms'),
|
|
15651
|
+
//这个地方要注意,子项目必须包含路径,否则会渲染不出class
|
|
15652
|
+
content: [
|
|
15653
|
+
"./app/**/*.{js,jsx,ts,tsx}",
|
|
15654
|
+
'node_modules/@rxdrag/website-components/**/*.{js,ts,jsx,tsx}',
|
|
15648
15655
|
],
|
|
15656
|
+
${TAILWIND_CONFIG}
|
|
15649
15657
|
} satisfies Config
|
|
15650
15658
|
|
|
15651
15659
|
|
|
@@ -16210,6 +16218,9 @@ ${spacesStr}</${componentName}>`;
|
|
|
16210
16218
|
if ((xData.type === XDataType.Field || xData.type === XDataType.HasMany || xData.type === XDataType.HasOne) && xData.field) {
|
|
16211
16219
|
return ` value={datas?.["${xData.scope}"]?.${xData.field}}`;
|
|
16212
16220
|
}
|
|
16221
|
+
if (xData.type === XDataType.Query) {
|
|
16222
|
+
return ` value={datas?.["${xData.scope}"]?.items}`;
|
|
16223
|
+
}
|
|
16213
16224
|
return "";
|
|
16214
16225
|
}
|
|
16215
16226
|
slotsToTsxProps(slots, spaces = 0) {
|
|
@@ -16248,11 +16259,16 @@ ${spacesStr}}`).join("\n" + spacesStr);
|
|
|
16248
16259
|
}
|
|
16249
16260
|
const rootTemplate = {
|
|
16250
16261
|
name: "root.tsx",
|
|
16251
|
-
content: `import type { LoaderFunctionArgs } from "~/deploy/remix-run-node";
|
|
16262
|
+
content: `import type { LinksFunction, LoaderFunctionArgs } from "~/deploy/remix-run-node";
|
|
16252
16263
|
import { entify } from "@rxdrag/model-remix-lib";
|
|
16253
16264
|
import { useAppInit, XDataScope, HtmlDocument } from "@rxdrag/website-components";
|
|
16254
|
-
import "./tailwind.css";
|
|
16255
16265
|
${FRAME_IMPORTS}
|
|
16266
|
+
import styles from "./tailwind.css"
|
|
16267
|
+
|
|
16268
|
+
export const links: LinksFunction = () => [
|
|
16269
|
+
{ rel: "stylesheet", href: styles },
|
|
16270
|
+
// ... 其他样式链接
|
|
16271
|
+
];
|
|
16256
16272
|
|
|
16257
16273
|
${LOADER_FUNCTION}
|
|
16258
16274
|
|
|
@@ -16707,9 +16723,10 @@ const deployRemixRunNodeTemplate = {
|
|
|
16707
16723
|
`
|
|
16708
16724
|
};
|
|
16709
16725
|
class WebsiteGenerator {
|
|
16710
|
-
constructor(studioProps, materials) {
|
|
16726
|
+
constructor(studioProps, materials, endpoint) {
|
|
16711
16727
|
this.studioProps = studioProps;
|
|
16712
16728
|
this.materials = materials;
|
|
16729
|
+
this.endpoint = endpoint;
|
|
16713
16730
|
}
|
|
16714
16731
|
getComponents() {
|
|
16715
16732
|
return this.studioProps.components || [];
|
|
@@ -16730,19 +16747,26 @@ class WebsiteGenerator {
|
|
|
16730
16747
|
return this.studioProps.frame;
|
|
16731
16748
|
}
|
|
16732
16749
|
async generate() {
|
|
16733
|
-
var _a2, _b2, _c2;
|
|
16750
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
16734
16751
|
const zip = new JSZip();
|
|
16735
16752
|
const pages = this.getPages();
|
|
16736
16753
|
const frame = this.getFrame();
|
|
16737
16754
|
const comsStore = new TemplatesStore(this.getComponents(), this.materials);
|
|
16738
|
-
zip.file(
|
|
16755
|
+
zip.file(
|
|
16756
|
+
envTemplate.name,
|
|
16757
|
+
envTemplate.content.replace(WEBSITE_ID, this.studioProps.websiteId || "").replace(ENTIFY_SERVER_URL, this.endpoint || "")
|
|
16758
|
+
);
|
|
16739
16759
|
zip.file(eslintrcTemplate.name, eslintrcTemplate.content);
|
|
16740
16760
|
zip.file(gitignoreTemplate.name, gitignoreTemplate.content);
|
|
16741
16761
|
zip.file(postcssTemplate.name, postcssTemplate.content);
|
|
16742
16762
|
zip.file(readmeTemplate.name, readmeTemplate.content);
|
|
16743
16763
|
zip.file(remixConfigTemplate.name, remixConfigTemplate.content);
|
|
16744
16764
|
zip.file(remixEnvTemplate.name, remixEnvTemplate.content);
|
|
16745
|
-
|
|
16765
|
+
const tailwindConfigStr = ((_b2 = (_a2 = this.studioProps.theme) == null ? void 0 : _a2.tailwindConfig) == null ? void 0 : _b2.trim()) || "{}";
|
|
16766
|
+
zip.file(
|
|
16767
|
+
tailwindConfigTemplate.name,
|
|
16768
|
+
tailwindConfigTemplate.content.replace(TAILWIND_CONFIG, tailwindConfigStr.substring(1, tailwindConfigStr.length - 2) || "")
|
|
16769
|
+
);
|
|
16746
16770
|
zip.file(tsConfigTemplate.name, tsConfigTemplate.content);
|
|
16747
16771
|
const appFolder = zip.folder("app");
|
|
16748
16772
|
const usedMaterials = [];
|
|
@@ -16757,7 +16781,10 @@ class WebsiteGenerator {
|
|
|
16757
16781
|
);
|
|
16758
16782
|
usedMaterials.push(...frameCoder.getUsedMaterials());
|
|
16759
16783
|
appFolder.file(frameCoder.getFileName(), frameCoder.getFileCode());
|
|
16760
|
-
appFolder.file(
|
|
16784
|
+
appFolder.file(
|
|
16785
|
+
tailwindCssTemplate.name,
|
|
16786
|
+
tailwindCssTemplate.content.replace(CSS_CONTENT, ((_c2 = this.studioProps.theme) == null ? void 0 : _c2.css) || "")
|
|
16787
|
+
);
|
|
16761
16788
|
const deplyFolder = appFolder.folder("deploy");
|
|
16762
16789
|
if (deplyFolder) {
|
|
16763
16790
|
deplyFolder.file(deployEnvTemplate.name, deployEnvTemplate.content);
|
|
@@ -16768,7 +16795,7 @@ class WebsiteGenerator {
|
|
|
16768
16795
|
if (routesFolder) {
|
|
16769
16796
|
routesFolder.file(slugTemplate.name, slugTemplate.content);
|
|
16770
16797
|
for (const page of pages || []) {
|
|
16771
|
-
if ((
|
|
16798
|
+
if ((_e2 = (_d2 = page.content) == null ? void 0 : _d2.elements) == null ? void 0 : _e2.length) {
|
|
16772
16799
|
const pageCoder = new PageCoder(comsStore, page);
|
|
16773
16800
|
routesFolder.file(pageCoder.getFileName(), pageCoder.getFileCode());
|
|
16774
16801
|
usedMaterials.push(...pageCoder.getUsedMaterials());
|
|
@@ -16851,13 +16878,15 @@ function useExportWebsite() {
|
|
|
16851
16878
|
const save = useSave();
|
|
16852
16879
|
const contextValue = useStudioContext();
|
|
16853
16880
|
const materials = useAllMaterials();
|
|
16881
|
+
const endpoint = useEntifyEndpoint();
|
|
16854
16882
|
const exportWebsite = useCallback(async () => {
|
|
16855
16883
|
try {
|
|
16856
16884
|
if (nopClient && website) {
|
|
16857
16885
|
setExporting(true);
|
|
16858
16886
|
const generator = new WebsiteGenerator(
|
|
16859
16887
|
contextValue,
|
|
16860
|
-
materials
|
|
16888
|
+
materials,
|
|
16889
|
+
endpoint || ""
|
|
16861
16890
|
);
|
|
16862
16891
|
const zip = await generator.generate();
|
|
16863
16892
|
const content = await zip.generateAsync({ type: "blob" });
|
|
@@ -16869,7 +16898,7 @@ function useExportWebsite() {
|
|
|
16869
16898
|
} finally {
|
|
16870
16899
|
setExporting(false);
|
|
16871
16900
|
}
|
|
16872
|
-
}, [contextValue, materials, nopClient, save, setError, website]);
|
|
16901
|
+
}, [contextValue, endpoint, materials, nopClient, save, setError, website]);
|
|
16873
16902
|
return { exportWebsite, exporting };
|
|
16874
16903
|
}
|
|
16875
16904
|
const Toolbar = memo(() => {
|