@neo4j-ndl/react 4.0.7 → 4.0.9
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/lib/cjs/ai/presence/Presence.js +1 -1
- package/lib/cjs/ai/presence/Presence.js.map +1 -1
- package/lib/cjs/ai/presence/stories/ai-presence-default.story.js +1 -1
- package/lib/cjs/ai/presence/stories/ai-presence-default.story.js.map +1 -1
- package/lib/cjs/icons/manual/Neo4JAiColor.js +16 -4
- package/lib/cjs/icons/manual/Neo4JAiColor.js.map +1 -1
- package/lib/cjs/spotlight/SpotlightProvider.js +6 -2
- package/lib/cjs/spotlight/SpotlightProvider.js.map +1 -1
- package/lib/esm/ai/presence/Presence.js +1 -1
- package/lib/esm/ai/presence/Presence.js.map +1 -1
- package/lib/esm/ai/presence/stories/ai-presence-default.story.js +1 -1
- package/lib/esm/ai/presence/stories/ai-presence-default.story.js.map +1 -1
- package/lib/esm/icons/manual/Neo4JAiColor.js +16 -4
- package/lib/esm/icons/manual/Neo4JAiColor.js.map +1 -1
- package/lib/esm/spotlight/SpotlightProvider.js +6 -2
- package/lib/esm/spotlight/SpotlightProvider.js.map +1 -1
- package/lib/types/ai/presence/stories/ai-presence-default.story.d.ts.map +1 -1
- package/lib/types/icons/manual/Neo4JAiColor.d.ts +10 -5
- package/lib/types/icons/manual/Neo4JAiColor.d.ts.map +1 -1
- package/lib/types/spotlight/SpotlightProvider.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -46,7 +46,7 @@ const Presence = (_a) => {
|
|
|
46
46
|
});
|
|
47
47
|
const { theme } = (0, react_1.useNeedleTheme)();
|
|
48
48
|
const Component = theme === 'light' ? icons_1.Neo4JAiColorLightIcon : icons_1.Neo4JAiColorDarkIcon;
|
|
49
|
-
return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ ref: ref, className: classes, style: style }, restProps
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ ref: ref, className: classes, style: style, htmlAttributes: htmlAttributes }, restProps)));
|
|
50
50
|
};
|
|
51
51
|
exports.Presence = Presence;
|
|
52
52
|
Presence.displayName = 'Presence';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Presence.js","sourceRoot":"","sources":["../../../../src/ai/presence/Presence.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4CAAkD;AAElD,kDAGgC;AAChC,4DAAoC;AAOpC,MAAM,QAAQ,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EAChB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,cAAc,EACd,GAAG,OAE+B,EAD/B,SAAS,cANI,6DAOjB,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,iBAAiB,EAAE,SAAS,EAAE;QACvD,cAAc,EAAE,UAAU,KAAK,IAAI;KACpC,CAAC,CAAC;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAEnC,MAAM,SAAS,GACb,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,6BAAqB,CAAC,CAAC,CAAC,4BAAoB,CAAC;IAEnE,OAAO,CACL,uBAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"Presence.js","sourceRoot":"","sources":["../../../../src/ai/presence/Presence.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4CAAkD;AAElD,kDAGgC;AAChC,4DAAoC;AAOpC,MAAM,QAAQ,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EAChB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,cAAc,EACd,GAAG,OAE+B,EAD/B,SAAS,cANI,6DAOjB,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,iBAAiB,EAAE,SAAS,EAAE;QACvD,cAAc,EAAE,UAAU,KAAK,IAAI;KACpC,CAAC,CAAC;IACH,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,sBAAc,GAAE,CAAC;IAEnC,MAAM,SAAS,GACb,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,6BAAqB,CAAC,CAAC,CAAC,4BAAoB,CAAC;IAEnE,OAAO,CACL,uBAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,IAC1B,SAAS,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AAIO,4BAAQ;AAFjB,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useNeedleTheme } from '@neo4j-ndl/react';\nimport type { CommonProps } from '@neo4j-ndl/react/_common/types';\nimport {\n Neo4JAiColorDarkIcon,\n Neo4JAiColorLightIcon,\n} from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\n\ntype PresenceProps = {\n /** Whether the AI is thinking. Animates the underlying SVG */\n isThinking?: boolean;\n};\n\nconst Presence = ({\n className,\n isThinking = false,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'svg', PresenceProps>) => {\n const classes = classNames('ndl-ai-presence', className, {\n 'ndl-thinking': isThinking === true,\n });\n const { theme } = useNeedleTheme();\n\n const Component =\n theme === 'light' ? Neo4JAiColorLightIcon : Neo4JAiColorDarkIcon;\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...restProps}\n />\n );\n};\n\nPresence.displayName = 'Presence';\n\nexport { Presence };\n"]}
|
|
@@ -27,7 +27,7 @@ const ai_1 = require("@neo4j-ndl/react/ai");
|
|
|
27
27
|
const react_2 = require("react");
|
|
28
28
|
const Component = () => {
|
|
29
29
|
const [isThinking, setIsThinking] = (0, react_2.useState)(false);
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(ai_1.Presence, { className: "n-size-token-32", isThinking: isThinking }), (0, jsx_runtime_1.jsx)(react_1.FilledButton, {
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(ai_1.Presence, { className: "n-size-token-32", isThinking: isThinking }), (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => setIsThinking(!isThinking), children: "Toggle Thinking" })] }));
|
|
31
31
|
};
|
|
32
32
|
exports.default = Component;
|
|
33
33
|
//# sourceMappingURL=ai-presence-default.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-presence-default.story.js","sourceRoot":"","sources":["../../../../../src/ai/presence/stories/ai-presence-default.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAgD;AAChD,4CAA+C;AAC/C,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEpD,OAAO,CACL,iCAAK,SAAS,EAAC,sBAAsB,aACnC,uBAAC,aAAQ,IAAC,SAAS,EAAC,iBAAiB,EAAC,UAAU,EAAE,UAAU,GAAI,EAChE,uBAAC,oBAAY,
|
|
1
|
+
{"version":3,"file":"ai-presence-default.story.js","sourceRoot":"","sources":["../../../../../src/ai/presence/stories/ai-presence-default.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAgD;AAChD,4CAA+C;AAC/C,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEpD,OAAO,CACL,iCAAK,SAAS,EAAC,sBAAsB,aACnC,uBAAC,aAAQ,IAAC,SAAS,EAAC,iBAAiB,EAAC,UAAU,EAAE,UAAU,GAAI,EAChE,uBAAC,oBAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,gCAExC,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton } from '@neo4j-ndl/react';\nimport { Presence } from '@neo4j-ndl/react/ai';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isThinking, setIsThinking] = useState(false);\n\n return (\n <div className=\"n-flex n-gap-token-8\">\n <Presence className=\"n-size-token-32\" isThinking={isThinking} />\n <FilledButton onClick={() => setIsThinking(!isThinking)}>\n Toggle Thinking\n </FilledButton>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -20,21 +20,33 @@
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
"use strict";
|
|
23
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
24
|
+
var t = {};
|
|
25
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
26
|
+
t[p] = s[p];
|
|
27
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
28
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
29
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
30
|
+
t[p[i]] = s[p[i]];
|
|
31
|
+
}
|
|
32
|
+
return t;
|
|
33
|
+
};
|
|
23
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
35
|
exports.Neo4JAiColorDark = exports.Neo4JAiColorLight = void 0;
|
|
25
36
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
26
37
|
const react_1 = require("react");
|
|
27
38
|
const wrapIcon_1 = require("../wrapIcon");
|
|
28
|
-
const Neo4JAiColor = (
|
|
39
|
+
const Neo4JAiColor = (_a) => {
|
|
40
|
+
var { theme, className, style, ref, htmlAttributes } = _a, restProps = __rest(_a, ["theme", "className", "style", "ref", "htmlAttributes"]);
|
|
29
41
|
const uniqueId = (0, react_1.useId)();
|
|
30
42
|
const gradientId = `neo4j-ai-color-gradient-${theme}-${uniqueId}`;
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className:
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, ref: ref, style: style }, restProps, htmlAttributes, { children: [(0, jsx_runtime_1.jsxs)("defs", { children: [(0, jsx_runtime_1.jsxs)("linearGradient", { id: `neo4j-ai-color-gradient-light-${uniqueId}`, x1: "9.5", y1: "1.5", x2: "19", y2: "16", gradientUnits: "userSpaceOnUse", children: [(0, jsx_runtime_1.jsx)("stop", { stopColor: "#0A6190" }), (0, jsx_runtime_1.jsx)("stop", { offset: "1", stopColor: "#754EC8" })] }), (0, jsx_runtime_1.jsxs)("linearGradient", { id: `neo4j-ai-color-gradient-dark-${uniqueId}`, x1: "9.5", y1: "1.5", x2: "19", y2: "16", gradientUnits: "userSpaceOnUse", children: [(0, jsx_runtime_1.jsx)("stop", { stopColor: "#8FE3E8" }), (0, jsx_runtime_1.jsx)("stop", { offset: "1", stopColor: "#CCB4FF" })] })] }), (0, jsx_runtime_1.jsx)("circle", { cx: 5.5, cy: 5.5, r: 1.5, stroke: `url(#${gradientId})`, fill: `url(#${gradientId})`, strokeWidth: 1.5 }), (0, jsx_runtime_1.jsx)("circle", { cx: 18.5, cy: 18.5, r: 1.5, stroke: `url(#${gradientId})`, fill: `url(#${gradientId})`, strokeWidth: 1.5 }), (0, jsx_runtime_1.jsx)("path", { d: "M12.7885 15.6345L12 18L11.2115 15.6345C10.7636 14.2908 9.70919 13.2364 8.36546 12.7885L6 12L8.36546 11.2115C9.70919 10.7636 10.7636 9.70919 11.2115 8.36546L12 6L12.7885 8.36546C13.2364 9.70919 14.2908 10.7636 15.6345 11.2115L18 12L15.6345 12.7885C14.2908 13.2364 13.2364 14.2908 12.7885 15.6345Z", stroke: `url(#${gradientId})`, fill: `url(#${gradientId})`, strokeWidth: 1.5, strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M15 21.418C15 21.418 9.56707 23.7462 4.91039 19.0895C0.253721 14.4328 2.58211 9 2.58211 9", stroke: `url(#${gradientId})`, strokeWidth: 1.5, strokeLinecap: "round", pathLength: 100 }), (0, jsx_runtime_1.jsx)("path", { d: "M9 2.58204C9 2.58204 14.4329 0.253777 19.0896 4.9105C23.7463 9.56722 21.4179 15 21.4179 15", stroke: `url(#${gradientId})`, strokeWidth: 1.5, strokeLinecap: "round", pathLength: 100 })] })));
|
|
32
44
|
};
|
|
33
45
|
const Neo4JAiColorLightComponent = (props) => {
|
|
34
|
-
return (0, jsx_runtime_1.jsx)(Neo4JAiColor, { theme: "light",
|
|
46
|
+
return (0, jsx_runtime_1.jsx)(Neo4JAiColor, Object.assign({ theme: "light" }, props));
|
|
35
47
|
};
|
|
36
48
|
const Neo4JAiColorDarkComponent = (props) => {
|
|
37
|
-
return (0, jsx_runtime_1.jsx)(Neo4JAiColor, { theme: "dark",
|
|
49
|
+
return (0, jsx_runtime_1.jsx)(Neo4JAiColor, Object.assign({ theme: "dark" }, props));
|
|
38
50
|
};
|
|
39
51
|
const Neo4JAiColorLight = (0, wrapIcon_1.wrapIcon)(Neo4JAiColorLightComponent);
|
|
40
52
|
exports.Neo4JAiColorLight = Neo4JAiColorLight;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Neo4JAiColor.js","sourceRoot":"","sources":["../../../../src/icons/manual/Neo4JAiColor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Neo4JAiColor.js","sourceRoot":"","sources":["../../../../src/icons/manual/Neo4JAiColor.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAqBA,iCAA8B;AAE9B,0CAAuC;AAMvC,MAAM,YAAY,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EACpB,KAAK,EACL,SAAS,EACT,KAAK,EACL,GAAG,EACH,cAAc,OAEwB,EADnC,SAAS,cANQ,wDAOrB,CADa;IAEZ,MAAM,QAAQ,GAAG,IAAA,aAAK,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,2BAA2B,KAAK,IAAI,QAAQ,EAAE,CAAC;IAElE,OAAO,CACL,+CACE,OAAO,EAAC,WA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CACE,CAAC,EAAC,2FAA2F,EAC7F,MAAM,EAAE,QAAQ,UAAU,GAAG,EAC7B,WAAW,EAAE,GAAG,EAChB,aAAa,EAAC,OAAO,EACrB,UAAU,EAAE,GAAG,GACf,EACF,iCACE,CAAC,EAAC,4FAA4F,EAC9F,MAAM,EAAE,QAAQ,UAAU,GAAG,EAC7B,WAAW,EAAE,GAAG,EAChB,aAAa,EAAC,OAAO,EACrB,UAAU,EAAE,GAAG,GACf,KACE,CACP,CAAC;AACJ,CAAC,CAAC;AAIF,MAAM,0BAA0B,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3D,OAAO,uBAAC,YAAY,kBAAC,KAAK,EAAC,OAAO,IAAK,KAAK,EAAI,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1D,OAAO,uBAAC,YAAY,kBAAC,KAAK,EAAC,MAAM,IAAK,KAAK,EAAI,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,IAAA,mBAAQ,EAAC,0BAA0B,CAAC,CAAC;AAGtD,8CAAiB;AAF1B,MAAM,gBAAgB,GAAG,IAAA,mBAAQ,EAAC,yBAAyB,CAAC,CAAC;AAEjC,4CAAgB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type CommonProps } from '@neo4j-ndl/react/_common/types';\nimport { useId } from 'react';\n\nimport { wrapIcon } from '../wrapIcon';\n\ntype Neo4JAiColorProps = {\n theme: 'light' | 'dark';\n};\n\nconst Neo4JAiColor = ({\n theme,\n className,\n style,\n ref,\n htmlAttributes,\n ...restProps\n}: CommonProps<'svg', Neo4JAiColorProps>) => {\n const uniqueId = useId();\n const gradientId = `neo4j-ai-color-gradient-${theme}-${uniqueId}`;\n\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n ref={ref}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <defs>\n <linearGradient\n id={`neo4j-ai-color-gradient-light-${uniqueId}`}\n x1=\"9.5\"\n y1=\"1.5\"\n x2=\"19\"\n y2=\"16\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#0A6190\" />\n <stop offset=\"1\" stopColor=\"#754EC8\" />\n </linearGradient>\n <linearGradient\n id={`neo4j-ai-color-gradient-dark-${uniqueId}`}\n x1=\"9.5\"\n y1=\"1.5\"\n x2=\"19\"\n y2=\"16\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#8FE3E8\" />\n <stop offset=\"1\" stopColor=\"#CCB4FF\" />\n </linearGradient>\n </defs>\n <circle\n cx={5.5}\n cy={5.5}\n r={1.5}\n stroke={`url(#${gradientId})`}\n fill={`url(#${gradientId})`}\n strokeWidth={1.5}\n />\n <circle\n cx={18.5}\n cy={18.5}\n r={1.5}\n stroke={`url(#${gradientId})`}\n fill={`url(#${gradientId})`}\n strokeWidth={1.5}\n />\n <path\n d=\"M12.7885 15.6345L12 18L11.2115 15.6345C10.7636 14.2908 9.70919 13.2364 8.36546 12.7885L6 12L8.36546 11.2115C9.70919 10.7636 10.7636 9.70919 11.2115 8.36546L12 6L12.7885 8.36546C13.2364 9.70919 14.2908 10.7636 15.6345 11.2115L18 12L15.6345 12.7885C14.2908 13.2364 13.2364 14.2908 12.7885 15.6345Z\"\n stroke={`url(#${gradientId})`}\n fill={`url(#${gradientId})`}\n strokeWidth={1.5}\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M15 21.418C15 21.418 9.56707 23.7462 4.91039 19.0895C0.253721 14.4328 2.58211 9 2.58211 9\"\n stroke={`url(#${gradientId})`}\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n pathLength={100}\n />\n <path\n d=\"M9 2.58204C9 2.58204 14.4329 0.253777 19.0896 4.9105C23.7463 9.56722 21.4179 15 21.4179 15\"\n stroke={`url(#${gradientId})`}\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n pathLength={100}\n />\n </svg>\n );\n};\n\ntype ComponentProps = Omit<React.ComponentProps<typeof Neo4JAiColor>, 'theme'>;\n\nconst Neo4JAiColorLightComponent = (props: ComponentProps) => {\n return <Neo4JAiColor theme=\"light\" {...props} />;\n};\n\nconst Neo4JAiColorDarkComponent = (props: ComponentProps) => {\n return <Neo4JAiColor theme=\"dark\" {...props} />;\n};\n\nconst Neo4JAiColorLight = wrapIcon(Neo4JAiColorLightComponent);\nconst Neo4JAiColorDark = wrapIcon(Neo4JAiColorDarkComponent);\n\nexport { Neo4JAiColorLight, Neo4JAiColorDark };\n"]}
|
|
@@ -47,7 +47,9 @@ const SpotlightProvider = ({ children, hasOverlay = true, isOverlayTransparent =
|
|
|
47
47
|
// Calculate target element position and size for mask
|
|
48
48
|
(0, react_2.useEffect)(() => {
|
|
49
49
|
var _a;
|
|
50
|
-
if (active !== null &&
|
|
50
|
+
if (active !== null &&
|
|
51
|
+
targets[active] !== undefined &&
|
|
52
|
+
((_a = targets[active]) === null || _a === void 0 ? void 0 : _a.current) !== null) {
|
|
51
53
|
const element = targets[active].current;
|
|
52
54
|
const rect = element.getBoundingClientRect();
|
|
53
55
|
setTargetRect(rect);
|
|
@@ -77,7 +79,9 @@ const SpotlightProvider = ({ children, hasOverlay = true, isOverlayTransparent =
|
|
|
77
79
|
// Get the border radius from the target element
|
|
78
80
|
const getHoleRadius = (0, react_2.useCallback)(() => {
|
|
79
81
|
var _a;
|
|
80
|
-
if (active !== null &&
|
|
82
|
+
if (active !== null &&
|
|
83
|
+
targets[active] !== undefined &&
|
|
84
|
+
((_a = targets[active]) === null || _a === void 0 ? void 0 : _a.current) !== null) {
|
|
81
85
|
const element = targets[active].current;
|
|
82
86
|
const computedStyle = window.getComputedStyle(element);
|
|
83
87
|
const borderRadius = computedStyle.borderRadius;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotlightProvider.js","sourceRoot":"","sources":["../../../src/spotlight/SpotlightProvider.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAAqE;AACrE,4DAAoC;AAEpC,iCAOe;AA8Bf,MAAM,gBAAgB,GAAG,IAAA,qBAAa,EAA8B,IAAI,CAAC,CAAC;AAEnE,MAAM,iBAAiB,GAAG,CAAC,EAChC,QAAQ,EACR,UAAU,GAAG,IAAI,EACjB,oBAAoB,GAAG,KAAK,GACL,EAAE,EAAE;IAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IACrD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAEpC,EAAE,CAAC,CAAC;IACN,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAiB,IAAI,CAAC,CAAC;IAEnE,MAAM,cAAc,GAAG,IAAA,mBAAW,EAChC,CAAC,EAAU,EAAE,GAAiC,EAAE,EAAE;QAChD,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iCAAM,IAAI,KAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAG,CAAC,CAAC;IACjD,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,gBAAgB,GAAG,IAAA,mBAAW,E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,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAVW,QAAA,mBAAmB,uBAU9B","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { FloatingOverlay, FloatingPortal } from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\ntype SpotlightProviderProps = {\n /** The app/screen content to wrap */\n children: React.ReactNode;\n /** A boolean that decides if there is a gray overlay when a spotlight is open. */\n hasOverlay?: boolean;\n /** If the overlay should be transparent */\n isOverlayTransparent?: boolean;\n};\n\ntype SpotlightContextType = {\n /** A boolean that indicates if a spotlight is open */\n isOpen: boolean;\n /** A function that can be used to close or open the spotlight */\n setIsOpen: (arg: boolean) => void;\n /** A function that can be used to check if a spotlight is active. It takes a target id as an argument */\n isActiveSpotlight: (target: string) => boolean;\n /** A function that can be used to set a spotlight as active. It takes a target id as an argument, or null to clear the active spotlight */\n setActiveSpotlight: (target: string | null) => void;\n /** A function that can be used to register a target. It takes a target id, and a ref to the target element as arguments */\n registerTarget: (id: string, ref: React.RefObject<HTMLElement>) => void;\n /** A function that can be used to unregister a target. It takes a target id as an argument */\n unregisterTarget: (id: string) => void;\n /** An object that contains all registered targets. The keys are the target ids, and the values are the refs to the target elements */\n registeredTargets: Record<string, React.RefObject<HTMLElement>>;\n /** A boolean that decides if there is a gray overlay when a spotlight is open */\n hasOverlay?: boolean;\n};\n\nconst SpotlightContext = createContext<SpotlightContextType | null>(null);\n\nexport const SpotlightProvider = ({\n children,\n hasOverlay = true,\n isOverlayTransparent = false,\n}: SpotlightProviderProps) => {\n const [active, setActive] = useState<string | null>(null);\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const [targets, setTargets] = useState<\n Record<string, React.RefObject<HTMLElement>>\n >({});\n const [targetRect, setTargetRect] = useState<DOMRect | null>(null);\n\n const registerTarget = useCallback(\n (id: string, ref: React.RefObject<HTMLElement>) => {\n setTargets((prev) => ({ ...prev, [id]: ref }));\n },\n [],\n );\n\n const unregisterTarget = useCallback((id: string) => {\n setTargets((prev) => {\n const newTargets = { ...prev };\n delete newTargets[id];\n return newTargets;\n });\n }, []);\n\n // Calculate target element position and size for mask\n useEffect(() => {\n if (active !== null && targets[active]?.current !== null) {\n const element = targets[active].current;\n const rect = element.getBoundingClientRect();\n setTargetRect(rect);\n } else {\n setTargetRect(null);\n }\n }, [active, targets]);\n\n const contextValue: SpotlightContextType = {\n hasOverlay,\n isActiveSpotlight: useCallback(\n (target: string) => target === active,\n [active],\n ),\n isOpen,\n registerTarget,\n registeredTargets: targets,\n setActiveSpotlight: useCallback(\n (target: string | null) => setActive(target),\n [],\n ),\n setIsOpen: useCallback((open: boolean) => setIsOpen(open), []),\n unregisterTarget,\n };\n\n const overlayClasses = classNames('ndl-spotlight-overlay', {\n 'ndl-spotlight-overlay-opaque': !isOverlayTransparent,\n 'ndl-spotlight-overlay-open': isOpen && active !== null,\n });\n\n const overlayRootRef = useRef<HTMLElement | null>(null);\n\n if (active !== null) {\n overlayRootRef.current = document.getElementById(active);\n }\n\n // Get the border radius from the target element\n const getHoleRadius = useCallback(() => {\n if (active !== null && targets[active]?.current !== null) {\n const element = targets[active].current;\n const computedStyle = window.getComputedStyle(element);\n const borderRadius = computedStyle.borderRadius;\n\n // Parse the border radius value (handle px, rem, em, etc.)\n const radiusValue = parseFloat(borderRadius);\n return isNaN(radiusValue) ? 0 : radiusValue;\n }\n return 0;\n }, [active, targets]);\n\n const getMaskStyle = () => {\n if (!targetRect || isOverlayTransparent) return {};\n\n const { left, top, width, height } = targetRect;\n\n const x = Math.max(0, left);\n const y = Math.max(0, top);\n const w = Math.max(0, width);\n const h = Math.max(0, height);\n const r = Math.max(0, Math.min(getHoleRadius(), Math.min(w, h) / 2));\n\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n // SVG mask: white = visible overlay, black = hole (transparent)\n const svg = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${vw}\" height=\"${vh}\" viewBox=\"0 0 ${vw} ${vh}\">\n <defs>\n <mask id=\"spotlightMask\" maskUnits=\"userSpaceOnUse\">\n <rect x=\"0\" y=\"0\" width=\"${vw}\" height=\"${vh}\" fill=\"white\"/>\n <rect x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" rx=\"${r}\" ry=\"${r}\" fill=\"black\"/>\n </mask>\n </defs>\n <rect x=\"0\" y=\"0\" width=\"${vw}\" height=\"${vh}\" fill=\"black\" mask=\"url(#spotlightMask)\"/>\n </svg>`.trim();\n\n const encoded = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\n return {\n WebkitMaskImage: `url(\"${encoded}\")`,\n WebkitMaskRepeat: 'no-repeat',\n WebkitMaskSize: `${vw}px ${vh}px`,\n maskImage: `url(\"${encoded}\")`,\n maskRepeat: 'no-repeat',\n maskSize: `${vw}px ${vh}px`,\n } as React.CSSProperties;\n };\n\n /** useEffect to update the target rect, so that the mask tracks the target element */\n useEffect(() => {\n if (active == null) return;\n\n const el = targets[active]?.current;\n if (el === null || el === undefined) return;\n\n const update = () => setTargetRect(el.getBoundingClientRect());\n update();\n\n const ro = new ResizeObserver(update);\n ro.observe(el);\n\n window.addEventListener('scroll', update, true);\n window.addEventListener('resize', update);\n\n return () => {\n ro.disconnect();\n window.removeEventListener('scroll', update, true);\n window.removeEventListener('resize', update);\n };\n }, [active, targets]);\n\n return (\n <SpotlightContext.Provider value={contextValue}>\n {hasOverlay && active !== null && isOpen && (\n <FloatingPortal>\n <FloatingOverlay\n lockScroll={true}\n className={overlayClasses}\n style={getMaskStyle()}\n data-testid=\"ndl-spotlight-overlay\"\n />\n </FloatingPortal>\n )}\n {children}\n </SpotlightContext.Provider>\n );\n};\n\nexport const useSpotlightContext = (): SpotlightContextType => {\n const context = useContext(SpotlightContext);\n\n if (context === null) {\n throw new Error(\n 'Spotlight components must be wrapped in <SpotlightProvider />',\n );\n }\n\n return context;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SpotlightProvider.js","sourceRoot":"","sources":["../../../src/spotlight/SpotlightProvider.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAAqE;AACrE,4DAAoC;AAEpC,iCAOe;AA8Bf,MAAM,gBAAgB,GAAG,IAAA,qBAAa,EAA8B,IAAI,CAAC,CAAC;AAEnE,MAAM,iBAAiB,GAAG,CAAC,EAChC,QAAQ,EACR,UAAU,GAAG,IAAI,EACjB,oBAAoB,GAAG,KAAK,GACL,EAAE,EAAE;IAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAgB,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAC;IACrD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAEpC,EAAE,CAAC,CAAC;IACN,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAiB,IAAI,CAAC,CAAC;IAEnE,MAAM,cAAc,GAAG,IAAA,mBAAW,EAChC,CAAC,EAAU,EAAE,GAAiC,EAAE,EAAE;QAChD,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iCAAM,IAAI,KAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IA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,EAAE;IAC5D,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,gBAAgB,CAAC,CAAC;IAE7C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAVW,QAAA,mBAAmB,uBAU9B","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { FloatingOverlay, FloatingPortal } from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\ntype SpotlightProviderProps = {\n /** The app/screen content to wrap */\n children: React.ReactNode;\n /** A boolean that decides if there is a gray overlay when a spotlight is open. */\n hasOverlay?: boolean;\n /** If the overlay should be transparent */\n isOverlayTransparent?: boolean;\n};\n\ntype SpotlightContextType = {\n /** A boolean that indicates if a spotlight is open */\n isOpen: boolean;\n /** A function that can be used to close or open the spotlight */\n setIsOpen: (arg: boolean) => void;\n /** A function that can be used to check if a spotlight is active. It takes a target id as an argument */\n isActiveSpotlight: (target: string) => boolean;\n /** A function that can be used to set a spotlight as active. It takes a target id as an argument, or null to clear the active spotlight */\n setActiveSpotlight: (target: string | null) => void;\n /** A function that can be used to register a target. It takes a target id, and a ref to the target element as arguments */\n registerTarget: (id: string, ref: React.RefObject<HTMLElement>) => void;\n /** A function that can be used to unregister a target. It takes a target id as an argument */\n unregisterTarget: (id: string) => void;\n /** An object that contains all registered targets. The keys are the target ids, and the values are the refs to the target elements */\n registeredTargets: Record<string, React.RefObject<HTMLElement>>;\n /** A boolean that decides if there is a gray overlay when a spotlight is open */\n hasOverlay?: boolean;\n};\n\nconst SpotlightContext = createContext<SpotlightContextType | null>(null);\n\nexport const SpotlightProvider = ({\n children,\n hasOverlay = true,\n isOverlayTransparent = false,\n}: SpotlightProviderProps) => {\n const [active, setActive] = useState<string | null>(null);\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const [targets, setTargets] = useState<\n Record<string, React.RefObject<HTMLElement>>\n >({});\n const [targetRect, setTargetRect] = useState<DOMRect | null>(null);\n\n const registerTarget = useCallback(\n (id: string, ref: React.RefObject<HTMLElement>) => {\n setTargets((prev) => ({ ...prev, [id]: ref }));\n },\n [],\n );\n\n const unregisterTarget = useCallback((id: string) => {\n setTargets((prev) => {\n const newTargets = { ...prev };\n delete newTargets[id];\n return newTargets;\n });\n }, []);\n\n // Calculate target element position and size for mask\n useEffect(() => {\n if (\n active !== null &&\n targets[active] !== undefined &&\n targets[active]?.current !== null\n ) {\n const element = targets[active].current;\n const rect = element.getBoundingClientRect();\n setTargetRect(rect);\n } else {\n setTargetRect(null);\n }\n }, [active, targets]);\n\n const contextValue: SpotlightContextType = {\n hasOverlay,\n isActiveSpotlight: useCallback(\n (target: string) => target === active,\n [active],\n ),\n isOpen,\n registerTarget,\n registeredTargets: targets,\n setActiveSpotlight: useCallback(\n (target: string | null) => setActive(target),\n [],\n ),\n setIsOpen: useCallback((open: boolean) => setIsOpen(open), []),\n unregisterTarget,\n };\n\n const overlayClasses = classNames('ndl-spotlight-overlay', {\n 'ndl-spotlight-overlay-opaque': !isOverlayTransparent,\n 'ndl-spotlight-overlay-open': isOpen && active !== null,\n });\n\n const overlayRootRef = useRef<HTMLElement | null>(null);\n\n if (active !== null) {\n overlayRootRef.current = document.getElementById(active);\n }\n\n // Get the border radius from the target element\n const getHoleRadius = useCallback(() => {\n if (\n active !== null &&\n targets[active] !== undefined &&\n targets[active]?.current !== null\n ) {\n const element = targets[active].current;\n const computedStyle = window.getComputedStyle(element);\n const borderRadius = computedStyle.borderRadius;\n\n // Parse the border radius value (handle px, rem, em, etc.)\n const radiusValue = parseFloat(borderRadius);\n return isNaN(radiusValue) ? 0 : radiusValue;\n }\n return 0;\n }, [active, targets]);\n\n const getMaskStyle = () => {\n if (!targetRect || isOverlayTransparent) return {};\n\n const { left, top, width, height } = targetRect;\n\n const x = Math.max(0, left);\n const y = Math.max(0, top);\n const w = Math.max(0, width);\n const h = Math.max(0, height);\n const r = Math.max(0, Math.min(getHoleRadius(), Math.min(w, h) / 2));\n\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n // SVG mask: white = visible overlay, black = hole (transparent)\n const svg = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${vw}\" height=\"${vh}\" viewBox=\"0 0 ${vw} ${vh}\">\n <defs>\n <mask id=\"spotlightMask\" maskUnits=\"userSpaceOnUse\">\n <rect x=\"0\" y=\"0\" width=\"${vw}\" height=\"${vh}\" fill=\"white\"/>\n <rect x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" rx=\"${r}\" ry=\"${r}\" fill=\"black\"/>\n </mask>\n </defs>\n <rect x=\"0\" y=\"0\" width=\"${vw}\" height=\"${vh}\" fill=\"black\" mask=\"url(#spotlightMask)\"/>\n </svg>`.trim();\n\n const encoded = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\n return {\n WebkitMaskImage: `url(\"${encoded}\")`,\n WebkitMaskRepeat: 'no-repeat',\n WebkitMaskSize: `${vw}px ${vh}px`,\n maskImage: `url(\"${encoded}\")`,\n maskRepeat: 'no-repeat',\n maskSize: `${vw}px ${vh}px`,\n } as React.CSSProperties;\n };\n\n /** useEffect to update the target rect, so that the mask tracks the target element */\n useEffect(() => {\n if (active == null) return;\n\n const el = targets[active]?.current;\n if (el === null || el === undefined) return;\n\n const update = () => setTargetRect(el.getBoundingClientRect());\n update();\n\n const ro = new ResizeObserver(update);\n ro.observe(el);\n\n window.addEventListener('scroll', update, true);\n window.addEventListener('resize', update);\n\n return () => {\n ro.disconnect();\n window.removeEventListener('scroll', update, true);\n window.removeEventListener('resize', update);\n };\n }, [active, targets]);\n\n return (\n <SpotlightContext.Provider value={contextValue}>\n {hasOverlay && active !== null && isOpen && (\n <FloatingPortal>\n <FloatingOverlay\n lockScroll={true}\n className={overlayClasses}\n style={getMaskStyle()}\n data-testid=\"ndl-spotlight-overlay\"\n />\n </FloatingPortal>\n )}\n {children}\n </SpotlightContext.Provider>\n );\n};\n\nexport const useSpotlightContext = (): SpotlightContextType => {\n const context = useContext(SpotlightContext);\n\n if (context === null) {\n throw new Error(\n 'Spotlight components must be wrapped in <SpotlightProvider />',\n );\n }\n\n return context;\n};\n"]}
|
|
@@ -40,7 +40,7 @@ const Presence = (_a) => {
|
|
|
40
40
|
});
|
|
41
41
|
const { theme } = useNeedleTheme();
|
|
42
42
|
const Component = theme === 'light' ? Neo4JAiColorLightIcon : Neo4JAiColorDarkIcon;
|
|
43
|
-
return (_jsx(Component, Object.assign({ ref: ref, className: classes, style: style }, restProps
|
|
43
|
+
return (_jsx(Component, Object.assign({ ref: ref, className: classes, style: style, htmlAttributes: htmlAttributes }, restProps)));
|
|
44
44
|
};
|
|
45
45
|
Presence.displayName = 'Presence';
|
|
46
46
|
export { Presence };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Presence.js","sourceRoot":"","sources":["../../../../src/ai/presence/Presence.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AAOpC,MAA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,CAAC,oBAAoB,CAAC;IAEnE,OAAO,CACL,KAAC,SAAS,kBACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,IAC1B,SAAS,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useNeedleTheme } from '@neo4j-ndl/react';\nimport type { CommonProps } from '@neo4j-ndl/react/_common/types';\nimport {\n Neo4JAiColorDarkIcon,\n Neo4JAiColorLightIcon,\n} from '@neo4j-ndl/react/icons';\nimport classNames from 'classnames';\n\ntype PresenceProps = {\n /** Whether the AI is thinking. Animates the underlying SVG */\n isThinking?: boolean;\n};\n\nconst Presence = ({\n className,\n isThinking = false,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'svg', PresenceProps>) => {\n const classes = classNames('ndl-ai-presence', className, {\n 'ndl-thinking': isThinking === true,\n });\n const { theme } = useNeedleTheme();\n\n const Component =\n theme === 'light' ? Neo4JAiColorLightIcon : Neo4JAiColorDarkIcon;\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...restProps}\n />\n );\n};\n\nPresence.displayName = 'Presence';\n\nexport { Presence };\n"]}
|
|
@@ -25,7 +25,7 @@ import { Presence } from '@neo4j-ndl/react/ai';
|
|
|
25
25
|
import { useState } from 'react';
|
|
26
26
|
const Component = () => {
|
|
27
27
|
const [isThinking, setIsThinking] = useState(false);
|
|
28
|
-
return (_jsxs("div", { className: "n-flex n-gap-token-8", children: [_jsx(Presence, { className: "n-size-token-32", isThinking: isThinking }), _jsx(FilledButton, {
|
|
28
|
+
return (_jsxs("div", { className: "n-flex n-gap-token-8", children: [_jsx(Presence, { className: "n-size-token-32", isThinking: isThinking }), _jsx(FilledButton, { onClick: () => setIsThinking(!isThinking), children: "Toggle Thinking" })] }));
|
|
29
29
|
};
|
|
30
30
|
export default Component;
|
|
31
31
|
//# sourceMappingURL=ai-presence-default.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-presence-default.story.js","sourceRoot":"","sources":["../../../../../src/ai/presence/stories/ai-presence-default.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,OAAO,CACL,eAAK,SAAS,EAAC,sBAAsB,aACnC,KAAC,QAAQ,IAAC,SAAS,EAAC,iBAAiB,EAAC,UAAU,EAAE,UAAU,GAAI,EAChE,KAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"ai-presence-default.story.js","sourceRoot":"","sources":["../../../../../src/ai/presence/stories/ai-presence-default.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,OAAO,CACL,eAAK,SAAS,EAAC,sBAAsB,aACnC,KAAC,QAAQ,IAAC,SAAS,EAAC,iBAAiB,EAAC,UAAU,EAAE,UAAU,GAAI,EAChE,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,gCAExC,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton } from '@neo4j-ndl/react';\nimport { Presence } from '@neo4j-ndl/react/ai';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isThinking, setIsThinking] = useState(false);\n\n return (\n <div className=\"n-flex n-gap-token-8\">\n <Presence className=\"n-size-token-32\" isThinking={isThinking} />\n <FilledButton onClick={() => setIsThinking(!isThinking)}>\n Toggle Thinking\n </FilledButton>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -19,19 +19,31 @@
|
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
23
|
+
var t = {};
|
|
24
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
25
|
+
t[p] = s[p];
|
|
26
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
27
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
28
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
29
|
+
t[p[i]] = s[p[i]];
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
};
|
|
22
33
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
34
|
import { useId } from 'react';
|
|
24
35
|
import { wrapIcon } from '../wrapIcon';
|
|
25
|
-
const Neo4JAiColor = (
|
|
36
|
+
const Neo4JAiColor = (_a) => {
|
|
37
|
+
var { theme, className, style, ref, htmlAttributes } = _a, restProps = __rest(_a, ["theme", "className", "style", "ref", "htmlAttributes"]);
|
|
26
38
|
const uniqueId = useId();
|
|
27
39
|
const gradientId = `neo4j-ai-color-gradient-${theme}-${uniqueId}`;
|
|
28
|
-
return (_jsxs("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className:
|
|
40
|
+
return (_jsxs("svg", Object.assign({ viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, ref: ref, style: style }, restProps, htmlAttributes, { children: [_jsxs("defs", { children: [_jsxs("linearGradient", { id: `neo4j-ai-color-gradient-light-${uniqueId}`, x1: "9.5", y1: "1.5", x2: "19", y2: "16", gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { stopColor: "#0A6190" }), _jsx("stop", { offset: "1", stopColor: "#754EC8" })] }), _jsxs("linearGradient", { id: `neo4j-ai-color-gradient-dark-${uniqueId}`, x1: "9.5", y1: "1.5", x2: "19", y2: "16", gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { stopColor: "#8FE3E8" }), _jsx("stop", { offset: "1", stopColor: "#CCB4FF" })] })] }), _jsx("circle", { cx: 5.5, cy: 5.5, r: 1.5, stroke: `url(#${gradientId})`, fill: `url(#${gradientId})`, strokeWidth: 1.5 }), _jsx("circle", { cx: 18.5, cy: 18.5, r: 1.5, stroke: `url(#${gradientId})`, fill: `url(#${gradientId})`, strokeWidth: 1.5 }), _jsx("path", { d: "M12.7885 15.6345L12 18L11.2115 15.6345C10.7636 14.2908 9.70919 13.2364 8.36546 12.7885L6 12L8.36546 11.2115C9.70919 10.7636 10.7636 9.70919 11.2115 8.36546L12 6L12.7885 8.36546C13.2364 9.70919 14.2908 10.7636 15.6345 11.2115L18 12L15.6345 12.7885C14.2908 13.2364 13.2364 14.2908 12.7885 15.6345Z", stroke: `url(#${gradientId})`, fill: `url(#${gradientId})`, strokeWidth: 1.5, strokeLinejoin: "round" }), _jsx("path", { d: "M15 21.418C15 21.418 9.56707 23.7462 4.91039 19.0895C0.253721 14.4328 2.58211 9 2.58211 9", stroke: `url(#${gradientId})`, strokeWidth: 1.5, strokeLinecap: "round", pathLength: 100 }), _jsx("path", { d: "M9 2.58204C9 2.58204 14.4329 0.253777 19.0896 4.9105C23.7463 9.56722 21.4179 15 21.4179 15", stroke: `url(#${gradientId})`, strokeWidth: 1.5, strokeLinecap: "round", pathLength: 100 })] })));
|
|
29
41
|
};
|
|
30
42
|
const Neo4JAiColorLightComponent = (props) => {
|
|
31
|
-
return _jsx(Neo4JAiColor, { theme: "light",
|
|
43
|
+
return _jsx(Neo4JAiColor, Object.assign({ theme: "light" }, props));
|
|
32
44
|
};
|
|
33
45
|
const Neo4JAiColorDarkComponent = (props) => {
|
|
34
|
-
return _jsx(Neo4JAiColor, { theme: "dark",
|
|
46
|
+
return _jsx(Neo4JAiColor, Object.assign({ theme: "dark" }, props));
|
|
35
47
|
};
|
|
36
48
|
const Neo4JAiColorLight = wrapIcon(Neo4JAiColorLightComponent);
|
|
37
49
|
const Neo4JAiColorDark = wrapIcon(Neo4JAiColorDarkComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Neo4JAiColor.js","sourceRoot":"","sources":["../../../../src/icons/manual/Neo4JAiColor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Neo4JAiColor.js","sourceRoot":"","sources":["../../../../src/icons/manual/Neo4JAiColor.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMvC,MAAM,YAAY,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EACpB,KAAK,EACL,SAAS,EACT,KAAK,EACL,GAAG,EACH,cAAc,OAEwB,EADnC,SAAS,cANQ,wDAOrB,CADa;IAEZ,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,2BAA2B,KAAK,IAAI,QAAQ,EAAE,CAAC;IAElE,OAAO,CACL,6BACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,eAElB,2BACE,0BACE,EAAE,EAAE,iCAAiC,QAAQ,EAAE,EAC/C,EAAE,EAAC,KAAK,EACR,EAAE,EAAC,KAAK,EACR,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,aAAa,EAAC,gBAAgB,aAE9B,eAAM,SAAS,EAAC,SAAS,GAAG,EAC5B,eAAM,MAAM,EAAC,GAAG,EAAC,SAAS,EAAC,SAAS,GAAG,IACxB,EACjB,0BACE,EAAE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AC;AACnD,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1D,OAAO,KAAC,YAAY,kBAAC,KAAK,EAAC,MAAM,IAAK,KAAK,EAAI,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,QAAQ,CAAC,0BAA0B,CAAC,CAAC;AAC/D,MAAM,gBAAgB,GAAG,QAAQ,CAAC,yBAAyB,CAAC,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type CommonProps } from '@neo4j-ndl/react/_common/types';\nimport { useId } from 'react';\n\nimport { wrapIcon } from '../wrapIcon';\n\ntype Neo4JAiColorProps = {\n theme: 'light' | 'dark';\n};\n\nconst Neo4JAiColor = ({\n theme,\n className,\n style,\n ref,\n htmlAttributes,\n ...restProps\n}: CommonProps<'svg', Neo4JAiColorProps>) => {\n const uniqueId = useId();\n const gradientId = `neo4j-ai-color-gradient-${theme}-${uniqueId}`;\n\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n ref={ref}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <defs>\n <linearGradient\n id={`neo4j-ai-color-gradient-light-${uniqueId}`}\n x1=\"9.5\"\n y1=\"1.5\"\n x2=\"19\"\n y2=\"16\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#0A6190\" />\n <stop offset=\"1\" stopColor=\"#754EC8\" />\n </linearGradient>\n <linearGradient\n id={`neo4j-ai-color-gradient-dark-${uniqueId}`}\n x1=\"9.5\"\n y1=\"1.5\"\n x2=\"19\"\n y2=\"16\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#8FE3E8\" />\n <stop offset=\"1\" stopColor=\"#CCB4FF\" />\n </linearGradient>\n </defs>\n <circle\n cx={5.5}\n cy={5.5}\n r={1.5}\n stroke={`url(#${gradientId})`}\n fill={`url(#${gradientId})`}\n strokeWidth={1.5}\n />\n <circle\n cx={18.5}\n cy={18.5}\n r={1.5}\n stroke={`url(#${gradientId})`}\n fill={`url(#${gradientId})`}\n strokeWidth={1.5}\n />\n <path\n d=\"M12.7885 15.6345L12 18L11.2115 15.6345C10.7636 14.2908 9.70919 13.2364 8.36546 12.7885L6 12L8.36546 11.2115C9.70919 10.7636 10.7636 9.70919 11.2115 8.36546L12 6L12.7885 8.36546C13.2364 9.70919 14.2908 10.7636 15.6345 11.2115L18 12L15.6345 12.7885C14.2908 13.2364 13.2364 14.2908 12.7885 15.6345Z\"\n stroke={`url(#${gradientId})`}\n fill={`url(#${gradientId})`}\n strokeWidth={1.5}\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M15 21.418C15 21.418 9.56707 23.7462 4.91039 19.0895C0.253721 14.4328 2.58211 9 2.58211 9\"\n stroke={`url(#${gradientId})`}\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n pathLength={100}\n />\n <path\n d=\"M9 2.58204C9 2.58204 14.4329 0.253777 19.0896 4.9105C23.7463 9.56722 21.4179 15 21.4179 15\"\n stroke={`url(#${gradientId})`}\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n pathLength={100}\n />\n </svg>\n );\n};\n\ntype ComponentProps = Omit<React.ComponentProps<typeof Neo4JAiColor>, 'theme'>;\n\nconst Neo4JAiColorLightComponent = (props: ComponentProps) => {\n return <Neo4JAiColor theme=\"light\" {...props} />;\n};\n\nconst Neo4JAiColorDarkComponent = (props: ComponentProps) => {\n return <Neo4JAiColor theme=\"dark\" {...props} />;\n};\n\nconst Neo4JAiColorLight = wrapIcon(Neo4JAiColorLightComponent);\nconst Neo4JAiColorDark = wrapIcon(Neo4JAiColorDarkComponent);\n\nexport { Neo4JAiColorLight, Neo4JAiColorDark };\n"]}
|
|
@@ -41,7 +41,9 @@ export const SpotlightProvider = ({ children, hasOverlay = true, isOverlayTransp
|
|
|
41
41
|
// Calculate target element position and size for mask
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
var _a;
|
|
44
|
-
if (active !== null &&
|
|
44
|
+
if (active !== null &&
|
|
45
|
+
targets[active] !== undefined &&
|
|
46
|
+
((_a = targets[active]) === null || _a === void 0 ? void 0 : _a.current) !== null) {
|
|
45
47
|
const element = targets[active].current;
|
|
46
48
|
const rect = element.getBoundingClientRect();
|
|
47
49
|
setTargetRect(rect);
|
|
@@ -71,7 +73,9 @@ export const SpotlightProvider = ({ children, hasOverlay = true, isOverlayTransp
|
|
|
71
73
|
// Get the border radius from the target element
|
|
72
74
|
const getHoleRadius = useCallback(() => {
|
|
73
75
|
var _a;
|
|
74
|
-
if (active !== null &&
|
|
76
|
+
if (active !== null &&
|
|
77
|
+
targets[active] !== undefined &&
|
|
78
|
+
((_a = targets[active]) === null || _a === void 0 ? void 0 : _a.current) !== null) {
|
|
75
79
|
const element = targets[active].current;
|
|
76
80
|
const computedStyle = window.getComputedStyle(element);
|
|
77
81
|
const borderRadius = computedStyle.borderRadius;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotlightProvider.js","sourceRoot":"","sources":["../../../src/spotlight/SpotlightProvider.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,UAAU,MAA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O,GAAG,EAAE;YACV,EAAE,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YACnD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC/C,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEtB,OAAO,CACL,MAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,aAC3C,UAAU,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,IAAI,CAC1C,KAAC,cAAc,cACb,KAAC,eAAe,IACd,UAAU,EAAE,IAAI,EAChB,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,YAAY,EAAE,iBACT,uBAAuB,GACnC,GACa,CAClB,EACA,QAAQ,IACiB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAyB,EAAE;IAC5D,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAE7C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { FloatingOverlay, FloatingPortal } from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\ntype SpotlightProviderProps = {\n /** The app/screen content to wrap */\n children: React.ReactNode;\n /** A boolean that decides if there is a gray overlay when a spotlight is open. */\n hasOverlay?: boolean;\n /** If the overlay should be transparent */\n isOverlayTransparent?: boolean;\n};\n\ntype SpotlightContextType = {\n /** A boolean that indicates if a spotlight is open */\n isOpen: boolean;\n /** A function that can be used to close or open the spotlight */\n setIsOpen: (arg: boolean) => void;\n /** A function that can be used to check if a spotlight is active. It takes a target id as an argument */\n isActiveSpotlight: (target: string) => boolean;\n /** A function that can be used to set a spotlight as active. It takes a target id as an argument, or null to clear the active spotlight */\n setActiveSpotlight: (target: string | null) => void;\n /** A function that can be used to register a target. It takes a target id, and a ref to the target element as arguments */\n registerTarget: (id: string, ref: React.RefObject<HTMLElement>) => void;\n /** A function that can be used to unregister a target. It takes a target id as an argument */\n unregisterTarget: (id: string) => void;\n /** An object that contains all registered targets. The keys are the target ids, and the values are the refs to the target elements */\n registeredTargets: Record<string, React.RefObject<HTMLElement>>;\n /** A boolean that decides if there is a gray overlay when a spotlight is open */\n hasOverlay?: boolean;\n};\n\nconst SpotlightContext = createContext<SpotlightContextType | null>(null);\n\nexport const SpotlightProvider = ({\n children,\n hasOverlay = true,\n isOverlayTransparent = false,\n}: SpotlightProviderProps) => {\n const [active, setActive] = useState<string | null>(null);\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const [targets, setTargets] = useState<\n Record<string, React.RefObject<HTMLElement>>\n >({});\n const [targetRect, setTargetRect] = useState<DOMRect | null>(null);\n\n const registerTarget = useCallback(\n (id: string, ref: React.RefObject<HTMLElement>) => {\n setTargets((prev) => ({ ...prev, [id]: ref }));\n },\n [],\n );\n\n const unregisterTarget = useCallback((id: string) => {\n setTargets((prev) => {\n const newTargets = { ...prev };\n delete newTargets[id];\n return newTargets;\n });\n }, []);\n\n // Calculate target element position and size for mask\n useEffect(() => {\n if (active !== null && targets[active]?.current !== null) {\n const element = targets[active].current;\n const rect = element.getBoundingClientRect();\n setTargetRect(rect);\n } else {\n setTargetRect(null);\n }\n }, [active, targets]);\n\n const contextValue: SpotlightContextType = {\n hasOverlay,\n isActiveSpotlight: useCallback(\n (target: string) => target === active,\n [active],\n ),\n isOpen,\n registerTarget,\n registeredTargets: targets,\n setActiveSpotlight: useCallback(\n (target: string | null) => setActive(target),\n [],\n ),\n setIsOpen: useCallback((open: boolean) => setIsOpen(open), []),\n unregisterTarget,\n };\n\n const overlayClasses = classNames('ndl-spotlight-overlay', {\n 'ndl-spotlight-overlay-opaque': !isOverlayTransparent,\n 'ndl-spotlight-overlay-open': isOpen && active !== null,\n });\n\n const overlayRootRef = useRef<HTMLElement | null>(null);\n\n if (active !== null) {\n overlayRootRef.current = document.getElementById(active);\n }\n\n // Get the border radius from the target element\n const getHoleRadius = useCallback(() => {\n if (active !== null && targets[active]?.current !== null) {\n const element = targets[active].current;\n const computedStyle = window.getComputedStyle(element);\n const borderRadius = computedStyle.borderRadius;\n\n // Parse the border radius value (handle px, rem, em, etc.)\n const radiusValue = parseFloat(borderRadius);\n return isNaN(radiusValue) ? 0 : radiusValue;\n }\n return 0;\n }, [active, targets]);\n\n const getMaskStyle = () => {\n if (!targetRect || isOverlayTransparent) return {};\n\n const { left, top, width, height } = targetRect;\n\n const x = Math.max(0, left);\n const y = Math.max(0, top);\n const w = Math.max(0, width);\n const h = Math.max(0, height);\n const r = Math.max(0, Math.min(getHoleRadius(), Math.min(w, h) / 2));\n\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n // SVG mask: white = visible overlay, black = hole (transparent)\n const svg = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${vw}\" height=\"${vh}\" viewBox=\"0 0 ${vw} ${vh}\">\n <defs>\n <mask id=\"spotlightMask\" maskUnits=\"userSpaceOnUse\">\n <rect x=\"0\" y=\"0\" width=\"${vw}\" height=\"${vh}\" fill=\"white\"/>\n <rect x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" rx=\"${r}\" ry=\"${r}\" fill=\"black\"/>\n </mask>\n </defs>\n <rect x=\"0\" y=\"0\" width=\"${vw}\" height=\"${vh}\" fill=\"black\" mask=\"url(#spotlightMask)\"/>\n </svg>`.trim();\n\n const encoded = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\n return {\n WebkitMaskImage: `url(\"${encoded}\")`,\n WebkitMaskRepeat: 'no-repeat',\n WebkitMaskSize: `${vw}px ${vh}px`,\n maskImage: `url(\"${encoded}\")`,\n maskRepeat: 'no-repeat',\n maskSize: `${vw}px ${vh}px`,\n } as React.CSSProperties;\n };\n\n /** useEffect to update the target rect, so that the mask tracks the target element */\n useEffect(() => {\n if (active == null) return;\n\n const el = targets[active]?.current;\n if (el === null || el === undefined) return;\n\n const update = () => setTargetRect(el.getBoundingClientRect());\n update();\n\n const ro = new ResizeObserver(update);\n ro.observe(el);\n\n window.addEventListener('scroll', update, true);\n window.addEventListener('resize', update);\n\n return () => {\n ro.disconnect();\n window.removeEventListener('scroll', update, true);\n window.removeEventListener('resize', update);\n };\n }, [active, targets]);\n\n return (\n <SpotlightContext.Provider value={contextValue}>\n {hasOverlay && active !== null && isOpen && (\n <FloatingPortal>\n <FloatingOverlay\n lockScroll={true}\n className={overlayClasses}\n style={getMaskStyle()}\n data-testid=\"ndl-spotlight-overlay\"\n />\n </FloatingPortal>\n )}\n {children}\n </SpotlightContext.Provider>\n );\n};\n\nexport const useSpotlightContext = (): SpotlightContextType => {\n const context = useContext(SpotlightContext);\n\n if (context === null) {\n throw new Error(\n 'Spotlight components must be wrapped in <SpotlightProvider />',\n );\n }\n\n return context;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SpotlightProvider.js","sourceRoot":"","sources":["../../../src/spotlight/SpotlightProvider.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG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,CAAC,CAAC;QAEf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAChD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAE1C,OAAO,GAAG,EAAE;YACV,EAAE,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YACnD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC/C,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEtB,OAAO,CACL,MAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,aAC3C,UAAU,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,IAAI,CAC1C,KAAC,cAAc,cACb,KAAC,eAAe,IACd,UAAU,EAAE,IAAI,EAChB,SAAS,EAAE,cAAc,EACzB,KAAK,EAAE,YAAY,EAAE,iBACT,uBAAuB,GACnC,GACa,CAClB,EACA,QAAQ,IACiB,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAyB,EAAE;IAC5D,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAE7C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { FloatingOverlay, FloatingPortal } from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\ntype SpotlightProviderProps = {\n /** The app/screen content to wrap */\n children: React.ReactNode;\n /** A boolean that decides if there is a gray overlay when a spotlight is open. */\n hasOverlay?: boolean;\n /** If the overlay should be transparent */\n isOverlayTransparent?: boolean;\n};\n\ntype SpotlightContextType = {\n /** A boolean that indicates if a spotlight is open */\n isOpen: boolean;\n /** A function that can be used to close or open the spotlight */\n setIsOpen: (arg: boolean) => void;\n /** A function that can be used to check if a spotlight is active. It takes a target id as an argument */\n isActiveSpotlight: (target: string) => boolean;\n /** A function that can be used to set a spotlight as active. It takes a target id as an argument, or null to clear the active spotlight */\n setActiveSpotlight: (target: string | null) => void;\n /** A function that can be used to register a target. It takes a target id, and a ref to the target element as arguments */\n registerTarget: (id: string, ref: React.RefObject<HTMLElement>) => void;\n /** A function that can be used to unregister a target. It takes a target id as an argument */\n unregisterTarget: (id: string) => void;\n /** An object that contains all registered targets. The keys are the target ids, and the values are the refs to the target elements */\n registeredTargets: Record<string, React.RefObject<HTMLElement>>;\n /** A boolean that decides if there is a gray overlay when a spotlight is open */\n hasOverlay?: boolean;\n};\n\nconst SpotlightContext = createContext<SpotlightContextType | null>(null);\n\nexport const SpotlightProvider = ({\n children,\n hasOverlay = true,\n isOverlayTransparent = false,\n}: SpotlightProviderProps) => {\n const [active, setActive] = useState<string | null>(null);\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const [targets, setTargets] = useState<\n Record<string, React.RefObject<HTMLElement>>\n >({});\n const [targetRect, setTargetRect] = useState<DOMRect | null>(null);\n\n const registerTarget = useCallback(\n (id: string, ref: React.RefObject<HTMLElement>) => {\n setTargets((prev) => ({ ...prev, [id]: ref }));\n },\n [],\n );\n\n const unregisterTarget = useCallback((id: string) => {\n setTargets((prev) => {\n const newTargets = { ...prev };\n delete newTargets[id];\n return newTargets;\n });\n }, []);\n\n // Calculate target element position and size for mask\n useEffect(() => {\n if (\n active !== null &&\n targets[active] !== undefined &&\n targets[active]?.current !== null\n ) {\n const element = targets[active].current;\n const rect = element.getBoundingClientRect();\n setTargetRect(rect);\n } else {\n setTargetRect(null);\n }\n }, [active, targets]);\n\n const contextValue: SpotlightContextType = {\n hasOverlay,\n isActiveSpotlight: useCallback(\n (target: string) => target === active,\n [active],\n ),\n isOpen,\n registerTarget,\n registeredTargets: targets,\n setActiveSpotlight: useCallback(\n (target: string | null) => setActive(target),\n [],\n ),\n setIsOpen: useCallback((open: boolean) => setIsOpen(open), []),\n unregisterTarget,\n };\n\n const overlayClasses = classNames('ndl-spotlight-overlay', {\n 'ndl-spotlight-overlay-opaque': !isOverlayTransparent,\n 'ndl-spotlight-overlay-open': isOpen && active !== null,\n });\n\n const overlayRootRef = useRef<HTMLElement | null>(null);\n\n if (active !== null) {\n overlayRootRef.current = document.getElementById(active);\n }\n\n // Get the border radius from the target element\n const getHoleRadius = useCallback(() => {\n if (\n active !== null &&\n targets[active] !== undefined &&\n targets[active]?.current !== null\n ) {\n const element = targets[active].current;\n const computedStyle = window.getComputedStyle(element);\n const borderRadius = computedStyle.borderRadius;\n\n // Parse the border radius value (handle px, rem, em, etc.)\n const radiusValue = parseFloat(borderRadius);\n return isNaN(radiusValue) ? 0 : radiusValue;\n }\n return 0;\n }, [active, targets]);\n\n const getMaskStyle = () => {\n if (!targetRect || isOverlayTransparent) return {};\n\n const { left, top, width, height } = targetRect;\n\n const x = Math.max(0, left);\n const y = Math.max(0, top);\n const w = Math.max(0, width);\n const h = Math.max(0, height);\n const r = Math.max(0, Math.min(getHoleRadius(), Math.min(w, h) / 2));\n\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n\n // SVG mask: white = visible overlay, black = hole (transparent)\n const svg = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${vw}\" height=\"${vh}\" viewBox=\"0 0 ${vw} ${vh}\">\n <defs>\n <mask id=\"spotlightMask\" maskUnits=\"userSpaceOnUse\">\n <rect x=\"0\" y=\"0\" width=\"${vw}\" height=\"${vh}\" fill=\"white\"/>\n <rect x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" rx=\"${r}\" ry=\"${r}\" fill=\"black\"/>\n </mask>\n </defs>\n <rect x=\"0\" y=\"0\" width=\"${vw}\" height=\"${vh}\" fill=\"black\" mask=\"url(#spotlightMask)\"/>\n </svg>`.trim();\n\n const encoded = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\n return {\n WebkitMaskImage: `url(\"${encoded}\")`,\n WebkitMaskRepeat: 'no-repeat',\n WebkitMaskSize: `${vw}px ${vh}px`,\n maskImage: `url(\"${encoded}\")`,\n maskRepeat: 'no-repeat',\n maskSize: `${vw}px ${vh}px`,\n } as React.CSSProperties;\n };\n\n /** useEffect to update the target rect, so that the mask tracks the target element */\n useEffect(() => {\n if (active == null) return;\n\n const el = targets[active]?.current;\n if (el === null || el === undefined) return;\n\n const update = () => setTargetRect(el.getBoundingClientRect());\n update();\n\n const ro = new ResizeObserver(update);\n ro.observe(el);\n\n window.addEventListener('scroll', update, true);\n window.addEventListener('resize', update);\n\n return () => {\n ro.disconnect();\n window.removeEventListener('scroll', update, true);\n window.removeEventListener('resize', update);\n };\n }, [active, targets]);\n\n return (\n <SpotlightContext.Provider value={contextValue}>\n {hasOverlay && active !== null && isOpen && (\n <FloatingPortal>\n <FloatingOverlay\n lockScroll={true}\n className={overlayClasses}\n style={getMaskStyle()}\n data-testid=\"ndl-spotlight-overlay\"\n />\n </FloatingPortal>\n )}\n {children}\n </SpotlightContext.Provider>\n );\n};\n\nexport const useSpotlightContext = (): SpotlightContextType => {\n const context = useContext(SpotlightContext);\n\n if (context === null) {\n throw new Error(\n 'Spotlight components must be wrapped in <SpotlightProvider />',\n );\n }\n\n return context;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-presence-default.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/presence/stories/ai-presence-default.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAMjD,QAAA,MAAM,SAAS,+
|
|
1
|
+
{"version":3,"file":"ai-presence-default.story.d.ts","sourceRoot":"","sources":["../../../../../src/ai/presence/stories/ai-presence-default.story.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAMjD,QAAA,MAAM,SAAS,+CAWd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -18,18 +18,23 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
import { type
|
|
21
|
+
import { type CommonProps } from '@neo4j-ndl/react/_common/types';
|
|
22
|
+
type Neo4JAiColorProps = {
|
|
23
|
+
theme: 'light' | 'dark';
|
|
24
|
+
};
|
|
25
|
+
declare const Neo4JAiColor: ({ theme, className, style, ref, htmlAttributes, ...restProps }: CommonProps<"svg", Neo4JAiColorProps>) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
type ComponentProps = Omit<React.ComponentProps<typeof Neo4JAiColor>, 'theme'>;
|
|
22
27
|
declare const Neo4JAiColorLight: import("react").MemoExoticComponent<({ className, style, ref, htmlAttributes, ...restProps }: {
|
|
23
28
|
className?: string;
|
|
24
29
|
style?: React.CSSProperties;
|
|
25
|
-
htmlAttributes?: HtmlAttributes<(props:
|
|
26
|
-
ref?:
|
|
30
|
+
htmlAttributes?: import("@neo4j-ndl/react/_common/types").HtmlAttributes<(props: ComponentProps) => import("react/jsx-runtime").JSX.Element> | undefined;
|
|
31
|
+
ref?: import("react").Ref<SVGSVGElement> | undefined;
|
|
27
32
|
}) => import("react/jsx-runtime").JSX.Element>;
|
|
28
33
|
declare const Neo4JAiColorDark: import("react").MemoExoticComponent<({ className, style, ref, htmlAttributes, ...restProps }: {
|
|
29
34
|
className?: string;
|
|
30
35
|
style?: React.CSSProperties;
|
|
31
|
-
htmlAttributes?: HtmlAttributes<(props:
|
|
32
|
-
ref?:
|
|
36
|
+
htmlAttributes?: import("@neo4j-ndl/react/_common/types").HtmlAttributes<(props: ComponentProps) => import("react/jsx-runtime").JSX.Element> | undefined;
|
|
37
|
+
ref?: import("react").Ref<SVGSVGElement> | undefined;
|
|
33
38
|
}) => import("react/jsx-runtime").JSX.Element>;
|
|
34
39
|
export { Neo4JAiColorLight, Neo4JAiColorDark };
|
|
35
40
|
//# sourceMappingURL=Neo4JAiColor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Neo4JAiColor.d.ts","sourceRoot":"","sources":["../../../../src/icons/manual/Neo4JAiColor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"Neo4JAiColor.d.ts","sourceRoot":"","sources":["../../../../src/icons/manual/Neo4JAiColor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAKlE,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,QAAA,MAAM,YAAY,GAAI,gEAOnB,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,4CA8EvC,CAAC;AAEF,KAAK,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAU/E,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eAAO,MAAM,iBAAiB,GAAI,iDAI/B,sBAAsB,
|
|
1
|
+
{"version":3,"file":"SpotlightProvider.d.ts","sourceRoot":"","sources":["../../../src/spotlight/SpotlightProvider.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,KAAK,sBAAsB,GAAG;IAC5B,qCAAqC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,iEAAiE;IACjE,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,yGAAyG;IACzG,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,2IAA2I;IAC3I,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACpD,2HAA2H;IAC3H,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACxE,8FAA8F;IAC9F,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,sIAAsI;IACtI,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAChE,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAIF,eAAO,MAAM,iBAAiB,GAAI,iDAI/B,sBAAsB,4CAgKxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAO,oBAUtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@tanstack/react-table": "8.21.3",
|
|
87
87
|
"react": ">=19.0.0",
|
|
88
88
|
"react-dom": ">=19.0.0",
|
|
89
|
-
"@neo4j-ndl/base": "^4.0.
|
|
89
|
+
"@neo4j-ndl/base": "^4.0.3"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"@dnd-kit/core": "6.3.1",
|