@hanzo/react 0.1.3 → 1.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 (52) hide show
  1. package/README.md +317 -53
  2. package/dist/index.d.mts +255 -0
  3. package/dist/index.d.ts +255 -0
  4. package/dist/index.js +548 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +539 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +84 -91
  9. package/src/components/HanzoProvider.test.tsx +346 -0
  10. package/src/components/HanzoProvider.tsx +508 -0
  11. package/src/hooks/index.ts +39 -0
  12. package/src/hooks/types.ts +162 -0
  13. package/src/hooks/useAuth.ts +0 -0
  14. package/src/hooks/useComponent.ts +0 -0
  15. package/src/hooks/useGenerativeUI.ts +0 -0
  16. package/src/hooks/useMCP.ts +0 -0
  17. package/src/hooks/useMessage.ts +105 -0
  18. package/src/hooks/useModelConfig.ts +0 -0
  19. package/src/hooks/useStreaming.ts +161 -0
  20. package/src/hooks/useSuggestions.ts +0 -0
  21. package/src/hooks/useThread.ts +0 -0
  22. package/src/hooks/useTool.ts +0 -0
  23. package/src/index.ts +40 -0
  24. package/src/types/index.ts +25 -0
  25. package/src/utils/cn.ts +6 -0
  26. package/src/utils/id.ts +6 -0
  27. package/src/utils/stream.ts +33 -0
  28. package/LICENSE +0 -21
  29. package/dist/index.cjs.js +0 -15736
  30. package/dist/index.cjs.js.map +0 -1
  31. package/dist/index.css +0 -789
  32. package/dist/index.esm.js +0 -15717
  33. package/dist/index.esm.js.map +0 -1
  34. package/dist/index.umd.js +0 -15737
  35. package/dist/index.umd.js.map +0 -1
  36. package/src/controls/.DS_Store +0 -0
  37. package/src/controls/MUICheckbox.js +0 -108
  38. package/src/controls/MUIKeyboardDatePicker.js +0 -90
  39. package/src/controls/MUIPhone.js +0 -33
  40. package/src/controls/MUISwitch.js +0 -107
  41. package/src/controls/MUIText.js +0 -284
  42. package/src/controls/NumericFormats.js +0 -55
  43. package/src/controls/control.js +0 -148
  44. package/src/controls/index.js +0 -7
  45. package/src/controls/material-ui-phone-number/components/Item.js +0 -66
  46. package/src/controls/material-ui-phone-number/components/flags.css +0 -789
  47. package/src/controls/material-ui-phone-number/components/index.js +0 -884
  48. package/src/controls/material-ui-phone-number/components/polyfills.js +0 -82
  49. package/src/controls/material-ui-phone-number/country_data.js +0 -1536
  50. package/src/controls/material-ui-phone-number/index.js +0 -3
  51. package/src/index.js +0 -1
  52. /package/src/{core/index.js → hooks/useAttachments.ts} +0 -0
@@ -1,82 +0,0 @@
1
- if (!Array.prototype.findIndex) {
2
- Object.defineProperty(Array.prototype, 'findIndex', {
3
- value: function(predicate) {
4
- // 1. Let O be ? ToObject(this value).
5
- if (this == null) {
6
- throw new TypeError('"this" is null or not defined');
7
- }
8
-
9
- var o = Object(this);
10
-
11
- // 2. Let len be ? ToLength(? Get(O, "length")).
12
- var len = o.length >>> 0;
13
-
14
- // 3. If IsCallable(predicate) is false, throw a TypeError exception.
15
- if (typeof predicate !== 'function') {
16
- throw new TypeError('predicate must be a function');
17
- }
18
-
19
- // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
20
- var thisArg = arguments[1];
21
-
22
- // 5. Let k be 0.
23
- var k = 0;
24
-
25
- // 6. Repeat, while k < len
26
- while (k < len) {
27
- // a. Let Pk be ! ToString(k).
28
- // b. Let kValue be ? Get(O, Pk).
29
- // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
30
- // d. If testResult is true, return k.
31
- var kValue = o[k];
32
- if (predicate.call(thisArg, kValue, k, o)) {
33
- return k;
34
- }
35
- // e. Increase k by 1.
36
- k++;
37
- }
38
-
39
- // 7. Return -1.
40
- return -1;
41
- },
42
- configurable: true,
43
- writable: true
44
- });
45
- }
46
-
47
- if (!Array.prototype.includes) {
48
- Object.defineProperty(Array.prototype, 'includes', {
49
- value: function(val) {
50
- if (this == null) {
51
- throw new TypeError('"this" is null or not defined');
52
- }
53
-
54
- return this.indexOf(val) > -1
55
- },
56
- configurable: true,
57
- writable: true
58
- });
59
- }
60
-
61
- if (!String.prototype.includes) {
62
- String.prototype.includes = function(search, start) {
63
- 'use strict';
64
-
65
- if (search instanceof RegExp) {
66
- throw TypeError('first argument must not be a RegExp');
67
- }
68
- if (start === undefined) { start = 0; }
69
- return this.indexOf(search, start) !== -1;
70
- };
71
- }
72
-
73
- if (!String.prototype.startsWith) {
74
- Object.defineProperty(String.prototype, 'startsWith', {
75
- value: function(search, rawPos) {
76
- var pos = rawPos > 0 ? rawPos|0 : 0;
77
- return this.substring(pos, pos + search.length) === search;
78
- }
79
- });
80
- }
81
-
82
-