@drawnagency/primitives 0.1.42 → 0.1.44

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 (80) hide show
  1. package/dist/{chunk-62OWSJ7V.js → chunk-5XYUO4HP.js} +1 -1
  2. package/dist/{chunk-A4RARGF2.js → chunk-BJ6FYGYP.js} +2 -0
  3. package/dist/{chunk-VY67DS3O.js → chunk-L2JJFOXD.js} +6 -0
  4. package/dist/{chunk-BU52OBPW.js → chunk-P3HO76OS.js} +1 -1
  5. package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
  6. package/dist/components/primitives/EditableRichText.d.ts.map +1 -1
  7. package/dist/components/primitives/ImageDropZone.d.ts +15 -0
  8. package/dist/components/primitives/ImageDropZone.d.ts.map +1 -0
  9. package/dist/components/primitives/RichTextToolbar.d.ts.map +1 -1
  10. package/dist/components/sections/Button/index.d.ts.map +1 -1
  11. package/dist/components/sections/Colors/index.d.ts.map +1 -1
  12. package/dist/components/sections/DoDontList/index.d.ts.map +1 -1
  13. package/dist/components/sections/DoDontMediaGrid/index.d.ts.map +1 -1
  14. package/dist/components/sections/IconList/index.d.ts.map +1 -1
  15. package/dist/components/sections/LinkHeading/index.d.ts.map +1 -1
  16. package/dist/components/sections/MediaGrid/MediaGrid.d.ts.map +1 -1
  17. package/dist/components/sections/MediaGrid/index.d.ts.map +1 -1
  18. package/dist/components/sections/Prose/index.d.ts.map +1 -1
  19. package/dist/components/sections/SplitContent/SplitContent.d.ts.map +1 -1
  20. package/dist/components/sections/SplitContent/index.d.ts.map +1 -1
  21. package/dist/components/sections/SubHeading/index.d.ts.map +1 -1
  22. package/dist/components/sections/SubSubHeading/index.d.ts.map +1 -1
  23. package/dist/components/shared/UploadRejectionAlert.d.ts +15 -0
  24. package/dist/components/shared/UploadRejectionAlert.d.ts.map +1 -0
  25. package/dist/components/shell/BugReportFAB.d.ts +1 -5
  26. package/dist/components/shell/BugReportFAB.d.ts.map +1 -1
  27. package/dist/components/shell/EditorShell.d.ts.map +1 -1
  28. package/dist/components/shell/MediaLibraryContext.d.ts +4 -0
  29. package/dist/components/shell/MediaLibraryContext.d.ts.map +1 -1
  30. package/dist/components/shell/MediaLibraryModal.d.ts.map +1 -1
  31. package/dist/components/shell/SectionSkeleton.d.ts.map +1 -1
  32. package/dist/components/shell/SectionTypePicker.d.ts +4 -3
  33. package/dist/components/shell/SectionTypePicker.d.ts.map +1 -1
  34. package/dist/components/shell/SiteSettingsDisplay.d.ts.map +1 -1
  35. package/dist/hooks/useMediaPipeline.d.ts.map +1 -1
  36. package/dist/index.js +6 -4
  37. package/dist/lib/index.js +2 -2
  38. package/dist/lib/registry.d.ts +2 -2
  39. package/dist/lib/registry.d.ts.map +1 -1
  40. package/dist/media/index.js +3 -1
  41. package/dist/media/utils.d.ts +1 -0
  42. package/dist/media/utils.d.ts.map +1 -1
  43. package/dist/schemas/index.js +2 -2
  44. package/dist/schemas/site-config.d.ts +2 -0
  45. package/dist/schemas/site-config.d.ts.map +1 -1
  46. package/dist/types/database.d.ts +512 -0
  47. package/dist/types/database.d.ts.map +1 -0
  48. package/dist/types/database.js +12 -0
  49. package/package.json +5 -1
  50. package/src/components/editor/SectionWrapper.tsx +9 -4
  51. package/src/components/primitives/EditableRichText.tsx +1 -0
  52. package/src/components/primitives/ImageDropZone.tsx +74 -0
  53. package/src/components/primitives/RichTextToolbar.tsx +42 -31
  54. package/src/components/primitives/tiptap-presets.ts +1 -1
  55. package/src/components/sections/Button/index.tsx +2 -0
  56. package/src/components/sections/Colors/index.tsx +2 -0
  57. package/src/components/sections/DoDontList/index.tsx +2 -0
  58. package/src/components/sections/DoDontMediaGrid/index.tsx +2 -0
  59. package/src/components/sections/IconList/index.tsx +2 -0
  60. package/src/components/sections/LinkHeading/index.tsx +2 -1
  61. package/src/components/sections/MediaGrid/MediaGrid.tsx +18 -5
  62. package/src/components/sections/MediaGrid/index.tsx +2 -0
  63. package/src/components/sections/Prose/index.tsx +2 -0
  64. package/src/components/sections/SplitContent/SplitContent.tsx +8 -7
  65. package/src/components/sections/SplitContent/index.tsx +2 -0
  66. package/src/components/sections/SubHeading/index.tsx +2 -1
  67. package/src/components/sections/SubSubHeading/index.tsx +2 -1
  68. package/src/components/shared/UploadRejectionAlert.tsx +52 -0
  69. package/src/components/shell/BugReportFAB.tsx +21 -26
  70. package/src/components/shell/EditorShell.tsx +16 -4
  71. package/src/components/shell/MediaLibraryContext.tsx +1 -0
  72. package/src/components/shell/MediaLibraryModal.tsx +10 -19
  73. package/src/components/shell/SectionSkeleton.tsx +15 -14
  74. package/src/components/shell/SectionTypePicker.tsx +15 -11
  75. package/src/components/shell/SiteSettingsDisplay.tsx +12 -0
  76. package/src/hooks/useMediaPipeline.ts +3 -0
  77. package/src/lib/registry.ts +2 -2
  78. package/src/media/utils.ts +6 -0
  79. package/src/schemas/site-config.ts +2 -0
  80. package/src/types/database.ts +568 -0
@@ -0,0 +1,568 @@
1
+ export type Json =
2
+ | string
3
+ | number
4
+ | boolean
5
+ | null
6
+ | { [key: string]: Json | undefined }
7
+ | Json[]
8
+
9
+ export type Database = {
10
+ // Allows to automatically instantiate createClient with right options
11
+ // instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
12
+ __InternalSupabase: {
13
+ PostgrestVersion: "14.5"
14
+ }
15
+ graphql_public: {
16
+ Tables: {
17
+ [_ in never]: never
18
+ }
19
+ Views: {
20
+ [_ in never]: never
21
+ }
22
+ Functions: {
23
+ graphql: {
24
+ Args: {
25
+ extensions?: Json
26
+ operationName?: string
27
+ query?: string
28
+ variables?: Json
29
+ }
30
+ Returns: Json
31
+ }
32
+ }
33
+ Enums: {
34
+ [_ in never]: never
35
+ }
36
+ CompositeTypes: {
37
+ [_ in never]: never
38
+ }
39
+ }
40
+ public: {
41
+ Tables: {
42
+ allowed_signups: {
43
+ Row: {
44
+ created_at: string | null
45
+ github_installation_id: string | null
46
+ id: string
47
+ pattern: string
48
+ }
49
+ Insert: {
50
+ created_at?: string | null
51
+ github_installation_id?: string | null
52
+ id?: string
53
+ pattern: string
54
+ }
55
+ Update: {
56
+ created_at?: string | null
57
+ github_installation_id?: string | null
58
+ id?: string
59
+ pattern?: string
60
+ }
61
+ Relationships: [
62
+ {
63
+ foreignKeyName: "allowed_signups_github_installation_id_fkey"
64
+ columns: ["github_installation_id"]
65
+ isOneToOne: false
66
+ referencedRelation: "github_installations"
67
+ referencedColumns: ["id"]
68
+ },
69
+ ]
70
+ }
71
+ bug_reports: {
72
+ Row: {
73
+ category: string
74
+ context: Json | null
75
+ created_at: string
76
+ description: string
77
+ id: string
78
+ images: Json
79
+ is_critical: boolean
80
+ site_id: string
81
+ status: string
82
+ user_id: string
83
+ }
84
+ Insert: {
85
+ category: string
86
+ context?: Json | null
87
+ created_at?: string
88
+ description: string
89
+ id?: string
90
+ images?: Json
91
+ is_critical?: boolean
92
+ site_id: string
93
+ status?: string
94
+ user_id: string
95
+ }
96
+ Update: {
97
+ category?: string
98
+ context?: Json | null
99
+ created_at?: string
100
+ description?: string
101
+ id?: string
102
+ images?: Json
103
+ is_critical?: boolean
104
+ site_id?: string
105
+ status?: string
106
+ user_id?: string
107
+ }
108
+ Relationships: [
109
+ {
110
+ foreignKeyName: "bug_reports_site_id_fkey"
111
+ columns: ["site_id"]
112
+ isOneToOne: false
113
+ referencedRelation: "sites"
114
+ referencedColumns: ["id"]
115
+ },
116
+ ]
117
+ }
118
+ deploy_status: {
119
+ Row: {
120
+ commit_sha: string | null
121
+ created_at: string
122
+ deploy_id: string
123
+ deploy_url: string
124
+ site_id: string
125
+ state: string
126
+ updated_at: string
127
+ }
128
+ Insert: {
129
+ commit_sha?: string | null
130
+ created_at?: string
131
+ deploy_id: string
132
+ deploy_url: string
133
+ site_id: string
134
+ state: string
135
+ updated_at?: string
136
+ }
137
+ Update: {
138
+ commit_sha?: string | null
139
+ created_at?: string
140
+ deploy_id?: string
141
+ deploy_url?: string
142
+ site_id?: string
143
+ state?: string
144
+ updated_at?: string
145
+ }
146
+ Relationships: [
147
+ {
148
+ foreignKeyName: "deploy_status_site_id_fkey"
149
+ columns: ["site_id"]
150
+ isOneToOne: true
151
+ referencedRelation: "sites"
152
+ referencedColumns: ["id"]
153
+ },
154
+ ]
155
+ }
156
+ github_installations: {
157
+ Row: {
158
+ created_at: string | null
159
+ github_account_login: string
160
+ github_account_type: string
161
+ github_installation_id: number
162
+ id: string
163
+ installed_by: string | null
164
+ status: string
165
+ }
166
+ Insert: {
167
+ created_at?: string | null
168
+ github_account_login: string
169
+ github_account_type: string
170
+ github_installation_id: number
171
+ id?: string
172
+ installed_by?: string | null
173
+ status?: string
174
+ }
175
+ Update: {
176
+ created_at?: string | null
177
+ github_account_login?: string
178
+ github_account_type?: string
179
+ github_installation_id?: number
180
+ id?: string
181
+ installed_by?: string | null
182
+ status?: string
183
+ }
184
+ Relationships: [
185
+ {
186
+ foreignKeyName: "github_installations_installed_by_fkey"
187
+ columns: ["installed_by"]
188
+ isOneToOne: false
189
+ referencedRelation: "platform_users"
190
+ referencedColumns: ["id"]
191
+ },
192
+ ]
193
+ }
194
+ installation_members: {
195
+ Row: {
196
+ created_at: string | null
197
+ installation_id: string
198
+ platform_user_id: string
199
+ role: string
200
+ }
201
+ Insert: {
202
+ created_at?: string | null
203
+ installation_id: string
204
+ platform_user_id: string
205
+ role?: string
206
+ }
207
+ Update: {
208
+ created_at?: string | null
209
+ installation_id?: string
210
+ platform_user_id?: string
211
+ role?: string
212
+ }
213
+ Relationships: [
214
+ {
215
+ foreignKeyName: "installation_members_installation_id_fkey"
216
+ columns: ["installation_id"]
217
+ isOneToOne: false
218
+ referencedRelation: "github_installations"
219
+ referencedColumns: ["id"]
220
+ },
221
+ {
222
+ foreignKeyName: "installation_members_platform_user_id_fkey"
223
+ columns: ["platform_user_id"]
224
+ isOneToOne: false
225
+ referencedRelation: "platform_users"
226
+ referencedColumns: ["id"]
227
+ },
228
+ ]
229
+ }
230
+ platform_users: {
231
+ Row: {
232
+ created_at: string | null
233
+ email: string
234
+ github_user_id: number | null
235
+ id: string
236
+ role: string
237
+ user_id: string
238
+ }
239
+ Insert: {
240
+ created_at?: string | null
241
+ email: string
242
+ github_user_id?: number | null
243
+ id?: string
244
+ role: string
245
+ user_id: string
246
+ }
247
+ Update: {
248
+ created_at?: string | null
249
+ email?: string
250
+ github_user_id?: number | null
251
+ id?: string
252
+ role?: string
253
+ user_id?: string
254
+ }
255
+ Relationships: []
256
+ }
257
+ site_api_keys: {
258
+ Row: {
259
+ created_at: string | null
260
+ id: string
261
+ key_hash: string
262
+ site_id: string
263
+ }
264
+ Insert: {
265
+ created_at?: string | null
266
+ id?: string
267
+ key_hash: string
268
+ site_id: string
269
+ }
270
+ Update: {
271
+ created_at?: string | null
272
+ id?: string
273
+ key_hash?: string
274
+ site_id?: string
275
+ }
276
+ Relationships: [
277
+ {
278
+ foreignKeyName: "site_api_keys_site_id_fkey"
279
+ columns: ["site_id"]
280
+ isOneToOne: false
281
+ referencedRelation: "sites"
282
+ referencedColumns: ["id"]
283
+ },
284
+ ]
285
+ }
286
+ site_users: {
287
+ Row: {
288
+ created_at: string | null
289
+ email: string
290
+ id: string
291
+ invited_by: string | null
292
+ role: string
293
+ site_id: string
294
+ user_id: string
295
+ }
296
+ Insert: {
297
+ created_at?: string | null
298
+ email: string
299
+ id?: string
300
+ invited_by?: string | null
301
+ role: string
302
+ site_id: string
303
+ user_id: string
304
+ }
305
+ Update: {
306
+ created_at?: string | null
307
+ email?: string
308
+ id?: string
309
+ invited_by?: string | null
310
+ role?: string
311
+ site_id?: string
312
+ user_id?: string
313
+ }
314
+ Relationships: [
315
+ {
316
+ foreignKeyName: "site_users_site_id_fkey"
317
+ columns: ["site_id"]
318
+ isOneToOne: false
319
+ referencedRelation: "sites"
320
+ referencedColumns: ["id"]
321
+ },
322
+ ]
323
+ }
324
+ sites: {
325
+ Row: {
326
+ created_at: string | null
327
+ custom_domain: string | null
328
+ github_owner: string
329
+ github_repo: string
330
+ id: string
331
+ installation_id: string | null
332
+ name: string
333
+ netlify_site_id: string | null
334
+ password_enabled: boolean
335
+ provisioned_by: string | null
336
+ provisioning_status: string
337
+ }
338
+ Insert: {
339
+ created_at?: string | null
340
+ custom_domain?: string | null
341
+ github_owner: string
342
+ github_repo: string
343
+ id?: string
344
+ installation_id?: string | null
345
+ name: string
346
+ netlify_site_id?: string | null
347
+ password_enabled?: boolean
348
+ provisioned_by?: string | null
349
+ provisioning_status?: string
350
+ }
351
+ Update: {
352
+ created_at?: string | null
353
+ custom_domain?: string | null
354
+ github_owner?: string
355
+ github_repo?: string
356
+ id?: string
357
+ installation_id?: string | null
358
+ name?: string
359
+ netlify_site_id?: string | null
360
+ password_enabled?: boolean
361
+ provisioned_by?: string | null
362
+ provisioning_status?: string
363
+ }
364
+ Relationships: [
365
+ {
366
+ foreignKeyName: "sites_installation_id_fkey"
367
+ columns: ["installation_id"]
368
+ isOneToOne: false
369
+ referencedRelation: "github_installations"
370
+ referencedColumns: ["id"]
371
+ },
372
+ {
373
+ foreignKeyName: "sites_provisioned_by_fkey"
374
+ columns: ["provisioned_by"]
375
+ isOneToOne: false
376
+ referencedRelation: "platform_users"
377
+ referencedColumns: ["id"]
378
+ },
379
+ ]
380
+ }
381
+ viewer_audiences: {
382
+ Row: {
383
+ color: string | null
384
+ created_at: string | null
385
+ display_name: string
386
+ id: string
387
+ is_default: boolean
388
+ name: string
389
+ password_hash: string
390
+ site_id: string
391
+ }
392
+ Insert: {
393
+ color?: string | null
394
+ created_at?: string | null
395
+ display_name: string
396
+ id?: string
397
+ is_default?: boolean
398
+ name: string
399
+ password_hash: string
400
+ site_id: string
401
+ }
402
+ Update: {
403
+ color?: string | null
404
+ created_at?: string | null
405
+ display_name?: string
406
+ id?: string
407
+ is_default?: boolean
408
+ name?: string
409
+ password_hash?: string
410
+ site_id?: string
411
+ }
412
+ Relationships: [
413
+ {
414
+ foreignKeyName: "viewer_tiers_site_id_fkey"
415
+ columns: ["site_id"]
416
+ isOneToOne: false
417
+ referencedRelation: "sites"
418
+ referencedColumns: ["id"]
419
+ },
420
+ ]
421
+ }
422
+ }
423
+ Views: {
424
+ [_ in never]: never
425
+ }
426
+ Functions: {
427
+ get_user_id_by_email: { Args: { lookup_email: string }; Returns: string }
428
+ is_site_member: { Args: { p_site_id: string }; Returns: boolean }
429
+ is_site_owner: { Args: { p_site_id: string }; Returns: boolean }
430
+ revoke_site_user: {
431
+ Args: { p_site_id: string; p_user_id: string }
432
+ Returns: undefined
433
+ }
434
+ }
435
+ Enums: {
436
+ [_ in never]: never
437
+ }
438
+ CompositeTypes: {
439
+ [_ in never]: never
440
+ }
441
+ }
442
+ }
443
+
444
+ type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">
445
+
446
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]
447
+
448
+ export type Tables<
449
+ DefaultSchemaTableNameOrOptions extends
450
+ | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
451
+ | { schema: keyof DatabaseWithoutInternals },
452
+ TableName extends DefaultSchemaTableNameOrOptions extends {
453
+ schema: keyof DatabaseWithoutInternals
454
+ }
455
+ ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
456
+ DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])
457
+ : never = never,
458
+ > = DefaultSchemaTableNameOrOptions extends {
459
+ schema: keyof DatabaseWithoutInternals
460
+ }
461
+ ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
462
+ DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
463
+ Row: infer R
464
+ }
465
+ ? R
466
+ : never
467
+ : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] &
468
+ DefaultSchema["Views"])
469
+ ? (DefaultSchema["Tables"] &
470
+ DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
471
+ Row: infer R
472
+ }
473
+ ? R
474
+ : never
475
+ : never
476
+
477
+ export type TablesInsert<
478
+ DefaultSchemaTableNameOrOptions extends
479
+ | keyof DefaultSchema["Tables"]
480
+ | { schema: keyof DatabaseWithoutInternals },
481
+ TableName extends DefaultSchemaTableNameOrOptions extends {
482
+ schema: keyof DatabaseWithoutInternals
483
+ }
484
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
485
+ : never = never,
486
+ > = DefaultSchemaTableNameOrOptions extends {
487
+ schema: keyof DatabaseWithoutInternals
488
+ }
489
+ ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
490
+ Insert: infer I
491
+ }
492
+ ? I
493
+ : never
494
+ : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
495
+ ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
496
+ Insert: infer I
497
+ }
498
+ ? I
499
+ : never
500
+ : never
501
+
502
+ export type TablesUpdate<
503
+ DefaultSchemaTableNameOrOptions extends
504
+ | keyof DefaultSchema["Tables"]
505
+ | { schema: keyof DatabaseWithoutInternals },
506
+ TableName extends DefaultSchemaTableNameOrOptions extends {
507
+ schema: keyof DatabaseWithoutInternals
508
+ }
509
+ ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
510
+ : never = never,
511
+ > = DefaultSchemaTableNameOrOptions extends {
512
+ schema: keyof DatabaseWithoutInternals
513
+ }
514
+ ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
515
+ Update: infer U
516
+ }
517
+ ? U
518
+ : never
519
+ : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
520
+ ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
521
+ Update: infer U
522
+ }
523
+ ? U
524
+ : never
525
+ : never
526
+
527
+ export type Enums<
528
+ DefaultSchemaEnumNameOrOptions extends
529
+ | keyof DefaultSchema["Enums"]
530
+ | { schema: keyof DatabaseWithoutInternals },
531
+ EnumName extends DefaultSchemaEnumNameOrOptions extends {
532
+ schema: keyof DatabaseWithoutInternals
533
+ }
534
+ ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"]
535
+ : never = never,
536
+ > = DefaultSchemaEnumNameOrOptions extends {
537
+ schema: keyof DatabaseWithoutInternals
538
+ }
539
+ ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName]
540
+ : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
541
+ ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions]
542
+ : never
543
+
544
+ export type CompositeTypes<
545
+ PublicCompositeTypeNameOrOptions extends
546
+ | keyof DefaultSchema["CompositeTypes"]
547
+ | { schema: keyof DatabaseWithoutInternals },
548
+ CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
549
+ schema: keyof DatabaseWithoutInternals
550
+ }
551
+ ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
552
+ : never = never,
553
+ > = PublicCompositeTypeNameOrOptions extends {
554
+ schema: keyof DatabaseWithoutInternals
555
+ }
556
+ ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
557
+ : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"]
558
+ ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
559
+ : never
560
+
561
+ export const Constants = {
562
+ graphql_public: {
563
+ Enums: {},
564
+ },
565
+ public: {
566
+ Enums: {},
567
+ },
568
+ } as const