@timeax/form-palette 0.0.4 → 0.0.6
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/{schema/adapter.d.ts → adapters.d.mts} +116 -13
- package/dist/adapters.d.ts +292 -0
- package/dist/adapters.js +13283 -0
- package/dist/adapters.js.map +1 -0
- package/dist/adapters.mjs +13269 -0
- package/dist/adapters.mjs.map +1 -0
- package/dist/index.d.mts +3828 -0
- package/dist/index.d.ts +3828 -15
- package/dist/index.js +43013 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42965 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +22 -7
- package/dist/adapters/axios.d.ts +0 -21
- package/dist/adapters/axios.d.ts.map +0 -1
- package/dist/adapters/axios.js +0 -74
- package/dist/adapters/axios.js.map +0 -1
- package/dist/adapters/index.d.ts +0 -35
- package/dist/adapters/index.d.ts.map +0 -1
- package/dist/adapters/index.js +0 -74
- package/dist/adapters/index.js.map +0 -1
- package/dist/adapters/inertia.d.ts +0 -24
- package/dist/adapters/inertia.d.ts.map +0 -1
- package/dist/adapters/inertia.js +0 -126
- package/dist/adapters/inertia.js.map +0 -1
- package/dist/core/adapter-registry.d.ts +0 -30
- package/dist/core/adapter-registry.d.ts.map +0 -1
- package/dist/core/adapter-registry.js +0 -69
- package/dist/core/adapter-registry.js.map +0 -1
- package/dist/core/bound/bind-host.d.ts +0 -13
- package/dist/core/bound/bind-host.d.ts.map +0 -1
- package/dist/core/bound/bind-host.js +0 -2
- package/dist/core/bound/bind-host.js.map +0 -1
- package/dist/core/bound/observe-bound-field.d.ts +0 -21
- package/dist/core/bound/observe-bound-field.d.ts.map +0 -1
- package/dist/core/bound/observe-bound-field.js +0 -116
- package/dist/core/bound/observe-bound-field.js.map +0 -1
- package/dist/core/bound/wait-for-bound-field.d.ts +0 -5
- package/dist/core/bound/wait-for-bound-field.d.ts.map +0 -1
- package/dist/core/bound/wait-for-bound-field.js +0 -35
- package/dist/core/bound/wait-for-bound-field.js.map +0 -1
- package/dist/core/context.d.ts +0 -19
- package/dist/core/context.d.ts.map +0 -1
- package/dist/core/context.js +0 -11
- package/dist/core/context.js.map +0 -1
- package/dist/core/core-provider.d.ts +0 -22
- package/dist/core/core-provider.d.ts.map +0 -1
- package/dist/core/core-provider.js +0 -663
- package/dist/core/core-provider.js.map +0 -1
- package/dist/core/core-root.d.ts +0 -26
- package/dist/core/core-root.d.ts.map +0 -1
- package/dist/core/core-root.js +0 -38
- package/dist/core/core-root.js.map +0 -1
- package/dist/core/core-shell.d.ts +0 -22
- package/dist/core/core-shell.d.ts.map +0 -1
- package/dist/core/core-shell.js +0 -8
- package/dist/core/core-shell.js.map +0 -1
- package/dist/core/errors/error-strip.d.ts +0 -34
- package/dist/core/errors/error-strip.d.ts.map +0 -1
- package/dist/core/errors/error-strip.js +0 -18
- package/dist/core/errors/error-strip.js.map +0 -1
- package/dist/core/errors/index.d.ts +0 -4
- package/dist/core/errors/index.d.ts.map +0 -1
- package/dist/core/errors/index.js +0 -4
- package/dist/core/errors/index.js.map +0 -1
- package/dist/core/errors/map-error-bag.d.ts +0 -24
- package/dist/core/errors/map-error-bag.d.ts.map +0 -1
- package/dist/core/errors/map-error-bag.js +0 -39
- package/dist/core/errors/map-error-bag.js.map +0 -1
- package/dist/core/errors/map-zod.d.ts +0 -18
- package/dist/core/errors/map-zod.d.ts.map +0 -1
- package/dist/core/errors/map-zod.js +0 -27
- package/dist/core/errors/map-zod.js.map +0 -1
- package/dist/core/hooks/use-button.d.ts +0 -73
- package/dist/core/hooks/use-button.d.ts.map +0 -1
- package/dist/core/hooks/use-button.js +0 -116
- package/dist/core/hooks/use-button.js.map +0 -1
- package/dist/core/hooks/use-core-context.d.ts +0 -9
- package/dist/core/hooks/use-core-context.d.ts.map +0 -1
- package/dist/core/hooks/use-core-context.js +0 -17
- package/dist/core/hooks/use-core-context.js.map +0 -1
- package/dist/core/hooks/use-core-utility.d.ts +0 -1
- package/dist/core/hooks/use-core-utility.d.ts.map +0 -1
- package/dist/core/hooks/use-core-utility.js +0 -2
- package/dist/core/hooks/use-core-utility.js.map +0 -1
- package/dist/core/hooks/use-core.d.ts +0 -9
- package/dist/core/hooks/use-core.d.ts.map +0 -1
- package/dist/core/hooks/use-core.js +0 -11
- package/dist/core/hooks/use-core.js.map +0 -1
- package/dist/core/hooks/use-field.d.ts +0 -141
- package/dist/core/hooks/use-field.d.ts.map +0 -1
- package/dist/core/hooks/use-field.js +0 -256
- package/dist/core/hooks/use-field.js.map +0 -1
- package/dist/core/hooks/use-optional-field.d.ts +0 -9
- package/dist/core/hooks/use-optional-field.d.ts.map +0 -1
- package/dist/core/hooks/use-optional-field.js +0 -146
- package/dist/core/hooks/use-optional-field.js.map +0 -1
- package/dist/core/index.d.ts +0 -11
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -11
- package/dist/core/index.js.map +0 -1
- package/dist/core/registry/binder-registry.d.ts +0 -38
- package/dist/core/registry/binder-registry.d.ts.map +0 -1
- package/dist/core/registry/binder-registry.js +0 -52
- package/dist/core/registry/binder-registry.js.map +0 -1
- package/dist/core/registry/field-registry.d.ts +0 -86
- package/dist/core/registry/field-registry.d.ts.map +0 -1
- package/dist/core/registry/field-registry.js +0 -173
- package/dist/core/registry/field-registry.js.map +0 -1
- package/dist/core/test.d.ts +0 -2
- package/dist/core/test.d.ts.map +0 -1
- package/dist/core/test.js +0 -9
- package/dist/core/test.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/input/index.d.ts +0 -3
- package/dist/input/index.d.ts.map +0 -1
- package/dist/input/index.js +0 -3
- package/dist/input/index.js.map +0 -1
- package/dist/input/input-field.d.ts +0 -15
- package/dist/input/input-field.d.ts.map +0 -1
- package/dist/input/input-field.js +0 -413
- package/dist/input/input-field.js.map +0 -1
- package/dist/input/input-layout-graph.d.ts +0 -77
- package/dist/input/input-layout-graph.d.ts.map +0 -1
- package/dist/input/input-layout-graph.js +0 -108
- package/dist/input/input-layout-graph.js.map +0 -1
- package/dist/input/input-props.d.ts +0 -128
- package/dist/input/input-props.d.ts.map +0 -1
- package/dist/input/input-props.js +0 -4
- package/dist/input/input-props.js.map +0 -1
- package/dist/lib/get-global-countries.d.ts +0 -3
- package/dist/lib/get-global-countries.d.ts.map +0 -1
- package/dist/lib/get-global-countries.js +0 -70
- package/dist/lib/get-global-countries.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -3
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -6
- package/dist/lib/utils.js.map +0 -1
- package/dist/presets/index.d.ts +0 -1
- package/dist/presets/index.d.ts.map +0 -1
- package/dist/presets/index.js +0 -2
- package/dist/presets/index.js.map +0 -1
- package/dist/presets/shadcn-preset.d.ts +0 -1
- package/dist/presets/shadcn-preset.d.ts.map +0 -1
- package/dist/presets/shadcn-preset.js +0 -2
- package/dist/presets/shadcn-preset.js.map +0 -1
- package/dist/presets/shadcn-variants/checkbox.d.ts +0 -212
- package/dist/presets/shadcn-variants/checkbox.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/checkbox.js +0 -315
- package/dist/presets/shadcn-variants/checkbox.js.map +0 -1
- package/dist/presets/shadcn-variants/chips.d.ts +0 -154
- package/dist/presets/shadcn-variants/chips.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/chips.js +0 -266
- package/dist/presets/shadcn-variants/chips.js.map +0 -1
- package/dist/presets/shadcn-variants/color.d.ts +0 -63
- package/dist/presets/shadcn-variants/color.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/color.js +0 -96
- package/dist/presets/shadcn-variants/color.js.map +0 -1
- package/dist/presets/shadcn-variants/custom.d.ts +0 -94
- package/dist/presets/shadcn-variants/custom.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/custom.js +0 -80
- package/dist/presets/shadcn-variants/custom.js.map +0 -1
- package/dist/presets/shadcn-variants/date.d.ts +0 -114
- package/dist/presets/shadcn-variants/date.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/date.js +0 -414
- package/dist/presets/shadcn-variants/date.js.map +0 -1
- package/dist/presets/shadcn-variants/file.d.ts +0 -79
- package/dist/presets/shadcn-variants/file.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/file.js +0 -289
- package/dist/presets/shadcn-variants/file.js.map +0 -1
- package/dist/presets/shadcn-variants/keyvalue.d.ts +0 -35
- package/dist/presets/shadcn-variants/keyvalue.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/keyvalue.js +0 -215
- package/dist/presets/shadcn-variants/keyvalue.js.map +0 -1
- package/dist/presets/shadcn-variants/multiselect.d.ts +0 -210
- package/dist/presets/shadcn-variants/multiselect.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/multiselect.js +0 -352
- package/dist/presets/shadcn-variants/multiselect.js.map +0 -1
- package/dist/presets/shadcn-variants/number.d.ts +0 -31
- package/dist/presets/shadcn-variants/number.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/number.js +0 -64
- package/dist/presets/shadcn-variants/number.js.map +0 -1
- package/dist/presets/shadcn-variants/password.d.ts +0 -195
- package/dist/presets/shadcn-variants/password.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/password.js +0 -296
- package/dist/presets/shadcn-variants/password.js.map +0 -1
- package/dist/presets/shadcn-variants/phone.d.ts +0 -69
- package/dist/presets/shadcn-variants/phone.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/phone.js +0 -308
- package/dist/presets/shadcn-variants/phone.js.map +0 -1
- package/dist/presets/shadcn-variants/radio.d.ts +0 -172
- package/dist/presets/shadcn-variants/radio.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/radio.js +0 -192
- package/dist/presets/shadcn-variants/radio.js.map +0 -1
- package/dist/presets/shadcn-variants/select.d.ts +0 -203
- package/dist/presets/shadcn-variants/select.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/select.js +0 -285
- package/dist/presets/shadcn-variants/select.js.map +0 -1
- package/dist/presets/shadcn-variants/slider.d.ts +0 -131
- package/dist/presets/shadcn-variants/slider.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/slider.js +0 -151
- package/dist/presets/shadcn-variants/slider.js.map +0 -1
- package/dist/presets/shadcn-variants/text.d.ts +0 -155
- package/dist/presets/shadcn-variants/text.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/text.js +0 -98
- package/dist/presets/shadcn-variants/text.js.map +0 -1
- package/dist/presets/shadcn-variants/textarea.d.ts +0 -18
- package/dist/presets/shadcn-variants/textarea.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/textarea.js +0 -24
- package/dist/presets/shadcn-variants/textarea.js.map +0 -1
- package/dist/presets/shadcn-variants/toggle.d.ts +0 -61
- package/dist/presets/shadcn-variants/toggle.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/toggle.js +0 -67
- package/dist/presets/shadcn-variants/toggle.js.map +0 -1
- package/dist/presets/shadcn-variants/treeselect.d.ts +0 -81
- package/dist/presets/shadcn-variants/treeselect.d.ts.map +0 -1
- package/dist/presets/shadcn-variants/treeselect.js +0 -317
- package/dist/presets/shadcn-variants/treeselect.js.map +0 -1
- package/dist/presets/ui/badge.d.ts +0 -10
- package/dist/presets/ui/badge.d.ts.map +0 -1
- package/dist/presets/ui/badge.js +0 -23
- package/dist/presets/ui/badge.js.map +0 -1
- package/dist/presets/ui/button.d.ts +0 -11
- package/dist/presets/ui/button.d.ts.map +0 -1
- package/dist/presets/ui/button.js +0 -34
- package/dist/presets/ui/button.js.map +0 -1
- package/dist/presets/ui/calendar.d.ts +0 -9
- package/dist/presets/ui/calendar.d.ts.map +0 -1
- package/dist/presets/ui/calendar.js +0 -76
- package/dist/presets/ui/calendar.js.map +0 -1
- package/dist/presets/ui/checkbox.d.ts +0 -18
- package/dist/presets/ui/checkbox.d.ts.map +0 -1
- package/dist/presets/ui/checkbox.js +0 -61
- package/dist/presets/ui/checkbox.js.map +0 -1
- package/dist/presets/ui/custom.d.ts +0 -1
- package/dist/presets/ui/custom.d.ts.map +0 -1
- package/dist/presets/ui/custom.js +0 -2
- package/dist/presets/ui/custom.js.map +0 -1
- package/dist/presets/ui/dialog.d.ts +0 -16
- package/dist/presets/ui/dialog.d.ts.map +0 -1
- package/dist/presets/ui/dialog.js +0 -36
- package/dist/presets/ui/dialog.js.map +0 -1
- package/dist/presets/ui/field.d.ts +0 -25
- package/dist/presets/ui/field.d.ts.map +0 -1
- package/dist/presets/ui/field.js +0 -76
- package/dist/presets/ui/field.js.map +0 -1
- package/dist/presets/ui/input-mask.d.ts +0 -34
- package/dist/presets/ui/input-mask.d.ts.map +0 -1
- package/dist/presets/ui/input-mask.js +0 -561
- package/dist/presets/ui/input-mask.js.map +0 -1
- package/dist/presets/ui/input-otp.d.ts +0 -12
- package/dist/presets/ui/input-otp.d.ts.map +0 -1
- package/dist/presets/ui/input-otp.js +0 -22
- package/dist/presets/ui/input-otp.js.map +0 -1
- package/dist/presets/ui/input.d.ts +0 -83
- package/dist/presets/ui/input.d.ts.map +0 -1
- package/dist/presets/ui/input.js +0 -436
- package/dist/presets/ui/input.js.map +0 -1
- package/dist/presets/ui/label.d.ts +0 -5
- package/dist/presets/ui/label.d.ts.map +0 -1
- package/dist/presets/ui/label.js +0 -8
- package/dist/presets/ui/label.js.map +0 -1
- package/dist/presets/ui/number.d.ts +0 -60
- package/dist/presets/ui/number.d.ts.map +0 -1
- package/dist/presets/ui/number.js +0 -1078
- package/dist/presets/ui/number.js.map +0 -1
- package/dist/presets/ui/popover.d.ts +0 -8
- package/dist/presets/ui/popover.d.ts.map +0 -1
- package/dist/presets/ui/popover.js +0 -17
- package/dist/presets/ui/popover.js.map +0 -1
- package/dist/presets/ui/radio-group.d.ts +0 -6
- package/dist/presets/ui/radio-group.d.ts.map +0 -1
- package/dist/presets/ui/radio-group.js +0 -12
- package/dist/presets/ui/radio-group.js.map +0 -1
- package/dist/presets/ui/scroll-area.d.ts +0 -6
- package/dist/presets/ui/scroll-area.d.ts.map +0 -1
- package/dist/presets/ui/scroll-area.js +0 -13
- package/dist/presets/ui/scroll-area.js.map +0 -1
- package/dist/presets/ui/select.d.ts +0 -21
- package/dist/presets/ui/select.d.ts.map +0 -1
- package/dist/presets/ui/select.js +0 -38
- package/dist/presets/ui/select.js.map +0 -1
- package/dist/presets/ui/separator.d.ts +0 -5
- package/dist/presets/ui/separator.d.ts.map +0 -1
- package/dist/presets/ui/separator.js +0 -9
- package/dist/presets/ui/separator.js.map +0 -1
- package/dist/presets/ui/slider.d.ts +0 -5
- package/dist/presets/ui/slider.d.ts.map +0 -1
- package/dist/presets/ui/slider.js +0 -14
- package/dist/presets/ui/slider.js.map +0 -1
- package/dist/presets/ui/switch.d.ts +0 -7
- package/dist/presets/ui/switch.d.ts.map +0 -1
- package/dist/presets/ui/switch.js +0 -9
- package/dist/presets/ui/switch.js.map +0 -1
- package/dist/presets/ui/textarea.d.ts +0 -76
- package/dist/presets/ui/textarea.d.ts.map +0 -1
- package/dist/presets/ui/textarea.js +0 -291
- package/dist/presets/ui/textarea.js.map +0 -1
- package/dist/presets/ui/time-dropdowns.d.ts +0 -58
- package/dist/presets/ui/time-dropdowns.d.ts.map +0 -1
- package/dist/presets/ui/time-dropdowns.js +0 -133
- package/dist/presets/ui/time-dropdowns.js.map +0 -1
- package/dist/schema/adapter.d.ts.map +0 -1
- package/dist/schema/adapter.js +0 -3
- package/dist/schema/adapter.js.map +0 -1
- package/dist/schema/core.d.ts +0 -329
- package/dist/schema/core.d.ts.map +0 -1
- package/dist/schema/core.js +0 -4
- package/dist/schema/core.js.map +0 -1
- package/dist/schema/field-map.d.ts +0 -1
- package/dist/schema/field-map.d.ts.map +0 -1
- package/dist/schema/field-map.js +0 -2
- package/dist/schema/field-map.js.map +0 -1
- package/dist/schema/field.d.ts +0 -191
- package/dist/schema/field.d.ts.map +0 -1
- package/dist/schema/field.js +0 -4
- package/dist/schema/field.js.map +0 -1
- package/dist/schema/index.d.ts +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js +0 -2
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/input-field.d.ts +0 -223
- package/dist/schema/input-field.d.ts.map +0 -1
- package/dist/schema/input-field.js +0 -3
- package/dist/schema/input-field.js.map +0 -1
- package/dist/schema/presets.d.ts +0 -1
- package/dist/schema/presets.d.ts.map +0 -1
- package/dist/schema/presets.js +0 -2
- package/dist/schema/presets.js.map +0 -1
- package/dist/schema/variant.d.ts +0 -176
- package/dist/schema/variant.d.ts.map +0 -1
- package/dist/schema/variant.js +0 -3
- package/dist/schema/variant.js.map +0 -1
- package/dist/variants/core/checkbox.d.ts +0 -15
- package/dist/variants/core/checkbox.d.ts.map +0 -1
- package/dist/variants/core/checkbox.js +0 -27
- package/dist/variants/core/checkbox.js.map +0 -1
- package/dist/variants/core/chips.d.ts +0 -3
- package/dist/variants/core/chips.d.ts.map +0 -1
- package/dist/variants/core/chips.js +0 -20
- package/dist/variants/core/chips.js.map +0 -1
- package/dist/variants/core/color.d.ts +0 -3
- package/dist/variants/core/color.d.ts.map +0 -1
- package/dist/variants/core/color.js +0 -14
- package/dist/variants/core/color.js.map +0 -1
- package/dist/variants/core/custom.d.ts +0 -11
- package/dist/variants/core/custom.d.ts.map +0 -1
- package/dist/variants/core/custom.js +0 -15
- package/dist/variants/core/custom.js.map +0 -1
- package/dist/variants/core/date.d.ts +0 -3
- package/dist/variants/core/date.d.ts.map +0 -1
- package/dist/variants/core/date.js +0 -20
- package/dist/variants/core/date.js.map +0 -1
- package/dist/variants/core/file.d.ts +0 -3
- package/dist/variants/core/file.d.ts.map +0 -1
- package/dist/variants/core/file.js +0 -6
- package/dist/variants/core/file.js.map +0 -1
- package/dist/variants/core/keyvalue.d.ts +0 -3
- package/dist/variants/core/keyvalue.d.ts.map +0 -1
- package/dist/variants/core/keyvalue.js +0 -9
- package/dist/variants/core/keyvalue.js.map +0 -1
- package/dist/variants/core/multiselect.d.ts +0 -11
- package/dist/variants/core/multiselect.d.ts.map +0 -1
- package/dist/variants/core/multiselect.js +0 -15
- package/dist/variants/core/multiselect.js.map +0 -1
- package/dist/variants/core/number.d.ts +0 -38
- package/dist/variants/core/number.d.ts.map +0 -1
- package/dist/variants/core/number.js +0 -62
- package/dist/variants/core/number.js.map +0 -1
- package/dist/variants/core/password.d.ts +0 -11
- package/dist/variants/core/password.d.ts.map +0 -1
- package/dist/variants/core/password.js +0 -29
- package/dist/variants/core/password.js.map +0 -1
- package/dist/variants/core/phone.d.ts +0 -3
- package/dist/variants/core/phone.d.ts.map +0 -1
- package/dist/variants/core/phone.js +0 -14
- package/dist/variants/core/phone.js.map +0 -1
- package/dist/variants/core/radio.d.ts +0 -8
- package/dist/variants/core/radio.d.ts.map +0 -1
- package/dist/variants/core/radio.js +0 -34
- package/dist/variants/core/radio.js.map +0 -1
- package/dist/variants/core/select.d.ts +0 -5
- package/dist/variants/core/select.d.ts.map +0 -1
- package/dist/variants/core/select.js +0 -11
- package/dist/variants/core/select.js.map +0 -1
- package/dist/variants/core/slider.d.ts +0 -19
- package/dist/variants/core/slider.d.ts.map +0 -1
- package/dist/variants/core/slider.js +0 -36
- package/dist/variants/core/slider.js.map +0 -1
- package/dist/variants/core/text.d.ts +0 -38
- package/dist/variants/core/text.d.ts.map +0 -1
- package/dist/variants/core/text.js +0 -62
- package/dist/variants/core/text.js.map +0 -1
- package/dist/variants/core/textarea.d.ts +0 -3
- package/dist/variants/core/textarea.d.ts.map +0 -1
- package/dist/variants/core/textarea.js +0 -20
- package/dist/variants/core/textarea.js.map +0 -1
- package/dist/variants/core/toggle.d.ts +0 -6
- package/dist/variants/core/toggle.d.ts.map +0 -1
- package/dist/variants/core/toggle.js +0 -41
- package/dist/variants/core/toggle.js.map +0 -1
- package/dist/variants/core/treeselect.d.ts +0 -4
- package/dist/variants/core/treeselect.d.ts.map +0 -1
- package/dist/variants/core/treeselect.js +0 -7
- package/dist/variants/core/treeselect.js.map +0 -1
- package/dist/variants/helpers/selection-summary.d.ts +0 -24
- package/dist/variants/helpers/selection-summary.d.ts.map +0 -1
- package/dist/variants/helpers/selection-summary.js +0 -105
- package/dist/variants/helpers/selection-summary.js.map +0 -1
- package/dist/variants/index.d.ts +0 -16
- package/dist/variants/index.d.ts.map +0 -1
- package/dist/variants/index.js +0 -55
- package/dist/variants/index.js.map +0 -1
- package/dist/variants/registry.d.ts +0 -19
- package/dist/variants/registry.d.ts.map +0 -1
- package/dist/variants/registry.js +0 -29
- package/dist/variants/registry.js.map +0 -1
- package/dist/variants/select-shared.d.ts +0 -1
- package/dist/variants/select-shared.d.ts.map +0 -1
- package/dist/variants/select-shared.js +0 -2
- package/dist/variants/select-shared.js.map +0 -1
- package/dist/variants/shared.d.ts +0 -107
- package/dist/variants/shared.d.ts.map +0 -1
- package/dist/variants/shared.js +0 -3
- package/dist/variants/shared.js.map +0 -1
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { Page } from './../../../../node_modules/@inertiajs/core/types/types.d';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* HTTP methods supported by the core adapter layer.
|
|
3
6
|
*
|
|
4
7
|
* This matches the legacy Method union from the old types.ts.
|
|
5
8
|
*/
|
|
6
|
-
|
|
9
|
+
type Method = 'post' | 'get' | 'delete' | 'put' | 'patch';
|
|
7
10
|
/**
|
|
8
11
|
* Lifecycle callbacks used by adapters to report events back to the core.
|
|
9
12
|
*
|
|
10
13
|
* @template Ok Type of the "successful" response payload (e.g. AxiosResponse).
|
|
11
14
|
* @template Err Type of the "error" payload (e.g. AxiosError, unknown).
|
|
12
15
|
*/
|
|
13
|
-
|
|
16
|
+
interface AdapterCallbacks<Ok = unknown, Err = unknown> {
|
|
14
17
|
/**
|
|
15
18
|
* Called when the underlying request completes successfully.
|
|
16
19
|
* The adapter decides what "success" means (HTTP 2xx, no exception, etc.).
|
|
@@ -45,7 +48,7 @@ export interface AdapterCallbacks<Ok = unknown, Err = unknown> {
|
|
|
45
48
|
*
|
|
46
49
|
* @template Ok Type of the "successful" response payload.
|
|
47
50
|
*/
|
|
48
|
-
|
|
51
|
+
interface AdapterResult<Ok = unknown> {
|
|
49
52
|
/**
|
|
50
53
|
* Fire-and-forget trigger.
|
|
51
54
|
*
|
|
@@ -85,7 +88,7 @@ export interface AdapterResult<Ok = unknown> {
|
|
|
85
88
|
* @template Ok Type of the "successful" response payload.
|
|
86
89
|
* @template Err Type of the "error" payload.
|
|
87
90
|
*/
|
|
88
|
-
|
|
91
|
+
interface AdapterConfig<Body = unknown, Ok = unknown, Err = unknown> {
|
|
89
92
|
/**
|
|
90
93
|
* HTTP method / intent used by the adapter.
|
|
91
94
|
*/
|
|
@@ -124,7 +127,7 @@ export interface AdapterConfig<Body = unknown, Ok = unknown, Err = unknown> {
|
|
|
124
127
|
* @template Ok Type of the "successful" response payload.
|
|
125
128
|
* @template Err Type of the "error" payload.
|
|
126
129
|
*/
|
|
127
|
-
|
|
130
|
+
type AdapterFactory<Body = unknown, Ok = unknown, Err = unknown> = (config: AdapterConfig<Body, Ok, Err>) => AdapterResult<Ok>;
|
|
128
131
|
/**
|
|
129
132
|
* Registry of adapter flavours.
|
|
130
133
|
*
|
|
@@ -136,7 +139,7 @@ export type AdapterFactory<Body = unknown, Ok = unknown, Err = unknown> = (confi
|
|
|
136
139
|
* Hosts can extend this interface via module augmentation to add
|
|
137
140
|
* their own adapter flavours (e.g. 'axios', 'inertia', ...).
|
|
138
141
|
*/
|
|
139
|
-
|
|
142
|
+
interface Adapters {
|
|
140
143
|
local: {
|
|
141
144
|
/**
|
|
142
145
|
* Type of the value produced by adapter.send() for this adapter flavour.
|
|
@@ -155,22 +158,22 @@ export interface Adapters {
|
|
|
155
158
|
*
|
|
156
159
|
* Hosts can extend this union by augmenting the Adapters interface.
|
|
157
160
|
*/
|
|
158
|
-
|
|
161
|
+
type AdapterKey = keyof Adapters;
|
|
159
162
|
/**
|
|
160
163
|
* Helper: given an adapter key K, get its "ok" payload type.
|
|
161
164
|
*/
|
|
162
|
-
|
|
165
|
+
type AdapterOk<K extends AdapterKey> = Adapters[K]['ok'];
|
|
163
166
|
/**
|
|
164
167
|
* Helper: given an adapter key K, get its "error" payload type.
|
|
165
168
|
*/
|
|
166
|
-
|
|
169
|
+
type AdapterError<K extends AdapterKey> = Adapters[K]['err'];
|
|
167
170
|
/**
|
|
168
171
|
* Helper: what CoreProps.onSubmitted receives for adapter K.
|
|
169
172
|
*
|
|
170
173
|
* For now, this is the same as AdapterOk<K>. If a host wants a different
|
|
171
174
|
* shape, they can wrap/transform in their own components.
|
|
172
175
|
*/
|
|
173
|
-
|
|
176
|
+
type AdapterSubmit<K extends AdapterKey> = AdapterOk<K>;
|
|
174
177
|
/**
|
|
175
178
|
* AdapterConfig specialised for a named adapter key K, using the
|
|
176
179
|
* registry's ok/err types for that key.
|
|
@@ -178,12 +181,112 @@ export type AdapterSubmit<K extends AdapterKey> = AdapterOk<K>;
|
|
|
178
181
|
* @template K Adapter key.
|
|
179
182
|
* @template Body Outbound payload type.
|
|
180
183
|
*/
|
|
181
|
-
|
|
184
|
+
type NamedAdapterConfig<K extends AdapterKey, Body = unknown> = AdapterConfig<Body, AdapterOk<K>, AdapterError<K>>;
|
|
182
185
|
/**
|
|
183
186
|
* AdapterFactory specialised for a named adapter key K.
|
|
184
187
|
*
|
|
185
188
|
* @template K Adapter key.
|
|
186
189
|
* @template Body Outbound payload type.
|
|
187
190
|
*/
|
|
188
|
-
|
|
189
|
-
|
|
191
|
+
type NamedAdapterFactory<K extends AdapterKey, Body = unknown> = (config: NamedAdapterConfig<K, Body>) => AdapterResult<AdapterOk<K>>;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Built-in 'local' adapter.
|
|
195
|
+
*
|
|
196
|
+
* Semantics:
|
|
197
|
+
* - send(options?) resolves to `{ data: Body }`
|
|
198
|
+
* - submit/run do nothing by default (no side effects)
|
|
199
|
+
*
|
|
200
|
+
* The core will typically call onSubmitted with the result of send().
|
|
201
|
+
*/
|
|
202
|
+
declare const localAdapter: NamedAdapterFactory<"local", any>;
|
|
203
|
+
/**
|
|
204
|
+
* Register or override an adapter factory for a given key.
|
|
205
|
+
*
|
|
206
|
+
* Hosts can call this at bootstrap time, e.g.:
|
|
207
|
+
*
|
|
208
|
+
* registerAdapter<'axios'>('axios', axiosAdapter);
|
|
209
|
+
*/
|
|
210
|
+
declare function registerAdapter<K extends AdapterKey, Body = any>(key: K, factory: NamedAdapterFactory<K, Body>): void;
|
|
211
|
+
/**
|
|
212
|
+
* Lookup an adapter factory by key.
|
|
213
|
+
*
|
|
214
|
+
* If no adapter is found for the given key, this returns undefined.
|
|
215
|
+
*/
|
|
216
|
+
declare function getAdapter<K extends AdapterKey>(key: K): NamedAdapterFactory<K, any> | undefined;
|
|
217
|
+
/**
|
|
218
|
+
* Check whether an adapter is registered for the given key.
|
|
219
|
+
*/
|
|
220
|
+
declare function hasAdapter(key: AdapterKey): boolean;
|
|
221
|
+
|
|
222
|
+
declare const createAxiosAdapter: NamedAdapterFactory<"axios">;
|
|
223
|
+
declare module "@/schema/adapter" {
|
|
224
|
+
interface Adapters {
|
|
225
|
+
axios: {
|
|
226
|
+
/**
|
|
227
|
+
* What adapter.send() resolves with for Axios.
|
|
228
|
+
*/
|
|
229
|
+
ok: AxiosResponse<unknown>;
|
|
230
|
+
/**
|
|
231
|
+
* What callbacks.onError receives for Axios.
|
|
232
|
+
*
|
|
233
|
+
* We pass the *payload* (e.g. response.data), not the raw AxiosError,
|
|
234
|
+
* so Form Palette's autoErr branch can see `.errors`.
|
|
235
|
+
*/
|
|
236
|
+
err: unknown;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare const createInertiaAdapter: NamedAdapterFactory<"inertia">;
|
|
242
|
+
declare module "@/schema/adapter" {
|
|
243
|
+
interface Adapters {
|
|
244
|
+
inertia: {
|
|
245
|
+
/**
|
|
246
|
+
* What adapter.send() resolves with for Inertia.
|
|
247
|
+
* This is the Page object passed to onSuccess.
|
|
248
|
+
*/
|
|
249
|
+
ok: Page<any>;
|
|
250
|
+
/**
|
|
251
|
+
* What callbacks.onError receives for Inertia.
|
|
252
|
+
*
|
|
253
|
+
* We shape this as `{ errors: ErrorBag }` so Form Palette's
|
|
254
|
+
* autoErr branch can see `.errors`.
|
|
255
|
+
*/
|
|
256
|
+
err: {
|
|
257
|
+
errors: Record<string, string | string[]>;
|
|
258
|
+
} | unknown;
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Register the Axios adapter under the "axios" key.
|
|
265
|
+
*
|
|
266
|
+
* This performs a basic runtime check to make sure Axios is present.
|
|
267
|
+
* If Axios isn't available or doesn't look like a proper Axios instance,
|
|
268
|
+
* an error is thrown.
|
|
269
|
+
*/
|
|
270
|
+
declare function registerAxiosAdapter(): void;
|
|
271
|
+
/**
|
|
272
|
+
* Register the Inertia adapter under the "inertia" key.
|
|
273
|
+
*
|
|
274
|
+
* This explicitly tests that '@inertiajs/react' can be imported and that
|
|
275
|
+
* it exposes a router with a .visit() method. If not, an error is thrown.
|
|
276
|
+
*
|
|
277
|
+
* Note:
|
|
278
|
+
* - This function is async because it uses dynamic import.
|
|
279
|
+
* - Call it at bootstrap time and await it:
|
|
280
|
+
*
|
|
281
|
+
* await registerInertiaAdapter();
|
|
282
|
+
*/
|
|
283
|
+
declare function registerInertiaAdapter(): Promise<void>;
|
|
284
|
+
/**
|
|
285
|
+
* Optional helper: convenience registration for known adapter keys.
|
|
286
|
+
*
|
|
287
|
+
* This is purely ergonomic; you can also call registerAxiosAdapter /
|
|
288
|
+
* registerInertiaAdapter directly.
|
|
289
|
+
*/
|
|
290
|
+
declare function registerKnownAdapter(key: AdapterKey): Promise<void>;
|
|
291
|
+
|
|
292
|
+
export { type AdapterCallbacks, type AdapterConfig, type AdapterError, type AdapterFactory, type AdapterKey, type AdapterOk, type AdapterResult, type AdapterSubmit, type Adapters, type Method, type NamedAdapterConfig, type NamedAdapterFactory, createAxiosAdapter, createInertiaAdapter, getAdapter, hasAdapter, localAdapter, registerAdapter, registerAxiosAdapter, registerInertiaAdapter, registerKnownAdapter };
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { Page } from './../../../../node_modules/@inertiajs/core/types/types.d';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* HTTP methods supported by the core adapter layer.
|
|
6
|
+
*
|
|
7
|
+
* This matches the legacy Method union from the old types.ts.
|
|
8
|
+
*/
|
|
9
|
+
type Method = 'post' | 'get' | 'delete' | 'put' | 'patch';
|
|
10
|
+
/**
|
|
11
|
+
* Lifecycle callbacks used by adapters to report events back to the core.
|
|
12
|
+
*
|
|
13
|
+
* @template Ok Type of the "successful" response payload (e.g. AxiosResponse).
|
|
14
|
+
* @template Err Type of the "error" payload (e.g. AxiosError, unknown).
|
|
15
|
+
*/
|
|
16
|
+
interface AdapterCallbacks<Ok = unknown, Err = unknown> {
|
|
17
|
+
/**
|
|
18
|
+
* Called when the underlying request completes successfully.
|
|
19
|
+
* The adapter decides what "success" means (HTTP 2xx, no exception, etc.).
|
|
20
|
+
*/
|
|
21
|
+
onSuccess?(response: Ok): void;
|
|
22
|
+
/**
|
|
23
|
+
* Called when the underlying request fails.
|
|
24
|
+
* Adapters should pass the most informative error shape they have.
|
|
25
|
+
*/
|
|
26
|
+
onError?(error: Err): void;
|
|
27
|
+
/**
|
|
28
|
+
* Called at the end of the adapter lifecycle, whether success or error.
|
|
29
|
+
* Useful for clearing loading states, unlocking buttons, etc.
|
|
30
|
+
*/
|
|
31
|
+
onFinish?(): void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Result interface returned by an adapter.
|
|
35
|
+
*
|
|
36
|
+
* Generic evolution of the legacy AdapterResult:
|
|
37
|
+
*
|
|
38
|
+
* type AdapterResult = {
|
|
39
|
+
* submit(options?: unknown): void;
|
|
40
|
+
* send<T = unknown>(): Promise<AxiosResponse<T>>;
|
|
41
|
+
* run(options?: unknown): void;
|
|
42
|
+
* };
|
|
43
|
+
*
|
|
44
|
+
* Differences:
|
|
45
|
+
* - The success payload is generic (Ok) instead of hard-coded to AxiosResponse.
|
|
46
|
+
* - send() always returns Promise<Ok>.
|
|
47
|
+
* - run() may return either void or Promise<Ok>, depending on adapter.
|
|
48
|
+
*
|
|
49
|
+
* @template Ok Type of the "successful" response payload.
|
|
50
|
+
*/
|
|
51
|
+
interface AdapterResult<Ok = unknown> {
|
|
52
|
+
/**
|
|
53
|
+
* Fire-and-forget trigger.
|
|
54
|
+
*
|
|
55
|
+
* Intended for flows where the caller does not care about the response
|
|
56
|
+
* object itself (e.g. SPA navigation).
|
|
57
|
+
*
|
|
58
|
+
* @param options Optional adapter-specific options.
|
|
59
|
+
*/
|
|
60
|
+
submit(options?: unknown): void;
|
|
61
|
+
/**
|
|
62
|
+
* Promise-based trigger.
|
|
63
|
+
*
|
|
64
|
+
* Intended for flows where the caller wants to await the response object.
|
|
65
|
+
* Adapters should reject the promise when an error occurs.
|
|
66
|
+
*
|
|
67
|
+
* @param options Optional adapter-specific options.
|
|
68
|
+
*/
|
|
69
|
+
send(options?: unknown): Promise<Ok>;
|
|
70
|
+
/**
|
|
71
|
+
* Convenience trigger.
|
|
72
|
+
*
|
|
73
|
+
* Adapters are free to implement this as:
|
|
74
|
+
* - submit(options) (returning void), or
|
|
75
|
+
* - send(options) (returning Promise<Ok>).
|
|
76
|
+
*
|
|
77
|
+
* Callers that need strict typing can prefer send();
|
|
78
|
+
* callers that just need "do the thing" can use run().
|
|
79
|
+
*
|
|
80
|
+
* @param options Optional adapter-specific options.
|
|
81
|
+
*/
|
|
82
|
+
run(options?: unknown): void | Promise<Ok>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Configuration passed from the core runtime to a concrete adapter factory.
|
|
86
|
+
*
|
|
87
|
+
* @template Body Type of the outbound payload (form values + extra data).
|
|
88
|
+
* @template Ok Type of the "successful" response payload.
|
|
89
|
+
* @template Err Type of the "error" payload.
|
|
90
|
+
*/
|
|
91
|
+
interface AdapterConfig<Body = unknown, Ok = unknown, Err = unknown> {
|
|
92
|
+
/**
|
|
93
|
+
* HTTP method / intent used by the adapter.
|
|
94
|
+
*/
|
|
95
|
+
method: Method;
|
|
96
|
+
/**
|
|
97
|
+
* Fully-resolved URL or route string.
|
|
98
|
+
*
|
|
99
|
+
* The core is responsible for resolving named routes, base URLs, etc.,
|
|
100
|
+
* before handing control to the adapter.
|
|
101
|
+
*/
|
|
102
|
+
url: string;
|
|
103
|
+
/**
|
|
104
|
+
* Request body payload built by the core.
|
|
105
|
+
*
|
|
106
|
+
* Typically something like:
|
|
107
|
+
*
|
|
108
|
+
* { ...formValues, ...extra }
|
|
109
|
+
*/
|
|
110
|
+
data: Body;
|
|
111
|
+
/**
|
|
112
|
+
* Lifecycle callbacks provided by the core.
|
|
113
|
+
*
|
|
114
|
+
* The adapter should invoke these at the appropriate times; it must not
|
|
115
|
+
* swallow errors without calling onError (when provided).
|
|
116
|
+
*/
|
|
117
|
+
callbacks?: AdapterCallbacks<Ok, Err>;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Factory function type for creating an adapter instance.
|
|
121
|
+
*
|
|
122
|
+
* Concrete implementations (Axios, Inertia, fetch, custom) can conform
|
|
123
|
+
* to this signature. The core runtime only knows about this type and does
|
|
124
|
+
* not depend on any adapter-specific details.
|
|
125
|
+
*
|
|
126
|
+
* @template Body Type of the outbound payload (form values + extra data).
|
|
127
|
+
* @template Ok Type of the "successful" response payload.
|
|
128
|
+
* @template Err Type of the "error" payload.
|
|
129
|
+
*/
|
|
130
|
+
type AdapterFactory<Body = unknown, Ok = unknown, Err = unknown> = (config: AdapterConfig<Body, Ok, Err>) => AdapterResult<Ok>;
|
|
131
|
+
/**
|
|
132
|
+
* Registry of adapter flavours.
|
|
133
|
+
*
|
|
134
|
+
* The library hard-codes a single built-in adapter flavour:
|
|
135
|
+
*
|
|
136
|
+
* - 'local' → host-handled, no transport semantics.
|
|
137
|
+
* .send() resolves to `{ data: Body }`.
|
|
138
|
+
*
|
|
139
|
+
* Hosts can extend this interface via module augmentation to add
|
|
140
|
+
* their own adapter flavours (e.g. 'axios', 'inertia', ...).
|
|
141
|
+
*/
|
|
142
|
+
interface Adapters {
|
|
143
|
+
local: {
|
|
144
|
+
/**
|
|
145
|
+
* Type of the value produced by adapter.send() for this adapter flavour.
|
|
146
|
+
*/
|
|
147
|
+
ok: {
|
|
148
|
+
data: unknown;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Type of the error value passed into callbacks.onError for this adapter.
|
|
152
|
+
*/
|
|
153
|
+
err: unknown;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Union of all adapter keys known to the core.
|
|
158
|
+
*
|
|
159
|
+
* Hosts can extend this union by augmenting the Adapters interface.
|
|
160
|
+
*/
|
|
161
|
+
type AdapterKey = keyof Adapters;
|
|
162
|
+
/**
|
|
163
|
+
* Helper: given an adapter key K, get its "ok" payload type.
|
|
164
|
+
*/
|
|
165
|
+
type AdapterOk<K extends AdapterKey> = Adapters[K]['ok'];
|
|
166
|
+
/**
|
|
167
|
+
* Helper: given an adapter key K, get its "error" payload type.
|
|
168
|
+
*/
|
|
169
|
+
type AdapterError<K extends AdapterKey> = Adapters[K]['err'];
|
|
170
|
+
/**
|
|
171
|
+
* Helper: what CoreProps.onSubmitted receives for adapter K.
|
|
172
|
+
*
|
|
173
|
+
* For now, this is the same as AdapterOk<K>. If a host wants a different
|
|
174
|
+
* shape, they can wrap/transform in their own components.
|
|
175
|
+
*/
|
|
176
|
+
type AdapterSubmit<K extends AdapterKey> = AdapterOk<K>;
|
|
177
|
+
/**
|
|
178
|
+
* AdapterConfig specialised for a named adapter key K, using the
|
|
179
|
+
* registry's ok/err types for that key.
|
|
180
|
+
*
|
|
181
|
+
* @template K Adapter key.
|
|
182
|
+
* @template Body Outbound payload type.
|
|
183
|
+
*/
|
|
184
|
+
type NamedAdapterConfig<K extends AdapterKey, Body = unknown> = AdapterConfig<Body, AdapterOk<K>, AdapterError<K>>;
|
|
185
|
+
/**
|
|
186
|
+
* AdapterFactory specialised for a named adapter key K.
|
|
187
|
+
*
|
|
188
|
+
* @template K Adapter key.
|
|
189
|
+
* @template Body Outbound payload type.
|
|
190
|
+
*/
|
|
191
|
+
type NamedAdapterFactory<K extends AdapterKey, Body = unknown> = (config: NamedAdapterConfig<K, Body>) => AdapterResult<AdapterOk<K>>;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Built-in 'local' adapter.
|
|
195
|
+
*
|
|
196
|
+
* Semantics:
|
|
197
|
+
* - send(options?) resolves to `{ data: Body }`
|
|
198
|
+
* - submit/run do nothing by default (no side effects)
|
|
199
|
+
*
|
|
200
|
+
* The core will typically call onSubmitted with the result of send().
|
|
201
|
+
*/
|
|
202
|
+
declare const localAdapter: NamedAdapterFactory<"local", any>;
|
|
203
|
+
/**
|
|
204
|
+
* Register or override an adapter factory for a given key.
|
|
205
|
+
*
|
|
206
|
+
* Hosts can call this at bootstrap time, e.g.:
|
|
207
|
+
*
|
|
208
|
+
* registerAdapter<'axios'>('axios', axiosAdapter);
|
|
209
|
+
*/
|
|
210
|
+
declare function registerAdapter<K extends AdapterKey, Body = any>(key: K, factory: NamedAdapterFactory<K, Body>): void;
|
|
211
|
+
/**
|
|
212
|
+
* Lookup an adapter factory by key.
|
|
213
|
+
*
|
|
214
|
+
* If no adapter is found for the given key, this returns undefined.
|
|
215
|
+
*/
|
|
216
|
+
declare function getAdapter<K extends AdapterKey>(key: K): NamedAdapterFactory<K, any> | undefined;
|
|
217
|
+
/**
|
|
218
|
+
* Check whether an adapter is registered for the given key.
|
|
219
|
+
*/
|
|
220
|
+
declare function hasAdapter(key: AdapterKey): boolean;
|
|
221
|
+
|
|
222
|
+
declare const createAxiosAdapter: NamedAdapterFactory<"axios">;
|
|
223
|
+
declare module "@/schema/adapter" {
|
|
224
|
+
interface Adapters {
|
|
225
|
+
axios: {
|
|
226
|
+
/**
|
|
227
|
+
* What adapter.send() resolves with for Axios.
|
|
228
|
+
*/
|
|
229
|
+
ok: AxiosResponse<unknown>;
|
|
230
|
+
/**
|
|
231
|
+
* What callbacks.onError receives for Axios.
|
|
232
|
+
*
|
|
233
|
+
* We pass the *payload* (e.g. response.data), not the raw AxiosError,
|
|
234
|
+
* so Form Palette's autoErr branch can see `.errors`.
|
|
235
|
+
*/
|
|
236
|
+
err: unknown;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare const createInertiaAdapter: NamedAdapterFactory<"inertia">;
|
|
242
|
+
declare module "@/schema/adapter" {
|
|
243
|
+
interface Adapters {
|
|
244
|
+
inertia: {
|
|
245
|
+
/**
|
|
246
|
+
* What adapter.send() resolves with for Inertia.
|
|
247
|
+
* This is the Page object passed to onSuccess.
|
|
248
|
+
*/
|
|
249
|
+
ok: Page<any>;
|
|
250
|
+
/**
|
|
251
|
+
* What callbacks.onError receives for Inertia.
|
|
252
|
+
*
|
|
253
|
+
* We shape this as `{ errors: ErrorBag }` so Form Palette's
|
|
254
|
+
* autoErr branch can see `.errors`.
|
|
255
|
+
*/
|
|
256
|
+
err: {
|
|
257
|
+
errors: Record<string, string | string[]>;
|
|
258
|
+
} | unknown;
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Register the Axios adapter under the "axios" key.
|
|
265
|
+
*
|
|
266
|
+
* This performs a basic runtime check to make sure Axios is present.
|
|
267
|
+
* If Axios isn't available or doesn't look like a proper Axios instance,
|
|
268
|
+
* an error is thrown.
|
|
269
|
+
*/
|
|
270
|
+
declare function registerAxiosAdapter(): void;
|
|
271
|
+
/**
|
|
272
|
+
* Register the Inertia adapter under the "inertia" key.
|
|
273
|
+
*
|
|
274
|
+
* This explicitly tests that '@inertiajs/react' can be imported and that
|
|
275
|
+
* it exposes a router with a .visit() method. If not, an error is thrown.
|
|
276
|
+
*
|
|
277
|
+
* Note:
|
|
278
|
+
* - This function is async because it uses dynamic import.
|
|
279
|
+
* - Call it at bootstrap time and await it:
|
|
280
|
+
*
|
|
281
|
+
* await registerInertiaAdapter();
|
|
282
|
+
*/
|
|
283
|
+
declare function registerInertiaAdapter(): Promise<void>;
|
|
284
|
+
/**
|
|
285
|
+
* Optional helper: convenience registration for known adapter keys.
|
|
286
|
+
*
|
|
287
|
+
* This is purely ergonomic; you can also call registerAxiosAdapter /
|
|
288
|
+
* registerInertiaAdapter directly.
|
|
289
|
+
*/
|
|
290
|
+
declare function registerKnownAdapter(key: AdapterKey): Promise<void>;
|
|
291
|
+
|
|
292
|
+
export { type AdapterCallbacks, type AdapterConfig, type AdapterError, type AdapterFactory, type AdapterKey, type AdapterOk, type AdapterResult, type AdapterSubmit, type Adapters, type Method, type NamedAdapterConfig, type NamedAdapterFactory, createAxiosAdapter, createInertiaAdapter, getAdapter, hasAdapter, localAdapter, registerAdapter, registerAxiosAdapter, registerInertiaAdapter, registerKnownAdapter };
|