@tulip-systems/core 0.7.0 → 0.8.1
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/auth/server.d.mts +3 -3
- package/dist/auth/server.mjs +3 -3
- package/dist/components/editor/components/editor.client.d.mts +4 -3
- package/dist/components/editor/components/editor.client.d.mts.map +1 -1
- package/dist/components/editor/components/editor.client.mjs +5 -2
- package/dist/components/editor/components/editor.client.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/extension.d.mts +4 -4
- package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -1
- package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/strategy.d.mts +4 -6
- package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -1
- package/dist/components/editor/extensions/file-handler/strategy.mjs +11 -11
- package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/utils.mjs +1 -1
- package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -1
- package/dist/components/editor/extensions/image/extension.mjs +9 -9
- package/dist/components/editor/extensions/image/extension.mjs.map +1 -1
- package/dist/components/editor/lib/constants.d.mts +1 -1
- package/dist/components/editor/lib/constants.mjs +1 -1
- package/dist/components/editor/lib/extensions.d.mts +1 -1
- package/dist/components/editor/lib/helpers.d.mts +11 -3
- package/dist/components/editor/lib/helpers.d.mts.map +1 -1
- package/dist/components/editor/lib/helpers.mjs +27 -13
- package/dist/components/editor/lib/helpers.mjs.map +1 -1
- package/dist/components/ui/combobox-dropdown.client.mjs +1 -0
- package/dist/components/ui/combobox-dropdown.client.mjs.map +1 -1
- package/dist/components/ui/combobox.client.mjs +1 -1
- package/dist/components/ui/combobox.client.mjs.map +1 -1
- package/dist/components.d.mts +2 -2
- package/dist/components.mjs +2 -2
- package/dist/config/server.d.mts +1 -3
- package/dist/config/server.mjs +1 -4
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +1 -1
- package/dist/data-tables/client.d.mts +2 -1
- package/dist/data-tables/client.mjs +2 -1
- package/dist/data-tables.d.mts +1 -1
- package/dist/database/client.d.mts +1 -0
- package/dist/database/client.mjs +1 -0
- package/dist/database/server.d.mts +2 -0
- package/dist/database/server.mjs +3 -0
- package/dist/database.d.mts +3 -0
- package/dist/database.mjs +3 -0
- package/dist/emails/client.d.mts +1 -0
- package/dist/emails/client.mjs +1 -0
- package/dist/emails/server.d.mts +2 -0
- package/dist/emails/server.mjs +3 -0
- package/dist/emails.d.mts +1 -0
- package/dist/emails.mjs +1 -0
- package/dist/lib/utils/markdown.d.mts +10 -0
- package/dist/lib/utils/markdown.d.mts.map +1 -0
- package/dist/lib/utils/markdown.mjs +15 -0
- package/dist/lib/utils/markdown.mjs.map +1 -0
- package/dist/lib/utils/url.mjs +2 -1
- package/dist/lib/utils/url.mjs.map +1 -1
- package/dist/lib/utils/user-agent.mjs +15 -0
- package/dist/lib/utils/user-agent.mjs.map +1 -1
- package/dist/lib.d.mts +2 -2
- package/dist/lib.mjs +2 -2
- package/dist/modules/auth/components/create-first-user-guard.server.d.mts +16 -0
- package/dist/modules/auth/components/create-first-user-guard.server.d.mts.map +1 -0
- package/dist/modules/auth/components/create-first-user-guard.server.mjs +16 -0
- package/dist/modules/auth/components/create-first-user-guard.server.mjs.map +1 -0
- package/dist/modules/auth/components/guard.server.d.mts +2 -2
- package/dist/modules/auth/components/guard.server.mjs +1 -1
- package/dist/modules/auth/components/guard.server.mjs.map +1 -1
- package/dist/modules/auth/db/schema.d.mts +1 -1
- package/dist/modules/auth/db/schema.mjs +2 -2
- package/dist/modules/auth/handler/create-client.client.d.mts +4838 -229
- package/dist/modules/auth/handler/create-client.client.d.mts.map +1 -1
- package/dist/modules/auth/handler/create-client.client.mjs.map +1 -1
- package/dist/modules/auth/handler/proxy.server.mjs +2 -2
- package/dist/modules/auth/handler/proxy.server.mjs.map +1 -1
- package/dist/modules/auth/handler/route.server.d.mts +2 -2
- package/dist/modules/auth/handler/route.server.d.mts.map +1 -1
- package/dist/modules/auth/handler/route.server.mjs.map +1 -1
- package/dist/modules/auth/handler/{init.d.mts → service.server.d.mts} +322 -90
- package/dist/modules/auth/handler/service.server.d.mts.map +1 -0
- package/dist/modules/auth/handler/{init.mjs → service.server.mjs} +19 -8
- package/dist/modules/auth/handler/service.server.mjs.map +1 -0
- package/dist/modules/auth/hooks/use-session.d.mts +9 -4
- package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
- package/dist/modules/auth/lib/helpers.server.d.mts +1 -1
- package/dist/modules/auth/lib/permissions.d.mts +1 -1
- package/dist/modules/auth/lib/validators.mjs +1 -1
- package/dist/modules/config/lib/context.d.mts +9 -10
- package/dist/modules/config/lib/context.d.mts.map +1 -1
- package/dist/modules/config/lib/context.mjs.map +1 -1
- package/dist/modules/data-tables/lib/converters/search.d.mts +1 -1
- package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -1
- package/dist/modules/data-tables/server/get-data.server.d.mts +3 -3
- package/dist/modules/data-tables/server/get-data.server.mjs +1 -1
- package/dist/modules/data-tables/server/get-data.server.mjs.map +1 -1
- package/dist/modules/data-tables/strategies/infinite/strategy.d.mts +1 -1
- package/dist/modules/data-tables/strategies/infinite/strategy.mjs +3 -0
- package/dist/modules/data-tables/strategies/infinite/strategy.mjs.map +1 -1
- package/dist/modules/data-tables/tables/data-table/components/row.mjs +5 -15
- package/dist/modules/data-tables/tables/data-table/components/row.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/body.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/body.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs +13 -23
- package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +1 -0
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.mjs +2 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +5 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs +2 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts +30 -0
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts.map +1 -0
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs +77 -9
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs.map +1 -1
- package/dist/modules/{config/db → database/lib}/helpers.d.mts +2 -2
- package/dist/modules/database/lib/helpers.d.mts.map +1 -0
- package/dist/modules/{config/db → database/lib}/helpers.mjs +1 -1
- package/dist/modules/database/lib/helpers.mjs.map +1 -0
- package/dist/modules/database/lib/service.server.d.mts +34 -0
- package/dist/modules/database/lib/service.server.d.mts.map +1 -0
- package/dist/modules/database/lib/service.server.mjs +24 -0
- package/dist/modules/database/lib/service.server.mjs.map +1 -0
- package/dist/modules/{config/db → database/lib}/types.d.mts +1 -1
- package/dist/modules/database/lib/types.d.mts.map +1 -0
- package/dist/modules/emails/lib/service.server.d.mts +29 -0
- package/dist/modules/emails/lib/service.server.d.mts.map +1 -0
- package/dist/modules/emails/lib/service.server.mjs +21 -0
- package/dist/modules/emails/lib/service.server.mjs.map +1 -0
- package/dist/modules/inline-edit/components/date-input.client.mjs +1 -1
- package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.mjs +1 -0
- package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-time.client.mjs +1 -0
- package/dist/modules/inline-edit/components/date-time.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.mjs +1 -0
- package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.mjs +1 -0
- package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.mjs +1 -0
- package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input.client.mjs +3 -0
- package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/select.client.mjs +1 -0
- package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.mjs +1 -0
- package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs +1 -0
- package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
- package/dist/modules/router/handler/context.server.d.mts +12 -10
- package/dist/modules/router/handler/context.server.d.mts.map +1 -1
- package/dist/modules/router/handler/init.server.d.mts +13 -11
- package/dist/modules/router/handler/init.server.d.mts.map +1 -1
- package/dist/modules/router/handler/init.server.mjs +2 -2
- package/dist/modules/router/handler/init.server.mjs.map +1 -1
- package/dist/modules/router/handler/route.server.d.mts +1 -1
- package/dist/modules/storage/components/dropzone.client.d.mts +2 -2
- package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/dropzone.client.mjs.map +1 -1
- package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
- package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
- package/dist/modules/storage/components/image-grid.client.mjs +20 -22
- package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
- package/dist/modules/storage/components/image.client.d.mts +8 -0
- package/dist/modules/storage/components/image.client.d.mts.map +1 -0
- package/dist/modules/storage/components/image.client.mjs +17 -0
- package/dist/modules/storage/components/image.client.mjs.map +1 -0
- package/dist/modules/storage/components/upload-button.client.d.mts +12 -0
- package/dist/modules/storage/components/upload-button.client.d.mts.map +1 -0
- package/dist/modules/storage/components/upload-button.client.mjs +34 -0
- package/dist/modules/storage/components/upload-button.client.mjs.map +1 -0
- package/dist/modules/storage/components/upload-zone-context.client.d.mts +5 -5
- package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone-context.client.mjs +2 -2
- package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.d.mts +4 -4
- package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.mjs +16 -9
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
- package/dist/modules/storage/lib/constants.d.mts +1 -5
- package/dist/modules/storage/lib/constants.d.mts.map +1 -1
- package/dist/modules/storage/lib/constants.mjs +1 -13
- package/dist/modules/storage/lib/constants.mjs.map +1 -1
- package/dist/modules/storage/lib/helpers.d.mts +14 -28
- package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
- package/dist/modules/storage/lib/helpers.mjs +17 -75
- package/dist/modules/storage/lib/helpers.mjs.map +1 -1
- package/dist/modules/storage/lib/procedures.server.d.mts +1991 -0
- package/dist/modules/{auth/handler/init.d.mts.map → storage/lib/procedures.server.d.mts.map} +1 -1
- package/dist/modules/storage/lib/procedures.server.mjs +22 -0
- package/dist/modules/storage/lib/procedures.server.mjs.map +1 -0
- package/dist/modules/storage/lib/router-handlers.server.d.mts +41 -0
- package/dist/modules/storage/lib/router-handlers.server.d.mts.map +1 -0
- package/dist/modules/storage/lib/router-handlers.server.mjs +124 -0
- package/dist/modules/storage/lib/router-handlers.server.mjs.map +1 -0
- package/dist/modules/storage/lib/schema.d.mts +68 -958
- package/dist/modules/storage/lib/schema.d.mts.map +1 -1
- package/dist/modules/storage/lib/schema.mjs +28 -65
- package/dist/modules/storage/lib/schema.mjs.map +1 -1
- package/dist/modules/storage/lib/service.server.d.mts +2155 -141
- package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/service.server.mjs +453 -242
- package/dist/modules/storage/lib/service.server.mjs.map +1 -1
- package/dist/modules/storage/lib/upload.client.d.mts +58 -0
- package/dist/modules/storage/lib/upload.client.d.mts.map +1 -0
- package/dist/modules/storage/lib/upload.client.mjs +87 -0
- package/dist/modules/storage/lib/upload.client.mjs.map +1 -0
- package/dist/modules/storage/lib/validators.d.mts +297 -835
- package/dist/modules/storage/lib/validators.d.mts.map +1 -1
- package/dist/modules/storage/lib/validators.mjs +32 -76
- package/dist/modules/storage/lib/validators.mjs.map +1 -1
- package/dist/modules/storage/providers/adapters/s3.server.d.mts +19 -0
- package/dist/modules/storage/providers/adapters/s3.server.d.mts.map +1 -0
- package/dist/modules/storage/providers/adapters/s3.server.mjs +173 -0
- package/dist/modules/storage/providers/adapters/s3.server.mjs.map +1 -0
- package/dist/modules/storage/providers/lib/constants.d.mts +6 -0
- package/dist/modules/storage/providers/lib/constants.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/constants.mjs +6 -0
- package/dist/modules/storage/providers/lib/constants.mjs.map +1 -0
- package/dist/modules/storage/providers/lib/errors.d.mts +12 -0
- package/dist/modules/storage/providers/lib/errors.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/errors.mjs +13 -0
- package/dist/modules/storage/providers/lib/errors.mjs.map +1 -0
- package/dist/modules/storage/providers/lib/types.d.mts +21 -0
- package/dist/modules/storage/providers/lib/types.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/validators.d.mts +112 -0
- package/dist/modules/storage/providers/lib/validators.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/validators.mjs +75 -0
- package/dist/modules/storage/providers/lib/validators.mjs.map +1 -0
- package/dist/router/server.d.mts +1 -1
- package/dist/storage/client.d.mts +4 -2
- package/dist/storage/client.mjs +4 -2
- package/dist/storage/server.d.mts +5 -4
- package/dist/storage/server.mjs +5 -4
- package/dist/storage.d.mts +9 -6
- package/dist/storage.mjs +8 -6
- package/package.json +18 -5
- package/src/components/editor/components/editor.client.tsx +9 -1
- package/src/components/editor/extensions/file-handler/extension.ts +4 -4
- package/src/components/editor/extensions/file-handler/strategy.ts +15 -40
- package/src/components/editor/extensions/file-handler/utils.ts +1 -1
- package/src/components/editor/extensions/image/extension.ts +10 -10
- package/src/components/editor/lib/helpers.ts +28 -11
- package/src/components/ui/combobox-dropdown.client.tsx +1 -0
- package/src/components/ui/combobox.client.tsx +1 -1
- package/src/entry.ts +12 -51
- package/src/lib/entry.ts +1 -5
- package/src/lib/utils/markdown.ts +10 -0
- package/src/lib/utils/url.ts +2 -1
- package/src/lib/utils/user-agent.ts +15 -0
- package/src/modules/auth/components/{guard-first-user.server.tsx → create-first-user-guard.server.tsx} +8 -8
- package/src/modules/auth/components/guard.server.tsx +1 -1
- package/src/modules/auth/entry.server.ts +4 -5
- package/src/modules/auth/handler/create-client.client.ts +2 -2
- package/src/modules/auth/handler/proxy.server.ts +1 -1
- package/src/modules/auth/handler/route.server.ts +2 -2
- package/src/modules/auth/handler/{init.ts → service.server.ts} +30 -9
- package/src/modules/config/entry.server.ts +0 -9
- package/src/modules/config/entry.ts +2 -2
- package/src/modules/config/lib/context.ts +9 -9
- package/src/modules/data-tables/entry.client.ts +1 -0
- package/src/modules/data-tables/server/get-data.server.ts +1 -1
- package/src/modules/data-tables/strategies/infinite/strategy.ts +4 -1
- package/src/modules/data-tables/tables/data-table/components/row.tsx +12 -21
- package/src/modules/data-tables/tables/inline-table/components/body.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/row.client.tsx +24 -30
- package/src/modules/data-tables/tables/inline-table/components/table.tsx +6 -1
- package/src/modules/data-tables/tables/inline-table/hooks/context.client.tsx +5 -0
- package/src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts +119 -91
- package/src/modules/database/entry.client.ts +0 -0
- package/src/modules/database/entry.server.ts +4 -0
- package/src/modules/database/entry.ts +5 -0
- package/src/modules/database/lib/service.server.ts +33 -0
- package/src/modules/emails/entry.client.ts +0 -0
- package/src/modules/emails/entry.server.ts +4 -0
- package/src/modules/emails/entry.ts +0 -0
- package/src/modules/emails/lib/service.server.ts +29 -0
- package/src/modules/inline-edit/components/date-input.client.tsx +1 -1
- package/src/modules/inline-edit/components/date-picker.client.tsx +1 -0
- package/src/modules/inline-edit/components/date-time.client.tsx +1 -0
- package/src/modules/inline-edit/components/editor.client.tsx +3 -0
- package/src/modules/inline-edit/components/input-recipient.client.tsx +1 -0
- package/src/modules/inline-edit/components/input-toggle.client.tsx +1 -0
- package/src/modules/inline-edit/components/input.client.tsx +3 -0
- package/src/modules/inline-edit/components/select.client.tsx +5 -1
- package/src/modules/inline-edit/components/switch.client.tsx +1 -0
- package/src/modules/inline-edit/components/toggle.client.tsx +1 -0
- package/src/modules/router/handler/init.server.ts +2 -2
- package/src/modules/storage/components/dropzone.client.tsx +1 -1
- package/src/modules/storage/components/image-grid.client.tsx +23 -20
- package/src/modules/storage/components/image.client.tsx +8 -0
- package/src/modules/storage/components/upload-zone-context.client.tsx +11 -8
- package/src/modules/storage/components/upload-zone.client.tsx +22 -16
- package/src/modules/storage/entry.client.ts +3 -1
- package/src/modules/storage/entry.server.ts +9 -3
- package/src/modules/storage/entry.ts +13 -1
- package/src/modules/storage/lib/constants.ts +0 -11
- package/src/modules/storage/lib/helpers.ts +18 -65
- package/src/modules/storage/lib/procedures.server.ts +60 -0
- package/src/modules/storage/lib/router-handlers.server.ts +178 -0
- package/src/modules/storage/lib/schema.ts +26 -97
- package/src/modules/storage/lib/service.server.ts +636 -374
- package/src/modules/storage/lib/upload.client.ts +156 -0
- package/src/modules/storage/lib/validators.ts +50 -111
- package/src/modules/storage/providers/adapters/s3.server.ts +281 -0
- package/src/modules/storage/providers/lib/constants.ts +3 -0
- package/src/modules/storage/providers/lib/errors.ts +21 -0
- package/src/modules/storage/providers/lib/types.ts +28 -0
- package/src/modules/storage/providers/lib/validators.ts +122 -0
- package/dist/lib/config/constants.d.mts +0 -5
- package/dist/lib/config/constants.d.mts.map +0 -1
- package/dist/lib/config/constants.mjs +0 -6
- package/dist/lib/config/constants.mjs.map +0 -1
- package/dist/modules/auth/components/guard-first-user.server.d.mts +0 -18
- package/dist/modules/auth/components/guard-first-user.server.d.mts.map +0 -1
- package/dist/modules/auth/components/guard-first-user.server.mjs +0 -16
- package/dist/modules/auth/components/guard-first-user.server.mjs.map +0 -1
- package/dist/modules/auth/handler/init.mjs.map +0 -1
- package/dist/modules/config/db/helpers.d.mts.map +0 -1
- package/dist/modules/config/db/helpers.mjs.map +0 -1
- package/dist/modules/config/db/init.d.mts +0 -20
- package/dist/modules/config/db/init.d.mts.map +0 -1
- package/dist/modules/config/db/init.mjs +0 -15
- package/dist/modules/config/db/init.mjs.map +0 -1
- package/dist/modules/config/db/types.d.mts.map +0 -1
- package/dist/modules/config/providers/email.d.mts +0 -12
- package/dist/modules/config/providers/email.d.mts.map +0 -1
- package/dist/modules/config/providers/email.mjs +0 -11
- package/dist/modules/config/providers/email.mjs.map +0 -1
- package/dist/modules/storage/config/filters.d.mts +0 -17
- package/dist/modules/storage/config/filters.d.mts.map +0 -1
- package/dist/modules/storage/config/filters.mjs +0 -17
- package/dist/modules/storage/config/filters.mjs.map +0 -1
- package/dist/modules/storage/lib/create-client.server.d.mts +0 -11
- package/dist/modules/storage/lib/create-client.server.d.mts.map +0 -1
- package/dist/modules/storage/lib/create-client.server.mjs +0 -11
- package/dist/modules/storage/lib/create-client.server.mjs.map +0 -1
- package/dist/modules/storage/lib/create-upload.client.d.mts +0 -56
- package/dist/modules/storage/lib/create-upload.client.d.mts.map +0 -1
- package/dist/modules/storage/lib/create-upload.client.mjs +0 -98
- package/dist/modules/storage/lib/create-upload.client.mjs.map +0 -1
- package/dist/modules/storage/lib/proxy.server.d.mts +0 -21
- package/dist/modules/storage/lib/proxy.server.d.mts.map +0 -1
- package/dist/modules/storage/lib/proxy.server.mjs +0 -46
- package/dist/modules/storage/lib/proxy.server.mjs.map +0 -1
- package/dist/modules/storage/lib/router.server.d.mts +0 -31002
- package/dist/modules/storage/lib/router.server.d.mts.map +0 -1
- package/dist/modules/storage/lib/router.server.mjs +0 -86
- package/dist/modules/storage/lib/router.server.mjs.map +0 -1
- package/src/lib/config/constants.ts +0 -1
- package/src/lib/utils/time-picker.ts +0 -139
- package/src/modules/config/db/init.ts +0 -21
- package/src/modules/config/providers/email.ts +0 -13
- package/src/modules/storage/config/filters.ts +0 -12
- package/src/modules/storage/lib/create-client.server.ts +0 -14
- package/src/modules/storage/lib/create-upload.client.ts +0 -134
- package/src/modules/storage/lib/proxy.server.ts +0 -63
- package/src/modules/storage/lib/router.server.ts +0 -182
- /package/src/modules/{config/db → database/lib}/helpers.ts +0 -0
- /package/src/modules/{config/db → database/lib}/types.ts +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z as z$1 } from "zod";
|
|
2
|
+
import { Readable } from "node:stream";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/storage/providers/lib/validators.ts
|
|
5
|
+
/**
|
|
6
|
+
* Object body schema
|
|
7
|
+
*/
|
|
8
|
+
const objectBodyInputSchema = z$1.union([
|
|
9
|
+
z$1.string(),
|
|
10
|
+
z$1.instanceof(Uint8Array),
|
|
11
|
+
z$1.instanceof(Buffer),
|
|
12
|
+
z$1.instanceof(Readable)
|
|
13
|
+
]);
|
|
14
|
+
/**
|
|
15
|
+
* Object body output schema (normalized)
|
|
16
|
+
*/
|
|
17
|
+
const objectBodyOutputSchema = z$1.instanceof(Readable);
|
|
18
|
+
/**
|
|
19
|
+
* Object schema
|
|
20
|
+
*/
|
|
21
|
+
const objectSchema = z$1.object({
|
|
22
|
+
contentType: z$1.string().nullable().optional(),
|
|
23
|
+
size: z$1.number().nullable().optional(),
|
|
24
|
+
metadata: z$1.record(z$1.string(), z$1.string()).optional()
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Get object input
|
|
28
|
+
*/
|
|
29
|
+
const getObjectInputSchema = z$1.string();
|
|
30
|
+
/**
|
|
31
|
+
* Get object options schema
|
|
32
|
+
*/
|
|
33
|
+
const getObjectOptionsDefaults = { disposition: "inline" };
|
|
34
|
+
const getObjectOptionsSchema = z$1.object({ disposition: z$1.string().optional().default(getObjectOptionsDefaults.disposition) });
|
|
35
|
+
/**
|
|
36
|
+
* Get object URL input
|
|
37
|
+
*/
|
|
38
|
+
const getObjectURLOptionsSchema = getObjectOptionsSchema.extend({ expiresIn: z$1.number().optional().default(3600 * 24) });
|
|
39
|
+
/**
|
|
40
|
+
* Get object output
|
|
41
|
+
*/
|
|
42
|
+
const getObjectOutputSchema = objectSchema.extend({ body: objectBodyOutputSchema });
|
|
43
|
+
/**
|
|
44
|
+
* Get object head input
|
|
45
|
+
*/
|
|
46
|
+
const headObjectInputSchema = z$1.object({ key: z$1.string() });
|
|
47
|
+
/**
|
|
48
|
+
* Head object output
|
|
49
|
+
*/
|
|
50
|
+
const headObjectOutputSchema = objectSchema;
|
|
51
|
+
/**
|
|
52
|
+
* Put object URL input
|
|
53
|
+
*/
|
|
54
|
+
const putObjectURLInputSchema = z$1.object({
|
|
55
|
+
key: z$1.string(),
|
|
56
|
+
contentType: z$1.string().nullable().optional(),
|
|
57
|
+
size: z$1.number().nullable().optional(),
|
|
58
|
+
metadata: z$1.record(z$1.string(), z$1.string()).optional()
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Put object URL input
|
|
62
|
+
*/
|
|
63
|
+
const putObjectURLOptionsSchema = z$1.object({ expiresIn: z$1.number().optional().default(3600) });
|
|
64
|
+
/**
|
|
65
|
+
* Put object input
|
|
66
|
+
*/
|
|
67
|
+
const putObjectInputSchema = putObjectURLInputSchema.extend({ body: objectBodyInputSchema });
|
|
68
|
+
/**
|
|
69
|
+
* Put object schema
|
|
70
|
+
*/
|
|
71
|
+
const putObjectOutputSchema = objectSchema;
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { getObjectInputSchema, getObjectOptionsDefaults, getObjectOptionsSchema, getObjectOutputSchema, getObjectURLOptionsSchema, headObjectInputSchema, headObjectOutputSchema, objectBodyInputSchema, objectBodyOutputSchema, objectSchema, putObjectInputSchema, putObjectOutputSchema, putObjectURLInputSchema, putObjectURLOptionsSchema };
|
|
75
|
+
//# sourceMappingURL=validators.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../../src/modules/storage/providers/lib/validators.ts"],"sourcesContent":["import { Readable } from \"node:stream\";\nimport { z } from \"zod\";\n\n/**\n * Object body schema\n */\nexport const objectBodyInputSchema = z.union([\n z.string(),\n z.instanceof(Uint8Array),\n z.instanceof(Buffer),\n z.instanceof(Readable),\n]);\n\nexport type ObjectBodyInput = z.infer<typeof objectBodyInputSchema>;\n\n/**\n * Object body output schema (normalized)\n */\nexport const objectBodyOutputSchema = z.instanceof(Readable);\n\nexport type ObjectBodyOutput = z.infer<typeof objectBodyOutputSchema>;\n\n/**\n * Object schema\n */\nexport const objectSchema = z.object({\n contentType: z.string().nullable().optional(),\n size: z.number().nullable().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type ObjectSchema = z.infer<typeof objectSchema>;\n\n/**\n * Get object input\n */\nexport const getObjectInputSchema = z.string();\nexport type GetObjectInput = z.input<typeof getObjectInputSchema>;\n\n/**\n * Get object options schema\n */\nexport const getObjectOptionsDefaults = { disposition: \"inline\" } as const;\n\nexport const getObjectOptionsSchema = z.object({\n disposition: z.string().optional().default(getObjectOptionsDefaults.disposition),\n});\n\nexport type GetObjectOptions = z.input<typeof getObjectOptionsSchema>;\n\n/**\n * Get object URL input\n */\nexport const getObjectURLOptionsSchema = getObjectOptionsSchema.extend({\n expiresIn: z\n .number()\n .optional()\n .default(3600 * 24),\n});\n\nexport type GetObjectURLOptions = z.input<typeof getObjectURLOptionsSchema>;\n\n/**\n * Get object output\n */\nexport const getObjectOutputSchema = objectSchema.extend({\n body: objectBodyOutputSchema,\n});\n\nexport type GetObjectOutput = z.infer<typeof getObjectOutputSchema>;\n\n/**\n * Get object head input\n */\nexport const headObjectInputSchema = z.object({\n key: z.string(),\n});\n\nexport type HeadObjectInput = z.input<typeof headObjectInputSchema>;\n\n/**\n * Head object output\n */\nexport const headObjectOutputSchema = objectSchema;\n\nexport type HeadObjectOutput = z.infer<typeof headObjectOutputSchema>;\n\n/**\n * Put object URL input\n */\nexport const putObjectURLInputSchema = z.object({\n key: z.string(),\n contentType: z.string().nullable().optional(),\n size: z.number().nullable().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type PutObjectURLInput = z.input<typeof putObjectURLInputSchema>;\n\n/**\n * Put object URL input\n */\nexport const putObjectURLOptionsSchema = z.object({\n expiresIn: z.number().optional().default(3600),\n});\n\nexport type PutObjectURLOptions = z.input<typeof putObjectURLOptionsSchema>;\n\n/**\n * Put object input\n */\nexport const putObjectInputSchema = putObjectURLInputSchema.extend({\n body: objectBodyInputSchema,\n});\n\nexport type PutObjectInput = z.input<typeof putObjectInputSchema>;\n\n/**\n * Put object schema\n */\nexport const putObjectOutputSchema = objectSchema;\nexport type PutObjectOutput = z.infer<typeof putObjectOutputSchema>;\n"],"mappings":";;;;;;;AAMA,MAAa,wBAAwBA,IAAE,MAAM;CAC3CA,IAAE,QAAQ;CACVA,IAAE,WAAW,WAAW;CACxBA,IAAE,WAAW,OAAO;CACpBA,IAAE,WAAW,SAAS;CACvB,CAAC;;;;AAOF,MAAa,yBAAyBA,IAAE,WAAW,SAAS;;;;AAO5D,MAAa,eAAeA,IAAE,OAAO;CACnC,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC7C,MAAMA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CACtC,UAAUA,IAAE,OAAOA,IAAE,QAAQ,EAAEA,IAAE,QAAQ,CAAC,CAAC,UAAU;CACtD,CAAC;;;;AAOF,MAAa,uBAAuBA,IAAE,QAAQ;;;;AAM9C,MAAa,2BAA2B,EAAE,aAAa,UAAU;AAEjE,MAAa,yBAAyBA,IAAE,OAAO,EAC7C,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,yBAAyB,YAAY,EACjF,CAAC;;;;AAOF,MAAa,4BAA4B,uBAAuB,OAAO,EACrE,WAAWA,IACR,QAAQ,CACR,UAAU,CACV,QAAQ,OAAO,GAAG,EACtB,CAAC;;;;AAOF,MAAa,wBAAwB,aAAa,OAAO,EACvD,MAAM,wBACP,CAAC;;;;AAOF,MAAa,wBAAwBA,IAAE,OAAO,EAC5C,KAAKA,IAAE,QAAQ,EAChB,CAAC;;;;AAOF,MAAa,yBAAyB;;;;AAOtC,MAAa,0BAA0BA,IAAE,OAAO;CAC9C,KAAKA,IAAE,QAAQ;CACf,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC7C,MAAMA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CACtC,UAAUA,IAAE,OAAOA,IAAE,QAAQ,EAAEA,IAAE,QAAQ,CAAC,CAAC,UAAU;CACtD,CAAC;;;;AAOF,MAAa,4BAA4BA,IAAE,OAAO,EAChD,WAAWA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK,EAC/C,CAAC;;;;AAOF,MAAa,uBAAuB,wBAAwB,OAAO,EACjE,MAAM,uBACP,CAAC;;;;AAOF,MAAa,wBAAwB"}
|
package/dist/router/server.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RouterClient, registerRouterClient } from "../modules/router/handler/register.server.mjs";
|
|
2
1
|
import { createRPCCaller } from "../modules/router/handler/caller.server.mjs";
|
|
3
2
|
import { ProtectedRPCContext, RPCContext, createRPCContext } from "../modules/router/handler/context.server.mjs";
|
|
4
3
|
import { initRPC } from "../modules/router/handler/init.server.mjs";
|
|
4
|
+
import { RouterClient, registerRouterClient } from "../modules/router/handler/register.server.mjs";
|
|
5
5
|
import { handleRPCRoute } from "../modules/router/handler/route.server.mjs";
|
|
6
6
|
import { ServerError } from "../modules/router/lib/error.server.mjs";
|
|
7
7
|
import { HydrateClient, getQueryClient } from "../modules/router/lib/query-client.server.mjs";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { PrepareUploadInput, UploadClient, UploadFileRequest, UploadHooks, createUploadClient } from "../modules/storage/lib/upload.client.mjs";
|
|
1
2
|
import { Dropzone, DropzoneContent, DropzoneContentProps, DropzoneEmptyState, DropzoneEmptyStateProps, DropzoneProps } from "../modules/storage/components/dropzone.client.mjs";
|
|
2
3
|
import { DropzoneContext, useDropzoneContext } from "../modules/storage/components/dropzone-context.client.mjs";
|
|
4
|
+
import { StorageImage } from "../modules/storage/components/image.client.mjs";
|
|
3
5
|
import { ImageGrid, ImageGridSkeleton } from "../modules/storage/components/image-grid.client.mjs";
|
|
4
|
-
import {
|
|
6
|
+
import { UploadButton } from "../modules/storage/components/upload-button.client.mjs";
|
|
5
7
|
import { UploadZoneContext, UploadZoneContextValue, useUploadZone } from "../modules/storage/components/upload-zone-context.client.mjs";
|
|
6
8
|
import { UploadZone, UploadZoneProps } from "../modules/storage/components/upload-zone.client.mjs";
|
|
7
|
-
export { Dropzone, DropzoneContent, DropzoneContentProps, DropzoneContext, DropzoneEmptyState, DropzoneEmptyStateProps, DropzoneProps, ImageGrid, ImageGridSkeleton, PrepareUploadInput, UploadClient, UploadFileRequest, UploadHooks, UploadZone, UploadZoneContext, UploadZoneContextValue, UploadZoneProps, createUploadClient, useDropzoneContext, useUploadZone };
|
|
9
|
+
export { Dropzone, DropzoneContent, DropzoneContentProps, DropzoneContext, DropzoneEmptyState, DropzoneEmptyStateProps, DropzoneProps, ImageGrid, ImageGridSkeleton, PrepareUploadInput, StorageImage, UploadButton, UploadClient, UploadFileRequest, UploadHooks, UploadZone, UploadZoneContext, UploadZoneContextValue, UploadZoneProps, createUploadClient, useDropzoneContext, useUploadZone };
|
package/dist/storage/client.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DropzoneContext, useDropzoneContext } from "../modules/storage/components/dropzone-context.client.mjs";
|
|
2
2
|
import { Dropzone, DropzoneContent, DropzoneEmptyState } from "../modules/storage/components/dropzone.client.mjs";
|
|
3
|
+
import { StorageImage } from "../modules/storage/components/image.client.mjs";
|
|
3
4
|
import { UploadZoneContext, useUploadZone } from "../modules/storage/components/upload-zone-context.client.mjs";
|
|
4
5
|
import { ImageGrid, ImageGridSkeleton } from "../modules/storage/components/image-grid.client.mjs";
|
|
6
|
+
import { UploadButton } from "../modules/storage/components/upload-button.client.mjs";
|
|
5
7
|
import { UploadZone } from "../modules/storage/components/upload-zone.client.mjs";
|
|
6
|
-
import { createUploadClient } from "../modules/storage/lib/
|
|
8
|
+
import { createUploadClient } from "../modules/storage/lib/upload.client.mjs";
|
|
7
9
|
|
|
8
|
-
export { Dropzone, DropzoneContent, DropzoneContext, DropzoneEmptyState, ImageGrid, ImageGridSkeleton, UploadZone, UploadZoneContext, createUploadClient, useDropzoneContext, useUploadZone };
|
|
10
|
+
export { Dropzone, DropzoneContent, DropzoneContext, DropzoneEmptyState, ImageGrid, ImageGridSkeleton, StorageImage, UploadButton, UploadZone, UploadZoneContext, createUploadClient, useDropzoneContext, useUploadZone };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { Storage, StorageConfig } from "../modules/storage/lib/service.server.mjs";
|
|
2
|
+
import { createStorageRouteHandler } from "../modules/storage/lib/router-handlers.server.mjs";
|
|
3
|
+
import { StorageS3AdapterConfig, storageS3Adapter } from "../modules/storage/providers/adapters/s3.server.mjs";
|
|
4
|
+
import { StorageRouter, StorageRouterInputs, StorageRouterOutputs, createStorageProcedures } from "../modules/storage/lib/procedures.server.mjs";
|
|
5
|
+
export { Storage, StorageConfig, StorageRouter, StorageRouterInputs, StorageRouterOutputs, StorageS3AdapterConfig, createStorageProcedures, createStorageRouteHandler, storageS3Adapter };
|
package/dist/storage/server.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { createStorageProcedures } from "../modules/storage/lib/procedures.server.mjs";
|
|
2
|
+
import { createStorageRouteHandler } from "../modules/storage/lib/router-handlers.server.mjs";
|
|
3
|
+
import { Storage } from "../modules/storage/lib/service.server.mjs";
|
|
4
|
+
import { storageS3Adapter } from "../modules/storage/providers/adapters/s3.server.mjs";
|
|
4
5
|
|
|
5
|
-
export {
|
|
6
|
+
export { Storage, createStorageProcedures, createStorageRouteHandler, storageS3Adapter };
|
package/dist/storage.d.mts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { StorageProvider, storageProviders } from "./modules/storage/providers/lib/constants.mjs";
|
|
2
|
+
import { GetObjectInput, GetObjectOptions, GetObjectOutput, GetObjectURLOptions, HeadObjectInput, HeadObjectOutput, ObjectBodyInput, ObjectBodyOutput, ObjectSchema, PutObjectInput, PutObjectOutput, PutObjectURLInput, PutObjectURLOptions, getObjectInputSchema, getObjectOptionsDefaults, getObjectOptionsSchema, getObjectOutputSchema, getObjectURLOptionsSchema, headObjectInputSchema, headObjectOutputSchema, objectBodyInputSchema, objectBodyOutputSchema, objectSchema, putObjectInputSchema, putObjectOutputSchema, putObjectURLInputSchema, putObjectURLOptionsSchema } from "./modules/storage/providers/lib/validators.mjs";
|
|
3
|
+
import { StorageAdapter } from "./modules/storage/providers/lib/types.mjs";
|
|
4
|
+
import { storageAssetStatusEnum, storageAssetVisibilityEnum, storageAssets } from "./modules/storage/lib/schema.mjs";
|
|
5
|
+
import { ConfirmUploadInput, CreateStorageAssetInput, CreateStorageAssetSchema, GetAssetURLInput, GetAssetURLSchema, PresignUploadInput, PresignUploadOutput, SelectStorageAssetSchema, StorageAsset, StorageAssetVisibility, UpdateStorageAssetInput, UpdateStorageAssetSchema, UploadInput, confirmUploadInputSchema, createStorageAssetSchema, getAssetURLSchema, presignUploadInputSchema, presignUploadOutputSchema, selectStorageAssetSchema, storageAssetVisibilitySchema, updateStorageAssetSchema, uploadInputSchema } from "./modules/storage/lib/validators.mjs";
|
|
6
|
+
import { ImageDisposition, imageDispositions } from "./modules/storage/lib/constants.mjs";
|
|
7
|
+
import { getAssetURL, imageLoader, renderBytes } from "./modules/storage/lib/helpers.mjs";
|
|
8
|
+
import { StorageAdapterError, StorageAdapterErrorCode } from "./modules/storage/providers/lib/errors.mjs";
|
|
9
|
+
export { ConfirmUploadInput, CreateStorageAssetInput, CreateStorageAssetSchema, GetAssetURLInput, GetAssetURLSchema, GetObjectInput, GetObjectOptions, GetObjectOutput, GetObjectURLOptions, HeadObjectInput, HeadObjectOutput, ImageDisposition, ObjectBodyInput, ObjectBodyOutput, ObjectSchema, PresignUploadInput, PresignUploadOutput, PutObjectInput, PutObjectOutput, PutObjectURLInput, PutObjectURLOptions, SelectStorageAssetSchema, StorageAdapter, StorageAdapterError, StorageAdapterErrorCode, StorageAsset, StorageAssetVisibility, StorageProvider, UpdateStorageAssetInput, UpdateStorageAssetSchema, UploadInput, confirmUploadInputSchema, createStorageAssetSchema, getAssetURL, getAssetURLSchema, getObjectInputSchema, getObjectOptionsDefaults, getObjectOptionsSchema, getObjectOutputSchema, getObjectURLOptionsSchema, headObjectInputSchema, headObjectOutputSchema, imageDispositions, imageLoader, objectBodyInputSchema, objectBodyOutputSchema, objectSchema, presignUploadInputSchema, presignUploadOutputSchema, putObjectInputSchema, putObjectOutputSchema, putObjectURLInputSchema, putObjectURLOptionsSchema, renderBytes, selectStorageAssetSchema, storageAssetStatusEnum, storageAssetVisibilityEnum, storageAssetVisibilitySchema, storageAssets, storageProviders, updateStorageAssetSchema, uploadInputSchema };
|
package/dist/storage.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { imageDispositions } from "./modules/storage/lib/constants.mjs";
|
|
2
|
+
import { getAssetURL, imageLoader, renderBytes } from "./modules/storage/lib/helpers.mjs";
|
|
3
|
+
import { storageProviders } from "./modules/storage/providers/lib/constants.mjs";
|
|
4
|
+
import { storageAssetStatusEnum, storageAssetVisibilityEnum, storageAssets } from "./modules/storage/lib/schema.mjs";
|
|
5
|
+
import { getObjectInputSchema, getObjectOptionsDefaults, getObjectOptionsSchema, getObjectOutputSchema, getObjectURLOptionsSchema, headObjectInputSchema, headObjectOutputSchema, objectBodyInputSchema, objectBodyOutputSchema, objectSchema, putObjectInputSchema, putObjectOutputSchema, putObjectURLInputSchema, putObjectURLOptionsSchema } from "./modules/storage/providers/lib/validators.mjs";
|
|
6
|
+
import { confirmUploadInputSchema, createStorageAssetSchema, getAssetURLSchema, presignUploadInputSchema, presignUploadOutputSchema, selectStorageAssetSchema, storageAssetVisibilitySchema, updateStorageAssetSchema, uploadInputSchema } from "./modules/storage/lib/validators.mjs";
|
|
7
|
+
import { StorageAdapterError } from "./modules/storage/providers/lib/errors.mjs";
|
|
6
8
|
|
|
7
|
-
export {
|
|
9
|
+
export { StorageAdapterError, confirmUploadInputSchema, createStorageAssetSchema, getAssetURL, getAssetURLSchema, getObjectInputSchema, getObjectOptionsDefaults, getObjectOptionsSchema, getObjectOutputSchema, getObjectURLOptionsSchema, headObjectInputSchema, headObjectOutputSchema, imageDispositions, imageLoader, objectBodyInputSchema, objectBodyOutputSchema, objectSchema, presignUploadInputSchema, presignUploadOutputSchema, putObjectInputSchema, putObjectOutputSchema, putObjectURLInputSchema, putObjectURLOptionsSchema, renderBytes, selectStorageAssetSchema, storageAssetStatusEnum, storageAssetVisibilityEnum, storageAssetVisibilitySchema, storageAssets, storageProviders, updateStorageAssetSchema, uploadInputSchema };
|
package/package.json
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tulip-systems/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"devDependencies": {
|
|
8
|
+
"@types/markdown-it": "^14.1.2",
|
|
8
9
|
"@types/pg": "^8.16.0",
|
|
9
10
|
"@types/react": "19.2.14",
|
|
10
11
|
"@types/react-dom": "19.2.3",
|
|
12
|
+
"aws-sdk-client-mock": "^4.1.0",
|
|
13
|
+
"aws-sdk-client-mock-vitest": "^7.0.1",
|
|
11
14
|
"tailwindcss": "^4.2.0",
|
|
12
15
|
"tsdown": "^0.20.3",
|
|
13
16
|
"tw-animate-css": "^1.4.0",
|
|
14
17
|
"typescript": "5.9.3",
|
|
15
18
|
"vite": "^7.3.1",
|
|
19
|
+
"vitest": "^4.1.0",
|
|
16
20
|
"@tulip-systems/typescript-config": "0.0.0"
|
|
17
21
|
},
|
|
18
22
|
"dependencies": {
|
|
@@ -55,6 +59,7 @@
|
|
|
55
59
|
"@tiptap/html": "^3.20.0",
|
|
56
60
|
"@tiptap/pm": "^3.20.0",
|
|
57
61
|
"@tiptap/react": "^3.20.0",
|
|
62
|
+
"@tiptap/static-renderer": "^3.22.4",
|
|
58
63
|
"class-variance-authority": "^0.7.1",
|
|
59
64
|
"client-only": "^0.0.1",
|
|
60
65
|
"clsx": "^2.1.1",
|
|
@@ -65,6 +70,7 @@
|
|
|
65
70
|
"drizzle-zod": "^0.8.3",
|
|
66
71
|
"embla-carousel-react": "^8.6.0",
|
|
67
72
|
"lucide-react": "^0.575.0",
|
|
73
|
+
"markdown-it": "^14.1.1",
|
|
68
74
|
"motion": "^12.34.3",
|
|
69
75
|
"next-themes": "^0.4.6",
|
|
70
76
|
"radix-ui": "^1.4.3",
|
|
@@ -86,16 +92,16 @@
|
|
|
86
92
|
"zod": "^4.3.6"
|
|
87
93
|
},
|
|
88
94
|
"peerDependencies": {
|
|
89
|
-
"@better-auth/passkey": "^1.
|
|
90
|
-
"
|
|
95
|
+
"@better-auth/passkey": "^1.5.5",
|
|
96
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
97
|
+
"better-auth": "^1.5.5",
|
|
91
98
|
"next": "16.1.6",
|
|
92
99
|
"nuqs": "2.8.8",
|
|
93
100
|
"pg": "8.18.0",
|
|
94
101
|
"react": "19.2.4",
|
|
95
102
|
"react-dom": "19.2.4",
|
|
96
103
|
"recharts": "2.15.4",
|
|
97
|
-
"sharp": "^0.34.5"
|
|
98
|
-
"@tailwindcss/typography": "^0.5.19"
|
|
104
|
+
"sharp": "^0.34.5"
|
|
99
105
|
},
|
|
100
106
|
"publishConfig": {
|
|
101
107
|
"access": "public"
|
|
@@ -123,6 +129,12 @@
|
|
|
123
129
|
"./data-tables": "./dist/data-tables.mjs",
|
|
124
130
|
"./data-tables/client": "./dist/data-tables/client.mjs",
|
|
125
131
|
"./data-tables/server": "./dist/data-tables/server.mjs",
|
|
132
|
+
"./database": "./dist/database.mjs",
|
|
133
|
+
"./database/client": "./dist/database/client.mjs",
|
|
134
|
+
"./database/server": "./dist/database/server.mjs",
|
|
135
|
+
"./emails": "./dist/emails.mjs",
|
|
136
|
+
"./emails/client": "./dist/emails/client.mjs",
|
|
137
|
+
"./emails/server": "./dist/emails/server.mjs",
|
|
126
138
|
"./inline-edit": "./dist/inline-edit.mjs",
|
|
127
139
|
"./inline-edit/client": "./dist/inline-edit/client.mjs",
|
|
128
140
|
"./inline-edit/server": "./dist/inline-edit/server.mjs",
|
|
@@ -145,6 +157,7 @@
|
|
|
145
157
|
"lint": "biome check",
|
|
146
158
|
"format": "biome format --write",
|
|
147
159
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
160
|
+
"test": "vitest",
|
|
148
161
|
"ui:add": "pnpm dlx shadcn@latest add",
|
|
149
162
|
"email": "email dev --port 9090 --dir src/components/emails"
|
|
150
163
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
type Content,
|
|
5
|
+
type Editor as TiptapEditor,
|
|
6
|
+
type EditorOptions as TiptapEditorOptions,
|
|
7
|
+
useEditor,
|
|
8
|
+
} from "@tiptap/react";
|
|
4
9
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
10
|
import { createContext, type PropsWithChildren } from "react";
|
|
6
11
|
import { cn } from "@/lib/utils/cn";
|
|
@@ -45,6 +50,7 @@ export const editorVariants = cva("", {
|
|
|
45
50
|
* Editor context provider
|
|
46
51
|
*/
|
|
47
52
|
export type EditorProps = VariantProps<typeof editorVariants> &
|
|
53
|
+
Pick<TiptapEditorOptions["editorProps"], "attributes"> &
|
|
48
54
|
PropsWithChildren<{
|
|
49
55
|
value?: Content;
|
|
50
56
|
extensions?: Partial<EditorExtensionsConfig>;
|
|
@@ -63,6 +69,7 @@ export function Editor({
|
|
|
63
69
|
variant,
|
|
64
70
|
className,
|
|
65
71
|
children,
|
|
72
|
+
attributes,
|
|
66
73
|
}: EditorProps) {
|
|
67
74
|
const editor = useEditor({
|
|
68
75
|
extensions: editorExtensionsConfigToExtensions(extensions),
|
|
@@ -75,6 +82,7 @@ export function Editor({
|
|
|
75
82
|
editorProps: {
|
|
76
83
|
transformPastedHTML: (html) => html.replace(/<img.*?>/g, ""),
|
|
77
84
|
attributes: {
|
|
85
|
+
...attributes,
|
|
78
86
|
class: cn(
|
|
79
87
|
"editor-content text-sm max-w-full focus:outline-none",
|
|
80
88
|
editorProseVariants(),
|
|
@@ -10,17 +10,17 @@ import { collectImageIds, diffIds } from "./utils";
|
|
|
10
10
|
export interface FileHandlerOptions extends TiptapFileHandlerOptions {
|
|
11
11
|
/**
|
|
12
12
|
* Callback function invoked when a image reference is removed from the editor. Receives the node ID of the removed node.
|
|
13
|
-
* @type {(
|
|
13
|
+
* @type {(assetId: string) => void}
|
|
14
14
|
* @default undefined
|
|
15
15
|
**/
|
|
16
|
-
onReferenceRemoved?: (
|
|
16
|
+
onReferenceRemoved?: (assetId: string) => void;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Callback function invoked when a image reference is added to the editor. Receives the node ID of the added node.
|
|
20
|
-
* @type {(
|
|
20
|
+
* @type {(assetId: string) => void}
|
|
21
21
|
* @default undefined
|
|
22
22
|
**/
|
|
23
|
-
onReferenceAdded?: (
|
|
23
|
+
onReferenceAdded?: (assetId: string) => void;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
2
|
import { TextSelection } from "@tiptap/pm/state";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { UploadClient, UploadHooks } from "@/modules/storage/lib/upload.client";
|
|
4
|
+
import type { PresignUploadInput, StorageAsset } from "@/modules/storage/lib/validators";
|
|
5
5
|
import type { FileHandlerOptions } from "./extension";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Handle File Handler props
|
|
9
9
|
*/
|
|
10
10
|
type CreateFileHandlerUploadStrategyProps = {
|
|
11
|
-
variables: Pick<
|
|
11
|
+
variables: Pick<PresignUploadInput, "visibility" | "metadata">;
|
|
12
12
|
uploadClient: UploadClient;
|
|
13
13
|
uploadHooks?: UploadHooks;
|
|
14
14
|
allowedMimeTypes?: string[];
|
|
15
|
-
onUploadCompleted?: (
|
|
15
|
+
onUploadCompleted?: (asset: StorageAsset) => Promise<void> | void;
|
|
16
16
|
onUploadFailed?: (error: unknown) => Promise<void> | void;
|
|
17
17
|
};
|
|
18
18
|
|
|
@@ -44,7 +44,7 @@ export function createFileHandlerUploadStrategy({
|
|
|
44
44
|
* Create skeleton node
|
|
45
45
|
*/
|
|
46
46
|
const skeletonNode = editor.schema.nodes.skeleton?.create({
|
|
47
|
-
imageNodeId: input.
|
|
47
|
+
imageNodeId: input.uploadId,
|
|
48
48
|
width: 500,
|
|
49
49
|
height: 500,
|
|
50
50
|
});
|
|
@@ -53,7 +53,6 @@ export function createFileHandlerUploadStrategy({
|
|
|
53
53
|
* Insert skeleton node into the document
|
|
54
54
|
*/
|
|
55
55
|
if (skeletonNode) {
|
|
56
|
-
// editor.chain().insertContentAt(insertPos, skeletonNode).focus().run();
|
|
57
56
|
const tr = editor.state.tr.insert(insertPos, skeletonNode);
|
|
58
57
|
tr.setSelection(TextSelection.create(tr.doc, insertPos + skeletonNode.nodeSize));
|
|
59
58
|
tr.setMeta("addToHistory", false);
|
|
@@ -63,7 +62,7 @@ export function createFileHandlerUploadStrategy({
|
|
|
63
62
|
/**
|
|
64
63
|
* Upload the file
|
|
65
64
|
*/
|
|
66
|
-
const
|
|
65
|
+
const asset = await uploadClient.upload(input, uploadHooks);
|
|
67
66
|
|
|
68
67
|
/**
|
|
69
68
|
* Replace skeleton with image node
|
|
@@ -72,9 +71,9 @@ export function createFileHandlerUploadStrategy({
|
|
|
72
71
|
let replaced = false;
|
|
73
72
|
|
|
74
73
|
replacedTr.doc.descendants((node, pos) => {
|
|
75
|
-
if (node.type.name === "skeleton" && node.attrs?.imageNodeId === input.
|
|
74
|
+
if (node.type.name === "skeleton" && node.attrs?.imageNodeId === input.uploadId) {
|
|
76
75
|
const imageNode = imageType.create({
|
|
77
|
-
|
|
76
|
+
assetId: asset.id,
|
|
78
77
|
alt: file.name,
|
|
79
78
|
fileName: file.name,
|
|
80
79
|
width: node.attrs.width ?? 500,
|
|
@@ -92,7 +91,7 @@ export function createFileHandlerUploadStrategy({
|
|
|
92
91
|
// In case skeleton is not found, insert the image node at the original position
|
|
93
92
|
const tr = editor.state.tr;
|
|
94
93
|
const imageNode = imageType.create({
|
|
95
|
-
|
|
94
|
+
assetId: asset.id,
|
|
96
95
|
alt: file.name,
|
|
97
96
|
fileName: file.name,
|
|
98
97
|
width: 500,
|
|
@@ -101,31 +100,7 @@ export function createFileHandlerUploadStrategy({
|
|
|
101
100
|
editor.view.dispatch(tr);
|
|
102
101
|
}
|
|
103
102
|
|
|
104
|
-
|
|
105
|
-
// * Remove skeleton node from the document
|
|
106
|
-
// */
|
|
107
|
-
// const tr = editor.state.tr;
|
|
108
|
-
// tr.doc.descendants((node, pos) => {
|
|
109
|
-
// if (node.type.name === "skeleton" && node.attrs?.imageNodeId === input.id) {
|
|
110
|
-
// tr.delete(pos, pos + node.nodeSize);
|
|
111
|
-
// return false;
|
|
112
|
-
// }
|
|
113
|
-
// });
|
|
114
|
-
// editor.view.dispatch(tr);
|
|
115
|
-
|
|
116
|
-
// /**
|
|
117
|
-
// * Add image node to the document
|
|
118
|
-
// */
|
|
119
|
-
// const imageNode = imageType.create({
|
|
120
|
-
// nodeId: fileNode.id,
|
|
121
|
-
// alt: file.name,
|
|
122
|
-
// fileName: file.name,
|
|
123
|
-
// width: 500,
|
|
124
|
-
// });
|
|
125
|
-
// editor.commands.insertContentAt(insertPos, imageNode);
|
|
126
|
-
// // insertPos += imageNode.nodeSize - skeletonNode.nodeSize;
|
|
127
|
-
|
|
128
|
-
await onUploadCompleted?.(fileNode);
|
|
103
|
+
await onUploadCompleted?.(asset);
|
|
129
104
|
} catch (err) {
|
|
130
105
|
console.error("Upload error:", err);
|
|
131
106
|
|
|
@@ -134,7 +109,7 @@ export function createFileHandlerUploadStrategy({
|
|
|
134
109
|
*/
|
|
135
110
|
const tr = editor.state.tr;
|
|
136
111
|
tr.doc.descendants((node, pos) => {
|
|
137
|
-
if (node.type.name === "
|
|
112
|
+
if (node.type.name === "skeleton" && node.attrs?.imageNodeId === input.uploadId) {
|
|
138
113
|
tr.delete(pos, pos + node.nodeSize);
|
|
139
114
|
return false;
|
|
140
115
|
}
|
|
@@ -157,11 +132,11 @@ export function createFileHandlerUploadStrategy({
|
|
|
157
132
|
const startPos = editor.state.selection.anchor;
|
|
158
133
|
await handleUpload(editor, files, startPos);
|
|
159
134
|
},
|
|
160
|
-
onReferenceRemoved: async (
|
|
161
|
-
await uploadClient.
|
|
135
|
+
onReferenceRemoved: async (assetId) => {
|
|
136
|
+
await uploadClient.deleteAsset(assetId);
|
|
162
137
|
},
|
|
163
|
-
onReferenceAdded: async (
|
|
164
|
-
await uploadClient.
|
|
138
|
+
onReferenceAdded: async (assetId) => {
|
|
139
|
+
await uploadClient.restoreAsset(assetId);
|
|
165
140
|
},
|
|
166
141
|
};
|
|
167
142
|
}
|
|
@@ -18,7 +18,7 @@ export function collectImageIds(doc: Node): Map<string, number> {
|
|
|
18
18
|
doc.descendants((node) => {
|
|
19
19
|
if (node.type.name !== "image") return;
|
|
20
20
|
|
|
21
|
-
const id = node.attrs?.
|
|
21
|
+
const id = node.attrs?.assetId;
|
|
22
22
|
if (!id) return;
|
|
23
23
|
|
|
24
24
|
counts.set(id, (counts.get(id) ?? 0) + 1);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
Image as TiptapImage,
|
|
5
5
|
type ImageOptions as TiptapImageOptions,
|
|
6
6
|
} from "@tiptap/extension-image";
|
|
7
|
-
import {
|
|
7
|
+
import { getAssetURL } from "@/modules/storage/entry";
|
|
8
8
|
|
|
9
9
|
export interface ImageOptions extends TiptapImageOptions {}
|
|
10
10
|
|
|
@@ -13,15 +13,15 @@ export const Image = TiptapImage.extend<ImageOptions>({
|
|
|
13
13
|
addAttributes() {
|
|
14
14
|
return {
|
|
15
15
|
...this.parent?.(),
|
|
16
|
-
//
|
|
17
|
-
|
|
16
|
+
// asset id
|
|
17
|
+
assetId: {
|
|
18
18
|
default: null,
|
|
19
|
-
parseHTML: (el) => el.getAttribute("data-
|
|
19
|
+
parseHTML: (el) => el.getAttribute("data-asset-id"),
|
|
20
20
|
renderHTML: (attrs) => {
|
|
21
|
-
if (!attrs.
|
|
21
|
+
if (!attrs.assetId) return {};
|
|
22
22
|
return {
|
|
23
|
-
"data-
|
|
24
|
-
...(attrs.
|
|
23
|
+
"data-asset-id": attrs.assetId,
|
|
24
|
+
...(attrs.assetId && !attrs.isPending ? { src: getAssetURL(attrs.assetId) } : {}),
|
|
25
25
|
};
|
|
26
26
|
},
|
|
27
27
|
},
|
|
@@ -43,15 +43,15 @@ export const Image = TiptapImage.extend<ImageOptions>({
|
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
45
|
parseHTML() {
|
|
46
|
-
return [{ tag: "img[data-
|
|
46
|
+
return [{ tag: "img[data-asset-id]" }];
|
|
47
47
|
},
|
|
48
48
|
renderHTML({ HTMLAttributes }) {
|
|
49
49
|
const { src: _, ...attrs } = HTMLAttributes;
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const assetId = attrs.assetId as string | null;
|
|
52
52
|
const isPending = Boolean(attrs.isPending);
|
|
53
53
|
|
|
54
|
-
const src =
|
|
54
|
+
const src = assetId && !isPending ? getAssetURL(assetId) : null;
|
|
55
55
|
|
|
56
56
|
return ["img", { ...attrs, ...(src ? { src } : {}) }];
|
|
57
57
|
},
|
|
@@ -6,13 +6,14 @@ import Heading from "@tiptap/extension-heading";
|
|
|
6
6
|
import HorizontalRule from "@tiptap/extension-horizontal-rule";
|
|
7
7
|
import Italic from "@tiptap/extension-italic";
|
|
8
8
|
import Link from "@tiptap/extension-link";
|
|
9
|
-
import { BulletList, ListItem,
|
|
9
|
+
import { BulletList, ListItem, OrderedList } from "@tiptap/extension-list";
|
|
10
10
|
import Paragraph from "@tiptap/extension-paragraph";
|
|
11
11
|
import Strike from "@tiptap/extension-strike";
|
|
12
12
|
import Text from "@tiptap/extension-text";
|
|
13
13
|
import Underline from "@tiptap/extension-underline";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { generateJSON } from "@tiptap/html";
|
|
15
|
+
import { renderToHTMLString, renderToMarkdown } from "@tiptap/static-renderer";
|
|
16
|
+
import { markdownParser } from "@/lib/utils/markdown";
|
|
16
17
|
import type { EditorJSONContent } from "./types";
|
|
17
18
|
|
|
18
19
|
const EXTENSIONS_FOR_GENERATION = [
|
|
@@ -31,23 +32,39 @@ const EXTENSIONS_FOR_GENERATION = [
|
|
|
31
32
|
Link,
|
|
32
33
|
Strike,
|
|
33
34
|
Underline,
|
|
34
|
-
Dropcursor,
|
|
35
|
-
Gapcursor,
|
|
36
|
-
UndoRedo,
|
|
37
|
-
ListKeymap,
|
|
38
|
-
TrailingNode,
|
|
39
35
|
];
|
|
40
36
|
|
|
41
37
|
/**
|
|
42
|
-
* Convert
|
|
38
|
+
* Convert HTML to editor content
|
|
43
39
|
*/
|
|
44
40
|
export function convertHTMLToEditorContent(html: string): EditorJSONContent {
|
|
45
41
|
return generateJSON(html, EXTENSIONS_FOR_GENERATION);
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
/**
|
|
49
|
-
* Convert editor content
|
|
45
|
+
* Convert markdown to editor content
|
|
46
|
+
*/
|
|
47
|
+
export function convertMarkdownToEditorContent(markdown: string): EditorJSONContent {
|
|
48
|
+
const html = markdownParser.render(markdown);
|
|
49
|
+
return convertHTMLToEditorContent(html);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Convert editor content to HTML
|
|
50
54
|
*/
|
|
51
55
|
export function convertEditorContentToHTML(content: EditorJSONContent): string {
|
|
52
|
-
return
|
|
56
|
+
return renderToHTMLString({
|
|
57
|
+
content,
|
|
58
|
+
extensions: EXTENSIONS_FOR_GENERATION,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Convert editor content to markdown
|
|
64
|
+
*/
|
|
65
|
+
export function convertEditorContentToMarkdown(content: EditorJSONContent): string {
|
|
66
|
+
return renderToMarkdown({
|
|
67
|
+
content,
|
|
68
|
+
extensions: EXTENSIONS_FOR_GENERATION,
|
|
69
|
+
});
|
|
53
70
|
}
|
|
@@ -64,6 +64,7 @@ export function ComboboxDropdown<T extends ComboboxDropdownItem>({
|
|
|
64
64
|
<Popover open={open} onOpenChange={setOpen} modal={true}>
|
|
65
65
|
<PopoverTrigger asChild disabled={disabled}>
|
|
66
66
|
<Button
|
|
67
|
+
data-inline-input="combobox-dropdown"
|
|
67
68
|
variant="outline"
|
|
68
69
|
role="combobox"
|
|
69
70
|
aria-expanded={open}
|
|
@@ -48,7 +48,7 @@ export function Combobox<TValue>({
|
|
|
48
48
|
<Command className="overflow-auto bg-transparent text-foreground">
|
|
49
49
|
<PopoverAnchor asChild>
|
|
50
50
|
<CommandPrimitive.Input
|
|
51
|
-
data-input
|
|
51
|
+
data-inline-input="combobox"
|
|
52
52
|
value={value?.toString() ?? ""}
|
|
53
53
|
placeholder={placeholder}
|
|
54
54
|
disabled={disabled}
|