@seed-ship/mcp-ui-solid 3.0.5 → 4.0.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 (126) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/README.md +253 -280
  3. package/dist/components/ChartJSRenderer.cjs +37 -15
  4. package/dist/components/ChartJSRenderer.cjs.map +1 -1
  5. package/dist/components/ChartJSRenderer.d.ts.map +1 -1
  6. package/dist/components/ChartJSRenderer.js +37 -15
  7. package/dist/components/ChartJSRenderer.js.map +1 -1
  8. package/dist/components/DataPreviewSection.cjs +172 -0
  9. package/dist/components/DataPreviewSection.cjs.map +1 -0
  10. package/dist/components/DataPreviewSection.d.ts +19 -0
  11. package/dist/components/DataPreviewSection.d.ts.map +1 -0
  12. package/dist/components/DataPreviewSection.js +172 -0
  13. package/dist/components/DataPreviewSection.js.map +1 -0
  14. package/dist/components/MapRenderer.cjs +168 -26
  15. package/dist/components/MapRenderer.cjs.map +1 -1
  16. package/dist/components/MapRenderer.d.ts +2 -2
  17. package/dist/components/MapRenderer.d.ts.map +1 -1
  18. package/dist/components/MapRenderer.js +169 -27
  19. package/dist/components/MapRenderer.js.map +1 -1
  20. package/dist/components/ScratchpadPanel.cjs +74 -0
  21. package/dist/components/ScratchpadPanel.cjs.map +1 -1
  22. package/dist/components/ScratchpadPanel.d.ts.map +1 -1
  23. package/dist/components/ScratchpadPanel.js +75 -1
  24. package/dist/components/ScratchpadPanel.js.map +1 -1
  25. package/dist/components/VerifiedText.cjs +166 -0
  26. package/dist/components/VerifiedText.cjs.map +1 -0
  27. package/dist/components/VerifiedText.d.ts +22 -0
  28. package/dist/components/VerifiedText.d.ts.map +1 -0
  29. package/dist/components/VerifiedText.js +166 -0
  30. package/dist/components/VerifiedText.js.map +1 -0
  31. package/dist/components/index.d.ts +4 -0
  32. package/dist/components/index.d.ts.map +1 -1
  33. package/dist/components.cjs +4 -0
  34. package/dist/components.cjs.map +1 -1
  35. package/dist/components.d.cts +4 -0
  36. package/dist/components.d.ts +4 -0
  37. package/dist/components.js +4 -0
  38. package/dist/components.js.map +1 -1
  39. package/dist/hooks/index.d.ts +2 -0
  40. package/dist/hooks/index.d.ts.map +1 -1
  41. package/dist/hooks/useDataValidator.cjs +31 -0
  42. package/dist/hooks/useDataValidator.cjs.map +1 -0
  43. package/dist/hooks/useDataValidator.d.ts +42 -0
  44. package/dist/hooks/useDataValidator.d.ts.map +1 -0
  45. package/dist/hooks/useDataValidator.js +31 -0
  46. package/dist/hooks/useDataValidator.js.map +1 -0
  47. package/dist/hooks.cjs +2 -0
  48. package/dist/hooks.cjs.map +1 -1
  49. package/dist/hooks.d.cts +2 -0
  50. package/dist/hooks.d.ts +2 -0
  51. package/dist/hooks.js +2 -0
  52. package/dist/hooks.js.map +1 -1
  53. package/dist/index.cjs +8 -0
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/index.d.cts +9 -5
  56. package/dist/index.d.ts +9 -5
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +8 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.cjs +290 -0
  61. package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.cjs.map +1 -0
  62. package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.js +291 -0
  63. package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.js.map +1 -0
  64. package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.cjs +243 -0
  65. package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.cjs.map +1 -0
  66. package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.js +243 -0
  67. package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.js.map +1 -0
  68. package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.cjs +137 -0
  69. package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.cjs.map +1 -0
  70. package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.js +137 -0
  71. package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.js.map +1 -0
  72. package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.cjs +686 -0
  73. package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.cjs.map +1 -0
  74. package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.js +687 -0
  75. package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.js.map +1 -0
  76. package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.cjs +1366 -0
  77. package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.cjs.map +1 -0
  78. package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.js +1366 -0
  79. package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.js.map +1 -0
  80. package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.cjs +54 -0
  81. package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.cjs.map +1 -0
  82. package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.js +55 -0
  83. package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.js.map +1 -0
  84. package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.cjs +1256 -0
  85. package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.cjs.map +1 -0
  86. package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.js +1256 -0
  87. package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.js.map +1 -0
  88. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.cjs +47 -0
  89. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.cjs.map +1 -0
  90. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js +48 -0
  91. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js.map +1 -0
  92. package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.cjs +378 -0
  93. package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.cjs.map +1 -0
  94. package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.js +379 -0
  95. package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.js.map +1 -0
  96. package/dist/services/data-validator.cjs +85 -0
  97. package/dist/services/data-validator.cjs.map +1 -0
  98. package/dist/services/data-validator.d.ts +28 -0
  99. package/dist/services/data-validator.d.ts.map +1 -0
  100. package/dist/services/data-validator.js +85 -0
  101. package/dist/services/data-validator.js.map +1 -0
  102. package/dist/services/index.d.ts +1 -0
  103. package/dist/services/index.d.ts.map +1 -1
  104. package/dist/types/chat-bus.d.ts +88 -1
  105. package/dist/types/chat-bus.d.ts.map +1 -1
  106. package/dist/types/index.d.ts +135 -6
  107. package/dist/types/index.d.ts.map +1 -1
  108. package/dist/types.d.cts +135 -6
  109. package/dist/types.d.ts +135 -6
  110. package/package.json +5 -1
  111. package/src/components/ChartJSRenderer.tsx +35 -13
  112. package/src/components/DataPreviewSection.tsx +206 -0
  113. package/src/components/MapRenderer.test.tsx +94 -5
  114. package/src/components/MapRenderer.tsx +246 -45
  115. package/src/components/ScratchpadPanel.tsx +10 -2
  116. package/src/components/VerifiedText.tsx +187 -0
  117. package/src/components/index.ts +7 -0
  118. package/src/hooks/index.ts +7 -0
  119. package/src/hooks/useDataValidator.ts +68 -0
  120. package/src/index.ts +26 -1
  121. package/src/services/data-validator.test.ts +151 -0
  122. package/src/services/data-validator.ts +149 -0
  123. package/src/services/index.ts +2 -0
  124. package/src/types/chat-bus.ts +98 -1
  125. package/src/types/index.ts +145 -6
  126. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,31 @@
1
+ import { createMemo } from "solid-js";
2
+ import { validateAgainstSource } from "../services/data-validator.js";
3
+ function useDataValidator(text, sourceRows, options = {}) {
4
+ const { enabled = true, ...validationOptions } = options;
5
+ const validation = createMemo(() => {
6
+ if (!enabled) return null;
7
+ const t = text();
8
+ const rows = sourceRows();
9
+ if (!t || !rows || rows.length === 0) return null;
10
+ return validateAgainstSource(t, rows, validationOptions);
11
+ });
12
+ return {
13
+ validation,
14
+ valid: () => {
15
+ var _a;
16
+ return ((_a = validation()) == null ? void 0 : _a.valid) ?? true;
17
+ },
18
+ confidence: () => {
19
+ var _a;
20
+ return ((_a = validation()) == null ? void 0 : _a.confidence) ?? 1;
21
+ },
22
+ hallucinatedCount: () => {
23
+ var _a;
24
+ return ((_a = validation()) == null ? void 0 : _a.hallucinated.length) ?? 0;
25
+ }
26
+ };
27
+ }
28
+ export {
29
+ useDataValidator
30
+ };
31
+ //# sourceMappingURL=useDataValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDataValidator.js","sources":["../../src/hooks/useDataValidator.ts"],"sourcesContent":["/**\n * useDataValidator — reactive SolidJS hook for data validation\n * v3.1.0: Wraps validateAgainstSource in a reactive memo\n *\n * @experimental\n */\n\nimport { createMemo } from 'solid-js'\nimport { validateAgainstSource } from '../services/data-validator'\nimport type { DataValidation, DataValidationOptions } from '../types/chat-bus'\n\nexport interface UseDataValidatorOptions extends DataValidationOptions {\n /** Disable validation (returns null) */\n enabled?: boolean\n}\n\nexport interface UseDataValidatorReturn {\n /** Reactive validation result (null if disabled or no text) */\n validation: () => DataValidation | null\n /** Is the text valid (no hallucinations)? */\n valid: () => boolean\n /** Confidence score 0-1 */\n confidence: () => number\n /** Count of hallucinated numbers */\n hallucinatedCount: () => number\n}\n\n/**\n * Reactive hook that validates LLM text against source data rows.\n * Re-validates automatically when text or rows change.\n *\n * @example\n * ```tsx\n * const { validation, valid, confidence } = useDataValidator(\n * () => llmResponse(),\n * () => sourceRows(),\n * { tolerance: 0.02, ignoreColumns: ['code_geo'] }\n * )\n *\n * return (\n * <Show when={!valid()}>\n * <span>⚠️ {validation()!.hallucinated.length} unverified numbers</span>\n * </Show>\n * )\n * ```\n */\nexport function useDataValidator(\n text: () => string,\n sourceRows: () => Record<string, unknown>[],\n options: UseDataValidatorOptions = {}\n): UseDataValidatorReturn {\n const { enabled = true, ...validationOptions } = options\n\n const validation = createMemo<DataValidation | null>(() => {\n if (!enabled) return null\n const t = text()\n const rows = sourceRows()\n if (!t || !rows || rows.length === 0) return null\n return validateAgainstSource(t, rows, validationOptions)\n })\n\n return {\n validation,\n valid: () => validation()?.valid ?? true,\n confidence: () => validation()?.confidence ?? 1,\n hallucinatedCount: () => validation()?.hallucinated.length ?? 0,\n }\n}\n"],"names":[],"mappings":";;AA8CO,SAAS,iBACd,MACA,YACA,UAAmC,CAAA,GACX;AACxB,QAAM,EAAE,UAAU,MAAM,GAAG,sBAAsB;AAEjD,QAAM,aAAa,WAAkC,MAAM;AACzD,QAAI,CAAC,QAAS,QAAO;AACrB,UAAM,IAAI,KAAA;AACV,UAAM,OAAO,WAAA;AACb,QAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,WAAW,EAAG,QAAO;AAC7C,WAAO,sBAAsB,GAAG,MAAM,iBAAiB;AAAA,EACzD,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA,OAAO,MAAA;;AAAM,qCAAA,mBAAc,UAAS;AAAA;AAAA,IACpC,YAAY,MAAA;;AAAM,qCAAA,mBAAc,eAAc;AAAA;AAAA,IAC9C,mBAAmB,MAAA;;AAAM,qCAAA,mBAAc,aAAa,WAAU;AAAA;AAAA,EAAA;AAElE;"}
package/dist/hooks.cjs CHANGED
@@ -8,6 +8,7 @@ const useFormPersistence = require("./hooks/useFormPersistence.cjs");
8
8
  const useDragDrop = require("./hooks/useDragDrop.cjs");
9
9
  const useResize = require("./hooks/useResize.cjs");
10
10
  const useAutocomplete = require("./hooks/useAutocomplete.cjs");
11
+ const useDataValidator = require("./hooks/useDataValidator.cjs");
11
12
  exports.useStreamingUI = useStreamingUI.useStreamingUI;
12
13
  exports.useAction = useAction.useAction;
13
14
  exports.useToolAction = useAction.useToolAction;
@@ -19,4 +20,5 @@ exports.useFormPersistence = useFormPersistence.useFormPersistence;
19
20
  exports.useDragDrop = useDragDrop.useDragDrop;
20
21
  exports.useResize = useResize.useResize;
21
22
  exports.useAutocomplete = useAutocomplete.useAutocomplete;
23
+ exports.useDataValidator = useDataValidator.useDataValidator;
22
24
  //# sourceMappingURL=hooks.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"hooks.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/hooks.d.cts CHANGED
@@ -19,4 +19,6 @@ export { useResize } from './useResize';
19
19
  export type { UseResizeOptions, UseResizeReturn, ResizeEdge, ResizeHandleProps, } from './useResize';
20
20
  export { useAutocomplete } from './useAutocomplete';
21
21
  export type { UseAutocompleteOptions, UseAutocompleteReturn, } from './useAutocomplete';
22
+ export { useDataValidator } from './useDataValidator';
23
+ export type { UseDataValidatorOptions, UseDataValidatorReturn, } from './useDataValidator';
22
24
  //# sourceMappingURL=index.d.ts.map
package/dist/hooks.d.ts CHANGED
@@ -19,4 +19,6 @@ export { useResize } from './useResize';
19
19
  export type { UseResizeOptions, UseResizeReturn, ResizeEdge, ResizeHandleProps, } from './useResize';
20
20
  export { useAutocomplete } from './useAutocomplete';
21
21
  export type { UseAutocompleteOptions, UseAutocompleteReturn, } from './useAutocomplete';
22
+ export { useDataValidator } from './useDataValidator';
23
+ export type { UseDataValidatorOptions, UseDataValidatorReturn, } from './useDataValidator';
22
24
  //# sourceMappingURL=index.d.ts.map
package/dist/hooks.js CHANGED
@@ -6,12 +6,14 @@ import { useFormPersistence } from "./hooks/useFormPersistence.js";
6
6
  import { useDragDrop } from "./hooks/useDragDrop.js";
7
7
  import { useResize } from "./hooks/useResize.js";
8
8
  import { useAutocomplete } from "./hooks/useAutocomplete.js";
9
+ import { useDataValidator } from "./hooks/useDataValidator.js";
9
10
  export {
10
11
  evaluateCondition,
11
12
  useAction,
12
13
  useAutocomplete,
13
14
  useConditionalField,
14
15
  useConfirmModal,
16
+ useDataValidator,
15
17
  useDragDrop,
16
18
  useFormPersistence,
17
19
  useModal,
package/dist/hooks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
package/dist/index.cjs CHANGED
@@ -16,6 +16,8 @@ require("./components/ChartJSRenderer.cjs");
16
16
  require("./components/LightboxOverlay.cjs");
17
17
  require("./components/ImageGalleryRenderer.cjs");
18
18
  require("./components/CodeBlockRenderer.cjs");
19
+ const VerifiedText = require("./components/VerifiedText.cjs");
20
+ const DataPreviewSection = require("./components/DataPreviewSection.cjs");
19
21
  const DraggableGridItem = require("./components/DraggableGridItem.cjs");
20
22
  const ResizeHandle = require("./components/ResizeHandle.cjs");
21
23
  const EditableUIResourceRenderer = require("./components/EditableUIResourceRenderer.cjs");
@@ -36,6 +38,7 @@ const useFormPersistence = require("./hooks/useFormPersistence.cjs");
36
38
  const useDragDrop = require("./hooks/useDragDrop.cjs");
37
39
  const useResize = require("./hooks/useResize.cjs");
38
40
  const useAutocomplete = require("./hooks/useAutocomplete.cjs");
41
+ const useDataValidator = require("./hooks/useDataValidator.cjs");
39
42
  const MCPActionContext = require("./context/MCPActionContext.cjs");
40
43
  const AutocompleteContext = require("./context/AutocompleteContext.cjs");
41
44
  const groq = require("./plugins/groq.cjs");
@@ -44,9 +47,12 @@ const rest = require("./plugins/rest.cjs");
44
47
  const validation = require("./services/validation.cjs");
45
48
  const componentRegistry = require("./services/component-registry.cjs");
46
49
  const chatBus = require("./services/chat-bus.cjs");
50
+ const dataValidator = require("./services/data-validator.cjs");
47
51
  exports.UIResourceRenderer = UIResourceRenderer.UIResourceRenderer;
48
52
  exports.StreamingUIRenderer = StreamingUIRenderer.StreamingUIRenderer;
49
53
  exports.GenerativeUIErrorBoundary = GenerativeUIErrorBoundary.GenerativeUIErrorBoundary;
54
+ exports.VerifiedText = VerifiedText.VerifiedText;
55
+ exports.DataPreviewSection = DataPreviewSection.DataPreviewSection;
50
56
  exports.DraggableGridItem = DraggableGridItem.DraggableGridItem;
51
57
  exports.ResizeHandle = ResizeHandle.ResizeHandle;
52
58
  exports.EditableUIResourceRenderer = EditableUIResourceRenderer.EditableUIResourceRenderer;
@@ -73,6 +79,7 @@ exports.useFormPersistence = useFormPersistence.useFormPersistence;
73
79
  exports.useDragDrop = useDragDrop.useDragDrop;
74
80
  exports.useResize = useResize.useResize;
75
81
  exports.useAutocomplete = useAutocomplete.useAutocomplete;
82
+ exports.useDataValidator = useDataValidator.useDataValidator;
76
83
  exports.MCPActionContext = MCPActionContext.MCPActionContext;
77
84
  exports.MCPActionProvider = MCPActionContext.MCPActionProvider;
78
85
  exports.useMCPAction = MCPActionContext.useMCPAction;
@@ -95,4 +102,5 @@ exports.createChatBus = chatBus.createChatBus;
95
102
  exports.createCommandHandler = chatBus.createCommandHandler;
96
103
  exports.createEventEmitter = chatBus.createEventEmitter;
97
104
  exports.mergeScratchpadSections = chatBus.mergeScratchpadSections;
105
+ exports.validateAgainstSource = dataValidator.validateAgainstSource;
98
106
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.cts CHANGED
@@ -37,6 +37,8 @@ export { ChatBusProvider, useChatBus } from './hooks/useChatBus';
37
37
  export { ChatPrompt } from './components/ChatPrompt';
38
38
  export { ScratchpadPanel } from './components/ScratchpadPanel';
39
39
  export { dispatchScratchpad, useScratchpadState } from './stores/scratchpad-store';
40
+ export { VerifiedText } from './components/VerifiedText';
41
+ export { DataPreviewSection } from './components/DataPreviewSection';
40
42
  export { GhostText, GhostTextInput } from './components/GhostText';
41
43
  export { AutocompleteDropdown } from './components/AutocompleteDropdown';
42
44
  export { AutocompleteFormField } from './components/AutocompleteFormField';
@@ -48,17 +50,19 @@ export type { ExpandableWrapperProps } from './components/ExpandableWrapper';
48
50
  export type { ComponentToolbarProps, ToolbarAction, ToolbarIcon } from './components/ComponentToolbar';
49
51
  export type { ChatPromptProps } from './components/ChatPrompt';
50
52
  export type { ScratchpadPanelProps } from './components/ScratchpadPanel';
53
+ export type { VerifiedTextProps } from './components/VerifiedText';
54
+ export type { DataPreviewSectionProps } from './components/DataPreviewSection';
51
55
  export type { GhostTextProps, GhostTextInputProps } from './components/GhostText';
52
56
  export type { AutocompleteDropdownProps } from './components/AutocompleteDropdown';
53
57
  export type { AutocompleteFormFieldProps, AutocompleteFormFieldParams } from './components/AutocompleteFormField';
54
- export { useStreamingUI, useAction, useToolAction, useConditionalField, evaluateCondition, useModal, useConfirmModal, useFormPersistence, useDragDrop, useResize, useAutocomplete, } from './hooks';
55
- export type { UseStreamingUIOptions, StreamingUIState, StreamProgress, StreamError, CompleteMetadata, UseActionReturn, UseActionOptions, UseToolActionReturn, UseConditionalFieldOptions, UseModalReturn, UseConfirmModalReturn, UseFormPersistenceOptions, UseFormPersistenceReturn, UseDragDropOptions, UseDragDropReturn, DragProps, UseResizeOptions, UseResizeReturn, ResizeEdge, UseAutocompleteOptions, UseAutocompleteReturn, } from './hooks';
58
+ export { useStreamingUI, useAction, useToolAction, useConditionalField, evaluateCondition, useModal, useConfirmModal, useFormPersistence, useDragDrop, useResize, useAutocomplete, useDataValidator, } from './hooks';
59
+ export type { UseStreamingUIOptions, StreamingUIState, StreamProgress, StreamError, CompleteMetadata, UseActionReturn, UseActionOptions, UseToolActionReturn, UseConditionalFieldOptions, UseModalReturn, UseConfirmModalReturn, UseFormPersistenceOptions, UseFormPersistenceReturn, UseDragDropOptions, UseDragDropReturn, DragProps, UseResizeOptions, UseResizeReturn, ResizeEdge, UseAutocompleteOptions, UseAutocompleteReturn, UseDataValidatorOptions, UseDataValidatorReturn, } from './hooks';
56
60
  export { MCPActionProvider, MCPActionContext, useMCPAction, useMCPActionSafe } from './context';
57
61
  export { AutocompleteProvider, useAutocompleteContext, useAutocompleteContextSafe, } from './context/AutocompleteContext';
58
62
  export type { MCPActionContextValue, MCPActionProviderProps, ActionRequest, ActionResult, } from './context';
59
63
  export type { AutocompleteContextValue, AutocompleteProviderProps, } from './context/AutocompleteContext';
60
64
  export { createGroqPlugin, createSupabasePlugin, createRestPlugin, } from './plugins';
61
- export type { UIComponent, UILayout, GridPosition, ComponentType, RendererError, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ActionComponentParams, GridComponentParams, FormFieldOption, FormFieldType, FormFieldParams, FormComponentParams, ShowWhenOperator, ShowWhenCondition, ActionRequestBase, ActionResultBase, ActionLifecycleCallbacks, ModalSize, ModalComponentParams, ActionGroupLayout, ActionGroupGap, ActionGroupParams, GalleryImage, ImageGalleryParams, VideoComponentParams, CodeComponentParams, MapMarker, MapComponentParams, IframePolicy, ValidationOptions, ResizeConstraints, DragDropConfig, DragEventData, DraggableGridItemProps as DraggableGridItemPropsType, AutocompleteResultType, AutocompleteOption, AutocompleteResult, AutocompleteContext, AutocompletePlugin, GroqPluginConfig, SupabasePluginConfig, DuckDBPluginConfig, RestPluginConfig, FieldAutocompleteConfig, AutocompleteProviderConfig, } from './types';
62
- export { validateComponent, validateLayout, validateIframeDomain, getIframeSandbox, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, TRUSTED_IFRAME_DOMAINS, ComponentRegistry, createEventEmitter, createCommandHandler, createChatBus, mergeScratchpadSections, } from './services';
63
- export type { ChatEventBase, ChatEvents, ChatCommands, ChatBus, ChatEventEmitter, ChatCommandHandler, EventSubscribeOptions, ChatPromptConfig, ChatPromptResponse, ChoicePromptConfig, ConfirmPromptConfig, FormPromptConfig, SelectPromptConfig, SuggestionItem, AgentContext, BriefingEvent, BriefingSection, ScratchpadState, ScratchpadSection, ScratchpadEvent, StreamDoneMetadata, ChatError, Citation, ToolCallEvent, ClarificationEvent, } from './types/chat-bus';
65
+ export type { UIComponent, UILayout, GridPosition, ComponentType, RendererError, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ActionComponentParams, GridComponentParams, FormFieldOption, FormFieldType, FormFieldParams, FormComponentParams, ShowWhenOperator, ShowWhenCondition, ActionRequestBase, ActionResultBase, ActionLifecycleCallbacks, ModalSize, ModalComponentParams, ActionGroupLayout, ActionGroupGap, ActionGroupParams, GalleryImage, ImageGalleryParams, VideoComponentParams, CodeComponentParams, MapMarker, MapComponentParams, MapPopupConfig, MapGeoJSONStyle, MapLayer, MapPMTilesConfig, IframePolicy, ValidationOptions, ResizeConstraints, DragDropConfig, DragEventData, DraggableGridItemProps as DraggableGridItemPropsType, AutocompleteResultType, AutocompleteOption, AutocompleteResult, AutocompleteContext, AutocompletePlugin, GroqPluginConfig, SupabasePluginConfig, DuckDBPluginConfig, RestPluginConfig, FieldAutocompleteConfig, AutocompleteProviderConfig, } from './types';
66
+ export { validateComponent, validateLayout, validateIframeDomain, getIframeSandbox, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, TRUSTED_IFRAME_DOMAINS, ComponentRegistry, createEventEmitter, createCommandHandler, createChatBus, mergeScratchpadSections, validateAgainstSource, } from './services';
67
+ export type { ChatEventBase, ChatEvents, ChatCommands, ChatBus, ChatEventEmitter, ChatCommandHandler, EventSubscribeOptions, ChatPromptConfig, ChatPromptResponse, ChoicePromptConfig, ConfirmPromptConfig, FormPromptConfig, SelectPromptConfig, SuggestionItem, AgentContext, BriefingEvent, BriefingSection, ScratchpadState, ScratchpadSection, ScratchpadEvent, StreamDoneMetadata, ChatError, Citation, ToolCallEvent, ClarificationEvent, DataValidation, LLMNumber, HallucinatedNumber, DataValidationOptions, VerifiedTextContent, DataPreviewColumn, DataPreviewContent, MapSectionContent, } from './types/chat-bus';
64
68
  //# sourceMappingURL=index.d.ts.map
package/dist/index.d.ts CHANGED
@@ -37,6 +37,8 @@ export { ChatBusProvider, useChatBus } from './hooks/useChatBus';
37
37
  export { ChatPrompt } from './components/ChatPrompt';
38
38
  export { ScratchpadPanel } from './components/ScratchpadPanel';
39
39
  export { dispatchScratchpad, useScratchpadState } from './stores/scratchpad-store';
40
+ export { VerifiedText } from './components/VerifiedText';
41
+ export { DataPreviewSection } from './components/DataPreviewSection';
40
42
  export { GhostText, GhostTextInput } from './components/GhostText';
41
43
  export { AutocompleteDropdown } from './components/AutocompleteDropdown';
42
44
  export { AutocompleteFormField } from './components/AutocompleteFormField';
@@ -48,17 +50,19 @@ export type { ExpandableWrapperProps } from './components/ExpandableWrapper';
48
50
  export type { ComponentToolbarProps, ToolbarAction, ToolbarIcon } from './components/ComponentToolbar';
49
51
  export type { ChatPromptProps } from './components/ChatPrompt';
50
52
  export type { ScratchpadPanelProps } from './components/ScratchpadPanel';
53
+ export type { VerifiedTextProps } from './components/VerifiedText';
54
+ export type { DataPreviewSectionProps } from './components/DataPreviewSection';
51
55
  export type { GhostTextProps, GhostTextInputProps } from './components/GhostText';
52
56
  export type { AutocompleteDropdownProps } from './components/AutocompleteDropdown';
53
57
  export type { AutocompleteFormFieldProps, AutocompleteFormFieldParams } from './components/AutocompleteFormField';
54
- export { useStreamingUI, useAction, useToolAction, useConditionalField, evaluateCondition, useModal, useConfirmModal, useFormPersistence, useDragDrop, useResize, useAutocomplete, } from './hooks';
55
- export type { UseStreamingUIOptions, StreamingUIState, StreamProgress, StreamError, CompleteMetadata, UseActionReturn, UseActionOptions, UseToolActionReturn, UseConditionalFieldOptions, UseModalReturn, UseConfirmModalReturn, UseFormPersistenceOptions, UseFormPersistenceReturn, UseDragDropOptions, UseDragDropReturn, DragProps, UseResizeOptions, UseResizeReturn, ResizeEdge, UseAutocompleteOptions, UseAutocompleteReturn, } from './hooks';
58
+ export { useStreamingUI, useAction, useToolAction, useConditionalField, evaluateCondition, useModal, useConfirmModal, useFormPersistence, useDragDrop, useResize, useAutocomplete, useDataValidator, } from './hooks';
59
+ export type { UseStreamingUIOptions, StreamingUIState, StreamProgress, StreamError, CompleteMetadata, UseActionReturn, UseActionOptions, UseToolActionReturn, UseConditionalFieldOptions, UseModalReturn, UseConfirmModalReturn, UseFormPersistenceOptions, UseFormPersistenceReturn, UseDragDropOptions, UseDragDropReturn, DragProps, UseResizeOptions, UseResizeReturn, ResizeEdge, UseAutocompleteOptions, UseAutocompleteReturn, UseDataValidatorOptions, UseDataValidatorReturn, } from './hooks';
56
60
  export { MCPActionProvider, MCPActionContext, useMCPAction, useMCPActionSafe } from './context';
57
61
  export { AutocompleteProvider, useAutocompleteContext, useAutocompleteContextSafe, } from './context/AutocompleteContext';
58
62
  export type { MCPActionContextValue, MCPActionProviderProps, ActionRequest, ActionResult, } from './context';
59
63
  export type { AutocompleteContextValue, AutocompleteProviderProps, } from './context/AutocompleteContext';
60
64
  export { createGroqPlugin, createSupabasePlugin, createRestPlugin, } from './plugins';
61
- export type { UIComponent, UILayout, GridPosition, ComponentType, RendererError, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ActionComponentParams, GridComponentParams, FormFieldOption, FormFieldType, FormFieldParams, FormComponentParams, ShowWhenOperator, ShowWhenCondition, ActionRequestBase, ActionResultBase, ActionLifecycleCallbacks, ModalSize, ModalComponentParams, ActionGroupLayout, ActionGroupGap, ActionGroupParams, GalleryImage, ImageGalleryParams, VideoComponentParams, CodeComponentParams, MapMarker, MapComponentParams, IframePolicy, ValidationOptions, ResizeConstraints, DragDropConfig, DragEventData, DraggableGridItemProps as DraggableGridItemPropsType, AutocompleteResultType, AutocompleteOption, AutocompleteResult, AutocompleteContext, AutocompletePlugin, GroqPluginConfig, SupabasePluginConfig, DuckDBPluginConfig, RestPluginConfig, FieldAutocompleteConfig, AutocompleteProviderConfig, } from './types';
62
- export { validateComponent, validateLayout, validateIframeDomain, getIframeSandbox, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, TRUSTED_IFRAME_DOMAINS, ComponentRegistry, createEventEmitter, createCommandHandler, createChatBus, mergeScratchpadSections, } from './services';
63
- export type { ChatEventBase, ChatEvents, ChatCommands, ChatBus, ChatEventEmitter, ChatCommandHandler, EventSubscribeOptions, ChatPromptConfig, ChatPromptResponse, ChoicePromptConfig, ConfirmPromptConfig, FormPromptConfig, SelectPromptConfig, SuggestionItem, AgentContext, BriefingEvent, BriefingSection, ScratchpadState, ScratchpadSection, ScratchpadEvent, StreamDoneMetadata, ChatError, Citation, ToolCallEvent, ClarificationEvent, } from './types/chat-bus';
65
+ export type { UIComponent, UILayout, GridPosition, ComponentType, RendererError, ChartComponentParams, TableComponentParams, MetricComponentParams, TextComponentParams, ActionComponentParams, GridComponentParams, FormFieldOption, FormFieldType, FormFieldParams, FormComponentParams, ShowWhenOperator, ShowWhenCondition, ActionRequestBase, ActionResultBase, ActionLifecycleCallbacks, ModalSize, ModalComponentParams, ActionGroupLayout, ActionGroupGap, ActionGroupParams, GalleryImage, ImageGalleryParams, VideoComponentParams, CodeComponentParams, MapMarker, MapComponentParams, MapPopupConfig, MapGeoJSONStyle, MapLayer, MapPMTilesConfig, IframePolicy, ValidationOptions, ResizeConstraints, DragDropConfig, DragEventData, DraggableGridItemProps as DraggableGridItemPropsType, AutocompleteResultType, AutocompleteOption, AutocompleteResult, AutocompleteContext, AutocompletePlugin, GroqPluginConfig, SupabasePluginConfig, DuckDBPluginConfig, RestPluginConfig, FieldAutocompleteConfig, AutocompleteProviderConfig, } from './types';
66
+ export { validateComponent, validateLayout, validateIframeDomain, getIframeSandbox, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, TRUSTED_IFRAME_DOMAINS, ComponentRegistry, createEventEmitter, createCommandHandler, createChatBus, mergeScratchpadSections, validateAgainstSource, } from './services';
67
+ export type { ChatEventBase, ChatEvents, ChatCommands, ChatBus, ChatEventEmitter, ChatCommandHandler, EventSubscribeOptions, ChatPromptConfig, ChatPromptResponse, ChoicePromptConfig, ConfirmPromptConfig, FormPromptConfig, SelectPromptConfig, SuggestionItem, AgentContext, BriefingEvent, BriefingSection, ScratchpadState, ScratchpadSection, ScratchpadEvent, StreamDoneMetadata, ChatError, Citation, ToolCallEvent, ClarificationEvent, DataValidation, LLMNumber, HallucinatedNumber, DataValidationOptions, VerifiedTextContent, DataPreviewColumn, DataPreviewContent, MapSectionContent, } from './types/chat-bus';
64
68
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAGjG,OAAO,EAAE,iBAAiB,EA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AAgB,EAChB,wBAAwB,EAExB,SAAS,EACT,oBAAoB,EAEpB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EAEjB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EAEpB,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAElB,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,sBAAsB,IAAI,0BAA0B,EAEpD,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,uBAAuB,GACxB,MAAM,YAAY,CAAA;AAGnB,YAAY,EACV,aAAa,EACb,UAAU,EACV,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,kBAAkB,GACnB,MAAM,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAGjG,OAAO,EAAE,iBAAiB,EAAE,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,EACf,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,kBAAkB,EAElB,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,kBAAkB,CAAA"}
package/dist/index.js CHANGED
@@ -14,6 +14,8 @@ import "./components/ChartJSRenderer.js";
14
14
  import "./components/LightboxOverlay.js";
15
15
  import "./components/ImageGalleryRenderer.js";
16
16
  import "./components/CodeBlockRenderer.js";
17
+ import { VerifiedText } from "./components/VerifiedText.js";
18
+ import { DataPreviewSection } from "./components/DataPreviewSection.js";
17
19
  import { DraggableGridItem } from "./components/DraggableGridItem.js";
18
20
  import { ResizeHandle } from "./components/ResizeHandle.js";
19
21
  import { EditableUIResourceRenderer } from "./components/EditableUIResourceRenderer.js";
@@ -34,6 +36,7 @@ import { useFormPersistence } from "./hooks/useFormPersistence.js";
34
36
  import { useDragDrop } from "./hooks/useDragDrop.js";
35
37
  import { useResize } from "./hooks/useResize.js";
36
38
  import { useAutocomplete } from "./hooks/useAutocomplete.js";
39
+ import { useDataValidator } from "./hooks/useDataValidator.js";
37
40
  import { MCPActionContext, MCPActionProvider, useMCPAction, useMCPActionSafe } from "./context/MCPActionContext.js";
38
41
  import { AutocompleteProvider, useAutocompleteContext, useAutocompleteContextSafe } from "./context/AutocompleteContext.js";
39
42
  import { createGroqPlugin } from "./plugins/groq.js";
@@ -42,6 +45,7 @@ import { createRestPlugin } from "./plugins/rest.js";
42
45
  import { DEFAULT_IFRAME_DOMAINS, DEFAULT_RESOURCE_LIMITS, TRUSTED_IFRAME_DOMAINS, getIframeSandbox, validateComponent, validateIframeDomain, validateLayout } from "./services/validation.js";
43
46
  import { ComponentRegistry } from "./services/component-registry.js";
44
47
  import { createChatBus, createCommandHandler, createEventEmitter, mergeScratchpadSections } from "./services/chat-bus.js";
48
+ import { validateAgainstSource } from "./services/data-validator.js";
45
49
  export {
46
50
  AutocompleteDropdown,
47
51
  AutocompleteFormField,
@@ -52,6 +56,7 @@ export {
52
56
  ComponentToolbar,
53
57
  DEFAULT_IFRAME_DOMAINS,
54
58
  DEFAULT_RESOURCE_LIMITS,
59
+ DataPreviewSection,
55
60
  DraggableGridItem,
56
61
  EditableUIResourceRenderer,
57
62
  ExpandableWrapper,
@@ -65,6 +70,7 @@ export {
65
70
  StreamingUIRenderer,
66
71
  TRUSTED_IFRAME_DOMAINS,
67
72
  UIResourceRenderer,
73
+ VerifiedText,
68
74
  createChatBus,
69
75
  createCommandHandler,
70
76
  createEventEmitter,
@@ -82,6 +88,7 @@ export {
82
88
  useChatBus,
83
89
  useConditionalField,
84
90
  useConfirmModal,
91
+ useDataValidator,
85
92
  useDragDrop,
86
93
  useFormPersistence,
87
94
  useMCPAction,
@@ -91,6 +98,7 @@ export {
91
98
  useScratchpadState,
92
99
  useStreamingUI,
93
100
  useToolAction,
101
+ validateAgainstSource,
94
102
  validateComponent,
95
103
  validateIframeDomain,
96
104
  validateLayout
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,290 @@
1
+ "use strict";
2
+ function Point(x, y) {
3
+ this.x = x;
4
+ this.y = y;
5
+ }
6
+ Point.prototype = {
7
+ /**
8
+ * Clone this point, returning a new point that can be modified
9
+ * without affecting the old one.
10
+ * @return {Point} the clone
11
+ */
12
+ clone() {
13
+ return new Point(this.x, this.y);
14
+ },
15
+ /**
16
+ * Add this point's x & y coordinates to another point,
17
+ * yielding a new point.
18
+ * @param {Point} p the other point
19
+ * @return {Point} output point
20
+ */
21
+ add(p) {
22
+ return this.clone()._add(p);
23
+ },
24
+ /**
25
+ * Subtract this point's x & y coordinates to from point,
26
+ * yielding a new point.
27
+ * @param {Point} p the other point
28
+ * @return {Point} output point
29
+ */
30
+ sub(p) {
31
+ return this.clone()._sub(p);
32
+ },
33
+ /**
34
+ * Multiply this point's x & y coordinates by point,
35
+ * yielding a new point.
36
+ * @param {Point} p the other point
37
+ * @return {Point} output point
38
+ */
39
+ multByPoint(p) {
40
+ return this.clone()._multByPoint(p);
41
+ },
42
+ /**
43
+ * Divide this point's x & y coordinates by point,
44
+ * yielding a new point.
45
+ * @param {Point} p the other point
46
+ * @return {Point} output point
47
+ */
48
+ divByPoint(p) {
49
+ return this.clone()._divByPoint(p);
50
+ },
51
+ /**
52
+ * Multiply this point's x & y coordinates by a factor,
53
+ * yielding a new point.
54
+ * @param {number} k factor
55
+ * @return {Point} output point
56
+ */
57
+ mult(k) {
58
+ return this.clone()._mult(k);
59
+ },
60
+ /**
61
+ * Divide this point's x & y coordinates by a factor,
62
+ * yielding a new point.
63
+ * @param {number} k factor
64
+ * @return {Point} output point
65
+ */
66
+ div(k) {
67
+ return this.clone()._div(k);
68
+ },
69
+ /**
70
+ * Rotate this point around the 0, 0 origin by an angle a,
71
+ * given in radians
72
+ * @param {number} a angle to rotate around, in radians
73
+ * @return {Point} output point
74
+ */
75
+ rotate(a) {
76
+ return this.clone()._rotate(a);
77
+ },
78
+ /**
79
+ * Rotate this point around p point by an angle a,
80
+ * given in radians
81
+ * @param {number} a angle to rotate around, in radians
82
+ * @param {Point} p Point to rotate around
83
+ * @return {Point} output point
84
+ */
85
+ rotateAround(a, p) {
86
+ return this.clone()._rotateAround(a, p);
87
+ },
88
+ /**
89
+ * Multiply this point by a 4x1 transformation matrix
90
+ * @param {[number, number, number, number]} m transformation matrix
91
+ * @return {Point} output point
92
+ */
93
+ matMult(m) {
94
+ return this.clone()._matMult(m);
95
+ },
96
+ /**
97
+ * Calculate this point but as a unit vector from 0, 0, meaning
98
+ * that the distance from the resulting point to the 0, 0
99
+ * coordinate will be equal to 1 and the angle from the resulting
100
+ * point to the 0, 0 coordinate will be the same as before.
101
+ * @return {Point} unit vector point
102
+ */
103
+ unit() {
104
+ return this.clone()._unit();
105
+ },
106
+ /**
107
+ * Compute a perpendicular point, where the new y coordinate
108
+ * is the old x coordinate and the new x coordinate is the old y
109
+ * coordinate multiplied by -1
110
+ * @return {Point} perpendicular point
111
+ */
112
+ perp() {
113
+ return this.clone()._perp();
114
+ },
115
+ /**
116
+ * Return a version of this point with the x & y coordinates
117
+ * rounded to integers.
118
+ * @return {Point} rounded point
119
+ */
120
+ round() {
121
+ return this.clone()._round();
122
+ },
123
+ /**
124
+ * Return the magnitude of this point: this is the Euclidean
125
+ * distance from the 0, 0 coordinate to this point's x and y
126
+ * coordinates.
127
+ * @return {number} magnitude
128
+ */
129
+ mag() {
130
+ return Math.sqrt(this.x * this.x + this.y * this.y);
131
+ },
132
+ /**
133
+ * Judge whether this point is equal to another point, returning
134
+ * true or false.
135
+ * @param {Point} other the other point
136
+ * @return {boolean} whether the points are equal
137
+ */
138
+ equals(other) {
139
+ return this.x === other.x && this.y === other.y;
140
+ },
141
+ /**
142
+ * Calculate the distance from this point to another point
143
+ * @param {Point} p the other point
144
+ * @return {number} distance
145
+ */
146
+ dist(p) {
147
+ return Math.sqrt(this.distSqr(p));
148
+ },
149
+ /**
150
+ * Calculate the distance from this point to another point,
151
+ * without the square root step. Useful if you're comparing
152
+ * relative distances.
153
+ * @param {Point} p the other point
154
+ * @return {number} distance
155
+ */
156
+ distSqr(p) {
157
+ const dx = p.x - this.x, dy = p.y - this.y;
158
+ return dx * dx + dy * dy;
159
+ },
160
+ /**
161
+ * Get the angle from the 0, 0 coordinate to this point, in radians
162
+ * coordinates.
163
+ * @return {number} angle
164
+ */
165
+ angle() {
166
+ return Math.atan2(this.y, this.x);
167
+ },
168
+ /**
169
+ * Get the angle from this point to another point, in radians
170
+ * @param {Point} b the other point
171
+ * @return {number} angle
172
+ */
173
+ angleTo(b) {
174
+ return Math.atan2(this.y - b.y, this.x - b.x);
175
+ },
176
+ /**
177
+ * Get the angle between this point and another point, in radians
178
+ * @param {Point} b the other point
179
+ * @return {number} angle
180
+ */
181
+ angleWith(b) {
182
+ return this.angleWithSep(b.x, b.y);
183
+ },
184
+ /**
185
+ * Find the angle of the two vectors, solving the formula for
186
+ * the cross product a x b = |a||b|sin(θ) for θ.
187
+ * @param {number} x the x-coordinate
188
+ * @param {number} y the y-coordinate
189
+ * @return {number} the angle in radians
190
+ */
191
+ angleWithSep(x, y) {
192
+ return Math.atan2(
193
+ this.x * y - this.y * x,
194
+ this.x * x + this.y * y
195
+ );
196
+ },
197
+ /** @param {[number, number, number, number]} m */
198
+ _matMult(m) {
199
+ const x = m[0] * this.x + m[1] * this.y, y = m[2] * this.x + m[3] * this.y;
200
+ this.x = x;
201
+ this.y = y;
202
+ return this;
203
+ },
204
+ /** @param {Point} p */
205
+ _add(p) {
206
+ this.x += p.x;
207
+ this.y += p.y;
208
+ return this;
209
+ },
210
+ /** @param {Point} p */
211
+ _sub(p) {
212
+ this.x -= p.x;
213
+ this.y -= p.y;
214
+ return this;
215
+ },
216
+ /** @param {number} k */
217
+ _mult(k) {
218
+ this.x *= k;
219
+ this.y *= k;
220
+ return this;
221
+ },
222
+ /** @param {number} k */
223
+ _div(k) {
224
+ this.x /= k;
225
+ this.y /= k;
226
+ return this;
227
+ },
228
+ /** @param {Point} p */
229
+ _multByPoint(p) {
230
+ this.x *= p.x;
231
+ this.y *= p.y;
232
+ return this;
233
+ },
234
+ /** @param {Point} p */
235
+ _divByPoint(p) {
236
+ this.x /= p.x;
237
+ this.y /= p.y;
238
+ return this;
239
+ },
240
+ _unit() {
241
+ this._div(this.mag());
242
+ return this;
243
+ },
244
+ _perp() {
245
+ const y = this.y;
246
+ this.y = this.x;
247
+ this.x = -y;
248
+ return this;
249
+ },
250
+ /** @param {number} angle */
251
+ _rotate(angle) {
252
+ const cos = Math.cos(angle), sin = Math.sin(angle), x = cos * this.x - sin * this.y, y = sin * this.x + cos * this.y;
253
+ this.x = x;
254
+ this.y = y;
255
+ return this;
256
+ },
257
+ /**
258
+ * @param {number} angle
259
+ * @param {Point} p
260
+ */
261
+ _rotateAround(angle, p) {
262
+ const cos = Math.cos(angle), sin = Math.sin(angle), x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y), y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);
263
+ this.x = x;
264
+ this.y = y;
265
+ return this;
266
+ },
267
+ _round() {
268
+ this.x = Math.round(this.x);
269
+ this.y = Math.round(this.y);
270
+ return this;
271
+ },
272
+ constructor: Point
273
+ };
274
+ Point.convert = function(p) {
275
+ if (p instanceof Point) {
276
+ return (
277
+ /** @type {Point} */
278
+ p
279
+ );
280
+ }
281
+ if (Array.isArray(p)) {
282
+ return new Point(+p[0], +p[1]);
283
+ }
284
+ if (p.x !== void 0 && p.y !== void 0) {
285
+ return new Point(+p.x, +p.y);
286
+ }
287
+ throw new Error("Expected [x, y] or {x, y} point format");
288
+ };
289
+ module.exports = Point;
290
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../../../../node_modules/.pnpm/@mapbox+point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.js"],"sourcesContent":["/**\n * A standalone point geometry with useful accessor, comparison, and\n * modification methods.\n *\n * @class\n * @param {number} x the x-coordinate. This could be longitude or screen pixels, or any other sort of unit.\n * @param {number} y the y-coordinate. This could be latitude or screen pixels, or any other sort of unit.\n *\n * @example\n * const point = new Point(-77, 38);\n */\nexport default function Point(x, y) {\n this.x = x;\n this.y = y;\n}\n\nPoint.prototype = {\n /**\n * Clone this point, returning a new point that can be modified\n * without affecting the old one.\n * @return {Point} the clone\n */\n clone() { return new Point(this.x, this.y); },\n\n /**\n * Add this point's x & y coordinates to another point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n add(p) { return this.clone()._add(p); },\n\n /**\n * Subtract this point's x & y coordinates to from point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n sub(p) { return this.clone()._sub(p); },\n\n /**\n * Multiply this point's x & y coordinates by point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n multByPoint(p) { return this.clone()._multByPoint(p); },\n\n /**\n * Divide this point's x & y coordinates by point,\n * yielding a new point.\n * @param {Point} p the other point\n * @return {Point} output point\n */\n divByPoint(p) { return this.clone()._divByPoint(p); },\n\n /**\n * Multiply this point's x & y coordinates by a factor,\n * yielding a new point.\n * @param {number} k factor\n * @return {Point} output point\n */\n mult(k) { return this.clone()._mult(k); },\n\n /**\n * Divide this point's x & y coordinates by a factor,\n * yielding a new point.\n * @param {number} k factor\n * @return {Point} output point\n */\n div(k) { return this.clone()._div(k); },\n\n /**\n * Rotate this point around the 0, 0 origin by an angle a,\n * given in radians\n * @param {number} a angle to rotate around, in radians\n * @return {Point} output point\n */\n rotate(a) { return this.clone()._rotate(a); },\n\n /**\n * Rotate this point around p point by an angle a,\n * given in radians\n * @param {number} a angle to rotate around, in radians\n * @param {Point} p Point to rotate around\n * @return {Point} output point\n */\n rotateAround(a, p) { return this.clone()._rotateAround(a, p); },\n\n /**\n * Multiply this point by a 4x1 transformation matrix\n * @param {[number, number, number, number]} m transformation matrix\n * @return {Point} output point\n */\n matMult(m) { return this.clone()._matMult(m); },\n\n /**\n * Calculate this point but as a unit vector from 0, 0, meaning\n * that the distance from the resulting point to the 0, 0\n * coordinate will be equal to 1 and the angle from the resulting\n * point to the 0, 0 coordinate will be the same as before.\n * @return {Point} unit vector point\n */\n unit() { return this.clone()._unit(); },\n\n /**\n * Compute a perpendicular point, where the new y coordinate\n * is the old x coordinate and the new x coordinate is the old y\n * coordinate multiplied by -1\n * @return {Point} perpendicular point\n */\n perp() { return this.clone()._perp(); },\n\n /**\n * Return a version of this point with the x & y coordinates\n * rounded to integers.\n * @return {Point} rounded point\n */\n round() { return this.clone()._round(); },\n\n /**\n * Return the magnitude of this point: this is the Euclidean\n * distance from the 0, 0 coordinate to this point's x and y\n * coordinates.\n * @return {number} magnitude\n */\n mag() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n },\n\n /**\n * Judge whether this point is equal to another point, returning\n * true or false.\n * @param {Point} other the other point\n * @return {boolean} whether the points are equal\n */\n equals(other) {\n return this.x === other.x &&\n this.y === other.y;\n },\n\n /**\n * Calculate the distance from this point to another point\n * @param {Point} p the other point\n * @return {number} distance\n */\n dist(p) {\n return Math.sqrt(this.distSqr(p));\n },\n\n /**\n * Calculate the distance from this point to another point,\n * without the square root step. Useful if you're comparing\n * relative distances.\n * @param {Point} p the other point\n * @return {number} distance\n */\n distSqr(p) {\n const dx = p.x - this.x,\n dy = p.y - this.y;\n return dx * dx + dy * dy;\n },\n\n /**\n * Get the angle from the 0, 0 coordinate to this point, in radians\n * coordinates.\n * @return {number} angle\n */\n angle() {\n return Math.atan2(this.y, this.x);\n },\n\n /**\n * Get the angle from this point to another point, in radians\n * @param {Point} b the other point\n * @return {number} angle\n */\n angleTo(b) {\n return Math.atan2(this.y - b.y, this.x - b.x);\n },\n\n /**\n * Get the angle between this point and another point, in radians\n * @param {Point} b the other point\n * @return {number} angle\n */\n angleWith(b) {\n return this.angleWithSep(b.x, b.y);\n },\n\n /**\n * Find the angle of the two vectors, solving the formula for\n * the cross product a x b = |a||b|sin(θ) for θ.\n * @param {number} x the x-coordinate\n * @param {number} y the y-coordinate\n * @return {number} the angle in radians\n */\n angleWithSep(x, y) {\n return Math.atan2(\n this.x * y - this.y * x,\n this.x * x + this.y * y);\n },\n\n /** @param {[number, number, number, number]} m */\n _matMult(m) {\n const x = m[0] * this.x + m[1] * this.y,\n y = m[2] * this.x + m[3] * this.y;\n this.x = x;\n this.y = y;\n return this;\n },\n\n /** @param {Point} p */\n _add(p) {\n this.x += p.x;\n this.y += p.y;\n return this;\n },\n\n /** @param {Point} p */\n _sub(p) {\n this.x -= p.x;\n this.y -= p.y;\n return this;\n },\n\n /** @param {number} k */\n _mult(k) {\n this.x *= k;\n this.y *= k;\n return this;\n },\n\n /** @param {number} k */\n _div(k) {\n this.x /= k;\n this.y /= k;\n return this;\n },\n\n /** @param {Point} p */\n _multByPoint(p) {\n this.x *= p.x;\n this.y *= p.y;\n return this;\n },\n\n /** @param {Point} p */\n _divByPoint(p) {\n this.x /= p.x;\n this.y /= p.y;\n return this;\n },\n\n _unit() {\n this._div(this.mag());\n return this;\n },\n\n _perp() {\n const y = this.y;\n this.y = this.x;\n this.x = -y;\n return this;\n },\n\n /** @param {number} angle */\n _rotate(angle) {\n const cos = Math.cos(angle),\n sin = Math.sin(angle),\n x = cos * this.x - sin * this.y,\n y = sin * this.x + cos * this.y;\n this.x = x;\n this.y = y;\n return this;\n },\n\n /**\n * @param {number} angle\n * @param {Point} p\n */\n _rotateAround(angle, p) {\n const cos = Math.cos(angle),\n sin = Math.sin(angle),\n x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y),\n y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);\n this.x = x;\n this.y = y;\n return this;\n },\n\n _round() {\n this.x = Math.round(this.x);\n this.y = Math.round(this.y);\n return this;\n },\n\n constructor: Point\n};\n\n/**\n * Construct a point from an array if necessary, otherwise if the input\n * is already a Point, return it unchanged.\n * @param {Point | [number, number] | {x: number, y: number}} p input value\n * @return {Point} constructed point.\n * @example\n * // this\n * var point = Point.convert([0, 1]);\n * // is equivalent to\n * var point = new Point(0, 1);\n */\nPoint.convert = function (p) {\n if (p instanceof Point) {\n return /** @type {Point} */ (p);\n }\n if (Array.isArray(p)) {\n return new Point(+p[0], +p[1]);\n }\n if (p.x !== undefined && p.y !== undefined) {\n return new Point(+p.x, +p.y);\n }\n throw new Error('Expected [x, y] or {x, y} point format');\n};\n"],"names":[],"mappings":";AAWe,SAAS,MAAM,GAAG,GAAG;AAChC,OAAK,IAAI;AACT,OAAK,IAAI;AACb;AAEA,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA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