vobi_document 1.0.2 → 1.1.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 (96) hide show
  1. package/README.md +23 -6
  2. package/dist/blocks.cjs +108 -0
  3. package/dist/blocks.cjs.map +1 -0
  4. package/dist/blocks.d.cts +214 -0
  5. package/dist/blocks.d.ts +214 -0
  6. package/dist/blocks.js +7 -0
  7. package/dist/blocks.js.map +1 -0
  8. package/dist/catalogContext-DenbX-OW.d.cts +15 -0
  9. package/dist/catalogContext-HGMU-w_4.d.ts +15 -0
  10. package/dist/chunk-26DSIOEY.cjs +68 -0
  11. package/dist/chunk-26DSIOEY.cjs.map +1 -0
  12. package/dist/chunk-3FTKM37U.cjs +1354 -0
  13. package/dist/chunk-3FTKM37U.cjs.map +1 -0
  14. package/dist/chunk-CZB7F2LA.js +90 -0
  15. package/dist/chunk-CZB7F2LA.js.map +1 -0
  16. package/dist/chunk-ERKU5FDV.cjs +407 -0
  17. package/dist/chunk-ERKU5FDV.cjs.map +1 -0
  18. package/dist/chunk-FKX46GKE.cjs +36 -0
  19. package/dist/chunk-FKX46GKE.cjs.map +1 -0
  20. package/dist/chunk-GR76U6FP.cjs +194 -0
  21. package/dist/chunk-GR76U6FP.cjs.map +1 -0
  22. package/dist/chunk-I22MGPXO.cjs +117 -0
  23. package/dist/chunk-I22MGPXO.cjs.map +1 -0
  24. package/dist/chunk-JYSA6IM5.js +1327 -0
  25. package/dist/chunk-JYSA6IM5.js.map +1 -0
  26. package/dist/chunk-L5FXGEKX.cjs +114 -0
  27. package/dist/chunk-L5FXGEKX.cjs.map +1 -0
  28. package/dist/chunk-LNBAFOVK.cjs +14 -0
  29. package/dist/chunk-LNBAFOVK.cjs.map +1 -0
  30. package/dist/chunk-M6FQVH76.js +824 -0
  31. package/dist/chunk-M6FQVH76.js.map +1 -0
  32. package/dist/chunk-MUSSJOOA.js +109 -0
  33. package/dist/chunk-MUSSJOOA.js.map +1 -0
  34. package/dist/chunk-N3IDPT3B.js +182 -0
  35. package/dist/chunk-N3IDPT3B.js.map +1 -0
  36. package/dist/chunk-OJZJJEJX.js +904 -0
  37. package/dist/chunk-OJZJJEJX.js.map +1 -0
  38. package/dist/chunk-PLQNNXS2.js +382 -0
  39. package/dist/chunk-PLQNNXS2.js.map +1 -0
  40. package/dist/chunk-QJ5W5EED.cjs +94 -0
  41. package/dist/chunk-QJ5W5EED.cjs.map +1 -0
  42. package/dist/chunk-QYBWIJXZ.js +98 -0
  43. package/dist/chunk-QYBWIJXZ.js.map +1 -0
  44. package/dist/chunk-RO3Y2MSU.cjs +844 -0
  45. package/dist/chunk-RO3Y2MSU.cjs.map +1 -0
  46. package/dist/chunk-RZOR3HOA.cjs +933 -0
  47. package/dist/chunk-RZOR3HOA.cjs.map +1 -0
  48. package/dist/chunk-SOIYSSU3.js +108 -0
  49. package/dist/chunk-SOIYSSU3.js.map +1 -0
  50. package/dist/chunk-SP5LCPDG.cjs +119 -0
  51. package/dist/chunk-SP5LCPDG.cjs.map +1 -0
  52. package/dist/chunk-W52ULJCW.js +61 -0
  53. package/dist/chunk-W52ULJCW.js.map +1 -0
  54. package/dist/chunk-ZOJBDFKU.js +12 -0
  55. package/dist/chunk-ZOJBDFKU.js.map +1 -0
  56. package/dist/editor.cjs +60 -0
  57. package/dist/editor.cjs.map +1 -0
  58. package/dist/editor.d.cts +190 -0
  59. package/dist/editor.d.ts +190 -0
  60. package/dist/editor.js +7 -0
  61. package/dist/editor.js.map +1 -0
  62. package/dist/index.cjs +436 -3753
  63. package/dist/index.cjs.map +1 -1
  64. package/dist/index.d.cts +72 -7892
  65. package/dist/index.d.ts +72 -7892
  66. package/dist/index.js +22 -3662
  67. package/dist/index.js.map +1 -1
  68. package/dist/messages-Bi0JxNIH.d.cts +23 -0
  69. package/dist/messages-Bi0JxNIH.d.ts +23 -0
  70. package/dist/print.cjs +354 -0
  71. package/dist/print.cjs.map +1 -0
  72. package/dist/print.d.cts +43 -0
  73. package/dist/print.d.ts +43 -0
  74. package/dist/print.js +336 -0
  75. package/dist/print.js.map +1 -0
  76. package/dist/puck.cjs +8 -8
  77. package/dist/puck.cjs.map +1 -1
  78. package/dist/render.cjs +72 -0
  79. package/dist/render.cjs.map +1 -0
  80. package/dist/render.d.cts +93 -0
  81. package/dist/render.d.ts +93 -0
  82. package/dist/render.js +7 -0
  83. package/dist/render.js.map +1 -0
  84. package/dist/theme-BuEFpQeZ.d.cts +112 -0
  85. package/dist/theme-BuEFpQeZ.d.ts +112 -0
  86. package/dist/types-BgIugNWW.d.cts +25 -0
  87. package/dist/types-BgIugNWW.d.ts +25 -0
  88. package/dist/types-CvKSS1Sy.d.cts +38 -0
  89. package/dist/types-CvKSS1Sy.d.ts +38 -0
  90. package/dist/variables.cjs +111 -0
  91. package/dist/variables.cjs.map +1 -0
  92. package/dist/variables.d.cts +106 -0
  93. package/dist/variables.d.ts +106 -0
  94. package/dist/variables.js +6 -0
  95. package/dist/variables.js.map +1 -0
  96. package/package.json +39 -8
package/dist/puck.cjs CHANGED
@@ -1,36 +1,36 @@
1
1
  'use strict';
2
2
 
3
- var core = require('@puckeditor/core');
3
+ var chunkFKX46GKE_cjs = require('./chunk-FKX46GKE.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "ActionBar", {
8
8
  enumerable: true,
9
- get: function () { return core.ActionBar; }
9
+ get: function () { return chunkFKX46GKE_cjs.ActionBar; }
10
10
  });
11
11
  Object.defineProperty(exports, "Puck", {
12
12
  enumerable: true,
13
- get: function () { return core.Puck; }
13
+ get: function () { return chunkFKX46GKE_cjs.Puck; }
14
14
  });
15
15
  Object.defineProperty(exports, "Render", {
16
16
  enumerable: true,
17
- get: function () { return core.Render; }
17
+ get: function () { return chunkFKX46GKE_cjs.Render; }
18
18
  });
19
19
  Object.defineProperty(exports, "createUsePuck", {
20
20
  enumerable: true,
21
- get: function () { return core.createUsePuck; }
21
+ get: function () { return chunkFKX46GKE_cjs.createUsePuck; }
22
22
  });
23
23
  Object.defineProperty(exports, "registerOverlayPortal", {
24
24
  enumerable: true,
25
- get: function () { return core.registerOverlayPortal; }
25
+ get: function () { return chunkFKX46GKE_cjs.registerOverlayPortal; }
26
26
  });
27
27
  Object.defineProperty(exports, "useGetPuck", {
28
28
  enumerable: true,
29
- get: function () { return core.useGetPuck; }
29
+ get: function () { return chunkFKX46GKE_cjs.useGetPuck; }
30
30
  });
31
31
  Object.defineProperty(exports, "usePuck", {
32
32
  enumerable: true,
33
- get: function () { return core.usePuck; }
33
+ get: function () { return chunkFKX46GKE_cjs.usePuck; }
34
34
  });
35
35
  //# sourceMappingURL=puck.cjs.map
36
36
  //# sourceMappingURL=puck.cjs.map
package/dist/puck.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"puck.cjs","sourcesContent":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"puck.cjs"}
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ var chunk26DSIOEY_cjs = require('./chunk-26DSIOEY.cjs');
4
+ var chunkRO3Y2MSU_cjs = require('./chunk-RO3Y2MSU.cjs');
5
+ require('./chunk-ERKU5FDV.cjs');
6
+ require('./chunk-QJ5W5EED.cjs');
7
+ require('./chunk-SP5LCPDG.cjs');
8
+
9
+
10
+
11
+ Object.defineProperty(exports, "CoverEditable", {
12
+ enumerable: true,
13
+ get: function () { return chunk26DSIOEY_cjs.CoverEditable; }
14
+ });
15
+ Object.defineProperty(exports, "CoverTemplateStatic", {
16
+ enumerable: true,
17
+ get: function () { return chunk26DSIOEY_cjs.CoverTemplateStatic; }
18
+ });
19
+ Object.defineProperty(exports, "COMPANY_INFO_ICONS", {
20
+ enumerable: true,
21
+ get: function () { return chunkRO3Y2MSU_cjs.COMPANY_INFO_ICONS; }
22
+ });
23
+ Object.defineProperty(exports, "COVER_TEMPLATE_IDS", {
24
+ enumerable: true,
25
+ get: function () { return chunkRO3Y2MSU_cjs.COVER_TEMPLATE_IDS; }
26
+ });
27
+ Object.defineProperty(exports, "CoverPage", {
28
+ enumerable: true,
29
+ get: function () { return chunkRO3Y2MSU_cjs.CoverPage; }
30
+ });
31
+ Object.defineProperty(exports, "DG_ERROR", {
32
+ enumerable: true,
33
+ get: function () { return chunkRO3Y2MSU_cjs.DG_ERROR; }
34
+ });
35
+ Object.defineProperty(exports, "DG_MESSAGE_SOURCE", {
36
+ enumerable: true,
37
+ get: function () { return chunkRO3Y2MSU_cjs.DG_MESSAGE_SOURCE; }
38
+ });
39
+ Object.defineProperty(exports, "DG_READY", {
40
+ enumerable: true,
41
+ get: function () { return chunkRO3Y2MSU_cjs.DG_READY; }
42
+ });
43
+ Object.defineProperty(exports, "DocumentRenderer", {
44
+ enumerable: true,
45
+ get: function () { return chunkRO3Y2MSU_cjs.DocumentRenderer; }
46
+ });
47
+ Object.defineProperty(exports, "FOOTER_INFO_ORDER", {
48
+ enumerable: true,
49
+ get: function () { return chunkRO3Y2MSU_cjs.FOOTER_INFO_ORDER; }
50
+ });
51
+ Object.defineProperty(exports, "FooterBar", {
52
+ enumerable: true,
53
+ get: function () { return chunkRO3Y2MSU_cjs.FooterBar; }
54
+ });
55
+ Object.defineProperty(exports, "HEADER_INFO_ORDER", {
56
+ enumerable: true,
57
+ get: function () { return chunkRO3Y2MSU_cjs.HEADER_INFO_ORDER; }
58
+ });
59
+ Object.defineProperty(exports, "HeaderBar", {
60
+ enumerable: true,
61
+ get: function () { return chunkRO3Y2MSU_cjs.HeaderBar; }
62
+ });
63
+ Object.defineProperty(exports, "resolveCoverAccent", {
64
+ enumerable: true,
65
+ get: function () { return chunkRO3Y2MSU_cjs.resolveCoverAccent; }
66
+ });
67
+ Object.defineProperty(exports, "resolveCoverColors", {
68
+ enumerable: true,
69
+ get: function () { return chunkRO3Y2MSU_cjs.resolveCoverColors; }
70
+ });
71
+ //# sourceMappingURL=render.cjs.map
72
+ //# sourceMappingURL=render.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"render.cjs"}
@@ -0,0 +1,93 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { Data, Metadata } from '@puckeditor/core';
4
+ import { R as Registry } from './types-CvKSS1Sy.cjs';
5
+ import { T as Theme, C as CoverFields, H as HeaderConfig, F as FooterConfig } from './theme-BuEFpQeZ.cjs';
6
+ import { V as VariableDef, c as VariableResolver, b as VariableContext, R as ResolvedVariables, U as UnresolvedDisplay } from './types-BgIugNWW.cjs';
7
+ import { C as CompanyInfo } from './messages-Bi0JxNIH.cjs';
8
+ export { D as DG_ERROR, a as DG_MESSAGE_SOURCE, b as DG_READY } from './messages-Bi0JxNIH.cjs';
9
+ import 'zod';
10
+ import 'styled-components';
11
+
12
+ type DocumentRendererProps = {
13
+ registry: Registry;
14
+ data: Data;
15
+ theme?: Theme;
16
+ catalog?: VariableDef[];
17
+ /** Live resolution (browser preview). Called in an effect. */
18
+ resolver?: VariableResolver;
19
+ ctx?: VariableContext;
20
+ resolvedVariables?: ResolvedVariables;
21
+ unresolvedDisplay?: UnresolvedDisplay;
22
+ metadata?: Metadata;
23
+ };
24
+ declare function DocumentRenderer({ registry, data, theme, catalog, resolver, ctx, resolvedVariables, unresolvedDisplay, metadata }: DocumentRendererProps): react.JSX.Element;
25
+
26
+ type CoverPageProps = {
27
+ templateId?: string;
28
+ accent?: string;
29
+ fields?: CoverFields;
30
+ theme?: Theme;
31
+ textColor?: string;
32
+ bgColor?: string;
33
+ };
34
+ declare function CoverPage({ templateId, accent, fields, theme, textColor, bgColor }: CoverPageProps): react.JSX.Element | null;
35
+
36
+ type CoverEditableProps = {
37
+ templateId: string;
38
+ fields: CoverFields;
39
+ accent?: string;
40
+ theme?: Theme;
41
+ textColor?: string;
42
+ bgColor?: string;
43
+ selected?: boolean;
44
+ onFieldsChange: (next: CoverFields) => void;
45
+ onImagePick: () => void;
46
+ };
47
+ declare function CoverEditable({ templateId, fields, accent, theme, textColor, bgColor, selected, onFieldsChange, onImagePick }: CoverEditableProps): react.JSX.Element;
48
+
49
+ type CoverTemplateStaticProps = {
50
+ templateId: string;
51
+ fields: CoverFields;
52
+ accent?: string;
53
+ theme?: Theme;
54
+ textColor?: string;
55
+ bgColor?: string;
56
+ };
57
+ declare function CoverTemplateStatic({ templateId, fields, accent, theme, textColor, bgColor }: CoverTemplateStaticProps): react.JSX.Element;
58
+
59
+ declare const COVER_TEMPLATE_IDS: string[];
60
+ declare const resolveCoverAccent: (accent?: string, theme?: Theme) => string;
61
+ type CoverColorOverrides = {
62
+ accent?: string;
63
+ textColor?: string;
64
+ bgColor?: string;
65
+ };
66
+ type CoverColors = {
67
+ accent: string;
68
+ textColor: string;
69
+ bgColor: string;
70
+ };
71
+ declare const resolveCoverColors: (templateId: string | undefined, { accent, textColor, bgColor }: CoverColorOverrides, theme?: Theme) => CoverColors;
72
+
73
+ /** Ordem em que as informações da empresa aparecem no cabeçalho. */
74
+ declare const HEADER_INFO_ORDER: Array<keyof CompanyInfo>;
75
+ type HeaderBarProps = {
76
+ config?: Partial<HeaderConfig>;
77
+ companyInfo?: CompanyInfo;
78
+ logoUrl?: string;
79
+ documentFont?: string;
80
+ };
81
+ declare function HeaderBar({ config, companyInfo, logoUrl, documentFont }: HeaderBarProps): react.JSX.Element | null;
82
+
83
+ declare const FOOTER_INFO_ORDER: Array<keyof CompanyInfo>;
84
+ type FooterBarProps = {
85
+ config?: Partial<FooterConfig>;
86
+ companyInfo?: CompanyInfo;
87
+ documentFont?: string;
88
+ };
89
+ declare function FooterBar({ config, companyInfo, documentFont }: FooterBarProps): react.JSX.Element | null;
90
+
91
+ declare const COMPANY_INFO_ICONS: Record<keyof CompanyInfo, ReactNode>;
92
+
93
+ export { COMPANY_INFO_ICONS, COVER_TEMPLATE_IDS, CompanyInfo, type CoverColorOverrides, type CoverColors, CoverEditable, type CoverEditableProps, CoverPage, CoverTemplateStatic, type CoverTemplateStaticProps, DocumentRenderer, type DocumentRendererProps, FOOTER_INFO_ORDER, FooterBar, HEADER_INFO_ORDER, HeaderBar, resolveCoverAccent, resolveCoverColors };
@@ -0,0 +1,93 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { Data, Metadata } from '@puckeditor/core';
4
+ import { R as Registry } from './types-CvKSS1Sy.js';
5
+ import { T as Theme, C as CoverFields, H as HeaderConfig, F as FooterConfig } from './theme-BuEFpQeZ.js';
6
+ import { V as VariableDef, c as VariableResolver, b as VariableContext, R as ResolvedVariables, U as UnresolvedDisplay } from './types-BgIugNWW.js';
7
+ import { C as CompanyInfo } from './messages-Bi0JxNIH.js';
8
+ export { D as DG_ERROR, a as DG_MESSAGE_SOURCE, b as DG_READY } from './messages-Bi0JxNIH.js';
9
+ import 'zod';
10
+ import 'styled-components';
11
+
12
+ type DocumentRendererProps = {
13
+ registry: Registry;
14
+ data: Data;
15
+ theme?: Theme;
16
+ catalog?: VariableDef[];
17
+ /** Live resolution (browser preview). Called in an effect. */
18
+ resolver?: VariableResolver;
19
+ ctx?: VariableContext;
20
+ resolvedVariables?: ResolvedVariables;
21
+ unresolvedDisplay?: UnresolvedDisplay;
22
+ metadata?: Metadata;
23
+ };
24
+ declare function DocumentRenderer({ registry, data, theme, catalog, resolver, ctx, resolvedVariables, unresolvedDisplay, metadata }: DocumentRendererProps): react.JSX.Element;
25
+
26
+ type CoverPageProps = {
27
+ templateId?: string;
28
+ accent?: string;
29
+ fields?: CoverFields;
30
+ theme?: Theme;
31
+ textColor?: string;
32
+ bgColor?: string;
33
+ };
34
+ declare function CoverPage({ templateId, accent, fields, theme, textColor, bgColor }: CoverPageProps): react.JSX.Element | null;
35
+
36
+ type CoverEditableProps = {
37
+ templateId: string;
38
+ fields: CoverFields;
39
+ accent?: string;
40
+ theme?: Theme;
41
+ textColor?: string;
42
+ bgColor?: string;
43
+ selected?: boolean;
44
+ onFieldsChange: (next: CoverFields) => void;
45
+ onImagePick: () => void;
46
+ };
47
+ declare function CoverEditable({ templateId, fields, accent, theme, textColor, bgColor, selected, onFieldsChange, onImagePick }: CoverEditableProps): react.JSX.Element;
48
+
49
+ type CoverTemplateStaticProps = {
50
+ templateId: string;
51
+ fields: CoverFields;
52
+ accent?: string;
53
+ theme?: Theme;
54
+ textColor?: string;
55
+ bgColor?: string;
56
+ };
57
+ declare function CoverTemplateStatic({ templateId, fields, accent, theme, textColor, bgColor }: CoverTemplateStaticProps): react.JSX.Element;
58
+
59
+ declare const COVER_TEMPLATE_IDS: string[];
60
+ declare const resolveCoverAccent: (accent?: string, theme?: Theme) => string;
61
+ type CoverColorOverrides = {
62
+ accent?: string;
63
+ textColor?: string;
64
+ bgColor?: string;
65
+ };
66
+ type CoverColors = {
67
+ accent: string;
68
+ textColor: string;
69
+ bgColor: string;
70
+ };
71
+ declare const resolveCoverColors: (templateId: string | undefined, { accent, textColor, bgColor }: CoverColorOverrides, theme?: Theme) => CoverColors;
72
+
73
+ /** Ordem em que as informações da empresa aparecem no cabeçalho. */
74
+ declare const HEADER_INFO_ORDER: Array<keyof CompanyInfo>;
75
+ type HeaderBarProps = {
76
+ config?: Partial<HeaderConfig>;
77
+ companyInfo?: CompanyInfo;
78
+ logoUrl?: string;
79
+ documentFont?: string;
80
+ };
81
+ declare function HeaderBar({ config, companyInfo, logoUrl, documentFont }: HeaderBarProps): react.JSX.Element | null;
82
+
83
+ declare const FOOTER_INFO_ORDER: Array<keyof CompanyInfo>;
84
+ type FooterBarProps = {
85
+ config?: Partial<FooterConfig>;
86
+ companyInfo?: CompanyInfo;
87
+ documentFont?: string;
88
+ };
89
+ declare function FooterBar({ config, companyInfo, documentFont }: FooterBarProps): react.JSX.Element | null;
90
+
91
+ declare const COMPANY_INFO_ICONS: Record<keyof CompanyInfo, ReactNode>;
92
+
93
+ export { COMPANY_INFO_ICONS, COVER_TEMPLATE_IDS, CompanyInfo, type CoverColorOverrides, type CoverColors, CoverEditable, type CoverEditableProps, CoverPage, CoverTemplateStatic, type CoverTemplateStaticProps, DocumentRenderer, type DocumentRendererProps, FOOTER_INFO_ORDER, FooterBar, HEADER_INFO_ORDER, HeaderBar, resolveCoverAccent, resolveCoverColors };
package/dist/render.js ADDED
@@ -0,0 +1,7 @@
1
+ export { CoverEditable, CoverTemplateStatic } from './chunk-W52ULJCW.js';
2
+ export { COMPANY_INFO_ICONS, COVER_TEMPLATE_IDS, CoverPage, DG_ERROR, DG_MESSAGE_SOURCE, DG_READY, DocumentRenderer, FOOTER_INFO_ORDER, FooterBar, HEADER_INFO_ORDER, HeaderBar, resolveCoverAccent, resolveCoverColors } from './chunk-M6FQVH76.js';
3
+ import './chunk-PLQNNXS2.js';
4
+ import './chunk-CZB7F2LA.js';
5
+ import './chunk-SOIYSSU3.js';
6
+ //# sourceMappingURL=render.js.map
7
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"render.js"}
@@ -0,0 +1,112 @@
1
+ import { z } from 'zod';
2
+ import * as styled_components from 'styled-components';
3
+
4
+ declare const DEFAULT_DOCUMENT_FONT = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif";
5
+ declare const DEFAULT_DOCUMENT_COLORS: {
6
+ readonly brand: "#005AC3";
7
+ readonly text: "#3F4759";
8
+ readonly background: "#FFFFFF";
9
+ };
10
+ type PageFormat = 'A4' | 'A5' | 'A3' | 'Letter' | 'Legal';
11
+ type PageMargins = {
12
+ top?: number;
13
+ right?: number;
14
+ bottom?: number;
15
+ left?: number;
16
+ };
17
+ type PageOptions = {
18
+ format?: PageFormat;
19
+ margins?: PageMargins;
20
+ };
21
+ declare const DEFAULT_PAGE_MARGINS: Required<PageMargins>;
22
+ declare function pageWidthPx(format?: PageFormat): number;
23
+ declare function marginsToPadding(margins?: PageMargins): string;
24
+ /** A página do documento — compartilhada pelo editor, viewer e PDF via `root` do Puck. */
25
+ declare const PageFrame: styled_components.StyledComponent<"div", any, {
26
+ $width: number;
27
+ $padding: string;
28
+ $font: string;
29
+ $brand: string;
30
+ $text: string;
31
+ $bg: string;
32
+ $padTop?: number;
33
+ $padRight?: number;
34
+ $padLeft?: number;
35
+ 'data-docgen-root'?: string;
36
+ }, never>;
37
+ /** Chrome do editor: mesa cinza + folha com sombra (só editor). Porquês: docs/architecture.md. */
38
+ declare const EditorShell: styled_components.StyledComponent<"div", any, {}, never>;
39
+
40
+ type CoverFields = {
41
+ title?: string;
42
+ subtitle?: string;
43
+ date?: string;
44
+ preparedFor?: string;
45
+ presentedBy?: string;
46
+ imageUrl?: string;
47
+ };
48
+ type HeaderInfoFlags = {
49
+ companyName?: boolean;
50
+ cnpj?: boolean;
51
+ phone?: boolean;
52
+ email?: boolean;
53
+ address?: boolean;
54
+ };
55
+ type HeaderConfig = {
56
+ enabled: boolean;
57
+ background: string;
58
+ color: string;
59
+ logoPosition: 'left' | 'right';
60
+ info?: HeaderInfoFlags;
61
+ };
62
+ type FooterInfoFlags = {
63
+ email?: boolean;
64
+ phone?: boolean;
65
+ instagram?: boolean;
66
+ twitter?: boolean;
67
+ address?: boolean;
68
+ site?: boolean;
69
+ facebook?: boolean;
70
+ linkedin?: boolean;
71
+ };
72
+ type FooterConfig = {
73
+ enabled: boolean;
74
+ pageNumber: boolean;
75
+ background: string;
76
+ color: string;
77
+ alignment: 'left' | 'center' | 'right';
78
+ info?: FooterInfoFlags;
79
+ };
80
+ /** Identidade visual do documento; numa versão publicada é congelada no snapshot. */
81
+ type Theme = {
82
+ documentFont?: string;
83
+ page?: {
84
+ format: PageFormat;
85
+ orientation: 'portrait' | 'landscape';
86
+ margins?: PageMargins;
87
+ };
88
+ colors?: {
89
+ brand?: string;
90
+ text?: string;
91
+ background?: string;
92
+ };
93
+ logo?: {
94
+ key?: string;
95
+ url?: string;
96
+ };
97
+ header?: HeaderConfig;
98
+ footer?: FooterConfig;
99
+ watermark?: {
100
+ text?: string;
101
+ imageKey?: string;
102
+ opacity?: number;
103
+ };
104
+ };
105
+ type Schema<T> = z.ZodType<T, z.ZodTypeDef, unknown>;
106
+ declare const pageFormatSchema: Schema<PageFormat>;
107
+ declare const coverFieldsSchema: Schema<CoverFields>;
108
+ declare const headerConfigSchema: Schema<HeaderConfig>;
109
+ declare const footerConfigSchema: Schema<FooterConfig>;
110
+ declare const themeSchema: Schema<Theme>;
111
+
112
+ export { type CoverFields as C, DEFAULT_DOCUMENT_COLORS as D, EditorShell as E, type FooterConfig as F, type HeaderConfig as H, type PageFormat as P, type Theme as T, DEFAULT_DOCUMENT_FONT as a, DEFAULT_PAGE_MARGINS as b, type FooterInfoFlags as c, type HeaderInfoFlags as d, PageFrame as e, type PageMargins as f, type PageOptions as g, coverFieldsSchema as h, footerConfigSchema as i, headerConfigSchema as j, pageWidthPx as k, marginsToPadding as m, pageFormatSchema as p, themeSchema as t };
@@ -0,0 +1,112 @@
1
+ import { z } from 'zod';
2
+ import * as styled_components from 'styled-components';
3
+
4
+ declare const DEFAULT_DOCUMENT_FONT = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif";
5
+ declare const DEFAULT_DOCUMENT_COLORS: {
6
+ readonly brand: "#005AC3";
7
+ readonly text: "#3F4759";
8
+ readonly background: "#FFFFFF";
9
+ };
10
+ type PageFormat = 'A4' | 'A5' | 'A3' | 'Letter' | 'Legal';
11
+ type PageMargins = {
12
+ top?: number;
13
+ right?: number;
14
+ bottom?: number;
15
+ left?: number;
16
+ };
17
+ type PageOptions = {
18
+ format?: PageFormat;
19
+ margins?: PageMargins;
20
+ };
21
+ declare const DEFAULT_PAGE_MARGINS: Required<PageMargins>;
22
+ declare function pageWidthPx(format?: PageFormat): number;
23
+ declare function marginsToPadding(margins?: PageMargins): string;
24
+ /** A página do documento — compartilhada pelo editor, viewer e PDF via `root` do Puck. */
25
+ declare const PageFrame: styled_components.StyledComponent<"div", any, {
26
+ $width: number;
27
+ $padding: string;
28
+ $font: string;
29
+ $brand: string;
30
+ $text: string;
31
+ $bg: string;
32
+ $padTop?: number;
33
+ $padRight?: number;
34
+ $padLeft?: number;
35
+ 'data-docgen-root'?: string;
36
+ }, never>;
37
+ /** Chrome do editor: mesa cinza + folha com sombra (só editor). Porquês: docs/architecture.md. */
38
+ declare const EditorShell: styled_components.StyledComponent<"div", any, {}, never>;
39
+
40
+ type CoverFields = {
41
+ title?: string;
42
+ subtitle?: string;
43
+ date?: string;
44
+ preparedFor?: string;
45
+ presentedBy?: string;
46
+ imageUrl?: string;
47
+ };
48
+ type HeaderInfoFlags = {
49
+ companyName?: boolean;
50
+ cnpj?: boolean;
51
+ phone?: boolean;
52
+ email?: boolean;
53
+ address?: boolean;
54
+ };
55
+ type HeaderConfig = {
56
+ enabled: boolean;
57
+ background: string;
58
+ color: string;
59
+ logoPosition: 'left' | 'right';
60
+ info?: HeaderInfoFlags;
61
+ };
62
+ type FooterInfoFlags = {
63
+ email?: boolean;
64
+ phone?: boolean;
65
+ instagram?: boolean;
66
+ twitter?: boolean;
67
+ address?: boolean;
68
+ site?: boolean;
69
+ facebook?: boolean;
70
+ linkedin?: boolean;
71
+ };
72
+ type FooterConfig = {
73
+ enabled: boolean;
74
+ pageNumber: boolean;
75
+ background: string;
76
+ color: string;
77
+ alignment: 'left' | 'center' | 'right';
78
+ info?: FooterInfoFlags;
79
+ };
80
+ /** Identidade visual do documento; numa versão publicada é congelada no snapshot. */
81
+ type Theme = {
82
+ documentFont?: string;
83
+ page?: {
84
+ format: PageFormat;
85
+ orientation: 'portrait' | 'landscape';
86
+ margins?: PageMargins;
87
+ };
88
+ colors?: {
89
+ brand?: string;
90
+ text?: string;
91
+ background?: string;
92
+ };
93
+ logo?: {
94
+ key?: string;
95
+ url?: string;
96
+ };
97
+ header?: HeaderConfig;
98
+ footer?: FooterConfig;
99
+ watermark?: {
100
+ text?: string;
101
+ imageKey?: string;
102
+ opacity?: number;
103
+ };
104
+ };
105
+ type Schema<T> = z.ZodType<T, z.ZodTypeDef, unknown>;
106
+ declare const pageFormatSchema: Schema<PageFormat>;
107
+ declare const coverFieldsSchema: Schema<CoverFields>;
108
+ declare const headerConfigSchema: Schema<HeaderConfig>;
109
+ declare const footerConfigSchema: Schema<FooterConfig>;
110
+ declare const themeSchema: Schema<Theme>;
111
+
112
+ export { type CoverFields as C, DEFAULT_DOCUMENT_COLORS as D, EditorShell as E, type FooterConfig as F, type HeaderConfig as H, type PageFormat as P, type Theme as T, DEFAULT_DOCUMENT_FONT as a, DEFAULT_PAGE_MARGINS as b, type FooterInfoFlags as c, type HeaderInfoFlags as d, PageFrame as e, type PageMargins as f, type PageOptions as g, coverFieldsSchema as h, footerConfigSchema as i, headerConfigSchema as j, pageWidthPx as k, marginsToPadding as m, pageFormatSchema as p, themeSchema as t };
@@ -0,0 +1,25 @@
1
+ type VariableType = 'string' | 'number' | 'date' | 'currency' | 'boolean' | 'document' | 'phone' | 'zipcode';
2
+ type VariableDef = {
3
+ key: string;
4
+ label: string;
5
+ /** Label qualificado pelo model (`Nome do projeto`) — usado no chip; `label` fica no menu. */
6
+ fullLabel?: string;
7
+ type: VariableType;
8
+ model: string;
9
+ default?: unknown;
10
+ };
11
+ /** Como exibir uma variável conhecida sem valor: `NOT_INFORMED_LABEL` ou o label gravado no chip. */
12
+ type UnresolvedDisplay = 'placeholder' | 'label';
13
+ type VariableCatalog = {
14
+ catalog: VariableDef[];
15
+ };
16
+ /**
17
+ * Bag opaca de identificadores do host (ex: `{ idDocument, idCustomer }`). A lib não interpreta
18
+ * nenhuma chave: só serializa para invalidar o cache de resolução e repassa ao `VariableResolver`.
19
+ * Use escalares — o hash é um `JSON.stringify` do objeto.
20
+ */
21
+ type VariableContext = Record<string, string | number | boolean | null | undefined>;
22
+ type VariableResolver = (keys: string[], ctx: VariableContext) => Promise<Record<string, unknown>>;
23
+ type ResolvedVariables = Record<string, string>;
24
+
25
+ export type { ResolvedVariables as R, UnresolvedDisplay as U, VariableDef as V, VariableCatalog as a, VariableContext as b, VariableResolver as c, VariableType as d };
@@ -0,0 +1,25 @@
1
+ type VariableType = 'string' | 'number' | 'date' | 'currency' | 'boolean' | 'document' | 'phone' | 'zipcode';
2
+ type VariableDef = {
3
+ key: string;
4
+ label: string;
5
+ /** Label qualificado pelo model (`Nome do projeto`) — usado no chip; `label` fica no menu. */
6
+ fullLabel?: string;
7
+ type: VariableType;
8
+ model: string;
9
+ default?: unknown;
10
+ };
11
+ /** Como exibir uma variável conhecida sem valor: `NOT_INFORMED_LABEL` ou o label gravado no chip. */
12
+ type UnresolvedDisplay = 'placeholder' | 'label';
13
+ type VariableCatalog = {
14
+ catalog: VariableDef[];
15
+ };
16
+ /**
17
+ * Bag opaca de identificadores do host (ex: `{ idDocument, idCustomer }`). A lib não interpreta
18
+ * nenhuma chave: só serializa para invalidar o cache de resolução e repassa ao `VariableResolver`.
19
+ * Use escalares — o hash é um `JSON.stringify` do objeto.
20
+ */
21
+ type VariableContext = Record<string, string | number | boolean | null | undefined>;
22
+ type VariableResolver = (keys: string[], ctx: VariableContext) => Promise<Record<string, unknown>>;
23
+ type ResolvedVariables = Record<string, string>;
24
+
25
+ export type { ResolvedVariables as R, UnresolvedDisplay as U, VariableDef as V, VariableCatalog as a, VariableContext as b, VariableResolver as c, VariableType as d };
@@ -0,0 +1,38 @@
1
+ import { ComponentConfig, Config } from '@puckeditor/core';
2
+ import { ReactNode, ComponentType } from 'react';
3
+ import { ZodObject, ZodRawShape } from 'zod';
4
+
5
+ /**
6
+ * Um bloco registrável; mesma `key` de um default da lib o substitui inteiro.
7
+ * O componente precisa ser puro, SSR-safe e print-safe — regras em docs/blocks.md.
8
+ */
9
+ type BlockEntry<Props extends Record<string, unknown> = Record<string, unknown>> = {
10
+ key: string;
11
+ label?: string;
12
+ category?: string;
13
+ /** Icon shown next to the block name in the palette. */
14
+ icon?: ReactNode;
15
+ /** Puck field schema. Field keys should match the component prop names. */
16
+ fields: ComponentConfig<any>['fields'];
17
+ /**
18
+ * Zod schema for the block props. When provided, the document schema validates
19
+ * this block's props by `type` (strips unknown keys). Omit it and props are
20
+ * only checked for an `id` (passthrough). The `id` is added automatically.
21
+ */
22
+ propsSchema?: ZodObject<ZodRawShape>;
23
+ /** Props for a freshly dropped block. */
24
+ defaultProps?: Partial<Props>;
25
+ /** Puck permissions for the block (e.g. `{ duplicate: false }`). */
26
+ permissions?: ComponentConfig<any>['permissions'];
27
+ /** Pure React component (props -> JSX). No editor hooks — runs under SSR too. */
28
+ component: ComponentType<Props>;
29
+ };
30
+ /**
31
+ * Ordered list of blocks. Later entries override earlier ones by `key`.
32
+ * Loosely typed (`any` props) so heterogeneous blocks live in one array — the
33
+ * precise props typing is enforced at the `defineBlock` call site.
34
+ */
35
+ type Registry = BlockEntry<any>[];
36
+ type DocumentConfig = Config;
37
+
38
+ export type { BlockEntry as B, DocumentConfig as D, Registry as R };
@@ -0,0 +1,38 @@
1
+ import { ComponentConfig, Config } from '@puckeditor/core';
2
+ import { ReactNode, ComponentType } from 'react';
3
+ import { ZodObject, ZodRawShape } from 'zod';
4
+
5
+ /**
6
+ * Um bloco registrável; mesma `key` de um default da lib o substitui inteiro.
7
+ * O componente precisa ser puro, SSR-safe e print-safe — regras em docs/blocks.md.
8
+ */
9
+ type BlockEntry<Props extends Record<string, unknown> = Record<string, unknown>> = {
10
+ key: string;
11
+ label?: string;
12
+ category?: string;
13
+ /** Icon shown next to the block name in the palette. */
14
+ icon?: ReactNode;
15
+ /** Puck field schema. Field keys should match the component prop names. */
16
+ fields: ComponentConfig<any>['fields'];
17
+ /**
18
+ * Zod schema for the block props. When provided, the document schema validates
19
+ * this block's props by `type` (strips unknown keys). Omit it and props are
20
+ * only checked for an `id` (passthrough). The `id` is added automatically.
21
+ */
22
+ propsSchema?: ZodObject<ZodRawShape>;
23
+ /** Props for a freshly dropped block. */
24
+ defaultProps?: Partial<Props>;
25
+ /** Puck permissions for the block (e.g. `{ duplicate: false }`). */
26
+ permissions?: ComponentConfig<any>['permissions'];
27
+ /** Pure React component (props -> JSX). No editor hooks — runs under SSR too. */
28
+ component: ComponentType<Props>;
29
+ };
30
+ /**
31
+ * Ordered list of blocks. Later entries override earlier ones by `key`.
32
+ * Loosely typed (`any` props) so heterogeneous blocks live in one array — the
33
+ * precise props typing is enforced at the `defineBlock` call site.
34
+ */
35
+ type Registry = BlockEntry<any>[];
36
+ type DocumentConfig = Config;
37
+
38
+ export type { BlockEntry as B, DocumentConfig as D, Registry as R };