tempest-react-sdk 0.72.0 → 0.74.0

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.
Files changed (147) hide show
  1. package/README.md +6 -4
  2. package/dist/br/MapMarkers.cjs +1 -1
  3. package/dist/br/MapMarkers.cjs.map +1 -1
  4. package/dist/br/MapMarkers.js +19 -22
  5. package/dist/br/MapMarkers.js.map +1 -1
  6. package/dist/components/AIChat/AIChatTurn.cjs +1 -1
  7. package/dist/components/AIChat/AIChatTurn.cjs.map +1 -1
  8. package/dist/components/AIChat/AIChatTurn.js +1 -1
  9. package/dist/components/AIChat/AIChatTurn.js.map +1 -1
  10. package/dist/components/AppShell/AppShell.module.cjs.map +1 -1
  11. package/dist/components/AppShell/AppShell.module.js.map +1 -1
  12. package/dist/components/Button/Button.cjs +1 -1
  13. package/dist/components/Button/Button.cjs.map +1 -1
  14. package/dist/components/Button/Button.js +41 -36
  15. package/dist/components/Button/Button.js.map +1 -1
  16. package/dist/components/Button/Button.module.cjs.map +1 -1
  17. package/dist/components/Button/Button.module.js.map +1 -1
  18. package/dist/components/Button/ButtonContent.cjs +2 -0
  19. package/dist/components/Button/ButtonContent.cjs.map +1 -0
  20. package/dist/components/Button/ButtonContent.js +34 -0
  21. package/dist/components/Button/ButtonContent.js.map +1 -0
  22. package/dist/components/Button/ButtonSlot.cjs +2 -0
  23. package/dist/components/Button/ButtonSlot.cjs.map +1 -0
  24. package/dist/components/Button/ButtonSlot.js +36 -0
  25. package/dist/components/Button/ButtonSlot.js.map +1 -0
  26. package/dist/components/Button/button-class.cjs +2 -0
  27. package/dist/components/Button/button-class.cjs.map +1 -0
  28. package/dist/components/Button/button-class.js +13 -0
  29. package/dist/components/Button/button-class.js.map +1 -0
  30. package/dist/components/Button/link-rel.cjs +2 -0
  31. package/dist/components/Button/link-rel.cjs.map +1 -0
  32. package/dist/components/Button/link-rel.js +11 -0
  33. package/dist/components/Button/link-rel.js.map +1 -0
  34. package/dist/components/Button/slot.cjs +2 -0
  35. package/dist/components/Button/slot.cjs.map +1 -0
  36. package/dist/components/Button/slot.js +41 -0
  37. package/dist/components/Button/slot.js.map +1 -0
  38. package/dist/components/Collapsible/Collapsible.cjs +1 -1
  39. package/dist/components/Collapsible/Collapsible.cjs.map +1 -1
  40. package/dist/components/Collapsible/Collapsible.js +1 -1
  41. package/dist/components/Collapsible/Collapsible.js.map +1 -1
  42. package/dist/components/Form/Form.cjs.map +1 -1
  43. package/dist/components/Form/Form.js.map +1 -1
  44. package/dist/components/InstallButton/InstallButton.cjs.map +1 -1
  45. package/dist/components/InstallButton/InstallButton.js.map +1 -1
  46. package/dist/components/Modal/Modal.cjs +1 -1
  47. package/dist/components/Modal/Modal.cjs.map +1 -1
  48. package/dist/components/Modal/Modal.js +1 -1
  49. package/dist/components/Modal/Modal.js.map +1 -1
  50. package/dist/components/Modal/Modal.module.cjs +1 -1
  51. package/dist/components/Modal/Modal.module.cjs.map +1 -1
  52. package/dist/components/Modal/Modal.module.js +1 -1
  53. package/dist/components/Modal/Modal.module.js.map +1 -1
  54. package/dist/components/Page/Page.cjs +1 -1
  55. package/dist/components/Page/Page.cjs.map +1 -1
  56. package/dist/components/Page/Page.js +23 -39
  57. package/dist/components/Page/Page.js.map +1 -1
  58. package/dist/components/Page/Page.module.cjs +1 -1
  59. package/dist/components/Page/Page.module.cjs.map +1 -1
  60. package/dist/components/Page/Page.module.js +5 -11
  61. package/dist/components/Page/Page.module.js.map +1 -1
  62. package/dist/components/Reveal/Reveal.cjs +2 -0
  63. package/dist/components/Reveal/Reveal.cjs.map +1 -0
  64. package/dist/components/Reveal/Reveal.js +56 -0
  65. package/dist/components/Reveal/Reveal.js.map +1 -0
  66. package/dist/components/Reveal/Reveal.module.cjs +3 -0
  67. package/dist/components/Reveal/Reveal.module.cjs.map +1 -0
  68. package/dist/components/Reveal/Reveal.module.js +7 -0
  69. package/dist/components/Reveal/Reveal.module.js.map +1 -0
  70. package/dist/components/Reveal/reveal-threshold.cjs +2 -0
  71. package/dist/components/Reveal/reveal-threshold.cjs.map +1 -0
  72. package/dist/components/Reveal/reveal-threshold.js +13 -0
  73. package/dist/components/Reveal/reveal-threshold.js.map +1 -0
  74. package/dist/components/SectionHeader/SectionHeader.cjs +2 -0
  75. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -0
  76. package/dist/components/SectionHeader/SectionHeader.js +58 -0
  77. package/dist/components/SectionHeader/SectionHeader.js.map +1 -0
  78. package/dist/components/SectionHeader/SectionHeader.module.cjs +3 -0
  79. package/dist/components/SectionHeader/SectionHeader.module.cjs.map +1 -0
  80. package/dist/components/SectionHeader/SectionHeader.module.js +15 -0
  81. package/dist/components/SectionHeader/SectionHeader.module.js.map +1 -0
  82. package/dist/components/Timeline/Timeline.cjs +1 -1
  83. package/dist/components/Timeline/Timeline.cjs.map +1 -1
  84. package/dist/components/Timeline/Timeline.js +22 -15
  85. package/dist/components/Timeline/Timeline.js.map +1 -1
  86. package/dist/components/Timeline/Timeline.module.cjs +1 -1
  87. package/dist/components/Timeline/Timeline.module.cjs.map +1 -1
  88. package/dist/components/Timeline/Timeline.module.js +1 -1
  89. package/dist/components/Timeline/Timeline.module.js.map +1 -1
  90. package/dist/styles/Reveal.css +2 -0
  91. package/dist/styles/SectionHeader.css +2 -0
  92. package/dist/styles/actions.css +24 -22
  93. package/dist/styles/base.css +3 -1
  94. package/dist/styles/component/AppShell.css +1 -1
  95. package/dist/styles/component/Button.css +24 -22
  96. package/dist/styles/component/Modal.css +2 -2
  97. package/dist/styles/component/Page.css +0 -6
  98. package/dist/styles/component/Reveal.css +9 -0
  99. package/dist/styles/component/SectionHeader.css +9 -0
  100. package/dist/styles/component/Timeline.css +5 -5
  101. package/dist/styles/core.css +3 -1
  102. package/dist/styles/data.css +5 -5
  103. package/dist/styles/inverse.css +147 -0
  104. package/dist/styles/layout.css +9 -7
  105. package/dist/styles/manifest.json +14 -1
  106. package/dist/styles/overlay.css +2 -2
  107. package/dist/styles/utility.css +8 -0
  108. package/dist/styles.css +1 -1
  109. package/dist/tempest-react-sdk.cjs +1 -1
  110. package/dist/tempest-react-sdk.d.ts +353 -4
  111. package/dist/tempest-react-sdk.js +350 -346
  112. package/dist/theme/create-theme.cjs +3 -3
  113. package/dist/theme/create-theme.cjs.map +1 -1
  114. package/dist/theme/create-theme.js +67 -55
  115. package/dist/theme/create-theme.js.map +1 -1
  116. package/dist/theme/inverse-render.cjs +3 -0
  117. package/dist/theme/inverse-render.cjs.map +1 -0
  118. package/dist/theme/inverse-render.js +10 -0
  119. package/dist/theme/inverse-render.js.map +1 -0
  120. package/dist/theme/inverse-surface.cjs +2 -0
  121. package/dist/theme/inverse-surface.cjs.map +1 -0
  122. package/dist/theme/inverse-surface.js +258 -0
  123. package/dist/theme/inverse-surface.js.map +1 -0
  124. package/dist/theme/status-tokens.cjs +2 -0
  125. package/dist/theme/status-tokens.cjs.map +1 -0
  126. package/dist/theme/status-tokens.js +15 -0
  127. package/dist/theme/status-tokens.js.map +1 -0
  128. package/dist/vision/core/graph.cjs.map +1 -1
  129. package/dist/vision/core/graph.js.map +1 -1
  130. package/dist/vision/core/metadata.cjs +2 -2
  131. package/dist/vision/core/metadata.cjs.map +1 -1
  132. package/dist/vision/core/metadata.js +101 -29
  133. package/dist/vision/core/metadata.js.map +1 -1
  134. package/dist/vision/core/session.cjs +1 -1
  135. package/dist/vision/core/session.cjs.map +1 -1
  136. package/dist/vision/core/session.js +59 -48
  137. package/dist/vision/core/session.js.map +1 -1
  138. package/dist/vision/index.cjs +1 -1
  139. package/dist/vision/index.cjs.map +1 -1
  140. package/dist/vision/index.js +1 -1
  141. package/dist/vision/index.js.map +1 -1
  142. package/dist/vision.d.ts +25 -21
  143. package/dist/vite/create-vite-config.cjs +1 -1
  144. package/dist/vite/create-vite-config.cjs.map +1 -1
  145. package/dist/vite/create-vite-config.js +6 -4
  146. package/dist/vite/create-vite-config.js.map +1 -1
  147. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * `tempest-react-sdk/vision` — browser computer-vision inference with ONNX\n * Runtime Web (classification, detection, segmentation).\n *\n * Vendored from `@mauriciobenjamin700/ort-vision-sdk-web@0.11.0` (MIT, same\n * author) so it ships inside this SDK without an extra package install.\n * `onnxruntime-web` stays an optional peer dependency — install it (and ship\n * the matching `.wasm` files) only when you use this subpath.\n *\n * Do not hand-edit — regenerate with `npm run vendor:vision`.\n */\n\nexport {\n BoundingBox,\n Mask,\n RGBImage,\n type ClassProbability,\n type ClassificationResult,\n type DetectionResult,\n type SegmentationResult,\n} from \"./types\";\n\nexport {\n Boxes,\n ClassificationResults,\n DetectClassifyResults,\n DetectionResults,\n Masks,\n Probs,\n SegmentationResults,\n} from \"./results\";\n\nexport {\n COCO_CLASSES,\n type LabelSpec,\n type ResolveLabelsOptions,\n defaultLabels,\n resolveLabels,\n} from \"./labels\";\n\nexport {\n FusionError,\n ImageLoadError,\n InferenceError,\n LabelMapError,\n ModelLoadError,\n NoDetectionsError,\n OrtVisionError,\n ProviderNotAvailableError,\n} from \"./core/exceptions\";\n\nexport {\n DEFAULT_MODEL_CACHE,\n GRAPH_OPTIMIZATION_KEY,\n type ModelSource,\n type OrtSessionOptions,\n OrtSession,\n QUANTIZATION_KEY,\n} from \"./core/session\";\nexport {\n type DeclaredDim,\n type DeclaredShape,\n type ResolveInputSizeOptions,\n classificationNumClasses,\n declaredShapesFrom,\n detectionNumClasses,\n resolveInputSize,\n spatialInputSize,\n} from \"./core/graph\";\nexport {\n DEFAULT_TENSOR_TYPE,\n type Float16ArrayLike,\n asFloat32Array,\n hasFloat16Array,\n tensorTypeFor,\n} from \"./core/dtypes\";\nexport { modelNames, parseNames, readModelInputTypes, readModelMetadata } from \"./core/metadata\";\nexport {\n DEFAULT_PROVIDERS,\n type ProviderSpec,\n detectProviders,\n resolveProviders,\n} from \"./core/providers\";\nexport { type Speed, SpeedTimer } from \"./core/timing\";\nexport {\n CUSTOM_NORMALIZATION,\n IDENTITY_MEAN,\n IDENTITY_STD,\n IMAGENET_MEAN,\n IMAGENET_STD,\n type Normalization,\n type ResolvedNormalization,\n isUltralyticsClassifier,\n resolveNormalization,\n} from \"./normalization\";\n\nexport { type ImageInput, loadImage } from \"./io/image\";\n\nexport {\n FUSION_KIND_DETECT_CLASSIFY,\n FUSION_KIND_DETECT_SEGMENT_CLASSIFY,\n INPUT_IMAGE,\n INPUT_PAD,\n INPUT_SCALE,\n INPUT_SOURCE,\n METADATA_PREFIX,\n OUTPUT_BOXES,\n OUTPUT_CLASSES,\n OUTPUT_MASKS,\n OUTPUT_NUM_DETECTIONS,\n OUTPUT_PROBS,\n OUTPUT_SCORES,\n type CropSource,\n type FusionSpec,\n readFusionSpec,\n} from \"./fusion\";\n\nexport {\n type LetterboxResult,\n fromCv2,\n letterbox,\n normalize,\n resize,\n toCHW,\n toCv2,\n toFloat32,\n toFloat32Tensor,\n toTensor,\n} from \"./preprocess/image\";\n\nexport {\n type FusedLetterboxResult,\n type FusedResizeResult,\n LetterboxPipeline,\n ResizePipeline,\n letterboxToTensorData,\n resizeToTensorData,\n writePlanarFloat32,\n zeroTensorData,\n} from \"./preprocess/pipeline\";\n\nexport { type TopKResult, softmax, topK } from \"./postprocess/classification\";\n\nexport {\n type DecodeYoloAnchorsOptions,\n type DecodeYoloOptions,\n type DecodedAnchors,\n type DecodedDetection,\n batchedNms,\n decodeYolo,\n decodeYoloAnchors,\n nms,\n} from \"./postprocess/detection\";\n\nexport {\n type DecodeYoloSegOptions,\n type DecodedSegmentation,\n decodeYoloSeg,\n} from \"./postprocess/segmentation\";\n\nexport { VisionTask, requireDetections } from \"./tasks/base\";\nexport {\n type ClassifierOptions,\n type ClassifierPredictOptions,\n Classifier,\n} from \"./tasks/classifier\";\nexport {\n type DetectClassifyOptions,\n type DetectClassifyPredictOptions,\n DetectClassify,\n} from \"./tasks/detectClassify\";\nexport {\n type DetectorHead,\n type DetectorOptions,\n type DetectorPredictOptions,\n Detector,\n} from \"./tasks/detector\";\nexport {\n type SegmenterHead,\n type SegmenterOptions,\n type SegmenterPredictOptions,\n Segmenter,\n} from \"./tasks/segmenter\";\n\nexport const VERSION: string = \"0.11.0\";\n"],"mappings":"0wBAwLA,IAAa,EAAkB"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * `tempest-react-sdk/vision` — browser computer-vision inference with ONNX\n * Runtime Web (classification, detection, segmentation).\n *\n * Vendored from `@mauriciobenjamin700/ort-vision-sdk-web@0.12.0` (MIT, same\n * author) so it ships inside this SDK without an extra package install.\n * `onnxruntime-web` stays an optional peer dependency — install it (and ship\n * the matching `.wasm` files) only when you use this subpath.\n *\n * Do not hand-edit — regenerate with `npm run vendor:vision`.\n */\n\nexport {\n BoundingBox,\n Mask,\n RGBImage,\n type ClassProbability,\n type ClassificationResult,\n type DetectionResult,\n type SegmentationResult,\n} from \"./types\";\n\nexport {\n Boxes,\n ClassificationResults,\n DetectClassifyResults,\n DetectionResults,\n Masks,\n Probs,\n SegmentationResults,\n} from \"./results\";\n\nexport {\n COCO_CLASSES,\n type LabelSpec,\n type ResolveLabelsOptions,\n defaultLabels,\n resolveLabels,\n} from \"./labels\";\n\nexport {\n FusionError,\n ImageLoadError,\n InferenceError,\n LabelMapError,\n ModelLoadError,\n NoDetectionsError,\n OrtVisionError,\n ProviderNotAvailableError,\n} from \"./core/exceptions\";\n\nexport {\n DEFAULT_MODEL_CACHE,\n GRAPH_OPTIMIZATION_KEY,\n type ModelSource,\n type OrtSessionOptions,\n OrtSession,\n QUANTIZATION_KEY,\n} from \"./core/session\";\nexport {\n type DeclaredDim,\n type DeclaredShape,\n type ResolveInputSizeOptions,\n classificationNumClasses,\n declaredShapesFrom,\n detectionNumClasses,\n resolveInputSize,\n spatialInputSize,\n} from \"./core/graph\";\nexport {\n DEFAULT_TENSOR_TYPE,\n type Float16ArrayLike,\n asFloat32Array,\n hasFloat16Array,\n tensorTypeFor,\n} from \"./core/dtypes\";\nexport { modelNames, parseNames, readModelInputTypes, readModelMetadata } from \"./core/metadata\";\nexport {\n DEFAULT_PROVIDERS,\n type ProviderSpec,\n detectProviders,\n resolveProviders,\n} from \"./core/providers\";\nexport { type Speed, SpeedTimer } from \"./core/timing\";\nexport {\n CUSTOM_NORMALIZATION,\n IDENTITY_MEAN,\n IDENTITY_STD,\n IMAGENET_MEAN,\n IMAGENET_STD,\n type Normalization,\n type ResolvedNormalization,\n isUltralyticsClassifier,\n resolveNormalization,\n} from \"./normalization\";\n\nexport { type ImageInput, loadImage } from \"./io/image\";\n\nexport {\n FUSION_KIND_DETECT_CLASSIFY,\n FUSION_KIND_DETECT_SEGMENT_CLASSIFY,\n INPUT_IMAGE,\n INPUT_PAD,\n INPUT_SCALE,\n INPUT_SOURCE,\n METADATA_PREFIX,\n OUTPUT_BOXES,\n OUTPUT_CLASSES,\n OUTPUT_MASKS,\n OUTPUT_NUM_DETECTIONS,\n OUTPUT_PROBS,\n OUTPUT_SCORES,\n type CropSource,\n type FusionSpec,\n readFusionSpec,\n} from \"./fusion\";\n\nexport {\n type LetterboxResult,\n fromCv2,\n letterbox,\n normalize,\n resize,\n toCHW,\n toCv2,\n toFloat32,\n toFloat32Tensor,\n toTensor,\n} from \"./preprocess/image\";\n\nexport {\n type FusedLetterboxResult,\n type FusedResizeResult,\n LetterboxPipeline,\n ResizePipeline,\n letterboxToTensorData,\n resizeToTensorData,\n writePlanarFloat32,\n zeroTensorData,\n} from \"./preprocess/pipeline\";\n\nexport { type TopKResult, softmax, topK } from \"./postprocess/classification\";\n\nexport {\n type DecodeYoloAnchorsOptions,\n type DecodeYoloOptions,\n type DecodedAnchors,\n type DecodedDetection,\n batchedNms,\n decodeYolo,\n decodeYoloAnchors,\n nms,\n} from \"./postprocess/detection\";\n\nexport {\n type DecodeYoloSegOptions,\n type DecodedSegmentation,\n decodeYoloSeg,\n} from \"./postprocess/segmentation\";\n\nexport { VisionTask, requireDetections } from \"./tasks/base\";\nexport {\n type ClassifierOptions,\n type ClassifierPredictOptions,\n Classifier,\n} from \"./tasks/classifier\";\nexport {\n type DetectClassifyOptions,\n type DetectClassifyPredictOptions,\n DetectClassify,\n} from \"./tasks/detectClassify\";\nexport {\n type DetectorHead,\n type DetectorOptions,\n type DetectorPredictOptions,\n Detector,\n} from \"./tasks/detector\";\nexport {\n type SegmenterHead,\n type SegmenterOptions,\n type SegmenterPredictOptions,\n Segmenter,\n} from \"./tasks/segmenter\";\n\nexport const VERSION: string = \"0.12.0\";\n"],"mappings":"0wBAwLA,IAAa,EAAkB"}
@@ -22,7 +22,7 @@ import { DetectClassify as Fe } from "./tasks/detectClassify.js";
22
22
  import { Detector as Ie } from "./tasks/detector.js";
23
23
  import { Segmenter as Le } from "./tasks/segmenter.js";
24
24
  //#region src/vision/index.ts
25
- var Re = "0.11.0";
25
+ var Re = "0.12.0";
26
26
  //#endregion
27
27
  export { c as BoundingBox, f as Boxes, y as COCO_CLASSES, H as CUSTOM_NORMALIZATION, p as ClassificationResults, Pe as Classifier, R as DEFAULT_MODEL_CACHE, F as DEFAULT_PROVIDERS, S as DEFAULT_TENSOR_TYPE, Fe as DetectClassify, m as DetectClassifyResults, h as DetectionResults, Ie as Detector, X as FUSION_KIND_DETECT_CLASSIFY, Z as FUSION_KIND_DETECT_SEGMENT_CLASSIFY, e as FusionError, z as GRAPH_OPTIMIZATION_KEY, U as IDENTITY_MEAN, W as IDENTITY_STD, G as IMAGENET_MEAN, K as IMAGENET_STD, Q as INPUT_IMAGE, $ as INPUT_PAD, ee as INPUT_SCALE, te as INPUT_SOURCE, t as ImageLoadError, n as InferenceError, r as LabelMapError, ye as LetterboxPipeline, ne as METADATA_PREFIX, l as Mask, g as Masks, i as ModelLoadError, a as NoDetectionsError, re as OUTPUT_BOXES, ie as OUTPUT_CLASSES, ae as OUTPUT_MASKS, oe as OUTPUT_NUM_DETECTIONS, se as OUTPUT_PROBS, ce as OUTPUT_SCORES, B as OrtSession, o as OrtVisionError, _ as Probs, s as ProviderNotAvailableError, V as QUANTIZATION_KEY, u as RGBImage, be as ResizePipeline, v as SegmentationResults, Le as Segmenter, d as SpeedTimer, Re as VERSION, Me as VisionTask, C as asFloat32Array, De as batchedNms, E as classificationNumClasses, D as declaredShapesFrom, Oe as decodeYolo, ke as decodeYoloAnchors, je as decodeYoloSeg, b as defaultLabels, I as detectProviders, O as detectionNumClasses, ue as fromCv2, w as hasFloat16Array, q as isUltralyticsClassifier, de as letterbox, xe as letterboxToTensorData, Y as loadImage, j as modelNames, Ae as nms, fe as normalize, M as parseNames, le as readFusionSpec, N as readModelInputTypes, P as readModelMetadata, Ne as requireDetections, pe as resize, Se as resizeToTensorData, k as resolveInputSize, x as resolveLabels, J as resolveNormalization, L as resolveProviders, Te as softmax, A as spatialInputSize, T as tensorTypeFor, me as toCHW, he as toCv2, ge as toFloat32, _e as toFloat32Tensor, ve as toTensor, Ee as topK, Ce as writePlanarFloat32, we as zeroTensorData };
28
28
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * `tempest-react-sdk/vision` — browser computer-vision inference with ONNX\n * Runtime Web (classification, detection, segmentation).\n *\n * Vendored from `@mauriciobenjamin700/ort-vision-sdk-web@0.11.0` (MIT, same\n * author) so it ships inside this SDK without an extra package install.\n * `onnxruntime-web` stays an optional peer dependency — install it (and ship\n * the matching `.wasm` files) only when you use this subpath.\n *\n * Do not hand-edit — regenerate with `npm run vendor:vision`.\n */\n\nexport {\n BoundingBox,\n Mask,\n RGBImage,\n type ClassProbability,\n type ClassificationResult,\n type DetectionResult,\n type SegmentationResult,\n} from \"./types\";\n\nexport {\n Boxes,\n ClassificationResults,\n DetectClassifyResults,\n DetectionResults,\n Masks,\n Probs,\n SegmentationResults,\n} from \"./results\";\n\nexport {\n COCO_CLASSES,\n type LabelSpec,\n type ResolveLabelsOptions,\n defaultLabels,\n resolveLabels,\n} from \"./labels\";\n\nexport {\n FusionError,\n ImageLoadError,\n InferenceError,\n LabelMapError,\n ModelLoadError,\n NoDetectionsError,\n OrtVisionError,\n ProviderNotAvailableError,\n} from \"./core/exceptions\";\n\nexport {\n DEFAULT_MODEL_CACHE,\n GRAPH_OPTIMIZATION_KEY,\n type ModelSource,\n type OrtSessionOptions,\n OrtSession,\n QUANTIZATION_KEY,\n} from \"./core/session\";\nexport {\n type DeclaredDim,\n type DeclaredShape,\n type ResolveInputSizeOptions,\n classificationNumClasses,\n declaredShapesFrom,\n detectionNumClasses,\n resolveInputSize,\n spatialInputSize,\n} from \"./core/graph\";\nexport {\n DEFAULT_TENSOR_TYPE,\n type Float16ArrayLike,\n asFloat32Array,\n hasFloat16Array,\n tensorTypeFor,\n} from \"./core/dtypes\";\nexport { modelNames, parseNames, readModelInputTypes, readModelMetadata } from \"./core/metadata\";\nexport {\n DEFAULT_PROVIDERS,\n type ProviderSpec,\n detectProviders,\n resolveProviders,\n} from \"./core/providers\";\nexport { type Speed, SpeedTimer } from \"./core/timing\";\nexport {\n CUSTOM_NORMALIZATION,\n IDENTITY_MEAN,\n IDENTITY_STD,\n IMAGENET_MEAN,\n IMAGENET_STD,\n type Normalization,\n type ResolvedNormalization,\n isUltralyticsClassifier,\n resolveNormalization,\n} from \"./normalization\";\n\nexport { type ImageInput, loadImage } from \"./io/image\";\n\nexport {\n FUSION_KIND_DETECT_CLASSIFY,\n FUSION_KIND_DETECT_SEGMENT_CLASSIFY,\n INPUT_IMAGE,\n INPUT_PAD,\n INPUT_SCALE,\n INPUT_SOURCE,\n METADATA_PREFIX,\n OUTPUT_BOXES,\n OUTPUT_CLASSES,\n OUTPUT_MASKS,\n OUTPUT_NUM_DETECTIONS,\n OUTPUT_PROBS,\n OUTPUT_SCORES,\n type CropSource,\n type FusionSpec,\n readFusionSpec,\n} from \"./fusion\";\n\nexport {\n type LetterboxResult,\n fromCv2,\n letterbox,\n normalize,\n resize,\n toCHW,\n toCv2,\n toFloat32,\n toFloat32Tensor,\n toTensor,\n} from \"./preprocess/image\";\n\nexport {\n type FusedLetterboxResult,\n type FusedResizeResult,\n LetterboxPipeline,\n ResizePipeline,\n letterboxToTensorData,\n resizeToTensorData,\n writePlanarFloat32,\n zeroTensorData,\n} from \"./preprocess/pipeline\";\n\nexport { type TopKResult, softmax, topK } from \"./postprocess/classification\";\n\nexport {\n type DecodeYoloAnchorsOptions,\n type DecodeYoloOptions,\n type DecodedAnchors,\n type DecodedDetection,\n batchedNms,\n decodeYolo,\n decodeYoloAnchors,\n nms,\n} from \"./postprocess/detection\";\n\nexport {\n type DecodeYoloSegOptions,\n type DecodedSegmentation,\n decodeYoloSeg,\n} from \"./postprocess/segmentation\";\n\nexport { VisionTask, requireDetections } from \"./tasks/base\";\nexport {\n type ClassifierOptions,\n type ClassifierPredictOptions,\n Classifier,\n} from \"./tasks/classifier\";\nexport {\n type DetectClassifyOptions,\n type DetectClassifyPredictOptions,\n DetectClassify,\n} from \"./tasks/detectClassify\";\nexport {\n type DetectorHead,\n type DetectorOptions,\n type DetectorPredictOptions,\n Detector,\n} from \"./tasks/detector\";\nexport {\n type SegmenterHead,\n type SegmenterOptions,\n type SegmenterPredictOptions,\n Segmenter,\n} from \"./tasks/segmenter\";\n\nexport const VERSION: string = \"0.11.0\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwLA,IAAa,KAAkB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/vision/index.ts"],"sourcesContent":["/**\n * `tempest-react-sdk/vision` — browser computer-vision inference with ONNX\n * Runtime Web (classification, detection, segmentation).\n *\n * Vendored from `@mauriciobenjamin700/ort-vision-sdk-web@0.12.0` (MIT, same\n * author) so it ships inside this SDK without an extra package install.\n * `onnxruntime-web` stays an optional peer dependency — install it (and ship\n * the matching `.wasm` files) only when you use this subpath.\n *\n * Do not hand-edit — regenerate with `npm run vendor:vision`.\n */\n\nexport {\n BoundingBox,\n Mask,\n RGBImage,\n type ClassProbability,\n type ClassificationResult,\n type DetectionResult,\n type SegmentationResult,\n} from \"./types\";\n\nexport {\n Boxes,\n ClassificationResults,\n DetectClassifyResults,\n DetectionResults,\n Masks,\n Probs,\n SegmentationResults,\n} from \"./results\";\n\nexport {\n COCO_CLASSES,\n type LabelSpec,\n type ResolveLabelsOptions,\n defaultLabels,\n resolveLabels,\n} from \"./labels\";\n\nexport {\n FusionError,\n ImageLoadError,\n InferenceError,\n LabelMapError,\n ModelLoadError,\n NoDetectionsError,\n OrtVisionError,\n ProviderNotAvailableError,\n} from \"./core/exceptions\";\n\nexport {\n DEFAULT_MODEL_CACHE,\n GRAPH_OPTIMIZATION_KEY,\n type ModelSource,\n type OrtSessionOptions,\n OrtSession,\n QUANTIZATION_KEY,\n} from \"./core/session\";\nexport {\n type DeclaredDim,\n type DeclaredShape,\n type ResolveInputSizeOptions,\n classificationNumClasses,\n declaredShapesFrom,\n detectionNumClasses,\n resolveInputSize,\n spatialInputSize,\n} from \"./core/graph\";\nexport {\n DEFAULT_TENSOR_TYPE,\n type Float16ArrayLike,\n asFloat32Array,\n hasFloat16Array,\n tensorTypeFor,\n} from \"./core/dtypes\";\nexport { modelNames, parseNames, readModelInputTypes, readModelMetadata } from \"./core/metadata\";\nexport {\n DEFAULT_PROVIDERS,\n type ProviderSpec,\n detectProviders,\n resolveProviders,\n} from \"./core/providers\";\nexport { type Speed, SpeedTimer } from \"./core/timing\";\nexport {\n CUSTOM_NORMALIZATION,\n IDENTITY_MEAN,\n IDENTITY_STD,\n IMAGENET_MEAN,\n IMAGENET_STD,\n type Normalization,\n type ResolvedNormalization,\n isUltralyticsClassifier,\n resolveNormalization,\n} from \"./normalization\";\n\nexport { type ImageInput, loadImage } from \"./io/image\";\n\nexport {\n FUSION_KIND_DETECT_CLASSIFY,\n FUSION_KIND_DETECT_SEGMENT_CLASSIFY,\n INPUT_IMAGE,\n INPUT_PAD,\n INPUT_SCALE,\n INPUT_SOURCE,\n METADATA_PREFIX,\n OUTPUT_BOXES,\n OUTPUT_CLASSES,\n OUTPUT_MASKS,\n OUTPUT_NUM_DETECTIONS,\n OUTPUT_PROBS,\n OUTPUT_SCORES,\n type CropSource,\n type FusionSpec,\n readFusionSpec,\n} from \"./fusion\";\n\nexport {\n type LetterboxResult,\n fromCv2,\n letterbox,\n normalize,\n resize,\n toCHW,\n toCv2,\n toFloat32,\n toFloat32Tensor,\n toTensor,\n} from \"./preprocess/image\";\n\nexport {\n type FusedLetterboxResult,\n type FusedResizeResult,\n LetterboxPipeline,\n ResizePipeline,\n letterboxToTensorData,\n resizeToTensorData,\n writePlanarFloat32,\n zeroTensorData,\n} from \"./preprocess/pipeline\";\n\nexport { type TopKResult, softmax, topK } from \"./postprocess/classification\";\n\nexport {\n type DecodeYoloAnchorsOptions,\n type DecodeYoloOptions,\n type DecodedAnchors,\n type DecodedDetection,\n batchedNms,\n decodeYolo,\n decodeYoloAnchors,\n nms,\n} from \"./postprocess/detection\";\n\nexport {\n type DecodeYoloSegOptions,\n type DecodedSegmentation,\n decodeYoloSeg,\n} from \"./postprocess/segmentation\";\n\nexport { VisionTask, requireDetections } from \"./tasks/base\";\nexport {\n type ClassifierOptions,\n type ClassifierPredictOptions,\n Classifier,\n} from \"./tasks/classifier\";\nexport {\n type DetectClassifyOptions,\n type DetectClassifyPredictOptions,\n DetectClassify,\n} from \"./tasks/detectClassify\";\nexport {\n type DetectorHead,\n type DetectorOptions,\n type DetectorPredictOptions,\n Detector,\n} from \"./tasks/detector\";\nexport {\n type SegmenterHead,\n type SegmenterOptions,\n type SegmenterPredictOptions,\n Segmenter,\n} from \"./tasks/segmenter\";\n\nexport const VERSION: string = \"0.12.0\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwLA,IAAa,KAAkB"}
package/dist/vision.d.ts CHANGED
@@ -441,7 +441,8 @@ export declare type DeclaredShape = readonly DeclaredDim[];
441
441
  * Convert ORT value metadata into declared shapes.
442
442
  *
443
443
  * @param metadata Metadata as reported by `InferenceSession.inputMetadata`, or
444
- * `undefined` on ORT builds that predate it (added in onnxruntime 1.21).
444
+ * `undefined` on ORT builds that predate it (`onnxruntime-web` < 1.22,
445
+ * measured). The session then falls back to the shapes in the model file.
445
446
  * @returns One shape per value, in declaration order. Non-tensor values and
446
447
  * builds without metadata yield empty shapes, which read as "nothing
447
448
  * declared" everywhere downstream.
@@ -1677,6 +1678,14 @@ export declare const DEFAULT_TENSOR_TYPE = "float32";
1677
1678
  * feed is built as float32, the behaviour before this existed.
1678
1679
  */
1679
1680
  private readonly _inputTypes;
1681
+ /**
1682
+ * Shapes the model file declares, keyed by value name.
1683
+ *
1684
+ * The fallback for {@link inputShapes} and {@link outputShapes} when the
1685
+ * runtime reports none, which `onnxruntime-web` does below 1.22. Empty when
1686
+ * the bytes were never in hand (a URL loaded with `readMetadata: false`).
1687
+ */
1688
+ private readonly _fileShapes;
1680
1689
  private constructor();
1681
1690
  /**
1682
1691
  * Tail of the run queue: settles when the latest queued run has finished.
@@ -1735,9 +1744,10 @@ export declare const DEFAULT_TENSOR_TYPE = "float32";
1735
1744
  /**
1736
1745
  * Shapes the graph declares for its inputs, in declaration order.
1737
1746
  *
1738
- * Dynamic (symbolic) axes appear as `null`. Empty shapes mean the runtime
1739
- * reported no metadata — either a non-tensor input, or an `onnxruntime-web`
1740
- * older than 1.21, which predates input metadata.
1747
+ * Dynamic (symbolic) axes appear as `null`. Read from the runtime when it
1748
+ * reports them (`onnxruntime-web` >= 1.22), otherwise from the model file. An
1749
+ * empty shape means neither source declared one: a non-tensor input, or a URL
1750
+ * model loaded with `readMetadata: false` on a runtime that reports nothing.
1741
1751
  */
1742
1752
  get inputShapes(): readonly DeclaredShape[];
1743
1753
  /**
@@ -1750,9 +1760,19 @@ export declare const DEFAULT_TENSOR_TYPE = "float32";
1750
1760
  * Shapes the graph declares for its outputs, in declaration order.
1751
1761
  *
1752
1762
  * Dynamic (symbolic) axes appear as `null`. Reading them is how a task can
1753
- * tell how many classes a head emits without being told.
1763
+ * tell how many classes a head emits without being told. Same sources as
1764
+ * {@link inputShapes}.
1754
1765
  */
1755
1766
  get outputShapes(): readonly DeclaredShape[];
1767
+ /**
1768
+ * Pick the runtime's declared shapes, or the file's when the runtime has none.
1769
+ *
1770
+ * @param metadata What the runtime reports, `undefined` below 1.22.
1771
+ * @param names The session's value names, in its own order.
1772
+ * @param fromFile Shapes the model file declares, keyed by name.
1773
+ * @returns One shape per name, in the session's order.
1774
+ */
1775
+ private _shapesOf;
1756
1776
  /**
1757
1777
  * Shape the graph declares for its first output, dynamic axes as `null`.
1758
1778
  *
@@ -2045,22 +2065,6 @@ export declare const DEFAULT_TENSOR_TYPE = "float32";
2045
2065
  */
2046
2066
  export declare function readModelInputTypes(model: Uint8Array | ArrayBufferLike): Readonly<Record<string, number>>;
2047
2067
 
2048
- /** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */
2049
- /**
2050
- * Read the metadata an exporter baked into a `.onnx` file.
2051
- *
2052
- * `onnxruntime-web` exposes input/output metadata but **not** the model's
2053
- * custom metadata map, which is where Ultralytics writes `names`, `task` and
2054
- * `imgsz`. The Python SDK gets it for free from
2055
- * `InferenceSession.get_modelmeta().custom_metadata_map`; in the browser the
2056
- * only way to the same information is to read it out of the file, so this
2057
- * module walks just enough of the ModelProto wire format to collect
2058
- * `metadata_props`.
2059
- *
2060
- * It never throws and never allocates unbounded: a truncated, hostile or
2061
- * simply unexpected file yields an empty map, and every caller treats that as
2062
- * "the model says nothing", falling back to what it was given.
2063
- */
2064
2068
  /**
2065
2069
  * Collect a model's custom metadata map straight out of its bytes.
2066
2070
  *
@@ -1,2 +1,2 @@
1
- const e=require("../_virtual/_rolldown/runtime.cjs"),t=require("./tempest-icons.cjs"),n=require("./tempest-vitest.cjs");let r=require("node:path"),i=require("vite"),a=require("@vitejs/plugin-react");a=e.__toESM(a,1);function o(e){let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`string`?{target:r,changeOrigin:!0}:r;return t}function s(e={}){let{srcDir:s=`src`,port:c=5173,host:l=`127.0.0.1`,open:u=!1,proxy:d,alias:f={},plugins:p=[],icons:m=!0,overrides:h={}}=e,g=h,_=m?[t.tempestIcons({dir:s,...typeof m==`object`?m:{}})]:[],v={plugins:[(0,a.default)(),..._,n.tempestVitest(),...p],resolve:{alias:{"@":(0,r.resolve)(process.cwd(),s),...f}},server:{port:c,host:l,open:u,...d?{proxy:o(d)}:{}}},y={...v,...g,plugins:[...v.plugins??[],...g.plugins??[]],resolve:{...v.resolve,...g.resolve},server:{...v.server,...g.server}};return(0,i.defineConfig)(y)}exports.createViteConfig=s;
1
+ const e=require("./tempest-icons.cjs"),t=require("./tempest-vitest.cjs");let n=require("node:path"),r=require("vite");function i(e){let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`string`?{target:r,changeOrigin:!0}:r;return t}function a(){return import(`@vitejs/plugin-react`).then(e=>e.default())}function o(o={}){let{srcDir:s=`src`,port:c=5173,host:l=`127.0.0.1`,open:u=!1,proxy:d,alias:f={},plugins:p=[],icons:m=!0,overrides:h={}}=o,g=h,_=m?[e.tempestIcons({dir:s,...typeof m==`object`?m:{}})]:[],v={plugins:[a(),..._,t.tempestVitest(),...p],resolve:{alias:{"@":(0,n.resolve)(process.cwd(),s),...f}},server:{port:c,host:l,open:u,...d?{proxy:i(d)}:{}}},y={...v,...g,plugins:[...v.plugins??[],...g.plugins??[]],resolve:{...v.resolve,...g.resolve},server:{...v.server,...g.server}};return(0,r.defineConfig)(y)}exports.createViteConfig=o;
2
2
  //# sourceMappingURL=create-vite-config.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-vite-config.cjs","names":[],"sources":["../../src/vite/create-vite-config.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { defineConfig } from \"vite\";\nimport type { ProxyOptions, UserConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react\";\n\nimport { tempestIcons, type TempestIconsOptions } from \"./tempest-icons\";\nimport { tempestVitest } from \"./tempest-vitest\";\n\n/**\n * A Vite proxy entry: either a target URL string (expanded to\n * `{ target, changeOrigin: true }`) or a raw Vite `ProxyOptions` object.\n */\nexport type ProxyEntry = string | Record<string, unknown>;\n\nexport interface CreateViteConfigOptions {\n /**\n * Source directory aliased to `@`, relative to the project root.\n * Default: `\"src\"` (so `@/components/Button` → `<root>/src/components/Button`).\n */\n srcDir?: string;\n /** Dev server port. Default: `5173`. */\n port?: number;\n /** Dev server host. Default: `\"127.0.0.1\"`. */\n host?: string | boolean;\n /** Open the browser on `dev` start. Default: `false`. */\n open?: boolean;\n /**\n * Dev proxy table. String values are expanded to\n * `{ target, changeOrigin: true }`; objects are passed through untouched.\n *\n * @example { \"/api\": \"http://127.0.0.1:8000\" }\n */\n proxy?: Record<string, ProxyEntry>;\n /** Extra path aliases merged on top of the default `@` → src alias. */\n alias?: Record<string, string>;\n /** Vite plugins appended after `@vitejs/plugin-react`. */\n plugins?: unknown[];\n /**\n * The `tempestIcons()` plugin, which generates `virtual:tempest-icons` from the\n * icon slugs your source mentions. On by default — it only ever removes\n * requests. Pass `false` to leave it out, or an options object to configure the\n * scan.\n */\n icons?: boolean | TempestIconsOptions;\n /**\n * Arbitrary Vite config (a `UserConfig` object) deep-merged last, for\n * escape-hatch overrides (build target, define, extra `server` keys, …).\n */\n overrides?: Record<string, unknown>;\n}\n\n/**\n * The resulting Vite config object. Typed loosely so the SDK's published\n * declarations stay free of `vite`'s internal types; assign it straight to a\n * `vite.config.ts` default export.\n */\nexport type TempestViteConfig = Record<string, unknown>;\n\nfunction normalizeProxy(proxy: Record<string, ProxyEntry>): Record<string, ProxyOptions> {\n const out: Record<string, ProxyOptions> = {};\n for (const [path, value] of Object.entries(proxy)) {\n out[path] =\n typeof value === \"string\"\n ? { target: value, changeOrigin: true }\n : (value as ProxyOptions);\n }\n return out;\n}\n\n/**\n * Build a Tempest-flavored Vite config for a React app: the `@vitejs/plugin-react`\n * plugin, the `@` → `src` import alias, sane dev-server defaults and\n * {@link tempestVitest}, which lets a Vitest suite import the SDK — so a\n * consuming app's `vite.config.ts` is a single call instead of repeated\n * boilerplate. Everything is overridable.\n *\n * Import it from the dedicated Node entry point:\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({\n * proxy: { \"/api\": \"http://127.0.0.1:8000\" },\n * });\n */\nexport function createViteConfig(options: CreateViteConfigOptions = {}): TempestViteConfig {\n const {\n srcDir = \"src\",\n port = 5173,\n host = \"127.0.0.1\",\n open = false,\n proxy,\n alias = {},\n plugins = [],\n icons = true,\n overrides = {},\n } = options;\n\n const overridesConfig = overrides as UserConfig;\n const iconsPlugin = icons\n ? [tempestIcons({ dir: srcDir, ...(typeof icons === \"object\" ? icons : {}) })]\n : [];\n\n const base: UserConfig = {\n plugins: [react(), ...iconsPlugin, tempestVitest(), ...plugins] as UserConfig[\"plugins\"],\n resolve: {\n alias: {\n \"@\": resolve(process.cwd(), srcDir),\n ...alias,\n },\n },\n server: {\n port,\n host,\n open,\n ...(proxy ? { proxy: normalizeProxy(proxy) } : {}),\n },\n };\n\n const merged: UserConfig = {\n ...base,\n ...overridesConfig,\n plugins: [...(base.plugins ?? []), ...(overridesConfig.plugins ?? [])],\n resolve: { ...base.resolve, ...overridesConfig.resolve },\n server: { ...base.server, ...overridesConfig.server },\n };\n\n return defineConfig(merged) as TempestViteConfig;\n}\n"],"mappings":"wNA0DA,SAAS,EAAe,EAAiE,CACrF,IAAM,EAAoC,CAAC,EAC3C,IAAK,GAAM,CAAC,EAAM,KAAU,OAAO,QAAQ,CAAK,EAC5C,EAAI,GACA,OAAO,GAAU,SACX,CAAE,OAAQ,EAAO,aAAc,EAAK,EACnC,EAEf,OAAO,CACX,CAmBA,SAAgB,EAAiB,EAAmC,CAAC,EAAsB,CACvF,GAAM,CACF,SAAS,MACT,OAAO,KACP,OAAO,YACP,OAAO,GACP,QACA,QAAQ,CAAC,EACT,UAAU,CAAC,EACX,QAAQ,GACR,YAAY,CAAC,GACb,EAEE,EAAkB,EAClB,EAAc,EACd,CAAC,EAAA,aAAa,CAAE,IAAK,EAAQ,GAAI,OAAO,GAAU,SAAW,EAAQ,CAAC,CAAG,CAAC,CAAC,EAC3E,CAAC,EAED,EAAmB,CACrB,QAAS,EAAC,EAAA,EAAA,QAAA,CAAM,EAAG,GAAG,EAAa,EAAA,cAAc,EAAG,GAAG,CAAO,EAC9D,QAAS,CACL,MAAO,CACH,KAAA,EAAK,EAAA,QAAA,CAAQ,QAAQ,IAAI,EAAG,CAAM,EAClC,GAAG,CACP,CACJ,EACA,OAAQ,CACJ,OACA,OACA,OACA,GAAI,EAAQ,CAAE,MAAO,EAAe,CAAK,CAAE,EAAI,CAAC,CACpD,CACJ,EAEM,EAAqB,CACvB,GAAG,EACH,GAAG,EACH,QAAS,CAAC,GAAI,EAAK,SAAW,CAAC,EAAI,GAAI,EAAgB,SAAW,CAAC,CAAE,EACrE,QAAS,CAAE,GAAG,EAAK,QAAS,GAAG,EAAgB,OAAQ,EACvD,OAAQ,CAAE,GAAG,EAAK,OAAQ,GAAG,EAAgB,MAAO,CACxD,EAEA,OAAA,EAAO,EAAA,aAAA,CAAa,CAAM,CAC9B"}
1
+ {"version":3,"file":"create-vite-config.cjs","names":[],"sources":["../../src/vite/create-vite-config.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { defineConfig } from \"vite\";\nimport type { PluginOption, ProxyOptions, UserConfig } from \"vite\";\n\nimport { tempestIcons, type TempestIconsOptions } from \"./tempest-icons\";\nimport { tempestVitest } from \"./tempest-vitest\";\n\n/**\n * A Vite proxy entry: either a target URL string (expanded to\n * `{ target, changeOrigin: true }`) or a raw Vite `ProxyOptions` object.\n */\nexport type ProxyEntry = string | Record<string, unknown>;\n\nexport interface CreateViteConfigOptions {\n /**\n * Source directory aliased to `@`, relative to the project root.\n * Default: `\"src\"` (so `@/components/Button` → `<root>/src/components/Button`).\n */\n srcDir?: string;\n /** Dev server port. Default: `5173`. */\n port?: number;\n /** Dev server host. Default: `\"127.0.0.1\"`. */\n host?: string | boolean;\n /** Open the browser on `dev` start. Default: `false`. */\n open?: boolean;\n /**\n * Dev proxy table. String values are expanded to\n * `{ target, changeOrigin: true }`; objects are passed through untouched.\n *\n * @example { \"/api\": \"http://127.0.0.1:8000\" }\n */\n proxy?: Record<string, ProxyEntry>;\n /** Extra path aliases merged on top of the default `@` → src alias. */\n alias?: Record<string, string>;\n /** Vite plugins appended after `@vitejs/plugin-react`. */\n plugins?: unknown[];\n /**\n * The `tempestIcons()` plugin, which generates `virtual:tempest-icons` from the\n * icon slugs your source mentions. On by default — it only ever removes\n * requests. Pass `false` to leave it out, or an options object to configure the\n * scan.\n */\n icons?: boolean | TempestIconsOptions;\n /**\n * Arbitrary Vite config (a `UserConfig` object) deep-merged last, for\n * escape-hatch overrides (build target, define, extra `server` keys, …).\n */\n overrides?: Record<string, unknown>;\n}\n\n/**\n * The resulting Vite config object. Typed loosely so the SDK's published\n * declarations stay free of `vite`'s internal types; assign it straight to a\n * `vite.config.ts` default export.\n */\nexport type TempestViteConfig = Record<string, unknown>;\n\nfunction normalizeProxy(proxy: Record<string, ProxyEntry>): Record<string, ProxyOptions> {\n const out: Record<string, ProxyOptions> = {};\n for (const [path, value] of Object.entries(proxy)) {\n out[path] =\n typeof value === \"string\"\n ? { target: value, changeOrigin: true }\n : (value as ProxyOptions);\n }\n return out;\n}\n\n/**\n * Load `@vitejs/plugin-react` when a config is built, not when this module loads.\n *\n * The plugin is an optional peer, and every helper of `tempest-react-sdk/vite`\n * ships through one barrel. A top-level import made the whole barrel require it:\n * a project without the React plugin could not load a config importing only\n * `tempestVitest` or `tempestCsp` (`ERR_MODULE_NOT_FOUND`, #401). Vite resolves a\n * promise in `plugins` before using it, so {@link createViteConfig} stays\n * synchronous and only it needs the peer.\n *\n * @returns The React plugin, once its module has loaded.\n */\nfunction reactPlugin(): Promise<PluginOption> {\n return import(\"@vitejs/plugin-react\").then((module) => module.default());\n}\n\n/**\n * Build a Tempest-flavored Vite config for a React app: the `@vitejs/plugin-react`\n * plugin, the `@` → `src` import alias, sane dev-server defaults and\n * {@link tempestVitest}, which lets a Vitest suite import the SDK — so a\n * consuming app's `vite.config.ts` is a single call instead of repeated\n * boilerplate. Everything is overridable.\n *\n * Import it from the dedicated Node entry point:\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({\n * proxy: { \"/api\": \"http://127.0.0.1:8000\" },\n * });\n */\nexport function createViteConfig(options: CreateViteConfigOptions = {}): TempestViteConfig {\n const {\n srcDir = \"src\",\n port = 5173,\n host = \"127.0.0.1\",\n open = false,\n proxy,\n alias = {},\n plugins = [],\n icons = true,\n overrides = {},\n } = options;\n\n const overridesConfig = overrides as UserConfig;\n const iconsPlugin = icons\n ? [tempestIcons({ dir: srcDir, ...(typeof icons === \"object\" ? icons : {}) })]\n : [];\n\n const base: UserConfig = {\n plugins: [\n reactPlugin(),\n ...iconsPlugin,\n tempestVitest(),\n ...plugins,\n ] as UserConfig[\"plugins\"],\n resolve: {\n alias: {\n \"@\": resolve(process.cwd(), srcDir),\n ...alias,\n },\n },\n server: {\n port,\n host,\n open,\n ...(proxy ? { proxy: normalizeProxy(proxy) } : {}),\n },\n };\n\n const merged: UserConfig = {\n ...base,\n ...overridesConfig,\n plugins: [...(base.plugins ?? []), ...(overridesConfig.plugins ?? [])],\n resolve: { ...base.resolve, ...overridesConfig.resolve },\n server: { ...base.server, ...overridesConfig.server },\n };\n\n return defineConfig(merged) as TempestViteConfig;\n}\n"],"mappings":"sHAyDA,SAAS,EAAe,EAAiE,CACrF,IAAM,EAAoC,CAAC,EAC3C,IAAK,GAAM,CAAC,EAAM,KAAU,OAAO,QAAQ,CAAK,EAC5C,EAAI,GACA,OAAO,GAAU,SACX,CAAE,OAAQ,EAAO,aAAc,EAAK,EACnC,EAEf,OAAO,CACX,CAcA,SAAS,GAAqC,CAC1C,OAAO,OAAO,uBAAuB,CAAC,KAAM,GAAW,EAAO,QAAQ,CAAC,CAC3E,CAmBA,SAAgB,EAAiB,EAAmC,CAAC,EAAsB,CACvF,GAAM,CACF,SAAS,MACT,OAAO,KACP,OAAO,YACP,OAAO,GACP,QACA,QAAQ,CAAC,EACT,UAAU,CAAC,EACX,QAAQ,GACR,YAAY,CAAC,GACb,EAEE,EAAkB,EAClB,EAAc,EACd,CAAC,EAAA,aAAa,CAAE,IAAK,EAAQ,GAAI,OAAO,GAAU,SAAW,EAAQ,CAAC,CAAG,CAAC,CAAC,EAC3E,CAAC,EAED,EAAmB,CACrB,QAAS,CACL,EAAY,EACZ,GAAG,EACH,EAAA,cAAc,EACd,GAAG,CACP,EACA,QAAS,CACL,MAAO,CACH,KAAA,EAAK,EAAA,QAAA,CAAQ,QAAQ,IAAI,EAAG,CAAM,EAClC,GAAG,CACP,CACJ,EACA,OAAQ,CACJ,OACA,OACA,OACA,GAAI,EAAQ,CAAE,MAAO,EAAe,CAAK,CAAE,EAAI,CAAC,CACpD,CACJ,EAEM,EAAqB,CACvB,GAAG,EACH,GAAG,EACH,QAAS,CAAC,GAAI,EAAK,SAAW,CAAC,EAAI,GAAI,EAAgB,SAAW,CAAC,CAAE,EACrE,QAAS,CAAE,GAAG,EAAK,QAAS,GAAG,EAAgB,OAAQ,EACvD,OAAQ,CAAE,GAAG,EAAK,OAAQ,GAAG,EAAgB,MAAO,CACxD,EAEA,OAAA,EAAO,EAAA,aAAA,CAAa,CAAM,CAC9B"}
@@ -2,9 +2,8 @@ import { tempestIcons as e } from "./tempest-icons.js";
2
2
  import { tempestVitest as t } from "./tempest-vitest.js";
3
3
  import { resolve as n } from "node:path";
4
4
  import { defineConfig as r } from "vite";
5
- import i from "@vitejs/plugin-react";
6
5
  //#region src/vite/create-vite-config.ts
7
- function a(e) {
6
+ function i(e) {
8
7
  let t = {};
9
8
  for (let [n, r] of Object.entries(e)) t[n] = typeof r == "string" ? {
10
9
  target: r,
@@ -12,13 +11,16 @@ function a(e) {
12
11
  } : r;
13
12
  return t;
14
13
  }
14
+ function a() {
15
+ return import("@vitejs/plugin-react").then((e) => e.default());
16
+ }
15
17
  function o(o = {}) {
16
18
  let { srcDir: s = "src", port: c = 5173, host: l = "127.0.0.1", open: u = !1, proxy: d, alias: f = {}, plugins: p = [], icons: m = !0, overrides: h = {} } = o, g = h, _ = m ? [e({
17
19
  dir: s,
18
20
  ...typeof m == "object" ? m : {}
19
21
  })] : [], v = {
20
22
  plugins: [
21
- i(),
23
+ a(),
22
24
  ..._,
23
25
  t(),
24
26
  ...p
@@ -31,7 +33,7 @@ function o(o = {}) {
31
33
  port: c,
32
34
  host: l,
33
35
  open: u,
34
- ...d ? { proxy: a(d) } : {}
36
+ ...d ? { proxy: i(d) } : {}
35
37
  }
36
38
  }, y = {
37
39
  ...v,
@@ -1 +1 @@
1
- {"version":3,"file":"create-vite-config.js","names":[],"sources":["../../src/vite/create-vite-config.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { defineConfig } from \"vite\";\nimport type { ProxyOptions, UserConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react\";\n\nimport { tempestIcons, type TempestIconsOptions } from \"./tempest-icons\";\nimport { tempestVitest } from \"./tempest-vitest\";\n\n/**\n * A Vite proxy entry: either a target URL string (expanded to\n * `{ target, changeOrigin: true }`) or a raw Vite `ProxyOptions` object.\n */\nexport type ProxyEntry = string | Record<string, unknown>;\n\nexport interface CreateViteConfigOptions {\n /**\n * Source directory aliased to `@`, relative to the project root.\n * Default: `\"src\"` (so `@/components/Button` → `<root>/src/components/Button`).\n */\n srcDir?: string;\n /** Dev server port. Default: `5173`. */\n port?: number;\n /** Dev server host. Default: `\"127.0.0.1\"`. */\n host?: string | boolean;\n /** Open the browser on `dev` start. Default: `false`. */\n open?: boolean;\n /**\n * Dev proxy table. String values are expanded to\n * `{ target, changeOrigin: true }`; objects are passed through untouched.\n *\n * @example { \"/api\": \"http://127.0.0.1:8000\" }\n */\n proxy?: Record<string, ProxyEntry>;\n /** Extra path aliases merged on top of the default `@` → src alias. */\n alias?: Record<string, string>;\n /** Vite plugins appended after `@vitejs/plugin-react`. */\n plugins?: unknown[];\n /**\n * The `tempestIcons()` plugin, which generates `virtual:tempest-icons` from the\n * icon slugs your source mentions. On by default — it only ever removes\n * requests. Pass `false` to leave it out, or an options object to configure the\n * scan.\n */\n icons?: boolean | TempestIconsOptions;\n /**\n * Arbitrary Vite config (a `UserConfig` object) deep-merged last, for\n * escape-hatch overrides (build target, define, extra `server` keys, …).\n */\n overrides?: Record<string, unknown>;\n}\n\n/**\n * The resulting Vite config object. Typed loosely so the SDK's published\n * declarations stay free of `vite`'s internal types; assign it straight to a\n * `vite.config.ts` default export.\n */\nexport type TempestViteConfig = Record<string, unknown>;\n\nfunction normalizeProxy(proxy: Record<string, ProxyEntry>): Record<string, ProxyOptions> {\n const out: Record<string, ProxyOptions> = {};\n for (const [path, value] of Object.entries(proxy)) {\n out[path] =\n typeof value === \"string\"\n ? { target: value, changeOrigin: true }\n : (value as ProxyOptions);\n }\n return out;\n}\n\n/**\n * Build a Tempest-flavored Vite config for a React app: the `@vitejs/plugin-react`\n * plugin, the `@` → `src` import alias, sane dev-server defaults and\n * {@link tempestVitest}, which lets a Vitest suite import the SDK — so a\n * consuming app's `vite.config.ts` is a single call instead of repeated\n * boilerplate. Everything is overridable.\n *\n * Import it from the dedicated Node entry point:\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({\n * proxy: { \"/api\": \"http://127.0.0.1:8000\" },\n * });\n */\nexport function createViteConfig(options: CreateViteConfigOptions = {}): TempestViteConfig {\n const {\n srcDir = \"src\",\n port = 5173,\n host = \"127.0.0.1\",\n open = false,\n proxy,\n alias = {},\n plugins = [],\n icons = true,\n overrides = {},\n } = options;\n\n const overridesConfig = overrides as UserConfig;\n const iconsPlugin = icons\n ? [tempestIcons({ dir: srcDir, ...(typeof icons === \"object\" ? icons : {}) })]\n : [];\n\n const base: UserConfig = {\n plugins: [react(), ...iconsPlugin, tempestVitest(), ...plugins] as UserConfig[\"plugins\"],\n resolve: {\n alias: {\n \"@\": resolve(process.cwd(), srcDir),\n ...alias,\n },\n },\n server: {\n port,\n host,\n open,\n ...(proxy ? { proxy: normalizeProxy(proxy) } : {}),\n },\n };\n\n const merged: UserConfig = {\n ...base,\n ...overridesConfig,\n plugins: [...(base.plugins ?? []), ...(overridesConfig.plugins ?? [])],\n resolve: { ...base.resolve, ...overridesConfig.resolve },\n server: { ...base.server, ...overridesConfig.server },\n };\n\n return defineConfig(merged) as TempestViteConfig;\n}\n"],"mappings":";;;;;;AA0DA,SAAS,EAAe,GAAiE;CACrF,IAAM,IAAoC,CAAC;CAC3C,KAAK,IAAM,CAAC,GAAM,MAAU,OAAO,QAAQ,CAAK,GAC5C,EAAI,KACA,OAAO,KAAU,WACX;EAAE,QAAQ;EAAO,cAAc;CAAK,IACnC;CAEf,OAAO;AACX;AAmBA,SAAgB,EAAiB,IAAmC,CAAC,GAAsB;CACvF,IAAM,EACF,YAAS,OACT,UAAO,MACP,UAAO,aACP,UAAO,IACP,UACA,WAAQ,CAAC,GACT,aAAU,CAAC,GACX,WAAQ,IACR,eAAY,CAAC,MACb,GAEE,IAAkB,GAClB,IAAc,IACd,CAAC,EAAa;EAAE,KAAK;EAAQ,GAAI,OAAO,KAAU,WAAW,IAAQ,CAAC;CAAG,CAAC,CAAC,IAC3E,CAAC,GAED,IAAmB;EACrB,SAAS;GAAC,EAAM;GAAG,GAAG;GAAa,EAAc;GAAG,GAAG;EAAO;EAC9D,SAAS,EACL,OAAO;GACH,KAAK,EAAQ,QAAQ,IAAI,GAAG,CAAM;GAClC,GAAG;EACP,EACJ;EACA,QAAQ;GACJ;GACA;GACA;GACA,GAAI,IAAQ,EAAE,OAAO,EAAe,CAAK,EAAE,IAAI,CAAC;EACpD;CACJ,GAEM,IAAqB;EACvB,GAAG;EACH,GAAG;EACH,SAAS,CAAC,GAAI,EAAK,WAAW,CAAC,GAAI,GAAI,EAAgB,WAAW,CAAC,CAAE;EACrE,SAAS;GAAE,GAAG,EAAK;GAAS,GAAG,EAAgB;EAAQ;EACvD,QAAQ;GAAE,GAAG,EAAK;GAAQ,GAAG,EAAgB;EAAO;CACxD;CAEA,OAAO,EAAa,CAAM;AAC9B"}
1
+ {"version":3,"file":"create-vite-config.js","names":[],"sources":["../../src/vite/create-vite-config.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { defineConfig } from \"vite\";\nimport type { PluginOption, ProxyOptions, UserConfig } from \"vite\";\n\nimport { tempestIcons, type TempestIconsOptions } from \"./tempest-icons\";\nimport { tempestVitest } from \"./tempest-vitest\";\n\n/**\n * A Vite proxy entry: either a target URL string (expanded to\n * `{ target, changeOrigin: true }`) or a raw Vite `ProxyOptions` object.\n */\nexport type ProxyEntry = string | Record<string, unknown>;\n\nexport interface CreateViteConfigOptions {\n /**\n * Source directory aliased to `@`, relative to the project root.\n * Default: `\"src\"` (so `@/components/Button` → `<root>/src/components/Button`).\n */\n srcDir?: string;\n /** Dev server port. Default: `5173`. */\n port?: number;\n /** Dev server host. Default: `\"127.0.0.1\"`. */\n host?: string | boolean;\n /** Open the browser on `dev` start. Default: `false`. */\n open?: boolean;\n /**\n * Dev proxy table. String values are expanded to\n * `{ target, changeOrigin: true }`; objects are passed through untouched.\n *\n * @example { \"/api\": \"http://127.0.0.1:8000\" }\n */\n proxy?: Record<string, ProxyEntry>;\n /** Extra path aliases merged on top of the default `@` → src alias. */\n alias?: Record<string, string>;\n /** Vite plugins appended after `@vitejs/plugin-react`. */\n plugins?: unknown[];\n /**\n * The `tempestIcons()` plugin, which generates `virtual:tempest-icons` from the\n * icon slugs your source mentions. On by default — it only ever removes\n * requests. Pass `false` to leave it out, or an options object to configure the\n * scan.\n */\n icons?: boolean | TempestIconsOptions;\n /**\n * Arbitrary Vite config (a `UserConfig` object) deep-merged last, for\n * escape-hatch overrides (build target, define, extra `server` keys, …).\n */\n overrides?: Record<string, unknown>;\n}\n\n/**\n * The resulting Vite config object. Typed loosely so the SDK's published\n * declarations stay free of `vite`'s internal types; assign it straight to a\n * `vite.config.ts` default export.\n */\nexport type TempestViteConfig = Record<string, unknown>;\n\nfunction normalizeProxy(proxy: Record<string, ProxyEntry>): Record<string, ProxyOptions> {\n const out: Record<string, ProxyOptions> = {};\n for (const [path, value] of Object.entries(proxy)) {\n out[path] =\n typeof value === \"string\"\n ? { target: value, changeOrigin: true }\n : (value as ProxyOptions);\n }\n return out;\n}\n\n/**\n * Load `@vitejs/plugin-react` when a config is built, not when this module loads.\n *\n * The plugin is an optional peer, and every helper of `tempest-react-sdk/vite`\n * ships through one barrel. A top-level import made the whole barrel require it:\n * a project without the React plugin could not load a config importing only\n * `tempestVitest` or `tempestCsp` (`ERR_MODULE_NOT_FOUND`, #401). Vite resolves a\n * promise in `plugins` before using it, so {@link createViteConfig} stays\n * synchronous and only it needs the peer.\n *\n * @returns The React plugin, once its module has loaded.\n */\nfunction reactPlugin(): Promise<PluginOption> {\n return import(\"@vitejs/plugin-react\").then((module) => module.default());\n}\n\n/**\n * Build a Tempest-flavored Vite config for a React app: the `@vitejs/plugin-react`\n * plugin, the `@` → `src` import alias, sane dev-server defaults and\n * {@link tempestVitest}, which lets a Vitest suite import the SDK — so a\n * consuming app's `vite.config.ts` is a single call instead of repeated\n * boilerplate. Everything is overridable.\n *\n * Import it from the dedicated Node entry point:\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({\n * proxy: { \"/api\": \"http://127.0.0.1:8000\" },\n * });\n */\nexport function createViteConfig(options: CreateViteConfigOptions = {}): TempestViteConfig {\n const {\n srcDir = \"src\",\n port = 5173,\n host = \"127.0.0.1\",\n open = false,\n proxy,\n alias = {},\n plugins = [],\n icons = true,\n overrides = {},\n } = options;\n\n const overridesConfig = overrides as UserConfig;\n const iconsPlugin = icons\n ? [tempestIcons({ dir: srcDir, ...(typeof icons === \"object\" ? icons : {}) })]\n : [];\n\n const base: UserConfig = {\n plugins: [\n reactPlugin(),\n ...iconsPlugin,\n tempestVitest(),\n ...plugins,\n ] as UserConfig[\"plugins\"],\n resolve: {\n alias: {\n \"@\": resolve(process.cwd(), srcDir),\n ...alias,\n },\n },\n server: {\n port,\n host,\n open,\n ...(proxy ? { proxy: normalizeProxy(proxy) } : {}),\n },\n };\n\n const merged: UserConfig = {\n ...base,\n ...overridesConfig,\n plugins: [...(base.plugins ?? []), ...(overridesConfig.plugins ?? [])],\n resolve: { ...base.resolve, ...overridesConfig.resolve },\n server: { ...base.server, ...overridesConfig.server },\n };\n\n return defineConfig(merged) as TempestViteConfig;\n}\n"],"mappings":";;;;;AAyDA,SAAS,EAAe,GAAiE;CACrF,IAAM,IAAoC,CAAC;CAC3C,KAAK,IAAM,CAAC,GAAM,MAAU,OAAO,QAAQ,CAAK,GAC5C,EAAI,KACA,OAAO,KAAU,WACX;EAAE,QAAQ;EAAO,cAAc;CAAK,IACnC;CAEf,OAAO;AACX;AAcA,SAAS,IAAqC;CAC1C,OAAO,OAAO,uBAAuB,CAAC,MAAM,MAAW,EAAO,QAAQ,CAAC;AAC3E;AAmBA,SAAgB,EAAiB,IAAmC,CAAC,GAAsB;CACvF,IAAM,EACF,YAAS,OACT,UAAO,MACP,UAAO,aACP,UAAO,IACP,UACA,WAAQ,CAAC,GACT,aAAU,CAAC,GACX,WAAQ,IACR,eAAY,CAAC,MACb,GAEE,IAAkB,GAClB,IAAc,IACd,CAAC,EAAa;EAAE,KAAK;EAAQ,GAAI,OAAO,KAAU,WAAW,IAAQ,CAAC;CAAG,CAAC,CAAC,IAC3E,CAAC,GAED,IAAmB;EACrB,SAAS;GACL,EAAY;GACZ,GAAG;GACH,EAAc;GACd,GAAG;EACP;EACA,SAAS,EACL,OAAO;GACH,KAAK,EAAQ,QAAQ,IAAI,GAAG,CAAM;GAClC,GAAG;EACP,EACJ;EACA,QAAQ;GACJ;GACA;GACA;GACA,GAAI,IAAQ,EAAE,OAAO,EAAe,CAAK,EAAE,IAAI,CAAC;EACpD;CACJ,GAEM,IAAqB;EACvB,GAAG;EACH,GAAG;EACH,SAAS,CAAC,GAAI,EAAK,WAAW,CAAC,GAAI,GAAI,EAAgB,WAAW,CAAC,CAAE;EACrE,SAAS;GAAE,GAAG,EAAK;GAAS,GAAG,EAAgB;EAAQ;EACvD,QAAQ;GAAE,GAAG,EAAK;GAAQ,GAAG,EAAgB;EAAO;CACxD;CAEA,OAAO,EAAa,CAAM;AAC9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tempest-react-sdk",
3
- "version": "0.72.0",
3
+ "version": "0.74.0",
4
4
  "description": "SDK público da Tempest com componentes, hooks e integrações para projetos React.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -155,7 +155,7 @@
155
155
  "@tiptap/starter-kit": "^2.0.0 || ^3.0.0",
156
156
  "@vitejs/plugin-react": "^4.0.0 || ^5.0.0 || ^6.0.0",
157
157
  "leaflet": "^1.9.0",
158
- "onnxruntime-web": ">=1.17.0",
158
+ "onnxruntime-web": ">=1.22.0",
159
159
  "react": "^18.0.0 || ^19.0.0",
160
160
  "react-dom": "^18.0.0 || ^19.0.0",
161
161
  "react-router": "^7.0.0 || ^8.0.0",