@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.
- package/README.md +317 -53
- package/dist/index.d.mts +255 -0
- package/dist/index.d.ts +255 -0
- package/dist/index.js +548 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +539 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +84 -91
- package/src/components/HanzoProvider.test.tsx +346 -0
- package/src/components/HanzoProvider.tsx +508 -0
- package/src/hooks/index.ts +39 -0
- package/src/hooks/types.ts +162 -0
- package/src/hooks/useAuth.ts +0 -0
- package/src/hooks/useComponent.ts +0 -0
- package/src/hooks/useGenerativeUI.ts +0 -0
- package/src/hooks/useMCP.ts +0 -0
- package/src/hooks/useMessage.ts +105 -0
- package/src/hooks/useModelConfig.ts +0 -0
- package/src/hooks/useStreaming.ts +161 -0
- package/src/hooks/useSuggestions.ts +0 -0
- package/src/hooks/useThread.ts +0 -0
- package/src/hooks/useTool.ts +0 -0
- package/src/index.ts +40 -0
- package/src/types/index.ts +25 -0
- package/src/utils/cn.ts +6 -0
- package/src/utils/id.ts +6 -0
- package/src/utils/stream.ts +33 -0
- package/LICENSE +0 -21
- package/dist/index.cjs.js +0 -15736
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.css +0 -789
- package/dist/index.esm.js +0 -15717
- package/dist/index.esm.js.map +0 -1
- package/dist/index.umd.js +0 -15737
- package/dist/index.umd.js.map +0 -1
- package/src/controls/.DS_Store +0 -0
- package/src/controls/MUICheckbox.js +0 -108
- package/src/controls/MUIKeyboardDatePicker.js +0 -90
- package/src/controls/MUIPhone.js +0 -33
- package/src/controls/MUISwitch.js +0 -107
- package/src/controls/MUIText.js +0 -284
- package/src/controls/NumericFormats.js +0 -55
- package/src/controls/control.js +0 -148
- package/src/controls/index.js +0 -7
- package/src/controls/material-ui-phone-number/components/Item.js +0 -66
- package/src/controls/material-ui-phone-number/components/flags.css +0 -789
- package/src/controls/material-ui-phone-number/components/index.js +0 -884
- package/src/controls/material-ui-phone-number/components/polyfills.js +0 -82
- package/src/controls/material-ui-phone-number/country_data.js +0 -1536
- package/src/controls/material-ui-phone-number/index.js +0 -3
- package/src/index.js +0 -1
- /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
|
-
|