@signiphi/pdf-compose 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4966 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4930 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles/index.css +2366 -0
- package/package.json +92 -0
- package/src/styles/index.css +229 -0
package/package.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@signiphi/pdf-compose",
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
4
|
+
"description": "Markdown-based document composer with field placeholders for the signiphi signing pipeline",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"*.css",
|
|
10
|
+
"./dist/styles/*.css"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.js",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./styles": "./dist/styles/index.css",
|
|
20
|
+
"./styles/source": "./src/styles/index.css",
|
|
21
|
+
"./src/styles/index.css": "./src/styles/index.css",
|
|
22
|
+
"./dist/styles/index.css": "./dist/styles/index.css"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"src/styles",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsup && node -e \"require('fs').mkdirSync('dist/styles', {recursive: true})\" && postcss src/styles/index.css -o dist/styles/index.css",
|
|
31
|
+
"dev": "tsup --watch",
|
|
32
|
+
"type-check": "tsc --noEmit"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"pdf",
|
|
36
|
+
"markdown",
|
|
37
|
+
"document-composer",
|
|
38
|
+
"form-fields",
|
|
39
|
+
"esignature"
|
|
40
|
+
],
|
|
41
|
+
"author": "signiphi",
|
|
42
|
+
"license": "",
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
45
|
+
"@radix-ui/react-label": "^2.1.0",
|
|
46
|
+
"@radix-ui/react-popover": "^1.1.0",
|
|
47
|
+
"@radix-ui/react-select": "^2.1.0",
|
|
48
|
+
"@radix-ui/react-tooltip": "^1.1.0",
|
|
49
|
+
"lucide-react": "^0.454.0",
|
|
50
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
51
|
+
"react-dom": "^18.2.0 || ^19.0.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"tailwindcss": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
60
|
+
"@tiptap/core": "^2.11.0",
|
|
61
|
+
"@tiptap/extension-placeholder": "^2.11.0",
|
|
62
|
+
"@tiptap/extension-text-align": "^2.11.0",
|
|
63
|
+
"@tiptap/extension-underline": "^2.11.0",
|
|
64
|
+
"@tiptap/pm": "^2.11.0",
|
|
65
|
+
"@tiptap/react": "^2.11.0",
|
|
66
|
+
"@tiptap/starter-kit": "^2.11.0",
|
|
67
|
+
"class-variance-authority": "^0.7.1",
|
|
68
|
+
"clsx": "^2.1.1",
|
|
69
|
+
"jszip": "^3.10.1",
|
|
70
|
+
"pdf-lib": "^1.17.1",
|
|
71
|
+
"pdfjs-dist": "5.3.93",
|
|
72
|
+
"tailwind-merge": "^3.3.1",
|
|
73
|
+
"uuid": "^9.0.1"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@jridgewell/remapping": "^2.3.5",
|
|
77
|
+
"@tailwindcss/postcss": "^4.1.4",
|
|
78
|
+
"@types/jszip": "^3.4.1",
|
|
79
|
+
"@types/node": "^20.11.19",
|
|
80
|
+
"@types/react": "^18.3.17",
|
|
81
|
+
"@types/react-dom": "^18.3.5",
|
|
82
|
+
"@types/uuid": "^9.0.7",
|
|
83
|
+
"postcss": "^8.5.6",
|
|
84
|
+
"postcss-cli": "^11.0.0",
|
|
85
|
+
"postcss-nesting": "^13.0.2",
|
|
86
|
+
"postcss-prefix-selector": "^1.16.1",
|
|
87
|
+
"postcss-preset-env": "^10.4.0",
|
|
88
|
+
"tailwindcss": "^4.1.4",
|
|
89
|
+
"tsup": "^8.3.5",
|
|
90
|
+
"typescript": "^5.8.3"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
@source '../**/*.{ts,tsx}';
|
|
4
|
+
|
|
5
|
+
@theme inline {
|
|
6
|
+
--color-border: hsl(var(--xpc-border));
|
|
7
|
+
--color-input: hsl(var(--xpc-input));
|
|
8
|
+
--color-ring: oklch(var(--xpc-ring));
|
|
9
|
+
--color-background: hsl(var(--xpc-background));
|
|
10
|
+
--color-foreground: hsl(var(--xpc-foreground));
|
|
11
|
+
--color-primary: oklch(var(--xpc-primary));
|
|
12
|
+
--color-primary-foreground: hsl(var(--xpc-primary-foreground));
|
|
13
|
+
--color-secondary: hsl(var(--xpc-secondary));
|
|
14
|
+
--color-secondary-foreground: hsl(var(--xpc-secondary-foreground));
|
|
15
|
+
--color-destructive: hsl(var(--xpc-destructive));
|
|
16
|
+
--color-destructive-foreground: hsl(var(--xpc-destructive-foreground));
|
|
17
|
+
--color-muted: hsl(var(--xpc-muted));
|
|
18
|
+
--color-muted-foreground: hsl(var(--xpc-muted-foreground));
|
|
19
|
+
--color-accent: hsl(var(--xpc-accent));
|
|
20
|
+
--color-accent-foreground: hsl(var(--xpc-accent-foreground));
|
|
21
|
+
--color-popover: hsl(var(--xpc-popover));
|
|
22
|
+
--color-popover-foreground: hsl(var(--xpc-popover-foreground));
|
|
23
|
+
--color-card: hsl(var(--xpc-card));
|
|
24
|
+
--color-card-foreground: hsl(var(--xpc-card-foreground));
|
|
25
|
+
|
|
26
|
+
--radius-lg: var(--xpc-radius);
|
|
27
|
+
--radius-md: calc(var(--xpc-radius) - 2px);
|
|
28
|
+
--radius-sm: calc(var(--xpc-radius) - 4px);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@layer base {
|
|
32
|
+
:root {
|
|
33
|
+
--xpc-color-medium-blue: oklch(0.597 0.186 230.42);
|
|
34
|
+
--xpc-color-dark-blue: oklch(0.23 0.12 273.81);
|
|
35
|
+
--xpc-color-light-blue: oklch(0.862 0.038 233.28);
|
|
36
|
+
|
|
37
|
+
--xpc-background: 0 0% 100%;
|
|
38
|
+
--xpc-foreground: 222.2 84% 4.9%;
|
|
39
|
+
--xpc-card: 0 0% 100%;
|
|
40
|
+
--xpc-card-foreground: 222.2 84% 4.9%;
|
|
41
|
+
--xpc-popover: 0 0% 100%;
|
|
42
|
+
--xpc-popover-foreground: 222.2 84% 4.9%;
|
|
43
|
+
--xpc-primary: 0.597 0.186 230.42;
|
|
44
|
+
--xpc-primary-foreground: 210 40% 98%;
|
|
45
|
+
--xpc-secondary: 210 40% 96.1%;
|
|
46
|
+
--xpc-secondary-foreground: 222.2 47.4% 11.2%;
|
|
47
|
+
--xpc-muted: 210 40% 96.1%;
|
|
48
|
+
--xpc-muted-foreground: 215.4 16.3% 46.9%;
|
|
49
|
+
--xpc-accent: 210 40% 96.1%;
|
|
50
|
+
--xpc-accent-foreground: 222.2 47.4% 11.2%;
|
|
51
|
+
--xpc-destructive: 0 84.2% 60.2%;
|
|
52
|
+
--xpc-destructive-foreground: 210 40% 98%;
|
|
53
|
+
--xpc-border: 214.3 31.8% 91.4%;
|
|
54
|
+
--xpc-input: 214.3 31.8% 91.4%;
|
|
55
|
+
--xpc-ring: 0.597 0.186 230.42;
|
|
56
|
+
--xpc-radius: 0.5rem;
|
|
57
|
+
--xpc-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
58
|
+
--xpc-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
59
|
+
--xpc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
60
|
+
--xpc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:root[data-theme="dark"],
|
|
64
|
+
:root.dark {
|
|
65
|
+
--xpc-background: 222.2 47.4% 11.2%;
|
|
66
|
+
--xpc-foreground: 210 40% 98%;
|
|
67
|
+
--xpc-card: 222.2 47.4% 11.2%;
|
|
68
|
+
--xpc-card-foreground: 210 40% 98%;
|
|
69
|
+
--xpc-popover: 222.2 47.4% 11.2%;
|
|
70
|
+
--xpc-popover-foreground: 210 40% 98%;
|
|
71
|
+
--xpc-primary: 0.597 0.186 230.42;
|
|
72
|
+
--xpc-primary-foreground: 210 40% 98%;
|
|
73
|
+
--xpc-secondary: 217.2 32.6% 17.5%;
|
|
74
|
+
--xpc-secondary-foreground: 210 40% 98%;
|
|
75
|
+
--xpc-muted: 217.2 32.6% 17.5%;
|
|
76
|
+
--xpc-muted-foreground: 215 20.2% 65.1%;
|
|
77
|
+
--xpc-accent: 217.2 32.6% 17.5%;
|
|
78
|
+
--xpc-accent-foreground: 210 40% 98%;
|
|
79
|
+
--xpc-destructive: 0 62.8% 30.6%;
|
|
80
|
+
--xpc-destructive-foreground: 210 40% 98%;
|
|
81
|
+
--xpc-border: 217.2 32.6% 17.5%;
|
|
82
|
+
--xpc-input: 217.2 32.6% 17.5%;
|
|
83
|
+
--xpc-ring: 0.597 0.186 230.42;
|
|
84
|
+
|
|
85
|
+
--xpc-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
|
|
86
|
+
--xpc-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
|
|
87
|
+
--xpc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
|
|
88
|
+
--xpc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Base styles — shared by root component AND portal wrappers (tooltip, popover).
|
|
93
|
+
Only include inheritable / non-layout properties here. */
|
|
94
|
+
.signiphi-pdf-compose {
|
|
95
|
+
box-sizing: border-box;
|
|
96
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
97
|
+
-webkit-font-smoothing: antialiased;
|
|
98
|
+
-moz-osx-font-smoothing: grayscale;
|
|
99
|
+
color: hsl(var(--xpc-foreground));
|
|
100
|
+
line-height: 1.5;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Root-only layout styles — Tailwind utilities don't apply to the root element
|
|
104
|
+
because PostCSS scopes them as descendant selectors (.signiphi-pdf-compose .utility).
|
|
105
|
+
Use data-compose-root to target only the actual component root, not portals. */
|
|
106
|
+
.signiphi-pdf-compose[data-compose-root] {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
height: 920px;
|
|
110
|
+
border: 1px solid hsl(var(--xpc-border));
|
|
111
|
+
border-radius: var(--xpc-radius);
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
background: hsl(var(--xpc-background));
|
|
114
|
+
|
|
115
|
+
transition: background-color 0.2s ease, color 0.2s ease;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.signiphi-pdf-compose[data-theme="dark"],
|
|
119
|
+
.signiphi-pdf-compose.dark {
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.signiphi-pdf-compose *,
|
|
123
|
+
.signiphi-pdf-compose *::before,
|
|
124
|
+
.signiphi-pdf-compose *::after {
|
|
125
|
+
box-sizing: border-box;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* TipTap editor styles */
|
|
129
|
+
.signiphi-pdf-compose .tiptap {
|
|
130
|
+
outline: none;
|
|
131
|
+
padding: 1rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.signiphi-pdf-compose .tiptap p {
|
|
135
|
+
margin: 0.5em 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.signiphi-pdf-compose .tiptap h1 {
|
|
139
|
+
font-size: 2em;
|
|
140
|
+
font-weight: 700;
|
|
141
|
+
margin: 0.67em 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.signiphi-pdf-compose .tiptap h2 {
|
|
145
|
+
font-size: 1.5em;
|
|
146
|
+
font-weight: 600;
|
|
147
|
+
margin: 0.75em 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.signiphi-pdf-compose .tiptap h3 {
|
|
151
|
+
font-size: 1.25em;
|
|
152
|
+
font-weight: 600;
|
|
153
|
+
margin: 0.83em 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.signiphi-pdf-compose .tiptap ul {
|
|
157
|
+
list-style-type: disc;
|
|
158
|
+
padding-left: 1.5em;
|
|
159
|
+
margin: 0.5em 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.signiphi-pdf-compose .tiptap ol {
|
|
163
|
+
list-style-type: decimal;
|
|
164
|
+
padding-left: 1.5em;
|
|
165
|
+
margin: 0.5em 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.signiphi-pdf-compose .tiptap li {
|
|
169
|
+
margin: 0.25em 0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.signiphi-pdf-compose .tiptap hr {
|
|
173
|
+
border: none;
|
|
174
|
+
border-top: 2px solid hsl(var(--xpc-border));
|
|
175
|
+
margin: 1em 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.signiphi-pdf-compose .tiptap blockquote {
|
|
179
|
+
border-left: 3px solid hsl(var(--xpc-border));
|
|
180
|
+
padding-left: 1em;
|
|
181
|
+
margin: 0.5em 0;
|
|
182
|
+
color: hsl(var(--xpc-muted-foreground));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.signiphi-pdf-compose .tiptap code {
|
|
186
|
+
background: hsl(var(--xpc-muted));
|
|
187
|
+
padding: 0.2em 0.4em;
|
|
188
|
+
border-radius: 0.25em;
|
|
189
|
+
font-size: 0.875em;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.signiphi-pdf-compose .tiptap .is-editor-empty:first-child::before {
|
|
193
|
+
content: attr(data-placeholder);
|
|
194
|
+
float: left;
|
|
195
|
+
color: hsl(var(--xpc-muted-foreground));
|
|
196
|
+
pointer-events: none;
|
|
197
|
+
height: 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* Scrollbar styles */
|
|
201
|
+
.signiphi-pdf-compose ::-webkit-scrollbar {
|
|
202
|
+
width: 8px;
|
|
203
|
+
height: 8px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.signiphi-pdf-compose ::-webkit-scrollbar-track {
|
|
207
|
+
background: hsl(var(--xpc-muted));
|
|
208
|
+
border-radius: 4px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.signiphi-pdf-compose ::-webkit-scrollbar-thumb {
|
|
212
|
+
background: hsl(var(--xpc-muted-foreground) / 0.3);
|
|
213
|
+
border-radius: 4px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.signiphi-pdf-compose ::-webkit-scrollbar-thumb:hover {
|
|
217
|
+
background: hsl(var(--xpc-muted-foreground) / 0.5);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* Loading spinner */
|
|
221
|
+
@keyframes xpc-spin {
|
|
222
|
+
to {
|
|
223
|
+
transform: rotate(360deg);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.signiphi-pdf-compose .animate-spin {
|
|
228
|
+
animation: xpc-spin 1s linear infinite;
|
|
229
|
+
}
|