lib-pixelbuild 0.1.4 → 0.2.1
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/README.md +102 -127
- package/dist/builders/PageBuilder.d.ts +3 -2
- package/dist/builders/PageBuilder.js +42 -33
- package/dist/components/CardComponent.d.ts +3 -3
- package/dist/components/CardComponent.js +71 -41
- package/dist/components/FormComponent.d.ts +3 -3
- package/dist/components/FormComponent.js +8 -14
- package/dist/components/ListComponent.d.ts +3 -2
- package/dist/components/ListComponent.js +20 -15
- package/dist/components/LoadingComponent.js +1 -1
- package/dist/components/MapComponent.js +19 -5
- package/dist/components/SliderComponent.js +59 -15
- package/dist/components/SocialIconsComponent.js +1 -1
- package/dist/components/TextComponent.d.ts +3 -3
- package/dist/components/TextComponent.js +6 -7
- package/dist/elements/AlertElement.js +4 -3
- package/dist/elements/ButtonElement.js +20 -17
- package/dist/elements/IconElement.d.ts +1 -2
- package/dist/elements/IconElement.js +8 -9
- package/dist/elements/IconMap.d.ts +2 -0
- package/dist/elements/IconMap.js +30 -0
- package/dist/elements/InputElement.js +19 -18
- package/dist/factories/ButtonActionFactory.d.ts +6 -1
- package/dist/factories/ButtonActionFactory.js +14 -4
- package/dist/index.d.ts +2 -6
- package/dist/index.js +1 -4
- package/dist/layouts/Header.d.ts +2 -1
- package/dist/layouts/Header.js +31 -5
- package/dist/layouts/SiteLayout.d.ts +2 -1
- package/dist/layouts/SiteLayout.js +2 -2
- package/dist/renderers/SectionRenderer.d.ts +3 -3
- package/dist/renderers/SectionRenderer.js +48 -30
- package/dist/services/EmailService.d.ts +10 -2
- package/dist/services/EmailService.js +27 -25
- package/dist/types/RawWebsiteType.d.ts +8 -184
- package/dist/utils/InputValidators.js +11 -11
- package/dist/utils/propertyUtils.d.ts +3 -0
- package/dist/utils/propertyUtils.js +28 -0
- package/package.json +33 -20
- package/dist/elements/FileElement.d.ts +0 -4
- package/dist/elements/FileElement.js +0 -6
- package/dist/services/ApiService.d.ts +0 -5
- package/dist/services/ApiService.js +0 -17
- package/dist/services/CacheService.d.ts +0 -5
- package/dist/services/CacheService.js +0 -16
- package/dist/services/ConstructorService.d.ts +0 -12
- package/dist/services/ConstructorService.js +0 -33
- package/dist/types/AuthenticateResponseType.d.ts +0 -5
- package/dist/types/AuthenticateResponseType.js +0 -1
- package/dist/types/ButtonPropertiesType.d.ts +0 -11
- package/dist/types/ButtonPropertiesType.js +0 -1
- package/dist/types/FilePropertiesType.d.ts +0 -4
- package/dist/types/FilePropertiesType.js +0 -1
- package/dist/types/ImagePropertiesType.d.ts +0 -4
- package/dist/types/ImagePropertiesType.js +0 -1
- package/dist/types/InputPropertiesType.d.ts +0 -7
- package/dist/types/InputPropertiesType.js +0 -1
- package/dist/types/LinkPropertiesType.d.ts +0 -4
- package/dist/types/LinkPropertiesType.js +0 -1
- package/dist/types/PlanWebsiteType.d.ts +0 -9
- package/dist/types/PlanWebsiteType.js +0 -1
- package/dist/types/UserType.d.ts +0 -10
- package/dist/types/UserType.js +0 -1
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import DOMPurify from 'dompurify';
|
|
3
|
-
import { ElementColWrapper } from './ElementColWrapper.js';
|
|
4
|
-
export function FileElement({ element }) {
|
|
5
|
-
return (_jsx(ElementColWrapper, { element: element, children: _jsx("div", { dangerouslySetInnerHTML: { __html: DOMPurify.sanitize(String(element.id)) } }) }));
|
|
6
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
class ApiService {
|
|
2
|
-
async getStructure(websiteId, apiUrl) {
|
|
3
|
-
try {
|
|
4
|
-
const response = await fetch(`${apiUrl}/website/${websiteId}/structure`);
|
|
5
|
-
if (!response.ok) {
|
|
6
|
-
throw new Error(response.status.toString());
|
|
7
|
-
}
|
|
8
|
-
const json = await response.json();
|
|
9
|
-
return json.data;
|
|
10
|
-
}
|
|
11
|
-
catch (error) {
|
|
12
|
-
console.error('Erro ao buscar dados da API:', error);
|
|
13
|
-
throw new Error(error instanceof Error ? error.message : JSON.stringify(error));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export { ApiService };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
class CacheService {
|
|
2
|
-
getStructure() {
|
|
3
|
-
try {
|
|
4
|
-
const cachedData = localStorage.getItem('websiteData');
|
|
5
|
-
if (!cachedData) {
|
|
6
|
-
throw new Error('Sem dados em cache');
|
|
7
|
-
}
|
|
8
|
-
return JSON.parse(cachedData);
|
|
9
|
-
}
|
|
10
|
-
catch (error) {
|
|
11
|
-
console.error('Erro ao buscar dados do cache:', error);
|
|
12
|
-
throw new Error(error instanceof Error ? error.message : JSON.stringify(error));
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export { CacheService };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { RawWebsiteType } from '../types/RawWebsiteType.js';
|
|
2
|
-
declare class ConstructorService {
|
|
3
|
-
fetchWebsiteFromApi(websiteId: number, apiUrl: string): Promise<RawWebsiteType>;
|
|
4
|
-
fetchWebsiteFromCache(): Promise<RawWebsiteType>;
|
|
5
|
-
fetchMenu(): Promise<{
|
|
6
|
-
id: number;
|
|
7
|
-
name: string;
|
|
8
|
-
path: string;
|
|
9
|
-
type: 'link';
|
|
10
|
-
}[]>;
|
|
11
|
-
}
|
|
12
|
-
export { ConstructorService };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ApiService } from './ApiService.js';
|
|
2
|
-
import { CacheService } from './CacheService.js';
|
|
3
|
-
class ConstructorService {
|
|
4
|
-
async fetchWebsiteFromApi(websiteId, apiUrl) {
|
|
5
|
-
const apiService = new ApiService();
|
|
6
|
-
const website = await apiService.getStructure(websiteId, apiUrl);
|
|
7
|
-
if (!website) {
|
|
8
|
-
throw new Error('Site não encontrado');
|
|
9
|
-
}
|
|
10
|
-
localStorage.setItem('websiteData', JSON.stringify(website));
|
|
11
|
-
return website;
|
|
12
|
-
}
|
|
13
|
-
async fetchWebsiteFromCache() {
|
|
14
|
-
const cacheService = new CacheService();
|
|
15
|
-
const website = cacheService.getStructure();
|
|
16
|
-
if (!website) {
|
|
17
|
-
throw new Error('Site não encontrado');
|
|
18
|
-
}
|
|
19
|
-
return website;
|
|
20
|
-
}
|
|
21
|
-
async fetchMenu() {
|
|
22
|
-
const websiteStructure = await this.fetchWebsiteFromCache();
|
|
23
|
-
return websiteStructure.pages
|
|
24
|
-
.filter((page) => page.menu === 1)
|
|
25
|
-
.map((page) => ({
|
|
26
|
-
id: page.id,
|
|
27
|
-
name: page.name,
|
|
28
|
-
path: page.path,
|
|
29
|
-
type: 'link'
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export { ConstructorService };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PropertiesType } from './PropertiesType.js';
|
|
2
|
-
export interface ButtonPropertiesType extends PropertiesType {
|
|
3
|
-
path: string;
|
|
4
|
-
loadingTime: number;
|
|
5
|
-
hideOnClick: boolean;
|
|
6
|
-
actionId: number;
|
|
7
|
-
successActionId: number;
|
|
8
|
-
errorActionId: number;
|
|
9
|
-
successMessageId: number;
|
|
10
|
-
errorMessageId: number;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/UserType.d.ts
DELETED
package/dist/types/UserType.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|