vobi_document 1.1.0 → 1.1.2
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/blocks.cjs +33 -25
- package/dist/blocks.d.cts +14 -1
- package/dist/blocks.d.ts +14 -1
- package/dist/blocks.js +3 -3
- package/dist/{chunk-ERKU5FDV.cjs → chunk-2VZW2MGO.cjs} +20 -2
- package/dist/chunk-2VZW2MGO.cjs.map +1 -0
- package/dist/{chunk-NDHTMYPA.cjs → chunk-A427FKMP.cjs} +20 -20
- package/dist/{chunk-NDHTMYPA.cjs.map → chunk-A427FKMP.cjs.map} +1 -1
- package/dist/{chunk-6GRYRVU5.js → chunk-BEG6KN5X.js} +5 -5
- package/dist/{chunk-6GRYRVU5.js.map → chunk-BEG6KN5X.js.map} +1 -1
- package/dist/{chunk-2EBYURIX.js → chunk-CZB7F2LA.js} +3 -3
- package/dist/{chunk-2EBYURIX.js.map → chunk-CZB7F2LA.js.map} +1 -1
- package/dist/{chunk-AQ5FAAP6.cjs → chunk-GR76U6FP.cjs} +37 -11
- package/dist/chunk-GR76U6FP.cjs.map +1 -0
- package/dist/{chunk-KUB3TYG2.cjs → chunk-I22MGPXO.cjs} +22 -7
- package/dist/chunk-I22MGPXO.cjs.map +1 -0
- package/dist/{chunk-X2BLERM5.cjs → chunk-KALUNX3C.cjs} +35 -27
- package/dist/chunk-KALUNX3C.cjs.map +1 -0
- package/dist/{chunk-JEVWEGSE.js → chunk-MUSSJOOA.js} +21 -7
- package/dist/chunk-MUSSJOOA.js.map +1 -0
- package/dist/{chunk-ABIEQHS2.js → chunk-N3IDPT3B.js} +31 -8
- package/dist/chunk-N3IDPT3B.js.map +1 -0
- package/dist/{chunk-IUDN2CGP.js → chunk-OJZJJEJX.js} +73 -32
- package/dist/chunk-OJZJJEJX.js.map +1 -0
- package/dist/{chunk-PLQNNXS2.js → chunk-QEWDIL2H.js} +20 -3
- package/dist/chunk-QEWDIL2H.js.map +1 -0
- package/dist/{chunk-ZXWOZZXO.cjs → chunk-QJ5W5EED.cjs} +4 -4
- package/dist/{chunk-ZXWOZZXO.cjs.map → chunk-QJ5W5EED.cjs.map} +1 -1
- package/dist/{chunk-HMTCQOEV.js → chunk-QRVQXVZC.js} +23 -15
- package/dist/chunk-QRVQXVZC.js.map +1 -0
- package/dist/{chunk-KCZKC3OG.js → chunk-QU6XF6OQ.js} +3 -3
- package/dist/{chunk-KCZKC3OG.js.map → chunk-QU6XF6OQ.js.map} +1 -1
- package/dist/{chunk-MHTTFNK2.cjs → chunk-RZOR3HOA.cjs} +80 -37
- package/dist/chunk-RZOR3HOA.cjs.map +1 -0
- package/dist/{chunk-U56KVTK5.cjs → chunk-SFKH6QYD.cjs} +8 -8
- package/dist/{chunk-U56KVTK5.cjs.map → chunk-SFKH6QYD.cjs.map} +1 -1
- package/dist/{chunk-M2TPAU2F.js → chunk-SOIYSSU3.js} +32 -3
- package/dist/chunk-SOIYSSU3.js.map +1 -0
- package/dist/{chunk-IRFFN74K.cjs → chunk-SP5LCPDG.cjs} +32 -2
- package/dist/chunk-SP5LCPDG.cjs.map +1 -0
- package/dist/editor.cjs +16 -16
- package/dist/editor.js +4 -4
- package/dist/index.cjs +132 -108
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/print.cjs +50 -18
- package/dist/print.cjs.map +1 -1
- package/dist/print.js +37 -5
- package/dist/print.js.map +1 -1
- package/dist/render.cjs +20 -20
- package/dist/render.js +5 -5
- package/dist/variables.cjs +41 -25
- package/dist/variables.d.cts +34 -2
- package/dist/variables.d.ts +34 -2
- package/dist/variables.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-ABIEQHS2.js.map +0 -1
- package/dist/chunk-AQ5FAAP6.cjs.map +0 -1
- package/dist/chunk-ERKU5FDV.cjs.map +0 -1
- package/dist/chunk-HMTCQOEV.js.map +0 -1
- package/dist/chunk-IRFFN74K.cjs.map +0 -1
- package/dist/chunk-IUDN2CGP.js.map +0 -1
- package/dist/chunk-JEVWEGSE.js.map +0 -1
- package/dist/chunk-KUB3TYG2.cjs.map +0 -1
- package/dist/chunk-M2TPAU2F.js.map +0 -1
- package/dist/chunk-MHTTFNK2.cjs.map +0 -1
- package/dist/chunk-PLQNNXS2.js.map +0 -1
- package/dist/chunk-X2BLERM5.cjs.map +0 -1
package/dist/blocks.cjs
CHANGED
|
@@ -1,100 +1,108 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRZOR3HOA_cjs = require('./chunk-RZOR3HOA.cjs');
|
|
4
4
|
require('./chunk-L5FXGEKX.cjs');
|
|
5
5
|
require('./chunk-LNBAFOVK.cjs');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-I22MGPXO.cjs');
|
|
7
|
+
require('./chunk-SP5LCPDG.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "ButtonBlock", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkRZOR3HOA_cjs.ButtonBlock; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "CONTENT_ICON_CATALOG", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkRZOR3HOA_cjs.CONTENT_ICON_CATALOG; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "CONTENT_ICON_NAMES", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkRZOR3HOA_cjs.CONTENT_ICON_NAMES; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "ContentIcon", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkRZOR3HOA_cjs.ContentIcon; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "DOCUMENT_PROSE_CSS", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkRZOR3HOA_cjs.DOCUMENT_PROSE_CSS; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "DOCUMENT_TEXT_CSS", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkRZOR3HOA_cjs.DOCUMENT_TEXT_CSS; }
|
|
26
34
|
});
|
|
27
35
|
Object.defineProperty(exports, "DividerBlock", {
|
|
28
36
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkRZOR3HOA_cjs.DividerBlock; }
|
|
30
38
|
});
|
|
31
39
|
Object.defineProperty(exports, "HeadingBlock", {
|
|
32
40
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkRZOR3HOA_cjs.HeadingBlock; }
|
|
34
42
|
});
|
|
35
43
|
Object.defineProperty(exports, "IconTextBlock", {
|
|
36
44
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkRZOR3HOA_cjs.IconTextBlock; }
|
|
38
46
|
});
|
|
39
47
|
Object.defineProperty(exports, "ImageBlock", {
|
|
40
48
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkRZOR3HOA_cjs.ImageBlock; }
|
|
42
50
|
});
|
|
43
51
|
Object.defineProperty(exports, "ImageGridBlock", {
|
|
44
52
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkRZOR3HOA_cjs.ImageGridBlock; }
|
|
46
54
|
});
|
|
47
55
|
Object.defineProperty(exports, "ImageTextBlock", {
|
|
48
56
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkRZOR3HOA_cjs.ImageTextBlock; }
|
|
50
58
|
});
|
|
51
59
|
Object.defineProperty(exports, "ListBlock", {
|
|
52
60
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkRZOR3HOA_cjs.ListBlock; }
|
|
54
62
|
});
|
|
55
63
|
Object.defineProperty(exports, "PageBreakBlock", {
|
|
56
64
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkRZOR3HOA_cjs.PageBreakBlock; }
|
|
58
66
|
});
|
|
59
67
|
Object.defineProperty(exports, "QuoteBlock", {
|
|
60
68
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkRZOR3HOA_cjs.QuoteBlock; }
|
|
62
70
|
});
|
|
63
71
|
Object.defineProperty(exports, "RichText", {
|
|
64
72
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkRZOR3HOA_cjs.RichText; }
|
|
66
74
|
});
|
|
67
75
|
Object.defineProperty(exports, "SpacerBlock", {
|
|
68
76
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkRZOR3HOA_cjs.SpacerBlock; }
|
|
70
78
|
});
|
|
71
79
|
Object.defineProperty(exports, "TableBlock", {
|
|
72
80
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkRZOR3HOA_cjs.TableBlock; }
|
|
74
82
|
});
|
|
75
83
|
Object.defineProperty(exports, "TextBlock", {
|
|
76
84
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkRZOR3HOA_cjs.TextBlock; }
|
|
78
86
|
});
|
|
79
87
|
Object.defineProperty(exports, "TwoColumnsBlock", {
|
|
80
88
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkRZOR3HOA_cjs.TwoColumnsBlock; }
|
|
82
90
|
});
|
|
83
91
|
Object.defineProperty(exports, "blocksByKey", {
|
|
84
92
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkRZOR3HOA_cjs.blocksByKey; }
|
|
86
94
|
});
|
|
87
95
|
Object.defineProperty(exports, "defaultBlocks", {
|
|
88
96
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkRZOR3HOA_cjs.defaultBlocks; }
|
|
90
98
|
});
|
|
91
99
|
Object.defineProperty(exports, "defineBlock", {
|
|
92
100
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkRZOR3HOA_cjs.defineBlock; }
|
|
94
102
|
});
|
|
95
103
|
Object.defineProperty(exports, "overrideBlock", {
|
|
96
104
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkRZOR3HOA_cjs.overrideBlock; }
|
|
98
106
|
});
|
|
99
107
|
//# sourceMappingURL=blocks.cjs.map
|
|
100
108
|
//# sourceMappingURL=blocks.cjs.map
|
package/dist/blocks.d.cts
CHANGED
|
@@ -170,6 +170,19 @@ type RichTextProps = {
|
|
|
170
170
|
};
|
|
171
171
|
declare function RichText({ html, editing, as, className }: RichTextProps): react.JSX.Element;
|
|
172
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Tipografia do texto rico do documento, em CSS cru para servir às três superfícies que
|
|
175
|
+
* mostram o MESMO conteúdo: o editor inline (iframe do TinyMCE, documento à parte que não
|
|
176
|
+
* recebe o CSS do app), o canvas do Puck e o HTML publicado. Antes cada uma caía num default
|
|
177
|
+
* diferente (h1 de 48px no canvas, 28px no editor, 32px no publicado) — ver docs/blocks.md.
|
|
178
|
+
*
|
|
179
|
+
* Sem `&` e sem seletor de escopo: dentro de `styled` os seletores de elemento já viram
|
|
180
|
+
* descendentes; no `content_style` do TinyMCE eles valem a partir do body.
|
|
181
|
+
*/
|
|
182
|
+
/** Declarações da base do texto — vão no container (ou no `body`, no iframe). */
|
|
183
|
+
declare const DOCUMENT_TEXT_CSS = "font-size: 16px;\nline-height: 1.5;\noverflow-wrap: break-word;\nword-break: break-word;";
|
|
184
|
+
declare const DOCUMENT_PROSE_CSS = "p {\n margin: 0 0 8px;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin: 0 0 8px;\n line-height: 1.25;\n font-weight: 600;\n}\n\nh1 { font-size: 2em; }\nh2 { font-size: 1.5em; }\nh3 { font-size: 1.25em; }\nh4 { font-size: 1.125em; }\nh5 { font-size: 1em; }\nh6 { font-size: 0.875em; }\n\nul, ol {\n margin: 0 0 8px;\n padding-left: 24px;\n}\n\nul { list-style: disc; }\nol { list-style: decimal; }\n\nli { margin: 0 0 4px; }\n\nstrong, b { font-weight: 600; }\nem, i { font-style: italic; }\n\na { color: var(--doc-brand, #005ac3); }\n\nimg { max-width: 100%; }\n\n/* O chip herda peso, estilo e sublinhado do texto ao redor: pinar qualquer um deles faz\n negrito/italico/sublinhado nao pegarem na variavel. Inline (e nao inline-block) porque\n text-decoration nao atravessa um inline-block. */\n.dg-var {\n display: inline;\n font-size: 0.92em;\n font-weight: inherit;\n font-style: inherit;\n white-space: nowrap;\n}\n\n/* Sem margem sobrando no fim do bloco. Seletores de elemento, e nao um combinador filho,\n porque a mesma string tambem e usada no topo de uma folha, onde nao ha pai. */\np:last-child,\nul:last-child,\nol:last-child,\nh1:last-child,\nh2:last-child,\nh3:last-child,\nh4:last-child,\nh5:last-child,\nh6:last-child {\n margin-bottom: 0;\n}";
|
|
185
|
+
|
|
173
186
|
type ContentIconDef = {
|
|
174
187
|
label: string;
|
|
175
188
|
group: string;
|
|
@@ -198,4 +211,4 @@ type ContentIconProps = {
|
|
|
198
211
|
};
|
|
199
212
|
declare function ContentIcon({ name, size, color, strokeWidth, style, className }: ContentIconProps): react.JSX.Element | null;
|
|
200
213
|
|
|
201
|
-
export { BlockEntry, ButtonBlock, CONTENT_ICON_CATALOG, CONTENT_ICON_NAMES, ContentIcon, type ContentIconDef, type ContentIconProps, DividerBlock, HeadingBlock, IconTextBlock, ImageBlock, ImageGridBlock, ImageTextBlock, ListBlock, PageBreakBlock, QuoteBlock, Registry, RichText, type RichTextProps, SpacerBlock, TableBlock, TextBlock, TwoColumnsBlock, blocksByKey, defaultBlocks, defineBlock, overrideBlock };
|
|
214
|
+
export { BlockEntry, ButtonBlock, CONTENT_ICON_CATALOG, CONTENT_ICON_NAMES, ContentIcon, type ContentIconDef, type ContentIconProps, DOCUMENT_PROSE_CSS, DOCUMENT_TEXT_CSS, DividerBlock, HeadingBlock, IconTextBlock, ImageBlock, ImageGridBlock, ImageTextBlock, ListBlock, PageBreakBlock, QuoteBlock, Registry, RichText, type RichTextProps, SpacerBlock, TableBlock, TextBlock, TwoColumnsBlock, blocksByKey, defaultBlocks, defineBlock, overrideBlock };
|
package/dist/blocks.d.ts
CHANGED
|
@@ -170,6 +170,19 @@ type RichTextProps = {
|
|
|
170
170
|
};
|
|
171
171
|
declare function RichText({ html, editing, as, className }: RichTextProps): react.JSX.Element;
|
|
172
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Tipografia do texto rico do documento, em CSS cru para servir às três superfícies que
|
|
175
|
+
* mostram o MESMO conteúdo: o editor inline (iframe do TinyMCE, documento à parte que não
|
|
176
|
+
* recebe o CSS do app), o canvas do Puck e o HTML publicado. Antes cada uma caía num default
|
|
177
|
+
* diferente (h1 de 48px no canvas, 28px no editor, 32px no publicado) — ver docs/blocks.md.
|
|
178
|
+
*
|
|
179
|
+
* Sem `&` e sem seletor de escopo: dentro de `styled` os seletores de elemento já viram
|
|
180
|
+
* descendentes; no `content_style` do TinyMCE eles valem a partir do body.
|
|
181
|
+
*/
|
|
182
|
+
/** Declarações da base do texto — vão no container (ou no `body`, no iframe). */
|
|
183
|
+
declare const DOCUMENT_TEXT_CSS = "font-size: 16px;\nline-height: 1.5;\noverflow-wrap: break-word;\nword-break: break-word;";
|
|
184
|
+
declare const DOCUMENT_PROSE_CSS = "p {\n margin: 0 0 8px;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin: 0 0 8px;\n line-height: 1.25;\n font-weight: 600;\n}\n\nh1 { font-size: 2em; }\nh2 { font-size: 1.5em; }\nh3 { font-size: 1.25em; }\nh4 { font-size: 1.125em; }\nh5 { font-size: 1em; }\nh6 { font-size: 0.875em; }\n\nul, ol {\n margin: 0 0 8px;\n padding-left: 24px;\n}\n\nul { list-style: disc; }\nol { list-style: decimal; }\n\nli { margin: 0 0 4px; }\n\nstrong, b { font-weight: 600; }\nem, i { font-style: italic; }\n\na { color: var(--doc-brand, #005ac3); }\n\nimg { max-width: 100%; }\n\n/* O chip herda peso, estilo e sublinhado do texto ao redor: pinar qualquer um deles faz\n negrito/italico/sublinhado nao pegarem na variavel. Inline (e nao inline-block) porque\n text-decoration nao atravessa um inline-block. */\n.dg-var {\n display: inline;\n font-size: 0.92em;\n font-weight: inherit;\n font-style: inherit;\n white-space: nowrap;\n}\n\n/* Sem margem sobrando no fim do bloco. Seletores de elemento, e nao um combinador filho,\n porque a mesma string tambem e usada no topo de uma folha, onde nao ha pai. */\np:last-child,\nul:last-child,\nol:last-child,\nh1:last-child,\nh2:last-child,\nh3:last-child,\nh4:last-child,\nh5:last-child,\nh6:last-child {\n margin-bottom: 0;\n}";
|
|
185
|
+
|
|
173
186
|
type ContentIconDef = {
|
|
174
187
|
label: string;
|
|
175
188
|
group: string;
|
|
@@ -198,4 +211,4 @@ type ContentIconProps = {
|
|
|
198
211
|
};
|
|
199
212
|
declare function ContentIcon({ name, size, color, strokeWidth, style, className }: ContentIconProps): react.JSX.Element | null;
|
|
200
213
|
|
|
201
|
-
export { BlockEntry, ButtonBlock, CONTENT_ICON_CATALOG, CONTENT_ICON_NAMES, ContentIcon, type ContentIconDef, type ContentIconProps, DividerBlock, HeadingBlock, IconTextBlock, ImageBlock, ImageGridBlock, ImageTextBlock, ListBlock, PageBreakBlock, QuoteBlock, Registry, RichText, type RichTextProps, SpacerBlock, TableBlock, TextBlock, TwoColumnsBlock, blocksByKey, defaultBlocks, defineBlock, overrideBlock };
|
|
214
|
+
export { BlockEntry, ButtonBlock, CONTENT_ICON_CATALOG, CONTENT_ICON_NAMES, ContentIcon, type ContentIconDef, type ContentIconProps, DOCUMENT_PROSE_CSS, DOCUMENT_TEXT_CSS, DividerBlock, HeadingBlock, IconTextBlock, ImageBlock, ImageGridBlock, ImageTextBlock, ListBlock, PageBreakBlock, QuoteBlock, Registry, RichText, type RichTextProps, SpacerBlock, TableBlock, TextBlock, TwoColumnsBlock, blocksByKey, defaultBlocks, defineBlock, overrideBlock };
|
package/dist/blocks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ButtonBlock, CONTENT_ICON_CATALOG, CONTENT_ICON_NAMES, ContentIcon, DividerBlock, HeadingBlock, IconTextBlock, ImageBlock, ImageGridBlock, ImageTextBlock, ListBlock, PageBreakBlock, QuoteBlock, RichText, SpacerBlock, TableBlock, TextBlock, TwoColumnsBlock, blocksByKey, defaultBlocks, defineBlock, overrideBlock } from './chunk-
|
|
1
|
+
export { ButtonBlock, CONTENT_ICON_CATALOG, CONTENT_ICON_NAMES, ContentIcon, DOCUMENT_PROSE_CSS, DOCUMENT_TEXT_CSS, DividerBlock, HeadingBlock, IconTextBlock, ImageBlock, ImageGridBlock, ImageTextBlock, ListBlock, PageBreakBlock, QuoteBlock, RichText, SpacerBlock, TableBlock, TextBlock, TwoColumnsBlock, blocksByKey, defaultBlocks, defineBlock, overrideBlock } from './chunk-OJZJJEJX.js';
|
|
2
2
|
import './chunk-QYBWIJXZ.js';
|
|
3
3
|
import './chunk-ZOJBDFKU.js';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-MUSSJOOA.js';
|
|
5
|
+
import './chunk-SOIYSSU3.js';
|
|
6
6
|
//# sourceMappingURL=blocks.js.map
|
|
7
7
|
//# sourceMappingURL=blocks.js.map
|
|
@@ -22,10 +22,20 @@ var PAGE_WIDTH_PX = {
|
|
|
22
22
|
Letter: 816,
|
|
23
23
|
Legal: 816
|
|
24
24
|
};
|
|
25
|
+
var PAGE_HEIGHT_PX = {
|
|
26
|
+
A4: 1123,
|
|
27
|
+
A5: 794,
|
|
28
|
+
A3: 1587,
|
|
29
|
+
Letter: 1056,
|
|
30
|
+
Legal: 1344
|
|
31
|
+
};
|
|
25
32
|
var DEFAULT_PAGE_MARGINS = { top: 24, right: 24, bottom: 24, left: 24 };
|
|
26
33
|
function pageWidthPx(format = "A4") {
|
|
27
34
|
return PAGE_WIDTH_PX[format];
|
|
28
35
|
}
|
|
36
|
+
function pageHeightPx(format = "A4") {
|
|
37
|
+
return PAGE_HEIGHT_PX[format];
|
|
38
|
+
}
|
|
29
39
|
function marginsToPadding(margins) {
|
|
30
40
|
const m = { ...DEFAULT_PAGE_MARGINS, ...margins };
|
|
31
41
|
return `${m.top}px ${m.right}px ${m.bottom}px ${m.left}px`;
|
|
@@ -51,6 +61,13 @@ var PageFrame = styled__default.default.div`
|
|
|
51
61
|
box-sizing: border-box;
|
|
52
62
|
}
|
|
53
63
|
|
|
64
|
+
& button,
|
|
65
|
+
& input,
|
|
66
|
+
& select,
|
|
67
|
+
& textarea {
|
|
68
|
+
font: inherit;
|
|
69
|
+
}
|
|
70
|
+
|
|
54
71
|
& [data-docgen-block] {
|
|
55
72
|
margin-bottom: 16px;
|
|
56
73
|
}
|
|
@@ -400,8 +417,9 @@ exports.buildConfig = buildConfig;
|
|
|
400
417
|
exports.fontStack = fontStack;
|
|
401
418
|
exports.gfontHref = gfontHref;
|
|
402
419
|
exports.marginsToPadding = marginsToPadding;
|
|
420
|
+
exports.pageHeightPx = pageHeightPx;
|
|
403
421
|
exports.pageWidthPx = pageWidthPx;
|
|
404
422
|
exports.useDocumentFont = useDocumentFont;
|
|
405
423
|
exports.useDocumentTheme = useDocumentTheme;
|
|
406
|
-
//# sourceMappingURL=chunk-
|
|
407
|
-
//# sourceMappingURL=chunk-
|
|
424
|
+
//# sourceMappingURL=chunk-2VZW2MGO.cjs.map
|
|
425
|
+
//# sourceMappingURL=chunk-2VZW2MGO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/surface/surface.tsx","../src/surface/fonts.ts","../src/surface/themeContext.tsx","../src/surface/DocumentPage.tsx","../src/surface/appearance.ts","../src/surface/useDocumentFont.ts","../src/surface/BlockShell.tsx","../src/core/buildConfig.ts"],"names":["styled","createContext","useContext","jsx","useEffect","createElement"],"mappings":";;;;;;;;;;;AAEO,IAAM,qBAAA,GACX;AAEK,IAAM,uBAAA,GAA0B;AAAA,EACrC,KAAA,EAAO,SAAA;AAAA,EACP,IAAA,EAAM,SAAA;AAAA,EACN,UAAA,EAAY;AACd;AAMA,IAAM,aAAA,GAA4C;AAAA,EAChD,EAAA,EAAI,GAAA;AAAA,EACJ,EAAA,EAAI,GAAA;AAAA,EACJ,EAAA,EAAI,IAAA;AAAA,EACJ,MAAA,EAAQ,GAAA;AAAA,EACR,KAAA,EAAO;AACT,CAAA;AAEA,IAAM,cAAA,GAA6C;AAAA,EACjD,EAAA,EAAI,IAAA;AAAA,EACJ,EAAA,EAAI,GAAA;AAAA,EACJ,EAAA,EAAI,IAAA;AAAA,EACJ,MAAA,EAAQ,IAAA;AAAA,EACR,KAAA,EAAO;AACT,CAAA;AAEO,IAAM,oBAAA,GAA8C,EAAE,GAAA,EAAK,EAAA,EAAI,OAAO,EAAA,EAAI,MAAA,EAAQ,EAAA,EAAI,IAAA,EAAM,EAAA;AAE5F,SAAS,WAAA,CAAY,SAAqB,IAAA,EAAc;AAC7D,EAAA,OAAO,cAAc,MAAM,CAAA;AAC7B;AAEO,SAAS,YAAA,CAAa,SAAqB,IAAA,EAAc;AAC9D,EAAA,OAAO,eAAe,MAAM,CAAA;AAC9B;AAEO,SAAS,iBAAiB,OAAA,EAA+B;AAC9D,EAAA,MAAM,CAAA,GAAI,EAAE,GAAG,oBAAA,EAAsB,GAAG,OAAA,EAAQ;AAChD,EAAA,OAAO,CAAA,EAAG,CAAA,CAAE,GAAG,CAAA,GAAA,EAAM,CAAA,CAAE,KAAK,CAAA,GAAA,EAAM,CAAA,CAAE,MAAM,CAAA,GAAA,EAAM,CAAA,CAA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,GACzC;AAEA,EAAA,OAAO,EAAE,IAAA,EAAM,UAAA,EAAY,UAAA,EAAW;AACxC","file":"chunk-2VZW2MGO.cjs","sourcesContent":["import styled from 'styled-components';\n\nexport const DEFAULT_DOCUMENT_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif\";\n\nexport const DEFAULT_DOCUMENT_COLORS = {\n brand: '#005AC3',\n text: '#3F4759',\n background: '#FFFFFF'\n} as const;\n\nexport type PageFormat = 'A4' | 'A5' | 'A3' | 'Letter' | 'Legal';\nexport type PageMargins = { top?: number; right?: number; bottom?: number; left?: number };\nexport type PageOptions = { format?: PageFormat; margins?: PageMargins };\n\nconst PAGE_WIDTH_PX: Record<PageFormat, number> = {\n A4: 794,\n A5: 559,\n A3: 1123,\n Letter: 816,\n Legal: 816\n};\n\nconst PAGE_HEIGHT_PX: Record<PageFormat, number> = {\n A4: 1123,\n A5: 794,\n A3: 1587,\n Letter: 1056,\n Legal: 1344\n};\n\nexport const DEFAULT_PAGE_MARGINS: Required<PageMargins> = { top: 24, right: 24, bottom: 24, left: 24 };\n\nexport function pageWidthPx(format: PageFormat = 'A4'): number {\n return PAGE_WIDTH_PX[format];\n}\n\nexport function pageHeightPx(format: PageFormat = 'A4'): number {\n return PAGE_HEIGHT_PX[format];\n}\n\nexport function marginsToPadding(margins?: PageMargins): string {\n const m = { ...DEFAULT_PAGE_MARGINS, ...margins };\n return `${m.top}px ${m.right}px ${m.bottom}px ${m.left}px`;\n}\n\n/** A página do documento — compartilhada pelo editor, viewer e PDF via `root` do Puck. */\nexport const PageFrame = styled.div<{\n $width: number;\n $padding: string;\n $font: string;\n $brand: string;\n $text: string;\n $bg: string;\n $padTop?: number;\n $padRight?: number;\n $padLeft?: number;\n 'data-docgen-root'?: string;\n}>`\n --doc-brand: ${props => props.$brand};\n --doc-text: ${props => props.$text};\n --doc-bg: ${props => props.$bg};\n font-family: ${props => props.$font};\n width: ${props => props.$width}px;\n max-width: 100%;\n min-height: 100%;\n margin: 0 auto;\n padding: ${props => props.$padding};\n background: var(--doc-bg);\n color: var(--doc-text);\n box-sizing: border-box;\n\n &,\n & *,\n & *::before,\n & *::after {\n box-sizing: border-box;\n }\n\n & button,\n & input,\n & select,\n & textarea {\n font: inherit;\n }\n\n & [data-docgen-block] {\n margin-bottom: 16px;\n }\n\n /* A capa é full-bleed (no preview/PDF ela sai do PageFrame via hoist). No editor\n ela renderiza em fluxo dentro do padding da folha — neutralizamos esse padding\n só pra ela, pra bater com o preview. O bleed vai no wrapper do Puck\n ([data-puck-component]) e não no bloco interno, senão a borda de seleção do Puck\n (desenhada no wrapper) fica inset. No PDF/viewer esse seletor nem existe (hoist). */\n & [data-puck-component]:has([data-docgen-block='Cover']) {\n margin-top: ${props => -(props.$padTop ?? 0)}px;\n margin-left: ${props => -(props.$padLeft ?? 0)}px;\n margin-right: ${props => -(props.$padRight ?? 0)}px;\n width: calc(100% + ${props => (props.$padLeft ?? 0) + (props.$padRight ?? 0)}px);\n }\n`;\n\n/** Chrome do editor: mesa cinza + folha com sombra (só editor). Porquês: docs/architecture.md. */\nexport const EditorShell = styled.div`\n height: 100%;\n\n li[data-puck-layer-tree-id] button > div,\n li[data-puck-layer-tree-id] button > div > div {\n overflow: hidden;\n }\n\n #puck-canvas-root,\n [class*='_PuckCanvas_'] {\n background: #e8e9eb;\n outline: none;\n }\n\n [class*='_PuckCanvas_'][class*='_PuckCanvas_'][class*='_PuckCanvas_'] {\n padding: 0;\n }\n\n #preview-frame {\n display: flex;\n flex-direction: column;\n align-items: center;\n box-sizing: border-box;\n min-height: 100%;\n padding: 32px 16px;\n }\n\n #preview-frame > * {\n flex: 1 0 auto;\n min-height: 0;\n box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);\n }\n`;\n\n/** Card custom do item no palette (substitui o item padrão do Puck): ícone + nome. */\nexport const DrawerCard = styled.div<{ $disabled?: boolean }>`\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n padding: 11px 12px;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n background: #fff;\n cursor: grab;\n font-size: 14px;\n color: #1f2937;\n\n &:hover {\n background: #f3f6fb;\n border-color: #c3c9d2;\n }\n\n ${props =>\n props.$disabled &&\n `\n opacity: 0.45;\n cursor: not-allowed;\n\n &:hover {\n background: #fff;\n border-color: #e5e7eb;\n }\n `}\n`;\n\n/**\n * Tooltip imediato para o card desabilitado do palette (o title nativo demora ~1s).\n * Os seletores de hover repetem `[data-hint]:not([data-hint=''])` para empatar a\n * especificidade da regra base — `&:hover::after` sozinho perde e o tooltip nunca aparece.\n */\nexport const DrawerHint = styled.div`\n position: relative;\n\n &[data-hint]:not([data-hint=''])::after {\n content: attr(data-hint);\n position: absolute;\n left: 50%;\n top: calc(100% + 6px);\n transform: translateX(-50%) translateY(-2px);\n width: max-content;\n max-width: 220px;\n padding: 6px 10px;\n background: #1f2937;\n color: #fff;\n font-size: 12px;\n line-height: 1.35;\n text-align: center;\n border-radius: 6px;\n opacity: 0;\n pointer-events: none;\n transition:\n opacity 0.12s ease,\n transform 0.12s ease;\n z-index: 20;\n }\n\n &[data-hint]:not([data-hint=''])::before {\n content: '';\n position: absolute;\n left: 50%;\n top: calc(100% + 1px);\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-bottom-color: #1f2937;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.12s ease;\n z-index: 20;\n }\n\n &[data-hint]:not([data-hint='']):hover::after,\n &[data-hint]:not([data-hint='']):hover::before {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n\n &[data-hint]:not([data-hint='']):hover::before {\n transform: translateX(-50%);\n }\n`;\n\n/** Mensagem do painel de propriedades quando nenhum bloco está selecionado. */\nexport const PanelPlaceholder = styled.div`\n padding: 24px 12px;\n color: #6b7280;\n font-size: 13px;\n line-height: 1.5;\n text-align: center;\n`;\n\nexport const DrawerItemIcon = styled.span`\n display: flex;\n flex-shrink: 0;\n align-items: center;\n color: #6b7280;\n`;\n","import { DEFAULT_DOCUMENT_FONT } from './surface';\n\nexport type DocumentFont = {\n id: string;\n label: string;\n stack: string;\n /** Família no Google Fonts; ausente = fonte de sistema (nada a carregar). */\n gfont?: string;\n};\n\nexport const DOCUMENT_FONTS: readonly DocumentFont[] = [\n { id: 'inter', label: 'Inter', stack: \"'Inter', sans-serif\", gfont: 'Inter:wght@400;500;600;700' },\n { id: 'arial', label: 'Arial', stack: 'Arial, Helvetica, sans-serif' },\n { id: 'calibri', label: 'Calibri', stack: \"Calibri, Carlito, 'Segoe UI', sans-serif\" },\n { id: 'times-new-roman', label: 'Times New Roman', stack: \"'Times New Roman', Times, serif\" },\n { id: 'roboto', label: 'Roboto', stack: \"'Roboto', sans-serif\", gfont: 'Roboto:wght@400;500;700' },\n { id: 'open-sans', label: 'Open Sans', stack: \"'Open Sans', sans-serif\", gfont: 'Open+Sans:wght@400;500;600;700' },\n {\n id: 'montserrat',\n label: 'Montserrat',\n stack: \"'Montserrat', sans-serif\",\n gfont: 'Montserrat:wght@400;500;600;700'\n },\n { id: 'lato', label: 'Lato', stack: \"'Lato', sans-serif\", gfont: 'Lato:wght@400;700' },\n { id: 'georgia', label: 'Georgia', stack: \"Georgia, 'Times New Roman', serif\" },\n { id: 'helvetica', label: 'Helvetica', stack: \"'Helvetica Neue', Helvetica, Arial, sans-serif\" }\n] as const;\n\nconst byId = new Map(DOCUMENT_FONTS.map(f => [f.id, f]));\n\nconst primaryFamily = (stack: string): string =>\n stack\n .split(',')[0]\n .trim()\n .replace(/^['\"]|['\"]$/g, '');\n\n/**\n * Fontes do Google ganham um alias próprio (`<Família> Doc`) no topo do stack: o app\n * hospedeiro pode ter um @font-face com o mesmo nome apontando pra outros arquivos\n * (ex.: Inter estática do FBO), e o alias garante que o documento use os arquivos do\n * Google nos dois lados — no editor via useDocumentFont (CSS reescrito) e no artifact\n * o alias não resolve e cai na família original do <link> (mesmos arquivos).\n */\nexport function docFontFamilies(id?: string): { primary: string; alias: string } | null {\n const font = id ? byId.get(id) : undefined;\n if (!font?.gfont) return null;\n const primary = primaryFamily(font.stack);\n return { primary, alias: `${primary} Doc` };\n}\n\nexport function fontStack(id?: string): string {\n const font = id ? byId.get(id) : undefined;\n if (!font) return DEFAULT_DOCUMENT_FONT;\n const families = docFontFamilies(id);\n return families ? `'${families.alias}', ${font.stack}` : font.stack;\n}\n\nexport function gfontHref(id?: string): string | null {\n const font = id ? byId.get(id) : undefined;\n if (!font?.gfont) return null;\n return `https://fonts.googleapis.com/css2?family=${font.gfont}&display=swap`;\n}\n","import { createContext, useContext, type ReactNode } from 'react';\nimport type { Theme } from '../schema/theme';\n\nconst EMPTY_THEME: Theme = {};\n\n/** `null` distingue \"sem provider\" de \"provider com tema vazio\" — ver DocumentPage. */\nconst DocumentThemeContext = createContext<Theme | null>(null);\n\nexport type DocumentThemeProviderProps = {\n theme?: Theme;\n children?: ReactNode;\n};\n\n/**\n * Publica o tema do documento na árvore. Montado por `DocumentEditor` e\n * `DocumentRenderer` — é o canal que mantém o `Config` do Puck estável quando o\n * tema muda (ver docs/theme.md).\n */\nexport function DocumentThemeProvider({ theme, children }: DocumentThemeProviderProps) {\n return <DocumentThemeContext.Provider value={theme ?? EMPTY_THEME}>{children}</DocumentThemeContext.Provider>;\n}\n\n/** Tema do documento; `{}` quando não há provider acima. */\nexport function useDocumentTheme(): Theme {\n return useContext(DocumentThemeContext) ?? EMPTY_THEME;\n}\n\n/** Igual ao `useDocumentTheme`, mas devolve `null` sem provider (uso interno). */\nexport function useOptionalDocumentTheme(): Theme | null {\n return useContext(DocumentThemeContext);\n}\n","import type { ReactNode } from 'react';\nimport type { Theme } from '../schema/theme';\nimport { DEFAULT_DOCUMENT_COLORS, DEFAULT_PAGE_MARGINS, PageFrame, marginsToPadding, pageWidthPx } from './surface';\nimport { fontStack } from './fonts';\nimport { useOptionalDocumentTheme } from './themeContext';\n\nexport type DocumentPageProps = {\n children?: ReactNode;\n /** Usado só quando não há `DocumentThemeProvider` acima (ver `BuildConfigOptions.theme`). */\n fallbackTheme?: Theme;\n};\n\n/**\n * `root.render` do Puck: a folha do documento (largura, margens, fonte e CSS vars\n * de cor). Lê o tema do contexto em vez de recebê-lo por closure — assim o\n * componente tem identidade estável e trocar de tema não remonta os blocos.\n */\nexport function DocumentPage({ children, fallbackTheme }: DocumentPageProps) {\n const theme = useOptionalDocumentTheme() ?? fallbackTheme ?? {};\n const margins = { ...DEFAULT_PAGE_MARGINS, ...(theme.page?.margins ?? {}) };\n const colors = { ...DEFAULT_DOCUMENT_COLORS, ...theme.colors };\n\n return (\n <PageFrame\n data-docgen-root=\"\"\n $width={pageWidthPx(theme.page?.format)}\n $padding={marginsToPadding(theme.page?.margins)}\n $padTop={margins.top}\n $padRight={margins.right}\n $padLeft={margins.left}\n $font={fontStack(theme.documentFont)}\n $brand={colors.brand}\n $text={colors.text}\n $bg={colors.background}\n >\n {children}\n </PageFrame>\n );\n}\n","import type { CSSProperties } from 'react';\nimport type { Appearance } from '../schema/appearance';\nimport { fontStack } from './fonts';\n\nexport const FONT_WEIGHT: Record<string, number> = { normal: 400, medium: 500, bold: 700 };\n\n/** Sobrescrita por bloco → estilo do wrapper (cores viram CSS vars locais; não-set herda o tema). */\nexport function appearanceToStyle(a?: Appearance): CSSProperties {\n const style: Record<string, string | number> = {};\n if (!a) return style;\n if (a.brand !== undefined) style['--doc-brand'] = a.brand;\n if (a.text !== undefined) {\n style['--doc-text'] = a.text;\n style.color = a.text;\n }\n if (a.background !== undefined) style.background = a.background;\n if (a.fontSize !== undefined) style.fontSize = a.fontSize;\n if (a.fontFamily !== undefined) style.fontFamily = fontStack(a.fontFamily);\n if (a.fontWeight !== undefined) style.fontWeight = FONT_WEIGHT[a.fontWeight];\n if (a.textAlign !== undefined) style.textAlign = a.textAlign;\n return style as CSSProperties;\n}\n","import { useEffect } from 'react';\nimport { docFontFamilies, gfontHref } from './fonts';\n\n/**\n * Carrega a fonte do documento no app hospedeiro. O CSS do Google é baixado e\n * reescrito pra família alias (`<Família> Doc`, ver docFontFamilies) — assim o\n * canvas do editor usa os MESMOS arquivos do preview mesmo quando o app já tem\n * um @font-face com o nome original. Se o fetch falhar, cai pro <link> direto\n * (família original — comportamento antigo).\n */\nexport function useDocumentFont(id?: string): void {\n useEffect(() => {\n const href = gfontHref(id);\n if (!href || typeof document === 'undefined') return undefined;\n\n const selector = `[data-docgen-font=\"${id}\"]`;\n if (document.head.querySelector(selector)) return undefined;\n\n if (typeof fetch === 'undefined') {\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n link.href = href;\n link.setAttribute('data-docgen-font', id as string);\n document.head.appendChild(link);\n return undefined;\n }\n\n const families = docFontFamilies(id);\n const style = document.createElement('style');\n style.setAttribute('data-docgen-font', id as string);\n document.head.appendChild(style);\n\n fetch(href)\n .then(res => {\n if (!res.ok) throw new Error(`gfont css ${res.status}`);\n return res.text();\n })\n .then(css => {\n style.textContent = families\n ? css.split(`font-family: '${families.primary}'`).join(`font-family: '${families.alias}'`)\n : css;\n })\n .catch(() => {\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n link.href = href;\n link.setAttribute('data-docgen-font', id as string);\n style.replaceWith(link);\n });\n return undefined;\n }, [id]);\n}\n","import type { ReactNode } from 'react';\nimport type { Appearance } from '../schema/appearance';\nimport { appearanceToStyle } from './appearance';\nimport { useDocumentFont } from './useDocumentFont';\n\nexport type BlockShellProps = {\n blockKey: string;\n appearance?: Appearance;\n children?: ReactNode;\n};\n\n/** Wrapper de todo bloco: aplica a aparência local e carrega a Google Font do bloco. */\nexport function BlockShell({ blockKey, appearance, children }: BlockShellProps) {\n useDocumentFont(appearance?.fontFamily);\n\n return (\n <div data-docgen-block={blockKey} style={appearanceToStyle(appearance)}>\n {children}\n </div>\n );\n}\n","import { createElement, type ComponentType } from 'react';\nimport type { ComponentConfig, Config } from '@puckeditor/core';\nimport type { BlockEntry, Registry } from '../blocks/types';\nimport { PanelPlaceholder } from '../surface/surface';\nimport { DocumentPage, type DocumentPageProps } from '../surface/DocumentPage';\nimport type { Theme } from '../schema/theme';\nimport { BlockShell } from '../surface/BlockShell';\n\nexport type BuildConfigOptions = {\n /**\n * Tema aplicado apenas quando NÃO há `DocumentThemeProvider` acima (uso avulso\n * de `buildConfig` + `<Render>`). No editor e no renderer o tema vem do provider:\n * passá-lo aqui troca a identidade de `root.render` a cada mudança e o Puck\n * remonta a árvore inteira. Ver docs/theme.md.\n */\n theme?: Theme;\n};\n\n/**\n * O Puck monta `componentConfig.render` como TIPO de elemento\n * (`<Component {...props}/>`), então uma closure nova por build desmonta e remonta\n * o bloco inteiro — perdendo foco, seleção e estado de editores embutidos. O cache\n * abaixo dá identidade estável por (componente, key). Ver docs/architecture.md.\n */\nconst blockRenderCache = new WeakMap<ComponentType<any>, Map<string, ComponentType<any>>>();\n\nfunction blockRender(key: string, Component: ComponentType<any>): ComponentType<any> {\n let byKey = blockRenderCache.get(Component);\n if (!byKey) {\n byKey = new Map();\n blockRenderCache.set(Component, byKey);\n }\n\n const cached = byKey.get(key);\n if (cached) return cached;\n\n function Block(props: any) {\n return createElement(BlockShell, { blockKey: key, appearance: props.appearance }, createElement(Component, props));\n }\n Block.displayName = `DocumentBlock(${key})`;\n byKey.set(key, Block);\n return Block;\n}\n\nconst fallbackPageCache = new WeakMap<Theme, ComponentType<any>>();\n\nfunction fallbackPage(theme: Theme): ComponentType<any> {\n const cached = fallbackPageCache.get(theme);\n if (cached) return cached;\n\n function Page(props: DocumentPageProps) {\n return createElement(DocumentPage, { ...props, fallbackTheme: theme });\n }\n Page.displayName = 'DocumentPage(fallback)';\n fallbackPageCache.set(theme, Page);\n return Page;\n}\n\n/**\n * Registry → Puck `Config` (mesmo config no editor, viewer e PDF). Replace-by-key;\n * `root.render` embrulha tudo no PageFrame do documento, que lê o tema do contexto.\n */\nexport function buildConfig(registry: Registry, options: BuildConfigOptions = {}): Config {\n const { theme } = options;\n\n const byKey = new Map<string, BlockEntry>();\n registry.forEach(entry => {\n byKey.set(entry.key, entry);\n });\n\n const components: Record<string, ComponentConfig<any>> = {};\n const categoryMap: Record<string, string[]> = {};\n\n byKey.forEach((entry, key) => {\n const { fields, defaultProps, component: Component } = entry;\n\n components[key] = {\n label: entry.label ?? key,\n fields,\n defaultProps,\n ...(entry.permissions && { permissions: entry.permissions }),\n render: blockRender(key, Component as ComponentType<any>)\n } as ComponentConfig<any>;\n\n const category = entry.category ?? 'other';\n if (!categoryMap[category]) categoryMap[category] = [];\n categoryMap[category].push(key);\n });\n\n const categories: NonNullable<Config['categories']> = {};\n Object.keys(categoryMap).forEach(name => {\n categories[name] = { components: categoryMap[name] };\n });\n\n const root: Config['root'] = {\n label: 'Página',\n fields: {\n placeholder: {\n type: 'custom',\n render: () => createElement(PanelPlaceholder, null, 'Selecione um bloco para editar suas propriedades.')\n }\n },\n render: (theme ? fallbackPage(theme) : DocumentPage) as NonNullable<Config['root']>['render']\n };\n\n return { root, components, categories } as Config;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk2VZW2MGO_cjs = require('./chunk-2VZW2MGO.cjs');
|
|
4
|
+
var chunkQJ5W5EED_cjs = require('./chunk-QJ5W5EED.cjs');
|
|
5
|
+
var chunkSP5LCPDG_cjs = require('./chunk-SP5LCPDG.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var core = require('@puckeditor/core');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -23,15 +23,15 @@ function DocumentRenderer({
|
|
|
23
23
|
unresolvedDisplay = "placeholder",
|
|
24
24
|
metadata
|
|
25
25
|
}) {
|
|
26
|
-
const config = react.useMemo(() =>
|
|
26
|
+
const config = react.useMemo(() => chunk2VZW2MGO_cjs.buildConfig(registry), [registry]);
|
|
27
27
|
const [resolved, setResolved] = react.useState(resolvedVariables ?? {});
|
|
28
|
-
|
|
29
|
-
const keysHash = react.useMemo(() =>
|
|
28
|
+
chunk2VZW2MGO_cjs.useDocumentFont(theme.documentFont);
|
|
29
|
+
const keysHash = react.useMemo(() => chunkSP5LCPDG_cjs.extractBindingKeys(data).sort().join("|"), [data]);
|
|
30
30
|
const ctxHash = JSON.stringify(ctx);
|
|
31
31
|
react.useEffect(() => {
|
|
32
32
|
if (resolvedVariables || !resolver || keysHash === "") return void 0;
|
|
33
33
|
let active = true;
|
|
34
|
-
|
|
34
|
+
chunkQJ5W5EED_cjs.resolveDocumentVariables(data, catalog, resolver, ctx).then((next) => {
|
|
35
35
|
if (active) setResolved(next);
|
|
36
36
|
});
|
|
37
37
|
return () => {
|
|
@@ -39,7 +39,7 @@ function DocumentRenderer({
|
|
|
39
39
|
};
|
|
40
40
|
}, [resolvedVariables, resolver, catalog, keysHash, ctxHash]);
|
|
41
41
|
const effective = resolvedVariables ?? resolved;
|
|
42
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunk2VZW2MGO_cjs.DocumentThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(chunkSP5LCPDG_cjs.CatalogProvider, { catalog, children: /* @__PURE__ */ jsxRuntime.jsx(chunkSP5LCPDG_cjs.ResolvedProvider, { resolved: effective, unresolvedDisplay, children: /* @__PURE__ */ jsxRuntime.jsx(core.Render, { config, data, metadata }) }) }) });
|
|
43
43
|
}
|
|
44
44
|
var CoverEditContext = react.createContext({ editable: false });
|
|
45
45
|
function CoverField({ name, value, placeholder, as: Tag = "span", className }) {
|
|
@@ -228,7 +228,7 @@ var Subtitle = styled6__default.default(CoverField)`
|
|
|
228
228
|
line-height: 1.3;
|
|
229
229
|
`;
|
|
230
230
|
function Model1({ fields, theme, accent, textColor, bgColor }) {
|
|
231
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(CoverFrame, { $font:
|
|
231
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(CoverFrame, { $font: chunk2VZW2MGO_cjs.fontStack(theme?.documentFont), $bg: fields.imageUrl ? void 0 : bgColor, $color: textColor, children: [
|
|
232
232
|
fields.imageUrl ? /* @__PURE__ */ jsxRuntime.jsx(FullBleedImage, { $overlay: accent, $overlayOpacity: 0.85, children: /* @__PURE__ */ jsxRuntime.jsx(CoverImage, { src: fields.imageUrl }) }) : null,
|
|
233
233
|
/* @__PURE__ */ jsxRuntime.jsxs(Chrome, { children: [
|
|
234
234
|
/* @__PURE__ */ jsxRuntime.jsxs(TopRow, { children: [
|
|
@@ -322,7 +322,7 @@ function Model2({ fields, theme, accent, textColor, bgColor }) {
|
|
|
322
322
|
const showPrepared = editable || Boolean(fields.preparedFor);
|
|
323
323
|
const showPresented = editable || Boolean(fields.presentedBy);
|
|
324
324
|
const hasBand = showPrepared || showPresented;
|
|
325
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(CoverFrame, { $font:
|
|
325
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(CoverFrame, { $font: chunk2VZW2MGO_cjs.fontStack(theme?.documentFont), $bg: bgColor, $color: textColor, children: [
|
|
326
326
|
theme?.logo?.url ? /* @__PURE__ */ jsxRuntime.jsx(Logo2, { src: theme.logo.url, alt: "" }) : null,
|
|
327
327
|
showHead ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
328
328
|
/* @__PURE__ */ jsxRuntime.jsx(AccentBar, { $accent: accent }),
|
|
@@ -412,7 +412,7 @@ function Model3({ fields, theme, textColor, bgColor }) {
|
|
|
412
412
|
const { editable } = react.useContext(CoverEditContext);
|
|
413
413
|
const showPresented = editable || Boolean(fields.presentedBy);
|
|
414
414
|
const showPrepared = editable || Boolean(fields.preparedFor);
|
|
415
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(CoverFrame, { $font:
|
|
415
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(CoverFrame, { $font: chunk2VZW2MGO_cjs.fontStack(theme?.documentFont), $bg: bgColor, $color: textColor, children: [
|
|
416
416
|
/* @__PURE__ */ jsxRuntime.jsxs(ImageBand, { children: [
|
|
417
417
|
fields.imageUrl ? /* @__PURE__ */ jsxRuntime.jsx(CoverImage, { src: fields.imageUrl }) : null,
|
|
418
418
|
theme?.logo?.url ? /* @__PURE__ */ jsxRuntime.jsx(Logo3, { src: theme.logo.url, alt: "" }) : null
|
|
@@ -498,7 +498,7 @@ function Model4({ fields, theme, accent, textColor, bgColor }) {
|
|
|
498
498
|
const { editable } = react.useContext(CoverEditContext);
|
|
499
499
|
const showPrepared = editable || Boolean(fields.preparedFor);
|
|
500
500
|
const showPresented = editable || Boolean(fields.presentedBy);
|
|
501
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CoverFrame, { $font:
|
|
501
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CoverFrame, { $font: chunk2VZW2MGO_cjs.fontStack(theme?.documentFont), $bg: bgColor, $color: textColor, children: /* @__PURE__ */ jsxRuntime.jsxs(Body2, { children: [
|
|
502
502
|
theme?.logo?.url ? /* @__PURE__ */ jsxRuntime.jsx(Logo4, { src: theme.logo.url, alt: "" }) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
503
503
|
/* @__PURE__ */ jsxRuntime.jsxs(Head3, { children: [
|
|
504
504
|
/* @__PURE__ */ jsxRuntime.jsx(DateChip, { name: "date", value: fields.date, placeholder: "M\xEAs e ano", $accent: accent }),
|
|
@@ -588,7 +588,7 @@ var PresentedValue = styled6__default.default(CoverField)`
|
|
|
588
588
|
function Model5({ fields, theme, accent, textColor, bgColor }) {
|
|
589
589
|
const { editable } = react.useContext(CoverEditContext);
|
|
590
590
|
const showPresented = editable || Boolean(fields.presentedBy);
|
|
591
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(CoverFrame, { $font:
|
|
591
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(CoverFrame, { $font: chunk2VZW2MGO_cjs.fontStack(theme?.documentFont), $bg: bgColor, $color: textColor, children: [
|
|
592
592
|
/* @__PURE__ */ jsxRuntime.jsx(Spacer, {}),
|
|
593
593
|
/* @__PURE__ */ jsxRuntime.jsx(ImageBand2, { children: fields.imageUrl ? /* @__PURE__ */ jsxRuntime.jsx(FullBleedImage, { $overlay: accent, $overlayOpacity: 0.5, children: /* @__PURE__ */ jsxRuntime.jsx(CoverImage, { src: fields.imageUrl }) }) : null }),
|
|
594
594
|
/* @__PURE__ */ jsxRuntime.jsxs(Bottom, { children: [
|
|
@@ -617,7 +617,7 @@ var COVER_TEMPLATES = {
|
|
|
617
617
|
"model-5": Model5
|
|
618
618
|
};
|
|
619
619
|
var COVER_TEMPLATE_IDS = Object.keys(COVER_TEMPLATES);
|
|
620
|
-
var resolveCoverAccent = (accent, theme) => accent ?? theme?.colors?.brand ??
|
|
620
|
+
var resolveCoverAccent = (accent, theme) => accent ?? theme?.colors?.brand ?? chunk2VZW2MGO_cjs.DEFAULT_DOCUMENT_COLORS.brand;
|
|
621
621
|
var COVER_SURFACES = {
|
|
622
622
|
"model-1": "brand",
|
|
623
623
|
"model-2": "background",
|
|
@@ -627,7 +627,7 @@ var COVER_SURFACES = {
|
|
|
627
627
|
};
|
|
628
628
|
var ON_BRAND_TEXT = "#FFFFFF";
|
|
629
629
|
var resolveCoverColors = (templateId, { accent, textColor, bgColor }, theme) => {
|
|
630
|
-
const colors = { ...
|
|
630
|
+
const colors = { ...chunk2VZW2MGO_cjs.DEFAULT_DOCUMENT_COLORS, ...theme?.colors };
|
|
631
631
|
const onBrand = (COVER_SURFACES[templateId ?? ""] ?? COVER_SURFACES["model-1"]) === "brand";
|
|
632
632
|
const resolvedAccent = resolveCoverAccent(accent, theme);
|
|
633
633
|
return {
|
|
@@ -638,7 +638,7 @@ var resolveCoverColors = (templateId, { accent, textColor, bgColor }, theme) =>
|
|
|
638
638
|
};
|
|
639
639
|
function CoverPage({ templateId, accent, fields, theme, textColor, bgColor }) {
|
|
640
640
|
if (!templateId) return null;
|
|
641
|
-
const colors = { ...
|
|
641
|
+
const colors = { ...chunk2VZW2MGO_cjs.DEFAULT_DOCUMENT_COLORS, ...theme?.colors };
|
|
642
642
|
const vars = {
|
|
643
643
|
["--doc-brand"]: colors.brand,
|
|
644
644
|
["--doc-text"]: colors.text,
|
|
@@ -780,7 +780,7 @@ function HeaderBar({ config, companyInfo = {}, logoUrl, documentFont }) {
|
|
|
780
780
|
(key) => config.info?.[key] && companyInfo[key]
|
|
781
781
|
);
|
|
782
782
|
const logoLeft = config.logoPosition === "left";
|
|
783
|
-
return /* @__PURE__ */ jsxRuntime.jsx(HeaderRoot, { className: "dg-running-header", $color: config.color ?? "#3F4759", $font:
|
|
783
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HeaderRoot, { className: "dg-running-header", $color: config.color ?? "#3F4759", $font: chunk2VZW2MGO_cjs.fontStack(documentFont), children: /* @__PURE__ */ jsxRuntime.jsxs(HeaderLayout, { $reverse: logoLeft, children: [
|
|
784
784
|
/* @__PURE__ */ jsxRuntime.jsx(HeaderInfo, { $alignEnd: logoLeft, children: lines.map((key) => /* @__PURE__ */ jsxRuntime.jsxs(InfoLine, { $strong: key === "companyName", $iconAfter: logoLeft, children: [
|
|
785
785
|
COMPANY_INFO_ICONS[key],
|
|
786
786
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: companyInfo[key] })
|
|
@@ -811,7 +811,7 @@ function FooterBar({ config, companyInfo = {}, documentFont }) {
|
|
|
811
811
|
(key) => config?.info?.[key] && companyInfo[key]
|
|
812
812
|
) : [];
|
|
813
813
|
const justify = ALIGNMENT_TO_JUSTIFY[config?.alignment ?? "center"];
|
|
814
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(FooterRoot, { className: "dg-running-footer", $color: config?.color ?? "#3F4759", $font:
|
|
814
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(FooterRoot, { className: "dg-running-footer", $color: config?.color ?? "#3F4759", $font: chunk2VZW2MGO_cjs.fontStack(documentFont), children: [
|
|
815
815
|
showPageNumber ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "dg-page-number" }) : null,
|
|
816
816
|
showBand ? /* @__PURE__ */ jsxRuntime.jsx(FooterLayout, { children: lines.length ? /* @__PURE__ */ jsxRuntime.jsx(FooterInfoRows, { $justify: justify, children: lines.map((key) => /* @__PURE__ */ jsxRuntime.jsxs(FooterItem, { children: [
|
|
817
817
|
COMPANY_INFO_ICONS[key],
|
|
@@ -840,5 +840,5 @@ exports.HEADER_INFO_ORDER = HEADER_INFO_ORDER;
|
|
|
840
840
|
exports.HeaderBar = HeaderBar;
|
|
841
841
|
exports.resolveCoverAccent = resolveCoverAccent;
|
|
842
842
|
exports.resolveCoverColors = resolveCoverColors;
|
|
843
|
-
//# sourceMappingURL=chunk-
|
|
844
|
-
//# sourceMappingURL=chunk-
|
|
843
|
+
//# sourceMappingURL=chunk-A427FKMP.cjs.map
|
|
844
|
+
//# sourceMappingURL=chunk-A427FKMP.cjs.map
|