@seedgrid/fe-components 2026.3.2-1 → 2026.3.2-3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SgQRCode.d.ts","sourceRoot":"","sources":["../../../src/gadgets/qr-code/SgQRCode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,MAAM,4BAA4B,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,kDAyItD;yBAzIe,QAAQ"}
1
+ {"version":3,"file":"SgQRCode.d.ts","sourceRoot":"","sources":["../../../src/gadgets/qr-code/SgQRCode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAyC/B,MAAM,MAAM,4BAA4B,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,kDA8FtD;yBA9Fe,QAAQ"}
@@ -1,70 +1,44 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import QRCode from "qrcode";
4
+ import { QRCodeSVG } from "qrcode.react";
5
5
  function cn(...parts) {
6
6
  return parts.filter(Boolean).join(" ");
7
7
  }
8
+ class QrErrorBoundary extends React.Component {
9
+ state = { hasError: false };
10
+ static getDerivedStateFromError() {
11
+ return { hasError: true };
12
+ }
13
+ componentDidCatch(error) {
14
+ this.props.onError?.(error);
15
+ }
16
+ componentDidUpdate(prevProps) {
17
+ if (prevProps.resetKey !== this.props.resetKey && this.state.hasError) {
18
+ this.setState({ hasError: false });
19
+ }
20
+ }
21
+ render() {
22
+ if (this.state.hasError)
23
+ return this.props.fallback;
24
+ return this.props.children;
25
+ }
26
+ }
8
27
  export function SgQRCode(props) {
9
28
  const { value, size = 220, margin = 2, fgColor = "#000000", bgColor = "#FFFFFF", errorCorrectionLevel = "H", logoSrc, logoAlt = "Logo", logoSize, logoPadding = 6, logoBackgroundColor = "#FFFFFF", logoBorderRadius = 12, imageClassName, logoClassName, emptyFallback, onGenerateError, className, style, ...rest } = props;
10
- const [qrDataUrl, setQrDataUrl] = React.useState("");
11
- const [hasError, setHasError] = React.useState(false);
12
29
  const normalizedValue = value?.trim() ?? "";
13
30
  const safeSize = Math.max(64, Math.round(size));
14
31
  const safeMargin = Math.max(0, Math.round(margin));
15
32
  const safeLogoPadding = Math.max(0, Math.round(logoPadding));
16
33
  const safeLogoSize = Math.max(18, Math.min(safeSize, Math.round(logoSize ?? safeSize * 0.22)));
17
34
  const logoContainerSize = safeLogoSize + safeLogoPadding * 2;
18
- React.useEffect(() => {
19
- let active = true;
20
- if (!normalizedValue) {
21
- setQrDataUrl("");
22
- setHasError(false);
23
- return () => {
24
- active = false;
25
- };
26
- }
27
- QRCode.toDataURL(normalizedValue, {
28
- width: safeSize,
29
- margin: safeMargin,
30
- color: {
31
- dark: fgColor,
32
- light: bgColor
33
- },
34
- errorCorrectionLevel
35
- })
36
- .then((dataUrl) => {
37
- if (!active)
38
- return;
39
- setQrDataUrl(dataUrl);
40
- setHasError(false);
41
- })
42
- .catch((cause) => {
43
- if (!active)
44
- return;
45
- const error = cause instanceof Error ? cause : new Error("Failed to generate QR code");
46
- setQrDataUrl("");
47
- setHasError(true);
48
- onGenerateError?.(error);
49
- });
50
- return () => {
51
- active = false;
52
- };
53
- }, [
54
- normalizedValue,
55
- safeSize,
56
- safeMargin,
57
- fgColor,
58
- bgColor,
59
- errorCorrectionLevel,
60
- onGenerateError
61
- ]);
35
+ const qrResetKey = `${normalizedValue}|${safeSize}|${safeMargin}|${fgColor}|${bgColor}|${errorCorrectionLevel}`;
62
36
  if (!normalizedValue) {
63
37
  if (!emptyFallback)
64
38
  return null;
65
39
  return (_jsx("div", { className: cn("inline-flex items-center justify-center", className), style: { width: safeSize, height: safeSize, ...style }, ...rest, children: emptyFallback }));
66
40
  }
67
- return (_jsxs("div", { className: cn("relative inline-flex items-center justify-center", className), style: { width: safeSize, height: safeSize, ...style }, ...rest, children: [qrDataUrl && !hasError ? (_jsx("img", { src: qrDataUrl, alt: "QR Code", width: safeSize, height: safeSize, className: cn("block h-full w-full", imageClassName), draggable: false })) : (_jsx("div", { className: "h-full w-full animate-pulse rounded-md bg-muted/40", "aria-hidden": "true" })), logoSrc && qrDataUrl && !hasError ? (_jsx("span", { className: cn("absolute inline-flex items-center justify-center overflow-hidden", logoClassName), style: {
41
+ return (_jsxs("div", { className: cn("relative inline-flex items-center justify-center", className), style: { width: safeSize, height: safeSize, ...style }, ...rest, children: [_jsx(QrErrorBoundary, { resetKey: qrResetKey, onError: onGenerateError, fallback: _jsx("div", { className: "h-full w-full animate-pulse rounded-md bg-muted/40", "aria-hidden": "true" }), children: _jsx(QRCodeSVG, { value: normalizedValue, size: safeSize, marginSize: safeMargin, fgColor: fgColor, bgColor: bgColor, level: errorCorrectionLevel, title: "QR Code", className: cn("block h-full w-full", imageClassName) }) }), logoSrc ? (_jsx("span", { className: cn("absolute inline-flex items-center justify-center overflow-hidden", logoClassName), style: {
68
42
  width: logoContainerSize,
69
43
  height: logoContainerSize,
70
44
  padding: safeLogoPadding,
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  export type SgPageControlPageProps = {
3
3
  id?: string;
4
4
  title: React.ReactNode;
5
+ hint?: string;
5
6
  icon?: React.ReactNode;
6
7
  hidden?: boolean;
7
8
  disabled?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"SgPageControl.d.ts","sourceRoot":"","sources":["../../src/layout/SgPageControl.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,CACrB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,sBAAsB,CAAA;KAAE,KACrD,IAAI,CAAC;IACV,mBAAmB,CAAC,EAAE,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,sBAAsB,CAAA;KAAE,KACtD,IAAI,CAAC;IAEV,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAA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AAsB,CAAC,2CAExE;yBAFe,iBAAiB"}
@@ -137,7 +137,7 @@ export function SgPageControl(props) {
137
137
  const panelId = `${rootId}-panel-${record.id}`;
138
138
  return (_jsxs("button", { ref: (el) => {
139
139
  tabsRef.current[index] = el;
140
- }, type: "button", id: tabId, role: "tab", "aria-controls": panelId, "aria-selected": isActive, tabIndex: isActive ? 0 : -1, disabled: record.props.disabled, onClick: () => selectPage(record.id), className: cn("inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors", sizeClasses.tab, tabStyle.base, isActive ? tabStyle.active : tabStyle.inactive, fullWidthTabs ? "w-full" : "", record.props.disabled ? "cursor-not-allowed opacity-45" : "", tabClassName, record.props.tabClassName), children: [record.props.icon ? (_jsx("span", { className: cn("inline-flex items-center justify-center", sizeClasses.icon), children: record.props.icon })) : null, _jsx("span", { className: "truncate", children: record.props.title })] }, record.id));
140
+ }, type: "button", id: tabId, role: "tab", "aria-controls": panelId, "aria-selected": isActive, tabIndex: isActive ? 0 : -1, title: record.props.hint, disabled: record.props.disabled, onClick: () => selectPage(record.id), className: cn("inline-flex shrink-0 items-center justify-center whitespace-nowrap font-medium transition-colors", sizeClasses.tab, tabStyle.base, isActive ? tabStyle.active : tabStyle.inactive, fullWidthTabs ? "w-full" : "", record.props.disabled ? "cursor-not-allowed opacity-45" : "", tabClassName, record.props.tabClassName), children: [record.props.icon ? (_jsx("span", { className: cn("inline-flex items-center justify-center", sizeClasses.icon), children: record.props.icon })) : null, _jsx("span", { className: "truncate", children: record.props.title })] }, record.id));
141
141
  }) }), _jsx("div", { className: cn("rounded-b-md border border-t-0 border-border bg-background", panelClassName), children: visiblePages.length === 0 ? (_jsx("div", { className: cn(sizeClasses.panel, "text-sm text-muted-foreground"), children: emptyMessage })) : keepMounted ? (visiblePages.map((record) => {
142
142
  const isActive = record.id === resolvedActiveId;
143
143
  const tabId = `${rootId}-tab-${record.id}`;
@@ -1 +1 @@
1
- {"version":3,"file":"SgPlayground.d.ts","sourceRoot":"","sources":["../../src/others/SgPlayground.tsx"],"names":[],"mappings":"AAiBA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA4VF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,2CAgOtE"}
1
+ {"version":3,"file":"SgPlayground.d.ts","sourceRoot":"","sources":["../../src/others/SgPlayground.tsx"],"names":[],"mappings":"AAiBA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAwXF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,2CAoOtE"}
@@ -7,12 +7,14 @@ import { SgCard } from "../layout/SgCard";
7
7
  function cn(...parts) {
8
8
  return parts.filter(Boolean).join(" ");
9
9
  }
10
- const DEFAULT_SEEDGRID_DEPENDENCY = "2026.3.1";
10
+ const DEFAULT_SEEDGRID_DEPENDENCY = "latest";
11
11
  const DEFAULT_SEEDGRID_PEER_DEPENDENCIES = {
12
12
  "@codesandbox/sandpack-react": "^2.20.0",
13
13
  "react-hook-form": "^7.0.0",
14
14
  "lucide-react": "^0.468.0",
15
+ "@tiptap/core": "^2.9.1",
15
16
  "@tiptap/react": "^2.9.1",
17
+ "@tiptap/pm": "^2.9.1",
16
18
  "@tiptap/starter-kit": "^2.9.1",
17
19
  "@tiptap/extension-underline": "^2.9.1",
18
20
  "@tiptap/extension-link": "^2.9.1",
@@ -29,6 +31,30 @@ const SANDPACK_EXTERNAL_RESOURCES = [
29
31
  // Prebuilt utility CSS so classes from @seedgrid/fe-components can render inside Sandpack
30
32
  "https://unpkg.com/tailwindcss@2.2.19/dist/tailwind.min.css"
31
33
  ];
34
+ const SANDPACK_QRCODE_SHIM_PACKAGE_JSON = `{
35
+ "name": "qrcode",
36
+ "version": "0.0.0-sandpack-shim",
37
+ "type": "module",
38
+ "main": "./index.js",
39
+ "module": "./index.js",
40
+ "exports": {
41
+ ".": "./index.js"
42
+ }
43
+ }`;
44
+ const SANDPACK_QRCODE_SHIM_INDEX_JS = `const makeError = () =>
45
+ new Error(
46
+ "qrcode (node build) is not supported in Sandpack browser runtime. Update @seedgrid/fe-components to a browser-safe QR implementation."
47
+ );
48
+
49
+ const qrcodeShim = {
50
+ toDataURL() {
51
+ return Promise.reject(makeError());
52
+ }
53
+ };
54
+
55
+ export const toDataURL = (...args) => qrcodeShim.toDataURL(...args);
56
+ export default qrcodeShim;
57
+ `;
32
58
  const SANDPACK_FALLBACK_THEME_VARS = {
33
59
  "--background": "0 0% 100%",
34
60
  "--foreground": "222.2 84% 4.9%",
@@ -361,7 +387,10 @@ export default function SgPlayground(props) {
361
387
  DEFAULT_SEEDGRID_DEPENDENCY;
362
388
  const files = {
363
389
  "/App.tsx": { code: appTsx, active: true },
364
- "/styles.css": { code: sandpackStylesCss || buildSandpackStylesCss({}, effectivePreviewPadding) }
390
+ "/styles.css": { code: sandpackStylesCss || buildSandpackStylesCss({}, effectivePreviewPadding) },
391
+ // Compatibility shim for legacy @seedgrid/fe-components builds that still import "qrcode" (node-only path).
392
+ "/node_modules/qrcode/package.json": { code: SANDPACK_QRCODE_SHIM_PACKAGE_JSON, hidden: true },
393
+ "/node_modules/qrcode/index.js": { code: SANDPACK_QRCODE_SHIM_INDEX_JS, hidden: true }
365
394
  };
366
395
  const deps = {
367
396
  react: "^19.0.0",
@@ -381,6 +410,7 @@ export default function SgPlayground(props) {
381
410
  const content = interactive ? (_jsx("div", { className: cn(withCard ? "" : "rounded-lg border border-border", withCard ? undefined : className), children: _jsxs(SandpackProvider, { template: "react-ts", files: files, customSetup: { dependencies: deps }, options: {
382
411
  autorun: false,
383
412
  initMode: "lazy",
413
+ bundlerURL: "https://sandpack.seedgrid.com.br",
384
414
  bundlerTimeOut: 60000,
385
415
  activeFile: "/App.tsx",
386
416
  visibleFiles: ["/App.tsx"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedgrid/fe-components",
3
- "version": "2026.3.2-1",
3
+ "version": "2026.3.2-3",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,11 +29,13 @@
29
29
  "typecheck": "tsc -p tsconfig.json --noEmit"
30
30
  },
31
31
  "peerDependencies": {
32
+ "@tiptap/core": "^2.9.1",
32
33
  "@tiptap/extension-color": "^2.9.1",
33
34
  "@tiptap/extension-font-family": "^2.9.1",
34
35
  "@tiptap/extension-highlight": "^2.9.1",
35
36
  "@tiptap/extension-image": "^2.9.1",
36
37
  "@tiptap/extension-link": "^2.9.1",
38
+ "@tiptap/pm": "^2.9.1",
37
39
  "@tiptap/extension-subscript": "^2.9.1",
38
40
  "@tiptap/extension-superscript": "^2.9.1",
39
41
  "@tiptap/extension-text-align": "^2.9.1",
@@ -46,11 +48,13 @@
46
48
  "react-hook-form": "^7.0.0"
47
49
  },
48
50
  "devDependencies": {
51
+ "@tiptap/core": "^2.9.1",
49
52
  "@tiptap/extension-color": "^2.9.1",
50
53
  "@tiptap/extension-font-family": "^2.9.1",
51
54
  "@tiptap/extension-highlight": "^2.9.1",
52
55
  "@tiptap/extension-image": "^2.9.1",
53
56
  "@tiptap/extension-link": "^2.9.1",
57
+ "@tiptap/pm": "^2.9.1",
54
58
  "@tiptap/extension-subscript": "^2.9.1",
55
59
  "@tiptap/extension-superscript": "^2.9.1",
56
60
  "@tiptap/extension-text-align": "^2.9.1",
@@ -58,7 +62,6 @@
58
62
  "@tiptap/extension-underline": "^2.9.1",
59
63
  "@tiptap/react": "^2.9.1",
60
64
  "@tiptap/starter-kit": "^2.9.1",
61
- "@types/qrcode": "^1.5.6",
62
65
  "lucide-react": "^0.468.0",
63
66
  "react": "19.0.0",
64
67
  "react-dom": "19.0.0",
@@ -67,6 +70,6 @@
67
70
  "dependencies": {
68
71
  "@codesandbox/sandpack-react": "^2.20.0",
69
72
  "@pqina/flip": "^1.8.4",
70
- "qrcode": "^1.5.4"
73
+ "qrcode.react": "^4.2.0"
71
74
  }
72
75
  }