mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
inititated shadcn
This commit is contained in:
18
extensions/react-widget/.eslintrc.cjs
Normal file
18
extensions/react-widget/.eslintrc.cjs
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: { browser: true, es2020: true },
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:react-hooks/recommended',
|
||||
],
|
||||
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['react-refresh'],
|
||||
rules: {
|
||||
'react-refresh/only-export-components': [
|
||||
'warn',
|
||||
{ allowConstantExport: true },
|
||||
],
|
||||
},
|
||||
}
|
||||
24
extensions/react-widget/.gitignore
vendored
Normal file
24
extensions/react-widget/.gitignore
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
17
extensions/react-widget/components.json
Normal file
17
extensions/react-widget/components.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "https://ui.shadcn.com/schema.json",
|
||||
"style": "new-york",
|
||||
"rsc": true,
|
||||
"tsx": true,
|
||||
"tailwind": {
|
||||
"config": "tailwind.config.js",
|
||||
"css": "src/index.css",
|
||||
"baseColor": "neutral",
|
||||
"cssVariables": true,
|
||||
"prefix": ""
|
||||
},
|
||||
"aliases": {
|
||||
"components": "@/components",
|
||||
"utils": "@/lib/utils"
|
||||
}
|
||||
}
|
||||
1
extensions/react-widget/dist/index.d.ts
vendored
1
extensions/react-widget/dist/index.d.ts
vendored
@@ -1 +0,0 @@
|
||||
export { DocsGPTWidget } from "./src/components/DocsGPTWidget";
|
||||
832
extensions/react-widget/dist/index.es.js
vendored
832
extensions/react-widget/dist/index.es.js
vendored
@@ -1,832 +0,0 @@
|
||||
import Ne, { useState as ke, useRef as ur, useEffect as Pe } from "react";
|
||||
var ne = { exports: {} }, Y = {};
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.development.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
var Ce;
|
||||
function cr() {
|
||||
return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && function() {
|
||||
var N = Ne, w = Symbol.for("react.element"), C = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), b = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), R = Symbol.iterator, j = "@@iterator";
|
||||
function J(e) {
|
||||
if (e === null || typeof e != "object")
|
||||
return null;
|
||||
var r = R && e[R] || e[j];
|
||||
return typeof r == "function" ? r : null;
|
||||
}
|
||||
var O = N.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
function g(e) {
|
||||
{
|
||||
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
||||
t[n - 1] = arguments[n];
|
||||
B("error", e, t);
|
||||
}
|
||||
}
|
||||
function B(e, r, t) {
|
||||
{
|
||||
var n = O.ReactDebugCurrentFrame, o = n.getStackAddendum();
|
||||
o !== "" && (r += "%s", t = t.concat([o]));
|
||||
var s = t.map(function(i) {
|
||||
return String(i);
|
||||
});
|
||||
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
||||
}
|
||||
}
|
||||
var D = !1, z = !1, De = !1, Ae = !1, Fe = !1, ae;
|
||||
ae = Symbol.for("react.module.reference");
|
||||
function Ie(e) {
|
||||
return !!(typeof e == "string" || typeof e == "function" || e === u || e === S || Fe || e === E || e === v || e === m || Ae || e === p || D || z || De || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === h || e.$$typeof === T || e.$$typeof === b || e.$$typeof === d || // This needs to include all possible module reference object
|
||||
// types supported by any Flight configuration anywhere since
|
||||
// we don't know which Flight build this will end up being used
|
||||
// with.
|
||||
e.$$typeof === ae || e.getModuleId !== void 0));
|
||||
}
|
||||
function $e(e, r, t) {
|
||||
var n = e.displayName;
|
||||
if (n)
|
||||
return n;
|
||||
var o = r.displayName || r.name || "";
|
||||
return o !== "" ? t + "(" + o + ")" : t;
|
||||
}
|
||||
function ie(e) {
|
||||
return e.displayName || "Context";
|
||||
}
|
||||
function k(e) {
|
||||
if (e == null)
|
||||
return null;
|
||||
if (typeof e.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
||||
return e.displayName || e.name || null;
|
||||
if (typeof e == "string")
|
||||
return e;
|
||||
switch (e) {
|
||||
case u:
|
||||
return "Fragment";
|
||||
case C:
|
||||
return "Portal";
|
||||
case S:
|
||||
return "Profiler";
|
||||
case E:
|
||||
return "StrictMode";
|
||||
case v:
|
||||
return "Suspense";
|
||||
case m:
|
||||
return "SuspenseList";
|
||||
}
|
||||
if (typeof e == "object")
|
||||
switch (e.$$typeof) {
|
||||
case b:
|
||||
var r = e;
|
||||
return ie(r) + ".Consumer";
|
||||
case T:
|
||||
var t = e;
|
||||
return ie(t._context) + ".Provider";
|
||||
case d:
|
||||
return $e(e, e.render, "ForwardRef");
|
||||
case h:
|
||||
var n = e.displayName || null;
|
||||
return n !== null ? n : k(e.type) || "Memo";
|
||||
case x: {
|
||||
var o = e, s = o._payload, i = o._init;
|
||||
try {
|
||||
return k(i(s));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
var A = Object.assign, $ = 0, oe, se, le, ue, ce, fe, de;
|
||||
function ve() {
|
||||
}
|
||||
ve.__reactDisabledLog = !0;
|
||||
function We() {
|
||||
{
|
||||
if ($ === 0) {
|
||||
oe = console.log, se = console.info, le = console.warn, ue = console.error, ce = console.group, fe = console.groupCollapsed, de = console.groupEnd;
|
||||
var e = {
|
||||
configurable: !0,
|
||||
enumerable: !0,
|
||||
value: ve,
|
||||
writable: !0
|
||||
};
|
||||
Object.defineProperties(console, {
|
||||
info: e,
|
||||
log: e,
|
||||
warn: e,
|
||||
error: e,
|
||||
group: e,
|
||||
groupCollapsed: e,
|
||||
groupEnd: e
|
||||
});
|
||||
}
|
||||
$++;
|
||||
}
|
||||
}
|
||||
function Ye() {
|
||||
{
|
||||
if ($--, $ === 0) {
|
||||
var e = {
|
||||
configurable: !0,
|
||||
enumerable: !0,
|
||||
writable: !0
|
||||
};
|
||||
Object.defineProperties(console, {
|
||||
log: A({}, e, {
|
||||
value: oe
|
||||
}),
|
||||
info: A({}, e, {
|
||||
value: se
|
||||
}),
|
||||
warn: A({}, e, {
|
||||
value: le
|
||||
}),
|
||||
error: A({}, e, {
|
||||
value: ue
|
||||
}),
|
||||
group: A({}, e, {
|
||||
value: ce
|
||||
}),
|
||||
groupCollapsed: A({}, e, {
|
||||
value: fe
|
||||
}),
|
||||
groupEnd: A({}, e, {
|
||||
value: de
|
||||
})
|
||||
});
|
||||
}
|
||||
$ < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
||||
}
|
||||
}
|
||||
var H = O.ReactCurrentDispatcher, K;
|
||||
function V(e, r, t) {
|
||||
{
|
||||
if (K === void 0)
|
||||
try {
|
||||
throw Error();
|
||||
} catch (o) {
|
||||
var n = o.stack.trim().match(/\n( *(at )?)/);
|
||||
K = n && n[1] || "";
|
||||
}
|
||||
return `
|
||||
` + K + e;
|
||||
}
|
||||
}
|
||||
var X = !1, M;
|
||||
{
|
||||
var Le = typeof WeakMap == "function" ? WeakMap : Map;
|
||||
M = new Le();
|
||||
}
|
||||
function pe(e, r) {
|
||||
if (!e || X)
|
||||
return "";
|
||||
{
|
||||
var t = M.get(e);
|
||||
if (t !== void 0)
|
||||
return t;
|
||||
}
|
||||
var n;
|
||||
X = !0;
|
||||
var o = Error.prepareStackTrace;
|
||||
Error.prepareStackTrace = void 0;
|
||||
var s;
|
||||
s = H.current, H.current = null, We();
|
||||
try {
|
||||
if (r) {
|
||||
var i = function() {
|
||||
throw Error();
|
||||
};
|
||||
if (Object.defineProperty(i.prototype, "props", {
|
||||
set: function() {
|
||||
throw Error();
|
||||
}
|
||||
}), typeof Reflect == "object" && Reflect.construct) {
|
||||
try {
|
||||
Reflect.construct(i, []);
|
||||
} catch (P) {
|
||||
n = P;
|
||||
}
|
||||
Reflect.construct(e, [], i);
|
||||
} else {
|
||||
try {
|
||||
i.call();
|
||||
} catch (P) {
|
||||
n = P;
|
||||
}
|
||||
e.call(i.prototype);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
throw Error();
|
||||
} catch (P) {
|
||||
n = P;
|
||||
}
|
||||
e();
|
||||
}
|
||||
} catch (P) {
|
||||
if (P && n && typeof P.stack == "string") {
|
||||
for (var a = P.stack.split(`
|
||||
`), y = n.stack.split(`
|
||||
`), c = a.length - 1, f = y.length - 1; c >= 1 && f >= 0 && a[c] !== y[f]; )
|
||||
f--;
|
||||
for (; c >= 1 && f >= 0; c--, f--)
|
||||
if (a[c] !== y[f]) {
|
||||
if (c !== 1 || f !== 1)
|
||||
do
|
||||
if (c--, f--, f < 0 || a[c] !== y[f]) {
|
||||
var _ = `
|
||||
` + a[c].replace(" at new ", " at ");
|
||||
return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, _), _;
|
||||
}
|
||||
while (c >= 1 && f >= 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
X = !1, H.current = s, Ye(), Error.prepareStackTrace = o;
|
||||
}
|
||||
var I = e ? e.displayName || e.name : "", je = I ? V(I) : "";
|
||||
return typeof e == "function" && M.set(e, je), je;
|
||||
}
|
||||
function Ve(e, r, t) {
|
||||
return pe(e, !1);
|
||||
}
|
||||
function Me(e) {
|
||||
var r = e.prototype;
|
||||
return !!(r && r.isReactComponent);
|
||||
}
|
||||
function U(e, r, t) {
|
||||
if (e == null)
|
||||
return "";
|
||||
if (typeof e == "function")
|
||||
return pe(e, Me(e));
|
||||
if (typeof e == "string")
|
||||
return V(e);
|
||||
switch (e) {
|
||||
case v:
|
||||
return V("Suspense");
|
||||
case m:
|
||||
return V("SuspenseList");
|
||||
}
|
||||
if (typeof e == "object")
|
||||
switch (e.$$typeof) {
|
||||
case d:
|
||||
return Ve(e.render);
|
||||
case h:
|
||||
return U(e.type, r, t);
|
||||
case x: {
|
||||
var n = e, o = n._payload, s = n._init;
|
||||
try {
|
||||
return U(s(o), r, t);
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
var G = Object.prototype.hasOwnProperty, he = {}, me = O.ReactDebugCurrentFrame;
|
||||
function q(e) {
|
||||
if (e) {
|
||||
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
||||
me.setExtraStackFrame(t);
|
||||
} else
|
||||
me.setExtraStackFrame(null);
|
||||
}
|
||||
function Ue(e, r, t, n, o) {
|
||||
{
|
||||
var s = Function.call.bind(G);
|
||||
for (var i in e)
|
||||
if (s(e, i)) {
|
||||
var a = void 0;
|
||||
try {
|
||||
if (typeof e[i] != "function") {
|
||||
var y = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
||||
throw y.name = "Invariant Violation", y;
|
||||
}
|
||||
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
||||
} catch (c) {
|
||||
a = c;
|
||||
}
|
||||
a && !(a instanceof Error) && (q(o), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), q(null)), a instanceof Error && !(a.message in he) && (he[a.message] = !0, q(o), g("Failed %s type: %s", t, a.message), q(null));
|
||||
}
|
||||
}
|
||||
}
|
||||
var Ge = Array.isArray;
|
||||
function Z(e) {
|
||||
return Ge(e);
|
||||
}
|
||||
function qe(e) {
|
||||
{
|
||||
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
||||
return t;
|
||||
}
|
||||
}
|
||||
function Je(e) {
|
||||
try {
|
||||
return ge(e), !1;
|
||||
} catch {
|
||||
return !0;
|
||||
}
|
||||
}
|
||||
function ge(e) {
|
||||
return "" + e;
|
||||
}
|
||||
function ye(e) {
|
||||
if (Je(e))
|
||||
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ge(e);
|
||||
}
|
||||
var W = O.ReactCurrentOwner, Be = {
|
||||
key: !0,
|
||||
ref: !0,
|
||||
__self: !0,
|
||||
__source: !0
|
||||
}, be, Ee, Q;
|
||||
Q = {};
|
||||
function ze(e) {
|
||||
if (G.call(e, "ref")) {
|
||||
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
||||
if (r && r.isReactWarning)
|
||||
return !1;
|
||||
}
|
||||
return e.ref !== void 0;
|
||||
}
|
||||
function He(e) {
|
||||
if (G.call(e, "key")) {
|
||||
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
||||
if (r && r.isReactWarning)
|
||||
return !1;
|
||||
}
|
||||
return e.key !== void 0;
|
||||
}
|
||||
function Ke(e, r) {
|
||||
if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
|
||||
var t = k(W.current.type);
|
||||
Q[t] || (g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', k(W.current.type), e.ref), Q[t] = !0);
|
||||
}
|
||||
}
|
||||
function Xe(e, r) {
|
||||
{
|
||||
var t = function() {
|
||||
be || (be = !0, g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
||||
};
|
||||
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
||||
get: t,
|
||||
configurable: !0
|
||||
});
|
||||
}
|
||||
}
|
||||
function Ze(e, r) {
|
||||
{
|
||||
var t = function() {
|
||||
Ee || (Ee = !0, g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
||||
};
|
||||
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
||||
get: t,
|
||||
configurable: !0
|
||||
});
|
||||
}
|
||||
}
|
||||
var Qe = function(e, r, t, n, o, s, i) {
|
||||
var a = {
|
||||
// This tag allows us to uniquely identify this as a React Element
|
||||
$$typeof: w,
|
||||
// Built-in properties that belong on the element
|
||||
type: e,
|
||||
key: r,
|
||||
ref: t,
|
||||
props: i,
|
||||
// Record the component responsible for creating this element.
|
||||
_owner: s
|
||||
};
|
||||
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !0,
|
||||
value: !1
|
||||
}), Object.defineProperty(a, "_self", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !1,
|
||||
value: n
|
||||
}), Object.defineProperty(a, "_source", {
|
||||
configurable: !1,
|
||||
enumerable: !1,
|
||||
writable: !1,
|
||||
value: o
|
||||
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
||||
};
|
||||
function er(e, r, t, n, o) {
|
||||
{
|
||||
var s, i = {}, a = null, y = null;
|
||||
t !== void 0 && (ye(t), a = "" + t), He(r) && (ye(r.key), a = "" + r.key), ze(r) && (y = r.ref, Ke(r, o));
|
||||
for (s in r)
|
||||
G.call(r, s) && !Be.hasOwnProperty(s) && (i[s] = r[s]);
|
||||
if (e && e.defaultProps) {
|
||||
var c = e.defaultProps;
|
||||
for (s in c)
|
||||
i[s] === void 0 && (i[s] = c[s]);
|
||||
}
|
||||
if (a || y) {
|
||||
var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
||||
a && Xe(i, f), y && Ze(i, f);
|
||||
}
|
||||
return Qe(e, a, y, o, n, W.current, i);
|
||||
}
|
||||
}
|
||||
var ee = O.ReactCurrentOwner, xe = O.ReactDebugCurrentFrame;
|
||||
function F(e) {
|
||||
if (e) {
|
||||
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
||||
xe.setExtraStackFrame(t);
|
||||
} else
|
||||
xe.setExtraStackFrame(null);
|
||||
}
|
||||
var re;
|
||||
re = !1;
|
||||
function te(e) {
|
||||
return typeof e == "object" && e !== null && e.$$typeof === w;
|
||||
}
|
||||
function _e() {
|
||||
{
|
||||
if (ee.current) {
|
||||
var e = k(ee.current.type);
|
||||
if (e)
|
||||
return `
|
||||
|
||||
Check the render method of \`` + e + "`.";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
function rr(e) {
|
||||
{
|
||||
if (e !== void 0) {
|
||||
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
|
||||
return `
|
||||
|
||||
Check your code at ` + r + ":" + t + ".";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
var Re = {};
|
||||
function tr(e) {
|
||||
{
|
||||
var r = _e();
|
||||
if (!r) {
|
||||
var t = typeof e == "string" ? e : e.displayName || e.name;
|
||||
t && (r = `
|
||||
|
||||
Check the top-level render call using <` + t + ">.");
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
function we(e, r) {
|
||||
{
|
||||
if (!e._store || e._store.validated || e.key != null)
|
||||
return;
|
||||
e._store.validated = !0;
|
||||
var t = tr(r);
|
||||
if (Re[t])
|
||||
return;
|
||||
Re[t] = !0;
|
||||
var n = "";
|
||||
e && e._owner && e._owner !== ee.current && (n = " It was passed a child from " + k(e._owner.type) + "."), F(e), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null);
|
||||
}
|
||||
}
|
||||
function Te(e, r) {
|
||||
{
|
||||
if (typeof e != "object")
|
||||
return;
|
||||
if (Z(e))
|
||||
for (var t = 0; t < e.length; t++) {
|
||||
var n = e[t];
|
||||
te(n) && we(n, r);
|
||||
}
|
||||
else if (te(e))
|
||||
e._store && (e._store.validated = !0);
|
||||
else if (e) {
|
||||
var o = J(e);
|
||||
if (typeof o == "function" && o !== e.entries)
|
||||
for (var s = o.call(e), i; !(i = s.next()).done; )
|
||||
te(i.value) && we(i.value, r);
|
||||
}
|
||||
}
|
||||
}
|
||||
function nr(e) {
|
||||
{
|
||||
var r = e.type;
|
||||
if (r == null || typeof r == "string")
|
||||
return;
|
||||
var t;
|
||||
if (typeof r == "function")
|
||||
t = r.propTypes;
|
||||
else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
|
||||
// Inner props are checked in the reconciler.
|
||||
r.$$typeof === h))
|
||||
t = r.propTypes;
|
||||
else
|
||||
return;
|
||||
if (t) {
|
||||
var n = k(r);
|
||||
Ue(t, e.props, "prop", n, e);
|
||||
} else if (r.PropTypes !== void 0 && !re) {
|
||||
re = !0;
|
||||
var o = k(r);
|
||||
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
||||
}
|
||||
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
||||
}
|
||||
}
|
||||
function ar(e) {
|
||||
{
|
||||
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
||||
var n = r[t];
|
||||
if (n !== "children" && n !== "key") {
|
||||
F(e), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e.ref !== null && (F(e), g("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
|
||||
}
|
||||
}
|
||||
function Se(e, r, t, n, o, s) {
|
||||
{
|
||||
var i = Ie(e);
|
||||
if (!i) {
|
||||
var a = "";
|
||||
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
||||
var y = rr(o);
|
||||
y ? a += y : a += _e();
|
||||
var c;
|
||||
e === null ? c = "null" : Z(e) ? c = "array" : e !== void 0 && e.$$typeof === w ? (c = "<" + (k(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, a);
|
||||
}
|
||||
var f = er(e, r, t, o, s);
|
||||
if (f == null)
|
||||
return f;
|
||||
if (i) {
|
||||
var _ = r.children;
|
||||
if (_ !== void 0)
|
||||
if (n)
|
||||
if (Z(_)) {
|
||||
for (var I = 0; I < _.length; I++)
|
||||
Te(_[I], e);
|
||||
Object.freeze && Object.freeze(_);
|
||||
} else
|
||||
g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
||||
else
|
||||
Te(_, e);
|
||||
}
|
||||
return e === u ? ar(f) : nr(f), f;
|
||||
}
|
||||
}
|
||||
function ir(e, r, t) {
|
||||
return Se(e, r, t, !0);
|
||||
}
|
||||
function or(e, r, t) {
|
||||
return Se(e, r, t, !1);
|
||||
}
|
||||
var sr = or, lr = ir;
|
||||
Y.Fragment = u, Y.jsx = sr, Y.jsxs = lr;
|
||||
}()), Y;
|
||||
}
|
||||
var L = {};
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
var Oe;
|
||||
function fr() {
|
||||
if (Oe)
|
||||
return L;
|
||||
Oe = 1;
|
||||
var N = Ne, w = Symbol.for("react.element"), C = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, E = N.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, S = { key: !0, ref: !0, __self: !0, __source: !0 };
|
||||
function T(b, d, v) {
|
||||
var m, h = {}, x = null, p = null;
|
||||
v !== void 0 && (x = "" + v), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (p = d.ref);
|
||||
for (m in d)
|
||||
u.call(d, m) && !S.hasOwnProperty(m) && (h[m] = d[m]);
|
||||
if (b && b.defaultProps)
|
||||
for (m in d = b.defaultProps, d)
|
||||
h[m] === void 0 && (h[m] = d[m]);
|
||||
return { $$typeof: w, type: b, key: x, ref: p, props: h, _owner: E.current };
|
||||
}
|
||||
return L.Fragment = C, L.jsx = T, L.jsxs = T, L;
|
||||
}
|
||||
process.env.NODE_ENV === "production" ? ne.exports = fr() : ne.exports = cr();
|
||||
var l = ne.exports;
|
||||
function dr({
|
||||
question: N = "",
|
||||
apiKey: w = "",
|
||||
selectedDocs: C = "",
|
||||
history: u = [],
|
||||
conversationId: E = null,
|
||||
apiHost: S = "",
|
||||
onEvent: T = () => {
|
||||
console.log("Event triggered, but no handler provided.");
|
||||
}
|
||||
}) {
|
||||
let b = "default";
|
||||
return C && (b = C), new Promise((d, v) => {
|
||||
const m = {
|
||||
question: N,
|
||||
api_key: w,
|
||||
embeddings_key: w,
|
||||
active_docs: b,
|
||||
history: JSON.stringify(u),
|
||||
conversation_id: E,
|
||||
model: "default"
|
||||
};
|
||||
fetch(S + "/stream", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(m)
|
||||
}).then((h) => {
|
||||
if (!h.body)
|
||||
throw Error("No response body");
|
||||
const x = h.body.getReader(), p = new TextDecoder("utf-8");
|
||||
let R = 0;
|
||||
const j = ({
|
||||
done: J,
|
||||
value: O
|
||||
}) => {
|
||||
if (J) {
|
||||
console.log(R), d();
|
||||
return;
|
||||
}
|
||||
R += 1;
|
||||
const B = p.decode(O).split(`
|
||||
`);
|
||||
for (let D of B) {
|
||||
if (D.trim() == "")
|
||||
continue;
|
||||
D.startsWith("data:") && (D = D.substring(5));
|
||||
const z = new MessageEvent("message", {
|
||||
data: D
|
||||
});
|
||||
T(z);
|
||||
}
|
||||
x.read().then(j).catch(v);
|
||||
};
|
||||
x.read().then(j).catch(v);
|
||||
}).catch((h) => {
|
||||
console.error("Connection failed:", h), v(h);
|
||||
});
|
||||
});
|
||||
}
|
||||
const pr = ({ apiHost: N = "https://gptcloud.arc53.com", selectDocs: w = "default", apiKey: C = "docsgpt-public" }) => {
|
||||
const [u, E] = ke(() => typeof window < "u" && localStorage.getItem("docsGPTChatState") || "init"), [S, T] = ke(""), b = ur(null);
|
||||
Pe(() => {
|
||||
if (b.current) {
|
||||
const v = b.current;
|
||||
v.scrollTop = v.scrollHeight;
|
||||
}
|
||||
}, [S]), Pe(() => {
|
||||
localStorage.setItem("docsGPTChatState", u);
|
||||
}, [u]);
|
||||
const d = (v) => {
|
||||
T(""), v.preventDefault(), E(
|
||||
"processing"
|
||||
/* Processing */
|
||||
), setTimeout(() => {
|
||||
E(
|
||||
"answer"
|
||||
/* Answer */
|
||||
);
|
||||
}, 800);
|
||||
const h = v.currentTarget[0].value;
|
||||
dr({
|
||||
question: h,
|
||||
apiKey: C,
|
||||
selectedDocs: w,
|
||||
history: [],
|
||||
conversationId: null,
|
||||
apiHost: N,
|
||||
onEvent: (x) => {
|
||||
const p = JSON.parse(x.data);
|
||||
if (p.type === "end")
|
||||
E(
|
||||
"answer"
|
||||
/* Answer */
|
||||
);
|
||||
else if (p.type === "source") {
|
||||
let R;
|
||||
if (p.metadata && p.metadata.title) {
|
||||
const j = p.metadata.title.split("/");
|
||||
R = {
|
||||
title: j[j.length - 1],
|
||||
text: p.doc
|
||||
};
|
||||
} else
|
||||
R = { title: p.doc, text: p.doc };
|
||||
console.log(R);
|
||||
} else if (p.type === "id")
|
||||
console.log(p.id);
|
||||
else {
|
||||
const R = p.answer;
|
||||
T((j) => j + R);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
return /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsxs("div", { className: "dark widget-container", children: [
|
||||
/* @__PURE__ */ l.jsx(
|
||||
"div",
|
||||
{
|
||||
onClick: () => E(
|
||||
"init"
|
||||
/* Init */
|
||||
),
|
||||
className: `${u !== "minimized" ? "hidden" : ""} cursor-pointer`,
|
||||
children: /* @__PURE__ */ l.jsx("div", { className: "mr-2 mb-2 w-20 h-20 rounded-full overflow-hidden dark:divide-gray-700 border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm flex items-center justify-center", children: /* @__PURE__ */ l.jsx(
|
||||
"img",
|
||||
{
|
||||
src: "https://d3dg1063dc54p9.cloudfront.net/cute-docsgpt.png",
|
||||
alt: "DocsGPT",
|
||||
className: "cursor-pointer hover:opacity-50 h-14"
|
||||
}
|
||||
) })
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ l.jsxs("div", { className: ` ${u !== "minimized" ? "" : "hidden"} divide-y dark:divide-gray-700 rounded-md border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm`, style: { width: "18rem", transform: "translateY(0%) translateZ(0px)" }, children: [
|
||||
/* @__PURE__ */ l.jsxs("div", { children: [
|
||||
/* @__PURE__ */ l.jsx(
|
||||
"img",
|
||||
{
|
||||
src: "https://d3dg1063dc54p9.cloudfront.net/exit.svg",
|
||||
alt: "Exit",
|
||||
className: "cursor-pointer hover:opacity-50 h-2 absolute top-0 right-0 m-2 white-filter",
|
||||
onClick: (v) => {
|
||||
v.stopPropagation(), E(
|
||||
"minimized"
|
||||
/* Minimized */
|
||||
);
|
||||
}
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2 p-3", children: [
|
||||
/* @__PURE__ */ l.jsxs("div", { className: `${u === "init" || u === "processing" || u === "typing" ? "" : "hidden"} flex-1`, children: [
|
||||
/* @__PURE__ */ l.jsx("h3", { className: "text-sm font-bold text-gray-700 dark:text-gray-200", children: "Need help with documentation?" }),
|
||||
/* @__PURE__ */ l.jsx("p", { className: "mt-1 text-xs text-gray-400 dark:text-gray-500", children: "DocsGPT AI assistant will help you with docs" })
|
||||
] }),
|
||||
/* @__PURE__ */ l.jsx("div", { id: "docsgpt-answer", ref: b, className: `${u !== "answer" ? "hidden" : ""}`, children: /* @__PURE__ */ l.jsx("p", { className: "mt-1 text-sm text-gray-600 dark:text-white text-left", children: S }) })
|
||||
] })
|
||||
] }),
|
||||
/* @__PURE__ */ l.jsxs("div", { className: "w-full", children: [
|
||||
/* @__PURE__ */ l.jsx(
|
||||
"button",
|
||||
{
|
||||
onClick: () => E(
|
||||
"typing"
|
||||
/* Typing */
|
||||
),
|
||||
className: `flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 hover:bg-gray-100 rounded-b dark:hover:bg-gray-800/70 ${u !== "init" ? "hidden" : ""}`,
|
||||
children: "Ask DocsGPT"
|
||||
}
|
||||
),
|
||||
(u === "typing" || u === "answer") && /* @__PURE__ */ l.jsxs(
|
||||
"form",
|
||||
{
|
||||
onSubmit: d,
|
||||
className: "relative w-full m-0",
|
||||
style: { opacity: 1 },
|
||||
children: [
|
||||
/* @__PURE__ */ l.jsx(
|
||||
"input",
|
||||
{
|
||||
type: "text",
|
||||
className: "w-full bg-transparent px-5 py-3 pr-8 text-sm text-gray-700 dark:text-white focus:outline-none",
|
||||
placeholder: "What do you want to do?"
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ l.jsx("button", { className: "absolute text-gray-400 dark:text-gray-500 text-sm inset-y-0 right-2 -mx-2 px-2", type: "submit", children: "Submit" })
|
||||
]
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ l.jsxs("p", { className: `${u !== "processing" ? "hidden" : ""} flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 rounded-b`, children: [
|
||||
"Processing",
|
||||
/* @__PURE__ */ l.jsx("span", { className: "dot-animation", children: "." }),
|
||||
/* @__PURE__ */ l.jsx("span", { className: "dot-animation delay-200", children: "." }),
|
||||
/* @__PURE__ */ l.jsx("span", { className: "dot-animation delay-400", children: "." })
|
||||
] })
|
||||
] })
|
||||
] })
|
||||
] }) });
|
||||
};
|
||||
export {
|
||||
pr as DocsGPTWidget
|
||||
};
|
||||
//# sourceMappingURL=index.es.js.map
|
||||
1
extensions/react-widget/dist/index.es.js.map
vendored
1
extensions/react-widget/dist/index.es.js.map
vendored
File diff suppressed because one or more lines are too long
29
extensions/react-widget/dist/index.umd.js
vendored
29
extensions/react-widget/dist/index.umd.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3
extensions/react-widget/dist/src/App.d.ts
vendored
3
extensions/react-widget/dist/src/App.d.ts
vendored
@@ -1,3 +0,0 @@
|
||||
/// <reference types="react" />
|
||||
declare function App(): JSX.Element;
|
||||
export default App;
|
||||
@@ -1,5 +0,0 @@
|
||||
export declare const DocsGPTWidget: ({ apiHost, selectDocs, apiKey }: {
|
||||
apiHost?: string | undefined;
|
||||
selectDocs?: string | undefined;
|
||||
apiKey?: string | undefined;
|
||||
}) => JSX.Element;
|
||||
@@ -1 +0,0 @@
|
||||
export { DocsGPTWidget } from "./DocsGPTWidget";
|
||||
762
extensions/react-widget/dist/style.css
vendored
762
extensions/react-widget/dist/style.css
vendored
@@ -1,762 +0,0 @@
|
||||
/*
|
||||
! tailwindcss v3.2.4 | MIT License | https://tailwindcss.com
|
||||
*//*
|
||||
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
||||
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
||||
*/
|
||||
|
||||
*,
|
||||
::before,
|
||||
::after {
|
||||
box-sizing: border-box; /* 1 */
|
||||
border-width: 0; /* 2 */
|
||||
border-style: solid; /* 2 */
|
||||
border-color: #e5e7eb; /* 2 */
|
||||
}
|
||||
|
||||
::before,
|
||||
::after {
|
||||
--tw-content: '';
|
||||
}
|
||||
|
||||
/*
|
||||
1. Use a consistent sensible line-height in all browsers.
|
||||
2. Prevent adjustments of font size after orientation changes in iOS.
|
||||
3. Use a more readable tab size.
|
||||
4. Use the user's configured `sans` font-family by default.
|
||||
5. Use the user's configured `sans` font-feature-settings by default.
|
||||
*/
|
||||
|
||||
html {
|
||||
line-height: 1.5; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
-moz-tab-size: 4; /* 3 */
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4; /* 3 */
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
|
||||
font-feature-settings: normal; /* 5 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Remove the margin in all browsers.
|
||||
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0; /* 1 */
|
||||
line-height: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Add the correct height in Firefox.
|
||||
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
|
||||
3. Ensure horizontal rules are visible by default.
|
||||
*/
|
||||
|
||||
hr {
|
||||
height: 0; /* 1 */
|
||||
color: inherit; /* 2 */
|
||||
border-top-width: 1px; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct text decoration in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
abbr:where([title]) {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the default font size and weight for headings.
|
||||
*/
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
Reset links to optimize for opt-in styling instead of opt-out.
|
||||
*/
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct font weight in Edge and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Use the user's configured `mono` font family by default.
|
||||
2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp,
|
||||
pre {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/*
|
||||
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
|
||||
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
|
||||
3. Remove gaps between table borders by default.
|
||||
*/
|
||||
|
||||
table {
|
||||
text-indent: 0; /* 1 */
|
||||
border-color: inherit; /* 2 */
|
||||
border-collapse: collapse; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Change the font styles in all browsers.
|
||||
2. Remove the margin in Firefox and Safari.
|
||||
3. Remove default padding in all browsers.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 1 */
|
||||
font-weight: inherit; /* 1 */
|
||||
line-height: inherit; /* 1 */
|
||||
color: inherit; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
padding: 0; /* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the inheritance of text transform in Edge and Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Remove default button styles.
|
||||
*/
|
||||
|
||||
button,
|
||||
[type='button'],
|
||||
[type='reset'],
|
||||
[type='submit'] {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
background-color: transparent; /* 2 */
|
||||
background-image: none; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Use the modern Firefox focus style for all focusable elements.
|
||||
*/
|
||||
|
||||
:-moz-focusring {
|
||||
outline: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
|
||||
*/
|
||||
|
||||
:-moz-ui-invalid {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct vertical alignment in Chrome and Firefox.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/*
|
||||
Correct the cursor style of increment and decrement buttons in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-inner-spin-button,
|
||||
::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the odd appearance in Chrome and Safari.
|
||||
2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type='search'] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct display in Chrome and Safari.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/*
|
||||
Removes the default spacing and border for appropriate elements.
|
||||
*/
|
||||
|
||||
blockquote,
|
||||
dl,
|
||||
dd,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
hr,
|
||||
figure,
|
||||
p,
|
||||
pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
menu {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Prevent resizing textareas horizontally by default.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
|
||||
2. Set the default placeholder color to the user's configured gray 400 color.
|
||||
*/
|
||||
|
||||
input::-moz-placeholder, textarea::-moz-placeholder {
|
||||
opacity: 1; /* 1 */
|
||||
color: #9ca3af; /* 2 */
|
||||
}
|
||||
|
||||
input::placeholder,
|
||||
textarea::placeholder {
|
||||
opacity: 1; /* 1 */
|
||||
color: #9ca3af; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Set the default cursor for buttons.
|
||||
*/
|
||||
|
||||
button,
|
||||
[role="button"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*
|
||||
Make sure disabled buttons don't get the pointer cursor.
|
||||
*/
|
||||
:disabled {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
|
||||
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
|
||||
This can trigger a poorly considered lint error in some tools but is included by design.
|
||||
*/
|
||||
|
||||
img,
|
||||
svg,
|
||||
video,
|
||||
canvas,
|
||||
audio,
|
||||
iframe,
|
||||
embed,
|
||||
object {
|
||||
display: block; /* 1 */
|
||||
vertical-align: middle; /* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
|
||||
*/
|
||||
|
||||
img,
|
||||
video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Make elements with the HTML hidden attribute stay hidden by default */
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
*, ::before, ::after {
|
||||
--tw-border-spacing-x: 0;
|
||||
--tw-border-spacing-y: 0;
|
||||
--tw-translate-x: 0;
|
||||
--tw-translate-y: 0;
|
||||
--tw-rotate: 0;
|
||||
--tw-skew-x: 0;
|
||||
--tw-skew-y: 0;
|
||||
--tw-scale-x: 1;
|
||||
--tw-scale-y: 1;
|
||||
--tw-pan-x: ;
|
||||
--tw-pan-y: ;
|
||||
--tw-pinch-zoom: ;
|
||||
--tw-scroll-snap-strictness: proximity;
|
||||
--tw-ordinal: ;
|
||||
--tw-slashed-zero: ;
|
||||
--tw-numeric-figure: ;
|
||||
--tw-numeric-spacing: ;
|
||||
--tw-numeric-fraction: ;
|
||||
--tw-ring-inset: ;
|
||||
--tw-ring-offset-width: 0px;
|
||||
--tw-ring-offset-color: #fff;
|
||||
--tw-ring-color: rgb(59 130 246 / 0.5);
|
||||
--tw-ring-offset-shadow: 0 0 #0000;
|
||||
--tw-ring-shadow: 0 0 #0000;
|
||||
--tw-shadow: 0 0 #0000;
|
||||
--tw-shadow-colored: 0 0 #0000;
|
||||
--tw-blur: ;
|
||||
--tw-brightness: ;
|
||||
--tw-contrast: ;
|
||||
--tw-grayscale: ;
|
||||
--tw-hue-rotate: ;
|
||||
--tw-invert: ;
|
||||
--tw-saturate: ;
|
||||
--tw-sepia: ;
|
||||
--tw-drop-shadow: ;
|
||||
--tw-backdrop-blur: ;
|
||||
--tw-backdrop-brightness: ;
|
||||
--tw-backdrop-contrast: ;
|
||||
--tw-backdrop-grayscale: ;
|
||||
--tw-backdrop-hue-rotate: ;
|
||||
--tw-backdrop-invert: ;
|
||||
--tw-backdrop-opacity: ;
|
||||
--tw-backdrop-saturate: ;
|
||||
--tw-backdrop-sepia: ;
|
||||
}
|
||||
|
||||
::backdrop {
|
||||
--tw-border-spacing-x: 0;
|
||||
--tw-border-spacing-y: 0;
|
||||
--tw-translate-x: 0;
|
||||
--tw-translate-y: 0;
|
||||
--tw-rotate: 0;
|
||||
--tw-skew-x: 0;
|
||||
--tw-skew-y: 0;
|
||||
--tw-scale-x: 1;
|
||||
--tw-scale-y: 1;
|
||||
--tw-pan-x: ;
|
||||
--tw-pan-y: ;
|
||||
--tw-pinch-zoom: ;
|
||||
--tw-scroll-snap-strictness: proximity;
|
||||
--tw-ordinal: ;
|
||||
--tw-slashed-zero: ;
|
||||
--tw-numeric-figure: ;
|
||||
--tw-numeric-spacing: ;
|
||||
--tw-numeric-fraction: ;
|
||||
--tw-ring-inset: ;
|
||||
--tw-ring-offset-width: 0px;
|
||||
--tw-ring-offset-color: #fff;
|
||||
--tw-ring-color: rgb(59 130 246 / 0.5);
|
||||
--tw-ring-offset-shadow: 0 0 #0000;
|
||||
--tw-ring-shadow: 0 0 #0000;
|
||||
--tw-shadow: 0 0 #0000;
|
||||
--tw-shadow-colored: 0 0 #0000;
|
||||
--tw-blur: ;
|
||||
--tw-brightness: ;
|
||||
--tw-contrast: ;
|
||||
--tw-grayscale: ;
|
||||
--tw-hue-rotate: ;
|
||||
--tw-invert: ;
|
||||
--tw-saturate: ;
|
||||
--tw-sepia: ;
|
||||
--tw-drop-shadow: ;
|
||||
--tw-backdrop-blur: ;
|
||||
--tw-backdrop-brightness: ;
|
||||
--tw-backdrop-contrast: ;
|
||||
--tw-backdrop-grayscale: ;
|
||||
--tw-backdrop-hue-rotate: ;
|
||||
--tw-backdrop-invert: ;
|
||||
--tw-backdrop-opacity: ;
|
||||
--tw-backdrop-saturate: ;
|
||||
--tw-backdrop-sepia: ;
|
||||
}
|
||||
.absolute {
|
||||
position: absolute;
|
||||
}
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
.inset-y-0 {
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
.top-0 {
|
||||
top: 0px;
|
||||
}
|
||||
.right-0 {
|
||||
right: 0px;
|
||||
}
|
||||
.right-2 {
|
||||
right: 0.5rem;
|
||||
}
|
||||
.m-2 {
|
||||
margin: 0.5rem;
|
||||
}
|
||||
.m-0 {
|
||||
margin: 0px;
|
||||
}
|
||||
.-mx-2 {
|
||||
margin-left: -0.5rem;
|
||||
margin-right: -0.5rem;
|
||||
}
|
||||
.mr-2 {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
.mb-2 {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
.mt-1 {
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
.h-20 {
|
||||
height: 5rem;
|
||||
}
|
||||
.h-14 {
|
||||
height: 3.5rem;
|
||||
}
|
||||
.h-2 {
|
||||
height: 0.5rem;
|
||||
}
|
||||
.w-20 {
|
||||
width: 5rem;
|
||||
}
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
.flex-1 {
|
||||
flex: 1 1 0%;
|
||||
}
|
||||
.transform {
|
||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||
}
|
||||
.cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
.items-center {
|
||||
align-items: center;
|
||||
}
|
||||
.justify-center {
|
||||
justify-content: center;
|
||||
}
|
||||
.gap-2 {
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.divide-y > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-divide-y-reverse: 0;
|
||||
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
||||
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
||||
}
|
||||
.overflow-hidden {
|
||||
overflow: hidden;
|
||||
}
|
||||
.rounded-full {
|
||||
border-radius: 9999px;
|
||||
}
|
||||
.rounded-md {
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
.rounded-b {
|
||||
border-bottom-right-radius: 0.25rem;
|
||||
border-bottom-left-radius: 0.25rem;
|
||||
}
|
||||
.border {
|
||||
border-width: 1px;
|
||||
}
|
||||
.bg-transparent {
|
||||
background-color: transparent;
|
||||
}
|
||||
.bg-gradient-to-br {
|
||||
background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
|
||||
}
|
||||
.from-gray-100\/80 {
|
||||
--tw-gradient-from: rgb(243 244 246 / 0.8);
|
||||
--tw-gradient-to: rgb(243 244 246 / 0);
|
||||
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
|
||||
}
|
||||
.via-white {
|
||||
--tw-gradient-to: rgb(255 255 255 / 0);
|
||||
--tw-gradient-stops: var(--tw-gradient-from), #fff, var(--tw-gradient-to);
|
||||
}
|
||||
.to-white {
|
||||
--tw-gradient-to: #fff;
|
||||
}
|
||||
.p-3 {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
.px-5 {
|
||||
padding-left: 1.25rem;
|
||||
padding-right: 1.25rem;
|
||||
}
|
||||
.py-3 {
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
}
|
||||
.px-2 {
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
}
|
||||
.pr-8 {
|
||||
padding-right: 2rem;
|
||||
}
|
||||
.text-left {
|
||||
text-align: left;
|
||||
}
|
||||
.font-sans {
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
}
|
||||
.text-sm {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.25rem;
|
||||
}
|
||||
.text-xs {
|
||||
font-size: 0.75rem;
|
||||
line-height: 1rem;
|
||||
}
|
||||
.font-bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
.text-gray-700 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(55 65 81 / var(--tw-text-opacity));
|
||||
}
|
||||
.text-gray-400 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(156 163 175 / var(--tw-text-opacity));
|
||||
}
|
||||
.text-gray-600 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(75 85 99 / var(--tw-text-opacity));
|
||||
}
|
||||
.text-gray-800 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(31 41 55 / var(--tw-text-opacity));
|
||||
}
|
||||
.shadow {
|
||||
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
||||
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
||||
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
||||
}
|
||||
.backdrop-blur-sm {
|
||||
--tw-backdrop-blur: blur(4px);
|
||||
-webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
||||
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
||||
}
|
||||
.transition {
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
.delay-200 {
|
||||
transition-delay: 200ms;
|
||||
}
|
||||
.duration-300 {
|
||||
transition-duration: 300ms;
|
||||
}
|
||||
|
||||
#docsgpt-answer {
|
||||
max-height: 50vh; /* 50% of the viewport height */
|
||||
overflow-y: auto; /* Adds a vertical scrollbar if the content exceeds the container height */
|
||||
}
|
||||
|
||||
.widget-container {
|
||||
position: fixed; /* fixed positioning */
|
||||
right: 10px; /* from the right edge */
|
||||
bottom: 10px; /* from the bottom edge */
|
||||
z-index: 1000; /* to ensure it appears on top of other content, if any */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@keyframes dotBounce {
|
||||
0%, 80%, 100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
40% {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
}
|
||||
|
||||
.dot-animation {
|
||||
display: inline-block;
|
||||
animation: dotBounce 1s infinite ease-in-out;
|
||||
}
|
||||
|
||||
.delay-200 {
|
||||
animation-delay: 200ms;
|
||||
}
|
||||
|
||||
.delay-400 {
|
||||
animation-delay: 400ms;
|
||||
}
|
||||
|
||||
.white-filter {
|
||||
filter: invert(1) brightness(2);
|
||||
}
|
||||
|
||||
.hover\:bg-gray-100:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.hover\:opacity-50:hover {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.focus\:outline-none:focus {
|
||||
outline: 2px solid transparent;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
|
||||
.dark\:divide-gray-700 > :not([hidden]) ~ :not([hidden]) {
|
||||
--tw-divide-opacity: 1;
|
||||
border-color: rgb(55 65 81 / var(--tw-divide-opacity));
|
||||
}
|
||||
|
||||
.dark\:border-gray-700 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(55 65 81 / var(--tw-border-opacity));
|
||||
}
|
||||
|
||||
.dark\:from-gray-900\/80 {
|
||||
--tw-gradient-from: rgb(17 24 39 / 0.8);
|
||||
--tw-gradient-to: rgb(17 24 39 / 0);
|
||||
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
|
||||
}
|
||||
|
||||
.dark\:via-gray-900 {
|
||||
--tw-gradient-to: rgb(17 24 39 / 0);
|
||||
--tw-gradient-stops: var(--tw-gradient-from), #111827, var(--tw-gradient-to);
|
||||
}
|
||||
|
||||
.dark\:to-gray-900 {
|
||||
--tw-gradient-to: #111827;
|
||||
}
|
||||
|
||||
.dark\:text-gray-200 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(229 231 235 / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.dark\:text-gray-500 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(107 114 128 / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.dark\:text-white {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(255 255 255 / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.dark\:hover\:bg-gray-800\/70:hover {
|
||||
background-color: rgb(31 41 55 / 0.7);
|
||||
}
|
||||
}
|
||||
1
extensions/react-widget/dist/vite.svg
vendored
1
extensions/react-widget/dist/vite.svg
vendored
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
3858
extensions/react-widget/package-lock.json
generated
3858
extensions/react-widget/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,64 +1,38 @@
|
||||
{
|
||||
"name": "docsgpt",
|
||||
"private": false,
|
||||
"version": "0.2.4",
|
||||
"name": "shadcn",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "dist/index.umd.js",
|
||||
"module": "dist/index.es.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.es.js",
|
||||
"require": "./dist/index.umd.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"./dist/style.css": "./dist/style.css"
|
||||
},
|
||||
"files": [
|
||||
"/dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"prepare": "npm run build && npm run build-css",
|
||||
"build-css": "postcss src/index.css -o dist/style.css",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"postcss-cli": "^10.1.0",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@radix-ui/react-slot": "^1.0.2",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.1.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"tailwindcss": "^3.2.4"
|
||||
"tailwind-merge": "^2.2.1",
|
||||
"tailwindcss-animate": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.0.26",
|
||||
"@types/react-dom": "^18.0.9",
|
||||
"@vitejs/plugin-react-swc": "^3.5.0",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"postcss": "^8.4.31",
|
||||
"typescript": "^4.9.3",
|
||||
"vite": "^5.0.12",
|
||||
"vite-plugin-dts": "^3.7.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/arc53/DocsGPT.git"
|
||||
},
|
||||
"keywords": [
|
||||
"docsgpt",
|
||||
"chatbot",
|
||||
"assistant",
|
||||
"ai",
|
||||
"chatdocs",
|
||||
"widget"
|
||||
],
|
||||
"author": "Arc53",
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/arc53/DocsGPT/issues"
|
||||
},
|
||||
"homepage": "https://github.com/arc53/DocsGPT#readme"
|
||||
"@types/node": "^20.11.19",
|
||||
"@types/react": "^18.2.55",
|
||||
"@types/react-dom": "^18.2.19",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"autoprefixer": "^10.4.17",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.5",
|
||||
"postcss": "^8.4.35",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import { useState } from "react";
|
||||
//import "./App.css";
|
||||
import {DocsGPTWidget} from "./components/DocsGPTWidget";
|
||||
import { DocsGPTWidget } from '..'
|
||||
|
||||
function App() {
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
<DocsGPTWidget />
|
||||
</div>
|
||||
);
|
||||
<>
|
||||
<div>
|
||||
<DocsGPTWidget/>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default App;
|
||||
export default App
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
"use client";
|
||||
import {useEffect, useRef, useState} from 'react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { PaperPlaneIcon } from '@radix-ui/react-icons';
|
||||
import { Input } from './ui/input';
|
||||
import { Button } from './ui/button';
|
||||
|
||||
//import './style.css'
|
||||
|
||||
interface HistoryItem {
|
||||
@@ -33,7 +37,7 @@ function fetchAnswerStreaming({
|
||||
history = [],
|
||||
conversationId = null,
|
||||
apiHost = '',
|
||||
onEvent = () => {console.log("Event triggered, but no handler provided.");}
|
||||
onEvent = () => { console.log("Event triggered, but no handler provided."); }
|
||||
}: FetchAnswerStreamingProps): Promise<void> {
|
||||
let docPath = 'default';
|
||||
if (selectedDocs) {
|
||||
@@ -107,140 +111,169 @@ function fetchAnswerStreaming({
|
||||
});
|
||||
}
|
||||
|
||||
export const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDocs = 'default', apiKey = 'docsgpt-public'}) => {
|
||||
// processing states
|
||||
const [chatState, setChatState] = useState<ChatStates>(() => {
|
||||
if (typeof window !== 'undefined') {
|
||||
return localStorage.getItem('docsGPTChatState') as ChatStates || ChatStates.Init;
|
||||
}
|
||||
return ChatStates.Init;
|
||||
});
|
||||
|
||||
const [answer, setAnswer] = useState<string>('');
|
||||
|
||||
//const selectDocs = 'local/1706.03762.pdf/'
|
||||
const answerRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (answerRef.current) {
|
||||
const element = answerRef.current;
|
||||
element.scrollTop = element.scrollHeight;
|
||||
}
|
||||
}, [answer]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem('docsGPTChatState', chatState);
|
||||
}, [chatState]);
|
||||
|
||||
|
||||
|
||||
// submit handler
|
||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||
setAnswer('')
|
||||
e.preventDefault()
|
||||
// get question
|
||||
setChatState(ChatStates.Processing)
|
||||
setTimeout(() => {
|
||||
setChatState(ChatStates.Answer)
|
||||
}, 800)
|
||||
const inputElement = e.currentTarget[0] as HTMLInputElement;
|
||||
const questionValue = inputElement.value;
|
||||
|
||||
fetchAnswerStreaming({
|
||||
question: questionValue,
|
||||
apiKey: apiKey,
|
||||
selectedDocs: selectDocs,
|
||||
history: [],
|
||||
conversationId: null,
|
||||
apiHost: apiHost,
|
||||
onEvent: (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
|
||||
// check if the 'end' event has been received
|
||||
if (data.type === 'end') {
|
||||
setChatState(ChatStates.Answer)
|
||||
} else if (data.type === 'source') {
|
||||
// check if data.metadata exists
|
||||
let result;
|
||||
if (data.metadata && data.metadata.title) {
|
||||
const titleParts = data.metadata.title.split('/');
|
||||
result = {
|
||||
title: titleParts[titleParts.length - 1],
|
||||
text: data.doc,
|
||||
};
|
||||
} else {
|
||||
result = { title: data.doc, text: data.doc };
|
||||
}
|
||||
console.log(result)
|
||||
|
||||
} else if (data.type === 'id') {
|
||||
console.log(data.id);
|
||||
} else {
|
||||
const result = data.answer;
|
||||
// set answer by appending answer
|
||||
setAnswer(prevAnswer => prevAnswer + result);
|
||||
}
|
||||
},
|
||||
});
|
||||
export const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDocs = 'default', apiKey = 'docsgpt-public' }) => {
|
||||
// processing states
|
||||
const [chatState, setChatState] = useState<ChatStates>(() => {
|
||||
if (typeof window !== 'undefined') {
|
||||
return localStorage.getItem('docsGPTChatState') as ChatStates || ChatStates.Init;
|
||||
}
|
||||
return ChatStates.Init;
|
||||
});
|
||||
|
||||
const [answer, setAnswer] = useState<string>('');
|
||||
|
||||
//const selectDocs = 'local/1706.03762.pdf/'
|
||||
const answerRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (answerRef.current) {
|
||||
const element = answerRef.current;
|
||||
element.scrollTop = element.scrollHeight;
|
||||
}
|
||||
}, [answer]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem('docsGPTChatState', chatState);
|
||||
}, [chatState]);
|
||||
|
||||
|
||||
|
||||
// submit handler
|
||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||
setAnswer('')
|
||||
e.preventDefault()
|
||||
// get question
|
||||
setChatState(ChatStates.Processing)
|
||||
setTimeout(() => {
|
||||
setChatState(ChatStates.Answer)
|
||||
}, 800)
|
||||
const inputElement = e.currentTarget[0] as HTMLInputElement;
|
||||
const questionValue = inputElement.value;
|
||||
|
||||
fetchAnswerStreaming({
|
||||
question: questionValue,
|
||||
apiKey: apiKey,
|
||||
selectedDocs: selectDocs,
|
||||
history: [],
|
||||
conversationId: null,
|
||||
apiHost: apiHost,
|
||||
onEvent: (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
|
||||
// check if the 'end' event has been received
|
||||
if (data.type === 'end') {
|
||||
setChatState(ChatStates.Answer)
|
||||
} else if (data.type === 'source') {
|
||||
// check if data.metadata exists
|
||||
let result;
|
||||
if (data.metadata && data.metadata.title) {
|
||||
const titleParts = data.metadata.title.split('/');
|
||||
result = {
|
||||
title: titleParts[titleParts.length - 1],
|
||||
text: data.doc,
|
||||
};
|
||||
} else {
|
||||
result = { title: data.doc, text: data.doc };
|
||||
}
|
||||
console.log(result)
|
||||
|
||||
} else if (data.type === 'id') {
|
||||
console.log(data.id);
|
||||
} else {
|
||||
const result = data.answer;
|
||||
// set answer by appending answer
|
||||
setAnswer(prevAnswer => prevAnswer + result);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="dark widget-container">
|
||||
<div onClick={() => setChatState(ChatStates.Init)}
|
||||
className={`${chatState !== 'minimized' ? 'hidden' : ''} cursor-pointer`}>
|
||||
<div className="mr-2 mb-2 w-20 h-20 rounded-full overflow-hidden dark:divide-gray-700 border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm flex items-center justify-center">
|
||||
<img
|
||||
src="https://d3dg1063dc54p9.cloudfront.net/cute-docsgpt.png"
|
||||
alt="DocsGPT"
|
||||
className="cursor-pointer hover:opacity-50 h-14"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={` ${chatState !== 'minimized' ? '' : 'hidden'} divide-y dark:divide-gray-700 rounded-md border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm`} style={{ width: '18rem', transform: 'translateY(0%) translateZ(0px)' }}>
|
||||
<div>
|
||||
<img
|
||||
src="https://d3dg1063dc54p9.cloudfront.net/exit.svg"
|
||||
alt="Exit"
|
||||
className="cursor-pointer hover:opacity-50 h-2 absolute top-0 right-0 m-2 white-filter"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
setChatState(ChatStates.Minimized);
|
||||
}}
|
||||
/>
|
||||
<div className="flex items-center gap-2 p-3">
|
||||
<div className={`${chatState === 'init' ? '' :
|
||||
chatState === 'processing' ? '' :
|
||||
chatState === 'typing' ? '' :
|
||||
'hidden'} flex-1`}>
|
||||
<h3 className="text-sm font-bold text-gray-700 dark:text-gray-200">Need help with documentation?</h3>
|
||||
<p className="mt-1 text-xs text-gray-400 dark:text-gray-500">DocsGPT AI assistant will help you with docs</p>
|
||||
</div>
|
||||
<div id="docsgpt-answer" ref={answerRef} className={`${chatState !== 'answer' ? 'hidden' : ''}`}>
|
||||
<p className="mt-1 text-sm text-gray-600 dark:text-white text-left">{answer}</p>
|
||||
</div>
|
||||
<div className="dark widget-container">
|
||||
<div onClick={() => setChatState(ChatStates.Init)}
|
||||
className={`${chatState !== 'minimized' ? 'hidden' : ''} cursor-pointer`}>
|
||||
<div className="mr-2 mb-2 w-20 h-20 rounded-full overflow-hidden dark:divide-gray-700 border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm flex items-center justify-center">
|
||||
<img
|
||||
src="https://d3dg1063dc54p9.cloudfront.net/cute-docsgpt.png"
|
||||
alt="DocsGPT"
|
||||
className="cursor-pointer hover:opacity-50 h-14"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<button onClick={() => setChatState(ChatStates.Typing)}
|
||||
className={`flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 hover:bg-gray-100 rounded-b dark:hover:bg-gray-800/70 ${chatState !== 'init' ? 'hidden' : ''}`}>
|
||||
Ask DocsGPT
|
||||
</button>
|
||||
{ (chatState === 'typing' || chatState === 'answer') && (
|
||||
<form
|
||||
onSubmit={handleSubmit}
|
||||
className="relative w-full m-0" style={{ opacity: 1 }}>
|
||||
<input type="text"
|
||||
className="w-full bg-transparent px-5 py-3 pr-8 text-sm text-gray-700 dark:text-white focus:outline-none" placeholder="What do you want to do?" />
|
||||
<button className="absolute text-gray-400 dark:text-gray-500 text-sm inset-y-0 right-2 -mx-2 px-2" type="submit" >Submit</button>
|
||||
</form>
|
||||
)}
|
||||
<p className={`${chatState !== 'processing' ? 'hidden' : ''} flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 rounded-b`}>
|
||||
Processing<span className="dot-animation">.</span><span className="dot-animation delay-200">.</span><span className="dot-animation delay-400">.</span>
|
||||
</p>
|
||||
<div className={` ${chatState !== 'minimized' ? '' : 'hidden'} divide-y dark:divide-gray-700 rounded-md border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm`} style={{ width: '18rem', transform: 'translateY(0%) translateZ(0px)' }}>
|
||||
<div>
|
||||
<img
|
||||
src="https://d3dg1063dc54p9.cloudfront.net/exit.svg"
|
||||
alt="Exit"
|
||||
className="cursor-pointer hover:opacity-50 h-2 absolute top-0 right-0 m-2 white-filter"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
setChatState(ChatStates.Minimized);
|
||||
}}
|
||||
/>
|
||||
<div className="flex items-center gap-2 p-3">
|
||||
<div className={`${chatState === 'init' ? '' :
|
||||
chatState === 'processing' ? '' :
|
||||
chatState === 'typing' ? '' :
|
||||
'hidden'} flex-1`}>
|
||||
<h3 className="text-sm font-bold text-gray-700 dark:text-gray-200">Need help with documentation?</h3>
|
||||
<p className="mt-1 text-xs text-gray-400 dark:text-gray-500">DocsGPT AI assistant will help you with docs</p>
|
||||
</div>
|
||||
<div id="docsgpt-answer" ref={answerRef} className={`${chatState !== 'answer' ? 'hidden' : ''}`}>
|
||||
<p className="mt-1 text-sm text-gray-600 dark:text-white text-left">{answer}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<button onClick={() => setChatState(ChatStates.Typing)}
|
||||
className={`flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 hover:bg-gray-100 rounded-b dark:hover:bg-gray-800/70 ${chatState !== 'init' ? 'hidden' : ''}`}>
|
||||
Ask DocsGPT
|
||||
</button>
|
||||
{(chatState === 'typing' || chatState === 'answer') && (
|
||||
<div>
|
||||
<div>
|
||||
<div className='flex justify-start m-2 '>
|
||||
<p className='dark:bg-slate-600 max-w-[80%] dark:text-white block p-2 rounded-lg'>
|
||||
Hi, How can I help you today ?
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className='flex justify-end m-2 '>
|
||||
<p className='dark:bg-blue-500 max-w-[80%] dark:text-black block p-2 rounded-lg '>
|
||||
Hey, I am having trouble with my account !
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className='flex justify-start m-2 '>
|
||||
<p className='dark:bg-slate-600 max-w-[80%] dark:text-white block p-2 rounded-lg'>
|
||||
What seems to be the problem ?
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className='flex justify-end m-2 '>
|
||||
<p className='dark:bg-blue-500 max-w-[80%] dark:text-black block p-2 rounded-lg '>
|
||||
I can't login
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<form
|
||||
onSubmit={handleSubmit}
|
||||
className="relative w-full m-0" style={{ opacity: 1 }}>
|
||||
<div className='p-2 flex justify-between'>
|
||||
<Input type='text'
|
||||
className="w-[85%] h-8 bg-transparent px-5 py-4 text-sm text-gray-700 dark:text-white focus:outline-none" placeholder="What do you want to do?" />
|
||||
<Button className="text-gray-400 dark:text-gray-500 dark:bg-blue-700 dark:hover:bg-blue-600 text-sm inset-y-0 px-2" type="submit" ><PaperPlaneIcon className='text-white' /></Button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
)}
|
||||
<p className={`${chatState !== 'processing' ? 'hidden' : ''} flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 rounded-b`}>
|
||||
Processing<span className="dot-animation">.</span><span className="dot-animation delay-200">.</span><span className="dot-animation delay-400">.</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</>
|
||||
)
|
||||
|
||||
57
extensions/react-widget/src/components/ui/button.tsx
Normal file
57
extensions/react-widget/src/components/ui/button.tsx
Normal file
@@ -0,0 +1,57 @@
|
||||
import * as React from "react"
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
import { cva, type VariantProps } from "class-variance-authority"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const buttonVariants = cva(
|
||||
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default:
|
||||
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
||||
destructive:
|
||||
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
||||
outline:
|
||||
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
||||
secondary:
|
||||
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
||||
link: "text-primary underline-offset-4 hover:underline",
|
||||
},
|
||||
size: {
|
||||
default: "h-9 px-4 py-2",
|
||||
sm: "h-8 rounded-md px-3 text-xs",
|
||||
lg: "h-10 rounded-md px-8",
|
||||
icon: "h-9 w-9",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: "default",
|
||||
size: "default",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
export interface ButtonProps
|
||||
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
VariantProps<typeof buttonVariants> {
|
||||
asChild?: boolean
|
||||
}
|
||||
|
||||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ className, variant, size, asChild = false, ...props }, ref) => {
|
||||
const Comp = asChild ? Slot : "button"
|
||||
return (
|
||||
<Comp
|
||||
className={cn(buttonVariants({ variant, size, className }))}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
)
|
||||
Button.displayName = "Button"
|
||||
|
||||
export { Button, buttonVariants }
|
||||
25
extensions/react-widget/src/components/ui/input.tsx
Normal file
25
extensions/react-widget/src/components/ui/input.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import * as React from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
export interface InputProps
|
||||
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
||||
|
||||
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
({ className, type, ...props }, ref) => {
|
||||
return (
|
||||
<input
|
||||
type={type}
|
||||
className={cn(
|
||||
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
||||
className
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
)
|
||||
Input.displayName = "Input"
|
||||
|
||||
export { Input }
|
||||
24
extensions/react-widget/src/components/ui/textarea.tsx
Normal file
24
extensions/react-widget/src/components/ui/textarea.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import * as React from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
export interface TextareaProps
|
||||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
||||
|
||||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
({ className, ...props }, ref) => {
|
||||
return (
|
||||
<textarea
|
||||
className={cn(
|
||||
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
||||
className
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
)
|
||||
Textarea.displayName = "Textarea"
|
||||
|
||||
export { Textarea }
|
||||
@@ -1,44 +1,117 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
|
||||
#docsgpt-answer {
|
||||
max-height: 50vh; /* 50% of the viewport height */
|
||||
overflow-y: auto; /* Adds a vertical scrollbar if the content exceeds the container height */
|
||||
max-height: 50vh; /* 50% of the viewport height */
|
||||
overflow-y: auto; /* Adds a vertical scrollbar if the content exceeds the container height */
|
||||
}
|
||||
|
||||
.widget-container {
|
||||
position: fixed; /* fixed positioning */
|
||||
right: 10px; /* from the right edge */
|
||||
bottom: 10px; /* from the bottom edge */
|
||||
z-index: 1000; /* to ensure it appears on top of other content, if any */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
position: fixed; /* fixed positioning */
|
||||
right: 10px; /* from the right edge */
|
||||
bottom: 10px; /* from the bottom edge */
|
||||
z-index: 1000; /* to ensure it appears on top of other content, if any */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@keyframes dotBounce {
|
||||
0%, 80%, 100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
40% {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
@keyframes dotBounce {
|
||||
0%, 80%, 100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.dot-animation {
|
||||
display: inline-block;
|
||||
animation: dotBounce 1s infinite ease-in-out;
|
||||
40% {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
}
|
||||
|
||||
.delay-200 {
|
||||
animation-delay: 200ms;
|
||||
.dot-animation {
|
||||
display: inline-block;
|
||||
animation: dotBounce 1s infinite ease-in-out;
|
||||
}
|
||||
|
||||
.delay-200 {
|
||||
animation-delay: 200ms;
|
||||
}
|
||||
|
||||
.delay-400 {
|
||||
animation-delay: 400ms;
|
||||
}
|
||||
|
||||
.white-filter {
|
||||
filter: invert(1) brightness(2);
|
||||
}
|
||||
|
||||
@layer base {
|
||||
:root {
|
||||
--background: 0 0% 100%;
|
||||
--foreground: 0 0% 3.9%;
|
||||
|
||||
--card: 0 0% 100%;
|
||||
--card-foreground: 0 0% 3.9%;
|
||||
|
||||
--popover: 0 0% 100%;
|
||||
--popover-foreground: 0 0% 3.9%;
|
||||
|
||||
--primary: 0 0% 9%;
|
||||
--primary-foreground: 0 0% 98%;
|
||||
|
||||
--secondary: 0 0% 96.1%;
|
||||
--secondary-foreground: 0 0% 9%;
|
||||
|
||||
--muted: 0 0% 96.1%;
|
||||
--muted-foreground: 0 0% 45.1%;
|
||||
|
||||
--accent: 0 0% 96.1%;
|
||||
--accent-foreground: 0 0% 9%;
|
||||
|
||||
--destructive: 0 84.2% 60.2%;
|
||||
--destructive-foreground: 0 0% 98%;
|
||||
|
||||
--border: 0 0% 89.8%;
|
||||
--input: 0 0% 89.8%;
|
||||
--ring: 0 0% 3.9%;
|
||||
|
||||
--radius: 0.5rem;
|
||||
}
|
||||
|
||||
.delay-400 {
|
||||
animation-delay: 400ms;
|
||||
|
||||
.dark {
|
||||
--background: 0 0% 3.9%;
|
||||
--foreground: 0 0% 98%;
|
||||
|
||||
--card: 0 0% 3.9%;
|
||||
--card-foreground: 0 0% 98%;
|
||||
|
||||
--popover: 0 0% 3.9%;
|
||||
--popover-foreground: 0 0% 98%;
|
||||
|
||||
--primary: 0 0% 98%;
|
||||
--primary-foreground: 0 0% 9%;
|
||||
|
||||
--secondary: 0 0% 14.9%;
|
||||
--secondary-foreground: 0 0% 98%;
|
||||
|
||||
--muted: 0 0% 14.9%;
|
||||
--muted-foreground: 0 0% 63.9%;
|
||||
|
||||
--accent: 0 0% 14.9%;
|
||||
--accent-foreground: 0 0% 98%;
|
||||
|
||||
--destructive: 0 62.8% 30.6%;
|
||||
--destructive-foreground: 0 0% 98%;
|
||||
|
||||
--border: 0 0% 14.9%;
|
||||
--input: 0 0% 14.9%;
|
||||
--ring: 0 0% 83.1%;
|
||||
}
|
||||
}
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
|
||||
.white-filter {
|
||||
filter: invert(1) brightness(2);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import App from './App'
|
||||
import App from './App.tsx'
|
||||
import './index.css'
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
77
extensions/react-widget/tailwind.config.js
Normal file
77
extensions/react-widget/tailwind.config.js
Normal file
@@ -0,0 +1,77 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
darkMode: ["class"],
|
||||
content: [
|
||||
'./pages/**/*.{ts,tsx}',
|
||||
'./components/**/*.{ts,tsx}',
|
||||
'./app/**/*.{ts,tsx}',
|
||||
'./src/**/*.{ts,tsx}',
|
||||
],
|
||||
prefix: "",
|
||||
theme: {
|
||||
container: {
|
||||
center: true,
|
||||
padding: "2rem",
|
||||
screens: {
|
||||
"2xl": "1400px",
|
||||
},
|
||||
},
|
||||
extend: {
|
||||
colors: {
|
||||
border: "hsl(var(--border))",
|
||||
input: "hsl(var(--input))",
|
||||
ring: "hsl(var(--ring))",
|
||||
background: "hsl(var(--background))",
|
||||
foreground: "hsl(var(--foreground))",
|
||||
primary: {
|
||||
DEFAULT: "hsl(var(--primary))",
|
||||
foreground: "hsl(var(--primary-foreground))",
|
||||
},
|
||||
secondary: {
|
||||
DEFAULT: "hsl(var(--secondary))",
|
||||
foreground: "hsl(var(--secondary-foreground))",
|
||||
},
|
||||
destructive: {
|
||||
DEFAULT: "hsl(var(--destructive))",
|
||||
foreground: "hsl(var(--destructive-foreground))",
|
||||
},
|
||||
muted: {
|
||||
DEFAULT: "hsl(var(--muted))",
|
||||
foreground: "hsl(var(--muted-foreground))",
|
||||
},
|
||||
accent: {
|
||||
DEFAULT: "hsl(var(--accent))",
|
||||
foreground: "hsl(var(--accent-foreground))",
|
||||
},
|
||||
popover: {
|
||||
DEFAULT: "hsl(var(--popover))",
|
||||
foreground: "hsl(var(--popover-foreground))",
|
||||
},
|
||||
card: {
|
||||
DEFAULT: "hsl(var(--card))",
|
||||
foreground: "hsl(var(--card-foreground))",
|
||||
},
|
||||
},
|
||||
borderRadius: {
|
||||
lg: "var(--radius)",
|
||||
md: "calc(var(--radius) - 2px)",
|
||||
sm: "calc(var(--radius) - 4px)",
|
||||
},
|
||||
keyframes: {
|
||||
"accordion-down": {
|
||||
from: { height: "0" },
|
||||
to: { height: "var(--radix-accordion-content-height)" },
|
||||
},
|
||||
"accordion-up": {
|
||||
from: { height: "var(--radix-accordion-content-height)" },
|
||||
to: { height: "0" },
|
||||
},
|
||||
},
|
||||
animation: {
|
||||
"accordion-down": "accordion-down 0.2s ease-out",
|
||||
"accordion-up": "accordion-up 0.2s ease-out",
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [require("tailwindcss-animate")],
|
||||
}
|
||||
@@ -1,23 +1,31 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./src/*"
|
||||
]
|
||||
},
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"declaration": true,
|
||||
"typeRoots": ["./dist/index.d.ts", "node_modules/@types"],
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx"
|
||||
"jsx": "react-jsx",
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": ["src", "./index.ts"],
|
||||
"include": ["src", "src/components/ui/input.tsx", "index.ts"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"allowSyntheticDefaultImports": true
|
||||
"moduleResolution": "bundler",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
|
||||
@@ -1,26 +1,12 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react-swc";
|
||||
import dts from "vite-plugin-dts";
|
||||
import path from "path";
|
||||
import path from "path"
|
||||
import react from "@vitejs/plugin-react"
|
||||
import { defineConfig } from "vite"
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, "index.ts"),
|
||||
name: "ViteButton",
|
||||
fileName: (format) => `index.${format}.js`,
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ["react", "react-dom"],
|
||||
output: {
|
||||
globals: {
|
||||
react: "React",
|
||||
"react-dom": "ReactDOM",
|
||||
},
|
||||
},
|
||||
},
|
||||
sourcemap: true,
|
||||
emptyOutDir: true,
|
||||
},
|
||||
plugins: [react(), dts()],
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user