@asymmetric-effort/specifyjs 0.2.97 → 0.2.100
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/specifyjs-build.cjs.js +160 -1
- package/dist/specifyjs-build.cjs.js.map +7 -1
- package/dist/specifyjs-build.d.ts +1 -110
- package/dist/specifyjs-build.esm.js +160 -1
- package/dist/specifyjs-build.esm.js.map +7 -1
- package/dist/specifyjs-client.cjs.js +2 -1
- package/dist/specifyjs-client.cjs.js.map +7 -1
- package/dist/specifyjs-client.d.ts +1 -159
- package/dist/specifyjs-client.esm.js +2 -1
- package/dist/specifyjs-client.esm.js.map +7 -1
- package/dist/specifyjs-components.cjs.js +8 -1
- package/dist/specifyjs-components.cjs.js.map +7 -1
- package/dist/specifyjs-components.d.ts +1 -3334
- package/dist/specifyjs-components.esm.js +8 -1
- package/dist/specifyjs-components.esm.js.map +7 -1
- package/dist/specifyjs-dom.cjs.js +2 -1
- package/dist/specifyjs-dom.cjs.js.map +7 -1
- package/dist/specifyjs-dom.d.ts +1 -107
- package/dist/specifyjs-dom.esm.js +2 -1
- package/dist/specifyjs-dom.esm.js.map +7 -1
- package/dist/specifyjs-jsx-dev-runtime.cjs.js +2 -1
- package/dist/specifyjs-jsx-dev-runtime.cjs.js.map +7 -1
- package/dist/specifyjs-jsx-dev-runtime.esm.js +2 -1
- package/dist/specifyjs-jsx-dev-runtime.esm.js.map +7 -1
- package/dist/specifyjs-jsx-runtime.cjs.js +2 -1
- package/dist/specifyjs-jsx-runtime.cjs.js.map +7 -1
- package/dist/specifyjs-jsx-runtime.esm.js +2 -1
- package/dist/specifyjs-jsx-runtime.esm.js.map +7 -1
- package/dist/specifyjs-server.cjs.js +2 -1
- package/dist/specifyjs-server.cjs.js.map +7 -1
- package/dist/specifyjs-server.d.ts +1 -136
- package/dist/specifyjs-server.esm.js +2 -1
- package/dist/specifyjs-server.esm.js.map +7 -1
- package/dist/specifyjs-telemetry.cjs.js +2 -1
- package/dist/specifyjs-telemetry.cjs.js.map +7 -1
- package/dist/specifyjs-telemetry.d.ts +1 -165
- package/dist/specifyjs-telemetry.esm.js +2 -1
- package/dist/specifyjs-telemetry.esm.js.map +7 -1
- package/dist/specifyjs.cjs.js +2 -1
- package/dist/specifyjs.cjs.js.map +7 -1
- package/dist/specifyjs.d.ts +1 -581
- package/dist/specifyjs.esm.js +2 -1
- package/dist/specifyjs.esm.js.map +7 -1
- package/dist/types/build/index.d.ts +5 -0
- package/dist/types/build/index.d.ts.map +1 -0
- package/dist/types/build/noscript-plugin.d.ts +63 -0
- package/dist/types/build/noscript-plugin.d.ts.map +1 -0
- package/dist/types/build/seo-plugin.d.ts +43 -0
- package/dist/types/build/seo-plugin.d.ts.map +1 -0
- package/dist/types/client/graphql.d.ts +64 -0
- package/dist/types/client/graphql.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +4 -0
- package/dist/types/client/index.d.ts.map +1 -0
- package/dist/types/client/protobuf.d.ts +40 -0
- package/dist/types/client/protobuf.d.ts.map +1 -0
- package/dist/types/client/rest.d.ts +61 -0
- package/dist/types/client/rest.d.ts.map +1 -0
- package/dist/types/components/ad/adsense/src/AdSense.d.ts +19 -0
- package/dist/types/components/ad/adsense/src/index.d.ts +2 -0
- package/dist/types/components/analytics/google-analytics/src/GoogleAnalytics.d.ts +13 -0
- package/dist/types/components/analytics/google-analytics/src/index.d.ts +2 -0
- package/dist/types/components/component.d.ts +39 -0
- package/dist/types/components/component.d.ts.map +1 -0
- package/dist/types/components/data/analog-clock/src/AnalogClock.d.ts +17 -0
- package/dist/types/components/data/analog-clock/src/index.d.ts +2 -0
- package/dist/types/components/data/avatar/src/Avatar.d.ts +19 -0
- package/dist/types/components/data/avatar/src/index.d.ts +2 -0
- package/dist/types/components/data/badge/src/Badge.d.ts +17 -0
- package/dist/types/components/data/badge/src/index.d.ts +2 -0
- package/dist/types/components/data/data-grid/src/DataGrid.d.ts +47 -0
- package/dist/types/components/data/data-grid/src/index.d.ts +2 -0
- package/dist/types/components/data/digital-clock/src/DigitalClock.d.ts +15 -0
- package/dist/types/components/data/digital-clock/src/index.d.ts +2 -0
- package/dist/types/components/data/list-view/src/ListView.d.ts +23 -0
- package/dist/types/components/data/list-view/src/index.d.ts +2 -0
- package/dist/types/components/data/tag/src/Tag.d.ts +21 -0
- package/dist/types/components/data/tag/src/index.d.ts +2 -0
- package/dist/types/components/data/virtual-scroll/src/VirtualScroll.d.ts +13 -0
- package/dist/types/components/data/virtual-scroll/src/index.d.ts +2 -0
- package/dist/types/components/error-boundary.d.ts +23 -0
- package/dist/types/components/error-boundary.d.ts.map +1 -0
- package/dist/types/components/errors/_shared/src/HttpErrorPage.d.ts +15 -0
- package/dist/types/components/errors/_shared/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-400/src/Http400.d.ts +9 -0
- package/dist/types/components/errors/http-400/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-401/src/Http401.d.ts +9 -0
- package/dist/types/components/errors/http-401/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-403/src/Http403.d.ts +9 -0
- package/dist/types/components/errors/http-403/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-404/src/Http404.d.ts +9 -0
- package/dist/types/components/errors/http-404/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-405/src/Http405.d.ts +9 -0
- package/dist/types/components/errors/http-405/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-408/src/Http408.d.ts +9 -0
- package/dist/types/components/errors/http-408/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-429/src/Http429.d.ts +9 -0
- package/dist/types/components/errors/http-429/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-500/src/Http500.d.ts +9 -0
- package/dist/types/components/errors/http-500/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-502/src/Http502.d.ts +9 -0
- package/dist/types/components/errors/http-502/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-503/src/Http503.d.ts +9 -0
- package/dist/types/components/errors/http-503/src/index.d.ts +2 -0
- package/dist/types/components/errors/http-504/src/Http504.d.ts +9 -0
- package/dist/types/components/errors/http-504/src/index.d.ts +2 -0
- package/dist/types/components/feedback/alert/src/Alert.d.ts +25 -0
- package/dist/types/components/feedback/alert/src/index.d.ts +2 -0
- package/dist/types/components/feedback/empty-state/src/EmptyState.d.ts +17 -0
- package/dist/types/components/feedback/empty-state/src/index.d.ts +2 -0
- package/dist/types/components/feedback/progress-bar/src/ProgressBar.d.ts +23 -0
- package/dist/types/components/feedback/progress-bar/src/index.d.ts +2 -0
- package/dist/types/components/feedback/skeleton/src/Skeleton.d.ts +15 -0
- package/dist/types/components/feedback/skeleton/src/index.d.ts +2 -0
- package/dist/types/components/feedback/spinner/src/Spinner.d.ts +13 -0
- package/dist/types/components/feedback/spinner/src/index.d.ts +2 -0
- package/dist/types/components/form/button/src/Button.d.ts +25 -0
- package/dist/types/components/form/button/src/index.d.ts +2 -0
- package/dist/types/components/form/checkbox/src/Checkbox.d.ts +19 -0
- package/dist/types/components/form/checkbox/src/index.d.ts +2 -0
- package/dist/types/components/form/color-picker/src/ColorPicker.d.ts +19 -0
- package/dist/types/components/form/color-picker/src/index.d.ts +2 -0
- package/dist/types/components/form/color-wheel/src/ColorWheel.d.ts +17 -0
- package/dist/types/components/form/color-wheel/src/index.d.ts +2 -0
- package/dist/types/components/form/datepicker/src/DatePicker.d.ts +23 -0
- package/dist/types/components/form/datepicker/src/index.d.ts +2 -0
- package/dist/types/components/form/file-upload/src/FileUpload.d.ts +19 -0
- package/dist/types/components/form/file-upload/src/index.d.ts +2 -0
- package/dist/types/components/form/multiline/src/MultilineField.d.ts +41 -0
- package/dist/types/components/form/multiline/src/index.d.ts +2 -0
- package/dist/types/components/form/number-spinner/src/NumberSpinner.d.ts +25 -0
- package/dist/types/components/form/number-spinner/src/index.d.ts +2 -0
- package/dist/types/components/form/radio/src/RadioGroup.d.ts +26 -0
- package/dist/types/components/form/radio/src/index.d.ts +2 -0
- package/dist/types/components/form/select/src/Select.d.ts +33 -0
- package/dist/types/components/form/select/src/index.d.ts +2 -0
- package/dist/types/components/form/slider/src/Slider.d.ts +33 -0
- package/dist/types/components/form/slider/src/index.d.ts +2 -0
- package/dist/types/components/form/texteditor/src/TextEditor.d.ts +46 -0
- package/dist/types/components/form/texteditor/src/index.d.ts +2 -0
- package/dist/types/components/form/textfield/src/TextField.d.ts +48 -0
- package/dist/types/components/form/textfield/src/index.d.ts +2 -0
- package/dist/types/components/form/timepicker/src/TimePicker.d.ts +29 -0
- package/dist/types/components/form/timepicker/src/index.d.ts +2 -0
- package/dist/types/components/form/toggle/src/Toggle.d.ts +19 -0
- package/dist/types/components/form/toggle/src/index.d.ts +2 -0
- package/dist/types/components/form/wrapper/src/FormFieldWrapper.d.ts +67 -0
- package/dist/types/components/form/wrapper/src/index.d.ts +2 -0
- package/dist/types/components/layout/card/src/Card.d.ts +31 -0
- package/dist/types/components/layout/card/src/index.d.ts +2 -0
- package/dist/types/components/layout/desktop-background/src/DesktopBackground.d.ts +23 -0
- package/dist/types/components/layout/desktop-background/src/index.d.ts +2 -0
- package/dist/types/components/layout/draggable-window/src/DraggableWindow.d.ts +59 -0
- package/dist/types/components/layout/draggable-window/src/index.d.ts +2 -0
- package/dist/types/components/layout/flex-container/src/FlexContainer.d.ts +42 -0
- package/dist/types/components/layout/flex-container/src/index.d.ts +2 -0
- package/dist/types/components/layout/footer/src/Footer.d.ts +25 -0
- package/dist/types/components/layout/footer/src/index.d.ts +2 -0
- package/dist/types/components/layout/grid/src/Grid.d.ts +54 -0
- package/dist/types/components/layout/grid/src/index.d.ts +2 -0
- package/dist/types/components/layout/panel/src/Panel.d.ts +23 -0
- package/dist/types/components/layout/panel/src/index.d.ts +2 -0
- package/dist/types/components/layout/scroll-container/src/ScrollContainer.d.ts +21 -0
- package/dist/types/components/layout/scroll-container/src/index.d.ts +2 -0
- package/dist/types/components/layout/splitter/src/Splitter.d.ts +19 -0
- package/dist/types/components/layout/splitter/src/index.d.ts +2 -0
- package/dist/types/components/layout/tabs/src/Tabs.d.ts +29 -0
- package/dist/types/components/layout/tabs/src/index.d.ts +2 -0
- package/dist/types/components/layout/window-manager/src/WindowManager.d.ts +106 -0
- package/dist/types/components/layout/window-manager/src/index.d.ts +2 -0
- package/dist/types/components/math/src/index.d.ts +5 -0
- package/dist/types/components/math/src/mat.d.ts +71 -0
- package/dist/types/components/math/src/mat4.d.ts +101 -0
- package/dist/types/components/math/src/quaternion.d.ts +62 -0
- package/dist/types/components/math/src/solver.d.ts +55 -0
- package/dist/types/components/math/src/vec.d.ts +54 -0
- package/dist/types/components/media/carousel/src/Carousel.d.ts +23 -0
- package/dist/types/components/media/carousel/src/index.d.ts +2 -0
- package/dist/types/components/media/image/src/Image.d.ts +23 -0
- package/dist/types/components/media/image/src/index.d.ts +2 -0
- package/dist/types/components/media/video-player/src/VideoPlayer.d.ts +27 -0
- package/dist/types/components/media/video-player/src/index.d.ts +2 -0
- package/dist/types/components/nav/accordion/src/Accordion.d.ts +52 -0
- package/dist/types/components/nav/accordion/src/index.d.ts +2 -0
- package/dist/types/components/nav/breadcrumb/src/Breadcrumb.d.ts +20 -0
- package/dist/types/components/nav/breadcrumb/src/index.d.ts +2 -0
- package/dist/types/components/nav/dock/src/Dock.d.ts +46 -0
- package/dist/types/components/nav/dock/src/index.d.ts +2 -0
- package/dist/types/components/nav/dropdown/src/Dropdown.d.ts +36 -0
- package/dist/types/components/nav/dropdown/src/index.d.ts +2 -0
- package/dist/types/components/nav/menubar/src/Menubar.d.ts +27 -0
- package/dist/types/components/nav/menubar/src/index.d.ts +2 -0
- package/dist/types/components/nav/pagination/src/Pagination.d.ts +19 -0
- package/dist/types/components/nav/pagination/src/index.d.ts +2 -0
- package/dist/types/components/nav/sidebar/src/Sidebar.d.ts +29 -0
- package/dist/types/components/nav/sidebar/src/index.d.ts +2 -0
- package/dist/types/components/nav/stepper/src/Stepper.d.ts +25 -0
- package/dist/types/components/nav/stepper/src/index.d.ts +2 -0
- package/dist/types/components/nav/system-tray/src/SystemTray.d.ts +47 -0
- package/dist/types/components/nav/system-tray/src/index.d.ts +2 -0
- package/dist/types/components/nav/toolbar/src/Toolbar.d.ts +27 -0
- package/dist/types/components/nav/toolbar/src/index.d.ts +2 -0
- package/dist/types/components/nav/treenav/src/TreeNav.d.ts +34 -0
- package/dist/types/components/nav/treenav/src/TreeNode.d.ts +74 -0
- package/dist/types/components/nav/treenav/src/index.d.ts +4 -0
- package/dist/types/components/nav/wrapper/src/NavWrapper.d.ts +73 -0
- package/dist/types/components/nav/wrapper/src/index.d.ts +2 -0
- package/dist/types/components/overlay/context-menu/src/ContextMenu.d.ts +21 -0
- package/dist/types/components/overlay/context-menu/src/index.d.ts +2 -0
- package/dist/types/components/overlay/drawer/src/Drawer.d.ts +22 -0
- package/dist/types/components/overlay/drawer/src/index.d.ts +2 -0
- package/dist/types/components/overlay/modal/src/Modal.d.ts +22 -0
- package/dist/types/components/overlay/modal/src/index.d.ts +2 -0
- package/dist/types/components/overlay/popover/src/Popover.d.ts +20 -0
- package/dist/types/components/overlay/popover/src/index.d.ts +2 -0
- package/dist/types/components/overlay/toast/src/Toast.d.ts +59 -0
- package/dist/types/components/overlay/toast/src/index.d.ts +2 -0
- package/dist/types/components/overlay/tooltip/src/Tooltip.d.ts +14 -0
- package/dist/types/components/overlay/tooltip/src/index.d.ts +2 -0
- package/dist/types/components/page/ide/src/IDE.d.ts +5 -0
- package/dist/types/components/page/ide/src/index.d.ts +2 -0
- package/dist/types/components/page/trading-dashboard/src/TradingDashboard.d.ts +5 -0
- package/dist/types/components/page/trading-dashboard/src/index.d.ts +2 -0
- package/dist/types/components/page/unity-desktop/src/UnityApp.d.ts +30 -0
- package/dist/types/components/page/unity-desktop/src/UnityDesktop.d.ts +30 -0
- package/dist/types/components/page/unity-desktop/src/index.d.ts +4 -0
- package/dist/types/components/page/word-processor/src/WordProcessor.d.ts +7 -0
- package/dist/types/components/page/word-processor/src/index.d.ts +2 -0
- package/dist/types/components/profiler.d.ts +6 -0
- package/dist/types/components/profiler.d.ts.map +1 -0
- package/dist/types/components/strict-mode.d.ts +6 -0
- package/dist/types/components/strict-mode.d.ts.map +1 -0
- package/dist/types/components/suspense.d.ts +6 -0
- package/dist/types/components/suspense.d.ts.map +1 -0
- package/dist/types/components/viz/2D-bar-graph/src/BarGraph.d.ts +61 -0
- package/dist/types/components/viz/2D-bar-graph/src/index.d.ts +2 -0
- package/dist/types/components/viz/2D-cartesian-raw/src/CartesianGraph2D.d.ts +40 -0
- package/dist/types/components/viz/2D-cartesian-raw/src/index.d.ts +2 -0
- package/dist/types/components/viz/2D-complex-graph/src/ComplexGraph2D.d.ts +33 -0
- package/dist/types/components/viz/2D-complex-graph/src/index.d.ts +2 -0
- package/dist/types/components/viz/2D-discrete-cartesian/src/DiscreteCartesian2D.d.ts +31 -0
- package/dist/types/components/viz/2D-discrete-cartesian/src/index.d.ts +2 -0
- package/dist/types/components/viz/2D-line-graph/src/LineGraph.d.ts +53 -0
- package/dist/types/components/viz/2D-line-graph/src/index.d.ts +2 -0
- package/dist/types/components/viz/2D-pie-graph/src/PieGraph.d.ts +49 -0
- package/dist/types/components/viz/2D-pie-graph/src/index.d.ts +3 -0
- package/dist/types/components/viz/2D-polar-graph/src/PolarGraph2D.d.ts +35 -0
- package/dist/types/components/viz/2D-polar-graph/src/index.d.ts +2 -0
- package/dist/types/components/viz/3d-layers/src/ThreeDLayers.d.ts +35 -0
- package/dist/types/components/viz/3d-layers/src/index.d.ts +2 -0
- package/dist/types/components/viz/3dSpace/src/Space3D.d.ts +63 -0
- package/dist/types/components/viz/3dSpace/src/animation.d.ts +75 -0
- package/dist/types/components/viz/3dSpace/src/bounds.d.ts +36 -0
- package/dist/types/components/viz/3dSpace/src/camera-controller.d.ts +59 -0
- package/dist/types/components/viz/3dSpace/src/camera.d.ts +43 -0
- package/dist/types/components/viz/3dSpace/src/collision.d.ts +54 -0
- package/dist/types/components/viz/3dSpace/src/cpu-pipeline.d.ts +47 -0
- package/dist/types/components/viz/3dSpace/src/index.d.ts +32 -0
- package/dist/types/components/viz/3dSpace/src/light.d.ts +23 -0
- package/dist/types/components/viz/3dSpace/src/lighting-model.d.ts +34 -0
- package/dist/types/components/viz/3dSpace/src/material.d.ts +12 -0
- package/dist/types/components/viz/3dSpace/src/mesh.d.ts +35 -0
- package/dist/types/components/viz/3dSpace/src/picking.d.ts +51 -0
- package/dist/types/components/viz/3dSpace/src/render-pipeline.d.ts +12 -0
- package/dist/types/components/viz/3dSpace/src/scene-graph.d.ts +20 -0
- package/dist/types/components/viz/3dSpace/src/scene-object.d.ts +31 -0
- package/dist/types/components/viz/3dSpace/src/terrain.d.ts +34 -0
- package/dist/types/components/viz/3dSpace/src/texture.d.ts +22 -0
- package/dist/types/components/viz/3dSpace/src/types.d.ts +42 -0
- package/dist/types/components/viz/3dSpace/src/viewport.d.ts +19 -0
- package/dist/types/components/viz/3dSpace/src/webgl-pipeline.d.ts +54 -0
- package/dist/types/components/viz/big-number/src/BigNumber.d.ts +29 -0
- package/dist/types/components/viz/big-number/src/index.d.ts +2 -0
- package/dist/types/components/viz/bloch-sphere/src/BlochSphere.d.ts +73 -0
- package/dist/types/components/viz/bloch-sphere/src/index.d.ts +2 -0
- package/dist/types/components/viz/box-plot/src/BoxPlot.d.ts +47 -0
- package/dist/types/components/viz/box-plot/src/index.d.ts +2 -0
- package/dist/types/components/viz/bubble-chart/src/BubbleChart.d.ts +38 -0
- package/dist/types/components/viz/bubble-chart/src/index.d.ts +2 -0
- package/dist/types/components/viz/calendar-heat-map/src/CalendarHeatMap.d.ts +29 -0
- package/dist/types/components/viz/calendar-heat-map/src/index.d.ts +2 -0
- package/dist/types/components/viz/chord/src/ChordDiagram.d.ts +25 -0
- package/dist/types/components/viz/chord/src/index.d.ts +2 -0
- package/dist/types/components/viz/decomposition-tree/src/DecompositionTree.d.ts +33 -0
- package/dist/types/components/viz/decomposition-tree/src/index.d.ts +2 -0
- package/dist/types/components/viz/earth-globe/src/EarthGlobe.d.ts +62 -0
- package/dist/types/components/viz/earth-globe/src/globe-data.d.ts +23 -0
- package/dist/types/components/viz/earth-globe/src/index.d.ts +5 -0
- package/dist/types/components/viz/force-graph/src/ForceGraph.d.ts +99 -0
- package/dist/types/components/viz/force-graph/src/index.d.ts +2 -0
- package/dist/types/components/viz/funnel/src/FunnelChart.d.ts +28 -0
- package/dist/types/components/viz/funnel/src/index.d.ts +2 -0
- package/dist/types/components/viz/gantt-chart/src/GanttChart.d.ts +33 -0
- package/dist/types/components/viz/gantt-chart/src/index.d.ts +2 -0
- package/dist/types/components/viz/gauge/src/Gauge.d.ts +37 -0
- package/dist/types/components/viz/gauge/src/index.d.ts +2 -0
- package/dist/types/components/viz/graph/src/HypercubeGraph.d.ts +43 -0
- package/dist/types/components/viz/graph/src/hypercube.d.ts +78 -0
- package/dist/types/components/viz/graph/src/index.d.ts +4 -0
- package/dist/types/components/viz/heat-map/src/HeatMap.d.ts +29 -0
- package/dist/types/components/viz/heat-map/src/index.d.ts +2 -0
- package/dist/types/components/viz/histogram/src/Histogram.d.ts +27 -0
- package/dist/types/components/viz/histogram/src/index.d.ts +2 -0
- package/dist/types/components/viz/lollipop/src/LollipopChart.d.ts +32 -0
- package/dist/types/components/viz/lollipop/src/index.d.ts +2 -0
- package/dist/types/components/viz/matrix/src/Matrix.d.ts +29 -0
- package/dist/types/components/viz/matrix/src/index.d.ts +2 -0
- package/dist/types/components/viz/partition/src/Partition.d.ts +31 -0
- package/dist/types/components/viz/partition/src/index.d.ts +2 -0
- package/dist/types/components/viz/pivot-table/src/PivotTable.d.ts +25 -0
- package/dist/types/components/viz/pivot-table/src/index.d.ts +2 -0
- package/dist/types/components/viz/radar-chart/src/RadarChart.d.ts +35 -0
- package/dist/types/components/viz/radar-chart/src/index.d.ts +2 -0
- package/dist/types/components/viz/sankey/src/SankeyDiagram.d.ts +38 -0
- package/dist/types/components/viz/sankey/src/index.d.ts +2 -0
- package/dist/types/components/viz/sunburst/src/Sunburst.d.ts +27 -0
- package/dist/types/components/viz/sunburst/src/index.d.ts +2 -0
- package/dist/types/components/viz/tree-map/src/TreeMap.d.ts +29 -0
- package/dist/types/components/viz/tree-map/src/index.d.ts +2 -0
- package/dist/types/components/viz/us-state-map/src/USStateMap.d.ts +23 -0
- package/dist/types/components/viz/us-state-map/src/index.d.ts +4 -0
- package/dist/types/components/viz/us-state-map/src/us-state-paths.d.ts +10 -0
- package/dist/types/components/viz/vector-field/src/VectorField.d.ts +61 -0
- package/dist/types/components/viz/vector-field/src/index.d.ts +2 -0
- package/dist/types/components/viz/waterfall/src/WaterfallChart.d.ts +32 -0
- package/dist/types/components/viz/waterfall/src/index.d.ts +2 -0
- package/dist/types/components/viz/word-cloud/src/WordCloud.d.ts +30 -0
- package/dist/types/components/viz/word-cloud/src/index.d.ts +2 -0
- package/dist/types/components/viz/wrapper/src/VizWrapper.d.ts +60 -0
- package/dist/types/components/viz/wrapper/src/index.d.ts +2 -0
- package/dist/types/compute/context.d.ts +20 -0
- package/dist/types/compute/context.d.ts.map +1 -0
- package/dist/types/compute/cpu-backend.d.ts +15 -0
- package/dist/types/compute/cpu-backend.d.ts.map +1 -0
- package/dist/types/compute/index.d.ts +3 -0
- package/dist/types/compute/index.d.ts.map +1 -0
- package/dist/types/compute/types.d.ts +57 -0
- package/dist/types/compute/types.d.ts.map +1 -0
- package/dist/types/compute/webgl-backend.d.ts +33 -0
- package/dist/types/compute/webgl-backend.d.ts.map +1 -0
- package/dist/types/compute/webgpu-backend.d.ts +50 -0
- package/dist/types/compute/webgpu-backend.d.ts.map +1 -0
- package/dist/types/context/create-context.d.ts +15 -0
- package/dist/types/context/create-context.d.ts.map +1 -0
- package/dist/types/core/children.d.ts +15 -0
- package/dist/types/core/children.d.ts.map +1 -0
- package/dist/types/core/clone-element.d.ts +10 -0
- package/dist/types/core/clone-element.d.ts.map +1 -0
- package/dist/types/core/create-element.d.ts +20 -0
- package/dist/types/core/create-element.d.ts.map +1 -0
- package/dist/types/core/create-ref.d.ts +7 -0
- package/dist/types/core/create-ref.d.ts.map +1 -0
- package/dist/types/core/fiber.d.ts +30 -0
- package/dist/types/core/fiber.d.ts.map +1 -0
- package/dist/types/core/forward-ref.d.ts +16 -0
- package/dist/types/core/forward-ref.d.ts.map +1 -0
- package/dist/types/core/fragment.d.ts +6 -0
- package/dist/types/core/fragment.d.ts.map +1 -0
- package/dist/types/core/is-valid-element.d.ts +7 -0
- package/dist/types/core/is-valid-element.d.ts.map +1 -0
- package/dist/types/core/lanes.d.ts +47 -0
- package/dist/types/core/lanes.d.ts.map +1 -0
- package/dist/types/core/lazy.d.ts +20 -0
- package/dist/types/core/lazy.d.ts.map +1 -0
- package/dist/types/core/memo.d.ts +13 -0
- package/dist/types/core/memo.d.ts.map +1 -0
- package/dist/types/core/reconciler.d.ts +12 -0
- package/dist/types/core/reconciler.d.ts.map +1 -0
- package/dist/types/core/scheduler-host-config.d.ts +37 -0
- package/dist/types/core/scheduler-host-config.d.ts.map +1 -0
- package/dist/types/core/scheduler.d.ts +29 -0
- package/dist/types/core/scheduler.d.ts.map +1 -0
- package/dist/types/core/src/build/index.d.ts +4 -0
- package/dist/types/core/src/build/noscript-plugin.d.ts +62 -0
- package/dist/types/core/src/build/seo-plugin.d.ts +42 -0
- package/dist/types/core/src/client/graphql.d.ts +63 -0
- package/dist/types/core/src/client/index.d.ts +3 -0
- package/dist/types/core/src/client/protobuf.d.ts +39 -0
- package/dist/types/core/src/client/rest.d.ts +60 -0
- package/dist/types/core/src/components/component.d.ts +38 -0
- package/dist/types/core/src/components/error-boundary.d.ts +22 -0
- package/dist/types/core/src/components/profiler.d.ts +5 -0
- package/dist/types/core/src/components/strict-mode.d.ts +5 -0
- package/dist/types/core/src/components/suspense.d.ts +5 -0
- package/dist/types/core/src/components-barrel.d.ts +100 -0
- package/dist/types/core/src/compute/context.d.ts +19 -0
- package/dist/types/core/src/compute/cpu-backend.d.ts +14 -0
- package/dist/types/core/src/compute/index.d.ts +2 -0
- package/dist/types/core/src/compute/types.d.ts +56 -0
- package/dist/types/core/src/compute/webgl-backend.d.ts +32 -0
- package/dist/types/core/src/compute/webgpu-backend.d.ts +49 -0
- package/dist/types/core/src/context/create-context.d.ts +14 -0
- package/dist/types/core/src/core/children.d.ts +14 -0
- package/dist/types/core/src/core/clone-element.d.ts +9 -0
- package/dist/types/core/src/core/create-element.d.ts +19 -0
- package/dist/types/core/src/core/create-ref.d.ts +6 -0
- package/dist/types/core/src/core/fiber.d.ts +29 -0
- package/dist/types/core/src/core/forward-ref.d.ts +15 -0
- package/dist/types/core/src/core/fragment.d.ts +5 -0
- package/dist/types/core/src/core/is-valid-element.d.ts +6 -0
- package/dist/types/core/src/core/lanes.d.ts +46 -0
- package/dist/types/core/src/core/lazy.d.ts +19 -0
- package/dist/types/core/src/core/memo.d.ts +12 -0
- package/dist/types/core/src/core/reconciler.d.ts +11 -0
- package/dist/types/core/src/core/scheduler-host-config.d.ts +36 -0
- package/dist/types/core/src/core/scheduler.d.ts +28 -0
- package/dist/types/core/src/core/transitions.d.ts +31 -0
- package/dist/types/core/src/devtools/index.d.ts +21 -0
- package/dist/types/core/src/dom/create-portal.d.ts +6 -0
- package/dist/types/core/src/dom/create-root.d.ts +23 -0
- package/dist/types/core/src/dom/flush-sync.d.ts +1 -0
- package/dist/types/core/src/dom/index.d.ts +4 -0
- package/dist/types/core/src/dom/legacy.d.ts +16 -0
- package/dist/types/core/src/dom/synthetic-event.d.ts +90 -0
- package/dist/types/core/src/dom/work-loop.d.ts +34 -0
- package/dist/types/core/src/features/feature-flags.d.ts +38 -0
- package/dist/types/core/src/features/index.d.ts +27 -0
- package/dist/types/core/src/hooks/dispatcher.d.ts +26 -0
- package/dist/types/core/src/hooks/hook-state.d.ts +46 -0
- package/dist/types/core/src/hooks/index.d.ts +47 -0
- package/dist/types/core/src/hooks/install-dispatcher.d.ts +2 -0
- package/dist/types/core/src/hooks/use-head.d.ts +54 -0
- package/dist/types/core/src/index.d.ts +23 -0
- package/dist/types/core/src/jsx-dev-runtime.d.ts +1 -0
- package/dist/types/core/src/jsx-runtime.d.ts +7 -0
- package/dist/types/core/src/router/index.d.ts +12 -0
- package/dist/types/core/src/router/link-component.d.ts +16 -0
- package/dist/types/core/src/router/match-path.d.ts +28 -0
- package/dist/types/core/src/router/route-component.d.ts +12 -0
- package/dist/types/core/src/router/router-component.d.ts +5 -0
- package/dist/types/core/src/router/router-context.d.ts +13 -0
- package/dist/types/core/src/router/router-store.d.ts +22 -0
- package/dist/types/core/src/router/use-navigate.d.ts +4 -0
- package/dist/types/core/src/router/use-params.d.ts +2 -0
- package/dist/types/core/src/router/use-router.d.ts +3 -0
- package/dist/types/core/src/server/index.d.ts +3 -0
- package/dist/types/core/src/server/render-to-pipeable-stream.d.ts +31 -0
- package/dist/types/core/src/server/render-to-readable-stream.d.ts +19 -0
- package/dist/types/core/src/server/render-to-string.d.ts +25 -0
- package/dist/types/core/src/shared/act.d.ts +1 -0
- package/dist/types/core/src/shared/aria-warnings.d.ts +1 -0
- package/dist/types/core/src/shared/async-compute.d.ts +63 -0
- package/dist/types/core/src/shared/component-registry.d.ts +53 -0
- package/dist/types/core/src/shared/render-guard.d.ts +47 -0
- package/dist/types/core/src/shared/secure-fetch.d.ts +21 -0
- package/dist/types/core/src/shared/types.d.ts +127 -0
- package/dist/types/core/src/shared/warnings.d.ts +19 -0
- package/dist/types/core/src/telemetry/index.d.ts +2 -0
- package/dist/types/core/src/telemetry/metrics.d.ts +67 -0
- package/dist/types/core/src/telemetry/tracing.d.ts +95 -0
- package/dist/types/core/transitions.d.ts +32 -0
- package/dist/types/core/transitions.d.ts.map +1 -0
- package/dist/types/devtools/index.d.ts +22 -0
- package/dist/types/devtools/index.d.ts.map +1 -0
- package/dist/types/dom/create-portal.d.ts +7 -0
- package/dist/types/dom/create-portal.d.ts.map +1 -0
- package/dist/types/dom/create-root.d.ts +24 -0
- package/dist/types/dom/create-root.d.ts.map +1 -0
- package/dist/types/dom/flush-sync.d.ts +2 -0
- package/dist/types/dom/flush-sync.d.ts.map +1 -0
- package/dist/types/dom/index.d.ts +5 -0
- package/dist/types/dom/index.d.ts.map +1 -0
- package/dist/types/dom/legacy.d.ts +17 -0
- package/dist/types/dom/legacy.d.ts.map +1 -0
- package/dist/types/dom/synthetic-event.d.ts +91 -0
- package/dist/types/dom/synthetic-event.d.ts.map +1 -0
- package/dist/types/dom/work-loop.d.ts +35 -0
- package/dist/types/dom/work-loop.d.ts.map +1 -0
- package/dist/types/features/feature-flags.d.ts +39 -0
- package/dist/types/features/feature-flags.d.ts.map +1 -0
- package/dist/types/features/index.d.ts +28 -0
- package/dist/types/features/index.d.ts.map +1 -0
- package/dist/types/hooks/dispatcher.d.ts +27 -0
- package/dist/types/hooks/dispatcher.d.ts.map +1 -0
- package/dist/types/hooks/hook-state.d.ts +47 -0
- package/dist/types/hooks/hook-state.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +48 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/install-dispatcher.d.ts +3 -0
- package/dist/types/hooks/install-dispatcher.d.ts.map +1 -0
- package/dist/types/hooks/use-head.d.ts +55 -0
- package/dist/types/hooks/use-head.d.ts.map +1 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/jsx-dev-runtime.d.ts +2 -0
- package/dist/types/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/types/jsx-runtime.d.ts +8 -0
- package/dist/types/jsx-runtime.d.ts.map +1 -0
- package/dist/types/router/index.d.ts +13 -0
- package/dist/types/router/index.d.ts.map +1 -0
- package/dist/types/router/link-component.d.ts +17 -0
- package/dist/types/router/link-component.d.ts.map +1 -0
- package/dist/types/router/match-path.d.ts +29 -0
- package/dist/types/router/match-path.d.ts.map +1 -0
- package/dist/types/router/route-component.d.ts +13 -0
- package/dist/types/router/route-component.d.ts.map +1 -0
- package/dist/types/router/router-component.d.ts +6 -0
- package/dist/types/router/router-component.d.ts.map +1 -0
- package/dist/types/router/router-context.d.ts +14 -0
- package/dist/types/router/router-context.d.ts.map +1 -0
- package/dist/types/router/router-store.d.ts +23 -0
- package/dist/types/router/router-store.d.ts.map +1 -0
- package/dist/types/router/use-navigate.d.ts +5 -0
- package/dist/types/router/use-navigate.d.ts.map +1 -0
- package/dist/types/router/use-params.d.ts +3 -0
- package/dist/types/router/use-params.d.ts.map +1 -0
- package/dist/types/router/use-router.d.ts +4 -0
- package/dist/types/router/use-router.d.ts.map +1 -0
- package/dist/types/server/index.d.ts +4 -0
- package/dist/types/server/index.d.ts.map +1 -0
- package/dist/types/server/render-to-pipeable-stream.d.ts +32 -0
- package/dist/types/server/render-to-pipeable-stream.d.ts.map +1 -0
- package/dist/types/server/render-to-readable-stream.d.ts +20 -0
- package/dist/types/server/render-to-readable-stream.d.ts.map +1 -0
- package/dist/types/server/render-to-string.d.ts +26 -0
- package/dist/types/server/render-to-string.d.ts.map +1 -0
- package/dist/types/shared/act.d.ts +2 -0
- package/dist/types/shared/act.d.ts.map +1 -0
- package/dist/types/shared/aria-warnings.d.ts +2 -0
- package/dist/types/shared/aria-warnings.d.ts.map +1 -0
- package/dist/types/shared/async-compute.d.ts +64 -0
- package/dist/types/shared/async-compute.d.ts.map +1 -0
- package/dist/types/shared/component-registry.d.ts +54 -0
- package/dist/types/shared/component-registry.d.ts.map +1 -0
- package/dist/types/shared/render-guard.d.ts +48 -0
- package/dist/types/shared/render-guard.d.ts.map +1 -0
- package/dist/types/shared/secure-fetch.d.ts +22 -0
- package/dist/types/shared/secure-fetch.d.ts.map +1 -0
- package/dist/types/shared/types.d.ts +128 -0
- package/dist/types/shared/types.d.ts.map +1 -0
- package/dist/types/shared/warnings.d.ts +20 -0
- package/dist/types/shared/warnings.d.ts.map +1 -0
- package/dist/types/telemetry/index.d.ts +3 -0
- package/dist/types/telemetry/index.d.ts.map +1 -0
- package/dist/types/telemetry/metrics.d.ts +68 -0
- package/dist/types/telemetry/metrics.d.ts.map +1 -0
- package/dist/types/telemetry/tracing.d.ts +96 -0
- package/dist/types/telemetry/tracing.d.ts.map +1 -0
- package/package.json +8 -17
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/shared/types.ts", "../src/core/create-element.ts", "../src/core/fragment.ts", "../src/jsx-runtime.ts"],
|
|
4
|
+
"sourcesContent": ["// ============================================================================\n// SpecifyJS Core Types\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\n/** Unique symbol to identify SpecifyJS elements */\nexport const SPEC_ELEMENT_TYPE = Symbol.for('spec.element');\nexport const SPEC_FRAGMENT_TYPE = Symbol.for('spec.fragment');\nexport const SPEC_PORTAL_TYPE = Symbol.for('spec.portal');\nexport const SPEC_PROVIDER_TYPE = Symbol.for('spec.provider');\nexport const SPEC_CONSUMER_TYPE = Symbol.for('spec.consumer');\nexport const SPEC_FORWARD_REF_TYPE = Symbol.for('spec.forward_ref');\nexport const SPEC_MEMO_TYPE = Symbol.for('spec.memo');\nexport const SPEC_LAZY_TYPE = Symbol.for('spec.lazy');\nexport const SPEC_SUSPENSE_TYPE = Symbol.for('spec.suspense');\nexport const SPEC_STRICT_MODE_TYPE = Symbol.for('spec.strict_mode');\nexport const SPEC_PROFILER_TYPE = Symbol.for('spec.profiler');\n\n/** A key used for reconciliation */\nexport type Key = string | number | null;\n\n/** A ref can be a callback, an object, or null */\nexport type Ref<T = unknown> = RefCallback<T> | RefObject<T> | null;\nexport type RefCallback<T> = (instance: T | null) => void;\nexport interface RefObject<T> {\n current: T | null;\n}\n\n/** Props are an arbitrary key-value map */\nexport type Props = Record<string, unknown> & {\n children?: SpecNode;\n key?: Key;\n ref?: Ref;\n};\n\n/** Valid child types in a SpecifyJS tree */\nexport type SpecChild = SpecElement | string | number | boolean | null | undefined;\nexport type SpecNode = SpecChild | SpecNode[];\n\n/** A functional component */\nexport type FunctionComponent<P extends Props = Props> = (props: P) => SpecNode;\n\n/** A class component constructor */\nexport interface ClassComponentConstructor<P extends Props = Props, S = unknown> {\n new (props: P): ClassComponentInstance<P, S>;\n getDerivedStateFromProps?(props: P, state: S): Partial<S> | null;\n getDerivedStateFromError?(error: unknown): Partial<S> | null;\n}\n\n/** Instance of a class component */\nexport interface ClassComponentInstance<P extends Props = Props, S = unknown> {\n props: P;\n state: S;\n setState(updater: Partial<S> | ((prevState: S, props: P) => Partial<S> | null)): void;\n forceUpdate(callback?: () => void): void;\n render(): SpecNode;\n componentDidMount?(): void;\n componentDidUpdate?(prevProps: P, prevState: S, snapshot?: unknown): void;\n componentWillUnmount?(): void;\n shouldComponentUpdate?(nextProps: P, nextState: S): boolean;\n getSnapshotBeforeUpdate?(prevProps: P, prevState: S): unknown;\n componentDidCatch?(error: unknown, info: ErrorInfo): void;\n // Internal: set by the reconciler for setState/forceUpdate wiring\n _fiber: unknown;\n _pendingState: Array<Partial<S> | ((prevState: S, props: P) => Partial<S> | null)>;\n _forceUpdate: boolean;\n _enqueueUpdate(callback?: () => void): void;\n}\n\nexport interface ErrorInfo {\n componentStack: string;\n}\n\n/** A component type can be a function, a class, or a special symbol type */\nexport type ComponentType<P extends Props = Props> =\n | FunctionComponent<P>\n | ClassComponentConstructor<P>\n | string\n | symbol;\n\n/** The core element structure \u2014 equivalent to React.Element */\nexport interface SpecElement<P extends Props = Props> {\n $$typeof: typeof SPEC_ELEMENT_TYPE;\n type: ComponentType<P>;\n props: P;\n key: Key;\n ref: Ref;\n}\n\n/** Fiber node types for the reconciler */\nexport const enum FiberTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n HostRoot = 2,\n HostComponent = 3,\n HostText = 4,\n Fragment = 5,\n ContextProvider = 6,\n ContextConsumer = 7,\n ForwardRef = 8,\n MemoComponent = 9,\n LazyComponent = 10,\n SuspenseComponent = 11,\n Profiler = 12,\n Portal = 13,\n}\n\n/** Effect flags for fiber work */\nexport const enum EffectTag {\n NoEffect = 0,\n Placement = 1,\n Update = 2,\n Deletion = 4,\n ChildDeletion = 8,\n Snapshot = 16,\n Passive = 32,\n Layout = 64,\n Ref = 128,\n}\n\n/** Fiber node \u2014 the internal work unit */\nexport interface Fiber<P extends Props = Props> {\n tag: FiberTag;\n type: ComponentType<P> | null;\n key: Key;\n ref: Ref;\n\n stateNode: unknown;\n pendingProps: P;\n memoizedProps: P | null;\n memoizedState: unknown;\n\n return: Fiber | null;\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n alternate: Fiber | null;\n effectTag: EffectTag;\n\n updateQueue: unknown;\n dependencies: unknown;\n\n lanes: number;\n childLanes: number;\n}\n\n/** Context type */\nexport interface SpecContext<T> {\n $$typeof: symbol;\n Provider: ComponentType;\n Consumer: ComponentType;\n _currentValue: T;\n _defaultValue: T;\n displayName?: string;\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport {\n SPEC_ELEMENT_TYPE,\n type SpecElement,\n type ComponentType,\n type Props,\n type Key,\n type Ref,\n} from '../shared/types';\n\n/**\n * Creates a SpecifyJS element (virtual DOM node).\n * Equivalent to React.createElement.\n */\nexport function createElement<P extends Props>(\n type: ComponentType<P>,\n config: (Omit<P, 'children'> & { key?: Key; ref?: Ref }) | null,\n ...children: unknown[]\n): SpecElement<P> {\n let key: Key = null;\n let ref: Ref = null;\n const props: Record<string, unknown> = {};\n\n if (config != null) {\n if (config.key !== undefined) {\n key = '' + config.key;\n }\n if (config.ref !== undefined) {\n ref = config.ref as Ref;\n }\n\n for (const propName in config) {\n if (\n Object.prototype.hasOwnProperty.call(config, propName) &&\n propName !== 'key' &&\n propName !== 'ref' &&\n propName !== '__proto__' &&\n propName !== 'constructor' &&\n propName !== 'prototype'\n ) {\n props[propName] = (config as Record<string, unknown>)[propName];\n }\n }\n }\n\n if (children.length === 1) {\n props.children = children[0];\n } else if (children.length > 1) {\n props.children = children;\n }\n\n // Apply default props for component types\n if (\n typeof type === 'function' &&\n (type as unknown as { defaultProps?: Partial<P> }).defaultProps\n ) {\n const defaultProps = (type as unknown as { defaultProps: Partial<P> }).defaultProps;\n for (const propName of Object.keys(defaultProps)) {\n if (propName !== '__proto__' && propName !== 'constructor' && props[propName] === undefined) {\n props[propName] = defaultProps[propName as keyof typeof defaultProps];\n }\n }\n }\n\n return {\n $$typeof: SPEC_ELEMENT_TYPE,\n type,\n props: props as P,\n key,\n ref,\n };\n}\n\n/**\n * Creates a factory function for producing elements of a given type.\n * Legacy API \u2014 equivalent to React.createFactory.\n *\n * @deprecated Use createElement directly or JSX instead.\n */\nexport function createFactory<P extends Props>(\n type: ComponentType<P>,\n): (\n config?: (Omit<P, 'children'> & { key?: Key; ref?: Ref }) | null,\n ...children: unknown[]\n) => SpecElement<P> {\n return (config, ...children) => createElement(type, config ?? null, ...children);\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport { SPEC_FRAGMENT_TYPE } from '../shared/types';\n\n/**\n * Fragment allows grouping children without adding extra DOM nodes.\n * Usage: <Fragment>...</Fragment> or <>...</>\n */\nexport const Fragment: symbol = SPEC_FRAGMENT_TYPE;\n", "// ============================================================================\n// SpecifyJS JSX Runtime (automatic transform)\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport { createElement } from './core/create-element';\nimport { Fragment } from './core/fragment';\nimport type { Props, Key, ComponentType, SpecElement } from './shared/types';\n\nexport { Fragment };\n\nexport function jsx<P extends Props>(\n type: ComponentType<P>,\n config: P & { key?: Key },\n maybeKey?: Key,\n): SpecElement<P> {\n const key = maybeKey !== undefined ? maybeKey : config.key !== undefined ? config.key : null;\n const { key: _key, ...props } = config;\n const configWithKey = key !== null ? { ...props, key } : props;\n return createElement(type, configWithKey as unknown as P);\n}\n\nexport { jsx as jsxs };\n"],
|
|
5
|
+
"mappings": ";AAOO,IAAMA,EAAoB,OAAO,IAAI,cAAc,EAC7C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AAM,KAClF,CAAE,IAAKG,EAAM,GAAGC,CAAM,EAAIJ,EAC1BK,EAAgBH,IAAQ,KAAO,CAAE,GAAGE,EAAO,IAAAF,CAAI,EAAIE,EACzD,OAAOE,EAAcP,EAAMM,CAA6B,CAC1D",
|
|
6
|
+
"names": ["SPEC_ELEMENT_TYPE", "SPEC_FRAGMENT_TYPE", "SPEC_PORTAL_TYPE", "SPEC_PROVIDER_TYPE", "SPEC_CONSUMER_TYPE", "SPEC_FORWARD_REF_TYPE", "SPEC_MEMO_TYPE", "SPEC_LAZY_TYPE", "SPEC_SUSPENSE_TYPE", "SPEC_STRICT_MODE_TYPE", "SPEC_PROFILER_TYPE", "createElement", "type", "config", "children", "key", "ref", "props", "propName", "defaultProps", "SPEC_ELEMENT_TYPE", "Fragment", "SPEC_FRAGMENT_TYPE", "jsx", "type", "config", "maybeKey", "key", "_key", "props", "configWithKey", "createElement"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
+
"use strict";var P=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var i=(o,e)=>{for(var t in e)P(o,t,{get:e[t],enumerable:!0})},f=(o,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of a(e))!S.call(o,p)&&p!==t&&P(o,p,{get:()=>e[p],enumerable:!(s=y(e,p))||s.enumerable});return o};var C=o=>f(P({},"__esModule",{value:!0}),o);var _={};i(_,{Fragment:()=>d,jsx:()=>x,jsxs:()=>x});module.exports=C(_);var u=Symbol.for("spec.element"),m=Symbol.for("spec.fragment"),k=Symbol.for("spec.portal"),R=Symbol.for("spec.provider"),w=Symbol.for("spec.consumer"),v=Symbol.for("spec.forward_ref"),h=Symbol.for("spec.memo"),N=Symbol.for("spec.lazy"),Y=Symbol.for("spec.suspense"),O=Symbol.for("spec.strict_mode"),K=Symbol.for("spec.profiler");function c(o,e,...t){let s=null,p=null,r={};if(e!=null){e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(p=e.ref);for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&n!=="key"&&n!=="ref"&&n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(r[n]=e[n])}if(t.length===1?r.children=t[0]:t.length>1&&(r.children=t),typeof o=="function"&&o.defaultProps){let n=o.defaultProps;for(let l of Object.keys(n))l!=="__proto__"&&l!=="constructor"&&r[l]===void 0&&(r[l]=n[l])}return{$$typeof:u,type:o,props:r,key:s,ref:p}}var d=m;function x(o,e,t){let s=t!==void 0?t:e.key!==void 0?e.key:null,{key:p,...r}=e,n=s!==null?{...r,key:s}:r;return c(o,n)}
|
|
2
3
|
//# sourceMappingURL=specifyjs-jsx-runtime.cjs.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/jsx-runtime.ts", "../src/shared/types.ts", "../src/core/create-element.ts", "../src/core/fragment.ts"],
|
|
4
|
+
"sourcesContent": ["// ============================================================================\n// SpecifyJS JSX Runtime (automatic transform)\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport { createElement } from './core/create-element';\nimport { Fragment } from './core/fragment';\nimport type { Props, Key, ComponentType, SpecElement } from './shared/types';\n\nexport { Fragment };\n\nexport function jsx<P extends Props>(\n type: ComponentType<P>,\n config: P & { key?: Key },\n maybeKey?: Key,\n): SpecElement<P> {\n const key = maybeKey !== undefined ? maybeKey : config.key !== undefined ? config.key : null;\n const { key: _key, ...props } = config;\n const configWithKey = key !== null ? { ...props, key } : props;\n return createElement(type, configWithKey as unknown as P);\n}\n\nexport { jsx as jsxs };\n", "// ============================================================================\n// SpecifyJS Core Types\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\n/** Unique symbol to identify SpecifyJS elements */\nexport const SPEC_ELEMENT_TYPE = Symbol.for('spec.element');\nexport const SPEC_FRAGMENT_TYPE = Symbol.for('spec.fragment');\nexport const SPEC_PORTAL_TYPE = Symbol.for('spec.portal');\nexport const SPEC_PROVIDER_TYPE = Symbol.for('spec.provider');\nexport const SPEC_CONSUMER_TYPE = Symbol.for('spec.consumer');\nexport const SPEC_FORWARD_REF_TYPE = Symbol.for('spec.forward_ref');\nexport const SPEC_MEMO_TYPE = Symbol.for('spec.memo');\nexport const SPEC_LAZY_TYPE = Symbol.for('spec.lazy');\nexport const SPEC_SUSPENSE_TYPE = Symbol.for('spec.suspense');\nexport const SPEC_STRICT_MODE_TYPE = Symbol.for('spec.strict_mode');\nexport const SPEC_PROFILER_TYPE = Symbol.for('spec.profiler');\n\n/** A key used for reconciliation */\nexport type Key = string | number | null;\n\n/** A ref can be a callback, an object, or null */\nexport type Ref<T = unknown> = RefCallback<T> | RefObject<T> | null;\nexport type RefCallback<T> = (instance: T | null) => void;\nexport interface RefObject<T> {\n current: T | null;\n}\n\n/** Props are an arbitrary key-value map */\nexport type Props = Record<string, unknown> & {\n children?: SpecNode;\n key?: Key;\n ref?: Ref;\n};\n\n/** Valid child types in a SpecifyJS tree */\nexport type SpecChild = SpecElement | string | number | boolean | null | undefined;\nexport type SpecNode = SpecChild | SpecNode[];\n\n/** A functional component */\nexport type FunctionComponent<P extends Props = Props> = (props: P) => SpecNode;\n\n/** A class component constructor */\nexport interface ClassComponentConstructor<P extends Props = Props, S = unknown> {\n new (props: P): ClassComponentInstance<P, S>;\n getDerivedStateFromProps?(props: P, state: S): Partial<S> | null;\n getDerivedStateFromError?(error: unknown): Partial<S> | null;\n}\n\n/** Instance of a class component */\nexport interface ClassComponentInstance<P extends Props = Props, S = unknown> {\n props: P;\n state: S;\n setState(updater: Partial<S> | ((prevState: S, props: P) => Partial<S> | null)): void;\n forceUpdate(callback?: () => void): void;\n render(): SpecNode;\n componentDidMount?(): void;\n componentDidUpdate?(prevProps: P, prevState: S, snapshot?: unknown): void;\n componentWillUnmount?(): void;\n shouldComponentUpdate?(nextProps: P, nextState: S): boolean;\n getSnapshotBeforeUpdate?(prevProps: P, prevState: S): unknown;\n componentDidCatch?(error: unknown, info: ErrorInfo): void;\n // Internal: set by the reconciler for setState/forceUpdate wiring\n _fiber: unknown;\n _pendingState: Array<Partial<S> | ((prevState: S, props: P) => Partial<S> | null)>;\n _forceUpdate: boolean;\n _enqueueUpdate(callback?: () => void): void;\n}\n\nexport interface ErrorInfo {\n componentStack: string;\n}\n\n/** A component type can be a function, a class, or a special symbol type */\nexport type ComponentType<P extends Props = Props> =\n | FunctionComponent<P>\n | ClassComponentConstructor<P>\n | string\n | symbol;\n\n/** The core element structure \u2014 equivalent to React.Element */\nexport interface SpecElement<P extends Props = Props> {\n $$typeof: typeof SPEC_ELEMENT_TYPE;\n type: ComponentType<P>;\n props: P;\n key: Key;\n ref: Ref;\n}\n\n/** Fiber node types for the reconciler */\nexport const enum FiberTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n HostRoot = 2,\n HostComponent = 3,\n HostText = 4,\n Fragment = 5,\n ContextProvider = 6,\n ContextConsumer = 7,\n ForwardRef = 8,\n MemoComponent = 9,\n LazyComponent = 10,\n SuspenseComponent = 11,\n Profiler = 12,\n Portal = 13,\n}\n\n/** Effect flags for fiber work */\nexport const enum EffectTag {\n NoEffect = 0,\n Placement = 1,\n Update = 2,\n Deletion = 4,\n ChildDeletion = 8,\n Snapshot = 16,\n Passive = 32,\n Layout = 64,\n Ref = 128,\n}\n\n/** Fiber node \u2014 the internal work unit */\nexport interface Fiber<P extends Props = Props> {\n tag: FiberTag;\n type: ComponentType<P> | null;\n key: Key;\n ref: Ref;\n\n stateNode: unknown;\n pendingProps: P;\n memoizedProps: P | null;\n memoizedState: unknown;\n\n return: Fiber | null;\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n alternate: Fiber | null;\n effectTag: EffectTag;\n\n updateQueue: unknown;\n dependencies: unknown;\n\n lanes: number;\n childLanes: number;\n}\n\n/** Context type */\nexport interface SpecContext<T> {\n $$typeof: symbol;\n Provider: ComponentType;\n Consumer: ComponentType;\n _currentValue: T;\n _defaultValue: T;\n displayName?: string;\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport {\n SPEC_ELEMENT_TYPE,\n type SpecElement,\n type ComponentType,\n type Props,\n type Key,\n type Ref,\n} from '../shared/types';\n\n/**\n * Creates a SpecifyJS element (virtual DOM node).\n * Equivalent to React.createElement.\n */\nexport function createElement<P extends Props>(\n type: ComponentType<P>,\n config: (Omit<P, 'children'> & { key?: Key; ref?: Ref }) | null,\n ...children: unknown[]\n): SpecElement<P> {\n let key: Key = null;\n let ref: Ref = null;\n const props: Record<string, unknown> = {};\n\n if (config != null) {\n if (config.key !== undefined) {\n key = '' + config.key;\n }\n if (config.ref !== undefined) {\n ref = config.ref as Ref;\n }\n\n for (const propName in config) {\n if (\n Object.prototype.hasOwnProperty.call(config, propName) &&\n propName !== 'key' &&\n propName !== 'ref' &&\n propName !== '__proto__' &&\n propName !== 'constructor' &&\n propName !== 'prototype'\n ) {\n props[propName] = (config as Record<string, unknown>)[propName];\n }\n }\n }\n\n if (children.length === 1) {\n props.children = children[0];\n } else if (children.length > 1) {\n props.children = children;\n }\n\n // Apply default props for component types\n if (\n typeof type === 'function' &&\n (type as unknown as { defaultProps?: Partial<P> }).defaultProps\n ) {\n const defaultProps = (type as unknown as { defaultProps: Partial<P> }).defaultProps;\n for (const propName of Object.keys(defaultProps)) {\n if (propName !== '__proto__' && propName !== 'constructor' && props[propName] === undefined) {\n props[propName] = defaultProps[propName as keyof typeof defaultProps];\n }\n }\n }\n\n return {\n $$typeof: SPEC_ELEMENT_TYPE,\n type,\n props: props as P,\n key,\n ref,\n };\n}\n\n/**\n * Creates a factory function for producing elements of a given type.\n * Legacy API \u2014 equivalent to React.createFactory.\n *\n * @deprecated Use createElement directly or JSX instead.\n */\nexport function createFactory<P extends Props>(\n type: ComponentType<P>,\n): (\n config?: (Omit<P, 'children'> & { key?: Key; ref?: Ref }) | null,\n ...children: unknown[]\n) => SpecElement<P> {\n return (config, ...children) => createElement(type, config ?? null, ...children);\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport { SPEC_FRAGMENT_TYPE } from '../shared/types';\n\n/**\n * Fragment allows grouping children without adding extra DOM nodes.\n * Usage: <Fragment>...</Fragment> or <>...</>\n */\nexport const Fragment: symbol = SPEC_FRAGMENT_TYPE;\n"],
|
|
5
|
+
"mappings": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,EAAA,QAAAC,EAAA,SAAAA,IAAA,eAAAC,EAAAJ,GCOO,IAAMK,EAAoB,OAAO,IAAI,cAAc,EAC7CC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAmB,OAAO,IAAI,aAAa,EAC3CC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAwB,OAAO,IAAI,kBAAkB,EACrDC,EAAiB,OAAO,IAAI,WAAW,EACvCC,EAAiB,OAAO,IAAI,WAAW,EACvCC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAwB,OAAO,IAAI,kBAAkB,EACrDC,EAAqB,OAAO,IAAI,eAAe,ECDrD,SAASC,EACdC,EACAC,KACGC,EACa,CAChB,IAAIC,EAAW,KACXC,EAAW,KACTC,EAAiC,CAAC,EAExC,GAAIJ,GAAU,KAAM,CACdA,EAAO,MAAQ,SACjBE,EAAM,GAAKF,EAAO,KAEhBA,EAAO,MAAQ,SACjBG,EAAMH,EAAO,KAGf,QAAWK,KAAYL,EAEnB,OAAO,UAAU,eAAe,KAAKA,EAAQK,CAAQ,GACrDA,IAAa,OACbA,IAAa,OACbA,IAAa,aACbA,IAAa,eACbA,IAAa,cAEbD,EAAMC,CAAQ,EAAKL,EAAmCK,CAAQ,EAGpE,CASA,GAPIJ,EAAS,SAAW,EACtBG,EAAM,SAAWH,EAAS,CAAC,EAClBA,EAAS,OAAS,IAC3BG,EAAM,SAAWH,GAKjB,OAAOF,GAAS,YACfA,EAAkD,aACnD,CACA,IAAMO,EAAgBP,EAAiD,aACvE,QAAWM,KAAY,OAAO,KAAKC,CAAY,EACzCD,IAAa,aAAeA,IAAa,eAAiBD,EAAMC,CAAQ,IAAM,SAChFD,EAAMC,CAAQ,EAAIC,EAAaD,CAAqC,EAG1E,CAEA,MAAO,CACL,SAAUE,EACV,KAAAR,EACA,MAAOK,EACP,IAAAF,EACA,IAAAC,CACF,CACF,CChEO,IAAMK,EAAmBC,EHGzB,SAASC,EACdC,EACAC,EACAC,EACgB,CAChB,IAAMC,EAAMD,IAAa,OAAYA,EAAWD,EAAO,MAAQ,OAAYA,EAAO,IAAM,KAClF,CAAE,IAAKG,EAAM,GAAGC,CAAM,EAAIJ,EAC1BK,EAAgBH,IAAQ,KAAO,CAAE,GAAGE,EAAO,IAAAF,CAAI,EAAIE,EACzD,OAAOE,EAAcP,EAAMM,CAA6B,CAC1D",
|
|
6
|
+
"names": ["jsx_runtime_exports", "__export", "Fragment", "jsx", "__toCommonJS", "SPEC_ELEMENT_TYPE", "SPEC_FRAGMENT_TYPE", "SPEC_PORTAL_TYPE", "SPEC_PROVIDER_TYPE", "SPEC_CONSUMER_TYPE", "SPEC_FORWARD_REF_TYPE", "SPEC_MEMO_TYPE", "SPEC_LAZY_TYPE", "SPEC_SUSPENSE_TYPE", "SPEC_STRICT_MODE_TYPE", "SPEC_PROFILER_TYPE", "createElement", "type", "config", "children", "key", "ref", "props", "propName", "defaultProps", "SPEC_ELEMENT_TYPE", "Fragment", "SPEC_FRAGMENT_TYPE", "jsx", "type", "config", "maybeKey", "key", "_key", "props", "configWithKey", "createElement"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
+
var P=Symbol.for("spec.element"),u=Symbol.for("spec.fragment"),d=Symbol.for("spec.portal"),y=Symbol.for("spec.provider"),a=Symbol.for("spec.consumer"),S=Symbol.for("spec.forward_ref"),i=Symbol.for("spec.memo"),f=Symbol.for("spec.lazy"),C=Symbol.for("spec.suspense"),x=Symbol.for("spec.strict_mode"),_=Symbol.for("spec.profiler");function m(p,o,...t){let r=null,l=null,n={};if(o!=null){o.key!==void 0&&(r=""+o.key),o.ref!==void 0&&(l=o.ref);for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&e!=="key"&&e!=="ref"&&e!=="__proto__"&&e!=="constructor"&&e!=="prototype"&&(n[e]=o[e])}if(t.length===1?n.children=t[0]:t.length>1&&(n.children=t),typeof p=="function"&&p.defaultProps){let e=p.defaultProps;for(let s of Object.keys(e))s!=="__proto__"&&s!=="constructor"&&n[s]===void 0&&(n[s]=e[s])}return{$$typeof:P,type:p,props:n,key:r,ref:l}}var c=u;function Y(p,o,t){let r=t!==void 0?t:o.key!==void 0?o.key:null,{key:l,...n}=o,e=r!==null?{...n,key:r}:n;return m(p,e)}export{c as Fragment,Y as jsx,Y as jsxs};
|
|
2
3
|
//# sourceMappingURL=specifyjs-jsx-runtime.esm.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/shared/types.ts", "../src/core/create-element.ts", "../src/core/fragment.ts", "../src/jsx-runtime.ts"],
|
|
4
|
+
"sourcesContent": ["// ============================================================================\n// SpecifyJS Core Types\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\n/** Unique symbol to identify SpecifyJS elements */\nexport const SPEC_ELEMENT_TYPE = Symbol.for('spec.element');\nexport const SPEC_FRAGMENT_TYPE = Symbol.for('spec.fragment');\nexport const SPEC_PORTAL_TYPE = Symbol.for('spec.portal');\nexport const SPEC_PROVIDER_TYPE = Symbol.for('spec.provider');\nexport const SPEC_CONSUMER_TYPE = Symbol.for('spec.consumer');\nexport const SPEC_FORWARD_REF_TYPE = Symbol.for('spec.forward_ref');\nexport const SPEC_MEMO_TYPE = Symbol.for('spec.memo');\nexport const SPEC_LAZY_TYPE = Symbol.for('spec.lazy');\nexport const SPEC_SUSPENSE_TYPE = Symbol.for('spec.suspense');\nexport const SPEC_STRICT_MODE_TYPE = Symbol.for('spec.strict_mode');\nexport const SPEC_PROFILER_TYPE = Symbol.for('spec.profiler');\n\n/** A key used for reconciliation */\nexport type Key = string | number | null;\n\n/** A ref can be a callback, an object, or null */\nexport type Ref<T = unknown> = RefCallback<T> | RefObject<T> | null;\nexport type RefCallback<T> = (instance: T | null) => void;\nexport interface RefObject<T> {\n current: T | null;\n}\n\n/** Props are an arbitrary key-value map */\nexport type Props = Record<string, unknown> & {\n children?: SpecNode;\n key?: Key;\n ref?: Ref;\n};\n\n/** Valid child types in a SpecifyJS tree */\nexport type SpecChild = SpecElement | string | number | boolean | null | undefined;\nexport type SpecNode = SpecChild | SpecNode[];\n\n/** A functional component */\nexport type FunctionComponent<P extends Props = Props> = (props: P) => SpecNode;\n\n/** A class component constructor */\nexport interface ClassComponentConstructor<P extends Props = Props, S = unknown> {\n new (props: P): ClassComponentInstance<P, S>;\n getDerivedStateFromProps?(props: P, state: S): Partial<S> | null;\n getDerivedStateFromError?(error: unknown): Partial<S> | null;\n}\n\n/** Instance of a class component */\nexport interface ClassComponentInstance<P extends Props = Props, S = unknown> {\n props: P;\n state: S;\n setState(updater: Partial<S> | ((prevState: S, props: P) => Partial<S> | null)): void;\n forceUpdate(callback?: () => void): void;\n render(): SpecNode;\n componentDidMount?(): void;\n componentDidUpdate?(prevProps: P, prevState: S, snapshot?: unknown): void;\n componentWillUnmount?(): void;\n shouldComponentUpdate?(nextProps: P, nextState: S): boolean;\n getSnapshotBeforeUpdate?(prevProps: P, prevState: S): unknown;\n componentDidCatch?(error: unknown, info: ErrorInfo): void;\n // Internal: set by the reconciler for setState/forceUpdate wiring\n _fiber: unknown;\n _pendingState: Array<Partial<S> | ((prevState: S, props: P) => Partial<S> | null)>;\n _forceUpdate: boolean;\n _enqueueUpdate(callback?: () => void): void;\n}\n\nexport interface ErrorInfo {\n componentStack: string;\n}\n\n/** A component type can be a function, a class, or a special symbol type */\nexport type ComponentType<P extends Props = Props> =\n | FunctionComponent<P>\n | ClassComponentConstructor<P>\n | string\n | symbol;\n\n/** The core element structure \u2014 equivalent to React.Element */\nexport interface SpecElement<P extends Props = Props> {\n $$typeof: typeof SPEC_ELEMENT_TYPE;\n type: ComponentType<P>;\n props: P;\n key: Key;\n ref: Ref;\n}\n\n/** Fiber node types for the reconciler */\nexport const enum FiberTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n HostRoot = 2,\n HostComponent = 3,\n HostText = 4,\n Fragment = 5,\n ContextProvider = 6,\n ContextConsumer = 7,\n ForwardRef = 8,\n MemoComponent = 9,\n LazyComponent = 10,\n SuspenseComponent = 11,\n Profiler = 12,\n Portal = 13,\n}\n\n/** Effect flags for fiber work */\nexport const enum EffectTag {\n NoEffect = 0,\n Placement = 1,\n Update = 2,\n Deletion = 4,\n ChildDeletion = 8,\n Snapshot = 16,\n Passive = 32,\n Layout = 64,\n Ref = 128,\n}\n\n/** Fiber node \u2014 the internal work unit */\nexport interface Fiber<P extends Props = Props> {\n tag: FiberTag;\n type: ComponentType<P> | null;\n key: Key;\n ref: Ref;\n\n stateNode: unknown;\n pendingProps: P;\n memoizedProps: P | null;\n memoizedState: unknown;\n\n return: Fiber | null;\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n alternate: Fiber | null;\n effectTag: EffectTag;\n\n updateQueue: unknown;\n dependencies: unknown;\n\n lanes: number;\n childLanes: number;\n}\n\n/** Context type */\nexport interface SpecContext<T> {\n $$typeof: symbol;\n Provider: ComponentType;\n Consumer: ComponentType;\n _currentValue: T;\n _defaultValue: T;\n displayName?: string;\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport {\n SPEC_ELEMENT_TYPE,\n type SpecElement,\n type ComponentType,\n type Props,\n type Key,\n type Ref,\n} from '../shared/types';\n\n/**\n * Creates a SpecifyJS element (virtual DOM node).\n * Equivalent to React.createElement.\n */\nexport function createElement<P extends Props>(\n type: ComponentType<P>,\n config: (Omit<P, 'children'> & { key?: Key; ref?: Ref }) | null,\n ...children: unknown[]\n): SpecElement<P> {\n let key: Key = null;\n let ref: Ref = null;\n const props: Record<string, unknown> = {};\n\n if (config != null) {\n if (config.key !== undefined) {\n key = '' + config.key;\n }\n if (config.ref !== undefined) {\n ref = config.ref as Ref;\n }\n\n for (const propName in config) {\n if (\n Object.prototype.hasOwnProperty.call(config, propName) &&\n propName !== 'key' &&\n propName !== 'ref' &&\n propName !== '__proto__' &&\n propName !== 'constructor' &&\n propName !== 'prototype'\n ) {\n props[propName] = (config as Record<string, unknown>)[propName];\n }\n }\n }\n\n if (children.length === 1) {\n props.children = children[0];\n } else if (children.length > 1) {\n props.children = children;\n }\n\n // Apply default props for component types\n if (\n typeof type === 'function' &&\n (type as unknown as { defaultProps?: Partial<P> }).defaultProps\n ) {\n const defaultProps = (type as unknown as { defaultProps: Partial<P> }).defaultProps;\n for (const propName of Object.keys(defaultProps)) {\n if (propName !== '__proto__' && propName !== 'constructor' && props[propName] === undefined) {\n props[propName] = defaultProps[propName as keyof typeof defaultProps];\n }\n }\n }\n\n return {\n $$typeof: SPEC_ELEMENT_TYPE,\n type,\n props: props as P,\n key,\n ref,\n };\n}\n\n/**\n * Creates a factory function for producing elements of a given type.\n * Legacy API \u2014 equivalent to React.createFactory.\n *\n * @deprecated Use createElement directly or JSX instead.\n */\nexport function createFactory<P extends Props>(\n type: ComponentType<P>,\n): (\n config?: (Omit<P, 'children'> & { key?: Key; ref?: Ref }) | null,\n ...children: unknown[]\n) => SpecElement<P> {\n return (config, ...children) => createElement(type, config ?? null, ...children);\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport { SPEC_FRAGMENT_TYPE } from '../shared/types';\n\n/**\n * Fragment allows grouping children without adding extra DOM nodes.\n * Usage: <Fragment>...</Fragment> or <>...</>\n */\nexport const Fragment: symbol = SPEC_FRAGMENT_TYPE;\n", "// ============================================================================\n// SpecifyJS JSX Runtime (automatic transform)\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport { createElement } from './core/create-element';\nimport { Fragment } from './core/fragment';\nimport type { Props, Key, ComponentType, SpecElement } from './shared/types';\n\nexport { Fragment };\n\nexport function jsx<P extends Props>(\n type: ComponentType<P>,\n config: P & { key?: Key },\n maybeKey?: Key,\n): SpecElement<P> {\n const key = maybeKey !== undefined ? maybeKey : config.key !== undefined ? config.key : null;\n const { key: _key, ...props } = config;\n const configWithKey = key !== null ? { ...props, key } : props;\n return createElement(type, configWithKey as unknown as P);\n}\n\nexport { jsx as jsxs };\n"],
|
|
5
|
+
"mappings": ";AAOO,IAAMA,EAAoB,OAAO,IAAI,cAAc,EAC7CC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAmB,OAAO,IAAI,aAAa,EAC3CC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAwB,OAAO,IAAI,kBAAkB,EACrDC,EAAiB,OAAO,IAAI,WAAW,EACvCC,EAAiB,OAAO,IAAI,WAAW,EACvCC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAwB,OAAO,IAAI,kBAAkB,EACrDC,EAAqB,OAAO,IAAI,eAAe,ECDrD,SAASC,EACdC,EACAC,KACGC,EACa,CAChB,IAAIC,EAAW,KACXC,EAAW,KACTC,EAAiC,CAAC,EAExC,GAAIJ,GAAU,KAAM,CACdA,EAAO,MAAQ,SACjBE,EAAM,GAAKF,EAAO,KAEhBA,EAAO,MAAQ,SACjBG,EAAMH,EAAO,KAGf,QAAWK,KAAYL,EAEnB,OAAO,UAAU,eAAe,KAAKA,EAAQK,CAAQ,GACrDA,IAAa,OACbA,IAAa,OACbA,IAAa,aACbA,IAAa,eACbA,IAAa,cAEbD,EAAMC,CAAQ,EAAKL,EAAmCK,CAAQ,EAGpE,CASA,GAPIJ,EAAS,SAAW,EACtBG,EAAM,SAAWH,EAAS,CAAC,EAClBA,EAAS,OAAS,IAC3BG,EAAM,SAAWH,GAKjB,OAAOF,GAAS,YACfA,EAAkD,aACnD,CACA,IAAMO,EAAgBP,EAAiD,aACvE,QAAWM,KAAY,OAAO,KAAKC,CAAY,EACzCD,IAAa,aAAeA,IAAa,eAAiBD,EAAMC,CAAQ,IAAM,SAChFD,EAAMC,CAAQ,EAAIC,EAAaD,CAAqC,EAG1E,CAEA,MAAO,CACL,SAAUE,EACV,KAAAR,EACA,MAAOK,EACP,IAAAF,EACA,IAAAC,CACF,CACF,CChEO,IAAMK,EAAmBC,ECGzB,SAASC,EACdC,EACAC,EACAC,EACgB,CAChB,IAAMC,EAAMD,IAAa,OAAYA,EAAWD,EAAO,MAAQ,OAAYA,EAAO,IAAM,KAClF,CAAE,IAAKG,EAAM,GAAGC,CAAM,EAAIJ,EAC1BK,EAAgBH,IAAQ,KAAO,CAAE,GAAGE,EAAO,IAAAF,CAAI,EAAIE,EACzD,OAAOE,EAAcP,EAAMM,CAA6B,CAC1D",
|
|
6
|
+
"names": ["SPEC_ELEMENT_TYPE", "SPEC_FRAGMENT_TYPE", "SPEC_PORTAL_TYPE", "SPEC_PROVIDER_TYPE", "SPEC_CONSUMER_TYPE", "SPEC_FORWARD_REF_TYPE", "SPEC_MEMO_TYPE", "SPEC_LAZY_TYPE", "SPEC_SUSPENSE_TYPE", "SPEC_STRICT_MODE_TYPE", "SPEC_PROFILER_TYPE", "createElement", "type", "config", "children", "key", "ref", "props", "propName", "defaultProps", "SPEC_ELEMENT_TYPE", "Fragment", "SPEC_FRAGMENT_TYPE", "jsx", "type", "config", "maybeKey", "key", "_key", "props", "configWithKey", "createElement"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
+
"use strict";var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var O=(n,o)=>{for(var s in o)d(n,s,{get:o[s],enumerable:!0})},T=(n,o,s,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of w(o))!N.call(n,r)&&r!==s&&d(n,r,{get:()=>o[r],enumerable:!(e=v(o,r))||e.enumerable});return n};var I=n=>T(d({},"__esModule",{value:!0}),n);var U={};O(U,{renderToPipeableStream:()=>b,renderToReadableStream:()=>g,renderToStaticMarkup:()=>R,renderToString:()=>c});module.exports=I(U);var S=Symbol.for("spec.element"),f=Symbol.for("spec.fragment"),j=Symbol.for("spec.portal"),P=Symbol.for("spec.provider"),q=Symbol.for("spec.consumer"),y=Symbol.for("spec.forward_ref"),E=Symbol.for("spec.memo"),G=Symbol.for("spec.lazy"),J=Symbol.for("spec.suspense"),C=Symbol.for("spec.strict_mode"),h=Symbol.for("spec.profiler");function m(n){return typeof n=="object"&&n!==null&&n.$$typeof===S}var $=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),L={className:"class",htmlFor:"for",httpEquiv:"http-equiv",acceptCharset:"accept-charset",tabIndex:"tabindex",autoFocus:"autofocus",autoComplete:"autocomplete",autoPlay:"autoplay",crossOrigin:"crossorigin",noValidate:"novalidate",formNoValidate:"formnovalidate",readOnly:"readonly",cellPadding:"cellpadding",cellSpacing:"cellspacing",colSpan:"colspan",rowSpan:"rowspan",frameBorder:"frameborder",marginHeight:"marginheight",marginWidth:"marginwidth"},Y=new Set(["children","key","ref","dangerouslySetInnerHTML"]),M=/^on[A-Z]/;function c(n){return _("renderToString"),l(n,!0)}function R(n){return _("renderToStaticMarkup"),l(n,!1)}function _(n){typeof process<"u"&&typeof process.env<"u"&&process.env.SPECIFYJS_ALLOW_PRERENDER==="true"||typeof process<"u"&&typeof process.env<"u"&&(process.env.SPECIFYJS_ALLOW_PRERENDER||console.warn(`[SpecifyJS] ${n}() is intended for build-time pre-rendering only, not runtime server-side rendering. Set SPECIFYJS_ALLOW_PRERENDER=true if you are using this in a build script. See: https://github.com/asymmetric-effort/specifyjs/blob/main/docs/api/static-prerendering.md`))}function l(n,o){if(n==null||typeof n=="boolean")return"";if(typeof n=="string")return u(n);if(typeof n=="number")return String(n);if(Array.isArray(n)){let e="",r=[];for(let t=n.length-1;t>=0;t--)r.push(n[t]);for(;r.length>0;){let t=r.pop();if(!(t==null||typeof t=="boolean")){if(typeof t=="string"){e+=u(t);continue}if(typeof t=="number"){e+=String(t);continue}if(Array.isArray(t)){for(let i=t.length-1;i>=0;i--)r.push(t[i]);continue}m(t)&&(e+=x(t,o))}}return e}return m(n)?x(n,o):""}function x(n,o){let{type:s,props:e}=n;if(s===f||s===C||s===h)return l(e.children,o);if(typeof s=="object"&&s!==null){let r=s.$$typeof;if(r===P){let t=s._context,i=t._currentValue;t._currentValue=e.value;let p=l(e.children,o);return t._currentValue=i,p}if(r===y){let t=s.render,i=t(e,n.ref);return l(i,o)}if(r===E){let t=s.type;if(typeof t=="function"){let i=t(e);return l(i,o)}}}if(typeof s=="function"){if(s.prototype?.isSpecComponent){let t=s,p=new t(e).render();return l(p,o)}let r=s(e);return l(r,o)}return typeof s=="string"?V(s,e,o):""}function V(n,o,s){let e=`<${n}`;for(let r in o){if(Y.has(r)||M.test(r))continue;let t=o[r];if(t==null||t===!1)continue;let i=L[r]||r.toLowerCase();/^[a-zA-Z_][\w\-:.]*$/.test(i)&&(r==="style"?e+=` style="${A(t)}"`:r==="value"||r==="checked"||r==="selected"?t===!0?e+=` ${i}`:e+=` ${i}="${u(String(t))}"`:t===!0?e+=` ${i}`:e+=` ${i}="${u(String(t))}"`)}if($.has(n))return e+="/>",e;if(e+=">",o.dangerouslySetInnerHTML){let r=o.dangerouslySetInnerHTML.__html;e+=r}else e+=l(o.children,s);return e+=`</${n}>`,e}function A(n){let o=[];for(let s in n){let e=n[s];if(e==null)continue;let r=s.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`),t=typeof e=="number"&&e!==0&&!D(s)?`${e}px`:String(e);t=t.replace(/expression\s*\(/gi,"").replace(/url\s*\(\s*javascript:/gi,"url("),o.push(`${r}:${t}`)}return o.join(";")}var z=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function D(n){return z.has(n)}function u(n){let o="",s=0;for(let e=0;e<n.length;e++){let r;switch(n.charCodeAt(e)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break}r!==void 0&&(s!==e&&(o+=n.slice(s,e)),o+=r,s=e+1)}return s===0?n:(s<n.length&&(o+=n.slice(s)),o)}function b(n,o){let s=!1;return{pipe(e){if(s)return e.end(),e;let r;try{r=c(n)}catch(p){return o?.onShellError?.(p),o?.onError?.(p),e.end(),e}o?.onShellReady?.();let t=o?.progressiveChunkSize??8192;if(r.length<=t)e.write(r),e.end(),o?.onAllReady?.();else{let a=function(){if(s||p>=r.length){e.end(),o?.onAllReady?.();return}let k=r.slice(p,p+t);p+=t,e.write(k)?setImmediate(a):e.once("drain",a)};var i=a;let p=0;a()}return e},abort(e){s=!0,o?.onError?.(e)}}}async function g(n,o){let s=new TextEncoder,e=o?.progressiveChunkSize??8192;return new ReadableStream({start(r){if(o?.signal?.aborted){r.close();return}let t;try{t=c(n)}catch(p){o?.onError?.(p),r.error(p);return}let i=0;for(;i<t.length;){let p=t.slice(i,i+e);r.enqueue(s.encode(p)),i+=e}r.close()}})}
|
|
2
3
|
//# sourceMappingURL=specifyjs-server.cjs.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/server/index.ts", "../src/shared/types.ts", "../src/core/is-valid-element.ts", "../src/server/render-to-string.ts", "../src/server/render-to-pipeable-stream.ts", "../src/server/render-to-readable-stream.ts"],
|
|
4
|
+
"sourcesContent": ["// ============================================================================\n// SpecifyJS Static Pre-rendering \u2014 Build-time HTML Generation\n//\n// These APIs render SpecifyJS component trees to HTML strings or streams\n// for use in BUILD SCRIPTS and STATIC SITE GENERATION only.\n// They must NOT be used for server-side rendering in request handlers.\n//\n// For dynamic content, use client-side rendering with data fetched\n// via HTTPS from API endpoints.\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nexport { renderToString, renderToStaticMarkup } from './render-to-string';\nexport { renderToPipeableStream } from './render-to-pipeable-stream';\nexport { renderToReadableStream } from './render-to-readable-stream';\n", "// ============================================================================\n// SpecifyJS Core Types\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\n/** Unique symbol to identify SpecifyJS elements */\nexport const SPEC_ELEMENT_TYPE = Symbol.for('spec.element');\nexport const SPEC_FRAGMENT_TYPE = Symbol.for('spec.fragment');\nexport const SPEC_PORTAL_TYPE = Symbol.for('spec.portal');\nexport const SPEC_PROVIDER_TYPE = Symbol.for('spec.provider');\nexport const SPEC_CONSUMER_TYPE = Symbol.for('spec.consumer');\nexport const SPEC_FORWARD_REF_TYPE = Symbol.for('spec.forward_ref');\nexport const SPEC_MEMO_TYPE = Symbol.for('spec.memo');\nexport const SPEC_LAZY_TYPE = Symbol.for('spec.lazy');\nexport const SPEC_SUSPENSE_TYPE = Symbol.for('spec.suspense');\nexport const SPEC_STRICT_MODE_TYPE = Symbol.for('spec.strict_mode');\nexport const SPEC_PROFILER_TYPE = Symbol.for('spec.profiler');\n\n/** A key used for reconciliation */\nexport type Key = string | number | null;\n\n/** A ref can be a callback, an object, or null */\nexport type Ref<T = unknown> = RefCallback<T> | RefObject<T> | null;\nexport type RefCallback<T> = (instance: T | null) => void;\nexport interface RefObject<T> {\n current: T | null;\n}\n\n/** Props are an arbitrary key-value map */\nexport type Props = Record<string, unknown> & {\n children?: SpecNode;\n key?: Key;\n ref?: Ref;\n};\n\n/** Valid child types in a SpecifyJS tree */\nexport type SpecChild = SpecElement | string | number | boolean | null | undefined;\nexport type SpecNode = SpecChild | SpecNode[];\n\n/** A functional component */\nexport type FunctionComponent<P extends Props = Props> = (props: P) => SpecNode;\n\n/** A class component constructor */\nexport interface ClassComponentConstructor<P extends Props = Props, S = unknown> {\n new (props: P): ClassComponentInstance<P, S>;\n getDerivedStateFromProps?(props: P, state: S): Partial<S> | null;\n getDerivedStateFromError?(error: unknown): Partial<S> | null;\n}\n\n/** Instance of a class component */\nexport interface ClassComponentInstance<P extends Props = Props, S = unknown> {\n props: P;\n state: S;\n setState(updater: Partial<S> | ((prevState: S, props: P) => Partial<S> | null)): void;\n forceUpdate(callback?: () => void): void;\n render(): SpecNode;\n componentDidMount?(): void;\n componentDidUpdate?(prevProps: P, prevState: S, snapshot?: unknown): void;\n componentWillUnmount?(): void;\n shouldComponentUpdate?(nextProps: P, nextState: S): boolean;\n getSnapshotBeforeUpdate?(prevProps: P, prevState: S): unknown;\n componentDidCatch?(error: unknown, info: ErrorInfo): void;\n // Internal: set by the reconciler for setState/forceUpdate wiring\n _fiber: unknown;\n _pendingState: Array<Partial<S> | ((prevState: S, props: P) => Partial<S> | null)>;\n _forceUpdate: boolean;\n _enqueueUpdate(callback?: () => void): void;\n}\n\nexport interface ErrorInfo {\n componentStack: string;\n}\n\n/** A component type can be a function, a class, or a special symbol type */\nexport type ComponentType<P extends Props = Props> =\n | FunctionComponent<P>\n | ClassComponentConstructor<P>\n | string\n | symbol;\n\n/** The core element structure \u2014 equivalent to React.Element */\nexport interface SpecElement<P extends Props = Props> {\n $$typeof: typeof SPEC_ELEMENT_TYPE;\n type: ComponentType<P>;\n props: P;\n key: Key;\n ref: Ref;\n}\n\n/** Fiber node types for the reconciler */\nexport const enum FiberTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n HostRoot = 2,\n HostComponent = 3,\n HostText = 4,\n Fragment = 5,\n ContextProvider = 6,\n ContextConsumer = 7,\n ForwardRef = 8,\n MemoComponent = 9,\n LazyComponent = 10,\n SuspenseComponent = 11,\n Profiler = 12,\n Portal = 13,\n}\n\n/** Effect flags for fiber work */\nexport const enum EffectTag {\n NoEffect = 0,\n Placement = 1,\n Update = 2,\n Deletion = 4,\n ChildDeletion = 8,\n Snapshot = 16,\n Passive = 32,\n Layout = 64,\n Ref = 128,\n}\n\n/** Fiber node \u2014 the internal work unit */\nexport interface Fiber<P extends Props = Props> {\n tag: FiberTag;\n type: ComponentType<P> | null;\n key: Key;\n ref: Ref;\n\n stateNode: unknown;\n pendingProps: P;\n memoizedProps: P | null;\n memoizedState: unknown;\n\n return: Fiber | null;\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n alternate: Fiber | null;\n effectTag: EffectTag;\n\n updateQueue: unknown;\n dependencies: unknown;\n\n lanes: number;\n childLanes: number;\n}\n\n/** Context type */\nexport interface SpecContext<T> {\n $$typeof: symbol;\n Provider: ComponentType;\n Consumer: ComponentType;\n _currentValue: T;\n _defaultValue: T;\n displayName?: string;\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport { SPEC_ELEMENT_TYPE, type SpecElement } from '../shared/types';\n\n/**\n * Checks if a value is a valid SpecifyJS element.\n * Equivalent to React.isValidElement.\n */\nexport function isValidElement(object: unknown): object is SpecElement {\n return (\n typeof object === 'object' &&\n object !== null &&\n (object as SpecElement).$$typeof === SPEC_ELEMENT_TYPE\n );\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport {\n type SpecNode,\n type SpecElement,\n type Props,\n type FunctionComponent,\n type ClassComponentInstance,\n SPEC_FRAGMENT_TYPE,\n SPEC_STRICT_MODE_TYPE,\n SPEC_PROFILER_TYPE,\n SPEC_FORWARD_REF_TYPE,\n SPEC_MEMO_TYPE,\n SPEC_PROVIDER_TYPE,\n} from '../shared/types';\nimport { isValidElement } from '../core/is-valid-element';\n\n// Self-closing HTML tags\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\n// Map of prop names to HTML attribute names\nconst PROP_TO_ATTR: Record<string, string> = {\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n acceptCharset: 'accept-charset',\n tabIndex: 'tabindex',\n autoFocus: 'autofocus',\n autoComplete: 'autocomplete',\n autoPlay: 'autoplay',\n crossOrigin: 'crossorigin',\n noValidate: 'novalidate',\n formNoValidate: 'formnovalidate',\n readOnly: 'readonly',\n cellPadding: 'cellpadding',\n cellSpacing: 'cellspacing',\n colSpan: 'colspan',\n rowSpan: 'rowspan',\n frameBorder: 'frameborder',\n marginHeight: 'marginheight',\n marginWidth: 'marginwidth',\n};\n\n// Props that should not be rendered as attributes\nconst RESERVED_PROPS = new Set(['children', 'key', 'ref', 'dangerouslySetInnerHTML']);\n\nconst EVENT_RE = /^on[A-Z]/;\n\n/**\n * Renders a SpecifyJS component tree to an HTML string.\n *\n * **Build-time pre-rendering only.** This function is designed for use\n * during the build process (e.g., static site generation, build scripts)\n * to produce HTML files that are served statically. It must NOT be called\n * in server request handlers, middleware, or any runtime code path that\n * responds to HTTP requests.\n *\n * For dynamic content, use SpecifyJS's client-side rendering with data\n * fetched via HTTPS from API endpoints.\n *\n * @throws {Error} If called in a detected server request context\n */\nexport function renderToString(element: SpecNode): string {\n assertNotInRequestContext('renderToString');\n return renderNode(element, true);\n}\n\n/**\n * Renders a SpecifyJS component tree to static HTML (no hydration markers).\n *\n * **Build-time pre-rendering only.** Use in build scripts to generate\n * static HTML pages. Do NOT use in server request handlers.\n *\n * @throws {Error} If called in a detected server request context\n */\nexport function renderToStaticMarkup(element: SpecNode): string {\n assertNotInRequestContext('renderToStaticMarkup');\n return renderNode(element, false);\n}\n\n/**\n * Guard against misuse in server request handlers.\n * Detects common server frameworks (Express, Koa, Fastify, etc.)\n * by checking for telltale global state.\n */\n/* v8 ignore next 22 -- environment detection only triggers in Node.js production */\nfunction assertNotInRequestContext(fnName: string): void {\n if (\n typeof process !== 'undefined' &&\n typeof process.env !== 'undefined' &&\n process.env.SPECIFYJS_ALLOW_PRERENDER === 'true'\n ) {\n return;\n }\n\n if (\n typeof process !== 'undefined' &&\n typeof process.env !== 'undefined' &&\n (process.env.NODE_ENV === 'production' || process.env.PORT)\n ) {\n if (!process.env.SPECIFYJS_ALLOW_PRERENDER) {\n console.warn(\n `[SpecifyJS] ${fnName}() is intended for build-time pre-rendering only, ` +\n `not runtime server-side rendering. Set SPECIFYJS_ALLOW_PRERENDER=true ` +\n `if you are using this in a build script. See: ` +\n `https://github.com/asymmetric-effort/specifyjs/blob/main/docs/api/static-prerendering.md`,\n );\n }\n }\n}\n\nfunction renderNode(node: SpecNode, includeDataAttrs: boolean): string {\n // Null, undefined, boolean \u2192 empty\n if (node == null || typeof node === 'boolean') {\n return '';\n }\n\n // String or number \u2192 escape and return\n if (typeof node === 'string') {\n return escapeHtml(node);\n }\n if (typeof node === 'number') {\n return String(node);\n }\n\n // Array \u2192 render each child (iterative, no recursion for flat arrays)\n if (Array.isArray(node)) {\n let result = '';\n const stack: SpecNode[] = [];\n for (let i = node.length - 1; i >= 0; i--) stack.push(node[i] as SpecNode);\n while (stack.length > 0) {\n const child = stack.pop()!;\n if (child == null || typeof child === 'boolean') continue;\n if (typeof child === 'string') {\n result += escapeHtml(child);\n continue;\n }\n if (typeof child === 'number') {\n result += String(child);\n continue;\n }\n if (Array.isArray(child)) {\n for (let i = child.length - 1; i >= 0; i--) stack.push(child[i] as SpecNode);\n continue;\n }\n if (isValidElement(child)) result += renderElement(child as SpecElement, includeDataAttrs);\n }\n return result;\n }\n\n // Must be an element\n if (!isValidElement(node)) {\n return '';\n }\n\n const element = node as SpecElement;\n return renderElement(element, includeDataAttrs);\n}\n\nfunction renderElement(element: SpecElement, includeDataAttrs: boolean): string {\n const { type, props } = element;\n\n // Fragment, StrictMode, Profiler \u2192 render children only\n if (\n type === SPEC_FRAGMENT_TYPE ||\n type === SPEC_STRICT_MODE_TYPE ||\n type === SPEC_PROFILER_TYPE\n ) {\n return renderNode(props.children, includeDataAttrs);\n }\n\n // Context Provider \u2192 set value and render children\n if (typeof type === 'object' && type !== null) {\n const $$typeof = (type as { $$typeof?: symbol }).$$typeof;\n\n if ($$typeof === SPEC_PROVIDER_TYPE) {\n const context = (type as { _context: { _currentValue: unknown } })._context;\n const prevValue = context._currentValue;\n context._currentValue = props.value;\n const result = renderNode(props.children, includeDataAttrs);\n context._currentValue = prevValue;\n return result;\n }\n\n if ($$typeof === SPEC_FORWARD_REF_TYPE) {\n const render = (type as { render: (props: Props, ref: unknown) => SpecNode }).render;\n const children = render(props, element.ref);\n return renderNode(children, includeDataAttrs);\n }\n\n if ($$typeof === SPEC_MEMO_TYPE) {\n const innerType = (type as { type: FunctionComponent }).type;\n if (typeof innerType === 'function') {\n const children = innerType(props);\n return renderNode(children, includeDataAttrs);\n }\n }\n }\n\n // Function component\n if (typeof type === 'function') {\n if ((type.prototype as Record<string, unknown>)?.isSpecComponent) {\n // Class component\n const Constructor = type as new (props: Props) => ClassComponentInstance;\n const instance = new Constructor(props);\n const children = instance.render();\n return renderNode(children, includeDataAttrs);\n }\n\n // Functional component\n const children = (type as FunctionComponent)(props);\n return renderNode(children, includeDataAttrs);\n }\n\n // Host element (string tag)\n if (typeof type === 'string') {\n return renderHostElement(type, props, includeDataAttrs);\n }\n\n return '';\n}\n\nfunction renderHostElement(tag: string, props: Props, includeDataAttrs: boolean): string {\n let html = `<${tag}`;\n\n // Render attributes\n for (const key in props) {\n if (RESERVED_PROPS.has(key) || EVENT_RE.test(key)) continue;\n\n const value = props[key];\n if (value == null || value === false) continue;\n\n const attrName = PROP_TO_ATTR[key] || key.toLowerCase();\n\n // C-1: Validate attribute names to prevent XSS via attribute name injection\n if (!/^[a-zA-Z_][\\w\\-:.]*$/.test(attrName)) continue;\n\n if (key === 'style') {\n html += ` style=\"${renderStyle(value as Record<string, string | number>)}\"`;\n } else if (key === 'value' || key === 'checked' || key === 'selected') {\n if (value === true) {\n html += ` ${attrName}`;\n } else {\n html += ` ${attrName}=\"${escapeHtml(String(value))}\"`;\n }\n } else if (value === true) {\n html += ` ${attrName}`;\n } else {\n html += ` ${attrName}=\"${escapeHtml(String(value))}\"`;\n }\n }\n\n if (includeDataAttrs) {\n // Mark the root element for hydration\n }\n\n // Self-closing tags\n if (VOID_ELEMENTS.has(tag)) {\n html += '/>';\n return html;\n }\n\n html += '>';\n\n // dangerouslySetInnerHTML\n if (props.dangerouslySetInnerHTML) {\n const innerHtml = (props.dangerouslySetInnerHTML as { __html: string }).__html;\n html += innerHtml;\n } else {\n // Render children\n html += renderNode(props.children, includeDataAttrs);\n }\n\n html += `</${tag}>`;\n return html;\n}\n\nfunction renderStyle(style: Record<string, string | number>): string {\n const parts: string[] = [];\n for (const prop in style) {\n const value = style[prop];\n if (value == null) continue;\n\n // Convert camelCase to kebab-case\n const cssProp = prop.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);\n let cssValue =\n typeof value === 'number' && value !== 0 && !isUnitlessProp(prop)\n ? `${value}px`\n : String(value);\n\n // L-6: Sanitize CSS values \u2014 strip dangerous patterns\n cssValue = cssValue\n .replace(/expression\\s*\\(/gi, '')\n .replace(/url\\s*\\(\\s*javascript:/gi, 'url(');\n\n parts.push(`${cssProp}:${cssValue}`);\n }\n return parts.join(';');\n}\n\nconst UNITLESS_PROPS = new Set([\n 'animationIterationCount',\n 'aspectRatio',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'columns',\n 'flex',\n 'flexGrow',\n 'flexPositive',\n 'flexShrink',\n 'flexNegative',\n 'flexOrder',\n 'gridArea',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowSpan',\n 'gridRowStart',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnSpan',\n 'gridColumnStart',\n 'fontWeight',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n 'fillOpacity',\n 'floodOpacity',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n]);\n\nfunction isUnitlessProp(prop: string): boolean {\n return UNITLESS_PROPS.has(prop);\n}\n\nfunction escapeHtml(str: string): string {\n let result = '';\n let lastIndex = 0;\n\n for (let i = 0; i < str.length; i++) {\n let escaped: string | undefined;\n switch (str.charCodeAt(i)) {\n case 34:\n escaped = '"';\n break; // \"\n case 38:\n escaped = '&';\n break; // &\n case 39:\n escaped = ''';\n break; // '\n case 60:\n escaped = '<';\n break; // <\n case 62:\n escaped = '>';\n break; // >\n }\n if (escaped !== undefined) {\n if (lastIndex !== i) {\n result += str.slice(lastIndex, i);\n }\n result += escaped;\n lastIndex = i + 1;\n }\n }\n\n if (lastIndex === 0) return str;\n if (lastIndex < str.length) {\n result += str.slice(lastIndex);\n }\n return result;\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport type { SpecNode } from '../shared/types';\nimport type { Writable } from 'stream';\nimport { renderToString } from './render-to-string';\n\nexport interface PipeableStream {\n pipe<T extends Writable>(destination: T): T;\n abort(reason?: unknown): void;\n}\n\nexport interface RenderToPipeableStreamOptions {\n identifierPrefix?: string;\n onShellReady?: () => void;\n onShellError?: (error: unknown) => void;\n onAllReady?: () => void;\n onError?: (error: unknown) => void;\n /**\n * Maximum number of bytes to write per chunk.\n * Smaller values allow the event loop to process other work between chunks.\n * Default: 8192 (8KB)\n */\n progressiveChunkSize?: number;\n}\n\n/**\n * Renders a SpecifyJS component tree to a Node.js pipeable stream.\n *\n * **Build-time pre-rendering only.** Intended for build scripts that\n * generate static HTML files, not for runtime server request handlers.\n * Renders the full HTML string, then writes it in chunks to the writable\n * stream for efficient file I/O during static site generation.\n *\n * For dynamic content, use SpecifyJS's client-side rendering with data\n * fetched via HTTPS from API endpoints.\n */\nexport function renderToPipeableStream(\n element: SpecNode,\n options?: RenderToPipeableStreamOptions,\n): PipeableStream {\n let aborted = false;\n\n return {\n pipe<T extends Writable>(destination: T): T {\n if (aborted) {\n destination.end();\n return destination;\n }\n\n let html: string;\n try {\n html = renderToString(element);\n } catch (error) {\n options?.onShellError?.(error);\n options?.onError?.(error);\n destination.end();\n return destination;\n }\n\n options?.onShellReady?.();\n\n const chunkSize = options?.progressiveChunkSize ?? 8192;\n\n if (html.length <= chunkSize) {\n // Small enough to write in one shot\n destination.write(html);\n destination.end();\n options?.onAllReady?.();\n } else {\n // Write in chunks, yielding between each\n let offset = 0;\n\n function writeNextChunk(): void {\n if (aborted || offset >= html.length) {\n destination.end();\n options?.onAllReady?.();\n return;\n }\n\n const chunk = html.slice(offset, offset + chunkSize);\n offset += chunkSize;\n\n const canContinue = destination.write(chunk);\n if (canContinue) {\n // Yield to event loop before next chunk\n setImmediate(writeNextChunk);\n } else {\n /* v8 ignore next 2 -- backpressure path requires slow consumer */\n destination.once('drain', writeNextChunk);\n }\n }\n\n writeNextChunk();\n }\n\n return destination;\n },\n abort(reason?: unknown): void {\n aborted = true;\n options?.onError?.(reason);\n },\n };\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport type { SpecNode } from '../shared/types';\nimport { renderToString } from './render-to-string';\n\nexport interface RenderToReadableStreamOptions {\n identifierPrefix?: string;\n signal?: AbortSignal;\n onError?: (error: unknown) => void;\n /**\n * Maximum bytes per chunk for progressive flushing.\n * Default: 8192 (8KB)\n */\n progressiveChunkSize?: number;\n}\n\n/**\n * Renders a SpecifyJS tree to a web ReadableStream.\n * **Build-time pre-rendering only.** Intended for build scripts that\n * generate static HTML files, not for runtime server request handlers.\n * Renders the full HTML, then enqueues it in chunks for efficient\n * file I/O during static site generation.\n */\nexport async function renderToReadableStream(\n element: SpecNode,\n options?: RenderToReadableStreamOptions,\n): Promise<ReadableStream<Uint8Array>> {\n const encoder = new TextEncoder();\n const chunkSize = options?.progressiveChunkSize ?? 8192;\n\n return new ReadableStream({\n start(controller) {\n if (options?.signal?.aborted) {\n controller.close();\n return;\n }\n\n let html: string;\n try {\n html = renderToString(element);\n } catch (error) {\n options?.onError?.(error);\n controller.error(error);\n return;\n }\n\n // Enqueue in chunks for progressive streaming\n let offset = 0;\n while (offset < html.length) {\n const chunk = html.slice(offset, offset + chunkSize);\n controller.enqueue(encoder.encode(chunk));\n offset += chunkSize;\n }\n\n controller.close();\n },\n });\n}\n"],
|
|
5
|
+
"mappings": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,EAAA,2BAAAC,EAAA,yBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAN,GCOO,IAAMO,EAAoB,OAAO,IAAI,cAAc,EAC7CC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAmB,OAAO,IAAI,aAAa,EAC3CC,EAA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IAAAA,IAFT,IAAIC,EAAS,EAsBbD,EAAe,CACjB,CAEA,OAAOL,CACT,EACA,MAAMQ,EAAwB,CAC5BT,EAAU,GACVD,GAAS,UAAUU,CAAM,CAC3B,CACF,CACF,CC/EA,eAAsBC,EACpBC,EACAC,EACqC,CACrC,IAAMC,EAAU,IAAI,YACdC,EAAYF,GAAS,sBAAwB,KAEnD,OAAO,IAAI,eAAe,CACxB,MAAMG,EAAY,CAChB,GAAIH,GAAS,QAAQ,QAAS,CAC5BG,EAAW,MAAM,EACjB,MACF,CAEA,IAAIC,EACJ,GAAI,CACFA,EAAOC,EAAeN,CAAO,CAC/B,OAASO,EAAO,CACdN,GAAS,UAAUM,CAAK,EACxBH,EAAW,MAAMG,CAAK,EACtB,MACF,CAGA,IAAIC,EAAS,EACb,KAAOA,EAASH,EAAK,QAAQ,CAC3B,IAAMI,EAAQJ,EAAK,MAAMG,EAAQA,EAASL,CAAS,EACnDC,EAAW,QAAQF,EAAQ,OAAOO,CAAK,CAAC,EACxCD,GAAUL,CACZ,CAEAC,EAAW,MAAM,CACnB,CACF,CAAC,CACH",
|
|
6
|
+
"names": ["index_exports", "__export", "renderToPipeableStream", "renderToReadableStream", "renderToStaticMarkup", "renderToString", "__toCommonJS", "SPEC_ELEMENT_TYPE", "SPEC_FRAGMENT_TYPE", "SPEC_PORTAL_TYPE", "SPEC_PROVIDER_TYPE", "SPEC_CONSUMER_TYPE", "SPEC_FORWARD_REF_TYPE", "SPEC_MEMO_TYPE", "SPEC_LAZY_TYPE", "SPEC_SUSPENSE_TYPE", "SPEC_STRICT_MODE_TYPE", "SPEC_PROFILER_TYPE", "isValidElement", "object", "SPEC_ELEMENT_TYPE", "VOID_ELEMENTS", "PROP_TO_ATTR", "RESERVED_PROPS", "EVENT_RE", "renderToString", "element", "assertNotInRequestContext", "renderNode", "renderToStaticMarkup", "fnName", "node", "includeDataAttrs", "escapeHtml", "result", "stack", "i", "child", "isValidElement", "renderElement", "type", "props", "SPEC_FRAGMENT_TYPE", "SPEC_STRICT_MODE_TYPE", "SPEC_PROFILER_TYPE", "$$typeof", "SPEC_PROVIDER_TYPE", "context", "prevValue", "SPEC_FORWARD_REF_TYPE", "render", "children", "SPEC_MEMO_TYPE", "innerType", "Constructor", "renderHostElement", "tag", "html", "key", "value", "attrName", "renderStyle", "innerHtml", "style", "parts", "prop", "cssProp", "m", "cssValue", "isUnitlessProp", "UNITLESS_PROPS", "str", "lastIndex", "escaped", "renderToPipeableStream", "element", "options", "aborted", "destination", "html", "renderToString", "error", "chunkSize", "writeNextChunk", "offset", "chunk", "reason", "renderToReadableStream", "element", "options", "encoder", "chunkSize", "controller", "html", "renderToString", "error", "offset", "chunk"]
|
|
7
|
+
}
|
|
@@ -1,136 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/** Unique symbol to identify SpecifyJS elements */
|
|
4
|
-
declare const SPEC_ELEMENT_TYPE: unique symbol;
|
|
5
|
-
/** A key used for reconciliation */
|
|
6
|
-
type Key = string | number | null;
|
|
7
|
-
/** A ref can be a callback, an object, or null */
|
|
8
|
-
type Ref<T = unknown> = RefCallback<T> | RefObject<T> | null;
|
|
9
|
-
type RefCallback<T> = (instance: T | null) => void;
|
|
10
|
-
interface RefObject<T> {
|
|
11
|
-
current: T | null;
|
|
12
|
-
}
|
|
13
|
-
/** Props are an arbitrary key-value map */
|
|
14
|
-
type Props = Record<string, unknown> & {
|
|
15
|
-
children?: SpecNode;
|
|
16
|
-
key?: Key;
|
|
17
|
-
ref?: Ref;
|
|
18
|
-
};
|
|
19
|
-
/** Valid child types in a SpecifyJS tree */
|
|
20
|
-
type SpecChild = SpecElement | string | number | boolean | null | undefined;
|
|
21
|
-
type SpecNode = SpecChild | SpecNode[];
|
|
22
|
-
/** A functional component */
|
|
23
|
-
type FunctionComponent<P extends Props = Props> = (props: P) => SpecNode;
|
|
24
|
-
/** A class component constructor */
|
|
25
|
-
interface ClassComponentConstructor<P extends Props = Props, S = unknown> {
|
|
26
|
-
new (props: P): ClassComponentInstance<P, S>;
|
|
27
|
-
getDerivedStateFromProps?(props: P, state: S): Partial<S> | null;
|
|
28
|
-
getDerivedStateFromError?(error: unknown): Partial<S> | null;
|
|
29
|
-
}
|
|
30
|
-
/** Instance of a class component */
|
|
31
|
-
interface ClassComponentInstance<P extends Props = Props, S = unknown> {
|
|
32
|
-
props: P;
|
|
33
|
-
state: S;
|
|
34
|
-
setState(updater: Partial<S> | ((prevState: S, props: P) => Partial<S> | null)): void;
|
|
35
|
-
forceUpdate(callback?: () => void): void;
|
|
36
|
-
render(): SpecNode;
|
|
37
|
-
componentDidMount?(): void;
|
|
38
|
-
componentDidUpdate?(prevProps: P, prevState: S, snapshot?: unknown): void;
|
|
39
|
-
componentWillUnmount?(): void;
|
|
40
|
-
shouldComponentUpdate?(nextProps: P, nextState: S): boolean;
|
|
41
|
-
getSnapshotBeforeUpdate?(prevProps: P, prevState: S): unknown;
|
|
42
|
-
componentDidCatch?(error: unknown, info: ErrorInfo): void;
|
|
43
|
-
_fiber: unknown;
|
|
44
|
-
_pendingState: Array<Partial<S> | ((prevState: S, props: P) => Partial<S> | null)>;
|
|
45
|
-
_forceUpdate: boolean;
|
|
46
|
-
_enqueueUpdate(callback?: () => void): void;
|
|
47
|
-
}
|
|
48
|
-
interface ErrorInfo {
|
|
49
|
-
componentStack: string;
|
|
50
|
-
}
|
|
51
|
-
/** A component type can be a function, a class, or a special symbol type */
|
|
52
|
-
type ComponentType<P extends Props = Props> = FunctionComponent<P> | ClassComponentConstructor<P> | string | symbol;
|
|
53
|
-
/** The core element structure — equivalent to React.Element */
|
|
54
|
-
interface SpecElement<P extends Props = Props> {
|
|
55
|
-
$$typeof: typeof SPEC_ELEMENT_TYPE;
|
|
56
|
-
type: ComponentType<P>;
|
|
57
|
-
props: P;
|
|
58
|
-
key: Key;
|
|
59
|
-
ref: Ref;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Renders a SpecifyJS component tree to an HTML string.
|
|
64
|
-
*
|
|
65
|
-
* **Build-time pre-rendering only.** This function is designed for use
|
|
66
|
-
* during the build process (e.g., static site generation, build scripts)
|
|
67
|
-
* to produce HTML files that are served statically. It must NOT be called
|
|
68
|
-
* in server request handlers, middleware, or any runtime code path that
|
|
69
|
-
* responds to HTTP requests.
|
|
70
|
-
*
|
|
71
|
-
* For dynamic content, use SpecifyJS's client-side rendering with data
|
|
72
|
-
* fetched via HTTPS from API endpoints.
|
|
73
|
-
*
|
|
74
|
-
* @throws {Error} If called in a detected server request context
|
|
75
|
-
*/
|
|
76
|
-
declare function renderToString(element: SpecNode): string;
|
|
77
|
-
/**
|
|
78
|
-
* Renders a SpecifyJS component tree to static HTML (no hydration markers).
|
|
79
|
-
*
|
|
80
|
-
* **Build-time pre-rendering only.** Use in build scripts to generate
|
|
81
|
-
* static HTML pages. Do NOT use in server request handlers.
|
|
82
|
-
*
|
|
83
|
-
* @throws {Error} If called in a detected server request context
|
|
84
|
-
*/
|
|
85
|
-
declare function renderToStaticMarkup(element: SpecNode): string;
|
|
86
|
-
|
|
87
|
-
interface PipeableStream {
|
|
88
|
-
pipe<T extends Writable>(destination: T): T;
|
|
89
|
-
abort(reason?: unknown): void;
|
|
90
|
-
}
|
|
91
|
-
interface RenderToPipeableStreamOptions {
|
|
92
|
-
identifierPrefix?: string;
|
|
93
|
-
onShellReady?: () => void;
|
|
94
|
-
onShellError?: (error: unknown) => void;
|
|
95
|
-
onAllReady?: () => void;
|
|
96
|
-
onError?: (error: unknown) => void;
|
|
97
|
-
/**
|
|
98
|
-
* Maximum number of bytes to write per chunk.
|
|
99
|
-
* Smaller values allow the event loop to process other work between chunks.
|
|
100
|
-
* Default: 8192 (8KB)
|
|
101
|
-
*/
|
|
102
|
-
progressiveChunkSize?: number;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Renders a SpecifyJS component tree to a Node.js pipeable stream.
|
|
106
|
-
*
|
|
107
|
-
* **Build-time pre-rendering only.** Intended for build scripts that
|
|
108
|
-
* generate static HTML files, not for runtime server request handlers.
|
|
109
|
-
* Renders the full HTML string, then writes it in chunks to the writable
|
|
110
|
-
* stream for efficient file I/O during static site generation.
|
|
111
|
-
*
|
|
112
|
-
* For dynamic content, use SpecifyJS's client-side rendering with data
|
|
113
|
-
* fetched via HTTPS from API endpoints.
|
|
114
|
-
*/
|
|
115
|
-
declare function renderToPipeableStream(element: SpecNode, options?: RenderToPipeableStreamOptions): PipeableStream;
|
|
116
|
-
|
|
117
|
-
interface RenderToReadableStreamOptions {
|
|
118
|
-
identifierPrefix?: string;
|
|
119
|
-
signal?: AbortSignal;
|
|
120
|
-
onError?: (error: unknown) => void;
|
|
121
|
-
/**
|
|
122
|
-
* Maximum bytes per chunk for progressive flushing.
|
|
123
|
-
* Default: 8192 (8KB)
|
|
124
|
-
*/
|
|
125
|
-
progressiveChunkSize?: number;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Renders a SpecifyJS tree to a web ReadableStream.
|
|
129
|
-
* **Build-time pre-rendering only.** Intended for build scripts that
|
|
130
|
-
* generate static HTML files, not for runtime server request handlers.
|
|
131
|
-
* Renders the full HTML, then enqueues it in chunks for efficient
|
|
132
|
-
* file I/O during static site generation.
|
|
133
|
-
*/
|
|
134
|
-
declare function renderToReadableStream(element: SpecNode, options?: RenderToReadableStreamOptions): Promise<ReadableStream<Uint8Array>>;
|
|
135
|
-
|
|
136
|
-
export { renderToPipeableStream, renderToReadableStream, renderToStaticMarkup, renderToString };
|
|
1
|
+
export * from "./types/server/index";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
+
var m=Symbol.for("spec.element"),S=Symbol.for("spec.fragment"),Y=Symbol.for("spec.portal"),f=Symbol.for("spec.provider"),M=Symbol.for("spec.consumer"),P=Symbol.for("spec.forward_ref"),y=Symbol.for("spec.memo"),V=Symbol.for("spec.lazy"),A=Symbol.for("spec.suspense"),E=Symbol.for("spec.strict_mode"),C=Symbol.for("spec.profiler");function d(r){return typeof r=="object"&&r!==null&&r.$$typeof===m}var _=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),b={className:"class",htmlFor:"for",httpEquiv:"http-equiv",acceptCharset:"accept-charset",tabIndex:"tabindex",autoFocus:"autofocus",autoComplete:"autocomplete",autoPlay:"autoplay",crossOrigin:"crossorigin",noValidate:"novalidate",formNoValidate:"formnovalidate",readOnly:"readonly",cellPadding:"cellpadding",cellSpacing:"cellspacing",colSpan:"colspan",rowSpan:"rowspan",frameBorder:"frameborder",marginHeight:"marginheight",marginWidth:"marginwidth"},g=new Set(["children","key","ref","dangerouslySetInnerHTML"]),k=/^on[A-Z]/;function c(r){return x("renderToString"),l(r,!0)}function v(r){return x("renderToStaticMarkup"),l(r,!1)}function x(r){typeof process<"u"&&typeof process.env<"u"&&process.env.SPECIFYJS_ALLOW_PRERENDER==="true"||typeof process<"u"&&typeof process.env<"u"&&(process.env.SPECIFYJS_ALLOW_PRERENDER||console.warn(`[SpecifyJS] ${r}() is intended for build-time pre-rendering only, not runtime server-side rendering. Set SPECIFYJS_ALLOW_PRERENDER=true if you are using this in a build script. See: https://github.com/asymmetric-effort/specifyjs/blob/main/docs/api/static-prerendering.md`))}function l(r,t){if(r==null||typeof r=="boolean")return"";if(typeof r=="string")return u(r);if(typeof r=="number")return String(r);if(Array.isArray(r)){let e="",o=[];for(let n=r.length-1;n>=0;n--)o.push(r[n]);for(;o.length>0;){let n=o.pop();if(!(n==null||typeof n=="boolean")){if(typeof n=="string"){e+=u(n);continue}if(typeof n=="number"){e+=String(n);continue}if(Array.isArray(n)){for(let i=n.length-1;i>=0;i--)o.push(n[i]);continue}d(n)&&(e+=h(n,t))}}return e}return d(r)?h(r,t):""}function h(r,t){let{type:s,props:e}=r;if(s===S||s===E||s===C)return l(e.children,t);if(typeof s=="object"&&s!==null){let o=s.$$typeof;if(o===f){let n=s._context,i=n._currentValue;n._currentValue=e.value;let p=l(e.children,t);return n._currentValue=i,p}if(o===P){let n=s.render,i=n(e,r.ref);return l(i,t)}if(o===y){let n=s.type;if(typeof n=="function"){let i=n(e);return l(i,t)}}}if(typeof s=="function"){if(s.prototype?.isSpecComponent){let n=s,p=new n(e).render();return l(p,t)}let o=s(e);return l(o,t)}return typeof s=="string"?w(s,e,t):""}function w(r,t,s){let e=`<${r}`;for(let o in t){if(g.has(o)||k.test(o))continue;let n=t[o];if(n==null||n===!1)continue;let i=b[o]||o.toLowerCase();/^[a-zA-Z_][\w\-:.]*$/.test(i)&&(o==="style"?e+=` style="${N(n)}"`:o==="value"||o==="checked"||o==="selected"?n===!0?e+=` ${i}`:e+=` ${i}="${u(String(n))}"`:n===!0?e+=` ${i}`:e+=` ${i}="${u(String(n))}"`)}if(_.has(r))return e+="/>",e;if(e+=">",t.dangerouslySetInnerHTML){let o=t.dangerouslySetInnerHTML.__html;e+=o}else e+=l(t.children,s);return e+=`</${r}>`,e}function N(r){let t=[];for(let s in r){let e=r[s];if(e==null)continue;let o=s.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`),n=typeof e=="number"&&e!==0&&!T(s)?`${e}px`:String(e);n=n.replace(/expression\s*\(/gi,"").replace(/url\s*\(\s*javascript:/gi,"url("),t.push(`${o}:${n}`)}return t.join(";")}var O=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function T(r){return O.has(r)}function u(r){let t="",s=0;for(let e=0;e<r.length;e++){let o;switch(r.charCodeAt(e)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break}o!==void 0&&(s!==e&&(t+=r.slice(s,e)),t+=o,s=e+1)}return s===0?r:(s<r.length&&(t+=r.slice(s)),t)}function I(r,t){let s=!1;return{pipe(e){if(s)return e.end(),e;let o;try{o=c(r)}catch(p){return t?.onShellError?.(p),t?.onError?.(p),e.end(),e}t?.onShellReady?.();let n=t?.progressiveChunkSize??8192;if(o.length<=n)e.write(o),e.end(),t?.onAllReady?.();else{let a=function(){if(s||p>=o.length){e.end(),t?.onAllReady?.();return}let R=o.slice(p,p+n);p+=n,e.write(R)?setImmediate(a):e.once("drain",a)};var i=a;let p=0;a()}return e},abort(e){s=!0,t?.onError?.(e)}}}async function $(r,t){let s=new TextEncoder,e=t?.progressiveChunkSize??8192;return new ReadableStream({start(o){if(t?.signal?.aborted){o.close();return}let n;try{n=c(r)}catch(p){t?.onError?.(p),o.error(p);return}let i=0;for(;i<n.length;){let p=n.slice(i,i+e);o.enqueue(s.encode(p)),i+=e}o.close()}})}export{I as renderToPipeableStream,$ as renderToReadableStream,v as renderToStaticMarkup,c as renderToString};
|
|
2
3
|
//# sourceMappingURL=specifyjs-server.esm.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/shared/types.ts", "../src/core/is-valid-element.ts", "../src/server/render-to-string.ts", "../src/server/render-to-pipeable-stream.ts", "../src/server/render-to-readable-stream.ts"],
|
|
4
|
+
"sourcesContent": ["// ============================================================================\n// SpecifyJS Core Types\n// ============================================================================\n// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\n/** Unique symbol to identify SpecifyJS elements */\nexport const SPEC_ELEMENT_TYPE = Symbol.for('spec.element');\nexport const SPEC_FRAGMENT_TYPE = Symbol.for('spec.fragment');\nexport const SPEC_PORTAL_TYPE = Symbol.for('spec.portal');\nexport const SPEC_PROVIDER_TYPE = Symbol.for('spec.provider');\nexport const SPEC_CONSUMER_TYPE = Symbol.for('spec.consumer');\nexport const SPEC_FORWARD_REF_TYPE = Symbol.for('spec.forward_ref');\nexport const SPEC_MEMO_TYPE = Symbol.for('spec.memo');\nexport const SPEC_LAZY_TYPE = Symbol.for('spec.lazy');\nexport const SPEC_SUSPENSE_TYPE = Symbol.for('spec.suspense');\nexport const SPEC_STRICT_MODE_TYPE = Symbol.for('spec.strict_mode');\nexport const SPEC_PROFILER_TYPE = Symbol.for('spec.profiler');\n\n/** A key used for reconciliation */\nexport type Key = string | number | null;\n\n/** A ref can be a callback, an object, or null */\nexport type Ref<T = unknown> = RefCallback<T> | RefObject<T> | null;\nexport type RefCallback<T> = (instance: T | null) => void;\nexport interface RefObject<T> {\n current: T | null;\n}\n\n/** Props are an arbitrary key-value map */\nexport type Props = Record<string, unknown> & {\n children?: SpecNode;\n key?: Key;\n ref?: Ref;\n};\n\n/** Valid child types in a SpecifyJS tree */\nexport type SpecChild = SpecElement | string | number | boolean | null | undefined;\nexport type SpecNode = SpecChild | SpecNode[];\n\n/** A functional component */\nexport type FunctionComponent<P extends Props = Props> = (props: P) => SpecNode;\n\n/** A class component constructor */\nexport interface ClassComponentConstructor<P extends Props = Props, S = unknown> {\n new (props: P): ClassComponentInstance<P, S>;\n getDerivedStateFromProps?(props: P, state: S): Partial<S> | null;\n getDerivedStateFromError?(error: unknown): Partial<S> | null;\n}\n\n/** Instance of a class component */\nexport interface ClassComponentInstance<P extends Props = Props, S = unknown> {\n props: P;\n state: S;\n setState(updater: Partial<S> | ((prevState: S, props: P) => Partial<S> | null)): void;\n forceUpdate(callback?: () => void): void;\n render(): SpecNode;\n componentDidMount?(): void;\n componentDidUpdate?(prevProps: P, prevState: S, snapshot?: unknown): void;\n componentWillUnmount?(): void;\n shouldComponentUpdate?(nextProps: P, nextState: S): boolean;\n getSnapshotBeforeUpdate?(prevProps: P, prevState: S): unknown;\n componentDidCatch?(error: unknown, info: ErrorInfo): void;\n // Internal: set by the reconciler for setState/forceUpdate wiring\n _fiber: unknown;\n _pendingState: Array<Partial<S> | ((prevState: S, props: P) => Partial<S> | null)>;\n _forceUpdate: boolean;\n _enqueueUpdate(callback?: () => void): void;\n}\n\nexport interface ErrorInfo {\n componentStack: string;\n}\n\n/** A component type can be a function, a class, or a special symbol type */\nexport type ComponentType<P extends Props = Props> =\n | FunctionComponent<P>\n | ClassComponentConstructor<P>\n | string\n | symbol;\n\n/** The core element structure \u2014 equivalent to React.Element */\nexport interface SpecElement<P extends Props = Props> {\n $$typeof: typeof SPEC_ELEMENT_TYPE;\n type: ComponentType<P>;\n props: P;\n key: Key;\n ref: Ref;\n}\n\n/** Fiber node types for the reconciler */\nexport const enum FiberTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n HostRoot = 2,\n HostComponent = 3,\n HostText = 4,\n Fragment = 5,\n ContextProvider = 6,\n ContextConsumer = 7,\n ForwardRef = 8,\n MemoComponent = 9,\n LazyComponent = 10,\n SuspenseComponent = 11,\n Profiler = 12,\n Portal = 13,\n}\n\n/** Effect flags for fiber work */\nexport const enum EffectTag {\n NoEffect = 0,\n Placement = 1,\n Update = 2,\n Deletion = 4,\n ChildDeletion = 8,\n Snapshot = 16,\n Passive = 32,\n Layout = 64,\n Ref = 128,\n}\n\n/** Fiber node \u2014 the internal work unit */\nexport interface Fiber<P extends Props = Props> {\n tag: FiberTag;\n type: ComponentType<P> | null;\n key: Key;\n ref: Ref;\n\n stateNode: unknown;\n pendingProps: P;\n memoizedProps: P | null;\n memoizedState: unknown;\n\n return: Fiber | null;\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n alternate: Fiber | null;\n effectTag: EffectTag;\n\n updateQueue: unknown;\n dependencies: unknown;\n\n lanes: number;\n childLanes: number;\n}\n\n/** Context type */\nexport interface SpecContext<T> {\n $$typeof: symbol;\n Provider: ComponentType;\n Consumer: ComponentType;\n _currentValue: T;\n _defaultValue: T;\n displayName?: string;\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport { SPEC_ELEMENT_TYPE, type SpecElement } from '../shared/types';\n\n/**\n * Checks if a value is a valid SpecifyJS element.\n * Equivalent to React.isValidElement.\n */\nexport function isValidElement(object: unknown): object is SpecElement {\n return (\n typeof object === 'object' &&\n object !== null &&\n (object as SpecElement).$$typeof === SPEC_ELEMENT_TYPE\n );\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport {\n type SpecNode,\n type SpecElement,\n type Props,\n type FunctionComponent,\n type ClassComponentInstance,\n SPEC_FRAGMENT_TYPE,\n SPEC_STRICT_MODE_TYPE,\n SPEC_PROFILER_TYPE,\n SPEC_FORWARD_REF_TYPE,\n SPEC_MEMO_TYPE,\n SPEC_PROVIDER_TYPE,\n} from '../shared/types';\nimport { isValidElement } from '../core/is-valid-element';\n\n// Self-closing HTML tags\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\n// Map of prop names to HTML attribute names\nconst PROP_TO_ATTR: Record<string, string> = {\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n acceptCharset: 'accept-charset',\n tabIndex: 'tabindex',\n autoFocus: 'autofocus',\n autoComplete: 'autocomplete',\n autoPlay: 'autoplay',\n crossOrigin: 'crossorigin',\n noValidate: 'novalidate',\n formNoValidate: 'formnovalidate',\n readOnly: 'readonly',\n cellPadding: 'cellpadding',\n cellSpacing: 'cellspacing',\n colSpan: 'colspan',\n rowSpan: 'rowspan',\n frameBorder: 'frameborder',\n marginHeight: 'marginheight',\n marginWidth: 'marginwidth',\n};\n\n// Props that should not be rendered as attributes\nconst RESERVED_PROPS = new Set(['children', 'key', 'ref', 'dangerouslySetInnerHTML']);\n\nconst EVENT_RE = /^on[A-Z]/;\n\n/**\n * Renders a SpecifyJS component tree to an HTML string.\n *\n * **Build-time pre-rendering only.** This function is designed for use\n * during the build process (e.g., static site generation, build scripts)\n * to produce HTML files that are served statically. It must NOT be called\n * in server request handlers, middleware, or any runtime code path that\n * responds to HTTP requests.\n *\n * For dynamic content, use SpecifyJS's client-side rendering with data\n * fetched via HTTPS from API endpoints.\n *\n * @throws {Error} If called in a detected server request context\n */\nexport function renderToString(element: SpecNode): string {\n assertNotInRequestContext('renderToString');\n return renderNode(element, true);\n}\n\n/**\n * Renders a SpecifyJS component tree to static HTML (no hydration markers).\n *\n * **Build-time pre-rendering only.** Use in build scripts to generate\n * static HTML pages. Do NOT use in server request handlers.\n *\n * @throws {Error} If called in a detected server request context\n */\nexport function renderToStaticMarkup(element: SpecNode): string {\n assertNotInRequestContext('renderToStaticMarkup');\n return renderNode(element, false);\n}\n\n/**\n * Guard against misuse in server request handlers.\n * Detects common server frameworks (Express, Koa, Fastify, etc.)\n * by checking for telltale global state.\n */\n/* v8 ignore next 22 -- environment detection only triggers in Node.js production */\nfunction assertNotInRequestContext(fnName: string): void {\n if (\n typeof process !== 'undefined' &&\n typeof process.env !== 'undefined' &&\n process.env.SPECIFYJS_ALLOW_PRERENDER === 'true'\n ) {\n return;\n }\n\n if (\n typeof process !== 'undefined' &&\n typeof process.env !== 'undefined' &&\n (process.env.NODE_ENV === 'production' || process.env.PORT)\n ) {\n if (!process.env.SPECIFYJS_ALLOW_PRERENDER) {\n console.warn(\n `[SpecifyJS] ${fnName}() is intended for build-time pre-rendering only, ` +\n `not runtime server-side rendering. Set SPECIFYJS_ALLOW_PRERENDER=true ` +\n `if you are using this in a build script. See: ` +\n `https://github.com/asymmetric-effort/specifyjs/blob/main/docs/api/static-prerendering.md`,\n );\n }\n }\n}\n\nfunction renderNode(node: SpecNode, includeDataAttrs: boolean): string {\n // Null, undefined, boolean \u2192 empty\n if (node == null || typeof node === 'boolean') {\n return '';\n }\n\n // String or number \u2192 escape and return\n if (typeof node === 'string') {\n return escapeHtml(node);\n }\n if (typeof node === 'number') {\n return String(node);\n }\n\n // Array \u2192 render each child (iterative, no recursion for flat arrays)\n if (Array.isArray(node)) {\n let result = '';\n const stack: SpecNode[] = [];\n for (let i = node.length - 1; i >= 0; i--) stack.push(node[i] as SpecNode);\n while (stack.length > 0) {\n const child = stack.pop()!;\n if (child == null || typeof child === 'boolean') continue;\n if (typeof child === 'string') {\n result += escapeHtml(child);\n continue;\n }\n if (typeof child === 'number') {\n result += String(child);\n continue;\n }\n if (Array.isArray(child)) {\n for (let i = child.length - 1; i >= 0; i--) stack.push(child[i] as SpecNode);\n continue;\n }\n if (isValidElement(child)) result += renderElement(child as SpecElement, includeDataAttrs);\n }\n return result;\n }\n\n // Must be an element\n if (!isValidElement(node)) {\n return '';\n }\n\n const element = node as SpecElement;\n return renderElement(element, includeDataAttrs);\n}\n\nfunction renderElement(element: SpecElement, includeDataAttrs: boolean): string {\n const { type, props } = element;\n\n // Fragment, StrictMode, Profiler \u2192 render children only\n if (\n type === SPEC_FRAGMENT_TYPE ||\n type === SPEC_STRICT_MODE_TYPE ||\n type === SPEC_PROFILER_TYPE\n ) {\n return renderNode(props.children, includeDataAttrs);\n }\n\n // Context Provider \u2192 set value and render children\n if (typeof type === 'object' && type !== null) {\n const $$typeof = (type as { $$typeof?: symbol }).$$typeof;\n\n if ($$typeof === SPEC_PROVIDER_TYPE) {\n const context = (type as { _context: { _currentValue: unknown } })._context;\n const prevValue = context._currentValue;\n context._currentValue = props.value;\n const result = renderNode(props.children, includeDataAttrs);\n context._currentValue = prevValue;\n return result;\n }\n\n if ($$typeof === SPEC_FORWARD_REF_TYPE) {\n const render = (type as { render: (props: Props, ref: unknown) => SpecNode }).render;\n const children = render(props, element.ref);\n return renderNode(children, includeDataAttrs);\n }\n\n if ($$typeof === SPEC_MEMO_TYPE) {\n const innerType = (type as { type: FunctionComponent }).type;\n if (typeof innerType === 'function') {\n const children = innerType(props);\n return renderNode(children, includeDataAttrs);\n }\n }\n }\n\n // Function component\n if (typeof type === 'function') {\n if ((type.prototype as Record<string, unknown>)?.isSpecComponent) {\n // Class component\n const Constructor = type as new (props: Props) => ClassComponentInstance;\n const instance = new Constructor(props);\n const children = instance.render();\n return renderNode(children, includeDataAttrs);\n }\n\n // Functional component\n const children = (type as FunctionComponent)(props);\n return renderNode(children, includeDataAttrs);\n }\n\n // Host element (string tag)\n if (typeof type === 'string') {\n return renderHostElement(type, props, includeDataAttrs);\n }\n\n return '';\n}\n\nfunction renderHostElement(tag: string, props: Props, includeDataAttrs: boolean): string {\n let html = `<${tag}`;\n\n // Render attributes\n for (const key in props) {\n if (RESERVED_PROPS.has(key) || EVENT_RE.test(key)) continue;\n\n const value = props[key];\n if (value == null || value === false) continue;\n\n const attrName = PROP_TO_ATTR[key] || key.toLowerCase();\n\n // C-1: Validate attribute names to prevent XSS via attribute name injection\n if (!/^[a-zA-Z_][\\w\\-:.]*$/.test(attrName)) continue;\n\n if (key === 'style') {\n html += ` style=\"${renderStyle(value as Record<string, string | number>)}\"`;\n } else if (key === 'value' || key === 'checked' || key === 'selected') {\n if (value === true) {\n html += ` ${attrName}`;\n } else {\n html += ` ${attrName}=\"${escapeHtml(String(value))}\"`;\n }\n } else if (value === true) {\n html += ` ${attrName}`;\n } else {\n html += ` ${attrName}=\"${escapeHtml(String(value))}\"`;\n }\n }\n\n if (includeDataAttrs) {\n // Mark the root element for hydration\n }\n\n // Self-closing tags\n if (VOID_ELEMENTS.has(tag)) {\n html += '/>';\n return html;\n }\n\n html += '>';\n\n // dangerouslySetInnerHTML\n if (props.dangerouslySetInnerHTML) {\n const innerHtml = (props.dangerouslySetInnerHTML as { __html: string }).__html;\n html += innerHtml;\n } else {\n // Render children\n html += renderNode(props.children, includeDataAttrs);\n }\n\n html += `</${tag}>`;\n return html;\n}\n\nfunction renderStyle(style: Record<string, string | number>): string {\n const parts: string[] = [];\n for (const prop in style) {\n const value = style[prop];\n if (value == null) continue;\n\n // Convert camelCase to kebab-case\n const cssProp = prop.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);\n let cssValue =\n typeof value === 'number' && value !== 0 && !isUnitlessProp(prop)\n ? `${value}px`\n : String(value);\n\n // L-6: Sanitize CSS values \u2014 strip dangerous patterns\n cssValue = cssValue\n .replace(/expression\\s*\\(/gi, '')\n .replace(/url\\s*\\(\\s*javascript:/gi, 'url(');\n\n parts.push(`${cssProp}:${cssValue}`);\n }\n return parts.join(';');\n}\n\nconst UNITLESS_PROPS = new Set([\n 'animationIterationCount',\n 'aspectRatio',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'columns',\n 'flex',\n 'flexGrow',\n 'flexPositive',\n 'flexShrink',\n 'flexNegative',\n 'flexOrder',\n 'gridArea',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowSpan',\n 'gridRowStart',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnSpan',\n 'gridColumnStart',\n 'fontWeight',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n 'fillOpacity',\n 'floodOpacity',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n]);\n\nfunction isUnitlessProp(prop: string): boolean {\n return UNITLESS_PROPS.has(prop);\n}\n\nfunction escapeHtml(str: string): string {\n let result = '';\n let lastIndex = 0;\n\n for (let i = 0; i < str.length; i++) {\n let escaped: string | undefined;\n switch (str.charCodeAt(i)) {\n case 34:\n escaped = '"';\n break; // \"\n case 38:\n escaped = '&';\n break; // &\n case 39:\n escaped = ''';\n break; // '\n case 60:\n escaped = '<';\n break; // <\n case 62:\n escaped = '>';\n break; // >\n }\n if (escaped !== undefined) {\n if (lastIndex !== i) {\n result += str.slice(lastIndex, i);\n }\n result += escaped;\n lastIndex = i + 1;\n }\n }\n\n if (lastIndex === 0) return str;\n if (lastIndex < str.length) {\n result += str.slice(lastIndex);\n }\n return result;\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport type { SpecNode } from '../shared/types';\nimport type { Writable } from 'stream';\nimport { renderToString } from './render-to-string';\n\nexport interface PipeableStream {\n pipe<T extends Writable>(destination: T): T;\n abort(reason?: unknown): void;\n}\n\nexport interface RenderToPipeableStreamOptions {\n identifierPrefix?: string;\n onShellReady?: () => void;\n onShellError?: (error: unknown) => void;\n onAllReady?: () => void;\n onError?: (error: unknown) => void;\n /**\n * Maximum number of bytes to write per chunk.\n * Smaller values allow the event loop to process other work between chunks.\n * Default: 8192 (8KB)\n */\n progressiveChunkSize?: number;\n}\n\n/**\n * Renders a SpecifyJS component tree to a Node.js pipeable stream.\n *\n * **Build-time pre-rendering only.** Intended for build scripts that\n * generate static HTML files, not for runtime server request handlers.\n * Renders the full HTML string, then writes it in chunks to the writable\n * stream for efficient file I/O during static site generation.\n *\n * For dynamic content, use SpecifyJS's client-side rendering with data\n * fetched via HTTPS from API endpoints.\n */\nexport function renderToPipeableStream(\n element: SpecNode,\n options?: RenderToPipeableStreamOptions,\n): PipeableStream {\n let aborted = false;\n\n return {\n pipe<T extends Writable>(destination: T): T {\n if (aborted) {\n destination.end();\n return destination;\n }\n\n let html: string;\n try {\n html = renderToString(element);\n } catch (error) {\n options?.onShellError?.(error);\n options?.onError?.(error);\n destination.end();\n return destination;\n }\n\n options?.onShellReady?.();\n\n const chunkSize = options?.progressiveChunkSize ?? 8192;\n\n if (html.length <= chunkSize) {\n // Small enough to write in one shot\n destination.write(html);\n destination.end();\n options?.onAllReady?.();\n } else {\n // Write in chunks, yielding between each\n let offset = 0;\n\n function writeNextChunk(): void {\n if (aborted || offset >= html.length) {\n destination.end();\n options?.onAllReady?.();\n return;\n }\n\n const chunk = html.slice(offset, offset + chunkSize);\n offset += chunkSize;\n\n const canContinue = destination.write(chunk);\n if (canContinue) {\n // Yield to event loop before next chunk\n setImmediate(writeNextChunk);\n } else {\n /* v8 ignore next 2 -- backpressure path requires slow consumer */\n destination.once('drain', writeNextChunk);\n }\n }\n\n writeNextChunk();\n }\n\n return destination;\n },\n abort(reason?: unknown): void {\n aborted = true;\n options?.onError?.(reason);\n },\n };\n}\n", "// (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE\n// SPDX-License-Identifier: MIT\n\nimport type { SpecNode } from '../shared/types';\nimport { renderToString } from './render-to-string';\n\nexport interface RenderToReadableStreamOptions {\n identifierPrefix?: string;\n signal?: AbortSignal;\n onError?: (error: unknown) => void;\n /**\n * Maximum bytes per chunk for progressive flushing.\n * Default: 8192 (8KB)\n */\n progressiveChunkSize?: number;\n}\n\n/**\n * Renders a SpecifyJS tree to a web ReadableStream.\n * **Build-time pre-rendering only.** Intended for build scripts that\n * generate static HTML files, not for runtime server request handlers.\n * Renders the full HTML, then enqueues it in chunks for efficient\n * file I/O during static site generation.\n */\nexport async function renderToReadableStream(\n element: SpecNode,\n options?: RenderToReadableStreamOptions,\n): Promise<ReadableStream<Uint8Array>> {\n const encoder = new TextEncoder();\n const chunkSize = options?.progressiveChunkSize ?? 8192;\n\n return new ReadableStream({\n start(controller) {\n if (options?.signal?.aborted) {\n controller.close();\n return;\n }\n\n let html: string;\n try {\n html = renderToString(element);\n } catch (error) {\n options?.onError?.(error);\n controller.error(error);\n return;\n }\n\n // Enqueue in chunks for progressive streaming\n let offset = 0;\n while (offset < html.length) {\n const chunk = html.slice(offset, offset + chunkSize);\n controller.enqueue(encoder.encode(chunk));\n offset += chunkSize;\n }\n\n controller.close();\n },\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAOO,IAAMA,EAAoB,OAAO,IAAI,cAAc,EAC7CC,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAmB,OAAO,IAAI,aAAa,EAC3CC,EAAqB,OA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,IAFT,IAAIC,EAAS,EAsBbD,EAAe,CACjB,CAEA,OAAOL,CACT,EACA,MAAMQ,EAAwB,CAC5BT,EAAU,GACVD,GAAS,UAAUU,CAAM,CAC3B,CACF,CACF,CC/EA,eAAsBC,EACpBC,EACAC,EACqC,CACrC,IAAMC,EAAU,IAAI,YACdC,EAAYF,GAAS,sBAAwB,KAEnD,OAAO,IAAI,eAAe,CACxB,MAAMG,EAAY,CAChB,GAAIH,GAAS,QAAQ,QAAS,CAC5BG,EAAW,MAAM,EACjB,MACF,CAEA,IAAIC,EACJ,GAAI,CACFA,EAAOC,EAAeN,CAAO,CAC/B,OAASO,EAAO,CACdN,GAAS,UAAUM,CAAK,EACxBH,EAAW,MAAMG,CAAK,EACtB,MACF,CAGA,IAAIC,EAAS,EACb,KAAOA,EAASH,EAAK,QAAQ,CAC3B,IAAMI,EAAQJ,EAAK,MAAMG,EAAQA,EAASL,CAAS,EACnDC,EAAW,QAAQF,EAAQ,OAAOO,CAAK,CAAC,EACxCD,GAAUL,CACZ,CAEAC,EAAW,MAAM,CACnB,CACF,CAAC,CACH",
|
|
6
|
+
"names": ["SPEC_ELEMENT_TYPE", "SPEC_FRAGMENT_TYPE", "SPEC_PORTAL_TYPE", "SPEC_PROVIDER_TYPE", "SPEC_CONSUMER_TYPE", "SPEC_FORWARD_REF_TYPE", "SPEC_MEMO_TYPE", "SPEC_LAZY_TYPE", "SPEC_SUSPENSE_TYPE", "SPEC_STRICT_MODE_TYPE", "SPEC_PROFILER_TYPE", "isValidElement", "object", "SPEC_ELEMENT_TYPE", "VOID_ELEMENTS", "PROP_TO_ATTR", "RESERVED_PROPS", "EVENT_RE", "renderToString", "element", "assertNotInRequestContext", "renderNode", "renderToStaticMarkup", "fnName", "node", "includeDataAttrs", "escapeHtml", "result", "stack", "i", "child", "isValidElement", "renderElement", "type", "props", "SPEC_FRAGMENT_TYPE", "SPEC_STRICT_MODE_TYPE", "SPEC_PROFILER_TYPE", "$$typeof", "SPEC_PROVIDER_TYPE", "context", "prevValue", "SPEC_FORWARD_REF_TYPE", "render", "children", "SPEC_MEMO_TYPE", "innerType", "Constructor", "renderHostElement", "tag", "html", "key", "value", "attrName", "renderStyle", "innerHtml", "style", "parts", "prop", "cssProp", "m", "cssValue", "isUnitlessProp", "UNITLESS_PROPS", "str", "lastIndex", "escaped", "renderToPipeableStream", "element", "options", "aborted", "destination", "html", "renderToString", "error", "chunkSize", "writeNextChunk", "offset", "chunk", "reason", "renderToReadableStream", "element", "options", "encoder", "chunkSize", "controller", "html", "renderToString", "error", "offset", "chunk"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
+
"use strict";var v=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var E=(e,t)=>()=>(e&&(t=e(e=0)),t);var C=(e,t)=>{for(var n in t)v(e,n,{get:t[n],enumerable:!0})},K=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of F(t))!G.call(e,o)&&o!==n&&v(e,o,{get:()=>t[o],enumerable:!(r=j(t,o))||r.enumerable});return e};var J=e=>K(v({},"__esModule",{value:!0}),e);function A(e){if(e.startsWith("//"))throw new Error(`[SpecifyJS] Protocol-relative URL rejected: "${e}". Use an explicit https:// prefix.`);if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||e.startsWith("data:"))return;let t;try{t=new URL(e,typeof window<"u"?window.location.href:void 0)}catch{return}if(t.protocol!=="https:"&&!(t.hostname==="localhost"||t.hostname==="127.0.0.1"))throw new Error(`[SpecifyJS] Insecure URL rejected: "${e}". SpecifyJS enforces HTTPS-only for all network requests. Use https:// or a relative URL. Localhost URLs are allowed for development.`)}var D=E(()=>{"use strict"});var U={};C(U,{createMeterProvider:()=>I,exportToEndpoint:()=>S,formatOtlpMetrics:()=>y,formatOtlpTraces:()=>x});function b(e,t,n){e.length>=H&&e.splice(0,Math.floor(H/2)),e.push({value:t,attributes:n?{...n}:{},timestamp:performance.now()})}function W(e,t){let n=[];return{name:e,description:t?.description??"",add(r,o){r<0||b(n,r,o)},get dataPoints(){return n}}}function X(e,t){let n=[];return{name:e,description:t?.description??"",record(r,o){b(n,r,o)},get dataPoints(){return n}}}function z(e,t){let n=[];return{name:e,description:t?.description??"",set(r,o){b(n,r,o)},get dataPoints(){return n}}}function I(e){let t=[],n;e.exportInterval&&e.exportInterval>0&&(n=setInterval(()=>{r.flush()},e.exportInterval),typeof n=="object"&&"unref"in n&&n.unref());let r={config:e,get instruments(){return t},counter(o,s){let i=W(o,s);return t.push(i),i},histogram(o,s){let i=X(o,s);return t.push(i),i},gauge(o,s){let i=z(o,s);return t.push(i),i},async flush(){if(!e.endpoint)return;let o=y(t,e.serviceName);await S(e.endpoint,e.headers??{},o)}};return r}function l(e){return Object.entries(e).map(([t,n])=>typeof n=="string"?{key:t,value:{stringValue:n}}:typeof n=="boolean"?{key:t,value:{boolValue:n}}:{key:t,value:{intValue:n}})}function g(e){return String(Math.round(e*1e6))}function y(e,t){let n=e.map(r=>{let o=r.dataPoints.map(i=>({attributes:l(i.attributes),timeUnixNano:g(i.timestamp),asDouble:i.value})),s;return"add"in r?s={sum:{dataPoints:o,isMonotonic:!0,aggregationTemporality:2}}:"record"in r?s={histogram:{dataPoints:o,aggregationTemporality:2}}:s={gauge:{dataPoints:o}},{name:r.name,description:r.description,...s}});return{resourceMetrics:[{resource:{attributes:l({"service.name":t??"unknown"})},scopeMetrics:[{scope:{name:"specifyjs-telemetry",version:"1.0.0"},metrics:n}]}]}}function x(e,t,n){let r={"service.name":t??"unknown"};n&&(r["service.version"]=n);let o={internal:1,server:2,client:3,producer:4,consumer:5},s={unset:0,ok:1,error:2},i=e.map(a=>({traceId:a.traceId,spanId:a.spanId,parentSpanId:a.parentSpanId??"",name:a.name,kind:o[a.kind]??1,startTimeUnixNano:g(a.startTime),endTimeUnixNano:a.endTime!==void 0?g(a.endTime):"0",attributes:l(a.attributes),status:{code:s[a.status.code]??0,message:a.status.message??""},events:a.events.map(u=>({name:u.name,timeUnixNano:g(u.timestamp),attributes:u.attributes?l(u.attributes):[]}))}));return{resourceSpans:[{resource:{attributes:l(r)},scopeSpans:[{scope:{name:"specifyjs-telemetry",version:"1.0.0"},spans:i}]}]}}async function S(e,t,n){try{A(e),await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...t},body:JSON.stringify(n)})}catch{}}var H,R=E(()=>{"use strict";D();H=1e4});var Z={};C(Z,{createMeterProvider:()=>I,createTracer:()=>_,endSpan:()=>d,exportToEndpoint:()=>S,formatOtlpMetrics:()=>y,formatOtlpTraces:()=>x,formatTraceparent:()=>L,generateSpanId:()=>k,generateTraceId:()=>w,parseTraceparent:()=>N,startSpan:()=>P,useTracing:()=>$});module.exports=J(Z);var M=null;function O(){if(M===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return M}function T(e,t){return O().useEffect(e,t)}function h(e){return O().useRef(e)}function V(e){let t=new Uint8Array(e);try{crypto.getRandomValues(t)}catch{for(let n=0;n<e;n++)t[n]=Math.floor(Math.random()*256)}return t}function q(e){let t="";for(let n=0;n<e.length;n++)t+=(e[n]??0).toString(16).padStart(2,"0");return t}function w(){return q(V(16))}function k(){return q(V(8))}var B=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;function N(e){let t=B.exec(e.trim());if(!t)return null;let n=t[2],r=t[3],o=t[4];return/^0+$/.test(n)||/^0+$/.test(r)?null:{traceId:n,spanId:r,traceFlags:o}}function L(e){return`00-${e.traceId}-${e.spanId}-${e.traceFlags}`}function P(e,t){return{traceId:t?.traceId??w(),spanId:k(),parentSpanId:t?.parentSpanId,name:e,kind:t?.kind??"internal",startTime:performance.now(),status:{code:"unset"},attributes:t?.attributes?{...t.attributes}:{},events:[]}}function d(e){e.endTime=performance.now()}function _(e){let t=e.batchSize??1e3,n=[],r=[];function o(a){r.length>=t&&r.splice(0,Math.floor(t/2)),r.push(a)}let s;e.flushInterval&&e.flushInterval>0&&(s=setInterval(()=>{i.flush()},e.flushInterval),typeof s=="object"&&"unref"in s&&s.unref());let i={config:e,get pendingSpans(){return r},activeSpan(){return n.length>0?n[n.length-1]:void 0},startSpan(a,u){let f=i.activeSpan(),p=P(a,{kind:u?.kind,attributes:u?.attributes,traceId:u?.traceId??f?.traceId,parentSpanId:u?.parentSpanId??f?.spanId});return n.push(p),p},withSpan(a,u){n.includes(a)||n.push(a);let p=()=>{for(let c=n.length-1;c>=0;c--)n[c]===a&&n.splice(c,1)};try{let c=u();return c&&typeof c.then=="function"?c.then(m=>(d(a),o(a),p(),m),m=>{throw a.status={code:"error",message:String(m)},d(a),o(a),p(),m}):(d(a),o(a),p(),c)}catch(c){throw a.status={code:"error",message:String(c)},d(a),o(a),p(),c}},async flush(){if(r.length===0)return;let a=r.splice(0,r.length);if(e.endpoint){let{formatOtlpTraces:u,exportToEndpoint:f}=await Promise.resolve().then(()=>(R(),U)),p=u(a,e.serviceName,e.serviceVersion);await f(e.endpoint,e.headers??{},p)}}};return i}function $(e,t){let n=h(null);T(()=>{let r=e.startSpan(t,{kind:"internal"});return r.events.push({name:"mount",timestamp:performance.now()}),n.current=r,()=>{n.current&&(n.current.events.push({name:"unmount",timestamp:performance.now()}),d(n.current))}},[])}R();
|
|
2
3
|
//# sourceMappingURL=specifyjs-telemetry.cjs.js.map
|