@tulip-systems/core 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/badge.d.mts +1 -1
- package/dist/components/ui/button-group.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- 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/ui/field.client.d.mts +1 -1
- package/dist/components/ui/item.d.mts +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/inline-edit/lib/variants.d.mts +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 @@
|
|
|
1
|
+
{"version":3,"file":"use-hotkeys.client.d.mts","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts"],"mappings":";;;;;AAMA;cAAa,iBAAA;;;;AAOb;;KAAY,4BAAA;EACV,QAAA,GAAW,IAAA;EACX,SAAA,GAAY,IAAA;EACZ,MAAA,GAAS,IAAA;EACT,QAAA,GAAW,IAAA;AAAA;;;;;;;;;iBAWG,yBAAA,CAA0B,KAAA,GAAO,4BAAA"}
|
|
@@ -1,27 +1,95 @@
|
|
|
1
1
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Inline input data attribute used to identify navigable cells in the data table.
|
|
6
|
+
*/
|
|
7
|
+
const INLINE_INPUT_ATTR = "data-inline-input";
|
|
8
|
+
/**
|
|
9
|
+
* Sets up hotkeys for navigating between inline-editable cells in a data table:
|
|
10
|
+
* - ArrowUp / ArrowDown: Move vertically to the next cell with an input in the same column.
|
|
11
|
+
* - ArrowLeft / ArrowRight: Move horizontally to the next cell with an input in the same row.
|
|
12
|
+
*
|
|
13
|
+
* The hotkeys only trigger when focused within a table that uses the "inline-data-table" scope,
|
|
14
|
+
* and they look for elements with the [data-inline-input] attribute to determine navigable cells.
|
|
15
|
+
*/
|
|
16
|
+
function useInlineDataTableHotkeys(props = {}) {
|
|
17
|
+
/**
|
|
18
|
+
* Move left hotkey handler
|
|
19
|
+
*/
|
|
20
|
+
useHotkeys(props.moveLeft ?? [], (e) => {
|
|
6
21
|
const currentCell = e.target?.closest("td");
|
|
7
|
-
(
|
|
22
|
+
if (!currentCell) return;
|
|
23
|
+
let cell = currentCell.previousElementSibling;
|
|
24
|
+
while (cell) {
|
|
25
|
+
const input = cell.querySelector(`[${INLINE_INPUT_ATTR}]`);
|
|
26
|
+
if (input) {
|
|
27
|
+
input.focus();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
cell = cell.previousElementSibling;
|
|
31
|
+
}
|
|
8
32
|
}, {
|
|
33
|
+
enabled: !!(props.moveLeft && props.moveLeft.length > 0),
|
|
9
34
|
scopes: "inline-data-table",
|
|
10
35
|
enableOnFormTags: true,
|
|
36
|
+
enableOnContentEditable: true,
|
|
11
37
|
preventDefault: true
|
|
12
38
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Move right hotkey handler
|
|
41
|
+
*/
|
|
42
|
+
useHotkeys(props.moveRight ?? [], (e) => {
|
|
43
|
+
const currentCell = e.target?.closest("td");
|
|
44
|
+
if (!currentCell) return;
|
|
45
|
+
let cell = currentCell.nextElementSibling;
|
|
46
|
+
while (cell) {
|
|
47
|
+
const input = cell.querySelector(`[${INLINE_INPUT_ATTR}]`);
|
|
48
|
+
if (input) {
|
|
49
|
+
input.focus();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
cell = cell.nextElementSibling;
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
enabled: !!(props.moveRight && props.moveRight.length > 0),
|
|
56
|
+
scopes: "inline-data-table",
|
|
57
|
+
enableOnFormTags: true,
|
|
58
|
+
enableOnContentEditable: true,
|
|
59
|
+
preventDefault: true
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Move up hotkey handler
|
|
63
|
+
*/
|
|
64
|
+
useHotkeys(props.moveUp ?? [], (e) => {
|
|
65
|
+
const currentCell = e.target?.closest("td");
|
|
66
|
+
if (!currentCell) return;
|
|
67
|
+
const nextRow = currentCell.closest("tr")?.previousElementSibling;
|
|
68
|
+
(nextRow ? nextRow.cells?.[currentCell.cellIndex]?.querySelector(`[${INLINE_INPUT_ATTR}]`) : null)?.focus();
|
|
69
|
+
}, {
|
|
70
|
+
enabled: !!(props.moveUp && props.moveUp.length > 0),
|
|
71
|
+
scopes: "inline-data-table",
|
|
72
|
+
enableOnFormTags: true,
|
|
73
|
+
enableOnContentEditable: true,
|
|
74
|
+
preventDefault: true
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Move down hotkey handler
|
|
78
|
+
*/
|
|
79
|
+
useHotkeys(props.moveDown ?? [], (e) => {
|
|
80
|
+
const currentCell = e.target?.closest("td");
|
|
81
|
+
if (!currentCell) return;
|
|
82
|
+
const nextRow = currentCell.closest("tr")?.nextElementSibling;
|
|
83
|
+
(nextRow ? nextRow.cells?.[currentCell.cellIndex]?.querySelector(`[${INLINE_INPUT_ATTR}]`) : null)?.focus();
|
|
18
84
|
}, {
|
|
85
|
+
enabled: !!(props.moveDown && props.moveDown.length > 0),
|
|
19
86
|
scopes: "inline-data-table",
|
|
20
87
|
enableOnFormTags: true,
|
|
88
|
+
enableOnContentEditable: true,
|
|
21
89
|
preventDefault: true
|
|
22
90
|
});
|
|
23
91
|
}
|
|
24
92
|
|
|
25
93
|
//#endregion
|
|
26
|
-
export { useInlineDataTableHotkeys };
|
|
94
|
+
export { INLINE_INPUT_ATTR, useInlineDataTableHotkeys };
|
|
27
95
|
//# sourceMappingURL=use-hotkeys.client.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-hotkeys.client.mjs","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts"],"sourcesContent":["import { useHotkeys } from \"react-hotkeys-hook\";\
|
|
1
|
+
{"version":3,"file":"use-hotkeys.client.mjs","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts"],"sourcesContent":["import { useHotkeys } from \"react-hotkeys-hook\";\nimport type { Keys } from \"react-hotkeys-hook/dist/types\";\n\n/**\n * Inline input data attribute used to identify navigable cells in the data table.\n */\nexport const INLINE_INPUT_ATTR = \"data-inline-input\";\n\n/**\n * Props for configuring the hotkeys used for navigating between inline-editable cells in a data table.\n * Each property corresponds to a direction of navigation and accepts an array of key combinations that trigger the navigation in that direction.\n * If a property is not provided or is an empty array, the corresponding navigation hotkeys will be disabled.\n */\nexport type InlineDataTableHotkeysConfig = {\n moveLeft?: Keys | undefined;\n moveRight?: Keys | undefined;\n moveUp?: Keys | undefined;\n moveDown?: Keys | undefined;\n};\n\n/**\n * Sets up hotkeys for navigating between inline-editable cells in a data table:\n * - ArrowUp / ArrowDown: Move vertically to the next cell with an input in the same column.\n * - ArrowLeft / ArrowRight: Move horizontally to the next cell with an input in the same row.\n *\n * The hotkeys only trigger when focused within a table that uses the \"inline-data-table\" scope,\n * and they look for elements with the [data-inline-input] attribute to determine navigable cells.\n */\nexport function useInlineDataTableHotkeys(props: InlineDataTableHotkeysConfig = {}) {\n /**\n * Move left hotkey handler\n */\n useHotkeys(\n props.moveLeft ?? [],\n (e) => {\n const currentCell = (e.target as HTMLElement)?.closest(\"td\");\n if (!currentCell) return;\n\n let cell = currentCell.previousElementSibling;\n\n while (cell) {\n const input = cell.querySelector(`[${INLINE_INPUT_ATTR}]`) as HTMLElement | null;\n if (input) {\n input.focus();\n return;\n }\n cell = cell.previousElementSibling;\n }\n },\n {\n enabled: !!(props.moveLeft && props.moveLeft.length > 0),\n scopes: \"inline-data-table\",\n enableOnFormTags: true,\n enableOnContentEditable: true,\n preventDefault: true,\n },\n );\n\n /**\n * Move right hotkey handler\n */\n useHotkeys(\n props.moveRight ?? [],\n (e) => {\n const currentCell = (e.target as HTMLElement)?.closest(\"td\");\n if (!currentCell) return;\n\n let cell = currentCell.nextElementSibling;\n\n while (cell) {\n const input = cell.querySelector(`[${INLINE_INPUT_ATTR}]`) as HTMLElement | null;\n if (input) {\n input.focus();\n return;\n }\n cell = cell.nextElementSibling;\n }\n },\n {\n enabled: !!(props.moveRight && props.moveRight.length > 0),\n scopes: \"inline-data-table\",\n enableOnFormTags: true,\n enableOnContentEditable: true,\n preventDefault: true,\n },\n );\n\n /**\n * Move up hotkey handler\n */\n useHotkeys(\n props.moveUp ?? [],\n (e) => {\n const currentCell = (e.target as HTMLElement)?.closest(\"td\") as HTMLTableCellElement | null;\n if (!currentCell) return;\n\n const currentRow = currentCell.closest(\"tr\");\n const nextRow = currentRow?.previousElementSibling;\n\n const nextInput = nextRow\n ? ((nextRow as HTMLTableRowElement).cells?.[currentCell.cellIndex]?.querySelector(\n `[${INLINE_INPUT_ATTR}]`,\n ) as HTMLElement | null)\n : null;\n\n nextInput?.focus();\n },\n {\n enabled: !!(props.moveUp && props.moveUp.length > 0),\n scopes: \"inline-data-table\",\n enableOnFormTags: true,\n enableOnContentEditable: true,\n preventDefault: true,\n },\n );\n\n /**\n * Move down hotkey handler\n */\n useHotkeys(\n props.moveDown ?? [],\n (e) => {\n const currentCell = (e.target as HTMLElement)?.closest(\"td\") as HTMLTableCellElement | null;\n if (!currentCell) return;\n\n const currentRow = currentCell.closest(\"tr\");\n const nextRow = currentRow?.nextElementSibling;\n\n const nextInput = nextRow\n ? ((nextRow as HTMLTableRowElement).cells?.[currentCell.cellIndex]?.querySelector(\n `[${INLINE_INPUT_ATTR}]`,\n ) as HTMLElement | null)\n : null;\n\n nextInput?.focus();\n },\n {\n enabled: !!(props.moveDown && props.moveDown.length > 0),\n scopes: \"inline-data-table\",\n enableOnFormTags: true,\n enableOnContentEditable: true,\n preventDefault: true,\n },\n );\n}\n"],"mappings":";;;;;;AAMA,MAAa,oBAAoB;;;;;;;;;AAsBjC,SAAgB,0BAA0B,QAAsC,EAAE,EAAE;;;;AAIlF,YACE,MAAM,YAAY,EAAE,GACnB,MAAM;EACL,MAAM,cAAe,EAAE,QAAwB,QAAQ,KAAK;AAC5D,MAAI,CAAC,YAAa;EAElB,IAAI,OAAO,YAAY;AAEvB,SAAO,MAAM;GACX,MAAM,QAAQ,KAAK,cAAc,IAAI,kBAAkB,GAAG;AAC1D,OAAI,OAAO;AACT,UAAM,OAAO;AACb;;AAEF,UAAO,KAAK;;IAGhB;EACE,SAAS,CAAC,EAAE,MAAM,YAAY,MAAM,SAAS,SAAS;EACtD,QAAQ;EACR,kBAAkB;EAClB,yBAAyB;EACzB,gBAAgB;EACjB,CACF;;;;AAKD,YACE,MAAM,aAAa,EAAE,GACpB,MAAM;EACL,MAAM,cAAe,EAAE,QAAwB,QAAQ,KAAK;AAC5D,MAAI,CAAC,YAAa;EAElB,IAAI,OAAO,YAAY;AAEvB,SAAO,MAAM;GACX,MAAM,QAAQ,KAAK,cAAc,IAAI,kBAAkB,GAAG;AAC1D,OAAI,OAAO;AACT,UAAM,OAAO;AACb;;AAEF,UAAO,KAAK;;IAGhB;EACE,SAAS,CAAC,EAAE,MAAM,aAAa,MAAM,UAAU,SAAS;EACxD,QAAQ;EACR,kBAAkB;EAClB,yBAAyB;EACzB,gBAAgB;EACjB,CACF;;;;AAKD,YACE,MAAM,UAAU,EAAE,GACjB,MAAM;EACL,MAAM,cAAe,EAAE,QAAwB,QAAQ,KAAK;AAC5D,MAAI,CAAC,YAAa;EAGlB,MAAM,UADa,YAAY,QAAQ,KAAK,EAChB;AAQ5B,GANkB,UACZ,QAAgC,QAAQ,YAAY,YAAY,cAChE,IAAI,kBAAkB,GACvB,GACD,OAEO,OAAO;IAEpB;EACE,SAAS,CAAC,EAAE,MAAM,UAAU,MAAM,OAAO,SAAS;EAClD,QAAQ;EACR,kBAAkB;EAClB,yBAAyB;EACzB,gBAAgB;EACjB,CACF;;;;AAKD,YACE,MAAM,YAAY,EAAE,GACnB,MAAM;EACL,MAAM,cAAe,EAAE,QAAwB,QAAQ,KAAK;AAC5D,MAAI,CAAC,YAAa;EAGlB,MAAM,UADa,YAAY,QAAQ,KAAK,EAChB;AAQ5B,GANkB,UACZ,QAAgC,QAAQ,YAAY,YAAY,cAChE,IAAI,kBAAkB,GACvB,GACD,OAEO,OAAO;IAEpB;EACE,SAAS,CAAC,EAAE,MAAM,YAAY,MAAM,SAAS,SAAS;EACtD,QAAQ;EACR,kBAAkB;EAClB,yBAAyB;EACzB,gBAAgB;EACjB,CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as drizzle_orm0 from "drizzle-orm";
|
|
2
1
|
import * as drizzle_orm_pg_core0 from "drizzle-orm/pg-core";
|
|
2
|
+
import * as drizzle_orm0 from "drizzle-orm";
|
|
3
3
|
|
|
4
|
-
//#region src/modules/
|
|
4
|
+
//#region src/modules/database/lib/helpers.d.ts
|
|
5
5
|
declare const generateDefaultUUID: () => string;
|
|
6
6
|
/**
|
|
7
7
|
* Base columns4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.mts","names":[],"sources":["../../../../src/modules/database/lib/helpers.ts"],"mappings":";;;;cAGa,mBAAA;;;;cAKA,WAAA;4GAWZ,oBAAA,CAAA,oBAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.mjs","names":["uuidv7"],"sources":["../../../../src/modules/database/lib/helpers.ts"],"sourcesContent":["import { timestamp, uuid } from \"drizzle-orm/pg-core\";\nimport { v7 as uuidv7 } from \"uuid\";\n\nexport const generateDefaultUUID = () => uuidv7();\n\n/**\n * Base columns4\n */\nexport const baseColumns = {\n // Primary key\n id: uuid()\n .primaryKey()\n .$defaultFn(() => generateDefaultUUID()),\n // Timestamps\n createdAt: timestamp().defaultNow().notNull(),\n updatedAt: timestamp()\n .defaultNow()\n .notNull()\n .$onUpdate(() => new Date()),\n};\n"],"mappings":";;;;AAGA,MAAa,4BAA4BA,IAAQ;;;;AAKjD,MAAa,cAAc;CAEzB,IAAI,MAAM,CACP,YAAY,CACZ,iBAAiB,qBAAqB,CAAC;CAE1C,WAAW,WAAW,CAAC,YAAY,CAAC,SAAS;CAC7C,WAAW,WAAW,CACnB,YAAY,CACZ,SAAS,CACT,gCAAgB,IAAI,MAAM,CAAC;CAC/B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TDatabaseSchema } from "./types.mjs";
|
|
2
|
+
import * as drizzle_orm_node_postgres0 from "drizzle-orm/node-postgres";
|
|
3
|
+
import { Pool } from "pg";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/database/lib/service.server.d.ts
|
|
6
|
+
type InitDatabaseProps<TSchema extends TDatabaseSchema> = {
|
|
7
|
+
schema: TSchema;
|
|
8
|
+
pool: Pool;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Create a Drizzle database client.
|
|
12
|
+
*/
|
|
13
|
+
declare function createDatabase<TSchema extends TDatabaseSchema>({
|
|
14
|
+
schema,
|
|
15
|
+
pool
|
|
16
|
+
}: InitDatabaseProps<TSchema>): drizzle_orm_node_postgres0.NodePgDatabase<TSchema> & {
|
|
17
|
+
$client: Pool;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Drizzle database client type returned by `Database.init()`.
|
|
21
|
+
*/
|
|
22
|
+
type Database<TSchema extends TDatabaseSchema> = ReturnType<typeof createDatabase<TSchema>>;
|
|
23
|
+
/**
|
|
24
|
+
* Database service namespace.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const db = Database.init<DatabaseSchema>({ schema, pool });
|
|
28
|
+
*/
|
|
29
|
+
declare const Database: {
|
|
30
|
+
init: typeof createDatabase;
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Database };
|
|
34
|
+
//# sourceMappingURL=service.server.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.server.d.mts","names":[],"sources":["../../../../src/modules/database/lib/service.server.ts"],"mappings":";;;;;KAIK,iBAAA,iBAAkC,eAAA;EACrC,MAAA,EAAQ,OAAA;EACR,IAAA,EAAM,IAAA;AAAA;;;;iBAMC,cAAA,iBAA+B,eAAA,CAAA,CAAA;EACtC,MAAA;EACA;AAAA,GACC,iBAAA,CAAkB,OAAA,IAAQ,0BAAA,CAAA,cAAA,CAAA,OAAA;;;;;;KAOjB,QAAA,iBAAyB,eAAA,IAAmB,UAAA,QAAkB,cAAA,CAAe,OAAA;;;;;;AAhB7E;cAwBC,QAAA;eAEZ,cAAA;AAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { drizzle } from "drizzle-orm/node-postgres";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/database/lib/service.server.ts
|
|
4
|
+
/**
|
|
5
|
+
* Create a Drizzle database client.
|
|
6
|
+
*/
|
|
7
|
+
function createDatabase({ schema, pool }) {
|
|
8
|
+
return drizzle({
|
|
9
|
+
client: pool,
|
|
10
|
+
schema,
|
|
11
|
+
casing: "snake_case"
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Database service namespace.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const db = Database.init<DatabaseSchema>({ schema, pool });
|
|
19
|
+
*/
|
|
20
|
+
const Database = { init: createDatabase };
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Database };
|
|
24
|
+
//# sourceMappingURL=service.server.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.server.mjs","names":[],"sources":["../../../../src/modules/database/lib/service.server.ts"],"sourcesContent":["import { drizzle } from \"drizzle-orm/node-postgres\";\nimport type { Pool } from \"pg\";\nimport type { TDatabaseSchema } from \"./types\";\n\ntype InitDatabaseProps<TSchema extends TDatabaseSchema> = {\n schema: TSchema;\n pool: Pool;\n};\n\n/**\n * Create a Drizzle database client.\n */\nfunction createDatabase<TSchema extends TDatabaseSchema>({\n schema,\n pool,\n}: InitDatabaseProps<TSchema>) {\n return drizzle({ client: pool, schema, casing: \"snake_case\" });\n}\n\n/**\n * Drizzle database client type returned by `Database.init()`.\n */\nexport type Database<TSchema extends TDatabaseSchema> = ReturnType<typeof createDatabase<TSchema>>;\n\n/**\n * Database service namespace.\n *\n * @example\n * const db = Database.init<DatabaseSchema>({ schema, pool });\n */\nexport const Database = {\n init: createDatabase,\n};\n"],"mappings":";;;;;;AAYA,SAAS,eAAgD,EACvD,QACA,QAC6B;AAC7B,QAAO,QAAQ;EAAE,QAAQ;EAAM;EAAQ,QAAQ;EAAc,CAAC;;;;;;;;AAchE,MAAa,WAAW,EACtB,MAAM,gBACP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../src/modules/database/lib/types.ts"],"mappings":";KAAY,eAAA,GAAkB,MAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "server-cli-only";
|
|
2
|
+
import { Resend } from "resend";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/emails/lib/service.server.d.ts
|
|
5
|
+
type InitEmailProps = {
|
|
6
|
+
key: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Create a Resend email client.
|
|
10
|
+
*/
|
|
11
|
+
declare function createEmail({
|
|
12
|
+
key
|
|
13
|
+
}: InitEmailProps): Resend;
|
|
14
|
+
/**
|
|
15
|
+
* Resend email client type returned by `Email.init()`.
|
|
16
|
+
*/
|
|
17
|
+
type Email = ReturnType<typeof createEmail>;
|
|
18
|
+
/**
|
|
19
|
+
* Email service namespace.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const email = Email.init({ key: env.RESEND_API_KEY });
|
|
23
|
+
*/
|
|
24
|
+
declare const Email: {
|
|
25
|
+
init: typeof createEmail;
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Email };
|
|
29
|
+
//# sourceMappingURL=service.server.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.server.d.mts","names":[],"sources":["../../../../src/modules/emails/lib/service.server.ts"],"mappings":";;;;KAIK,cAAA;EACH,GAAA;AAAA;;;;iBAMO,WAAA,CAAA;EAAc;AAAA,GAAO,cAAA,GAAc,MAAA;AANvC;;;AAAA,KAaO,KAAA,GAAQ,UAAA,QAAkB,WAAA;;;;;;;cAQzB,KAAA;eAEZ,WAAA;AAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "server-cli-only";
|
|
2
|
+
import { Resend } from "resend";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/emails/lib/service.server.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a Resend email client.
|
|
7
|
+
*/
|
|
8
|
+
function createEmail({ key }) {
|
|
9
|
+
return new Resend(key);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Email service namespace.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const email = Email.init({ key: env.RESEND_API_KEY });
|
|
16
|
+
*/
|
|
17
|
+
const Email = { init: createEmail };
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Email };
|
|
21
|
+
//# sourceMappingURL=service.server.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.server.mjs","names":[],"sources":["../../../../src/modules/emails/lib/service.server.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport { Resend } from \"resend\";\n\ntype InitEmailProps = {\n key: string;\n};\n\n/**\n * Create a Resend email client.\n */\nfunction createEmail({ key }: InitEmailProps) {\n return new Resend(key);\n}\n\n/**\n * Resend email client type returned by `Email.init()`.\n */\nexport type Email = ReturnType<typeof createEmail>;\n\n/**\n * Email service namespace.\n *\n * @example\n * const email = Email.init({ key: env.RESEND_API_KEY });\n */\nexport const Email = {\n init: createEmail,\n};\n"],"mappings":";;;;;;;AAWA,SAAS,YAAY,EAAE,OAAuB;AAC5C,QAAO,IAAI,OAAO,IAAI;;;;;;;;AAcxB,MAAa,QAAQ,EACnB,MAAM,aACP"}
|
|
@@ -40,7 +40,7 @@ function InlineDateInput({ initialValue, action, permission, variant, className,
|
|
|
40
40
|
...props,
|
|
41
41
|
className: cn("relative h-full", className),
|
|
42
42
|
children: [/* @__PURE__ */ jsx(Input, {
|
|
43
|
-
"data-input":
|
|
43
|
+
"data-inline-input": "date",
|
|
44
44
|
type: "string",
|
|
45
45
|
value: stringDate,
|
|
46
46
|
className: cn(inlineEditVariants({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\nconst isValidDate = (date: Date) => date instanceof Date && date.toString() !== \"Invalid Date\";\n\nexport function InlineDateInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n const [stringDate, setStringDate] = React.useState<string>(\n initialValue ? formatDate(initialValue) : \"\",\n );\n\n /**\n * Update string date when value changes\n */\n React.useEffect(() => {\n if (value) setStringDate(formatDate(value));\n }, [value]);\n\n return (\n <Popover>\n <div {...props} className={cn(\"relative h-full\", className)}>\n <Input\n data-input\n type=\"string\"\n value={stringDate}\n className={cn(inlineEditVariants({ variant, status }), inValid && \"text-destructive\")}\n disabled={!isAllowed}\n onChange={(e) => {\n setStringDate(e.target.value);\n const parsedDate = parseDate(e.target.value);\n\n if (!isValidDate(parsedDate)) {\n setInValid(true);\n setValue(undefined);\n } else {\n setInValid(false);\n setValue(parsedDate);\n }\n }}\n onBlur={(e) => {\n const parsedDate = parseDate(e.target.value);\n handleBlur(isValidDate(parsedDate) ? parsedDate : null);\n }}\n />\n\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n tabIndex={-1}\n disabled={!isAllowed}\n className={cn(\n \"absolute top-0 right-0 bottom-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n <CalendarIcon className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </div>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ?? undefined}\n defaultMonth={value ?? undefined}\n disabled={!isAllowed}\n onSelect={(selectedDate) => {\n if (!selectedDate) return;\n\n setStringDate(formatDate(selectedDate));\n\n handleChange(selectedDate ?? null);\n handleBlur(selectedDate ?? null);\n\n setInValid(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,cAAc,UAAgB,OAAO,OAAO,aAAa;AAC/D,MAAM,aAAa,UAAkB,IAAI,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AACnF,MAAM,eAAe,SAAe,gBAAgB,QAAQ,KAAK,UAAU,KAAK;AAEhF,SAAgB,gBAAkD,EAChE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,GAAG,SACsF;CACzF,MAAM,CAAC,SAAS,cAAc,MAAM,SAAkB,MAAM;CAE5D,MAAM,EAAE,OAAO,UAAU,cAAc,YAAY,QAAQ,cAAc,cAAc;EACrF;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;CAEF,MAAM,CAAC,YAAY,iBAAiB,MAAM,SACxC,eAAe,WAAW,aAAa,GAAG,GAC3C;;;;AAKD,OAAM,gBAAgB;AACpB,MAAI,MAAO,eAAc,WAAW,MAAM,CAAC;IAC1C,CAAC,MAAM,CAAC;AAEX,QACE,qBAAC,sBACC,qBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mBAAmB,UAAU;aACzD,oBAAC;GACC;
|
|
1
|
+
{"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\nconst isValidDate = (date: Date) => date instanceof Date && date.toString() !== \"Invalid Date\";\n\nexport function InlineDateInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n const [stringDate, setStringDate] = React.useState<string>(\n initialValue ? formatDate(initialValue) : \"\",\n );\n\n /**\n * Update string date when value changes\n */\n React.useEffect(() => {\n if (value) setStringDate(formatDate(value));\n }, [value]);\n\n return (\n <Popover>\n <div {...props} className={cn(\"relative h-full\", className)}>\n <Input\n data-inline-input=\"date\"\n type=\"string\"\n value={stringDate}\n className={cn(inlineEditVariants({ variant, status }), inValid && \"text-destructive\")}\n disabled={!isAllowed}\n onChange={(e) => {\n setStringDate(e.target.value);\n const parsedDate = parseDate(e.target.value);\n\n if (!isValidDate(parsedDate)) {\n setInValid(true);\n setValue(undefined);\n } else {\n setInValid(false);\n setValue(parsedDate);\n }\n }}\n onBlur={(e) => {\n const parsedDate = parseDate(e.target.value);\n handleBlur(isValidDate(parsedDate) ? parsedDate : null);\n }}\n />\n\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n tabIndex={-1}\n disabled={!isAllowed}\n className={cn(\n \"absolute top-0 right-0 bottom-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n <CalendarIcon className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </div>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ?? undefined}\n defaultMonth={value ?? undefined}\n disabled={!isAllowed}\n onSelect={(selectedDate) => {\n if (!selectedDate) return;\n\n setStringDate(formatDate(selectedDate));\n\n handleChange(selectedDate ?? null);\n handleBlur(selectedDate ?? null);\n\n setInValid(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,cAAc,UAAgB,OAAO,OAAO,aAAa;AAC/D,MAAM,aAAa,UAAkB,IAAI,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AACnF,MAAM,eAAe,SAAe,gBAAgB,QAAQ,KAAK,UAAU,KAAK;AAEhF,SAAgB,gBAAkD,EAChE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,GAAG,SACsF;CACzF,MAAM,CAAC,SAAS,cAAc,MAAM,SAAkB,MAAM;CAE5D,MAAM,EAAE,OAAO,UAAU,cAAc,YAAY,QAAQ,cAAc,cAAc;EACrF;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;CAEF,MAAM,CAAC,YAAY,iBAAiB,MAAM,SACxC,eAAe,WAAW,aAAa,GAAG,GAC3C;;;;AAKD,OAAM,gBAAgB;AACpB,MAAI,MAAO,eAAc,WAAW,MAAM,CAAC;IAC1C,CAAC,MAAM,CAAC;AAEX,QACE,qBAAC,sBACC,qBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mBAAmB,UAAU;aACzD,oBAAC;GACC,qBAAkB;GAClB,MAAK;GACL,OAAO;GACP,WAAW,GAAG,mBAAmB;IAAE;IAAS;IAAQ,CAAC,EAAE,WAAW,mBAAmB;GACrF,UAAU,CAAC;GACX,WAAW,MAAM;AACf,kBAAc,EAAE,OAAO,MAAM;IAC7B,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAE5C,QAAI,CAAC,YAAY,WAAW,EAAE;AAC5B,gBAAW,KAAK;AAChB,cAAS,OAAU;WACd;AACL,gBAAW,MAAM;AACjB,cAAS,WAAW;;;GAGxB,SAAS,MAAM;IACb,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAC5C,eAAW,YAAY,WAAW,GAAG,aAAa,KAAK;;IAEzD,EAEF,oBAAC;GAAe;aACd,oBAAC;IACC,SAAQ;IACR,UAAU;IACV,UAAU,CAAC;IACX,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;cAED,oBAAC,gBAAa,WAAU,YAAY;KAC7B;IACM;GACb,EAEN,oBAAC;EAAe,WAAU;YACxB,oBAACA;GACC,MAAK;GACL;GACA,UAAU,SAAS;GACnB,cAAc,SAAS;GACvB,UAAU,CAAC;GACX,WAAW,iBAAiB;AAC1B,QAAI,CAAC,aAAc;AAEnB,kBAAc,WAAW,aAAa,CAAC;AAEvC,iBAAa,gBAAgB,KAAK;AAClC,eAAW,gBAAgB,KAAK;AAEhC,eAAW,MAAM;;IAEnB;GACa,IACT"}
|
|
@@ -35,6 +35,7 @@ function InlineDatePicker({ initialValue, action, permission, variant, className
|
|
|
35
35
|
asChild: true,
|
|
36
36
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
37
37
|
...props,
|
|
38
|
+
"data-inline-input": "date-picker",
|
|
38
39
|
type: "button",
|
|
39
40
|
variant: "outline",
|
|
40
41
|
className: cn("w-full", inlineEditVariants({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar.client\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineEditDatePickerProps<Required>) {\n const [open, setOpen] = React.useState(false);\n\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Popover\n open={open}\n onOpenChange={(open) => {\n setOpen(open);\n if (!open && value) handleBlur(value);\n }}\n >\n <PopoverTrigger asChild>\n <Button\n {...props}\n type=\"button\"\n variant=\"outline\"\n className={cn(\"w-full\", inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? formatDate(value) : <span>Kies een datum</span>}\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ? new Date(value) : undefined}\n onSelect={(date) => handleChange(date ?? null)}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,iBAAmD,EACjE,cACA,QACA,YACA,SACA,WACA,UACA,gBACA,YACA,GAAG,SACmC;CACtC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAE7C,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,qBAAC;EACO;EACN,eAAe,SAAS;AACtB,WAAQ,KAAK;AACb,OAAI,CAAC,QAAQ,MAAO,YAAW,MAAM;;aAGvC,oBAAC;GAAe;aACd,qBAAC;IACC,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,WAAW,GAAG,UAAU,mBAAmB;KAAE;KAAS;KAAQ,CAAC,EAAE,UAAU;IAC3E,UAAU,YAAY,CAAC;eAEvB,oBAAC,gBAAa,WAAU,iBAAiB,EACxC,QAAQ,WAAW,MAAM,GAAG,oBAAC,oBAAK,mBAAqB;KACjD;IACM,EAEjB,oBAAC;GAAe,WAAU;aACxB,oBAACA;IACC,MAAK;IACL;IACA,UAAU,QAAQ,IAAI,KAAK,MAAM,GAAG;IACpC,WAAW,SAAS,aAAa,QAAQ,KAAK;KAC9C;IACa;GACT"}
|
|
1
|
+
{"version":3,"file":"date-picker.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar.client\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineEditDatePickerProps<Required>) {\n const [open, setOpen] = React.useState(false);\n\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Popover\n open={open}\n onOpenChange={(open) => {\n setOpen(open);\n if (!open && value) handleBlur(value);\n }}\n >\n <PopoverTrigger asChild>\n <Button\n {...props}\n data-inline-input=\"date-picker\"\n type=\"button\"\n variant=\"outline\"\n className={cn(\"w-full\", inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? formatDate(value) : <span>Kies een datum</span>}\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ? new Date(value) : undefined}\n onSelect={(date) => handleChange(date ?? null)}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,iBAAmD,EACjE,cACA,QACA,YACA,SACA,WACA,UACA,gBACA,YACA,GAAG,SACmC;CACtC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAE7C,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,qBAAC;EACO;EACN,eAAe,SAAS;AACtB,WAAQ,KAAK;AACb,OAAI,CAAC,QAAQ,MAAO,YAAW,MAAM;;aAGvC,oBAAC;GAAe;aACd,qBAAC;IACC,GAAI;IACJ,qBAAkB;IAClB,MAAK;IACL,SAAQ;IACR,WAAW,GAAG,UAAU,mBAAmB;KAAE;KAAS;KAAQ,CAAC,EAAE,UAAU;IAC3E,UAAU,YAAY,CAAC;eAEvB,oBAAC,gBAAa,WAAU,iBAAiB,EACxC,QAAQ,WAAW,MAAM,GAAG,oBAAC,oBAAK,mBAAqB;KACjD;IACM,EAEjB,oBAAC;GAAe,WAAU;aACxB,oBAACA;IACC,MAAK;IACL;IACA,UAAU,QAAQ,IAAI,KAAK,MAAM,GAAG;IACpC,WAAW,SAAS,aAAa,QAAQ,KAAK;KAC9C;IACa;GACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/date-time.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport type { ComponentProps } from \"react\";\nimport { DateTimeInput } from \"@/components/ui/input-date-time.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport function InlineDateTimeInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof DateTimeInput> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps) {\n const { value, handleChange, handleBlur, status, isAllowed } = useInlineEdit<\n string,\n Date,\n Required\n >({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) =>\n (value instanceof Date\n ? format(value, \"yyyy-MM-dd'T'HH:mm\")\n : typeof value === \"string\"\n ? value\n : undefined) as string,\n encode: (value) => (value ? new Date(value) : null) as Date,\n },\n });\n\n return (\n <DateTimeInput\n value={value ?? undefined}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n onValueChange={(date) => handleChange(date ?? null)}\n onValueBlur={(date) => handleBlur(date ?? null)}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,oBAAsD,EACpE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,UACA,GAAG,SAGsB;CACzB,MAAM,EAAE,OAAO,cAAc,YAAY,QAAQ,cAAc,cAI7D;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UACN,iBAAiB,OACd,OAAO,OAAO,qBAAqB,GACnC,OAAO,UAAU,WACf,QACA;GACR,SAAS,UAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;GAC/C;EACF,CAAC;AAEF,QACE,oBAAC;EACC,OAAO,SAAS;EAChB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACvB,gBAAgB,SAAS,aAAa,QAAQ,KAAK;EACnD,cAAc,SAAS,WAAW,QAAQ,KAAK;EAC/C,GAAI;GACJ"}
|
|
1
|
+
{"version":3,"file":"date-time.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/date-time.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport type { ComponentProps } from \"react\";\nimport { DateTimeInput } from \"@/components/ui/input-date-time.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport function InlineDateTimeInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof DateTimeInput> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps) {\n const { value, handleChange, handleBlur, status, isAllowed } = useInlineEdit<\n string,\n Date,\n Required\n >({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) =>\n (value instanceof Date\n ? format(value, \"yyyy-MM-dd'T'HH:mm\")\n : typeof value === \"string\"\n ? value\n : undefined) as string,\n encode: (value) => (value ? new Date(value) : null) as Date,\n },\n });\n\n return (\n <DateTimeInput\n data-inline-input=\"date-time\"\n value={value ?? undefined}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n onValueChange={(date) => handleChange(date ?? null)}\n onValueBlur={(date) => handleBlur(date ?? null)}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,oBAAsD,EACpE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,UACA,GAAG,SAGsB;CACzB,MAAM,EAAE,OAAO,cAAc,YAAY,QAAQ,cAAc,cAI7D;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UACN,iBAAiB,OACd,OAAO,OAAO,qBAAqB,GACnC,OAAO,UAAU,WACf,QACA;GACR,SAAS,UAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;GAC/C;EACF,CAAC;AAEF,QACE,oBAAC;EACC,qBAAkB;EAClB,OAAO,SAAS;EAChB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACvB,gBAAgB,SAAS,aAAa,QAAQ,KAAK;EACnD,cAAc,SAAS,WAAW,QAAQ,KAAK;EAC/C,GAAI;GACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Editor, type EditorProps } from \"@/components/editor/components/editor.client\";\nimport type { EditorJSONContent } from \"@/components/editor/lib/types\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport type InlineEditorProps<Required extends boolean = false> = useInlineEditOptions<\n EditorJSONContent,\n Required\n> &\n InlineEditVariantsProps &\n Omit<EditorProps, \"value\" | \"onUpdate\" | \"onBlur\" | \"variant\">;\n\nexport function InlineEditor<Required extends boolean = false>({\n initialValue,\n action,\n extensions,\n variant,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n children,\n}: InlineEditorProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Editor\n value={value}\n extensions={extensions}\n onUpdate={(value) => handleChange(value)}\n onBlur={(value) => handleBlur(value)}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n variant={variant}\n >\n {children}\n </Editor>\n );\n}\n"],"mappings":";;;;;;;;;AAeA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,SACA,UACA,YACA,gBACA,YACA,WACA,YAC8B;CAC9B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACQ;EACK;EACZ,WAAW,UAAU,aAAa,MAAM;EACxC,SAAS,UAAU,WAAW,MAAM;EACpC,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACd;
|
|
1
|
+
{"version":3,"file":"editor.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/editor.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Editor, type EditorProps } from \"@/components/editor/components/editor.client\";\nimport type { EditorJSONContent } from \"@/components/editor/lib/types\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport type InlineEditorProps<Required extends boolean = false> = useInlineEditOptions<\n EditorJSONContent,\n Required\n> &\n InlineEditVariantsProps &\n Omit<EditorProps, \"value\" | \"onUpdate\" | \"onBlur\" | \"variant\">;\n\nexport function InlineEditor<Required extends boolean = false>({\n initialValue,\n action,\n extensions,\n variant,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n children,\n}: InlineEditorProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Editor\n value={value}\n extensions={extensions}\n onUpdate={(value) => handleChange(value)}\n onBlur={(value) => handleBlur(value)}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n variant={variant}\n attributes={{\n \"data-inline-input\": \"editor\",\n }}\n >\n {children}\n </Editor>\n );\n}\n"],"mappings":";;;;;;;;;AAeA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,SACA,UACA,YACA,gBACA,YACA,WACA,YAC8B;CAC9B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACQ;EACK;EACZ,WAAW,UAAU,aAAa,MAAM;EACxC,SAAS,UAAU,WAAW,MAAM;EACpC,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACd;EACT,YAAY,EACV,qBAAqB,UACtB;EAEA;GACM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-recipient.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { type Contact, RecipientInput } from \"@/components/ui/input-recipient\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineRecipientInputProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof RecipientInput>,\n \"value\" | \"onChange\"\n> &\n useInlineEditOptions<string[], Required> &\n InlineEditVariantsProps & {\n contacts: Contact[];\n };\n\n/**\n * The inline edit recipient input component.\n */\nexport function InlineRecipientInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n disabled,\n contacts,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineRecipientInputProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <RecipientInput\n {...props}\n contacts={contacts}\n value={value ?? []}\n onChange={(newValue) => {\n handleChange(newValue);\n handleBlur(newValue);\n }}\n disabled={disabled || !isAllowed}\n className={cn(inlineEditVariants({ variant, status }), className)}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAgB,qBAAuD,EACrE,cACA,QACA,SACA,UACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACmC;CACtC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;
|
|
1
|
+
{"version":3,"file":"input-recipient.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-recipient.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { type Contact, RecipientInput } from \"@/components/ui/input-recipient\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineRecipientInputProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof RecipientInput>,\n \"value\" | \"onChange\"\n> &\n useInlineEditOptions<string[], Required> &\n InlineEditVariantsProps & {\n contacts: Contact[];\n };\n\n/**\n * The inline edit recipient input component.\n */\nexport function InlineRecipientInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n disabled,\n contacts,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineRecipientInputProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <RecipientInput\n {...props}\n data-inline-input=\"recipient\"\n contacts={contacts}\n value={value ?? []}\n onChange={(newValue) => {\n handleChange(newValue);\n handleBlur(newValue);\n }}\n disabled={disabled || !isAllowed}\n className={cn(inlineEditVariants({ variant, status }), className)}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAgB,qBAAuD,EACrE,cACA,QACA,SACA,UACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACmC;CACtC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,qBAAkB;EACR;EACV,OAAO,SAAS,EAAE;EAClB,WAAW,aAAa;AACtB,gBAAa,SAAS;AACtB,cAAW,SAAS;;EAEtB,UAAU,YAAY,CAAC;EACvB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;GACjE"}
|
|
@@ -32,6 +32,7 @@ function InlineStringInputToggle({ initialValue, action, disabled, permission, u
|
|
|
32
32
|
className: "relative",
|
|
33
33
|
children: [/* @__PURE__ */ jsx(Input, {
|
|
34
34
|
...props,
|
|
35
|
+
"data-inline-input": "input-toggle",
|
|
35
36
|
type: "text",
|
|
36
37
|
value: value ?? void 0,
|
|
37
38
|
disabled: isDisabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { type ComponentProps, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/entry\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\ntype InlineStringInputToggleProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<string, Required>;\n\nexport function InlineStringInputToggle<Required extends boolean>({\n initialValue,\n action,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineStringInputToggleProps<Required>) {\n const [enabled, setEnabled] = useState(!!initialValue);\n\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n function handleToggle() {\n setEnabled(!enabled);\n if (!enabled) return;\n\n handleBlur(null);\n }\n\n const isDisabled = !enabled || disabled || !isAllowed;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={isDisabled}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\"w-full border-border/70 hover:border-border\", className)}\n />\n\n <Button\n variant=\"ghost\"\n onClick={handleToggle}\n tabIndex={-1}\n className={cn(\n \"absolute top-0 right-0 bottom-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n {enabled ? <CheckIcon /> : <XIcon />}\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,wBAAkD,EAChE,cACA,QACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACsC;CACzC,MAAM,CAAC,SAAS,cAAc,SAAS,CAAC,CAAC,aAAa;CAEtD,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;CAEF,SAAS,eAAe;AACtB,aAAW,CAAC,QAAQ;AACpB,MAAI,CAAC,QAAS;AAEd,aAAW,KAAK;;CAGlB,MAAM,aAAa,CAAC,WAAW,YAAY,CAAC;AAE5C,QACE,qBAAC;EAAI,WAAU;aACb,oBAAC;GACC,GAAI;GACJ,MAAK;GACL,OAAO,SAAS;GAChB,UAAU;GACV,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACjE,WAAW,GAAG,+CAA+C,UAAU;IACvE,EAEF,oBAAC;GACC,SAAQ;GACR,SAAS;GACT,UAAU;GACV,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;aAEA,UAAU,oBAAC,cAAY,GAAG,oBAAC,UAAQ;IAC7B;GACL"}
|
|
1
|
+
{"version":3,"file":"input-toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { type ComponentProps, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/entry\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\ntype InlineStringInputToggleProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<string, Required>;\n\nexport function InlineStringInputToggle<Required extends boolean>({\n initialValue,\n action,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineStringInputToggleProps<Required>) {\n const [enabled, setEnabled] = useState(!!initialValue);\n\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n function handleToggle() {\n setEnabled(!enabled);\n if (!enabled) return;\n\n handleBlur(null);\n }\n\n const isDisabled = !enabled || disabled || !isAllowed;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n data-inline-input=\"input-toggle\"\n type=\"text\"\n value={value ?? undefined}\n disabled={isDisabled}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\"w-full border-border/70 hover:border-border\", className)}\n />\n\n <Button\n variant=\"ghost\"\n onClick={handleToggle}\n tabIndex={-1}\n className={cn(\n \"absolute top-0 right-0 bottom-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n {enabled ? <CheckIcon /> : <XIcon />}\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,wBAAkD,EAChE,cACA,QACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACsC;CACzC,MAAM,CAAC,SAAS,cAAc,SAAS,CAAC,CAAC,aAAa;CAEtD,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;CAEF,SAAS,eAAe;AACtB,aAAW,CAAC,QAAQ;AACpB,MAAI,CAAC,QAAS;AAEd,aAAW,KAAK;;CAGlB,MAAM,aAAa,CAAC,WAAW,YAAY,CAAC;AAE5C,QACE,qBAAC;EAAI,WAAU;aACb,oBAAC;GACC,GAAI;GACJ,qBAAkB;GAClB,MAAK;GACL,OAAO,SAAS;GAChB,UAAU;GACV,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACjE,WAAW,GAAG,+CAA+C,UAAU;IACvE,EAEF,oBAAC;GACC,SAAQ;GACR,SAAS;GACT,UAAU;GACV,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;aAEA,UAAU,oBAAC,cAAY,GAAG,oBAAC,UAAQ;IAC7B;GACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"mappings":";;;;;;;KAQK,oBAAA,6CAAiE,IAAA,CACpE,cAAA,QAAsB,KAAA,aAGtB,oBAAA,CAAqB,MAAA,EAAQ,QAAA,IAC7B,uBAAA;;;AAPiF;iBAYnE,iBAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,oBAAA,SAA6B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"input.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"mappings":";;;;;;;KAQK,oBAAA,6CAAiE,IAAA,CACpE,cAAA,QAAsB,KAAA,aAGtB,oBAAA,CAAqB,MAAA,EAAQ,QAAA,IAC7B,uBAAA;;;AAPiF;iBAYnE,iBAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,oBAAA,SAA6B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAqCzB,iBAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,oBAAA,SAA6B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAkCzB,kBAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,oBAAA,WAA4B,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -24,6 +24,7 @@ function InlineStringInput({ initialValue, action, variant, className, permissio
|
|
|
24
24
|
});
|
|
25
25
|
return /* @__PURE__ */ jsx(Input, {
|
|
26
26
|
...props,
|
|
27
|
+
"data-inline-input": "string",
|
|
27
28
|
type: "text",
|
|
28
29
|
value: value ?? void 0,
|
|
29
30
|
disabled: disabled || !isAllowed,
|
|
@@ -53,6 +54,7 @@ function InlineNumberInput({ initialValue, action, variant, className, permissio
|
|
|
53
54
|
});
|
|
54
55
|
return /* @__PURE__ */ jsx(Input, {
|
|
55
56
|
...props,
|
|
57
|
+
"data-inline-input": "number",
|
|
56
58
|
type: "number",
|
|
57
59
|
value: value ?? void 0,
|
|
58
60
|
disabled: disabled || !isAllowed,
|
|
@@ -81,6 +83,7 @@ function InlineDecimalInput({ initialValue, action, variant, className, permissi
|
|
|
81
83
|
});
|
|
82
84
|
return /* @__PURE__ */ jsx(Input, {
|
|
83
85
|
...props,
|
|
86
|
+
"data-inline-input": "decimal",
|
|
84
87
|
type: "number",
|
|
85
88
|
value: value ?? void 0,
|
|
86
89
|
disabled: disabled || !isAllowed,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditInputProps<TValue, Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<TValue, Required> &\n InlineEditVariantsProps;\n\n/**\n * The inline edit string input component.\n */\nexport function InlineStringInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n\n/**\n * The inline edit number input component.\n */\nconst parseValueAsNumber = (valueAsNumber: number): number | null =>\n !Number.isNaN(Number(valueAsNumber)) ? valueAsNumber : null;\n\nexport function InlineNumberInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<number, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"number\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(parseValueAsNumber(e.target.valueAsNumber))}\n onBlur={(e) => handleBlur(parseValueAsNumber(e.target.valueAsNumber))}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n\n/**\n * The inline edit decimal input component.\n */\nexport function InlineDecimalInput({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"number\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,kBAAoD,EAClE,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SACsC;CACzC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACjE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD;;;;;AAON,MAAM,sBAAsB,kBAC1B,CAAC,OAAO,MAAM,OAAO,cAAc,CAAC,GAAG,gBAAgB;AAEzD,SAAgB,kBAAoD,EAClE,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SACsC;CACzC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,mBAAmB,EAAE,OAAO,cAAc,CAAC;EACzE,SAAS,MAAM,WAAW,mBAAmB,EAAE,OAAO,cAAc,CAAC;EACrE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD;;;;;AAON,SAAgB,mBAAmB,EACjC,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SAC4B;CAC/B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACjE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD"}
|
|
1
|
+
{"version":3,"file":"input.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditInputProps<TValue, Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<TValue, Required> &\n InlineEditVariantsProps;\n\n/**\n * The inline edit string input component.\n */\nexport function InlineStringInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n data-inline-input=\"string\"\n type=\"text\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n\n/**\n * The inline edit number input component.\n */\nconst parseValueAsNumber = (valueAsNumber: number): number | null =>\n !Number.isNaN(Number(valueAsNumber)) ? valueAsNumber : null;\n\nexport function InlineNumberInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<number, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n data-inline-input=\"number\"\n type=\"number\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(parseValueAsNumber(e.target.valueAsNumber))}\n onBlur={(e) => handleBlur(parseValueAsNumber(e.target.valueAsNumber))}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n\n/**\n * The inline edit decimal input component.\n */\nexport function InlineDecimalInput({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n data-inline-input=\"decimal\"\n type=\"number\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,kBAAoD,EAClE,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SACsC;CACzC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,qBAAkB;EAClB,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACjE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD;;;;;AAON,MAAM,sBAAsB,kBAC1B,CAAC,OAAO,MAAM,OAAO,cAAc,CAAC,GAAG,gBAAgB;AAEzD,SAAgB,kBAAoD,EAClE,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SACsC;CACzC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,qBAAkB;EAClB,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,mBAAmB,EAAE,OAAO,cAAc,CAAC;EACzE,SAAS,MAAM,WAAW,mBAAmB,EAAE,OAAO,cAAc,CAAC;EACrE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD;;;;;AAON,SAAgB,mBAAmB,EACjC,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SAC4B;CAC/B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,qBAAkB;EAClB,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACjE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/select.client.tsx"],"mappings":";;;;;;;iBAegB,YAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,MAAA,IAAU,oBAAA,SAA6B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBA0BzD,mBAAA,CAAA;EACd,OAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,aAAA,IAAiB,uBAAA,GAAuB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"select.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/select.client.tsx"],"mappings":";;;;;;;iBAegB,YAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,MAAA,IAAU,oBAAA,SAA6B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBA0BzD,mBAAA,CAAA;EACd,OAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,aAAA,IAAiB,uBAAA,GAAuB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAYjD,mBAAA,CAAoB,KAAA,EAAO,cAAA,QAAsB,aAAA,IAAc,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAI/D,iBAAA,CAAkB,KAAA,EAAO,cAAA,QAAsB,WAAA,IAAY,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAI3D,gBAAA,CAAiB,KAAA,EAAO,cAAA,QAAsB,UAAA,IAAW,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/select.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select.client\";\nimport { useIndicator } from \"@/lib/entry.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport function InlineSelect<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof Select> & useInlineEditOptions<string, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Select\n {...props}\n disabled={disabled || !isAllowed}\n defaultValue={value ?? undefined}\n onValueChange={(value) => {\n handleChange(value ? value : null);\n handleBlur(value ? value : null);\n }}\n />\n );\n}\n\nexport function InlineSelectTrigger({\n variant,\n className,\n ...props\n}: ComponentProps<typeof SelectTrigger> & InlineEditVariantsProps) {\n const { status } = useIndicator();\n\n return (\n <SelectTrigger
|
|
1
|
+
{"version":3,"file":"select.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/select.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select.client\";\nimport { useIndicator } from \"@/lib/entry.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport function InlineSelect<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof Select> & useInlineEditOptions<string, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Select\n {...props}\n disabled={disabled || !isAllowed}\n defaultValue={value ?? undefined}\n onValueChange={(value) => {\n handleChange(value ? value : null);\n handleBlur(value ? value : null);\n }}\n />\n );\n}\n\nexport function InlineSelectTrigger({\n variant,\n className,\n ...props\n}: ComponentProps<typeof SelectTrigger> & InlineEditVariantsProps) {\n const { status } = useIndicator();\n\n return (\n <SelectTrigger\n {...props}\n data-inline-input=\"select\"\n className={cn(inlineEditVariants({ variant, status }), className)}\n />\n );\n}\n\nexport function InlineSelectContent(props: ComponentProps<typeof SelectContent>) {\n return <SelectContent {...props} />;\n}\n\nexport function InlineSelectValue(props: ComponentProps<typeof SelectValue>) {\n return <SelectValue {...props} />;\n}\n\nexport function InlineSelectItem(props: ComponentProps<typeof SelectItem>) {\n return <SelectItem {...props} />;\n}\n"],"mappings":";;;;;;;;;;AAeA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,gBACA,YACA,UACA,GAAG,SACsE;CACzE,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,UAAU,YAAY,CAAC;EACvB,cAAc,SAAS;EACvB,gBAAgB,UAAU;AACxB,gBAAa,QAAQ,QAAQ,KAAK;AAClC,cAAW,QAAQ,QAAQ,KAAK;;GAElC;;AAIN,SAAgB,oBAAoB,EAClC,SACA,WACA,GAAG,SAC8D;CACjE,MAAM,EAAE,WAAW,cAAc;AAEjC,QACE,oBAAC;EACC,GAAI;EACJ,qBAAkB;EAClB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;GACjE;;AAIN,SAAgB,oBAAoB,OAA6C;AAC/E,QAAO,oBAAC,iBAAc,GAAI,QAAS;;AAGrC,SAAgB,kBAAkB,OAA2C;AAC3E,QAAO,oBAAC,eAAY,GAAI,QAAS;;AAGnC,SAAgB,iBAAiB,OAA0C;AACzE,QAAO,oBAAC,cAAW,GAAI,QAAS"}
|
|
@@ -19,6 +19,7 @@ function InlineSwitch({ initialValue, action, permission, updateStrategy, isRequ
|
|
|
19
19
|
});
|
|
20
20
|
return /* @__PURE__ */ jsx(Switch, {
|
|
21
21
|
...props,
|
|
22
|
+
"data-inline-input": "switch",
|
|
22
23
|
disabled: disabled || !isAllowed,
|
|
23
24
|
defaultChecked: value ?? void 0,
|
|
24
25
|
onCheckedChange: (checked) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/switch.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Switch } from \"@/components/ui/switch.client\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport function InlineSwitch<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof Switch> & useInlineEditOptions<boolean, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Switch\n {...props}\n disabled={disabled || !isAllowed}\n defaultChecked={value ?? undefined}\n onCheckedChange={(checked) => {\n handleChange(checked ?? null);\n handleBlur(checked ?? null);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,gBACA,YACA,UACA,GAAG,SACuE;CAC1E,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,UAAU,YAAY,CAAC;EACvB,gBAAgB,SAAS;EACzB,kBAAkB,YAAY;AAC5B,gBAAa,WAAW,KAAK;AAC7B,cAAW,WAAW,KAAK;;GAE7B"}
|
|
1
|
+
{"version":3,"file":"switch.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/switch.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Switch } from \"@/components/ui/switch.client\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport function InlineSwitch<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof Switch> & useInlineEditOptions<boolean, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Switch\n {...props}\n data-inline-input=\"switch\"\n disabled={disabled || !isAllowed}\n defaultChecked={value ?? undefined}\n onCheckedChange={(checked) => {\n handleChange(checked ?? null);\n handleBlur(checked ?? null);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,gBACA,YACA,UACA,GAAG,SACuE;CAC1E,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,qBAAkB;EAClB,UAAU,YAAY,CAAC;EACvB,gBAAgB,SAAS;EACzB,kBAAkB,YAAY;AAC5B,gBAAa,WAAW,KAAK;AAC7B,cAAW,WAAW,KAAK;;GAE7B"}
|