vobi_document 1.0.2 → 1.1.0
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 +23 -6
- package/dist/blocks.cjs +100 -0
- package/dist/blocks.cjs.map +1 -0
- package/dist/blocks.d.cts +201 -0
- package/dist/blocks.d.ts +201 -0
- package/dist/blocks.js +7 -0
- package/dist/blocks.js.map +1 -0
- package/dist/catalogContext-DenbX-OW.d.cts +15 -0
- package/dist/catalogContext-HGMU-w_4.d.ts +15 -0
- package/dist/chunk-2EBYURIX.js +90 -0
- package/dist/chunk-2EBYURIX.js.map +1 -0
- package/dist/chunk-6GRYRVU5.js +824 -0
- package/dist/chunk-6GRYRVU5.js.map +1 -0
- package/dist/chunk-ABIEQHS2.js +159 -0
- package/dist/chunk-ABIEQHS2.js.map +1 -0
- package/dist/chunk-AQ5FAAP6.cjs +168 -0
- package/dist/chunk-AQ5FAAP6.cjs.map +1 -0
- package/dist/chunk-ERKU5FDV.cjs +407 -0
- package/dist/chunk-ERKU5FDV.cjs.map +1 -0
- package/dist/chunk-FKX46GKE.cjs +36 -0
- package/dist/chunk-FKX46GKE.cjs.map +1 -0
- package/dist/chunk-HMTCQOEV.js +1319 -0
- package/dist/chunk-HMTCQOEV.js.map +1 -0
- package/dist/chunk-IRFFN74K.cjs +89 -0
- package/dist/chunk-IRFFN74K.cjs.map +1 -0
- package/dist/chunk-IUDN2CGP.js +863 -0
- package/dist/chunk-IUDN2CGP.js.map +1 -0
- package/dist/chunk-JEVWEGSE.js +95 -0
- package/dist/chunk-JEVWEGSE.js.map +1 -0
- package/dist/chunk-KCZKC3OG.js +61 -0
- package/dist/chunk-KCZKC3OG.js.map +1 -0
- package/dist/chunk-KUB3TYG2.cjs +102 -0
- package/dist/chunk-KUB3TYG2.cjs.map +1 -0
- package/dist/chunk-L5FXGEKX.cjs +114 -0
- package/dist/chunk-L5FXGEKX.cjs.map +1 -0
- package/dist/chunk-LNBAFOVK.cjs +14 -0
- package/dist/chunk-LNBAFOVK.cjs.map +1 -0
- package/dist/chunk-M2TPAU2F.js +79 -0
- package/dist/chunk-M2TPAU2F.js.map +1 -0
- package/dist/chunk-MHTTFNK2.cjs +890 -0
- package/dist/chunk-MHTTFNK2.cjs.map +1 -0
- package/dist/chunk-NDHTMYPA.cjs +844 -0
- package/dist/chunk-NDHTMYPA.cjs.map +1 -0
- package/dist/chunk-PLQNNXS2.js +382 -0
- package/dist/chunk-PLQNNXS2.js.map +1 -0
- package/dist/chunk-QYBWIJXZ.js +98 -0
- package/dist/chunk-QYBWIJXZ.js.map +1 -0
- package/dist/chunk-U56KVTK5.cjs +68 -0
- package/dist/chunk-U56KVTK5.cjs.map +1 -0
- package/dist/chunk-X2BLERM5.cjs +1346 -0
- package/dist/chunk-X2BLERM5.cjs.map +1 -0
- package/dist/chunk-ZOJBDFKU.js +12 -0
- package/dist/chunk-ZOJBDFKU.js.map +1 -0
- package/dist/chunk-ZXWOZZXO.cjs +94 -0
- package/dist/chunk-ZXWOZZXO.cjs.map +1 -0
- package/dist/editor.cjs +60 -0
- package/dist/editor.cjs.map +1 -0
- package/dist/editor.d.cts +190 -0
- package/dist/editor.d.ts +190 -0
- package/dist/editor.js +7 -0
- package/dist/editor.js.map +1 -0
- package/dist/index.cjs +412 -3753
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -7892
- package/dist/index.d.ts +72 -7892
- package/dist/index.js +22 -3662
- package/dist/index.js.map +1 -1
- package/dist/messages-Bi0JxNIH.d.cts +23 -0
- package/dist/messages-Bi0JxNIH.d.ts +23 -0
- package/dist/print.cjs +354 -0
- package/dist/print.cjs.map +1 -0
- package/dist/print.d.cts +43 -0
- package/dist/print.d.ts +43 -0
- package/dist/print.js +336 -0
- package/dist/print.js.map +1 -0
- package/dist/puck.cjs +8 -8
- package/dist/puck.cjs.map +1 -1
- package/dist/render.cjs +72 -0
- package/dist/render.cjs.map +1 -0
- package/dist/render.d.cts +93 -0
- package/dist/render.d.ts +93 -0
- package/dist/render.js +7 -0
- package/dist/render.js.map +1 -0
- package/dist/theme-BuEFpQeZ.d.cts +112 -0
- package/dist/theme-BuEFpQeZ.d.ts +112 -0
- package/dist/types-BgIugNWW.d.cts +25 -0
- package/dist/types-BgIugNWW.d.ts +25 -0
- package/dist/types-CvKSS1Sy.d.cts +38 -0
- package/dist/types-CvKSS1Sy.d.ts +38 -0
- package/dist/variables.cjs +95 -0
- package/dist/variables.cjs.map +1 -0
- package/dist/variables.d.cts +74 -0
- package/dist/variables.d.ts +74 -0
- package/dist/variables.js +6 -0
- package/dist/variables.js.map +1 -0
- package/package.json +39 -8
package/dist/puck.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
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
|
|
9
|
+
get: function () { return chunkFKX46GKE_cjs.ActionBar; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "Puck", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkFKX46GKE_cjs.Puck; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "Render", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkFKX46GKE_cjs.Render; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "createUsePuck", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkFKX46GKE_cjs.createUsePuck; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "registerOverlayPortal", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkFKX46GKE_cjs.registerOverlayPortal; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "useGetPuck", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkFKX46GKE_cjs.useGetPuck; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "usePuck", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
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"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"puck.cjs"}
|
package/dist/render.cjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkU56KVTK5_cjs = require('./chunk-U56KVTK5.cjs');
|
|
4
|
+
var chunkNDHTMYPA_cjs = require('./chunk-NDHTMYPA.cjs');
|
|
5
|
+
require('./chunk-ERKU5FDV.cjs');
|
|
6
|
+
require('./chunk-ZXWOZZXO.cjs');
|
|
7
|
+
require('./chunk-IRFFN74K.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Object.defineProperty(exports, "CoverEditable", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkU56KVTK5_cjs.CoverEditable; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "CoverTemplateStatic", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkU56KVTK5_cjs.CoverTemplateStatic; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "COMPANY_INFO_ICONS", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkNDHTMYPA_cjs.COMPANY_INFO_ICONS; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "COVER_TEMPLATE_IDS", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkNDHTMYPA_cjs.COVER_TEMPLATE_IDS; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "CoverPage", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkNDHTMYPA_cjs.CoverPage; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "DG_ERROR", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkNDHTMYPA_cjs.DG_ERROR; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "DG_MESSAGE_SOURCE", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkNDHTMYPA_cjs.DG_MESSAGE_SOURCE; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "DG_READY", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkNDHTMYPA_cjs.DG_READY; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "DocumentRenderer", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return chunkNDHTMYPA_cjs.DocumentRenderer; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "FOOTER_INFO_ORDER", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return chunkNDHTMYPA_cjs.FOOTER_INFO_ORDER; }
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "FooterBar", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () { return chunkNDHTMYPA_cjs.FooterBar; }
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "HEADER_INFO_ORDER", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () { return chunkNDHTMYPA_cjs.HEADER_INFO_ORDER; }
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(exports, "HeaderBar", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () { return chunkNDHTMYPA_cjs.HeaderBar; }
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(exports, "resolveCoverAccent", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () { return chunkNDHTMYPA_cjs.resolveCoverAccent; }
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(exports, "resolveCoverColors", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () { return chunkNDHTMYPA_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 };
|
package/dist/render.d.ts
ADDED
|
@@ -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-KCZKC3OG.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-6GRYRVU5.js';
|
|
3
|
+
import './chunk-PLQNNXS2.js';
|
|
4
|
+
import './chunk-2EBYURIX.js';
|
|
5
|
+
import './chunk-M2TPAU2F.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 };
|