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.
Files changed (63) hide show
  1. package/README.md +102 -127
  2. package/dist/builders/PageBuilder.d.ts +3 -2
  3. package/dist/builders/PageBuilder.js +42 -33
  4. package/dist/components/CardComponent.d.ts +3 -3
  5. package/dist/components/CardComponent.js +71 -41
  6. package/dist/components/FormComponent.d.ts +3 -3
  7. package/dist/components/FormComponent.js +8 -14
  8. package/dist/components/ListComponent.d.ts +3 -2
  9. package/dist/components/ListComponent.js +20 -15
  10. package/dist/components/LoadingComponent.js +1 -1
  11. package/dist/components/MapComponent.js +19 -5
  12. package/dist/components/SliderComponent.js +59 -15
  13. package/dist/components/SocialIconsComponent.js +1 -1
  14. package/dist/components/TextComponent.d.ts +3 -3
  15. package/dist/components/TextComponent.js +6 -7
  16. package/dist/elements/AlertElement.js +4 -3
  17. package/dist/elements/ButtonElement.js +20 -17
  18. package/dist/elements/IconElement.d.ts +1 -2
  19. package/dist/elements/IconElement.js +8 -9
  20. package/dist/elements/IconMap.d.ts +2 -0
  21. package/dist/elements/IconMap.js +30 -0
  22. package/dist/elements/InputElement.js +19 -18
  23. package/dist/factories/ButtonActionFactory.d.ts +6 -1
  24. package/dist/factories/ButtonActionFactory.js +14 -4
  25. package/dist/index.d.ts +2 -6
  26. package/dist/index.js +1 -4
  27. package/dist/layouts/Header.d.ts +2 -1
  28. package/dist/layouts/Header.js +31 -5
  29. package/dist/layouts/SiteLayout.d.ts +2 -1
  30. package/dist/layouts/SiteLayout.js +2 -2
  31. package/dist/renderers/SectionRenderer.d.ts +3 -3
  32. package/dist/renderers/SectionRenderer.js +48 -30
  33. package/dist/services/EmailService.d.ts +10 -2
  34. package/dist/services/EmailService.js +27 -25
  35. package/dist/types/RawWebsiteType.d.ts +8 -184
  36. package/dist/utils/InputValidators.js +11 -11
  37. package/dist/utils/propertyUtils.d.ts +3 -0
  38. package/dist/utils/propertyUtils.js +28 -0
  39. package/package.json +33 -20
  40. package/dist/elements/FileElement.d.ts +0 -4
  41. package/dist/elements/FileElement.js +0 -6
  42. package/dist/services/ApiService.d.ts +0 -5
  43. package/dist/services/ApiService.js +0 -17
  44. package/dist/services/CacheService.d.ts +0 -5
  45. package/dist/services/CacheService.js +0 -16
  46. package/dist/services/ConstructorService.d.ts +0 -12
  47. package/dist/services/ConstructorService.js +0 -33
  48. package/dist/types/AuthenticateResponseType.d.ts +0 -5
  49. package/dist/types/AuthenticateResponseType.js +0 -1
  50. package/dist/types/ButtonPropertiesType.d.ts +0 -11
  51. package/dist/types/ButtonPropertiesType.js +0 -1
  52. package/dist/types/FilePropertiesType.d.ts +0 -4
  53. package/dist/types/FilePropertiesType.js +0 -1
  54. package/dist/types/ImagePropertiesType.d.ts +0 -4
  55. package/dist/types/ImagePropertiesType.js +0 -1
  56. package/dist/types/InputPropertiesType.d.ts +0 -7
  57. package/dist/types/InputPropertiesType.js +0 -1
  58. package/dist/types/LinkPropertiesType.d.ts +0 -4
  59. package/dist/types/LinkPropertiesType.js +0 -1
  60. package/dist/types/PlanWebsiteType.d.ts +0 -9
  61. package/dist/types/PlanWebsiteType.js +0 -1
  62. package/dist/types/UserType.d.ts +0 -10
  63. 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,5 +0,0 @@
1
- import type { RawWebsiteType } from '../types/RawWebsiteType.js';
2
- declare class ApiService {
3
- getStructure(websiteId: number, apiUrl: string): Promise<RawWebsiteType>;
4
- }
5
- export { ApiService };
@@ -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,5 +0,0 @@
1
- import type { RawWebsiteType } from '../types/RawWebsiteType.js';
2
- declare class CacheService {
3
- getStructure(): RawWebsiteType;
4
- }
5
- export { CacheService };
@@ -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,5 +0,0 @@
1
- import type { UserType } from './UserType.js';
2
- export interface AuthenticateResponseType {
3
- status: boolean;
4
- data: UserType;
5
- }
@@ -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,4 +0,0 @@
1
- import { PropertiesType } from './PropertiesType.js';
2
- export interface FilePropertiesType extends PropertiesType {
3
- path: string;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { PropertiesType } from './PropertiesType.js';
2
- export interface ImagePropertiesType extends PropertiesType {
3
- path: string;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import { PropertiesType } from './PropertiesType.js';
2
- export interface InputPropertiesType extends PropertiesType {
3
- mask: string;
4
- placeholder: string;
5
- required: boolean;
6
- inputValidateId: number;
7
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { PropertiesType } from './PropertiesType.js';
2
- export interface LinkPropertiesType extends PropertiesType {
3
- path: string;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- export interface PlanWebsiteType {
2
- planId: number;
3
- paymentTypeId: number;
4
- quantity: number;
5
- startDate: string;
6
- endDate: string;
7
- finished: boolean;
8
- name: string;
9
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- export interface UserType {
2
- id: number;
3
- email: string;
4
- password: string;
5
- defaultWebsiteId: number;
6
- token: string;
7
- accessLevel: {
8
- id: number;
9
- };
10
- }
@@ -1 +0,0 @@
1
- export {};