@soxa-ui/react 0.0.0-stage → 0.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +253 -2
- package/dist/adapter/common/aria.d.ts +6 -0
- package/dist/adapter/common/aria.js +22 -0
- package/dist/adapter/common/icon.d.ts +9 -0
- package/dist/adapter/common/icon.js +22 -0
- package/dist/adapter/common/index.d.ts +6 -0
- package/dist/adapter/common/naming.d.ts +6 -0
- package/dist/adapter/common/naming.js +8 -0
- package/dist/adapter/common/profile.d.ts +3 -0
- package/dist/adapter/common/profile.js +8 -0
- package/dist/adapter/common/root.d.ts +67 -0
- package/dist/adapter/common/root.js +83 -0
- package/dist/adapter/common/slots.d.ts +15 -0
- package/dist/adapter/common/slots.js +23 -0
- package/dist/adapter/elevator/Elevate.d.ts +16 -0
- package/dist/adapter/elevator/Elevate.js +22 -0
- package/dist/adapter/elevator/elevator.class.d.ts +14 -0
- package/dist/adapter/elevator/elevator.class.js +23 -0
- package/dist/adapter/elevator/index.d.ts +3 -0
- package/dist/adapter/elevator/layer.d.ts +6 -0
- package/dist/adapter/elevator/layer.js +5 -0
- package/dist/adapter/elevator/scope.class.d.ts +19 -0
- package/dist/adapter/elevator/scope.class.js +31 -0
- package/dist/adapter/index.d.ts +5 -0
- package/dist/adapter/locale/LocaleProvider.d.ts +19 -0
- package/dist/adapter/locale/LocaleProvider.js +29 -0
- package/dist/adapter/locale/context.d.ts +3 -0
- package/dist/adapter/locale/context.js +7 -0
- package/dist/adapter/locale/index.d.ts +2 -0
- package/dist/adapter/runtime/NativeInput.d.ts +24 -0
- package/dist/adapter/runtime/NativeInput.js +40 -0
- package/dist/adapter/runtime/NativeTextarea.d.ts +10 -0
- package/dist/adapter/runtime/NativeTextarea.js +24 -0
- package/dist/adapter/runtime/Teleport.d.ts +14 -0
- package/dist/adapter/runtime/Teleport.js +82 -0
- package/dist/adapter/runtime/accepting.d.ts +10 -0
- package/dist/adapter/runtime/accepting.js +18 -0
- package/dist/adapter/runtime/click-action.class.d.ts +14 -0
- package/dist/adapter/runtime/click-action.class.js +26 -0
- package/dist/adapter/runtime/drafts.class.d.ts +24 -0
- package/dist/adapter/runtime/drafts.class.js +41 -0
- package/dist/adapter/runtime/event-callbacks.class.d.ts +29 -0
- package/dist/adapter/runtime/event-callbacks.class.js +44 -0
- package/dist/adapter/runtime/index.d.ts +16 -0
- package/dist/adapter/runtime/root-ref.class.d.ts +39 -0
- package/dist/adapter/runtime/root-ref.class.js +86 -0
- package/dist/adapter/runtime/stable-snapshot.class.d.ts +20 -0
- package/dist/adapter/runtime/stable-snapshot.class.js +43 -0
- package/dist/adapter/runtime/useAdapter.d.ts +39 -0
- package/dist/adapter/runtime/useAdapter.js +78 -0
- package/dist/adapter/runtime/useAdapterContext.d.ts +22 -0
- package/dist/adapter/runtime/useAdapterContext.js +128 -0
- package/dist/adapter/runtime/useClickAction.d.ts +6 -0
- package/dist/adapter/runtime/useClickAction.js +16 -0
- package/dist/adapter/runtime/useComponent.d.ts +15 -0
- package/dist/adapter/runtime/useComponent.js +13 -0
- package/dist/adapter/runtime/useRootElement.d.ts +6 -0
- package/dist/adapter/runtime/useRootElement.js +13 -0
- package/dist/adapter/runtime/withRenderBoundary.d.ts +7 -0
- package/dist/adapter/runtime/withRenderBoundary.js +13 -0
- package/dist/adapter/toasts/index.d.ts +3 -0
- package/dist/adapter/toasts/render.d.ts +6 -0
- package/dist/adapter/toasts/render.js +17 -0
- package/dist/adapter/toasts/types.d.ts +6 -0
- package/dist/adapter/toasts/useToasts.d.ts +8 -0
- package/dist/adapter/toasts/useToasts.js +19 -0
- package/dist/components/accordion/Accordion.d.ts +14 -0
- package/dist/components/accordion/Accordion.js +40 -0
- package/dist/components/accordion/base.component.d.ts +6 -0
- package/dist/components/accordion/index.d.ts +6 -0
- package/dist/components/accordion/index.js +7 -0
- package/dist/components/accordion/item/Item.d.ts +6 -0
- package/dist/components/accordion/item/Item.js +68 -0
- package/dist/components/accordion/item/base.component.d.ts +9 -0
- package/dist/components/accordion/item/index.d.ts +2 -0
- package/dist/components/accordion/item/setup.component.d.ts +17 -0
- package/dist/components/accordion/item/setup.component.js +23 -0
- package/dist/components/accordion/setup.component.d.ts +15 -0
- package/dist/components/accordion/setup.component.js +26 -0
- package/dist/components/button/Button.d.ts +15 -0
- package/dist/components/button/Button.js +38 -0
- package/dist/components/button/base.component.d.ts +7 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/setup.component.d.ts +22 -0
- package/dist/components/button/setup.component.js +12 -0
- package/dist/components/calendar/Calendar.d.ts +7 -0
- package/dist/components/calendar/Calendar.js +190 -0
- package/dist/components/calendar/base.component.d.ts +7 -0
- package/dist/components/calendar/index.d.ts +7 -0
- package/dist/components/calendar/index.js +8 -0
- package/dist/components/calendar/item/Item.d.ts +3 -0
- package/dist/components/calendar/item/Item.js +26 -0
- package/dist/components/calendar/item/base.component.d.ts +7 -0
- package/dist/components/calendar/item/index.d.ts +2 -0
- package/dist/components/calendar/item/setup.component.d.ts +13 -0
- package/dist/components/calendar/item/setup.component.js +20 -0
- package/dist/components/calendar/setup.component.d.ts +15 -0
- package/dist/components/calendar/setup.component.js +26 -0
- package/dist/components/check-box/CheckBox.d.ts +4 -0
- package/dist/components/check-box/CheckBox.js +49 -0
- package/dist/components/check-box/base.component.d.ts +7 -0
- package/dist/components/check-box/index.d.ts +2 -0
- package/dist/components/check-box/setup.component.d.ts +27 -0
- package/dist/components/check-box/setup.component.js +13 -0
- package/dist/components/component/base.component.d.ts +5 -0
- package/dist/components/component/index.d.ts +1 -0
- package/dist/components/component-view/ComponentView.d.ts +4 -0
- package/dist/components/component-view/ComponentView.js +22 -0
- package/dist/components/component-view/base.component.d.ts +5 -0
- package/dist/components/component-view/index.d.ts +2 -0
- package/dist/components/component-view/setup.component.d.ts +9 -0
- package/dist/components/component-view/setup.component.js +12 -0
- package/dist/components/control/base.component.d.ts +5 -0
- package/dist/components/control/index.d.ts +1 -0
- package/dist/components/control/setup.component.d.ts +22 -0
- package/dist/components/date-input/DateInput.d.ts +4 -0
- package/dist/components/date-input/DateInput.js +88 -0
- package/dist/components/date-input/base.component.d.ts +6 -0
- package/dist/components/date-input/index.d.ts +2 -0
- package/dist/components/date-input/setup.component.d.ts +27 -0
- package/dist/components/date-input/setup.component.js +13 -0
- package/dist/components/date-picker/DatePicker.d.ts +9 -0
- package/dist/components/date-picker/DatePicker.js +148 -0
- package/dist/components/date-picker/base.component.d.ts +6 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/setup.component.d.ts +60 -0
- package/dist/components/date-picker/setup.component.js +26 -0
- package/dist/components/dialog/Dialog.d.ts +7 -0
- package/dist/components/dialog/Dialog.js +88 -0
- package/dist/components/dialog/base.component.d.ts +6 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/setup.component.d.ts +29 -0
- package/dist/components/dialog/setup.component.js +12 -0
- package/dist/components/drag-and-drop/DragAndDrop.d.ts +4 -0
- package/dist/components/drag-and-drop/DragAndDrop.js +16 -0
- package/dist/components/drag-and-drop/base.component.d.ts +6 -0
- package/dist/components/drag-and-drop/index.d.ts +2 -0
- package/dist/components/drag-and-drop/setup.component.d.ts +6 -0
- package/dist/components/drag-and-drop/setup.component.js +12 -0
- package/dist/components/drawer/Drawer.d.ts +7 -0
- package/dist/components/drawer/Drawer.js +75 -0
- package/dist/components/drawer/base.component.d.ts +6 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/setup.component.d.ts +29 -0
- package/dist/components/drawer/setup.component.js +12 -0
- package/dist/components/field/Field.d.ts +4 -0
- package/dist/components/field/Field.js +58 -0
- package/dist/components/field/base.component.d.ts +5 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/setup.component.d.ts +10 -0
- package/dist/components/field/setup.component.js +13 -0
- package/dist/components/frame/Frame.d.ts +7 -0
- package/dist/components/frame/Frame.js +30 -0
- package/dist/components/frame/base.component.d.ts +5 -0
- package/dist/components/frame/index.d.ts +2 -0
- package/dist/components/frame/setup.component.d.ts +33 -0
- package/dist/components/frame/setup.component.js +12 -0
- package/dist/components/icon/Icon.d.ts +7 -0
- package/dist/components/icon/Icon.js +17 -0
- package/dist/components/icon/base.component.d.ts +5 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/setup.component.d.ts +19 -0
- package/dist/components/icon/setup.component.js +12 -0
- package/dist/components/index.d.ts +43 -0
- package/dist/components/input/Input.d.ts +4 -0
- package/dist/components/input/Input.js +65 -0
- package/dist/components/input/base.component.d.ts +7 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/setup.component.d.ts +27 -0
- package/dist/components/input/setup.component.js +13 -0
- package/dist/components/input-control/base.component.d.ts +6 -0
- package/dist/components/input-control/index.d.ts +1 -0
- package/dist/components/input-control/setup.component.d.ts +26 -0
- package/dist/components/interactive/base.component.d.ts +5 -0
- package/dist/components/interactive/index.d.ts +1 -0
- package/dist/components/interactive/setup.component.d.ts +9 -0
- package/dist/components/item-row/ItemRow.d.ts +13 -0
- package/dist/components/item-row/ItemRow.js +19 -0
- package/dist/components/item-row/index.d.ts +2 -0
- package/dist/components/item-row/setup.component.d.ts +22 -0
- package/dist/components/item-row/setup.component.js +12 -0
- package/dist/components/label/Label.d.ts +7 -0
- package/dist/components/label/Label.js +31 -0
- package/dist/components/label/base.component.d.ts +5 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/label/setup.component.d.ts +9 -0
- package/dist/components/label/setup.component.js +12 -0
- package/dist/components/list-box/ListBox.d.ts +8 -0
- package/dist/components/list-box/ListBox.js +67 -0
- package/dist/components/list-box/base.component.d.ts +9 -0
- package/dist/components/list-box/group/Group.d.ts +7 -0
- package/dist/components/list-box/group/Group.js +34 -0
- package/dist/components/list-box/group/base.component.d.ts +6 -0
- package/dist/components/list-box/group/index.d.ts +2 -0
- package/dist/components/list-box/group/setup.component.d.ts +9 -0
- package/dist/components/list-box/group/setup.component.js +12 -0
- package/dist/components/list-box/index.d.ts +9 -0
- package/dist/components/list-box/index.js +11 -0
- package/dist/components/list-box/item/Item.d.ts +6 -0
- package/dist/components/list-box/item/Item.js +57 -0
- package/dist/components/list-box/item/base.component.d.ts +8 -0
- package/dist/components/list-box/item/index.d.ts +2 -0
- package/dist/components/list-box/item/setup.component.d.ts +19 -0
- package/dist/components/list-box/item/setup.component.js +23 -0
- package/dist/components/list-box/setup.component.d.ts +15 -0
- package/dist/components/list-box/setup.component.js +26 -0
- package/dist/components/menu/Menu.d.ts +7 -0
- package/dist/components/menu/Menu.js +47 -0
- package/dist/components/menu/base.component.d.ts +6 -0
- package/dist/components/menu/checkbox-item/CheckboxItem.d.ts +6 -0
- package/dist/components/menu/checkbox-item/CheckboxItem.js +61 -0
- package/dist/components/menu/checkbox-item/base.component.d.ts +8 -0
- package/dist/components/menu/checkbox-item/index.d.ts +2 -0
- package/dist/components/menu/checkbox-item/setup.component.d.ts +17 -0
- package/dist/components/menu/checkbox-item/setup.component.js +23 -0
- package/dist/components/menu/group/Group.d.ts +4 -0
- package/dist/components/menu/group/Group.js +31 -0
- package/dist/components/menu/group/base.component.d.ts +6 -0
- package/dist/components/menu/group/index.d.ts +2 -0
- package/dist/components/menu/group/setup.component.d.ts +9 -0
- package/dist/components/menu/group/setup.component.js +12 -0
- package/dist/components/menu/index.d.ts +23 -0
- package/dist/components/menu/index.js +23 -0
- package/dist/components/menu/item/Item.d.ts +3 -0
- package/dist/components/menu/item/Item.js +42 -0
- package/dist/components/menu/item/base.component.d.ts +8 -0
- package/dist/components/menu/item/index.d.ts +2 -0
- package/dist/components/menu/item/setup.component.d.ts +17 -0
- package/dist/components/menu/item/setup.component.js +23 -0
- package/dist/components/menu/popover-item/PopoverItem.d.ts +6 -0
- package/dist/components/menu/popover-item/PopoverItem.js +72 -0
- package/dist/components/menu/popover-item/base.component.d.ts +8 -0
- package/dist/components/menu/popover-item/index.d.ts +2 -0
- package/dist/components/menu/popover-item/setup.component.d.ts +24 -0
- package/dist/components/menu/popover-item/setup.component.js +26 -0
- package/dist/components/menu/radio-group/RadioGroup.d.ts +4 -0
- package/dist/components/menu/radio-group/RadioGroup.js +31 -0
- package/dist/components/menu/radio-group/base.component.d.ts +5 -0
- package/dist/components/menu/radio-group/index.d.ts +2 -0
- package/dist/components/menu/radio-group/setup.component.d.ts +9 -0
- package/dist/components/menu/radio-group/setup.component.js +12 -0
- package/dist/components/menu/radio-item/RadioItem.d.ts +3 -0
- package/dist/components/menu/radio-item/RadioItem.js +50 -0
- package/dist/components/menu/radio-item/base.component.d.ts +9 -0
- package/dist/components/menu/radio-item/index.d.ts +2 -0
- package/dist/components/menu/radio-item/setup.component.d.ts +17 -0
- package/dist/components/menu/radio-item/setup.component.js +23 -0
- package/dist/components/menu/separator/Separator.d.ts +4 -0
- package/dist/components/menu/separator/Separator.js +18 -0
- package/dist/components/menu/separator/base.component.d.ts +5 -0
- package/dist/components/menu/separator/index.d.ts +2 -0
- package/dist/components/menu/separator/setup.component.d.ts +9 -0
- package/dist/components/menu/separator/setup.component.js +12 -0
- package/dist/components/menu/setup.component.d.ts +16 -0
- package/dist/components/menu/setup.component.js +29 -0
- package/dist/components/menu/submenu/Submenu.d.ts +22 -0
- package/dist/components/menu/submenu/Submenu.js +117 -0
- package/dist/components/menu/submenu/base.component.d.ts +9 -0
- package/dist/components/menu/submenu/index.d.ts +2 -0
- package/dist/components/menu/submenu/setup.component.d.ts +25 -0
- package/dist/components/menu/submenu/setup.component.js +37 -0
- package/dist/components/number-input/NumberInput.d.ts +4 -0
- package/dist/components/number-input/NumberInput.js +108 -0
- package/dist/components/number-input/base.component.d.ts +7 -0
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/number-input/setup.component.d.ts +27 -0
- package/dist/components/number-input/setup.component.js +13 -0
- package/dist/components/pagination/Pagination.d.ts +7 -0
- package/dist/components/pagination/Pagination.js +80 -0
- package/dist/components/pagination/base.component.d.ts +6 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/item/Item.d.ts +3 -0
- package/dist/components/pagination/item/Item.js +34 -0
- package/dist/components/pagination/item/base.component.d.ts +5 -0
- package/dist/components/pagination/item/index.d.ts +2 -0
- package/dist/components/pagination/item/setup.component.d.ts +11 -0
- package/dist/components/pagination/item/setup.component.js +23 -0
- package/dist/components/pagination/setup.component.d.ts +15 -0
- package/dist/components/pagination/setup.component.js +26 -0
- package/dist/components/popover/Popover.d.ts +7 -0
- package/dist/components/popover/Popover.js +68 -0
- package/dist/components/popover/base.component.d.ts +6 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/setup.component.d.ts +34 -0
- package/dist/components/popover/setup.component.js +17 -0
- package/dist/components/progress-linear/ProgressLinear.d.ts +7 -0
- package/dist/components/progress-linear/ProgressLinear.js +24 -0
- package/dist/components/progress-linear/base.component.d.ts +5 -0
- package/dist/components/progress-linear/index.d.ts +2 -0
- package/dist/components/progress-linear/setup.component.d.ts +17 -0
- package/dist/components/progress-linear/setup.component.js +12 -0
- package/dist/components/progress-spinner/ProgressSpinner.d.ts +7 -0
- package/dist/components/progress-spinner/ProgressSpinner.js +50 -0
- package/dist/components/progress-spinner/base.component.d.ts +5 -0
- package/dist/components/progress-spinner/index.d.ts +2 -0
- package/dist/components/progress-spinner/setup.component.d.ts +17 -0
- package/dist/components/progress-spinner/setup.component.js +12 -0
- package/dist/components/radio-group/RadioGroup.d.ts +4 -0
- package/dist/components/radio-group/RadioGroup.js +30 -0
- package/dist/components/radio-group/base.component.d.ts +7 -0
- package/dist/components/radio-group/index.d.ts +7 -0
- package/dist/components/radio-group/index.js +8 -0
- package/dist/components/radio-group/item/Item.d.ts +3 -0
- package/dist/components/radio-group/item/Item.js +46 -0
- package/dist/components/radio-group/item/base.component.d.ts +9 -0
- package/dist/components/radio-group/item/index.d.ts +2 -0
- package/dist/components/radio-group/item/setup.component.d.ts +42 -0
- package/dist/components/radio-group/item/setup.component.js +30 -0
- package/dist/components/radio-group/setup.component.d.ts +16 -0
- package/dist/components/radio-group/setup.component.js +27 -0
- package/dist/components/rating/Rating.d.ts +4 -0
- package/dist/components/rating/Rating.js +55 -0
- package/dist/components/rating/base.component.d.ts +6 -0
- package/dist/components/rating/index.d.ts +2 -0
- package/dist/components/rating/setup.component.d.ts +27 -0
- package/dist/components/rating/setup.component.js +13 -0
- package/dist/components/scroller/Scroller.d.ts +7 -0
- package/dist/components/scroller/Scroller.js +64 -0
- package/dist/components/scroller/base.component.d.ts +6 -0
- package/dist/components/scroller/index.d.ts +2 -0
- package/dist/components/scroller/setup.component.d.ts +22 -0
- package/dist/components/scroller/setup.component.js +12 -0
- package/dist/components/select/Select.d.ts +7 -0
- package/dist/components/select/Select.js +116 -0
- package/dist/components/select/base.component.d.ts +8 -0
- package/dist/components/select/group/Group.d.ts +7 -0
- package/dist/components/select/group/Group.js +34 -0
- package/dist/components/select/group/base.component.d.ts +6 -0
- package/dist/components/select/group/index.d.ts +2 -0
- package/dist/components/select/group/setup.component.d.ts +9 -0
- package/dist/components/select/group/setup.component.js +12 -0
- package/dist/components/select/index.d.ts +9 -0
- package/dist/components/select/index.js +11 -0
- package/dist/components/select/item/Item.d.ts +6 -0
- package/dist/components/select/item/Item.js +58 -0
- package/dist/components/select/item/base.component.d.ts +8 -0
- package/dist/components/select/item/index.d.ts +2 -0
- package/dist/components/select/item/setup.component.d.ts +19 -0
- package/dist/components/select/item/setup.component.js +23 -0
- package/dist/components/select/setup.component.d.ts +27 -0
- package/dist/components/select/setup.component.js +30 -0
- package/dist/components/skeleton/Skeleton.d.ts +4 -0
- package/dist/components/skeleton/Skeleton.js +23 -0
- package/dist/components/skeleton/base.component.d.ts +5 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/setup.component.d.ts +11 -0
- package/dist/components/skeleton/setup.component.js +12 -0
- package/dist/components/slider/Slider.d.ts +4 -0
- package/dist/components/slider/Slider.js +72 -0
- package/dist/components/slider/base.component.d.ts +6 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/setup.component.d.ts +23 -0
- package/dist/components/slider/setup.component.js +13 -0
- package/dist/components/stylable/base.component.d.ts +5 -0
- package/dist/components/stylable/index.d.ts +1 -0
- package/dist/components/stylable/setup.component.d.ts +9 -0
- package/dist/components/switch/Switch.d.ts +4 -0
- package/dist/components/switch/Switch.js +42 -0
- package/dist/components/switch/base.component.d.ts +7 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/setup.component.d.ts +27 -0
- package/dist/components/switch/setup.component.js +13 -0
- package/dist/components/table/Table.d.ts +9 -0
- package/dist/components/table/Table.js +83 -0
- package/dist/components/table/base.component.d.ts +7 -0
- package/dist/components/table/column/Column.d.ts +7 -0
- package/dist/components/table/column/Column.js +66 -0
- package/dist/components/table/column/base.component.d.ts +6 -0
- package/dist/components/table/column/index.d.ts +2 -0
- package/dist/components/table/column/setup.component.d.ts +19 -0
- package/dist/components/table/column/setup.component.js +16 -0
- package/dist/components/table/index.d.ts +9 -0
- package/dist/components/table/index.js +11 -0
- package/dist/components/table/row/Cells.d.ts +14 -0
- package/dist/components/table/row/Cells.js +29 -0
- package/dist/components/table/row/Row.d.ts +6 -0
- package/dist/components/table/row/Row.js +43 -0
- package/dist/components/table/row/base.component.d.ts +7 -0
- package/dist/components/table/row/index.d.ts +2 -0
- package/dist/components/table/row/setup.component.d.ts +11 -0
- package/dist/components/table/row/setup.component.js +23 -0
- package/dist/components/table/setup.component.d.ts +18 -0
- package/dist/components/table/setup.component.js +27 -0
- package/dist/components/tabs/Tabs.d.ts +9 -0
- package/dist/components/tabs/Tabs.js +53 -0
- package/dist/components/tabs/base.component.d.ts +9 -0
- package/dist/components/tabs/content/Content.d.ts +4 -0
- package/dist/components/tabs/content/Content.js +18 -0
- package/dist/components/tabs/content/base.component.d.ts +7 -0
- package/dist/components/tabs/content/index.d.ts +2 -0
- package/dist/components/tabs/content/setup.component.d.ts +17 -0
- package/dist/components/tabs/content/setup.component.js +20 -0
- package/dist/components/tabs/index.d.ts +9 -0
- package/dist/components/tabs/index.js +11 -0
- package/dist/components/tabs/item/Item.d.ts +6 -0
- package/dist/components/tabs/item/Item.js +64 -0
- package/dist/components/tabs/item/base.component.d.ts +9 -0
- package/dist/components/tabs/item/index.d.ts +2 -0
- package/dist/components/tabs/item/setup.component.d.ts +17 -0
- package/dist/components/tabs/item/setup.component.js +23 -0
- package/dist/components/tabs/setup.component.d.ts +15 -0
- package/dist/components/tabs/setup.component.js +26 -0
- package/dist/components/tags/Tags.d.ts +7 -0
- package/dist/components/tags/Tags.js +36 -0
- package/dist/components/tags/base.component.d.ts +6 -0
- package/dist/components/tags/index.d.ts +6 -0
- package/dist/components/tags/index.js +7 -0
- package/dist/components/tags/item/Item.d.ts +6 -0
- package/dist/components/tags/item/Item.js +63 -0
- package/dist/components/tags/item/base.component.d.ts +8 -0
- package/dist/components/tags/item/index.d.ts +2 -0
- package/dist/components/tags/item/setup.component.d.ts +15 -0
- package/dist/components/tags/item/setup.component.js +23 -0
- package/dist/components/tags/setup.component.d.ts +15 -0
- package/dist/components/tags/setup.component.js +26 -0
- package/dist/components/textable/base.component.d.ts +5 -0
- package/dist/components/textable/index.d.ts +1 -0
- package/dist/components/textable/setup.component.d.ts +22 -0
- package/dist/components/textarea/Textarea.d.ts +4 -0
- package/dist/components/textarea/Textarea.js +35 -0
- package/dist/components/textarea/base.component.d.ts +7 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/setup.component.d.ts +29 -0
- package/dist/components/textarea/setup.component.js +13 -0
- package/dist/components/toasts/Toasts.d.ts +7 -0
- package/dist/components/toasts/Toasts.js +43 -0
- package/dist/components/toasts/base.component.d.ts +7 -0
- package/dist/components/toasts/index.d.ts +2 -0
- package/dist/components/toasts/item/Item.d.ts +3 -0
- package/dist/components/toasts/item/Item.js +88 -0
- package/dist/components/toasts/item/base.component.d.ts +6 -0
- package/dist/components/toasts/item/index.d.ts +2 -0
- package/dist/components/toasts/item/setup.component.d.ts +13 -0
- package/dist/components/toasts/item/setup.component.js +20 -0
- package/dist/components/toasts/setup.component.d.ts +13 -0
- package/dist/components/toasts/setup.component.js +26 -0
- package/dist/components/tooltip/Tooltip.d.ts +4 -0
- package/dist/components/tooltip/Tooltip.js +34 -0
- package/dist/components/tooltip/base.component.d.ts +6 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/setup.component.d.ts +26 -0
- package/dist/components/tooltip/setup.component.js +17 -0
- package/dist/components/value-control/base.component.d.ts +6 -0
- package/dist/components/value-control/index.d.ts +1 -0
- package/dist/components/value-control/setup.component.d.ts +22 -0
- package/dist/components/virtual/Virtual.d.ts +4 -0
- package/dist/components/virtual/Virtual.js +16 -0
- package/dist/components/virtual/base.component.d.ts +6 -0
- package/dist/components/virtual/index.d.ts +2 -0
- package/dist/components/virtual/setup.component.d.ts +6 -0
- package/dist/components/virtual/setup.component.js +12 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +60 -0
- package/dist/types.d.ts +25 -0
- package/package.json +60 -4
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Слой лифта — неизменяемая карта «ключ → значение» от предков, один
|
|
3
|
+
* контекст React на все ключи. AGENTS.md (React), «Срок жизни контекста».
|
|
4
|
+
*/
|
|
5
|
+
export type TElevatorLayer = ReadonlyMap<symbol, unknown>;
|
|
6
|
+
export declare const ElevatorContext: import("react").Context<TElevatorLayer>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TReactElevatorScope — лифт одной сборки: родительский слой, своё и
|
|
3
|
+
* прочитанное. Сменилось прочитанное — сборка устарела (`isStale`).
|
|
4
|
+
*/
|
|
5
|
+
import type { TElevatorFactory } from '@soxa-ui/setup';
|
|
6
|
+
import type { TElevatorLayer } from './layer';
|
|
7
|
+
export declare class TReactElevatorScope {
|
|
8
|
+
readonly parent: TElevatorLayer;
|
|
9
|
+
private readonly _own;
|
|
10
|
+
private readonly _reads;
|
|
11
|
+
/** @param parent слой, который компонент увидел на рендере */
|
|
12
|
+
constructor(parent: TElevatorLayer);
|
|
13
|
+
readonly elevator: TElevatorFactory;
|
|
14
|
+
read(key: symbol): unknown;
|
|
15
|
+
write(key: symbol, value: unknown): void;
|
|
16
|
+
isStale(layer: TElevatorLayer): boolean;
|
|
17
|
+
/** Слой для детей; своего нет — тот же объект, детям не из-за чего перерисовываться. */
|
|
18
|
+
layerOver(layer: TElevatorLayer): TElevatorLayer;
|
|
19
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TReactElevator } from "./elevator.class.js";
|
|
2
|
+
//#region src/adapter/elevator/scope.class.ts
|
|
3
|
+
var TReactElevatorScope = class {
|
|
4
|
+
parent;
|
|
5
|
+
_own = /* @__PURE__ */ new Map();
|
|
6
|
+
_reads = /* @__PURE__ */ new Map();
|
|
7
|
+
/** @param parent слой, который компонент увидел на рендере */
|
|
8
|
+
constructor(parent) {
|
|
9
|
+
this.parent = parent;
|
|
10
|
+
}
|
|
11
|
+
elevator = (key) => new TReactElevator(key.name, this);
|
|
12
|
+
read(key) {
|
|
13
|
+
const value = this.parent.get(key);
|
|
14
|
+
this._reads.set(key, value);
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
write(key, value) {
|
|
18
|
+
this._own.set(key, value);
|
|
19
|
+
}
|
|
20
|
+
isStale(layer) {
|
|
21
|
+
for (const [key, value] of this._reads) if (layer.get(key) !== value) return true;
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
/** Слой для детей; своего нет — тот же объект, детям не из-за чего перерисовываться. */
|
|
25
|
+
layerOver(layer) {
|
|
26
|
+
if (this._own.size === 0) return layer;
|
|
27
|
+
return new Map([...layer, ...this._own]);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { TReactElevatorScope };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { TLocale } from '@soxa-ui/plugins';
|
|
3
|
+
export type TLocaleProviderProps = {
|
|
4
|
+
/** Локаль поддерева: тег для Intl и строки библиотеки (`ruRU`, `extendLocale(...)`) */
|
|
5
|
+
locale: TLocale;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* LocaleProvider — язык и строки библиотеки компонентам внутри; смена пропа
|
|
10
|
+
* переписывает их на лету, без перемонтирования. Без провайдера — английский.
|
|
11
|
+
* AGENTS.md (React), «Локаль и тосты».
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <LocaleProvider locale={current}>
|
|
15
|
+
* <App />
|
|
16
|
+
* </LocaleProvider>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function LocaleProvider({ locale, children }: TLocaleProviderProps): ReactNode;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { LocaleContext } from "./context.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useLayoutEffect, useState } from "react";
|
|
5
|
+
import { TLocaleSource } from "@soxa-ui/plugins";
|
|
6
|
+
//#region src/adapter/locale/LocaleProvider.tsx
|
|
7
|
+
/**
|
|
8
|
+
* LocaleProvider — язык и строки библиотеки компонентам внутри; смена пропа
|
|
9
|
+
* переписывает их на лету, без перемонтирования. Без провайдера — английский.
|
|
10
|
+
* AGENTS.md (React), «Локаль и тосты».
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <LocaleProvider locale={current}>
|
|
14
|
+
* <App />
|
|
15
|
+
* </LocaleProvider>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
function LocaleProvider({ locale, children }) {
|
|
19
|
+
const [source] = useState(() => new TLocaleSource(locale));
|
|
20
|
+
useLayoutEffect(() => {
|
|
21
|
+
source.locale = locale;
|
|
22
|
+
}, [source, locale]);
|
|
23
|
+
return /* @__PURE__ */ jsx(LocaleContext, {
|
|
24
|
+
value: source,
|
|
25
|
+
children
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { LocaleProvider };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
//#region src/adapter/locale/context.ts
|
|
4
|
+
/** Источник локали ближайшего `LocaleProvider`; вне провайдера — `undefined`. */
|
|
5
|
+
var LocaleContext = createContext(void 0);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { LocaleContext };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NativeInput — неуправляемый `<input>`, чьё живое состояние (текст, значение
|
|
3
|
+
* ползунка, отметку, «выбрано частично») ведёт ядро: аналог `:value`,
|
|
4
|
+
* `:checked`, `:indeterminate` у Vue. AGENTS.md (React), «Поля ввода».
|
|
5
|
+
*/
|
|
6
|
+
import type { InputHTMLAttributes, ReactElement } from 'react';
|
|
7
|
+
/** Живое состояние поля: свойства узла, которые ведёт ядро. */
|
|
8
|
+
export type TNativeInputLive = {
|
|
9
|
+
/** Текст текстового поля или значение ползунка (`type="range"`). */
|
|
10
|
+
readonly value?: string | number;
|
|
11
|
+
/** Отметка флажка и радио. */
|
|
12
|
+
readonly checked?: boolean;
|
|
13
|
+
/** «Выбрано частично» у флажка. */
|
|
14
|
+
readonly indeterminate?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Атрибуты `<input>` без живого состояния: `checked` атрибутом сделал бы поле
|
|
18
|
+
* контролируемым, а `value` у флажка и радио — значение для формы.
|
|
19
|
+
*/
|
|
20
|
+
export type TNativeInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'defaultChecked' | 'defaultValue'> & {
|
|
21
|
+
/** Состояние, которое ведёт ядро: ключа нет — свойство поле не трогает. */
|
|
22
|
+
live: TNativeInputLive;
|
|
23
|
+
};
|
|
24
|
+
export declare function NativeInput({ live, ...attributes }: TNativeInputProps): ReactElement;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useLayoutEffect, useRef } from "react";
|
|
4
|
+
//#region src/adapter/runtime/NativeInput.tsx
|
|
5
|
+
/**
|
|
6
|
+
* NativeInput — неуправляемый `<input>`, чьё живое состояние (текст, значение
|
|
7
|
+
* ползунка, отметку, «выбрано частично») ведёт ядро: аналог `:value`,
|
|
8
|
+
* `:checked`, `:indeterminate` у Vue. AGENTS.md (React), «Поля ввода».
|
|
9
|
+
*/
|
|
10
|
+
function toProperties(live) {
|
|
11
|
+
return {
|
|
12
|
+
value: "value" in live ? String(live.value ?? "") : void 0,
|
|
13
|
+
checked: "checked" in live ? live.checked === true : void 0,
|
|
14
|
+
indeterminate: "indeterminate" in live ? live.indeterminate === true : void 0
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function NativeInput({ live, ...attributes }) {
|
|
18
|
+
const node = useRef(null);
|
|
19
|
+
const { value, checked, indeterminate } = toProperties(live);
|
|
20
|
+
const initial = useRef(value);
|
|
21
|
+
useLayoutEffect(() => {
|
|
22
|
+
const input = node.current;
|
|
23
|
+
if (!input) return;
|
|
24
|
+
if (value !== void 0 && input.value !== value) input.value = value;
|
|
25
|
+
if (checked !== void 0) input.checked = checked;
|
|
26
|
+
if (indeterminate !== void 0 && input.indeterminate !== indeterminate) input.indeterminate = indeterminate;
|
|
27
|
+
}, [
|
|
28
|
+
value,
|
|
29
|
+
checked,
|
|
30
|
+
indeterminate
|
|
31
|
+
]);
|
|
32
|
+
return /* @__PURE__ */ jsx("input", {
|
|
33
|
+
...attributes,
|
|
34
|
+
ref: node,
|
|
35
|
+
defaultValue: initial.current,
|
|
36
|
+
defaultChecked: checked
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { NativeInput };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NativeTextarea — неуправляемая `<textarea>`, чей текст ведёт ядро: то же,
|
|
3
|
+
* что `NativeInput`. AGENTS.md (React), «Поля ввода».
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactElement, TextareaHTMLAttributes } from 'react';
|
|
6
|
+
export type TNativeTextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'defaultValue'> & {
|
|
7
|
+
/** Текст, который ведёт ядро; `undefined` — пустое поле. */
|
|
8
|
+
text: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare function NativeTextarea({ text, ...attributes }: TNativeTextareaProps): ReactElement;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useLayoutEffect, useRef } from "react";
|
|
4
|
+
//#region src/adapter/runtime/NativeTextarea.tsx
|
|
5
|
+
/**
|
|
6
|
+
* NativeTextarea — неуправляемая `<textarea>`, чей текст ведёт ядро: то же,
|
|
7
|
+
* что `NativeInput`. AGENTS.md (React), «Поля ввода».
|
|
8
|
+
*/
|
|
9
|
+
function NativeTextarea({ text, ...attributes }) {
|
|
10
|
+
const node = useRef(null);
|
|
11
|
+
const value = text ?? "";
|
|
12
|
+
const initial = useRef(value);
|
|
13
|
+
useLayoutEffect(() => {
|
|
14
|
+
const textarea = node.current;
|
|
15
|
+
if (textarea && textarea.value !== value) textarea.value = value;
|
|
16
|
+
}, [value]);
|
|
17
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
18
|
+
...attributes,
|
|
19
|
+
ref: node,
|
|
20
|
+
defaultValue: initial.current
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { NativeTextarea };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Teleport — аналог `<teleport :to>` Vue: рисует содержимое в элементе по
|
|
3
|
+
* селектору цели. Контейнер портала — одна обёртка на всё монтирование, и
|
|
4
|
+
* двигается она, а не узлы React. AGENTS.md (React), «Teleport».
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactNode } from 'react';
|
|
7
|
+
export type TTeleportProps = {
|
|
8
|
+
/** Селектор цели: `body`, `#layers`. */
|
|
9
|
+
to: string | undefined;
|
|
10
|
+
/** Рисовать на месте, без портала */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export declare function Teleport({ to, disabled, children }: TTeleportProps): ReactNode;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useInsertionEffect, useState, useSyncExternalStore } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
//#region src/adapter/runtime/Teleport.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Teleport — аналог `<teleport :to>` Vue: рисует содержимое в элементе по
|
|
8
|
+
* селектору цели. Контейнер портала — одна обёртка на всё монтирование, и
|
|
9
|
+
* двигается она, а не узлы React. AGENTS.md (React), «Teleport».
|
|
10
|
+
*/
|
|
11
|
+
var subscribe = () => () => {};
|
|
12
|
+
var onClient = () => true;
|
|
13
|
+
var onServer = () => false;
|
|
14
|
+
/** Стиль обёртки и узла места: своей коробки у них нет. */
|
|
15
|
+
var CONTENTS = { display: "contents" };
|
|
16
|
+
/** Ключ портала — один на все рендеры: узел места рядом его не сдвинет. */
|
|
17
|
+
var PORTAL_KEY = "teleport";
|
|
18
|
+
function targetOf(selector) {
|
|
19
|
+
return selector ? document.querySelector(selector) : null;
|
|
20
|
+
}
|
|
21
|
+
function advance(phase, client, disabled, target) {
|
|
22
|
+
if (phase === "wrapped") return phase;
|
|
23
|
+
if (!client) return disabled ? "placed" : phase;
|
|
24
|
+
if (phase === "placed") return disabled ? phase : "wrapped";
|
|
25
|
+
return disabled || target ? "wrapped" : phase;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Обёртка и её место: цель, куда её положил insertion-эффект, или узел места,
|
|
29
|
+
* куда её положил его ref.
|
|
30
|
+
*/
|
|
31
|
+
var TTeleportWrapper = class {
|
|
32
|
+
/** Заводится на клиенте, когда впервые нужна. */
|
|
33
|
+
_node = null;
|
|
34
|
+
_target = null;
|
|
35
|
+
_place = null;
|
|
36
|
+
get node() {
|
|
37
|
+
if (!this._node) {
|
|
38
|
+
this._node = document.createElement("div");
|
|
39
|
+
this._node.style.display = "contents";
|
|
40
|
+
}
|
|
41
|
+
return this._node;
|
|
42
|
+
}
|
|
43
|
+
/** Обёртку — в цель; цели нет — эффект её не трогает, очистки нет. */
|
|
44
|
+
enter(target) {
|
|
45
|
+
if (!target) return void 0;
|
|
46
|
+
target.appendChild(this.node);
|
|
47
|
+
this._target = target;
|
|
48
|
+
return this.leave;
|
|
49
|
+
}
|
|
50
|
+
leave = () => {
|
|
51
|
+
this._takeFrom(this._target);
|
|
52
|
+
this._target = null;
|
|
53
|
+
};
|
|
54
|
+
/** Ref узла места: обёртку — в него, при снятии — вон из него. */
|
|
55
|
+
place = (node) => {
|
|
56
|
+
if (node) node.appendChild(this.node);
|
|
57
|
+
else this._takeFrom(this._place);
|
|
58
|
+
this._place = node;
|
|
59
|
+
};
|
|
60
|
+
_takeFrom(parent) {
|
|
61
|
+
const node = this._node;
|
|
62
|
+
if (node && parent && node.parentNode === parent) node.remove();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
function Teleport({ to, disabled = false, children }) {
|
|
66
|
+
const client = useSyncExternalStore(subscribe, onClient, onServer);
|
|
67
|
+
const [wrapper] = useState(() => new TTeleportWrapper());
|
|
68
|
+
const target = client && !disabled ? targetOf(to) : null;
|
|
69
|
+
const [stored, setPhase] = useState(() => advance("none", client, disabled, target));
|
|
70
|
+
const phase = advance(stored, client, disabled, target);
|
|
71
|
+
if (phase !== stored) setPhase(phase);
|
|
72
|
+
const into = phase === "wrapped" ? target : null;
|
|
73
|
+
useInsertionEffect(() => wrapper.enter(into), [wrapper, into]);
|
|
74
|
+
if (phase === "none") return null;
|
|
75
|
+
if (phase === "placed") return children;
|
|
76
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [disabled ? /* @__PURE__ */ jsx("div", {
|
|
77
|
+
ref: wrapper.place,
|
|
78
|
+
style: CONTENTS
|
|
79
|
+
}) : null, createPortal(children, wrapper.node, PORTAL_KEY)] });
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { Teleport };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contexts being accepted right now, only while `TBuilt.accept` runs. The
|
|
3
|
+
* consumer's sink of such a context drops its events (`TEventCallbacks`):
|
|
4
|
+
* what the acceptance writes is the starting state.
|
|
5
|
+
*/
|
|
6
|
+
import type { IAdapterContext } from '@soxa-ui/setup';
|
|
7
|
+
/** Run the acceptance of the contexts with their consumers silent. */
|
|
8
|
+
export declare function accepting(contexts: IAdapterContext | readonly IAdapterContext[], accept: () => void): void;
|
|
9
|
+
/** Whether the context is being accepted right now. */
|
|
10
|
+
export declare function isAccepting(context: IAdapterContext): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/adapter/runtime/accepting.ts
|
|
2
|
+
var now = /* @__PURE__ */ new Set();
|
|
3
|
+
/** Run the acceptance of the contexts with their consumers silent. */
|
|
4
|
+
function accepting(contexts, accept) {
|
|
5
|
+
const list = Array.isArray(contexts) ? contexts : [contexts];
|
|
6
|
+
for (const context of list) now.add(context);
|
|
7
|
+
try {
|
|
8
|
+
accept();
|
|
9
|
+
} finally {
|
|
10
|
+
for (const context of list) now.delete(context);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Whether the context is being accepted right now. */
|
|
14
|
+
function isAccepting(context) {
|
|
15
|
+
return now.has(context);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { accepting, isAccepting };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TClickAction — the action of a part on a click, as a native listener on the
|
|
3
|
+
* node: AGENTS.md (React), «Клик части». A class, not a closure:
|
|
4
|
+
* AGENTS.md (React), «Функции дольше рендера — в классах».
|
|
5
|
+
*/
|
|
6
|
+
export declare class TClickAction {
|
|
7
|
+
private _action;
|
|
8
|
+
private _node;
|
|
9
|
+
/** The action of the last render. */
|
|
10
|
+
update(action: (event: Event) => void): void;
|
|
11
|
+
/** The ref of the node: the listener moves with the node. */
|
|
12
|
+
readonly ref: (node: Element | null) => void;
|
|
13
|
+
private readonly _listener;
|
|
14
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/adapter/runtime/click-action.class.ts
|
|
2
|
+
/**
|
|
3
|
+
* TClickAction — the action of a part on a click, as a native listener on the
|
|
4
|
+
* node: AGENTS.md (React), «Клик части». A class, not a closure:
|
|
5
|
+
* AGENTS.md (React), «Функции дольше рендера — в классах».
|
|
6
|
+
*/
|
|
7
|
+
var TClickAction = class {
|
|
8
|
+
_action = () => {};
|
|
9
|
+
_node = null;
|
|
10
|
+
/** The action of the last render. */
|
|
11
|
+
update(action) {
|
|
12
|
+
this._action = action;
|
|
13
|
+
}
|
|
14
|
+
/** The ref of the node: the listener moves with the node. */
|
|
15
|
+
ref = (node) => {
|
|
16
|
+
if (node === this._node) return;
|
|
17
|
+
this._node?.removeEventListener("click", this._listener);
|
|
18
|
+
this._node = node;
|
|
19
|
+
node?.addEventListener("click", this._listener);
|
|
20
|
+
};
|
|
21
|
+
_listener = (event) => {
|
|
22
|
+
this._action(event);
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { TClickAction };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TDrafts — сборки, которые React ещё не принял, и освобождение тех, что он
|
|
3
|
+
* отбросил. AGENTS.md (React), «Срок жизни контекста».
|
|
4
|
+
*
|
|
5
|
+
* 1. `take(options)` — до сборки контекста: уничтожает непринятую сборку с
|
|
6
|
+
* тем же `ctrl` или движком и отдаёт взятое;
|
|
7
|
+
* 2. `add(held, destroy)` — собранное становится черновиком;
|
|
8
|
+
* 3. `accept(held)` при коммите — больше не черновик.
|
|
9
|
+
*/
|
|
10
|
+
import type { IAdapterContextOptions } from '@soxa-ui/setup';
|
|
11
|
+
export type TTaken = {
|
|
12
|
+
readonly held: object[];
|
|
13
|
+
readonly mountId?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare class TDrafts {
|
|
16
|
+
/** Непринятые сборки — по каждому объекту, который они взяли снаружи. */
|
|
17
|
+
private readonly _drafts;
|
|
18
|
+
/** Взятое снаружи — `ctrl` и движок фасада; id — выброшенного черновика того же `ctrl`. */
|
|
19
|
+
take(options: IAdapterContextOptions): TTaken;
|
|
20
|
+
add(held: readonly object[], destroy: () => void, mountId: string): void;
|
|
21
|
+
accept(held: readonly object[]): void;
|
|
22
|
+
private _discard;
|
|
23
|
+
private _forget;
|
|
24
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/adapter/runtime/drafts.class.ts
|
|
2
|
+
function isObject(value) {
|
|
3
|
+
return typeof value === "object" && value !== null;
|
|
4
|
+
}
|
|
5
|
+
var TDrafts = class {
|
|
6
|
+
/** Непринятые сборки — по каждому объекту, который они взяли снаружи. */
|
|
7
|
+
_drafts = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
/** Взятое снаружи — `ctrl` и движок фасада; id — выброшенного черновика того же `ctrl`. */
|
|
9
|
+
take(options) {
|
|
10
|
+
const engine = options.options ? Reflect.get(options.options, "engine") : void 0;
|
|
11
|
+
const held = [options.ctrl, engine].filter(isObject);
|
|
12
|
+
const mountId = options.ctrl ? this._drafts.get(options.ctrl)?.mountId : void 0;
|
|
13
|
+
for (const value of held) this._discard(value);
|
|
14
|
+
return {
|
|
15
|
+
held,
|
|
16
|
+
mountId
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
add(held, destroy, mountId) {
|
|
20
|
+
const draft = {
|
|
21
|
+
held,
|
|
22
|
+
destroy,
|
|
23
|
+
mountId
|
|
24
|
+
};
|
|
25
|
+
for (const value of held) this._drafts.set(value, draft);
|
|
26
|
+
}
|
|
27
|
+
accept(held) {
|
|
28
|
+
this._forget(held);
|
|
29
|
+
}
|
|
30
|
+
_discard(value) {
|
|
31
|
+
const draft = this._drafts.get(value);
|
|
32
|
+
if (draft === void 0) return;
|
|
33
|
+
this._forget(draft.held);
|
|
34
|
+
draft.destroy();
|
|
35
|
+
}
|
|
36
|
+
_forget(held) {
|
|
37
|
+
for (const value of held) if (this._drafts.get(value)?.held === held) this._drafts.delete(value);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { TDrafts };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TEventCallbacks — the binding's event sink: an event goes to the callback
|
|
3
|
+
* prop of the same name from the last render's props. A class, not a closure:
|
|
4
|
+
* AGENTS.md (React), «Функции дольше рендера — в классах».
|
|
5
|
+
*/
|
|
6
|
+
import type { IAdapterContext, TEventSink, TExchange } from '@soxa-ui/setup';
|
|
7
|
+
export declare class TEventCallbacks {
|
|
8
|
+
private readonly _adapter;
|
|
9
|
+
private _props;
|
|
10
|
+
/** The subscription of the last `listen`. */
|
|
11
|
+
private _stop?;
|
|
12
|
+
/** @param _adapter the context whose events the sink takes */
|
|
13
|
+
constructor(_adapter: IAdapterContext);
|
|
14
|
+
update(props: object): void;
|
|
15
|
+
readonly sink: TEventSink;
|
|
16
|
+
/**
|
|
17
|
+
* Listen to the binding until the context's `detach`, which comes from the
|
|
18
|
+
* teardown's first moment or, for a collection item, from its collection.
|
|
19
|
+
* Returns the layout effect's cleanup (`release`).
|
|
20
|
+
*/
|
|
21
|
+
listen(binding: TExchange): () => void;
|
|
22
|
+
/**
|
|
23
|
+
* The layout effect's cleanup is the teardown's first moment: React runs
|
|
24
|
+
* every layout cleanup of a removed subtree before any passive one, and the
|
|
25
|
+
* destruction is a passive cleanup (`useAdapterContext`). So it ends the
|
|
26
|
+
* subscription and detaches the context.
|
|
27
|
+
*/
|
|
28
|
+
readonly release: () => void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { isAccepting } from "./accepting.js";
|
|
2
|
+
//#region src/adapter/runtime/event-callbacks.class.ts
|
|
3
|
+
var TEventCallbacks = class {
|
|
4
|
+
_adapter;
|
|
5
|
+
_props = {};
|
|
6
|
+
/** The subscription of the last `listen`. */
|
|
7
|
+
_stop;
|
|
8
|
+
/** @param _adapter the context whose events the sink takes */
|
|
9
|
+
constructor(_adapter) {
|
|
10
|
+
this._adapter = _adapter;
|
|
11
|
+
}
|
|
12
|
+
update(props) {
|
|
13
|
+
this._props = props;
|
|
14
|
+
}
|
|
15
|
+
sink = (name, args) => {
|
|
16
|
+
if (isAccepting(this._adapter)) return;
|
|
17
|
+
const callback = Reflect.get(this._props, name);
|
|
18
|
+
if (typeof callback === "function") callback(...args);
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Listen to the binding until the context's `detach`, which comes from the
|
|
22
|
+
* teardown's first moment or, for a collection item, from its collection.
|
|
23
|
+
* Returns the layout effect's cleanup (`release`).
|
|
24
|
+
*/
|
|
25
|
+
listen(binding) {
|
|
26
|
+
const stop = binding.events.listen(this.sink);
|
|
27
|
+
this._stop = stop;
|
|
28
|
+
this._adapter.events.on("detach", stop);
|
|
29
|
+
return this.release;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The layout effect's cleanup is the teardown's first moment: React runs
|
|
33
|
+
* every layout cleanup of a removed subtree before any passive one, and the
|
|
34
|
+
* destruction is a passive cleanup (`useAdapterContext`). So it ends the
|
|
35
|
+
* subscription and detaches the context.
|
|
36
|
+
*/
|
|
37
|
+
release = () => {
|
|
38
|
+
this._stop?.();
|
|
39
|
+
this._stop = void 0;
|
|
40
|
+
this._adapter.detach();
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { TEventCallbacks };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { useAdapter, useCollectionAdapter } from './useAdapter';
|
|
2
|
+
export { useAdapterContext } from './useAdapterContext';
|
|
3
|
+
export { useComponent } from './useComponent';
|
|
4
|
+
export { useRootElement } from './useRootElement';
|
|
5
|
+
export { useClickAction } from './useClickAction';
|
|
6
|
+
export { withRenderBoundary } from './withRenderBoundary';
|
|
7
|
+
export { Teleport } from './Teleport';
|
|
8
|
+
export { NativeInput } from './NativeInput';
|
|
9
|
+
export { NativeTextarea } from './NativeTextarea';
|
|
10
|
+
export type { TBinding, TCollectionBinding } from './useAdapter';
|
|
11
|
+
export type { TConsumerRef, TRootSource } from './root-ref.class';
|
|
12
|
+
export type { TAdapterContexts, TAssembly, TCreateAdapterContext } from './useAdapterContext';
|
|
13
|
+
export type { TComponentBinding } from './useComponent';
|
|
14
|
+
export type { TTeleportProps } from './Teleport';
|
|
15
|
+
export type { TNativeInputLive, TNativeInputProps } from './NativeInput';
|
|
16
|
+
export type { TNativeTextareaProps } from './NativeTextarea';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TRootRef — ref корня компонента: узел привязывается к `TElementPlugin`
|
|
3
|
+
* контекста, и тот же узел получает `ref` потребителя; корень значением —
|
|
4
|
+
* подпиской (`TRootSource`). AGENTS.md (React), «Корень и `ref` потребителя».
|
|
5
|
+
*/
|
|
6
|
+
import type { Ref } from 'react';
|
|
7
|
+
import type { IAdapterContext } from '@soxa-ui/setup';
|
|
8
|
+
/** `ref` потребителя. Узел — `Element`: `tag` свободен, корнем бывает `<svg>`. */
|
|
9
|
+
export type TConsumerRef = Ref<Element> | undefined;
|
|
10
|
+
/** Корень значением — подписка и снимок, как их ждёт `useSyncExternalStore`. */
|
|
11
|
+
export type TRootSource = {
|
|
12
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
13
|
+
/** Корень сейчас: до коммита, после снятия и у уничтоженного — `null`. */
|
|
14
|
+
readonly getSnapshot: () => Element | null;
|
|
15
|
+
};
|
|
16
|
+
/** `ref` потребителя из пропсов: в React 19 это обычный проп. */
|
|
17
|
+
export declare function consumerRefOf(props: object): TConsumerRef;
|
|
18
|
+
export declare class TRootRef implements TRootSource {
|
|
19
|
+
/** Контекст корня; уничтожен — `null`, и ref больше ничего не делает. */
|
|
20
|
+
private _context;
|
|
21
|
+
private _node;
|
|
22
|
+
/** `ref` потребителя последнего коммита. */
|
|
23
|
+
private _consumer;
|
|
24
|
+
private _given;
|
|
25
|
+
/** Заводятся с первым подписчиком — у большинства компонентов их нет. */
|
|
26
|
+
private _listeners;
|
|
27
|
+
constructor(adapter: IAdapterContext);
|
|
28
|
+
/** Ref корня: привязка к `TElementPlugin`, затем тот же узел — `ref` потребителя. */
|
|
29
|
+
readonly attach: (element: Element | null) => void;
|
|
30
|
+
readonly subscribe: (listener: () => void) => (() => void);
|
|
31
|
+
readonly getSnapshot: () => Element | null;
|
|
32
|
+
/** Ref корня внутри обёртки: только привязка — `ref` потребителя получает обёртка. */
|
|
33
|
+
readonly bind: (element: Element | null) => void;
|
|
34
|
+
/** `ref` потребителя коммита — раньше, чем React привяжет ref узлов. */
|
|
35
|
+
consume(ref: TConsumerRef): void;
|
|
36
|
+
/** Сменился узел или `ref` потребителя: прежнему — отпустить, новому — отдать. */
|
|
37
|
+
sync(): void;
|
|
38
|
+
private _destroy;
|
|
39
|
+
}
|