@guard-rail/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +339 -0
  2. package/dist/adapters/supabase/auth.d.ts +9 -0
  3. package/dist/adapters/supabase/auth.js +57 -0
  4. package/dist/adapters/supabase/auth.js.map +1 -0
  5. package/dist/adapters/supabase/client.d.ts +28 -0
  6. package/dist/adapters/supabase/client.js +44 -0
  7. package/dist/adapters/supabase/client.js.map +1 -0
  8. package/dist/adapters/supabase/confirm.d.ts +19 -0
  9. package/dist/adapters/supabase/confirm.js +27 -0
  10. package/dist/adapters/supabase/confirm.js.map +1 -0
  11. package/dist/adapters/supabase/db.d.ts +9 -0
  12. package/dist/adapters/supabase/db.js +49 -0
  13. package/dist/adapters/supabase/db.js.map +1 -0
  14. package/dist/adapters/supabase/index.d.ts +25 -0
  15. package/dist/adapters/supabase/index.js +29 -0
  16. package/dist/adapters/supabase/index.js.map +1 -0
  17. package/dist/adapters/supabase/members.d.ts +9 -0
  18. package/dist/adapters/supabase/members.js +73 -0
  19. package/dist/adapters/supabase/members.js.map +1 -0
  20. package/dist/adapters/supabase/repeaters.d.ts +9 -0
  21. package/dist/adapters/supabase/repeaters.js +73 -0
  22. package/dist/adapters/supabase/repeaters.js.map +1 -0
  23. package/dist/adapters/supabase/storage.d.ts +18 -0
  24. package/dist/adapters/supabase/storage.js +93 -0
  25. package/dist/adapters/supabase/storage.js.map +1 -0
  26. package/dist/core/adapter-types.d.ts +212 -0
  27. package/dist/core/adapter-types.js +1 -0
  28. package/dist/core/adapter-types.js.map +1 -0
  29. package/dist/core/bailout.d.ts +9 -0
  30. package/dist/core/bailout.js +14 -0
  31. package/dist/core/bailout.js.map +1 -0
  32. package/dist/core/config.d.ts +27 -0
  33. package/dist/core/config.js +46 -0
  34. package/dist/core/config.js.map +1 -0
  35. package/dist/core/defs.d.ts +22 -0
  36. package/dist/core/defs.js +16 -0
  37. package/dist/core/defs.js.map +1 -0
  38. package/dist/core/types.d.ts +136 -0
  39. package/dist/core/types.js +1 -0
  40. package/dist/core/types.js.map +1 -0
  41. package/dist/index.d.ts +13 -0
  42. package/dist/index.js +43 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/react/Admin.d.ts +8 -0
  45. package/dist/react/Admin.js +116 -0
  46. package/dist/react/Admin.js.map +1 -0
  47. package/dist/react/GRail/client.d.ts +11 -0
  48. package/dist/react/GRail/client.js +242 -0
  49. package/dist/react/GRail/client.js.map +1 -0
  50. package/dist/react/GRail/index.d.ts +12 -0
  51. package/dist/react/GRail/index.js +19 -0
  52. package/dist/react/GRail/index.js.map +1 -0
  53. package/dist/react/GRail/render.d.ts +23 -0
  54. package/dist/react/GRail/render.js +67 -0
  55. package/dist/react/GRail/render.js.map +1 -0
  56. package/dist/react/Icons.d.ts +13 -0
  57. package/dist/react/Icons.js +68 -0
  58. package/dist/react/Icons.js.map +1 -0
  59. package/dist/react/MediaPicker.d.ts +14 -0
  60. package/dist/react/MediaPicker.js +172 -0
  61. package/dist/react/MediaPicker.js.map +1 -0
  62. package/dist/react/Provider.d.ts +11 -0
  63. package/dist/react/Provider.js +26 -0
  64. package/dist/react/Provider.js.map +1 -0
  65. package/dist/react/Repeater/client.d.ts +16 -0
  66. package/dist/react/Repeater/client.js +148 -0
  67. package/dist/react/Repeater/client.js.map +1 -0
  68. package/dist/react/Repeater/index.d.ts +35 -0
  69. package/dist/react/Repeater/index.js +22 -0
  70. package/dist/react/Repeater/index.js.map +1 -0
  71. package/dist/react/Syncer.d.ts +17 -0
  72. package/dist/react/Syncer.js +23 -0
  73. package/dist/react/Syncer.js.map +1 -0
  74. package/dist/react/Team.d.ts +7 -0
  75. package/dist/react/Team.js +190 -0
  76. package/dist/react/Team.js.map +1 -0
  77. package/dist/react/resizeImage.d.ts +25 -0
  78. package/dist/react/resizeImage.js +52 -0
  79. package/dist/react/resizeImage.js.map +1 -0
  80. package/dist/react/styles.d.ts +421 -0
  81. package/dist/react/styles.js +402 -0
  82. package/dist/react/styles.js.map +1 -0
  83. package/dist/react/useAnchorRect.d.ts +17 -0
  84. package/dist/react/useAnchorRect.js +32 -0
  85. package/dist/react/useAnchorRect.js.map +1 -0
  86. package/dist/server/actions.d.ts +41 -0
  87. package/dist/server/actions.js +214 -0
  88. package/dist/server/actions.js.map +1 -0
  89. package/dist/server/data.d.ts +10 -0
  90. package/dist/server/data.js +24 -0
  91. package/dist/server/data.js.map +1 -0
  92. package/dist/server/fieldData.d.ts +26 -0
  93. package/dist/server/fieldData.js +9 -0
  94. package/dist/server/fieldData.js.map +1 -0
  95. package/dist/server/loader.d.ts +6 -0
  96. package/dist/server/loader.js +53 -0
  97. package/dist/server/loader.js.map +1 -0
  98. package/dist/server/repeaterActions.d.ts +20 -0
  99. package/dist/server/repeaterActions.js +72 -0
  100. package/dist/server/repeaterActions.js.map +1 -0
  101. package/dist/server/repeaterData.d.ts +18 -0
  102. package/dist/server/repeaterData.js +27 -0
  103. package/dist/server/repeaterData.js.map +1 -0
  104. package/dist/server/session.d.ts +14 -0
  105. package/dist/server/session.js +37 -0
  106. package/dist/server/session.js.map +1 -0
  107. package/dist/server/wrapper.d.ts +12 -0
  108. package/dist/server/wrapper.js +42 -0
  109. package/dist/server/wrapper.js.map +1 -0
  110. package/package.json +58 -0
  111. package/supabase/migrations/20260911000000_guardrail_init.sql +288 -0
@@ -0,0 +1,402 @@
1
+ const S = {
2
+ banner: {
3
+ position: "fixed",
4
+ bottom: 0,
5
+ left: 0,
6
+ width: "100%",
7
+ background: "#fff",
8
+ color: "#000",
9
+ padding: "12px 16px",
10
+ zIndex: 1e4,
11
+ borderTop: "1px solid #e5e7eb",
12
+ fontFamily: "system-ui, -apple-system, sans-serif"
13
+ },
14
+ bannerForm: {
15
+ display: "flex",
16
+ gap: 12,
17
+ justifyContent: "center",
18
+ alignItems: "center",
19
+ flexWrap: "wrap"
20
+ },
21
+ brand: {
22
+ fontWeight: 900,
23
+ letterSpacing: "0.15em",
24
+ fontSize: 12,
25
+ textTransform: "uppercase"
26
+ },
27
+ error: { color: "#dc2626", fontSize: 12, fontWeight: 700 },
28
+ input: {
29
+ border: "1px solid #d1d5db",
30
+ borderRadius: 4,
31
+ padding: "6px 8px",
32
+ fontSize: 13,
33
+ color: "#000",
34
+ background: "#fff",
35
+ outline: "none"
36
+ },
37
+ primaryBtn: {
38
+ background: "#111827",
39
+ color: "#fff",
40
+ padding: "7px 16px",
41
+ borderRadius: 4,
42
+ fontSize: 12,
43
+ fontWeight: 700,
44
+ border: "none",
45
+ cursor: "pointer"
46
+ },
47
+ toolbar: {
48
+ position: "fixed",
49
+ bottom: 24,
50
+ left: "50%",
51
+ transform: "translateX(-50%)",
52
+ zIndex: 9999,
53
+ background: "rgba(17,24,39,0.95)",
54
+ backdropFilter: "blur(8px)",
55
+ color: "#fff",
56
+ padding: "12px 20px",
57
+ borderRadius: 9999,
58
+ boxShadow: "0 20px 40px rgba(0,0,0,0.35)",
59
+ display: "flex",
60
+ alignItems: "center",
61
+ gap: 20,
62
+ border: "1px solid rgba(255,255,255,0.1)",
63
+ fontFamily: "system-ui, -apple-system, sans-serif"
64
+ },
65
+ dot: {
66
+ display: "inline-block",
67
+ width: 8,
68
+ height: 8,
69
+ borderRadius: "50%",
70
+ background: "#3b82f6"
71
+ },
72
+ toolbarLabel: {
73
+ fontSize: 10,
74
+ fontWeight: 900,
75
+ textTransform: "uppercase",
76
+ letterSpacing: "0.2em",
77
+ color: "#dbeafe"
78
+ },
79
+ divider: { width: 1, height: 16, background: "rgba(255,255,255,0.2)" },
80
+ linkBtn: {
81
+ fontSize: 10,
82
+ fontWeight: 700,
83
+ textTransform: "uppercase",
84
+ letterSpacing: "0.15em",
85
+ color: "#9ca3af",
86
+ background: "none",
87
+ border: "none",
88
+ cursor: "pointer"
89
+ },
90
+ popover: {
91
+ position: "fixed",
92
+ bottom: 90,
93
+ left: "50%",
94
+ transform: "translateX(-50%)",
95
+ zIndex: 10001,
96
+ background: "#fff",
97
+ padding: 16,
98
+ borderRadius: 8,
99
+ boxShadow: "0 20px 40px rgba(0,0,0,0.25)",
100
+ border: "1px solid #e5e7eb",
101
+ minWidth: 300,
102
+ cursor: "default",
103
+ fontFamily: "system-ui, -apple-system, sans-serif"
104
+ },
105
+ label: {
106
+ display: "block",
107
+ fontSize: 10,
108
+ fontWeight: 700,
109
+ color: "#9ca3af",
110
+ marginBottom: 4,
111
+ textTransform: "uppercase"
112
+ },
113
+ field: {
114
+ border: "1px solid #d1d5db",
115
+ borderRadius: 4,
116
+ padding: "6px 8px",
117
+ fontSize: 13,
118
+ color: "#000",
119
+ background: "#fff",
120
+ width: "100%",
121
+ marginBottom: 8,
122
+ boxSizing: "border-box"
123
+ },
124
+ row: {
125
+ display: "flex",
126
+ gap: 8,
127
+ marginTop: 8,
128
+ paddingTop: 8,
129
+ borderTop: "1px solid #f3f4f6"
130
+ },
131
+ cancelBtn: {
132
+ background: "#f3f4f6",
133
+ color: "#4b5563",
134
+ padding: "7px 14px",
135
+ borderRadius: 4,
136
+ fontSize: 12,
137
+ border: "none",
138
+ cursor: "pointer"
139
+ },
140
+ /** Anchored to the element's rect at runtime; top/left are set inline. */
141
+ anchoredBar: {
142
+ position: "fixed",
143
+ zIndex: 10001,
144
+ display: "flex",
145
+ alignItems: "center",
146
+ gap: 4,
147
+ background: "rgba(17,24,39,0.97)",
148
+ backdropFilter: "blur(8px)",
149
+ padding: 4,
150
+ borderRadius: 8,
151
+ boxShadow: "0 8px 24px rgba(0,0,0,0.3)",
152
+ border: "1px solid rgba(255,255,255,0.12)",
153
+ fontFamily: "system-ui, -apple-system, sans-serif"
154
+ },
155
+ anchoredPanel: {
156
+ position: "fixed",
157
+ zIndex: 10001,
158
+ maxHeight: "calc(100vh - 24px)",
159
+ overflowY: "auto",
160
+ background: "#fff",
161
+ padding: 12,
162
+ borderRadius: 8,
163
+ boxShadow: "0 12px 32px rgba(0,0,0,0.25)",
164
+ border: "1px solid #e5e7eb",
165
+ minWidth: 260,
166
+ maxWidth: "min(340px, calc(100vw - 16px))",
167
+ cursor: "default",
168
+ fontFamily: "system-ui, -apple-system, sans-serif"
169
+ },
170
+ iconBtn: {
171
+ display: "inline-flex",
172
+ alignItems: "center",
173
+ justifyContent: "center",
174
+ width: 26,
175
+ height: 26,
176
+ borderRadius: 6,
177
+ border: "none",
178
+ background: "transparent",
179
+ color: "#e5e7eb",
180
+ cursor: "pointer",
181
+ padding: 0
182
+ },
183
+ iconBtnPrimary: {
184
+ display: "inline-flex",
185
+ alignItems: "center",
186
+ justifyContent: "center",
187
+ width: 26,
188
+ height: 26,
189
+ borderRadius: 6,
190
+ border: "none",
191
+ background: "#2563eb",
192
+ color: "#fff",
193
+ cursor: "pointer",
194
+ padding: 0
195
+ },
196
+ scrim: {
197
+ position: "fixed",
198
+ inset: 0,
199
+ background: "rgba(0,0,0,0.4)",
200
+ zIndex: 10002
201
+ },
202
+ drawer: {
203
+ position: "fixed",
204
+ top: 0,
205
+ right: 0,
206
+ height: "100%",
207
+ width: "min(420px, 100vw)",
208
+ background: "#fff",
209
+ color: "#111827",
210
+ zIndex: 10003,
211
+ boxShadow: "-12px 0 32px rgba(0,0,0,0.2)",
212
+ display: "flex",
213
+ flexDirection: "column",
214
+ fontFamily: "system-ui, -apple-system, sans-serif"
215
+ },
216
+ drawerHead: {
217
+ display: "flex",
218
+ alignItems: "center",
219
+ justifyContent: "space-between",
220
+ padding: "16px 20px",
221
+ borderBottom: "1px solid #e5e7eb"
222
+ },
223
+ drawerTitle: { fontSize: 14, fontWeight: 800, margin: 0 },
224
+ drawerBody: { padding: 20, overflowY: "auto", flex: 1 },
225
+ memberRow: {
226
+ display: "flex",
227
+ alignItems: "center",
228
+ gap: 8,
229
+ padding: "10px 0",
230
+ borderBottom: "1px solid #f3f4f6"
231
+ },
232
+ memberEmail: {
233
+ flex: 1,
234
+ fontSize: 13,
235
+ overflow: "hidden",
236
+ textOverflow: "ellipsis",
237
+ whiteSpace: "nowrap"
238
+ },
239
+ select: {
240
+ border: "1px solid #d1d5db",
241
+ borderRadius: 4,
242
+ padding: "4px 6px",
243
+ fontSize: 12,
244
+ background: "#fff",
245
+ color: "#111827"
246
+ },
247
+ badge: {
248
+ fontSize: 9,
249
+ fontWeight: 800,
250
+ textTransform: "uppercase",
251
+ letterSpacing: "0.1em",
252
+ padding: "2px 6px",
253
+ borderRadius: 999,
254
+ background: "#fef3c7",
255
+ color: "#92400e"
256
+ },
257
+ sectionLabel: {
258
+ fontSize: 10,
259
+ fontWeight: 800,
260
+ textTransform: "uppercase",
261
+ letterSpacing: "0.15em",
262
+ color: "#9ca3af",
263
+ margin: "20px 0 8px"
264
+ },
265
+ pickerScrim: {
266
+ position: "fixed",
267
+ inset: 0,
268
+ background: "rgba(0,0,0,0.5)",
269
+ zIndex: 10010
270
+ },
271
+ picker: {
272
+ position: "fixed",
273
+ top: "50%",
274
+ left: "50%",
275
+ transform: "translate(-50%, -50%)",
276
+ width: "min(720px, calc(100vw - 32px))",
277
+ maxHeight: "min(640px, calc(100vh - 32px))",
278
+ background: "#fff",
279
+ color: "#111827",
280
+ borderRadius: 12,
281
+ zIndex: 10011,
282
+ boxShadow: "0 24px 64px rgba(0,0,0,0.35)",
283
+ display: "flex",
284
+ flexDirection: "column",
285
+ overflow: "hidden",
286
+ fontFamily: "system-ui, -apple-system, sans-serif"
287
+ },
288
+ pickerGrid: {
289
+ display: "grid",
290
+ gridTemplateColumns: "repeat(auto-fill, minmax(120px, 1fr))",
291
+ gap: 10
292
+ },
293
+ pickerTile: {
294
+ position: "relative",
295
+ aspectRatio: "1",
296
+ borderRadius: 8,
297
+ overflow: "hidden",
298
+ border: "2px solid transparent",
299
+ background: "#f3f4f6",
300
+ cursor: "pointer",
301
+ padding: 0
302
+ },
303
+ pickerTileActive: { borderColor: "#2563eb" },
304
+ pickerThumb: {
305
+ width: "100%",
306
+ height: "100%",
307
+ objectFit: "cover",
308
+ display: "block"
309
+ },
310
+ dropzone: {
311
+ border: "1.5px dashed #d1d5db",
312
+ borderRadius: 8,
313
+ padding: 16,
314
+ textAlign: "center",
315
+ fontSize: 13,
316
+ color: "#6b7280",
317
+ marginBottom: 14,
318
+ cursor: "pointer"
319
+ },
320
+ dropzoneActive: {
321
+ borderColor: "#2563eb",
322
+ background: "#eff6ff",
323
+ color: "#1d4ed8"
324
+ },
325
+ previewThumb: {
326
+ // maxWidth also caps what the image contributes to the panel's width. The
327
+ // panel shrink-wraps its content, so an uncapped width: 100% image grew
328
+ // the whole panel to the picture's natural size.
329
+ width: "100%",
330
+ maxWidth: 300,
331
+ height: "auto",
332
+ maxHeight: 200,
333
+ objectFit: "contain",
334
+ background: "#f3f4f6",
335
+ borderRadius: 6,
336
+ display: "block",
337
+ marginBottom: 8
338
+ },
339
+ secondaryBtn: {
340
+ background: "#f3f4f6",
341
+ color: "#111827",
342
+ padding: "7px 12px",
343
+ borderRadius: 4,
344
+ fontSize: 12,
345
+ fontWeight: 600,
346
+ border: "none",
347
+ cursor: "pointer",
348
+ width: "100%",
349
+ marginBottom: 10
350
+ },
351
+ repeaterItem: {
352
+ position: "relative",
353
+ outline: "1px dashed #60a5fa",
354
+ outlineOffset: 2
355
+ },
356
+ repeaterToolbar: {
357
+ position: "absolute",
358
+ top: 4,
359
+ right: 4,
360
+ zIndex: 20,
361
+ display: "flex",
362
+ gap: 2,
363
+ background: "rgba(17,24,39,0.9)",
364
+ backdropFilter: "blur(6px)",
365
+ padding: 3,
366
+ borderRadius: 6,
367
+ boxShadow: "0 4px 12px rgba(0,0,0,0.25)"
368
+ },
369
+ repeaterAddRow: {
370
+ display: "flex",
371
+ gap: 8,
372
+ alignItems: "center",
373
+ marginTop: 8,
374
+ fontFamily: "system-ui, -apple-system, sans-serif"
375
+ },
376
+ repeaterAddBtn: {
377
+ display: "inline-flex",
378
+ alignItems: "center",
379
+ gap: 6,
380
+ padding: "8px 14px",
381
+ borderRadius: 6,
382
+ border: "1.5px dashed #93c5fd",
383
+ background: "transparent",
384
+ color: "#2563eb",
385
+ fontSize: 12,
386
+ fontWeight: 700,
387
+ cursor: "pointer"
388
+ },
389
+ repeaterSlugInput: {
390
+ border: "1px solid #d1d5db",
391
+ borderRadius: 4,
392
+ padding: "7px 9px",
393
+ fontSize: 13,
394
+ color: "#000",
395
+ background: "#fff",
396
+ minWidth: 180
397
+ }
398
+ };
399
+ export {
400
+ S
401
+ };
402
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/react/styles.ts"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\n/**\n * Guardrail's own chrome is styled with inline styles on purpose. Utility\n * classes would make the package depend on the consumer having Tailwind *and*\n * adding node_modules/guardrail to their content globs — it would render\n * unstyled on a clean install. Developer-authored content is never touched.\n */\nexport const S = {\n banner: {\n position: \"fixed\",\n bottom: 0,\n left: 0,\n width: \"100%\",\n background: \"#fff\",\n color: \"#000\",\n padding: \"12px 16px\",\n zIndex: 10000,\n borderTop: \"1px solid #e5e7eb\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n bannerForm: {\n display: \"flex\",\n gap: 12,\n justifyContent: \"center\",\n alignItems: \"center\",\n flexWrap: \"wrap\",\n },\n brand: {\n fontWeight: 900,\n letterSpacing: \"0.15em\",\n fontSize: 12,\n textTransform: \"uppercase\",\n },\n error: { color: \"#dc2626\", fontSize: 12, fontWeight: 700 },\n input: {\n border: \"1px solid #d1d5db\",\n borderRadius: 4,\n padding: \"6px 8px\",\n fontSize: 13,\n color: \"#000\",\n background: \"#fff\",\n outline: \"none\",\n },\n primaryBtn: {\n background: \"#111827\",\n color: \"#fff\",\n padding: \"7px 16px\",\n borderRadius: 4,\n fontSize: 12,\n fontWeight: 700,\n border: \"none\",\n cursor: \"pointer\",\n },\n toolbar: {\n position: \"fixed\",\n bottom: 24,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n zIndex: 9999,\n background: \"rgba(17,24,39,0.95)\",\n backdropFilter: \"blur(8px)\",\n color: \"#fff\",\n padding: \"12px 20px\",\n borderRadius: 9999,\n boxShadow: \"0 20px 40px rgba(0,0,0,0.35)\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 20,\n border: \"1px solid rgba(255,255,255,0.1)\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n dot: {\n display: \"inline-block\",\n width: 8,\n height: 8,\n borderRadius: \"50%\",\n background: \"#3b82f6\",\n },\n toolbarLabel: {\n fontSize: 10,\n fontWeight: 900,\n textTransform: \"uppercase\",\n letterSpacing: \"0.2em\",\n color: \"#dbeafe\",\n },\n divider: { width: 1, height: 16, background: \"rgba(255,255,255,0.2)\" },\n linkBtn: {\n fontSize: 10,\n fontWeight: 700,\n textTransform: \"uppercase\",\n letterSpacing: \"0.15em\",\n color: \"#9ca3af\",\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n },\n popover: {\n position: \"fixed\",\n bottom: 90,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n zIndex: 10001,\n background: \"#fff\",\n padding: 16,\n borderRadius: 8,\n boxShadow: \"0 20px 40px rgba(0,0,0,0.25)\",\n border: \"1px solid #e5e7eb\",\n minWidth: 300,\n cursor: \"default\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n label: {\n display: \"block\",\n fontSize: 10,\n fontWeight: 700,\n color: \"#9ca3af\",\n marginBottom: 4,\n textTransform: \"uppercase\",\n },\n field: {\n border: \"1px solid #d1d5db\",\n borderRadius: 4,\n padding: \"6px 8px\",\n fontSize: 13,\n color: \"#000\",\n background: \"#fff\",\n width: \"100%\",\n marginBottom: 8,\n boxSizing: \"border-box\",\n },\n row: {\n display: \"flex\",\n gap: 8,\n marginTop: 8,\n paddingTop: 8,\n borderTop: \"1px solid #f3f4f6\",\n },\n cancelBtn: {\n background: \"#f3f4f6\",\n color: \"#4b5563\",\n padding: \"7px 14px\",\n borderRadius: 4,\n fontSize: 12,\n border: \"none\",\n cursor: \"pointer\",\n },\n\n /** Anchored to the element's rect at runtime; top/left are set inline. */\n anchoredBar: {\n position: \"fixed\",\n zIndex: 10001,\n display: \"flex\",\n alignItems: \"center\",\n gap: 4,\n background: \"rgba(17,24,39,0.97)\",\n backdropFilter: \"blur(8px)\",\n padding: 4,\n borderRadius: 8,\n boxShadow: \"0 8px 24px rgba(0,0,0,0.3)\",\n border: \"1px solid rgba(255,255,255,0.12)\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n anchoredPanel: {\n position: \"fixed\",\n zIndex: 10001,\n maxHeight: \"calc(100vh - 24px)\",\n overflowY: \"auto\",\n background: \"#fff\",\n padding: 12,\n borderRadius: 8,\n boxShadow: \"0 12px 32px rgba(0,0,0,0.25)\",\n border: \"1px solid #e5e7eb\",\n minWidth: 260,\n maxWidth: \"min(340px, calc(100vw - 16px))\",\n cursor: \"default\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n iconBtn: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 26,\n height: 26,\n borderRadius: 6,\n border: \"none\",\n background: \"transparent\",\n color: \"#e5e7eb\",\n cursor: \"pointer\",\n padding: 0,\n },\n iconBtnPrimary: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 26,\n height: 26,\n borderRadius: 6,\n border: \"none\",\n background: \"#2563eb\",\n color: \"#fff\",\n cursor: \"pointer\",\n padding: 0,\n },\n\n scrim: {\n position: \"fixed\",\n inset: 0,\n background: \"rgba(0,0,0,0.4)\",\n zIndex: 10002,\n },\n drawer: {\n position: \"fixed\",\n top: 0,\n right: 0,\n height: \"100%\",\n width: \"min(420px, 100vw)\",\n background: \"#fff\",\n color: \"#111827\",\n zIndex: 10003,\n boxShadow: \"-12px 0 32px rgba(0,0,0,0.2)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n drawerHead: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"16px 20px\",\n borderBottom: \"1px solid #e5e7eb\",\n },\n drawerTitle: { fontSize: 14, fontWeight: 800, margin: 0 },\n drawerBody: { padding: 20, overflowY: \"auto\", flex: 1 },\n memberRow: {\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"10px 0\",\n borderBottom: \"1px solid #f3f4f6\",\n },\n memberEmail: {\n flex: 1,\n fontSize: 13,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n select: {\n border: \"1px solid #d1d5db\",\n borderRadius: 4,\n padding: \"4px 6px\",\n fontSize: 12,\n background: \"#fff\",\n color: \"#111827\",\n },\n badge: {\n fontSize: 9,\n fontWeight: 800,\n textTransform: \"uppercase\",\n letterSpacing: \"0.1em\",\n padding: \"2px 6px\",\n borderRadius: 999,\n background: \"#fef3c7\",\n color: \"#92400e\",\n },\n sectionLabel: {\n fontSize: 10,\n fontWeight: 800,\n textTransform: \"uppercase\",\n letterSpacing: \"0.15em\",\n color: \"#9ca3af\",\n margin: \"20px 0 8px\",\n },\n\n pickerScrim: {\n position: \"fixed\",\n inset: 0,\n background: \"rgba(0,0,0,0.5)\",\n zIndex: 10010,\n },\n picker: {\n position: \"fixed\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"min(720px, calc(100vw - 32px))\",\n maxHeight: \"min(640px, calc(100vh - 32px))\",\n background: \"#fff\",\n color: \"#111827\",\n borderRadius: 12,\n zIndex: 10011,\n boxShadow: \"0 24px 64px rgba(0,0,0,0.35)\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n pickerGrid: {\n display: \"grid\",\n gridTemplateColumns: \"repeat(auto-fill, minmax(120px, 1fr))\",\n gap: 10,\n },\n pickerTile: {\n position: \"relative\",\n aspectRatio: \"1\",\n borderRadius: 8,\n overflow: \"hidden\",\n border: \"2px solid transparent\",\n background: \"#f3f4f6\",\n cursor: \"pointer\",\n padding: 0,\n },\n pickerTileActive: { borderColor: \"#2563eb\" },\n pickerThumb: {\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n display: \"block\",\n },\n dropzone: {\n border: \"1.5px dashed #d1d5db\",\n borderRadius: 8,\n padding: 16,\n textAlign: \"center\",\n fontSize: 13,\n color: \"#6b7280\",\n marginBottom: 14,\n cursor: \"pointer\",\n },\n dropzoneActive: {\n borderColor: \"#2563eb\",\n background: \"#eff6ff\",\n color: \"#1d4ed8\",\n },\n previewThumb: {\n // maxWidth also caps what the image contributes to the panel's width. The\n // panel shrink-wraps its content, so an uncapped width: 100% image grew\n // the whole panel to the picture's natural size.\n width: \"100%\",\n maxWidth: 300,\n height: \"auto\",\n maxHeight: 200,\n objectFit: \"contain\",\n background: \"#f3f4f6\",\n borderRadius: 6,\n display: \"block\",\n marginBottom: 8,\n },\n secondaryBtn: {\n background: \"#f3f4f6\",\n color: \"#111827\",\n padding: \"7px 12px\",\n borderRadius: 4,\n fontSize: 12,\n fontWeight: 600,\n border: \"none\",\n cursor: \"pointer\",\n width: \"100%\",\n marginBottom: 10,\n },\n\n repeaterItem: {\n position: \"relative\",\n outline: \"1px dashed #60a5fa\",\n outlineOffset: 2,\n },\n repeaterToolbar: {\n position: \"absolute\",\n top: 4,\n right: 4,\n zIndex: 20,\n display: \"flex\",\n gap: 2,\n background: \"rgba(17,24,39,0.9)\",\n backdropFilter: \"blur(6px)\",\n padding: 3,\n borderRadius: 6,\n boxShadow: \"0 4px 12px rgba(0,0,0,0.25)\",\n },\n repeaterAddRow: {\n display: \"flex\",\n gap: 8,\n alignItems: \"center\",\n marginTop: 8,\n fontFamily: \"system-ui, -apple-system, sans-serif\",\n },\n repeaterAddBtn: {\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"8px 14px\",\n borderRadius: 6,\n border: \"1.5px dashed #93c5fd\",\n background: \"transparent\",\n color: \"#2563eb\",\n fontSize: 12,\n fontWeight: 700,\n cursor: \"pointer\",\n },\n repeaterSlugInput: {\n border: \"1px solid #d1d5db\",\n borderRadius: 4,\n padding: \"7px 9px\",\n fontSize: 13,\n color: \"#000\",\n background: \"#fff\",\n minWidth: 180,\n },\n} satisfies Record<string, CSSProperties>;\n"],"mappings":"AAQO,MAAM,IAAI;AAAA,EACf,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,YAAY;AAAA,IACV,SAAS;AAAA,IACT,KAAK;AAAA,IACL,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,UAAU;AAAA,IACV,eAAe;AAAA,EACjB;AAAA,EACA,OAAO,EAAE,OAAO,WAAW,UAAU,IAAI,YAAY,IAAI;AAAA,EACzD,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,SAAS;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AAAA,EACA,YAAY;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,SAAS;AAAA,IACT,cAAc;AAAA,IACd,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,SAAS;AAAA,IACP,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,IACX,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,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EA,cAAc;AAAA,IACZ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,eAAe;AAAA,EACjB;AAAA,EACA,iBAAiB;AAAA,IACf,UAAU;AAAA,IACV,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,EACb;AAAA,EACA,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,SAAS;AAAA,IACT,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,EACV;AAAA,EACA,mBAAmB;AAAA,IACjB,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,SAAS;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AACF;","names":[]}
@@ -0,0 +1,17 @@
1
+ import { RefObject } from 'react';
2
+
3
+ interface AnchorRect {
4
+ top: number;
5
+ left: number;
6
+ bottom: number;
7
+ width: number;
8
+ }
9
+ /**
10
+ * Tracks an element's viewport rect so editing chrome can sit against it.
11
+ *
12
+ * Listens on the capture phase so scrolling inside any ancestor container
13
+ * repositions the chrome, not just window scroll.
14
+ */
15
+ declare function useAnchorRect(ref: RefObject<HTMLElement | null>, active: boolean): AnchorRect | null;
16
+
17
+ export { type AnchorRect, useAnchorRect };
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { useCallback, useEffect, useState } from "react";
3
+ function useAnchorRect(ref, active) {
4
+ const [rect, setRect] = useState(null);
5
+ const measure = useCallback(() => {
6
+ const el = ref.current;
7
+ if (!el) return;
8
+ const r = el.getBoundingClientRect();
9
+ setRect({ top: r.top, left: r.left, bottom: r.bottom, width: r.width });
10
+ }, [ref]);
11
+ useEffect(() => {
12
+ if (!active) {
13
+ setRect(null);
14
+ return;
15
+ }
16
+ measure();
17
+ window.addEventListener("scroll", measure, true);
18
+ window.addEventListener("resize", measure);
19
+ const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(measure) : null;
20
+ if (observer && ref.current) observer.observe(ref.current);
21
+ return () => {
22
+ window.removeEventListener("scroll", measure, true);
23
+ window.removeEventListener("resize", measure);
24
+ observer?.disconnect();
25
+ };
26
+ }, [active, measure, ref]);
27
+ return rect;
28
+ }
29
+ export {
30
+ useAnchorRect
31
+ };
32
+ //# sourceMappingURL=useAnchorRect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/react/useAnchorRect.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useState, type RefObject } from \"react\";\n\nexport interface AnchorRect {\n top: number;\n left: number;\n bottom: number;\n width: number;\n}\n\n/**\n * Tracks an element's viewport rect so editing chrome can sit against it.\n *\n * Listens on the capture phase so scrolling inside any ancestor container\n * repositions the chrome, not just window scroll.\n */\nexport function useAnchorRect(\n ref: RefObject<HTMLElement | null>,\n active: boolean,\n): AnchorRect | null {\n const [rect, setRect] = useState<AnchorRect | null>(null);\n\n const measure = useCallback(() => {\n const el = ref.current;\n if (!el) return;\n const r = el.getBoundingClientRect();\n setRect({ top: r.top, left: r.left, bottom: r.bottom, width: r.width });\n }, [ref]);\n\n useEffect(() => {\n if (!active) {\n setRect(null);\n return;\n }\n\n measure();\n window.addEventListener(\"scroll\", measure, true);\n window.addEventListener(\"resize\", measure);\n\n // Catches layout shifts from the edit itself (text reflowing the element).\n const observer =\n typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(measure) : null;\n if (observer && ref.current) observer.observe(ref.current);\n\n return () => {\n window.removeEventListener(\"scroll\", measure, true);\n window.removeEventListener(\"resize\", measure);\n observer?.disconnect();\n };\n }, [active, measure, ref]);\n\n return rect;\n}\n"],"mappings":";AAEA,SAAS,aAAa,WAAW,gBAAgC;AAe1D,SAAS,cACd,KACA,QACmB;AACnB,QAAM,CAAC,MAAM,OAAO,IAAI,SAA4B,IAAI;AAExD,QAAM,UAAU,YAAY,MAAM;AAChC,UAAM,KAAK,IAAI;AACf,QAAI,CAAC,GAAI;AACT,UAAM,IAAI,GAAG,sBAAsB;AACnC,YAAQ,EAAE,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,EAAE,QAAQ,OAAO,EAAE,MAAM,CAAC;AAAA,EACxE,GAAG,CAAC,GAAG,CAAC;AAER,YAAU,MAAM;AACd,QAAI,CAAC,QAAQ;AACX,cAAQ,IAAI;AACZ;AAAA,IACF;AAEA,YAAQ;AACR,WAAO,iBAAiB,UAAU,SAAS,IAAI;AAC/C,WAAO,iBAAiB,UAAU,OAAO;AAGzC,UAAM,WACJ,OAAO,mBAAmB,cAAc,IAAI,eAAe,OAAO,IAAI;AACxE,QAAI,YAAY,IAAI,QAAS,UAAS,QAAQ,IAAI,OAAO;AAEzD,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,SAAS,IAAI;AAClD,aAAO,oBAAoB,UAAU,OAAO;AAC5C,gBAAU,WAAW;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,QAAQ,SAAS,GAAG,CAAC;AAEzB,SAAO;AACT;","names":[]}
@@ -0,0 +1,41 @@
1
+ import { GRRole, GRAsset, GRMember, ActionState, GRViewer, OverrideRow } from '../core/types.js';
2
+ import { GRUploadTarget } from '../core/adapter-types.js';
3
+ import 'react';
4
+
5
+ type Result = {
6
+ success: boolean;
7
+ error?: string;
8
+ };
9
+ /**
10
+ * Every mutation re-resolves the viewer server-side. The client's copy of the
11
+ * role decides what to *show*; it never decides what is *allowed*. A hidden
12
+ * button is not authorization — this is the same lesson as the session cookie.
13
+ */
14
+ declare function requireRole(allowed: readonly GRRole[]): Promise<GRViewer | null>;
15
+ declare function saveOverride(row: OverrideRow): Promise<Result>;
16
+ /**
17
+ * Authorizes an upload and returns where the browser should send the bytes.
18
+ * Only metadata comes through here — the file itself goes straight to storage.
19
+ */
20
+ declare function createAssetUpload(file: {
21
+ name: string;
22
+ contentType: string;
23
+ size: number;
24
+ }): Promise<{
25
+ success: true;
26
+ target: GRUploadTarget;
27
+ } | {
28
+ success: false;
29
+ error: string;
30
+ }>;
31
+ declare function listAssets(): Promise<GRAsset[]>;
32
+ declare function listTeam(): Promise<GRMember[]>;
33
+ declare function inviteMember(email: string, role: GRRole): Promise<Result>;
34
+ declare function updateMemberRole(email: string, role: GRRole): Promise<Result>;
35
+ declare function removeMember(email: string): Promise<Result>;
36
+ declare function loginAction(_prev: ActionState, formData: FormData): Promise<ActionState>;
37
+ declare function logoutAction(): Promise<{
38
+ success: boolean;
39
+ }>;
40
+
41
+ export { createAssetUpload, inviteMember, listAssets, listTeam, loginAction, logoutAction, removeMember, requireRole, saveOverride, updateMemberRole };