@asymmetric-effort/specifyjs 0.2.110 → 0.2.114
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/esm/chunks/chunk-2Y3QZBBL.js +221 -0
- package/dist/esm/chunks/{chunk-3SXNLMCH.js.map → chunk-2Y3QZBBL.js.map} +2 -2
- package/dist/esm/chunks/chunk-5OX5JKEY.js +174 -0
- package/dist/esm/chunks/{chunk-VAF4KNDP.js.map → chunk-5OX5JKEY.js.map} +2 -2
- package/dist/esm/chunks/chunk-AVA7QEGU.js +625 -0
- package/dist/esm/chunks/{chunk-A7AAS5ZR.js.map → chunk-AVA7QEGU.js.map} +2 -2
- package/dist/esm/chunks/chunk-BLIAKWAU.js +42 -0
- package/dist/esm/chunks/{chunk-TVDAY42P.js.map → chunk-BLIAKWAU.js.map} +2 -2
- package/dist/esm/chunks/chunk-CWCWXKVV.js +202 -0
- package/dist/esm/chunks/{chunk-MCXU6QF3.js.map → chunk-CWCWXKVV.js.map} +2 -2
- package/dist/esm/chunks/chunk-HINJXYXY.js +29 -0
- package/dist/esm/chunks/{chunk-3J4RXW7E.js.map → chunk-HINJXYXY.js.map} +2 -2
- package/dist/esm/chunks/chunk-MKUA6QTB.js +9 -0
- package/dist/esm/chunks/chunk-NF4555DU.js +58 -0
- package/dist/esm/chunks/{chunk-ODCBJ22O.js.map → chunk-NF4555DU.js.map} +2 -2
- package/dist/esm/chunks/chunk-RSL3RU56.js +14 -0
- package/dist/esm/chunks/{chunk-E43OK6IZ.js.map → chunk-RSL3RU56.js.map} +2 -2
- package/dist/esm/chunks/chunk-T7EHIXSF.js +17 -0
- package/dist/esm/chunks/{chunk-LWOMFZ4C.js.map → chunk-T7EHIXSF.js.map} +2 -2
- package/dist/esm/chunks/metrics-6LW2N3GU.js +16 -0
- package/dist/esm/client/index.js +670 -1
- package/dist/esm/components-barrel.js +25688 -3
- package/dist/esm/dom/index.js +1902 -1
- package/dist/esm/index.js +117 -1
- package/dist/esm/jsx-dev-runtime.js +12 -1
- package/dist/esm/jsx-runtime.js +13 -1
- package/dist/esm/server/index.js +381 -1
- package/dist/esm/telemetry/index.js +188 -1
- package/dist/specifyjs-client.esm.js +670 -1
- package/dist/specifyjs-client.esm.js.map +2 -2
- package/dist/specifyjs-components.cjs.js.map +1 -1
- package/dist/specifyjs-components.esm.js +25688 -3
- package/dist/specifyjs-components.esm.js.map +3 -3
- package/dist/specifyjs-dom.esm.js +1902 -1
- package/dist/specifyjs-dom.esm.js.map +2 -2
- package/dist/specifyjs-jsx-dev-runtime.esm.js +12 -1
- package/dist/specifyjs-jsx-runtime.esm.js +13 -1
- package/dist/specifyjs-server.esm.js +381 -1
- package/dist/specifyjs-server.esm.js.map +2 -2
- package/dist/specifyjs-telemetry.esm.js +188 -1
- package/dist/specifyjs-telemetry.esm.js.map +2 -2
- package/dist/specifyjs.esm.js +117 -1
- package/dist/types/components/ad/adsense/src/AdSense.d.ts +1 -1
- package/dist/types/components/data/analog-clock/src/AnalogClock.d.ts +1 -1
- package/dist/types/components/data/avatar/src/Avatar.d.ts +1 -1
- package/dist/types/components/data/badge/src/Badge.d.ts +1 -1
- package/dist/types/components/data/data-grid/src/DataGrid.d.ts +1 -1
- package/dist/types/components/data/digital-clock/src/DigitalClock.d.ts +1 -1
- package/dist/types/components/data/list-view/src/ListView.d.ts +1 -1
- package/dist/types/components/data/tag/src/Tag.d.ts +1 -1
- package/dist/types/components/data/virtual-scroll/src/VirtualScroll.d.ts +1 -1
- package/dist/types/components/feedback/alert/src/Alert.d.ts +1 -1
- package/dist/types/components/feedback/empty-state/src/EmptyState.d.ts +1 -1
- package/dist/types/components/feedback/progress-bar/src/ProgressBar.d.ts +1 -1
- package/dist/types/components/feedback/skeleton/src/Skeleton.d.ts +1 -1
- package/dist/types/components/feedback/spinner/src/Spinner.d.ts +1 -1
- package/dist/types/components/form/button/src/Button.d.ts +1 -1
- package/dist/types/components/form/checkbox/src/Checkbox.d.ts +1 -1
- package/dist/types/components/form/color-picker/src/ColorPicker.d.ts +1 -1
- package/dist/types/components/form/color-wheel/src/ColorWheel.d.ts +1 -1
- package/dist/types/components/form/datepicker/src/DatePicker.d.ts +1 -1
- package/dist/types/components/form/file-upload/src/FileUpload.d.ts +1 -1
- package/dist/types/components/form/multiline/src/MultilineField.d.ts +1 -1
- package/dist/types/components/form/number-spinner/src/NumberSpinner.d.ts +1 -1
- package/dist/types/components/form/radio/src/RadioGroup.d.ts +1 -1
- package/dist/types/components/form/select/src/Select.d.ts +1 -1
- package/dist/types/components/form/slider/src/Slider.d.ts +1 -1
- package/dist/types/components/form/texteditor/src/TextEditor.d.ts +1 -1
- package/dist/types/components/form/textfield/src/TextField.d.ts +1 -1
- package/dist/types/components/form/timepicker/src/TimePicker.d.ts +1 -1
- package/dist/types/components/form/toggle/src/Toggle.d.ts +1 -1
- package/dist/types/components/form/wrapper/src/FormFieldWrapper.d.ts +1 -1
- package/dist/types/components/layout/card/src/Card.d.ts +1 -1
- package/dist/types/components/layout/desktop-background/src/DesktopBackground.d.ts +1 -1
- package/dist/types/components/layout/flex-container/src/FlexContainer.d.ts +2 -2
- package/dist/types/components/layout/footer/src/Footer.d.ts +1 -1
- package/dist/types/components/layout/grid/src/Grid.d.ts +2 -2
- package/dist/types/components/layout/panel/src/Panel.d.ts +1 -1
- package/dist/types/components/layout/scroll-container/src/ScrollContainer.d.ts +1 -1
- package/dist/types/components/layout/splitter/src/Splitter.d.ts +1 -1
- package/dist/types/components/layout/tabs/src/Tabs.d.ts +1 -1
- package/dist/types/components/layout/window-manager/src/WindowManager.d.ts +1 -1
- package/dist/types/components/media/carousel/src/Carousel.d.ts +1 -1
- package/dist/types/components/media/image/src/Image.d.ts +1 -1
- package/dist/types/components/media/video-player/src/VideoPlayer.d.ts +1 -1
- package/dist/types/components/nav/accordion/src/Accordion.d.ts +1 -1
- package/dist/types/components/nav/breadcrumb/src/Breadcrumb.d.ts +1 -1
- package/dist/types/components/nav/dock/src/Dock.d.ts +1 -1
- package/dist/types/components/nav/dropdown/src/Dropdown.d.ts +1 -1
- package/dist/types/components/nav/menubar/src/Menubar.d.ts +1 -1
- package/dist/types/components/nav/pagination/src/Pagination.d.ts +1 -1
- package/dist/types/components/nav/sidebar/src/Sidebar.d.ts +1 -1
- package/dist/types/components/nav/stepper/src/Stepper.d.ts +1 -1
- package/dist/types/components/nav/system-tray/src/SystemTray.d.ts +1 -1
- package/dist/types/components/nav/toolbar/src/Toolbar.d.ts +1 -1
- package/dist/types/components/nav/treenav/src/TreeNav.d.ts +1 -1
- package/dist/types/components/nav/wrapper/src/NavWrapper.d.ts +1 -1
- package/dist/types/components/overlay/context-menu/src/ContextMenu.d.ts +1 -1
- package/dist/types/components/overlay/drawer/src/Drawer.d.ts +1 -1
- package/dist/types/components/overlay/modal/src/Modal.d.ts +1 -1
- package/dist/types/components/overlay/popover/src/Popover.d.ts +1 -1
- package/dist/types/components/overlay/toast/src/Toast.d.ts +2 -2
- package/dist/types/components/overlay/tooltip/src/Tooltip.d.ts +1 -1
- package/dist/types/components/page/ide/src/IDE.d.ts +1 -1
- package/dist/types/components/page/trading-dashboard/src/TradingDashboard.d.ts +1 -1
- package/dist/types/components/page/unity-desktop/src/UnityApp.d.ts +1 -1
- package/dist/types/components/page/unity-desktop/src/UnityDesktop.d.ts +1 -1
- package/dist/types/components/page/word-processor/src/WordProcessor.d.ts +1 -1
- package/dist/types/components/viz/2D-bar-graph/src/BarGraph.d.ts +1 -1
- package/dist/types/components/viz/2D-discrete-cartesian/src/DiscreteCartesian2D.d.ts +1 -1
- package/dist/types/components/viz/2D-line-graph/src/LineGraph.d.ts +1 -1
- package/dist/types/components/viz/2D-pie-graph/src/PieGraph.d.ts +1 -1
- package/dist/types/components/viz/3d-force-graph/src/ForceGraph3D.d.ts +27 -119
- package/dist/types/components/viz/3d-force-graph/src/force-sim.d.ts +49 -0
- package/dist/types/components/viz/3d-force-graph/src/index.d.ts +5 -1
- package/dist/types/components/viz/3d-force-graph/src/types.d.ts +88 -0
- package/dist/types/components/viz/3d-layers/src/ThreeDLayers.d.ts +1 -1
- package/dist/types/components/viz/3dSpace/src/Space3D.d.ts +1 -1
- package/dist/types/components/viz/3dSpace/src/geom-polyhedron.d.ts +49 -0
- package/dist/types/components/viz/3dSpace/src/geom-sphere.d.ts +27 -0
- package/dist/types/components/viz/3dSpace/src/index.d.ts +5 -0
- package/dist/types/components/viz/3dSpace/src/mesh.d.ts +22 -0
- package/dist/types/components/viz/3dSpace/src/scene-object.d.ts +4 -0
- package/dist/types/components/viz/big-number/src/BigNumber.d.ts +1 -1
- package/dist/types/components/viz/bloch-sphere/src/BlochSphere.d.ts +1 -1
- package/dist/types/components/viz/box-plot/src/BoxPlot.d.ts +1 -1
- package/dist/types/components/viz/bubble-chart/src/BubbleChart.d.ts +1 -1
- package/dist/types/components/viz/calendar-heat-map/src/CalendarHeatMap.d.ts +1 -1
- package/dist/types/components/viz/chord/src/ChordDiagram.d.ts +1 -1
- package/dist/types/components/viz/decomposition-tree/src/DecompositionTree.d.ts +1 -1
- package/dist/types/components/viz/funnel/src/FunnelChart.d.ts +1 -1
- package/dist/types/components/viz/gantt-chart/src/GanttChart.d.ts +1 -1
- package/dist/types/components/viz/gauge/src/Gauge.d.ts +1 -1
- package/dist/types/components/viz/graph/src/HypercubeGraph.d.ts +1 -1
- package/dist/types/components/viz/heat-map/src/HeatMap.d.ts +1 -1
- package/dist/types/components/viz/histogram/src/Histogram.d.ts +1 -1
- package/dist/types/components/viz/matrix/src/Matrix.d.ts +1 -1
- package/dist/types/components/viz/partition/src/Partition.d.ts +1 -1
- package/dist/types/components/viz/pivot-table/src/PivotTable.d.ts +1 -1
- package/dist/types/components/viz/radar-chart/src/RadarChart.d.ts +1 -1
- package/dist/types/components/viz/sankey/src/SankeyDiagram.d.ts +1 -1
- package/dist/types/components/viz/sunburst/src/Sunburst.d.ts +1 -1
- package/dist/types/components/viz/tree-map/src/TreeMap.d.ts +1 -1
- package/dist/types/components/viz/vector-field/src/VectorField.d.ts +1 -1
- package/dist/types/components/viz/waterfall/src/WaterfallChart.d.ts +1 -1
- package/dist/types/components/viz/word-cloud/src/WordCloud.d.ts +1 -1
- package/dist/types/components/viz/wrapper/src/VizWrapper.d.ts +1 -1
- package/package.json +1 -1
- package/dist/esm/chunks/chunk-3J4RXW7E.js +0 -3
- package/dist/esm/chunks/chunk-3SXNLMCH.js +0 -3
- package/dist/esm/chunks/chunk-A7AAS5ZR.js +0 -3
- package/dist/esm/chunks/chunk-E43OK6IZ.js +0 -3
- package/dist/esm/chunks/chunk-LWOMFZ4C.js +0 -3
- package/dist/esm/chunks/chunk-MCXU6QF3.js +0 -3
- package/dist/esm/chunks/chunk-ODCBJ22O.js +0 -3
- package/dist/esm/chunks/chunk-TVDAY42P.js +0 -3
- package/dist/esm/chunks/chunk-VAF4KNDP.js +0 -3
- package/dist/esm/chunks/chunk-ZDPD2MPQ.js +0 -3
- package/dist/esm/chunks/metrics-56RIK7JQ.js +0 -3
- /package/dist/esm/chunks/{chunk-ZDPD2MPQ.js.map → chunk-MKUA6QTB.js.map} +0 -0
- /package/dist/esm/chunks/{metrics-56RIK7JQ.js.map → metrics-6LW2N3GU.js.map} +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,119 @@
|
|
|
1
1
|
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
Children,
|
|
4
|
+
Component,
|
|
5
|
+
ErrorBoundary,
|
|
6
|
+
FeatureFlagProvider,
|
|
7
|
+
FeatureGate,
|
|
8
|
+
Link,
|
|
9
|
+
Profiler,
|
|
10
|
+
PureComponent,
|
|
11
|
+
Route,
|
|
12
|
+
Router,
|
|
13
|
+
StrictMode,
|
|
14
|
+
Suspense,
|
|
15
|
+
act,
|
|
16
|
+
cloneElement,
|
|
17
|
+
createContext,
|
|
18
|
+
createRef,
|
|
19
|
+
forwardRef,
|
|
20
|
+
lazy,
|
|
21
|
+
matchPath,
|
|
22
|
+
memo,
|
|
23
|
+
useFeatureFlags,
|
|
24
|
+
useNavigate,
|
|
25
|
+
useParams,
|
|
26
|
+
useRouter
|
|
27
|
+
} from "./chunks/chunk-AVA7QEGU.js";
|
|
28
|
+
import {
|
|
29
|
+
getComponentTypeTable,
|
|
30
|
+
resolveComponentId,
|
|
31
|
+
setComponentIdsEnabled,
|
|
32
|
+
startTransition
|
|
33
|
+
} from "./chunks/chunk-5OX5JKEY.js";
|
|
34
|
+
import {
|
|
35
|
+
isValidElement
|
|
36
|
+
} from "./chunks/chunk-RSL3RU56.js";
|
|
37
|
+
import {
|
|
38
|
+
Fragment,
|
|
39
|
+
createElement,
|
|
40
|
+
createFactory
|
|
41
|
+
} from "./chunks/chunk-NF4555DU.js";
|
|
42
|
+
import "./chunks/chunk-HINJXYXY.js";
|
|
43
|
+
import {
|
|
44
|
+
assertSecureUrl,
|
|
45
|
+
secureFetch
|
|
46
|
+
} from "./chunks/chunk-BLIAKWAU.js";
|
|
47
|
+
import {
|
|
48
|
+
useCallback,
|
|
49
|
+
useContext,
|
|
50
|
+
useDebugValue,
|
|
51
|
+
useDeferredValue,
|
|
52
|
+
useEffect,
|
|
53
|
+
useHead,
|
|
54
|
+
useId,
|
|
55
|
+
useImperativeHandle,
|
|
56
|
+
useInsertionEffect,
|
|
57
|
+
useLayoutEffect,
|
|
58
|
+
useMemo,
|
|
59
|
+
useReducer,
|
|
60
|
+
useRef,
|
|
61
|
+
useState,
|
|
62
|
+
useSyncExternalStore,
|
|
63
|
+
useTransition
|
|
64
|
+
} from "./chunks/chunk-CWCWXKVV.js";
|
|
65
|
+
import "./chunks/chunk-MKUA6QTB.js";
|
|
66
|
+
export {
|
|
67
|
+
Children,
|
|
68
|
+
Component,
|
|
69
|
+
ErrorBoundary,
|
|
70
|
+
FeatureFlagProvider,
|
|
71
|
+
FeatureGate,
|
|
72
|
+
Fragment,
|
|
73
|
+
Link,
|
|
74
|
+
Profiler,
|
|
75
|
+
PureComponent,
|
|
76
|
+
Route,
|
|
77
|
+
Router,
|
|
78
|
+
StrictMode,
|
|
79
|
+
Suspense,
|
|
80
|
+
act,
|
|
81
|
+
assertSecureUrl,
|
|
82
|
+
cloneElement,
|
|
83
|
+
createContext,
|
|
84
|
+
createElement,
|
|
85
|
+
createFactory,
|
|
86
|
+
createRef,
|
|
87
|
+
forwardRef,
|
|
88
|
+
getComponentTypeTable,
|
|
89
|
+
createElement as h,
|
|
90
|
+
isValidElement,
|
|
91
|
+
lazy,
|
|
92
|
+
matchPath,
|
|
93
|
+
memo,
|
|
94
|
+
resolveComponentId,
|
|
95
|
+
secureFetch,
|
|
96
|
+
setComponentIdsEnabled,
|
|
97
|
+
startTransition,
|
|
98
|
+
useCallback,
|
|
99
|
+
useContext,
|
|
100
|
+
useDebugValue,
|
|
101
|
+
useDeferredValue,
|
|
102
|
+
useEffect,
|
|
103
|
+
useFeatureFlags,
|
|
104
|
+
useHead,
|
|
105
|
+
useId,
|
|
106
|
+
useImperativeHandle,
|
|
107
|
+
useInsertionEffect,
|
|
108
|
+
useLayoutEffect,
|
|
109
|
+
useMemo,
|
|
110
|
+
useNavigate,
|
|
111
|
+
useParams,
|
|
112
|
+
useReducer,
|
|
113
|
+
useRef,
|
|
114
|
+
useRouter,
|
|
115
|
+
useState,
|
|
116
|
+
useSyncExternalStore,
|
|
117
|
+
useTransition
|
|
118
|
+
};
|
|
3
119
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
jsx
|
|
4
|
+
} from "./chunks/chunk-T7EHIXSF.js";
|
|
5
|
+
import {
|
|
6
|
+
Fragment
|
|
7
|
+
} from "./chunks/chunk-NF4555DU.js";
|
|
8
|
+
import "./chunks/chunk-HINJXYXY.js";
|
|
9
|
+
import "./chunks/chunk-MKUA6QTB.js";
|
|
10
|
+
export {
|
|
11
|
+
Fragment,
|
|
12
|
+
jsx as jsxDEV
|
|
13
|
+
};
|
|
3
14
|
//# sourceMappingURL=jsx-dev-runtime.js.map
|
package/dist/esm/jsx-runtime.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
jsx
|
|
4
|
+
} from "./chunks/chunk-T7EHIXSF.js";
|
|
5
|
+
import {
|
|
6
|
+
Fragment
|
|
7
|
+
} from "./chunks/chunk-NF4555DU.js";
|
|
8
|
+
import "./chunks/chunk-HINJXYXY.js";
|
|
9
|
+
import "./chunks/chunk-MKUA6QTB.js";
|
|
10
|
+
export {
|
|
11
|
+
Fragment,
|
|
12
|
+
jsx,
|
|
13
|
+
jsx as jsxs
|
|
14
|
+
};
|
|
3
15
|
//# sourceMappingURL=jsx-runtime.js.map
|
package/dist/esm/server/index.js
CHANGED
|
@@ -1,3 +1,383 @@
|
|
|
1
1
|
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
isValidElement
|
|
4
|
+
} from "../chunks/chunk-RSL3RU56.js";
|
|
5
|
+
import {
|
|
6
|
+
SPEC_FORWARD_REF_TYPE,
|
|
7
|
+
SPEC_FRAGMENT_TYPE,
|
|
8
|
+
SPEC_MEMO_TYPE,
|
|
9
|
+
SPEC_PROFILER_TYPE,
|
|
10
|
+
SPEC_PROVIDER_TYPE,
|
|
11
|
+
SPEC_STRICT_MODE_TYPE
|
|
12
|
+
} from "../chunks/chunk-HINJXYXY.js";
|
|
13
|
+
import "../chunks/chunk-MKUA6QTB.js";
|
|
14
|
+
|
|
15
|
+
// src/server/render-to-string.ts
|
|
16
|
+
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
17
|
+
"area",
|
|
18
|
+
"base",
|
|
19
|
+
"br",
|
|
20
|
+
"col",
|
|
21
|
+
"embed",
|
|
22
|
+
"hr",
|
|
23
|
+
"img",
|
|
24
|
+
"input",
|
|
25
|
+
"link",
|
|
26
|
+
"meta",
|
|
27
|
+
"param",
|
|
28
|
+
"source",
|
|
29
|
+
"track",
|
|
30
|
+
"wbr"
|
|
31
|
+
]);
|
|
32
|
+
var PROP_TO_ATTR = {
|
|
33
|
+
className: "class",
|
|
34
|
+
htmlFor: "for",
|
|
35
|
+
httpEquiv: "http-equiv",
|
|
36
|
+
acceptCharset: "accept-charset",
|
|
37
|
+
tabIndex: "tabindex",
|
|
38
|
+
autoFocus: "autofocus",
|
|
39
|
+
autoComplete: "autocomplete",
|
|
40
|
+
autoPlay: "autoplay",
|
|
41
|
+
crossOrigin: "crossorigin",
|
|
42
|
+
noValidate: "novalidate",
|
|
43
|
+
formNoValidate: "formnovalidate",
|
|
44
|
+
readOnly: "readonly",
|
|
45
|
+
cellPadding: "cellpadding",
|
|
46
|
+
cellSpacing: "cellspacing",
|
|
47
|
+
colSpan: "colspan",
|
|
48
|
+
rowSpan: "rowspan",
|
|
49
|
+
frameBorder: "frameborder",
|
|
50
|
+
marginHeight: "marginheight",
|
|
51
|
+
marginWidth: "marginwidth"
|
|
52
|
+
};
|
|
53
|
+
var RESERVED_PROPS = /* @__PURE__ */ new Set(["children", "key", "ref", "dangerouslySetInnerHTML"]);
|
|
54
|
+
var EVENT_RE = /^on[A-Z]/;
|
|
55
|
+
function renderToString(element) {
|
|
56
|
+
assertNotInRequestContext("renderToString");
|
|
57
|
+
return renderNode(element, true);
|
|
58
|
+
}
|
|
59
|
+
function renderToStaticMarkup(element) {
|
|
60
|
+
assertNotInRequestContext("renderToStaticMarkup");
|
|
61
|
+
return renderNode(element, false);
|
|
62
|
+
}
|
|
63
|
+
function assertNotInRequestContext(fnName) {
|
|
64
|
+
if (typeof process !== "undefined" && typeof process.env !== "undefined" && process.env.SPECIFYJS_ALLOW_PRERENDER === "true") {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (typeof process !== "undefined" && typeof process.env !== "undefined" && process.env.PORT) {
|
|
68
|
+
if (!process.env.SPECIFYJS_ALLOW_PRERENDER) {
|
|
69
|
+
console.warn(
|
|
70
|
+
`[SpecifyJS] ${fnName}() 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`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function renderNode(node, includeDataAttrs) {
|
|
76
|
+
if (node == null || typeof node === "boolean") {
|
|
77
|
+
return "";
|
|
78
|
+
}
|
|
79
|
+
if (typeof node === "string") {
|
|
80
|
+
return escapeHtml(node);
|
|
81
|
+
}
|
|
82
|
+
if (typeof node === "number") {
|
|
83
|
+
return String(node);
|
|
84
|
+
}
|
|
85
|
+
if (Array.isArray(node)) {
|
|
86
|
+
let result = "";
|
|
87
|
+
const stack = [];
|
|
88
|
+
for (let i = node.length - 1; i >= 0; i--) stack.push(node[i]);
|
|
89
|
+
while (stack.length > 0) {
|
|
90
|
+
const child = stack.pop();
|
|
91
|
+
if (child == null || typeof child === "boolean") continue;
|
|
92
|
+
if (typeof child === "string") {
|
|
93
|
+
result += escapeHtml(child);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (typeof child === "number") {
|
|
97
|
+
result += String(child);
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (Array.isArray(child)) {
|
|
101
|
+
for (let i = child.length - 1; i >= 0; i--) stack.push(child[i]);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (isValidElement(child)) result += renderElement(child, includeDataAttrs);
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
if (!isValidElement(node)) {
|
|
109
|
+
return "";
|
|
110
|
+
}
|
|
111
|
+
const element = node;
|
|
112
|
+
return renderElement(element, includeDataAttrs);
|
|
113
|
+
}
|
|
114
|
+
function renderElement(element, includeDataAttrs) {
|
|
115
|
+
const { type, props } = element;
|
|
116
|
+
if (type === SPEC_FRAGMENT_TYPE || type === SPEC_STRICT_MODE_TYPE || type === SPEC_PROFILER_TYPE) {
|
|
117
|
+
return renderNode(props.children, includeDataAttrs);
|
|
118
|
+
}
|
|
119
|
+
if (typeof type === "object" && type !== null) {
|
|
120
|
+
const $$typeof = type.$$typeof;
|
|
121
|
+
if ($$typeof === SPEC_PROVIDER_TYPE) {
|
|
122
|
+
const context = type._context;
|
|
123
|
+
const prevValue = context._currentValue;
|
|
124
|
+
context._currentValue = props.value;
|
|
125
|
+
const result = renderNode(props.children, includeDataAttrs);
|
|
126
|
+
context._currentValue = prevValue;
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
if ($$typeof === SPEC_FORWARD_REF_TYPE) {
|
|
130
|
+
const render = type.render;
|
|
131
|
+
const children = render(props, element.ref);
|
|
132
|
+
return renderNode(children, includeDataAttrs);
|
|
133
|
+
}
|
|
134
|
+
if ($$typeof === SPEC_MEMO_TYPE) {
|
|
135
|
+
const innerType = type.type;
|
|
136
|
+
if (typeof innerType === "function") {
|
|
137
|
+
const children = innerType(props);
|
|
138
|
+
return renderNode(children, includeDataAttrs);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (typeof type === "function") {
|
|
143
|
+
if (type.prototype?.isSpecComponent) {
|
|
144
|
+
const Constructor = type;
|
|
145
|
+
const instance = new Constructor(props);
|
|
146
|
+
const children2 = instance.render();
|
|
147
|
+
return renderNode(children2, includeDataAttrs);
|
|
148
|
+
}
|
|
149
|
+
const children = type(props);
|
|
150
|
+
return renderNode(children, includeDataAttrs);
|
|
151
|
+
}
|
|
152
|
+
if (typeof type === "string") {
|
|
153
|
+
return renderHostElement(type, props, includeDataAttrs);
|
|
154
|
+
}
|
|
155
|
+
return "";
|
|
156
|
+
}
|
|
157
|
+
function renderHostElement(tag, props, includeDataAttrs) {
|
|
158
|
+
let html = `<${tag}`;
|
|
159
|
+
for (const key in props) {
|
|
160
|
+
if (RESERVED_PROPS.has(key) || EVENT_RE.test(key)) continue;
|
|
161
|
+
const value = props[key];
|
|
162
|
+
if (value == null || value === false) continue;
|
|
163
|
+
const attrName = PROP_TO_ATTR[key] || key.toLowerCase();
|
|
164
|
+
if (!/^[a-zA-Z_][\w\-:.]*$/.test(attrName)) continue;
|
|
165
|
+
if (key === "style") {
|
|
166
|
+
html += ` style="${renderStyle(value)}"`;
|
|
167
|
+
} else if (key === "value" || key === "checked" || key === "selected") {
|
|
168
|
+
if (value === true) {
|
|
169
|
+
html += ` ${attrName}`;
|
|
170
|
+
} else {
|
|
171
|
+
html += ` ${attrName}="${escapeHtml(String(value))}"`;
|
|
172
|
+
}
|
|
173
|
+
} else if (value === true) {
|
|
174
|
+
html += ` ${attrName}`;
|
|
175
|
+
} else {
|
|
176
|
+
html += ` ${attrName}="${escapeHtml(String(value))}"`;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (includeDataAttrs) {
|
|
180
|
+
}
|
|
181
|
+
if (VOID_ELEMENTS.has(tag)) {
|
|
182
|
+
html += "/>";
|
|
183
|
+
return html;
|
|
184
|
+
}
|
|
185
|
+
html += ">";
|
|
186
|
+
if (props.dangerouslySetInnerHTML) {
|
|
187
|
+
const innerHtml = props.dangerouslySetInnerHTML.__html;
|
|
188
|
+
html += innerHtml;
|
|
189
|
+
} else {
|
|
190
|
+
html += renderNode(props.children, includeDataAttrs);
|
|
191
|
+
}
|
|
192
|
+
html += `</${tag}>`;
|
|
193
|
+
return html;
|
|
194
|
+
}
|
|
195
|
+
function renderStyle(style) {
|
|
196
|
+
const parts = [];
|
|
197
|
+
for (const prop in style) {
|
|
198
|
+
const value = style[prop];
|
|
199
|
+
if (value == null) continue;
|
|
200
|
+
const cssProp = prop.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
201
|
+
let cssValue = typeof value === "number" && value !== 0 && !isUnitlessProp(prop) ? `${value}px` : String(value);
|
|
202
|
+
cssValue = cssValue.replace(/expression\s*\(/gi, "").replace(/url\s*\(\s*javascript:/gi, "url(");
|
|
203
|
+
parts.push(`${cssProp}:${cssValue}`);
|
|
204
|
+
}
|
|
205
|
+
return parts.join(";");
|
|
206
|
+
}
|
|
207
|
+
var UNITLESS_PROPS = /* @__PURE__ */ new Set([
|
|
208
|
+
"animationIterationCount",
|
|
209
|
+
"aspectRatio",
|
|
210
|
+
"borderImageOutset",
|
|
211
|
+
"borderImageSlice",
|
|
212
|
+
"borderImageWidth",
|
|
213
|
+
"boxFlex",
|
|
214
|
+
"boxFlexGroup",
|
|
215
|
+
"boxOrdinalGroup",
|
|
216
|
+
"columnCount",
|
|
217
|
+
"columns",
|
|
218
|
+
"flex",
|
|
219
|
+
"flexGrow",
|
|
220
|
+
"flexPositive",
|
|
221
|
+
"flexShrink",
|
|
222
|
+
"flexNegative",
|
|
223
|
+
"flexOrder",
|
|
224
|
+
"gridArea",
|
|
225
|
+
"gridRow",
|
|
226
|
+
"gridRowEnd",
|
|
227
|
+
"gridRowSpan",
|
|
228
|
+
"gridRowStart",
|
|
229
|
+
"gridColumn",
|
|
230
|
+
"gridColumnEnd",
|
|
231
|
+
"gridColumnSpan",
|
|
232
|
+
"gridColumnStart",
|
|
233
|
+
"fontWeight",
|
|
234
|
+
"lineClamp",
|
|
235
|
+
"lineHeight",
|
|
236
|
+
"opacity",
|
|
237
|
+
"order",
|
|
238
|
+
"orphans",
|
|
239
|
+
"tabSize",
|
|
240
|
+
"widows",
|
|
241
|
+
"zIndex",
|
|
242
|
+
"zoom",
|
|
243
|
+
"fillOpacity",
|
|
244
|
+
"floodOpacity",
|
|
245
|
+
"stopOpacity",
|
|
246
|
+
"strokeDasharray",
|
|
247
|
+
"strokeDashoffset",
|
|
248
|
+
"strokeMiterlimit",
|
|
249
|
+
"strokeOpacity",
|
|
250
|
+
"strokeWidth"
|
|
251
|
+
]);
|
|
252
|
+
function isUnitlessProp(prop) {
|
|
253
|
+
return UNITLESS_PROPS.has(prop);
|
|
254
|
+
}
|
|
255
|
+
function escapeHtml(str) {
|
|
256
|
+
let result = "";
|
|
257
|
+
let lastIndex = 0;
|
|
258
|
+
for (let i = 0; i < str.length; i++) {
|
|
259
|
+
let escaped;
|
|
260
|
+
switch (str.charCodeAt(i)) {
|
|
261
|
+
case 34:
|
|
262
|
+
escaped = """;
|
|
263
|
+
break;
|
|
264
|
+
// "
|
|
265
|
+
case 38:
|
|
266
|
+
escaped = "&";
|
|
267
|
+
break;
|
|
268
|
+
// &
|
|
269
|
+
case 39:
|
|
270
|
+
escaped = "'";
|
|
271
|
+
break;
|
|
272
|
+
// '
|
|
273
|
+
case 60:
|
|
274
|
+
escaped = "<";
|
|
275
|
+
break;
|
|
276
|
+
// <
|
|
277
|
+
case 62:
|
|
278
|
+
escaped = ">";
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
if (escaped !== void 0) {
|
|
282
|
+
if (lastIndex !== i) {
|
|
283
|
+
result += str.slice(lastIndex, i);
|
|
284
|
+
}
|
|
285
|
+
result += escaped;
|
|
286
|
+
lastIndex = i + 1;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (lastIndex === 0) return str;
|
|
290
|
+
if (lastIndex < str.length) {
|
|
291
|
+
result += str.slice(lastIndex);
|
|
292
|
+
}
|
|
293
|
+
return result;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// src/server/render-to-pipeable-stream.ts
|
|
297
|
+
function renderToPipeableStream(element, options) {
|
|
298
|
+
let aborted = false;
|
|
299
|
+
return {
|
|
300
|
+
pipe(destination) {
|
|
301
|
+
if (aborted) {
|
|
302
|
+
destination.end();
|
|
303
|
+
return destination;
|
|
304
|
+
}
|
|
305
|
+
let html;
|
|
306
|
+
try {
|
|
307
|
+
html = renderToString(element);
|
|
308
|
+
} catch (error) {
|
|
309
|
+
options?.onShellError?.(error);
|
|
310
|
+
options?.onError?.(error);
|
|
311
|
+
destination.end();
|
|
312
|
+
return destination;
|
|
313
|
+
}
|
|
314
|
+
options?.onShellReady?.();
|
|
315
|
+
const chunkSize = options?.progressiveChunkSize ?? 8192;
|
|
316
|
+
if (html.length <= chunkSize) {
|
|
317
|
+
destination.write(html);
|
|
318
|
+
destination.end();
|
|
319
|
+
options?.onAllReady?.();
|
|
320
|
+
} else {
|
|
321
|
+
let writeNextChunk2 = function() {
|
|
322
|
+
if (aborted || offset >= html.length) {
|
|
323
|
+
destination.end();
|
|
324
|
+
options?.onAllReady?.();
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
const chunk = html.slice(offset, offset + chunkSize);
|
|
328
|
+
offset += chunkSize;
|
|
329
|
+
const canContinue = destination.write(chunk);
|
|
330
|
+
if (canContinue) {
|
|
331
|
+
setImmediate(writeNextChunk2);
|
|
332
|
+
} else {
|
|
333
|
+
destination.once("drain", writeNextChunk2);
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
var writeNextChunk = writeNextChunk2;
|
|
337
|
+
let offset = 0;
|
|
338
|
+
writeNextChunk2();
|
|
339
|
+
}
|
|
340
|
+
return destination;
|
|
341
|
+
},
|
|
342
|
+
abort(reason) {
|
|
343
|
+
aborted = true;
|
|
344
|
+
options?.onError?.(reason);
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// src/server/render-to-readable-stream.ts
|
|
350
|
+
async function renderToReadableStream(element, options) {
|
|
351
|
+
const encoder = new TextEncoder();
|
|
352
|
+
const chunkSize = options?.progressiveChunkSize ?? 8192;
|
|
353
|
+
return new ReadableStream({
|
|
354
|
+
start(controller) {
|
|
355
|
+
if (options?.signal?.aborted) {
|
|
356
|
+
controller.close();
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
let html;
|
|
360
|
+
try {
|
|
361
|
+
html = renderToString(element);
|
|
362
|
+
} catch (error) {
|
|
363
|
+
options?.onError?.(error);
|
|
364
|
+
controller.error(error);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
let offset = 0;
|
|
368
|
+
while (offset < html.length) {
|
|
369
|
+
const chunk = html.slice(offset, offset + chunkSize);
|
|
370
|
+
controller.enqueue(encoder.encode(chunk));
|
|
371
|
+
offset += chunkSize;
|
|
372
|
+
}
|
|
373
|
+
controller.close();
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
export {
|
|
378
|
+
renderToPipeableStream,
|
|
379
|
+
renderToReadableStream,
|
|
380
|
+
renderToStaticMarkup,
|
|
381
|
+
renderToString
|
|
382
|
+
};
|
|
3
383
|
//# sourceMappingURL=index.js.map
|