@embedpdf/viewer-chrome 3.0.0-next.14 → 3.0.0-next.16

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 (177) hide show
  1. package/README.md +175 -132
  2. package/dist/annotation-fonts-DWjVOTP0.js +80 -0
  3. package/dist/annotation-fonts-DWjVOTP0.js.map +1 -0
  4. package/dist/annotation-fonts-dpfVkhnq.cjs +91 -0
  5. package/dist/annotation-fonts-dpfVkhnq.cjs.map +1 -0
  6. package/dist/annotation-style-B3XKAyZ-.cjs +879 -0
  7. package/dist/annotation-style-B3XKAyZ-.cjs.map +1 -0
  8. package/dist/annotation-style-CXF3X47Z.js +879 -0
  9. package/dist/annotation-style-CXF3X47Z.js.map +1 -0
  10. package/dist/ar-B132r9bo.cjs +659 -0
  11. package/dist/ar-B132r9bo.cjs.map +1 -0
  12. package/dist/ar-BLWFJoA_.js +659 -0
  13. package/dist/ar-BLWFJoA_.js.map +1 -0
  14. package/dist/attachments-panel-Cxln8xos.cjs +217 -0
  15. package/dist/attachments-panel-Cxln8xos.cjs.map +1 -0
  16. package/dist/attachments-panel-H1ucRbwo.js +217 -0
  17. package/dist/attachments-panel-H1ucRbwo.js.map +1 -0
  18. package/dist/chrome.cjs +399 -242
  19. package/dist/chrome.cjs.map +1 -1
  20. package/dist/chrome.d.cts +5 -35
  21. package/dist/chrome.d.ts +5 -35
  22. package/dist/chrome.js +398 -239
  23. package/dist/chrome.js.map +1 -1
  24. package/dist/commands-BkgLP3Om.js +1348 -0
  25. package/dist/commands-BkgLP3Om.js.map +1 -0
  26. package/dist/commands-DL1gjZt7.cjs +1473 -0
  27. package/dist/commands-DL1gjZt7.cjs.map +1 -0
  28. package/dist/commands.cjs +13 -649
  29. package/dist/commands.d.cts +30 -3
  30. package/dist/commands.d.ts +30 -3
  31. package/dist/commands.js +2 -647
  32. package/dist/comments-panel-BsnWedTh.cjs +514 -0
  33. package/dist/comments-panel-BsnWedTh.cjs.map +1 -0
  34. package/dist/comments-panel-D7Eadws9.js +514 -0
  35. package/dist/comments-panel-D7Eadws9.js.map +1 -0
  36. package/dist/de-7_MvFWzN.cjs +658 -0
  37. package/dist/de-7_MvFWzN.cjs.map +1 -0
  38. package/dist/de-BUhwc9-x.js +658 -0
  39. package/dist/de-BUhwc9-x.js.map +1 -0
  40. package/dist/dialog-BIb373cg.js +55 -0
  41. package/dist/dialog-BIb373cg.js.map +1 -0
  42. package/dist/dialog-CngKTnAM.cjs +60 -0
  43. package/dist/dialog-CngKTnAM.cjs.map +1 -0
  44. package/dist/es-DgYj-1L3.cjs +658 -0
  45. package/dist/es-DgYj-1L3.cjs.map +1 -0
  46. package/dist/es-DoXTqFoO.js +658 -0
  47. package/dist/es-DoXTqFoO.js.map +1 -0
  48. package/dist/form-design-panel-CgV_5YWC.js +418 -0
  49. package/dist/form-design-panel-CgV_5YWC.js.map +1 -0
  50. package/dist/form-design-panel-D0FdmWXW.cjs +418 -0
  51. package/dist/form-design-panel-D0FdmWXW.cjs.map +1 -0
  52. package/dist/fr-B-8NDhBA.js +658 -0
  53. package/dist/fr-B-8NDhBA.js.map +1 -0
  54. package/dist/fr-C856dmQJ.cjs +658 -0
  55. package/dist/fr-C856dmQJ.cjs.map +1 -0
  56. package/dist/he-BFTeNc4t.cjs +659 -0
  57. package/dist/he-BFTeNc4t.cjs.map +1 -0
  58. package/dist/he-Dlh0fNXM.js +659 -0
  59. package/dist/he-Dlh0fNXM.js.map +1 -0
  60. package/dist/icons-1UfLUZ_y.cjs +1029 -0
  61. package/dist/icons-1UfLUZ_y.cjs.map +1 -0
  62. package/dist/icons-7dB0Y1ct.js +875 -0
  63. package/dist/icons-7dB0Y1ct.js.map +1 -0
  64. package/dist/index.cjs +3651 -5447
  65. package/dist/index.cjs.map +1 -1
  66. package/dist/index.d.cts +646 -144
  67. package/dist/index.d.ts +646 -144
  68. package/dist/index.js +3618 -5368
  69. package/dist/index.js.map +1 -1
  70. package/dist/it-Bef-2Yxq.cjs +658 -0
  71. package/dist/it-Bef-2Yxq.cjs.map +1 -0
  72. package/dist/it-BkirG7ol.js +658 -0
  73. package/dist/it-BkirG7ol.js.map +1 -0
  74. package/dist/ja-CGEjCE-s.js +658 -0
  75. package/dist/ja-CGEjCE-s.js.map +1 -0
  76. package/dist/ja-DNw2zqSD.cjs +658 -0
  77. package/dist/ja-DNw2zqSD.cjs.map +1 -0
  78. package/dist/ko-CTkl5vMh.js +658 -0
  79. package/dist/ko-CTkl5vMh.js.map +1 -0
  80. package/dist/ko-YHzeBqP6.cjs +658 -0
  81. package/dist/ko-YHzeBqP6.cjs.map +1 -0
  82. package/dist/labels-BiM9wp9K.cjs +21 -0
  83. package/dist/labels-BiM9wp9K.cjs.map +1 -0
  84. package/dist/labels-C6_i87Oj.js +16 -0
  85. package/dist/labels-C6_i87Oj.js.map +1 -0
  86. package/dist/link-editor-CAS7MZM2.cjs +125 -0
  87. package/dist/link-editor-CAS7MZM2.cjs.map +1 -0
  88. package/dist/link-editor-CkwtqRvb.js +125 -0
  89. package/dist/link-editor-CkwtqRvb.js.map +1 -0
  90. package/dist/measurement-CQdbnIrn.js +325 -0
  91. package/dist/measurement-CQdbnIrn.js.map +1 -0
  92. package/dist/measurement-Cxv1Ahxx.cjs +326 -0
  93. package/dist/measurement-Cxv1Ahxx.cjs.map +1 -0
  94. package/dist/nl-BjkbaLq3.cjs +658 -0
  95. package/dist/nl-BjkbaLq3.cjs.map +1 -0
  96. package/dist/nl-Dya4sR8_.js +658 -0
  97. package/dist/nl-Dya4sR8_.js.map +1 -0
  98. package/dist/outline-panel-BpGtBdj0.cjs +707 -0
  99. package/dist/outline-panel-BpGtBdj0.cjs.map +1 -0
  100. package/dist/outline-panel-DO5_REYw.js +707 -0
  101. package/dist/outline-panel-DO5_REYw.js.map +1 -0
  102. package/dist/outline-properties-BCa2cc0t.js +330 -0
  103. package/dist/outline-properties-BCa2cc0t.js.map +1 -0
  104. package/dist/outline-properties-DT3FIxCw.cjs +330 -0
  105. package/dist/outline-properties-DT3FIxCw.cjs.map +1 -0
  106. package/dist/pl-CKKdVnpZ.cjs +658 -0
  107. package/dist/pl-CKKdVnpZ.cjs.map +1 -0
  108. package/dist/pl-DA9b5NVg.js +658 -0
  109. package/dist/pl-DA9b5NVg.js.map +1 -0
  110. package/dist/print-dialog-BqIrHCBh.cjs +276 -0
  111. package/dist/print-dialog-BqIrHCBh.cjs.map +1 -0
  112. package/dist/print-dialog-DvcI2m2_.js +276 -0
  113. package/dist/print-dialog-DvcI2m2_.js.map +1 -0
  114. package/dist/pt-DLcszlzi.cjs +658 -0
  115. package/dist/pt-DLcszlzi.cjs.map +1 -0
  116. package/dist/pt-Nm8yyjbX.js +658 -0
  117. package/dist/pt-Nm8yyjbX.js.map +1 -0
  118. package/dist/redact-confirm-C6EiK8yN.cjs +83 -0
  119. package/dist/redact-confirm-C6EiK8yN.cjs.map +1 -0
  120. package/dist/redact-confirm-CKuv9iN_.js +83 -0
  121. package/dist/redact-confirm-CKuv9iN_.js.map +1 -0
  122. package/dist/redaction-panel-CgNZ-pQk.js +96 -0
  123. package/dist/redaction-panel-CgNZ-pQk.js.map +1 -0
  124. package/dist/redaction-panel-ZhX0dlMi.cjs +96 -0
  125. package/dist/redaction-panel-ZhX0dlMi.cjs.map +1 -0
  126. package/dist/search-panel-BE4xzWlm.js +249 -0
  127. package/dist/search-panel-BE4xzWlm.js.map +1 -0
  128. package/dist/search-panel-wcbTNG1z.cjs +249 -0
  129. package/dist/search-panel-wcbTNG1z.cjs.map +1 -0
  130. package/dist/sheet-DTBFiwde.cjs +461 -0
  131. package/dist/sheet-DTBFiwde.cjs.map +1 -0
  132. package/dist/sheet-DyjKfAq0.js +378 -0
  133. package/dist/sheet-DyjKfAq0.js.map +1 -0
  134. package/dist/sign-dialog-D5WGx-Yn.cjs +155 -0
  135. package/dist/sign-dialog-D5WGx-Yn.cjs.map +1 -0
  136. package/dist/sign-dialog-DerNe8qT.js +155 -0
  137. package/dist/sign-dialog-DerNe8qT.js.map +1 -0
  138. package/dist/signature-inspector-Bz6TAfZM.cjs +160 -0
  139. package/dist/signature-inspector-Bz6TAfZM.cjs.map +1 -0
  140. package/dist/signature-inspector-CsGr9EBk.js +160 -0
  141. package/dist/signature-inspector-CsGr9EBk.js.map +1 -0
  142. package/dist/signature-maker-D_YfBXLn.cjs +393 -0
  143. package/dist/signature-maker-D_YfBXLn.cjs.map +1 -0
  144. package/dist/signature-maker-Dnth4rV4.js +393 -0
  145. package/dist/signature-maker-Dnth4rV4.js.map +1 -0
  146. package/dist/signatures-panel-Ci_LaI1C.cjs +294 -0
  147. package/dist/signatures-panel-Ci_LaI1C.cjs.map +1 -0
  148. package/dist/signatures-panel-DZ9ywrjz.js +294 -0
  149. package/dist/signatures-panel-DZ9ywrjz.js.map +1 -0
  150. package/dist/stamp-store-BHvRs-Do.cjs +147 -0
  151. package/dist/stamp-store-BHvRs-Do.cjs.map +1 -0
  152. package/dist/stamp-store-WuF-L3Jj.js +112 -0
  153. package/dist/stamp-store-WuF-L3Jj.js.map +1 -0
  154. package/dist/stamps-panel-BrczStaz.js +225 -0
  155. package/dist/stamps-panel-BrczStaz.js.map +1 -0
  156. package/dist/stamps-panel-Cv9nJBwx.cjs +225 -0
  157. package/dist/stamps-panel-Cv9nJBwx.cjs.map +1 -0
  158. package/dist/theme-Be0OZokZ.js +97 -0
  159. package/dist/theme-Be0OZokZ.js.map +1 -0
  160. package/dist/theme-FR26JI3r.cjs +126 -0
  161. package/dist/theme-FR26JI3r.cjs.map +1 -0
  162. package/dist/toolbar-DF361xWY.js +1565 -0
  163. package/dist/toolbar-DF361xWY.js.map +1 -0
  164. package/dist/toolbar-ddvpsvTb.cjs +1660 -0
  165. package/dist/toolbar-ddvpsvTb.cjs.map +1 -0
  166. package/dist/zh-cn-BMPPkLpL.js +658 -0
  167. package/dist/zh-cn-BMPPkLpL.js.map +1 -0
  168. package/dist/zh-cn-CZOO3p4H.cjs +658 -0
  169. package/dist/zh-cn-CZOO3p4H.cjs.map +1 -0
  170. package/package.json +6 -4
  171. package/src/styles.css +161 -89
  172. package/dist/commands.cjs.map +0 -1
  173. package/dist/commands.js.map +0 -1
  174. package/dist/es-BXLlBo2b.cjs +0 -321
  175. package/dist/es-BXLlBo2b.cjs.map +0 -1
  176. package/dist/es-CLgTsFDS.js +0 -321
  177. package/dist/es-CLgTsFDS.js.map +0 -1
package/dist/chrome.cjs CHANGED
@@ -1,262 +1,419 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let _embedpdf_react_toolbar = require("@embedpdf/react/toolbar");
2
+ let _embedpdf_core_ui = require("@embedpdf/core-ui");
3
3
  //#region src/config/chrome.ts
4
4
  /**
5
- * The chrome — structure only. No breakpoints, no show/hide lists, no locale
6
- * overrides, no dividers/spacers, no hand-written overflow menus. What fits is
7
- * measured and solved at runtime (@embedpdf/core-ui); the overflow menu is
8
- * derived. Compare to the v2 snippet's 1,950-line ui-schema.ts.
5
+ * The default layout: every bar, menu and panel the viewer ships, as plain
6
+ * data. Structure only: no breakpoints, no show/hide lists, no locale
7
+ * overrides, no dividers or spacers, no hand-written overflow menus. What fits
8
+ * is measured and solved at runtime (@embedpdf/core-ui); the "More" menu is
9
+ * derived, and so are the mode tabs (the `modes` group lists one per bar with
10
+ * a `mode`).
9
11
  *
10
- * `importance` (1 sheds first … 5 pinned) is the only responsive knob.
12
+ * `importance` (1 makes room first … 5 never leaves the bar) is the only
13
+ * responsive knob. The bar, group and menu ids are API: they don't change
14
+ * between minor versions.
11
15
  */
12
- const style = (0, _embedpdf_react_toolbar.group)("style", { importance: 4 }, [(0, _embedpdf_react_toolbar.item)("panel:annotation-style")]);
13
- const history = (0, _embedpdf_react_toolbar.group)("history", { importance: 3 }, ["history:undo", "history:redo"]);
14
- const mainBar = {
15
- id: "main",
16
- sections: {
17
- start: [
18
- (0, _embedpdf_react_toolbar.group)("document", { importance: 5 }, [(0, _embedpdf_react_toolbar.item)("document:menu")]),
19
- (0, _embedpdf_react_toolbar.group)("workspace", { importance: 4 }, [(0, _embedpdf_react_toolbar.item)("panel:sidebar", { importance: 5 }), (0, _embedpdf_react_toolbar.item)("page:settings")]),
20
- (0, _embedpdf_react_toolbar.group)("zoom", { importance: 4 }, [(0, _embedpdf_react_toolbar.custom)("zoom-controls", {
21
- variants: ["inline", "button"],
22
- terminal: "zoom:menu"
23
- })]),
24
- (0, _embedpdf_react_toolbar.group)("tools", { importance: 2 }, ["pan:toggle", "pointer:toggle"])
25
- ],
26
- center: [(0, _embedpdf_react_toolbar.group)("modes", {
27
- role: "tabs",
28
- shed: true,
29
- collapse: "select",
30
- importance: 4,
31
- labelKey: "commands.mode.group",
32
- items: [
33
- (0, _embedpdf_react_toolbar.item)("mode:view", {
34
- variants: ["label"],
35
- importance: 1
36
- }),
37
- (0, _embedpdf_react_toolbar.item)("mode:annotate", {
38
- variants: ["label"],
39
- importance: 1
40
- }),
41
- (0, _embedpdf_react_toolbar.item)("mode:shapes", {
42
- variants: ["label"],
43
- importance: 1
44
- }),
45
- (0, _embedpdf_react_toolbar.item)("mode:insert", {
46
- variants: ["label"],
47
- importance: 1
48
- }),
49
- (0, _embedpdf_react_toolbar.item)("mode:form", {
50
- variants: ["label"],
51
- importance: 1
52
- }),
53
- (0, _embedpdf_react_toolbar.item)("mode:redact", {
54
- variants: ["label"],
55
- importance: 1
56
- }),
57
- (0, _embedpdf_react_toolbar.item)("mode:measure", {
58
- variants: ["label"],
59
- importance: 1
60
- })
61
- ]
62
- })],
63
- end: [(0, _embedpdf_react_toolbar.group)("panels", { importance: 5 }, ["panel:search", "panel:comment"])]
64
- }
65
- };
66
- const annotateBar = {
67
- id: "annotate",
68
- sections: { center: [
69
- (0, _embedpdf_react_toolbar.group)("comment", { importance: 4 }, ["annotation:add-note", "annotation:add-link"]),
70
- (0, _embedpdf_react_toolbar.group)("markup", { importance: 4 }, [
71
- "annotation:add-highlight",
72
- "annotation:add-strikeout",
73
- "annotation:add-underline",
74
- "annotation:add-squiggly"
75
- ]),
76
- (0, _embedpdf_react_toolbar.group)("draw", { importance: 3 }, ["annotation:add-ink", "annotation:add-ink-highlight"]),
77
- (0, _embedpdf_react_toolbar.group)("text", { importance: 2 }, [
78
- "annotation:add-text",
79
- "annotation:add-insert-text",
80
- "annotation:add-replace-text",
81
- "annotation:add-callout"
82
- ]),
83
- style,
84
- history
85
- ] }
86
- };
87
- const shapesBar = {
88
- id: "shapes",
89
- sections: { center: [
90
- (0, _embedpdf_react_toolbar.group)("shapes", { importance: 4 }, [
91
- "annotation:add-rectangle",
92
- "annotation:add-circle",
93
- "annotation:add-line",
94
- "annotation:add-arrow"
95
- ]),
96
- (0, _embedpdf_react_toolbar.group)("polygons", { importance: 2 }, ["annotation:add-polygon", "annotation:add-polyline"]),
97
- style,
98
- history
99
- ] }
16
+ const style = {
17
+ id: "style",
18
+ items: ["panel:style"],
19
+ importance: 4,
20
+ dependent: true
100
21
  };
101
- const insertBar = {
102
- id: "insert",
103
- sections: { center: [
104
- (0, _embedpdf_react_toolbar.group)("stamps", { importance: 4 }, [
105
- "insert:add-stamp",
106
- (0, _embedpdf_react_toolbar.custom)("quick-stamps", {
107
- terminal: "insert:add-stamp",
108
- importance: 3
109
- }),
110
- "insert:add-attachment",
111
- "insert:add-signature",
112
- "insert:add-image"
113
- ]),
114
- style,
115
- history
116
- ] }
22
+ const history = {
23
+ id: "history",
24
+ items: ["history:undo", "history:redo"],
25
+ importance: 3,
26
+ dependent: true
117
27
  };
118
- const formBar = {
119
- id: "form",
120
- sections: { center: [
121
- (0, _embedpdf_react_toolbar.group)("fields", { importance: 4 }, [
122
- "form:add-textfield",
123
- "form:add-checkbox",
124
- "form:add-radio"
125
- ]),
126
- (0, _embedpdf_react_toolbar.group)("choice-fields", { importance: 2 }, ["form:add-select", "form:add-listbox"]),
127
- (0, _embedpdf_react_toolbar.group)("signature-fields", { importance: 2 }, ["form:add-signature"]),
128
- history
129
- ] }
130
- };
131
- const measureBar = {
132
- id: "measure",
133
- sections: { center: [
134
- (0, _embedpdf_react_toolbar.group)("measure", { importance: 5 }, [
135
- "measurement:distance",
136
- "measurement:perimeter",
137
- "measurement:area",
138
- "measurement:calibrate"
139
- ]),
140
- (0, _embedpdf_react_toolbar.group)("scale", { importance: 4 }, [(0, _embedpdf_react_toolbar.custom)("measurement-scale", {
141
- variants: ["inline"],
142
- terminal: "panel:measurement"
143
- })]),
144
- style
145
- ] }
146
- };
147
- const redactBar = {
148
- id: "redact",
149
- sections: { center: [
150
- (0, _embedpdf_react_toolbar.group)("redact", { importance: 4 }, ["redaction:redact", "panel:redaction"]),
151
- style,
152
- history
153
- ] }
154
- };
155
- const documentMenu = {
156
- id: "document",
157
- sections: [{ items: ["document:download", "document:print"] }, { items: ["document:fullscreen"] }]
158
- };
159
- const zoomMenu = {
160
- id: "zoom",
161
- sections: [
162
- {
163
- labelKey: "commands.zoom.level",
164
- items: [
165
- "zoom:50",
166
- "zoom:100",
167
- "zoom:150",
168
- "zoom:200",
169
- "zoom:400"
28
+ const DEFAULT_LAYOUT = {
29
+ bars: {
30
+ main: {
31
+ place: "top",
32
+ start: [
33
+ {
34
+ id: "document",
35
+ items: ["menu:document"],
36
+ importance: 5
37
+ },
38
+ {
39
+ id: "view",
40
+ items: [{
41
+ command: "panel:thumbnails",
42
+ importance: 5
43
+ }, "menu:view"],
44
+ importance: 4
45
+ },
46
+ {
47
+ id: "zoom",
48
+ items: [{
49
+ custom: "zoom",
50
+ command: "menu:zoom",
51
+ variants: ["inline", "button"]
52
+ }],
53
+ importance: 4
54
+ },
55
+ {
56
+ id: "tools",
57
+ items: ["tool:pan", "tool:pointer"],
58
+ importance: 2
59
+ }
60
+ ],
61
+ center: [{
62
+ id: "modes",
63
+ items: [],
64
+ shed: true,
65
+ collapse: "select",
66
+ importance: 4,
67
+ titleKey: "commands.mode.group"
68
+ }],
69
+ end: [{
70
+ id: "panels",
71
+ items: [
72
+ {
73
+ custom: "view-only",
74
+ variants: ["label", "icon"]
75
+ },
76
+ "panel:search",
77
+ "panel:comments"
78
+ ],
79
+ importance: 5
80
+ }]
81
+ },
82
+ annotate: {
83
+ place: { with: "main" },
84
+ mode: "annotate",
85
+ titleKey: "commands.mode.annotate",
86
+ center: [
87
+ {
88
+ id: "comment",
89
+ items: ["tool:note", "tool:link"],
90
+ importance: 4
91
+ },
92
+ {
93
+ id: "markup",
94
+ items: [
95
+ "tool:highlight",
96
+ "tool:strikeout",
97
+ "tool:underline",
98
+ "tool:squiggly"
99
+ ],
100
+ importance: 4
101
+ },
102
+ {
103
+ id: "draw",
104
+ items: ["tool:ink", "tool:ink-highlight"],
105
+ importance: 3
106
+ },
107
+ {
108
+ id: "text",
109
+ items: [
110
+ "tool:free-text",
111
+ "tool:insert-text",
112
+ "tool:replace-text",
113
+ "tool:callout"
114
+ ],
115
+ importance: 2
116
+ },
117
+ style,
118
+ history
170
119
  ]
171
120
  },
172
- { items: ["zoom:in", "zoom:out"] },
173
- { items: [
174
- "zoom:fit-page",
175
- "zoom:fit-width",
176
- "zoom:automatic"
177
- ] }
178
- ]
179
- };
180
- const pageSettingsMenu = {
181
- id: "page-settings",
182
- sections: [
183
- {
184
- labelKey: "commands.spread.group",
185
- items: [
186
- "spread:none",
187
- "spread:odd",
188
- "spread:even"
121
+ shapes: {
122
+ place: { with: "main" },
123
+ mode: "shapes",
124
+ titleKey: "commands.mode.shapes",
125
+ center: [
126
+ {
127
+ id: "shapes",
128
+ items: [
129
+ "tool:square",
130
+ "tool:circle",
131
+ "tool:line",
132
+ "tool:arrow"
133
+ ],
134
+ importance: 4
135
+ },
136
+ {
137
+ id: "polygons",
138
+ items: ["tool:polygon", "tool:polyline"],
139
+ importance: 2
140
+ },
141
+ style,
142
+ history
189
143
  ]
190
144
  },
191
- {
192
- labelKey: "commands.scroll.group",
193
- items: ["scroll:vertical", "scroll:horizontal"]
145
+ insert: {
146
+ place: { with: "main" },
147
+ mode: "insert",
148
+ titleKey: "commands.mode.insert",
149
+ center: [
150
+ {
151
+ id: "stamps",
152
+ items: [
153
+ "tool:stamp",
154
+ {
155
+ custom: "quick-stamps",
156
+ command: "tool:stamp",
157
+ importance: 3
158
+ },
159
+ "tool:attachment",
160
+ "tool:signature",
161
+ "tool:image"
162
+ ],
163
+ importance: 4
164
+ },
165
+ style,
166
+ history
167
+ ]
194
168
  },
195
- {
196
- labelKey: "commands.rotate.group",
197
- items: ["rotate:clockwise", "rotate:counter-clockwise"]
169
+ form: {
170
+ place: { with: "main" },
171
+ mode: "form",
172
+ titleKey: "commands.mode.form",
173
+ center: [
174
+ {
175
+ id: "design",
176
+ items: ["form:design"],
177
+ importance: 5
178
+ },
179
+ {
180
+ id: "fields",
181
+ items: [
182
+ "tool:text-field",
183
+ "tool:checkbox",
184
+ "tool:radio"
185
+ ],
186
+ importance: 4
187
+ },
188
+ {
189
+ id: "choices",
190
+ items: ["tool:combo-box", "tool:list-box"],
191
+ importance: 2
192
+ },
193
+ {
194
+ id: "buttons",
195
+ items: ["tool:button"],
196
+ importance: 2
197
+ },
198
+ {
199
+ id: "signatures",
200
+ items: ["tool:signature-field"],
201
+ importance: 2
202
+ },
203
+ style,
204
+ history
205
+ ]
198
206
  },
199
- { items: ["document:fullscreen"] }
200
- ]
201
- };
202
- const annotationStrip = {
203
- id: "annotation-strip",
204
- sections: { center: [(0, _embedpdf_react_toolbar.group)("annotation-actions", { importance: 4 }, [
205
- "annotation:comment",
206
- "annotation:style",
207
- "annotation:stamp-from-selection",
208
- "annotation:link",
209
- "annotation:goto-link",
210
- "annotation:remove-link",
211
- "annotation:group",
212
- "annotation:ungroup"
213
- ]), (0, _embedpdf_react_toolbar.group)("annotation-danger", { importance: 5 }, ["annotation:delete"])] }
214
- };
215
- const selectionStrip = {
216
- id: "selection-strip",
217
- sections: { center: [(0, _embedpdf_react_toolbar.group)("selection-actions", { importance: 4 }, ["selection:copy"])] }
218
- };
219
- /**
220
- * The DEFAULT chrome — exported as a VALUE, which is the whole customization
221
- * model: consumers pass nothing and track this, transform it, or write their
222
- * own. It is never merged with anything.
223
- */
224
- const defaultChrome = (0, _embedpdf_react_toolbar.defineChrome)({
225
- bars: { main: mainBar },
226
- modeBars: {
227
- "mode:annotate": annotateBar,
228
- "mode:shapes": shapesBar,
229
- "mode:insert": insertBar,
230
- "mode:form": formBar,
231
- "mode:redact": redactBar,
232
- "mode:measure": measureBar
207
+ redact: {
208
+ place: { with: "main" },
209
+ mode: "redact",
210
+ titleKey: "commands.mode.redact",
211
+ center: [
212
+ {
213
+ id: "redact",
214
+ items: ["tool:redact", "panel:redaction"],
215
+ importance: 4
216
+ },
217
+ style,
218
+ history
219
+ ]
220
+ },
221
+ measure: {
222
+ place: { with: "main" },
223
+ mode: "measure",
224
+ titleKey: "commands.mode.measure",
225
+ center: [
226
+ {
227
+ id: "measure",
228
+ items: [
229
+ "tool:distance",
230
+ "tool:perimeter",
231
+ "tool:area",
232
+ "measurement:calibrate"
233
+ ],
234
+ importance: 5
235
+ },
236
+ {
237
+ id: "scale",
238
+ items: [{
239
+ custom: "measurement-scale",
240
+ command: "panel:measurement",
241
+ variants: ["inline"]
242
+ }],
243
+ importance: 4
244
+ },
245
+ style
246
+ ]
247
+ },
248
+ pager: {
249
+ place: { float: "bottom" },
250
+ center: [{
251
+ id: "pages",
252
+ items: [{ custom: "page-number" }]
253
+ }]
254
+ },
255
+ selection: {
256
+ place: { at: "selection" },
257
+ center: [{
258
+ id: "selection",
259
+ items: [
260
+ "selection:copy",
261
+ "selection:highlight",
262
+ "selection:underline",
263
+ "selection:strikeout"
264
+ ],
265
+ importance: 4
266
+ }]
267
+ },
268
+ annotation: {
269
+ place: { at: "annotation" },
270
+ center: [{
271
+ id: "actions",
272
+ items: [
273
+ "annotation:comment",
274
+ "annotation:style",
275
+ "annotation:stamp-from-selection",
276
+ "annotation:link",
277
+ "annotation:goto-link",
278
+ "annotation:save-file",
279
+ "annotation:remove-link",
280
+ "annotation:group",
281
+ "annotation:ungroup"
282
+ ],
283
+ importance: 4
284
+ }, {
285
+ id: "danger",
286
+ items: ["annotation:delete"],
287
+ importance: 5
288
+ }]
289
+ }
233
290
  },
234
291
  menus: {
235
- document: documentMenu,
236
- zoom: zoomMenu,
237
- "page-settings": pageSettingsMenu
292
+ document: [[
293
+ "document:open",
294
+ "document:download",
295
+ "document:print"
296
+ ], ["view:fullscreen"]],
297
+ view: [
298
+ {
299
+ titleKey: "commands.spread.group",
300
+ items: [
301
+ "view:single-page",
302
+ "view:two-pages",
303
+ "view:cover-page"
304
+ ]
305
+ },
306
+ {
307
+ titleKey: "commands.scroll.group",
308
+ items: ["view:scroll-vertical", "view:scroll-horizontal"]
309
+ },
310
+ {
311
+ titleKey: "commands.rotate.group",
312
+ items: ["view:rotate-clockwise", "view:rotate-counterclockwise"]
313
+ },
314
+ ["view:fullscreen"]
315
+ ],
316
+ zoom: [
317
+ {
318
+ titleKey: "commands.zoom.level",
319
+ items: [
320
+ "zoom:50",
321
+ "zoom:100",
322
+ "zoom:150",
323
+ "zoom:200",
324
+ "zoom:400"
325
+ ]
326
+ },
327
+ ["zoom:in", "zoom:out"],
328
+ [
329
+ "zoom:fit-page",
330
+ "zoom:fit-width",
331
+ "zoom:automatic"
332
+ ]
333
+ ],
334
+ "outline-item": [
335
+ ["outline:add", "outline:add-child"],
336
+ [
337
+ "outline:rename",
338
+ "outline:set-destination",
339
+ "outline:properties"
340
+ ],
341
+ ["outline:delete"]
342
+ ],
343
+ "attachment-item": [["attachment:save", "attachment:go-to"], ["attachment:delete"]],
344
+ page: [
345
+ ["page:rotate-clockwise", "page:rotate-counterclockwise"],
346
+ [
347
+ "page:insert-blank",
348
+ "page:insert-file",
349
+ "page:duplicate"
350
+ ],
351
+ ["page:extract"],
352
+ ["page:delete"]
353
+ ]
238
354
  },
239
- strips: {
240
- annotation: annotationStrip,
241
- selection: selectionStrip
355
+ panels: {
356
+ thumbnails: {
357
+ side: "start",
358
+ titleKey: "panels.thumbnails",
359
+ icon: "sidebar"
360
+ },
361
+ outline: {
362
+ side: "start",
363
+ titleKey: "panels.outline",
364
+ icon: "listTree"
365
+ },
366
+ attachments: {
367
+ side: "start",
368
+ titleKey: "panels.attachments",
369
+ icon: "paperclip"
370
+ },
371
+ search: {
372
+ side: "end",
373
+ titleKey: "panels.search",
374
+ icon: "search"
375
+ },
376
+ comments: {
377
+ side: "end",
378
+ titleKey: "panels.comments",
379
+ icon: "comment"
380
+ },
381
+ style: {
382
+ side: "end",
383
+ titleKey: "panels.style",
384
+ icon: "palette"
385
+ },
386
+ stamps: {
387
+ side: "end",
388
+ titleKey: "panels.stamps",
389
+ icon: "rubberStamp"
390
+ },
391
+ signatures: {
392
+ side: "end",
393
+ titleKey: "panels.signatures",
394
+ icon: "signature"
395
+ },
396
+ redaction: {
397
+ side: "end",
398
+ titleKey: "panels.redaction",
399
+ icon: "redactionSidebar"
400
+ },
401
+ measurement: {
402
+ side: "end",
403
+ titleKey: "panels.measurement",
404
+ icon: "updateScale"
405
+ },
406
+ "form-design": {
407
+ side: "end",
408
+ titleKey: "panels.formDesign",
409
+ icon: "formDesign"
410
+ }
242
411
  }
243
- });
244
- /** Menu lookup by id (arbitrary string). */
245
- function getMenu(schema, id) {
246
- return schema.menus?.[id];
247
- }
248
- /** Secondary band lookup by mode-surface id. */
249
- function getModeBar(schema, id) {
250
- return schema.modeBars?.[id];
251
- }
252
- /** Contextual strip lookup by context id ('annotation', …). */
253
- function getStrip(schema, id) {
254
- return schema.strips?.[id];
255
- }
412
+ };
413
+ /** The default layout, which the `layout` function gets. */
414
+ const defaultLayout = (0, _embedpdf_core_ui.createLayout)(DEFAULT_LAYOUT);
256
415
  //#endregion
257
- exports.defaultChrome = defaultChrome;
258
- exports.getMenu = getMenu;
259
- exports.getModeBar = getModeBar;
260
- exports.getStrip = getStrip;
416
+ exports.DEFAULT_LAYOUT = DEFAULT_LAYOUT;
417
+ exports.defaultLayout = defaultLayout;
261
418
 
262
419
  //# sourceMappingURL=chrome.cjs.map