UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

130 lines (128 loc) 4.88 kB
"use strict"; "use client"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var StackToolbar_exports = {}; __export(StackToolbar_exports, { StackToolbar: () => StackToolbar, StackToolbarBadge: () => StackToolbarBadge, StackToolbarButton: () => StackToolbarButton, StackToolbarIcon: () => StackToolbarIcon, StackToolbarLabel: () => StackToolbarLabel, StackToolbarMenu: () => StackToolbarMenu, StackToolbarMenuAction: () => StackToolbarMenuAction, StackToolbarSearchBarSlot: () => StackToolbarSearchBarSlot, StackToolbarSpacer: () => StackToolbarSpacer, StackToolbarView: () => StackToolbarView, appendStackToolbarPropsToOptions: () => appendStackToolbarPropsToOptions }); module.exports = __toCommonJS(StackToolbar_exports); var import_react = require("react"); var import_use_isomorphic_layout_effect = require("@vxrn/use-isomorphic-layout-effect"); var import_children = require("../../headless/children.native.js"); var import_useNavigation = require("../../router/useNavigation.native.js"); var import_StackToolbarImplementation = require("./StackToolbarImplementation.native.js"); var import_StackToolbar = require("./StackToolbar.shared"); function appendStackToolbarPropsToOptions(options, props, implementation) { var optionsWithConfig = (0, import_StackToolbar.appendStackToolbarConfig)(options, props); return implementation ? implementation.appendPropsToOptions(optionsWithConfig, props) : optionsWithConfig; } function StackToolbarComponent(props) { var _ref; var navigation = (0, import_useNavigation.useNavigation)(); var implementation = (0, import_StackToolbarImplementation.getStackToolbarImplementation)(); var options = (0, import_react.useMemo)(function () { return appendStackToolbarPropsToOptions({}, props, implementation); }, [implementation, props.placement, props.asChild, props.children, props.disableImePadding, props.tintColor, props.backgroundColor]); (0, import_use_isomorphic_layout_effect.useIsomorphicLayoutEffect)(function () { navigation.setOptions(options); }, [navigation, options]); return (_ref = implementation === null || implementation === void 0 ? void 0 : implementation.render(props)) !== null && _ref !== void 0 ? _ref : null; } function StackToolbarButton(_props) { return null; } function StackToolbarMenu(_props) { return null; } function StackToolbarMenuAction(_props) { return null; } function StackToolbarSpacer(_props) { return null; } function StackToolbarSearchBarSlot(_props) { return null; } function StackToolbarView(_props) { return null; } function StackToolbarLabel(_props) { return null; } function StackToolbarIcon(_props) { return null; } function StackToolbarBadge(_props) { return null; } Object.assign(StackToolbarButton, { [import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "button" }); Object.assign(StackToolbarMenu, { [import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "menu" }); Object.assign(StackToolbarMenuAction, { [import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "menuAction" }); Object.assign(StackToolbarSpacer, { [import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "spacer" }); Object.assign(StackToolbarSearchBarSlot, { [import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "searchBarSlot" }); Object.assign(StackToolbarView, { [import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "view" }); Object.assign(StackToolbarLabel, { [import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "label" }); Object.assign(StackToolbarIcon, { [import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "icon" }); Object.assign(StackToolbarBadge, { [import_StackToolbarImplementation.STACK_TOOLBAR_CHILD]: "badge" }); var StackToolbar = Object.assign(StackToolbarComponent, { [import_children.NAVIGATOR_CONFIG]: true, Button: StackToolbarButton, Menu: StackToolbarMenu, MenuAction: StackToolbarMenuAction, Spacer: StackToolbarSpacer, SearchBarSlot: StackToolbarSearchBarSlot, View: StackToolbarView, Label: StackToolbarLabel, Icon: StackToolbarIcon, Badge: StackToolbarBadge }); //# sourceMappingURL=StackToolbar.native.js.map