@enerex/template-studio 1.1.46 → 1.1.49
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.
- package/dist/CraftLogoAnimated-krR7PJb-.mjs +959 -0
- package/dist/ExchangeLiveLogoAnimated-lh3AvtCi.mjs +330 -0
- package/dist/ExchangeLogoAnimated-BfEEO0we.mjs +128 -0
- package/dist/GeneratorLogoAnimated-C7Qjs1Aj.mjs +47 -0
- package/dist/InsightsLogoAnimated-BeYSz-hF.mjs +180 -0
- package/dist/PropellerLogoAnimated-EK-YLCSR.mjs +20 -0
- package/dist/SparkplugLogoAnimated-DG8-eD8V.mjs +109 -0
- package/dist/enerex-template-editor.es.js +24300 -1696
- package/dist/enerex-template-editor.umd.js +2430 -16
- package/dist/template-studio.css +5 -1
- package/dist/types/component/TemplateList/components/TemplateActionsCell.d.ts +14 -0
- package/dist/types/component/TemplateList/components/TemplateModal.d.ts +13 -0
- package/dist/types/component/TemplateList/components/TemplateStatusCell.d.ts +8 -0
- package/dist/types/component/TemplateList/components/TemplateTable.d.ts +15 -0
- package/dist/types/component/TemplateList/index.d.ts +9 -14
- package/dist/types/component/TemplateList/types.d.ts +12 -0
- package/dist/types/component/TemplateList/useTemplateController.d.ts +20 -0
- package/dist/types/component/editor/index.d.ts +2 -0
- package/dist/types/component/editormodal/index.d.ts +5 -2
- package/dist/types/component/icons/box-icon.d.ts +2 -0
- package/dist/types/component/icons/layers-icon.d.ts +2 -0
- package/dist/types/component/icons/star-icon.d.ts +2 -0
- package/dist/types/component/template-form/index.d.ts +4 -2
- package/dist/types/hook/useStripoObserver.d.ts +3 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/queries/endpoints.d.ts +1 -0
- package/dist/types/queries/get_exclude_category.query.d.ts +1 -1
- package/dist/types/queries/get_template_list.query.d.ts +1 -1
- package/dist/types/queries/get_template_list_all.query.d.ts +1 -1
- package/dist/types/queries/get_template_settings.mutation.d.ts +2 -0
- package/dist/types/queries/get_template_tags.query.d.ts +1 -1
- package/dist/types/queries/get_template_types.query.d.ts +1 -1
- package/dist/types/queries/types.d.ts +6 -0
- package/dist/types/utils/stripoDomUtils.d.ts +2 -0
- package/dist/types/utils/utility.d.ts +1 -0
- package/package.json +7 -2
- package/dist/types/component/TemplateList/SortableTh.d.ts +0 -11
- package/dist/types/component/TemplateList/pagination/pagination.d.ts +0 -9
- package/dist/types/component/TemplateList/template-row.d.ts +0 -14
- package/dist/types/component/icons/down-icon.d.ts +0 -6
- package/dist/types/component/icons/ellipsis-vertical-icon.d.ts +0 -6
- package/dist/types/component/icons/serach-icon.d.ts +0 -2
- package/dist/types/component/icons/up-icon.d.ts +0 -6
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ITemplateWithChain } from "../types";
|
|
3
|
+
interface TemplateActionsCellProps {
|
|
4
|
+
template: ITemplateWithChain;
|
|
5
|
+
isAdmin?: boolean;
|
|
6
|
+
openActionId: string | null;
|
|
7
|
+
setOpenActionId: (id: string | null) => void;
|
|
8
|
+
onEdit: (template: ITemplateWithChain) => void;
|
|
9
|
+
onDuplicate: (template: ITemplateWithChain) => void;
|
|
10
|
+
onRemove: (template: ITemplateWithChain) => void;
|
|
11
|
+
onPreview: (template: ITemplateWithChain) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: React.NamedExoticComponent<TemplateActionsCellProps>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModalVariant } from "../../../type/application-type";
|
|
2
|
+
import type { ITemplateWithChain } from "../types";
|
|
3
|
+
interface Props {
|
|
4
|
+
show: boolean;
|
|
5
|
+
variant: ModalVariant;
|
|
6
|
+
template: ITemplateWithChain | null;
|
|
7
|
+
isNameAlreadyPresent: boolean;
|
|
8
|
+
onConfirm: (value?: string) => void;
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
onInputChange: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const TemplateModal: React.FC<Props>;
|
|
13
|
+
export default TemplateModal;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ITemplateWithChain } from "../types";
|
|
3
|
+
interface Props {
|
|
4
|
+
data: ITemplateWithChain[];
|
|
5
|
+
isAdmin: boolean;
|
|
6
|
+
openActionId: string | null;
|
|
7
|
+
setOpenActionId: (id: string | null) => void;
|
|
8
|
+
onEdit: (t: ITemplateWithChain) => void;
|
|
9
|
+
onDuplicate: (t: ITemplateWithChain) => void;
|
|
10
|
+
onRemove: (t: ITemplateWithChain) => void;
|
|
11
|
+
onPreview: (t: ITemplateWithChain) => void;
|
|
12
|
+
onRefresh: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const TemplateTable: React.FC<Props>;
|
|
15
|
+
export default TemplateTable;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./template-list.css";
|
|
1
3
|
import type { ITemplatesList, ITemplateTypes } from "../../queries/types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
name: string;
|
|
5
|
-
key: number;
|
|
6
|
-
}
|
|
7
|
-
export interface ITemplateWithChain extends ITemplatesList {
|
|
8
|
-
categoryChain: ChainNode[];
|
|
9
|
-
}
|
|
10
|
-
interface TemplatesListPageProps {
|
|
4
|
+
import type { ITemplateWithChain } from "./types";
|
|
5
|
+
interface Props {
|
|
11
6
|
templates: ITemplatesList[];
|
|
12
7
|
templateTypes: ITemplateTypes[];
|
|
13
|
-
onRefresh: () => void;
|
|
14
8
|
onAdd: () => void;
|
|
15
|
-
onEdit: (
|
|
16
|
-
onPreview: (
|
|
9
|
+
onEdit: (t: ITemplateWithChain) => void;
|
|
10
|
+
onPreview: (t: ITemplateWithChain) => void;
|
|
11
|
+
onRefresh: () => void;
|
|
17
12
|
}
|
|
18
|
-
declare const
|
|
19
|
-
export default
|
|
13
|
+
declare const TemplatesList: React.FC<Props>;
|
|
14
|
+
export default TemplatesList;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Variant } from "react-bootstrap/esm/types";
|
|
2
|
+
import type { ITemplatesList } from "../../queries/types";
|
|
3
|
+
export interface ChainNode {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
key: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ITemplateWithChain extends ITemplatesList {
|
|
9
|
+
categoryChain: ChainNode[];
|
|
10
|
+
}
|
|
11
|
+
export type StatusBadgeColors<T extends string = string> = Record<T, Variant>;
|
|
12
|
+
export declare const templateBadgeColors: StatusBadgeColors;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ITemplatesList, ITemplateTypes } from "../../queries/types";
|
|
2
|
+
import type { ModalVariant } from "../../type/application-type";
|
|
3
|
+
import type { ITemplateWithChain } from "./types";
|
|
4
|
+
export declare const useTemplateController: (templates: ITemplatesList[], templateTypes: ITemplateTypes[], onRefresh: () => void) => {
|
|
5
|
+
templatesWithChain: ITemplateWithChain[];
|
|
6
|
+
isAdmin: boolean;
|
|
7
|
+
openActionId: string | null;
|
|
8
|
+
setOpenActionId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
9
|
+
onDuplicate: (template: ITemplateWithChain) => void;
|
|
10
|
+
onRemove: (template: ITemplateWithChain) => void;
|
|
11
|
+
handleConfirmModal: (value?: string) => Promise<void>;
|
|
12
|
+
showModal: boolean;
|
|
13
|
+
setShowModal: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
14
|
+
variant: ModalVariant;
|
|
15
|
+
selectedTemplate: ITemplateWithChain | null;
|
|
16
|
+
isNameAlreadyPresent: boolean;
|
|
17
|
+
setIsNameAlreadyPresent: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
18
|
+
loadingDuplicate: boolean;
|
|
19
|
+
loadingDelete: boolean;
|
|
20
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { stripoData } from "../../type/application-type";
|
|
2
|
+
import type { IProposalSettings } from "../../queries/types";
|
|
2
3
|
interface IproposalEditorProps {
|
|
3
4
|
templateHTML?: stripoData;
|
|
4
5
|
className?: string;
|
|
5
6
|
loading?: boolean;
|
|
6
7
|
onEditorInitialized?: (initialized: boolean) => void;
|
|
8
|
+
proposalSettings: IProposalSettings;
|
|
7
9
|
}
|
|
8
10
|
declare const ProposalEditor: React.FC<IproposalEditorProps>;
|
|
9
11
|
export default ProposalEditor;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./editormodal.css";
|
|
2
|
+
import type { IProposalSettings, ITemplatesList, ITemplateTypes } from "../../queries/types";
|
|
2
3
|
import type { EditorModalVariant } from "../../type/application-type";
|
|
3
4
|
interface EditorModalProps {
|
|
4
5
|
show: boolean;
|
|
5
6
|
mode: EditorModalVariant;
|
|
6
|
-
template?:
|
|
7
|
+
template?: ITemplatesList;
|
|
7
8
|
templateTypes: ITemplateTypes[];
|
|
8
9
|
templateList: ITemplatesList[];
|
|
9
10
|
editorInitialized: boolean;
|
|
@@ -12,6 +13,8 @@ interface EditorModalProps {
|
|
|
12
13
|
onClose: () => void;
|
|
13
14
|
onSaved: () => void;
|
|
14
15
|
onRefresh: () => void;
|
|
16
|
+
isTemplateNameExists: (name: string, excludeId?: string) => boolean;
|
|
17
|
+
proposalSettings: IProposalSettings;
|
|
15
18
|
}
|
|
16
19
|
declare const EditorModal: React.FC<EditorModalProps>;
|
|
17
20
|
export default EditorModal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IProposalSettings, ITemplatesList, ITemplateTypes } from "../../queries/types";
|
|
3
3
|
import type { EditorModalVariant } from "../../type/application-type";
|
|
4
4
|
interface ITemplateFormProps {
|
|
5
5
|
onReset: () => void;
|
|
@@ -7,9 +7,11 @@ interface ITemplateFormProps {
|
|
|
7
7
|
mode: EditorModalVariant;
|
|
8
8
|
templateTypes: ITemplateTypes[];
|
|
9
9
|
templateList: ITemplatesList[];
|
|
10
|
-
template?:
|
|
10
|
+
template?: ITemplatesList;
|
|
11
11
|
onRefresh: () => void;
|
|
12
12
|
closeEditorModal: () => void;
|
|
13
|
+
isTemplateNameExists: (name: string, excludeId?: string) => boolean;
|
|
14
|
+
proposalSettings: IProposalSettings;
|
|
13
15
|
}
|
|
14
16
|
declare const TemplateForm: React.FC<ITemplateFormProps>;
|
|
15
17
|
export default TemplateForm;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getExcludeCategory: () => import("@tanstack/react-query").UseQueryResult<number[] | undefined,
|
|
1
|
+
export declare const getExcludeCategory: () => import("@tanstack/react-query").UseQueryResult<number[] | undefined, Error>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ITemplatesList } from "./types";
|
|
2
|
-
export declare const getTemplatesList: () => import("@tanstack/react-query").UseQueryResult<ITemplatesList[] | undefined,
|
|
2
|
+
export declare const getTemplatesList: () => import("@tanstack/react-query").UseQueryResult<ITemplatesList[] | undefined, Error>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ITemplatesList } from "./types";
|
|
2
|
-
export declare const getTemplatesListAll: () => import("@tanstack/react-query").UseQueryResult<ITemplatesList[] | undefined,
|
|
2
|
+
export declare const getTemplatesListAll: () => import("@tanstack/react-query").UseQueryResult<ITemplatesList[] | undefined, Error>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TemplateTag } from "./types";
|
|
2
|
-
export declare const getTemplateTags: () => import("@tanstack/react-query").UseQueryResult<TemplateTag[] | undefined,
|
|
2
|
+
export declare const getTemplateTags: () => import("@tanstack/react-query").UseQueryResult<TemplateTag[] | undefined, Error>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ITemplateTypes } from "./types";
|
|
2
|
-
export declare const getTemplateTypes: () => import("@tanstack/react-query").UseQueryResult<ITemplateTypes[] | undefined,
|
|
2
|
+
export declare const getTemplateTypes: () => import("@tanstack/react-query").UseQueryResult<ITemplateTypes[] | undefined, Error>;
|
|
@@ -15,6 +15,12 @@ export type ITemplatesList = {
|
|
|
15
15
|
html: string;
|
|
16
16
|
css?: string;
|
|
17
17
|
companyName?: string;
|
|
18
|
+
subject?: string;
|
|
19
|
+
proposalSettings: IProposalSettings;
|
|
20
|
+
};
|
|
21
|
+
export type IProposalSettings = {
|
|
22
|
+
primaryColor: string;
|
|
23
|
+
highlightColor: string;
|
|
18
24
|
};
|
|
19
25
|
export type ITemplate = {
|
|
20
26
|
templateID: string;
|
|
@@ -8,3 +8,4 @@ export declare function groupBy(array: any[]): {
|
|
|
8
8
|
}[];
|
|
9
9
|
export declare function groupByLevel(array: any[], level: number): any[];
|
|
10
10
|
export declare const formatToMMDDYY: (dateString?: string) => string;
|
|
11
|
+
export declare function applyThemeVariables(css: string, primary: string, highlight: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enerex/template-studio",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.49",
|
|
4
4
|
"main": "./dist/enerex-template-editor.umd.js",
|
|
5
5
|
"module": "./dist/enerex-template-editor.es.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -45,5 +45,10 @@
|
|
|
45
45
|
"vite",
|
|
46
46
|
"typescript",
|
|
47
47
|
"npm"
|
|
48
|
-
]
|
|
48
|
+
],
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@enerex/unified-ui-assets": "^1.0.61",
|
|
51
|
+
"@enerex/unified-ui-react": "^1.0.61",
|
|
52
|
+
"@enerex/unified-ui-utils": "^1.0.61"
|
|
53
|
+
}
|
|
49
54
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
type SortKey = "name" | "category" | "type" | "subtype" | "companyName" | "lastUpdatedBy" | "lastUpdatedOn" | "templateId" | null;
|
|
3
|
-
interface SortableThProps {
|
|
4
|
-
label: string;
|
|
5
|
-
sortKey: NonNullable<SortKey>;
|
|
6
|
-
sortBy: SortKey;
|
|
7
|
-
sortOrder: "asc" | "desc";
|
|
8
|
-
onSort: (key: SortKey) => void;
|
|
9
|
-
}
|
|
10
|
-
declare const SortableTh: React.FC<SortableThProps>;
|
|
11
|
-
export default SortableTh;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface PaginationProps {
|
|
2
|
-
page: number;
|
|
3
|
-
pageSize: number;
|
|
4
|
-
totalRecords: number;
|
|
5
|
-
onPageChange: (page: number) => void;
|
|
6
|
-
onPageSizeChange: (size: number) => void;
|
|
7
|
-
}
|
|
8
|
-
declare const Pagination: ({ page, pageSize, totalRecords, onPageChange, onPageSizeChange, }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default Pagination;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ITemplateWithChain } from ".";
|
|
2
|
-
interface TemplateRowProps {
|
|
3
|
-
template: ITemplateWithChain;
|
|
4
|
-
openActionId: string | null;
|
|
5
|
-
setOpenActionId: (id: string | null) => void;
|
|
6
|
-
onEdit: (template: ITemplateWithChain) => void;
|
|
7
|
-
onDuplicate: (template: ITemplateWithChain) => void;
|
|
8
|
-
onRemove: (template: ITemplateWithChain) => void;
|
|
9
|
-
onPreview: (template: ITemplateWithChain) => void;
|
|
10
|
-
onRefresh: () => void;
|
|
11
|
-
}
|
|
12
|
-
declare function TemplateRow({ template, openActionId, setOpenActionId, onEdit, onDuplicate, onRemove, onPreview, onRefresh, }: TemplateRowProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare const _default: import("react").MemoExoticComponent<typeof TemplateRow>;
|
|
14
|
-
export default _default;
|