@papyrus-sdk/ui-react 0.2.17 → 0.2.19
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/base.css +116 -48
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/base.css
CHANGED
|
@@ -1,45 +1,86 @@
|
|
|
1
1
|
.papyrus-theme {
|
|
2
|
-
--papyrus-bg: #f3f4f6;
|
|
3
|
-
--papyrus-surface: #ffffff;
|
|
4
|
-
--papyrus-surface-2: #f9fafb;
|
|
5
|
-
--papyrus-border: #e5e7eb;
|
|
6
|
-
--papyrus-border-strong: #d1d5db;
|
|
7
|
-
--papyrus-text: #111827;
|
|
8
|
-
--papyrus-text-muted: #6b7280;
|
|
9
|
-
--papyrus-icon: #6b7280;
|
|
10
|
-
--papyrus-focus: #93c5fd;
|
|
11
|
-
--papyrus-canvas: #f3f4f6;
|
|
12
|
-
--papyrus-hover: #e5e7eb;
|
|
13
|
-
--papyrus-popover: #ffffff;
|
|
14
|
-
--papyrus-shadow: rgba(15, 23, 42, 0.08);
|
|
15
|
-
--papyrus-selection-bg: rgba(30, 64, 175, 0.5);
|
|
16
|
-
|
|
2
|
+
--papyrus-bg-fallback: #f3f4f6;
|
|
3
|
+
--papyrus-surface-fallback: #ffffff;
|
|
4
|
+
--papyrus-surface-2-fallback: #f9fafb;
|
|
5
|
+
--papyrus-border-fallback: #e5e7eb;
|
|
6
|
+
--papyrus-border-strong-fallback: #d1d5db;
|
|
7
|
+
--papyrus-text-fallback: #111827;
|
|
8
|
+
--papyrus-text-muted-fallback: #6b7280;
|
|
9
|
+
--papyrus-icon-fallback: #6b7280;
|
|
10
|
+
--papyrus-focus-fallback: #93c5fd;
|
|
11
|
+
--papyrus-canvas-fallback: #f3f4f6;
|
|
12
|
+
--papyrus-hover-fallback: #e5e7eb;
|
|
13
|
+
--papyrus-popover-fallback: #ffffff;
|
|
14
|
+
--papyrus-shadow-fallback: rgba(15, 23, 42, 0.08);
|
|
15
|
+
--papyrus-selection-bg-fallback: rgba(30, 64, 175, 0.5);
|
|
16
|
+
--papyrus-bg-resolved: var(--papyrus-bg, var(--papyrus-bg-fallback));
|
|
17
|
+
--papyrus-surface-resolved: var(
|
|
18
|
+
--papyrus-surface,
|
|
19
|
+
var(--papyrus-surface-fallback)
|
|
20
|
+
);
|
|
21
|
+
--papyrus-surface-2-resolved: var(
|
|
22
|
+
--papyrus-surface-2,
|
|
23
|
+
var(--papyrus-surface-2-fallback)
|
|
24
|
+
);
|
|
25
|
+
--papyrus-border-resolved: var(
|
|
26
|
+
--papyrus-border,
|
|
27
|
+
var(--papyrus-border-fallback)
|
|
28
|
+
);
|
|
29
|
+
--papyrus-border-strong-resolved: var(
|
|
30
|
+
--papyrus-border-strong,
|
|
31
|
+
var(--papyrus-border-strong-fallback)
|
|
32
|
+
);
|
|
33
|
+
--papyrus-text-resolved: var(--papyrus-text, var(--papyrus-text-fallback));
|
|
34
|
+
--papyrus-text-muted-resolved: var(
|
|
35
|
+
--papyrus-text-muted,
|
|
36
|
+
var(--papyrus-text-muted-fallback)
|
|
37
|
+
);
|
|
38
|
+
--papyrus-icon-resolved: var(--papyrus-icon, var(--papyrus-icon-fallback));
|
|
39
|
+
--papyrus-focus-resolved: var(--papyrus-focus, var(--papyrus-focus-fallback));
|
|
40
|
+
--papyrus-canvas-resolved: var(
|
|
41
|
+
--papyrus-canvas,
|
|
42
|
+
var(--papyrus-canvas-fallback)
|
|
43
|
+
);
|
|
44
|
+
--papyrus-hover-resolved: var(--papyrus-hover, var(--papyrus-hover-fallback));
|
|
45
|
+
--papyrus-popover-resolved: var(
|
|
46
|
+
--papyrus-popover,
|
|
47
|
+
var(--papyrus-popover-fallback)
|
|
48
|
+
);
|
|
49
|
+
--papyrus-shadow-resolved: var(
|
|
50
|
+
--papyrus-shadow,
|
|
51
|
+
var(--papyrus-shadow-fallback)
|
|
52
|
+
);
|
|
53
|
+
--papyrus-selection-bg-resolved: var(
|
|
54
|
+
--papyrus-selection-bg,
|
|
55
|
+
var(--papyrus-selection-bg-fallback)
|
|
56
|
+
);
|
|
57
|
+
color: var(--papyrus-text-resolved);
|
|
17
58
|
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
18
59
|
}
|
|
19
60
|
|
|
20
61
|
.papyrus-theme[data-papyrus-theme="dark"] {
|
|
21
|
-
--papyrus-bg: #0f1115;
|
|
22
|
-
--papyrus-surface: #1a1a1a;
|
|
23
|
-
--papyrus-surface-2: #222222;
|
|
24
|
-
--papyrus-border: #333333;
|
|
25
|
-
--papyrus-border-strong: #444444;
|
|
26
|
-
--papyrus-text: #f3f4f6;
|
|
27
|
-
--papyrus-text-muted: #9ca3af;
|
|
28
|
-
--papyrus-icon: #9ca3af;
|
|
29
|
-
--papyrus-focus: #2563eb;
|
|
30
|
-
--papyrus-canvas: #121212;
|
|
31
|
-
--papyrus-hover: rgba(255, 255, 255, 0.08);
|
|
32
|
-
--papyrus-popover: #1f1f1f;
|
|
33
|
-
--papyrus-shadow: rgba(0, 0, 0, 0.4);
|
|
34
|
-
--papyrus-selection-bg: rgba(96, 165, 250, 0.5);
|
|
62
|
+
--papyrus-bg-fallback: #0f1115;
|
|
63
|
+
--papyrus-surface-fallback: #1a1a1a;
|
|
64
|
+
--papyrus-surface-2-fallback: #222222;
|
|
65
|
+
--papyrus-border-fallback: #333333;
|
|
66
|
+
--papyrus-border-strong-fallback: #444444;
|
|
67
|
+
--papyrus-text-fallback: #f3f4f6;
|
|
68
|
+
--papyrus-text-muted-fallback: #9ca3af;
|
|
69
|
+
--papyrus-icon-fallback: #9ca3af;
|
|
70
|
+
--papyrus-focus-fallback: #2563eb;
|
|
71
|
+
--papyrus-canvas-fallback: #121212;
|
|
72
|
+
--papyrus-hover-fallback: rgba(255, 255, 255, 0.08);
|
|
73
|
+
--papyrus-popover-fallback: #1f1f1f;
|
|
74
|
+
--papyrus-shadow-fallback: rgba(0, 0, 0, 0.4);
|
|
75
|
+
--papyrus-selection-bg-fallback: rgba(96, 165, 250, 0.5);
|
|
35
76
|
}
|
|
36
77
|
|
|
37
78
|
.papyrus-topbar,
|
|
38
79
|
.papyrus-sidebar-left,
|
|
39
80
|
.papyrus-sidebar-right {
|
|
40
|
-
background: var(--papyrus-surface) !important;
|
|
41
|
-
border-color: var(--papyrus-border) !important;
|
|
42
|
-
color: var(--papyrus-text) !important;
|
|
81
|
+
background: var(--papyrus-surface-resolved) !important;
|
|
82
|
+
border-color: var(--papyrus-border-resolved) !important;
|
|
83
|
+
color: var(--papyrus-text-resolved) !important;
|
|
43
84
|
box-sizing: border-box;
|
|
44
85
|
font-size: 13px;
|
|
45
86
|
line-height: 1.4;
|
|
@@ -54,6 +95,33 @@
|
|
|
54
95
|
font-size: 14px;
|
|
55
96
|
}
|
|
56
97
|
|
|
98
|
+
/* Fallback responsive display helpers for hosts that don't emit dependency Tailwind utilities. */
|
|
99
|
+
.papyrus-topbar .hidden {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (min-width: 640px) {
|
|
104
|
+
.papyrus-topbar .sm\:inline {
|
|
105
|
+
display: inline !important;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.papyrus-topbar .sm\:inline-flex {
|
|
109
|
+
display: inline-flex !important;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.papyrus-topbar .sm\:block {
|
|
113
|
+
display: block !important;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.papyrus-topbar .sm\:flex {
|
|
117
|
+
display: flex !important;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.papyrus-topbar .sm\:hidden {
|
|
121
|
+
display: none !important;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
57
125
|
@media (max-width: 720px) {
|
|
58
126
|
.papyrus-topbar {
|
|
59
127
|
flex-wrap: wrap;
|
|
@@ -72,33 +140,33 @@
|
|
|
72
140
|
}
|
|
73
141
|
|
|
74
142
|
.papyrus-viewer {
|
|
75
|
-
background: var(--papyrus-canvas) !important;
|
|
143
|
+
background: var(--papyrus-canvas-resolved) !important;
|
|
76
144
|
box-sizing: border-box;
|
|
77
145
|
flex: 1 1 auto;
|
|
78
146
|
overflow-x: hidden;
|
|
79
147
|
overflow-y: scroll;
|
|
80
148
|
scrollbar-gutter: stable;
|
|
81
|
-
color: var(--papyrus-text);
|
|
149
|
+
color: var(--papyrus-text-resolved);
|
|
82
150
|
}
|
|
83
151
|
|
|
84
152
|
.papyrus-control,
|
|
85
153
|
.papyrus-input,
|
|
86
154
|
.papyrus-popover {
|
|
87
|
-
background: var(--papyrus-surface-2) !important;
|
|
88
|
-
border-color: var(--papyrus-border) !important;
|
|
89
|
-
color: var(--papyrus-text) !important;
|
|
155
|
+
background: var(--papyrus-surface-2-resolved) !important;
|
|
156
|
+
border-color: var(--papyrus-border-resolved) !important;
|
|
157
|
+
color: var(--papyrus-text-resolved) !important;
|
|
90
158
|
}
|
|
91
159
|
|
|
92
160
|
.papyrus-popover {
|
|
93
|
-
background: var(--papyrus-popover) !important;
|
|
94
|
-
box-shadow: 0 20px 40px var(--papyrus-shadow);
|
|
161
|
+
background: var(--papyrus-popover-resolved) !important;
|
|
162
|
+
box-shadow: 0 20px 40px var(--papyrus-shadow-resolved);
|
|
95
163
|
}
|
|
96
164
|
|
|
97
165
|
.papyrus-topbar button,
|
|
98
166
|
.papyrus-sidebar-left button,
|
|
99
167
|
.papyrus-sidebar-right button {
|
|
100
|
-
background: var(--papyrus-surface-2);
|
|
101
|
-
border: 1px solid var(--papyrus-border);
|
|
168
|
+
background: var(--papyrus-surface-2-resolved);
|
|
169
|
+
border: 1px solid var(--papyrus-border-resolved);
|
|
102
170
|
border-radius: 8px;
|
|
103
171
|
color: inherit;
|
|
104
172
|
cursor: pointer;
|
|
@@ -119,11 +187,11 @@
|
|
|
119
187
|
.papyrus-topbar select,
|
|
120
188
|
.papyrus-sidebar-left select,
|
|
121
189
|
.papyrus-sidebar-right select {
|
|
122
|
-
background: var(--papyrus-surface);
|
|
123
|
-
border: 1px solid var(--papyrus-border);
|
|
190
|
+
background: var(--papyrus-surface-resolved);
|
|
191
|
+
border: 1px solid var(--papyrus-border-resolved);
|
|
124
192
|
border-radius: 6px;
|
|
125
193
|
box-sizing: border-box;
|
|
126
|
-
color: var(--papyrus-text);
|
|
194
|
+
color: var(--papyrus-text-resolved);
|
|
127
195
|
font: inherit;
|
|
128
196
|
padding: 6px 8px;
|
|
129
197
|
}
|
|
@@ -131,8 +199,8 @@
|
|
|
131
199
|
.papyrus-topbar button:hover,
|
|
132
200
|
.papyrus-sidebar-left button:hover,
|
|
133
201
|
.papyrus-sidebar-right button:hover {
|
|
134
|
-
background: var(--papyrus-hover);
|
|
135
|
-
border-color: var(--papyrus-border-strong);
|
|
202
|
+
background: var(--papyrus-hover-resolved);
|
|
203
|
+
border-color: var(--papyrus-border-strong-resolved);
|
|
136
204
|
}
|
|
137
205
|
|
|
138
206
|
.papyrus-topbar svg,
|
|
@@ -147,7 +215,7 @@
|
|
|
147
215
|
.papyrus-topbar select:focus,
|
|
148
216
|
.papyrus-sidebar-left select:focus,
|
|
149
217
|
.papyrus-sidebar-right select:focus {
|
|
150
|
-
outline: 2px solid var(--papyrus-focus);
|
|
218
|
+
outline: 2px solid var(--papyrus-focus-resolved);
|
|
151
219
|
outline-offset: 1px;
|
|
152
220
|
}
|
|
153
221
|
|
|
@@ -163,7 +231,7 @@
|
|
|
163
231
|
}
|
|
164
232
|
|
|
165
233
|
.papyrus-viewer .textLayer ::selection {
|
|
166
|
-
background: var(--papyrus-selection-bg);
|
|
234
|
+
background: var(--papyrus-selection-bg-resolved);
|
|
167
235
|
}
|
|
168
236
|
|
|
169
237
|
.papyrus-viewer .textLayer {
|
package/dist/index.d.mts
CHANGED
|
@@ -6,6 +6,7 @@ interface TopbarProps {
|
|
|
6
6
|
showBrand?: boolean;
|
|
7
7
|
brand?: React.ReactNode;
|
|
8
8
|
title?: React.ReactNode;
|
|
9
|
+
style?: React.CSSProperties;
|
|
9
10
|
showSidebarLeftToggle?: boolean;
|
|
10
11
|
showPageControls?: boolean;
|
|
11
12
|
showZoomControls?: boolean;
|
|
@@ -18,16 +19,19 @@ declare const Topbar: React.FC<TopbarProps>;
|
|
|
18
19
|
|
|
19
20
|
interface SidebarLeftProps {
|
|
20
21
|
engine: DocumentEngine;
|
|
22
|
+
style?: React.CSSProperties;
|
|
21
23
|
}
|
|
22
24
|
declare const SidebarLeft: React.FC<SidebarLeftProps>;
|
|
23
25
|
|
|
24
26
|
interface SidebarRightProps {
|
|
25
27
|
engine: DocumentEngine;
|
|
28
|
+
style?: React.CSSProperties;
|
|
26
29
|
}
|
|
27
30
|
declare const SidebarRight: React.FC<SidebarRightProps>;
|
|
28
31
|
|
|
29
32
|
interface ViewerProps {
|
|
30
33
|
engine: DocumentEngine;
|
|
34
|
+
style?: React.CSSProperties;
|
|
31
35
|
}
|
|
32
36
|
declare const Viewer: React.FC<ViewerProps>;
|
|
33
37
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ interface TopbarProps {
|
|
|
6
6
|
showBrand?: boolean;
|
|
7
7
|
brand?: React.ReactNode;
|
|
8
8
|
title?: React.ReactNode;
|
|
9
|
+
style?: React.CSSProperties;
|
|
9
10
|
showSidebarLeftToggle?: boolean;
|
|
10
11
|
showPageControls?: boolean;
|
|
11
12
|
showZoomControls?: boolean;
|
|
@@ -18,16 +19,19 @@ declare const Topbar: React.FC<TopbarProps>;
|
|
|
18
19
|
|
|
19
20
|
interface SidebarLeftProps {
|
|
20
21
|
engine: DocumentEngine;
|
|
22
|
+
style?: React.CSSProperties;
|
|
21
23
|
}
|
|
22
24
|
declare const SidebarLeft: React.FC<SidebarLeftProps>;
|
|
23
25
|
|
|
24
26
|
interface SidebarRightProps {
|
|
25
27
|
engine: DocumentEngine;
|
|
28
|
+
style?: React.CSSProperties;
|
|
26
29
|
}
|
|
27
30
|
declare const SidebarRight: React.FC<SidebarRightProps>;
|
|
28
31
|
|
|
29
32
|
interface ViewerProps {
|
|
30
33
|
engine: DocumentEngine;
|
|
34
|
+
style?: React.CSSProperties;
|
|
31
35
|
}
|
|
32
36
|
declare const Viewer: React.FC<ViewerProps>;
|
|
33
37
|
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ var Topbar = ({
|
|
|
37
37
|
showBrand = false,
|
|
38
38
|
brand,
|
|
39
39
|
title,
|
|
40
|
+
style,
|
|
40
41
|
showSidebarLeftToggle = true,
|
|
41
42
|
showPageControls = true,
|
|
42
43
|
showZoomControls = true,
|
|
@@ -383,6 +384,7 @@ var Topbar = ({
|
|
|
383
384
|
{
|
|
384
385
|
"data-papyrus-theme": uiTheme,
|
|
385
386
|
className: `papyrus-topbar papyrus-theme relative h-14 border-b flex items-center px-3 sm:px-4 z-50 transition-colors duration-200 ${isDark ? "bg-[#1a1a1a] border-[#333] text-white" : "bg-white border-gray-200 text-gray-800"}`,
|
|
387
|
+
style,
|
|
386
388
|
children: [
|
|
387
389
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 min-w-0 z-10", children: [
|
|
388
390
|
showSidebarLeftToggle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -915,7 +917,7 @@ var OutlineNode = ({ item, engine, isDark, accentColor, depth = 0 }) => {
|
|
|
915
917
|
)) })
|
|
916
918
|
] });
|
|
917
919
|
};
|
|
918
|
-
var SidebarLeft = ({ engine }) => {
|
|
920
|
+
var SidebarLeft = ({ engine, style }) => {
|
|
919
921
|
const {
|
|
920
922
|
pageCount,
|
|
921
923
|
currentPage,
|
|
@@ -937,6 +939,7 @@ var SidebarLeft = ({ engine }) => {
|
|
|
937
939
|
{
|
|
938
940
|
"data-papyrus-theme": uiTheme,
|
|
939
941
|
className: `papyrus-sidebar-left papyrus-theme absolute left-0 top-0 bottom-0 z-[120] w-[85vw] max-w-72 border-r flex flex-col h-full overflow-hidden transition-colors duration-200 ${isDark ? "bg-[#2a2a2a] border-[#3a3a3a]" : "bg-[#fcfcfc] border-gray-200"}`,
|
|
942
|
+
style,
|
|
940
943
|
children: [
|
|
941
944
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
942
945
|
"div",
|
|
@@ -1077,7 +1080,7 @@ var withAlpha2 = (hex, alpha) => {
|
|
|
1077
1080
|
const b = parseInt(value.slice(4, 6), 16);
|
|
1078
1081
|
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
1079
1082
|
};
|
|
1080
|
-
var SidebarRight = ({ engine }) => {
|
|
1083
|
+
var SidebarRight = ({ engine, style }) => {
|
|
1081
1084
|
const {
|
|
1082
1085
|
sidebarRightOpen,
|
|
1083
1086
|
sidebarRightTab,
|
|
@@ -1114,6 +1117,7 @@ var SidebarRight = ({ engine }) => {
|
|
|
1114
1117
|
{
|
|
1115
1118
|
"data-papyrus-theme": uiTheme,
|
|
1116
1119
|
className: `papyrus-sidebar-right papyrus-theme absolute right-0 top-0 bottom-0 z-[120] w-[88vw] max-w-80 border-l flex flex-col h-full transition-colors duration-200 shadow-2xl ${isDark ? "bg-[#1a1a1a] border-[#333]" : "bg-white border-gray-200"}`,
|
|
1120
|
+
style,
|
|
1117
1121
|
children: [
|
|
1118
1122
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1119
1123
|
"div",
|
|
@@ -2106,7 +2110,7 @@ var MIN_ZOOM = 0.2;
|
|
|
2106
2110
|
var MAX_ZOOM = 5;
|
|
2107
2111
|
var WIDTH_SNAP_PX = 4;
|
|
2108
2112
|
var WIDTH_HYSTERESIS_PX = 6;
|
|
2109
|
-
var Viewer = ({ engine }) => {
|
|
2113
|
+
var Viewer = ({ engine, style }) => {
|
|
2110
2114
|
const {
|
|
2111
2115
|
pageCount,
|
|
2112
2116
|
currentPage,
|
|
@@ -2449,6 +2453,7 @@ var Viewer = ({ engine }) => {
|
|
|
2449
2453
|
onTouchEnd: handleTouchEnd,
|
|
2450
2454
|
onTouchCancel: handleTouchEnd,
|
|
2451
2455
|
className: `papyrus-viewer papyrus-theme min-w-0 w-full flex-1 overflow-y-scroll overflow-x-hidden flex flex-col items-center ${paddingY} relative custom-scrollbar scroll-smooth ${isDark ? "bg-[#121212]" : "bg-[#e9ecef]"}`,
|
|
2456
|
+
style,
|
|
2452
2457
|
children: [
|
|
2453
2458
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-col items-center gap-6 w-full min-w-0", children: pages.map((idx) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2454
2459
|
"div",
|