tekivex-ui 2.5.12 → 2.5.14
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/dist/{TkxForm-9-W3Nl6m.js → TkxForm-BaO4wvXt.js} +109 -103
- package/dist/{TkxForm-1KDzoniV.cjs → TkxForm-M6ttomry.cjs} +1 -1
- package/dist/charts.cjs +1 -1
- package/dist/charts.js +2 -1
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +3 -2
- package/dist/index.cjs +10 -10
- package/dist/index.js +953 -896
- package/dist/quantum.cjs +9 -9
- package/dist/quantum.js +160 -115
- package/dist/realtime.cjs +1 -1
- package/dist/realtime.js +1 -1
- package/dist/src/charts/TkxAreaChart.d.ts.map +1 -1
- package/dist/src/charts/TkxBarChart.d.ts.map +1 -1
- package/dist/src/charts/TkxDonutChart.d.ts.map +1 -1
- package/dist/src/charts/TkxLineChart.d.ts.map +1 -1
- package/dist/src/charts/TkxPieChart.d.ts.map +1 -1
- package/dist/src/charts/TkxRadarChart.d.ts.map +1 -1
- package/dist/src/charts/TkxScatterChart.d.ts.map +1 -1
- package/dist/src/charts/index.d.ts.map +1 -1
- package/dist/src/charts/shared.d.ts.map +1 -1
- package/dist/src/components/TkxAIChatBubble.d.ts.map +1 -1
- package/dist/src/components/TkxAIConfidenceBar.d.ts.map +1 -1
- package/dist/src/components/TkxAIThinking.d.ts.map +1 -1
- package/dist/src/components/TkxAccordion.d.ts.map +1 -1
- package/dist/src/components/TkxAffix.d.ts.map +1 -1
- package/dist/src/components/TkxAlert.d.ts.map +1 -1
- package/dist/src/components/TkxAnchor.d.ts.map +1 -1
- package/dist/src/components/TkxAppBar.d.ts.map +1 -1
- package/dist/src/components/TkxAutocomplete.d.ts.map +1 -1
- package/dist/src/components/TkxAvatar.d.ts.map +1 -1
- package/dist/src/components/TkxBadge.d.ts.map +1 -1
- package/dist/src/components/TkxBottomNav.d.ts.map +1 -1
- package/dist/src/components/TkxBreadcrumb.d.ts.map +1 -1
- package/dist/src/components/TkxButton.d.ts.map +1 -1
- package/dist/src/components/TkxCard.d.ts.map +1 -1
- package/dist/src/components/TkxCarousel.d.ts.map +1 -1
- package/dist/src/components/TkxCascader.d.ts.map +1 -1
- package/dist/src/components/TkxChat.d.ts.map +1 -1
- package/dist/src/components/TkxCheckbox.d.ts.map +1 -1
- package/dist/src/components/TkxClock.d.ts.map +1 -1
- package/dist/src/components/TkxColorPicker.d.ts.map +1 -1
- package/dist/src/components/TkxCommand.d.ts.map +1 -1
- package/dist/src/components/TkxConfigProvider.d.ts.map +1 -1
- package/dist/src/components/TkxDataGrid.d.ts.map +1 -1
- package/dist/src/components/TkxDatePicker.d.ts +1 -1
- package/dist/src/components/TkxDatePicker.d.ts.map +1 -1
- package/dist/src/components/TkxDivider.d.ts.map +1 -1
- package/dist/src/components/TkxDrawer.d.ts.map +1 -1
- package/dist/src/components/TkxDropdown.d.ts.map +1 -1
- package/dist/src/components/TkxEmpty.d.ts.map +1 -1
- package/dist/src/components/TkxFileUpload.d.ts.map +1 -1
- package/dist/src/components/TkxForm.d.ts.map +1 -1
- package/dist/src/components/TkxIcon.d.ts.map +1 -1
- package/dist/src/components/TkxImage.d.ts.map +1 -1
- package/dist/src/components/TkxInput.d.ts.map +1 -1
- package/dist/src/components/TkxLayout.d.ts.map +1 -1
- package/dist/src/components/TkxList.d.ts.map +1 -1
- package/dist/src/components/TkxLiveFeed.d.ts.map +1 -1
- package/dist/src/components/TkxLiveLog.d.ts.map +1 -1
- package/dist/src/components/TkxLiveMetrics.d.ts.map +1 -1
- package/dist/src/components/TkxLogo.d.ts.map +1 -1
- package/dist/src/components/TkxMasonry.d.ts.map +1 -1
- package/dist/src/components/TkxMentions.d.ts.map +1 -1
- package/dist/src/components/TkxMenu.d.ts.map +1 -1
- package/dist/src/components/TkxModal.d.ts.map +1 -1
- package/dist/src/components/TkxNumberInput.d.ts.map +1 -1
- package/dist/src/components/TkxOTP.d.ts.map +1 -1
- package/dist/src/components/TkxPagination.d.ts.map +1 -1
- package/dist/src/components/TkxPlayground.d.ts +15 -1
- package/dist/src/components/TkxPlayground.d.ts.map +1 -1
- package/dist/src/components/TkxPopover.d.ts.map +1 -1
- package/dist/src/components/TkxProgress.d.ts.map +1 -1
- package/dist/src/components/TkxQRCode.d.ts.map +1 -1
- package/dist/src/components/TkxQuantumForm.d.ts.map +1 -1
- package/dist/src/components/TkxRadio.d.ts.map +1 -1
- package/dist/src/components/TkxRating.d.ts.map +1 -1
- package/dist/src/components/TkxRealTimeChart.d.ts.map +1 -1
- package/dist/src/components/TkxResult.d.ts.map +1 -1
- package/dist/src/components/TkxRichTextDisplay.d.ts.map +1 -1
- package/dist/src/components/TkxSegmented.d.ts.map +1 -1
- package/dist/src/components/TkxSelect.d.ts.map +1 -1
- package/dist/src/components/TkxSkeleton.d.ts.map +1 -1
- package/dist/src/components/TkxSlider.d.ts.map +1 -1
- package/dist/src/components/TkxSnackbar.d.ts.map +1 -1
- package/dist/src/components/TkxSpeedDial.d.ts.map +1 -1
- package/dist/src/components/TkxSpin.d.ts.map +1 -1
- package/dist/src/components/TkxStatistic.d.ts.map +1 -1
- package/dist/src/components/TkxStepper.d.ts.map +1 -1
- package/dist/src/components/TkxTable.d.ts.map +1 -1
- package/dist/src/components/TkxTabs.d.ts.map +1 -1
- package/dist/src/components/TkxTag.d.ts.map +1 -1
- package/dist/src/components/TkxThemeBuilder.d.ts.map +1 -1
- package/dist/src/components/TkxTimeline.d.ts.map +1 -1
- package/dist/src/components/TkxToast.d.ts.map +1 -1
- package/dist/src/components/TkxToggle.d.ts.map +1 -1
- package/dist/src/components/TkxToolbar.d.ts.map +1 -1
- package/dist/src/components/TkxTooltip.d.ts.map +1 -1
- package/dist/src/components/TkxTour.d.ts.map +1 -1
- package/dist/src/components/TkxTransferList.d.ts.map +1 -1
- package/dist/src/components/TkxTreeView.d.ts.map +1 -1
- package/dist/src/components/TkxTypography.d.ts.map +1 -1
- package/dist/src/components/TkxVideoPlayer.d.ts.map +1 -1
- package/dist/src/components/TkxWatermark.d.ts.map +1 -1
- package/dist/src/engine/security.d.ts +8 -0
- package/dist/src/engine/security.d.ts.map +1 -1
- package/dist/src/headless/index.d.ts.map +1 -1
- package/dist/src/headless/useControllable.d.ts.map +1 -1
- package/dist/src/headless/useDebounce.d.ts.map +1 -1
- package/dist/src/headless/useDisclosure.d.ts.map +1 -1
- package/dist/src/headless/useFormState.d.ts.map +1 -1
- package/dist/src/headless/useInfiniteQuery.d.ts.map +1 -1
- package/dist/src/headless/useIntersectionObserver.d.ts.map +1 -1
- package/dist/src/headless/useListSelection.d.ts.map +1 -1
- package/dist/src/headless/useLocalStorage.d.ts.map +1 -1
- package/dist/src/headless/useMediaQuery.d.ts.map +1 -1
- package/dist/src/headless/useRovingTabIndex.d.ts.map +1 -1
- package/dist/src/headless/useSSE.d.ts.map +1 -1
- package/dist/src/headless/useThrottle.d.ts.map +1 -1
- package/dist/src/headless/useWebSocket.d.ts.map +1 -1
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/tkx-BoP5V5zy.cjs +4 -0
- package/dist/{tkx-DQkvHdE5.js → tkx-mOKMzvUK.js} +4 -2
- package/package.json +3 -4
- package/src/charts/TkxAreaChart.tsx +3 -1
- package/src/charts/TkxBarChart.tsx +3 -1
- package/src/charts/TkxDonutChart.tsx +3 -1
- package/src/charts/TkxLineChart.tsx +3 -1
- package/src/charts/TkxPieChart.tsx +4 -2
- package/src/charts/TkxRadarChart.tsx +3 -1
- package/src/charts/TkxScatterChart.tsx +3 -1
- package/src/charts/index.ts +3 -1
- package/src/charts/shared.ts +3 -1
- package/src/components/TkxAIChatBubble.tsx +55 -8
- package/src/components/TkxAIConfidenceBar.tsx +3 -1
- package/src/components/TkxAIThinking.tsx +3 -1
- package/src/components/TkxAccordion.tsx +3 -1
- package/src/components/TkxAffix.tsx +3 -1
- package/src/components/TkxAlert.tsx +3 -1
- package/src/components/TkxAnchor.tsx +3 -1
- package/src/components/TkxAppBar.tsx +3 -1
- package/src/components/TkxAutocomplete.tsx +3 -1
- package/src/components/TkxAvatar.tsx +3 -1
- package/src/components/TkxBadge.tsx +3 -1
- package/src/components/TkxBottomNav.tsx +3 -1
- package/src/components/TkxBreadcrumb.tsx +3 -1
- package/src/components/TkxButton.tsx +3 -1
- package/src/components/TkxCard.tsx +3 -1
- package/src/components/TkxCarousel.tsx +3 -1
- package/src/components/TkxCascader.tsx +3 -1
- package/src/components/TkxChat.tsx +3 -1
- package/src/components/TkxCheckbox.tsx +3 -1
- package/src/components/TkxClock.tsx +3 -1
- package/src/components/TkxColorPicker.tsx +3 -1
- package/src/components/TkxCommand.tsx +3 -1
- package/src/components/TkxConfigProvider.tsx +3 -1
- package/src/components/TkxDataGrid.tsx +3 -1
- package/src/components/TkxDatePicker.tsx +76 -18
- package/src/components/TkxDivider.tsx +3 -1
- package/src/components/TkxDrawer.tsx +3 -1
- package/src/components/TkxDropdown.tsx +3 -1
- package/src/components/TkxEmpty.tsx +3 -1
- package/src/components/TkxFileUpload.tsx +3 -1
- package/src/components/TkxForm.tsx +22 -3
- package/src/components/TkxIcon.tsx +3 -1
- package/src/components/TkxImage.tsx +3 -1
- package/src/components/TkxInput.tsx +3 -1
- package/src/components/TkxLayout.tsx +3 -1
- package/src/components/TkxList.tsx +3 -1
- package/src/components/TkxLiveFeed.tsx +3 -1
- package/src/components/TkxLiveLog.tsx +3 -1
- package/src/components/TkxLiveMetrics.tsx +3 -1
- package/src/components/TkxLogo.tsx +3 -1
- package/src/components/TkxMasonry.tsx +3 -1
- package/src/components/TkxMentions.tsx +3 -1
- package/src/components/TkxMenu.tsx +3 -1
- package/src/components/TkxModal.tsx +3 -1
- package/src/components/TkxNumberInput.tsx +3 -1
- package/src/components/TkxOTP.tsx +3 -1
- package/src/components/TkxPagination.tsx +3 -1
- package/src/components/TkxPlayground.tsx +77 -3
- package/src/components/TkxPopover.tsx +3 -1
- package/src/components/TkxProgress.tsx +3 -1
- package/src/components/TkxQRCode.tsx +3 -1
- package/src/components/TkxQuantumForm.tsx +3 -1
- package/src/components/TkxRadio.tsx +3 -1
- package/src/components/TkxRating.tsx +3 -1
- package/src/components/TkxRealTimeChart.tsx +3 -1
- package/src/components/TkxResult.tsx +3 -1
- package/src/components/TkxRichTextDisplay.tsx +3 -1
- package/src/components/TkxSegmented.tsx +3 -1
- package/src/components/TkxSelect.tsx +3 -1
- package/src/components/TkxSkeleton.tsx +3 -1
- package/src/components/TkxSlider.tsx +3 -1
- package/src/components/TkxSnackbar.tsx +3 -1
- package/src/components/TkxSpeedDial.tsx +3 -1
- package/src/components/TkxSpin.tsx +3 -1
- package/src/components/TkxStatistic.tsx +3 -1
- package/src/components/TkxStepper.tsx +3 -1
- package/src/components/TkxTable.tsx +3 -1
- package/src/components/TkxTabs.tsx +3 -1
- package/src/components/TkxTag.tsx +3 -1
- package/src/components/TkxThemeBuilder.tsx +3 -1
- package/src/components/TkxTimeline.tsx +3 -1
- package/src/components/TkxToast.tsx +3 -1
- package/src/components/TkxToggle.tsx +3 -1
- package/src/components/TkxToolbar.tsx +3 -1
- package/src/components/TkxTooltip.tsx +15 -2
- package/src/components/TkxTour.tsx +3 -1
- package/src/components/TkxTransferList.tsx +3 -1
- package/src/components/TkxTreeView.tsx +3 -1
- package/src/components/TkxTypography.tsx +3 -1
- package/src/components/TkxVideoPlayer.tsx +3 -1
- package/src/components/TkxWatermark.tsx +3 -1
- package/src/engine/security.ts +16 -1
- package/src/headless/index.ts +3 -1
- package/src/headless/useControllable.ts +3 -1
- package/src/headless/useDebounce.ts +3 -1
- package/src/headless/useDisclosure.ts +3 -1
- package/src/headless/useFormState.ts +3 -1
- package/src/headless/useInfiniteQuery.ts +3 -1
- package/src/headless/useIntersectionObserver.ts +3 -1
- package/src/headless/useListSelection.ts +3 -1
- package/src/headless/useLocalStorage.ts +3 -1
- package/src/headless/useMediaQuery.ts +3 -1
- package/src/headless/useRovingTabIndex.ts +3 -1
- package/src/headless/useSSE.ts +3 -1
- package/src/headless/useThrottle.ts +3 -1
- package/src/headless/useWebSocket.ts +3 -1
- package/src/hooks/index.ts +3 -1
- package/dist/tkx-0oAwZqgL.cjs +0 -4
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { forwardRef, type ReactNode, type SVGAttributes } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { tkx, cx } from '../engine/tkx';
|
|
@@ -680,4 +682,4 @@ export const ICON_CATEGORIES: Record<string, IconName[]> = {
|
|
|
680
682
|
'file', 'file-text', 'folder', 'folder-open', 'code', 'terminal',
|
|
681
683
|
'lock', 'unlock', 'key', 'shield',
|
|
682
684
|
],
|
|
683
|
-
};
|
|
685
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { forwardRef, useId, type InputHTMLAttributes, type ReactNode } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { sanitizeString } from '../engine/security';
|
|
@@ -98,4 +100,4 @@ export const TkxInput = forwardRef<HTMLInputElement, TkxInputProps>(
|
|
|
98
100
|
},
|
|
99
101
|
);
|
|
100
102
|
|
|
101
|
-
TkxInput.displayName = 'TkxInput';
|
|
103
|
+
TkxInput.displayName = 'TkxInput';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
forwardRef,
|
|
3
5
|
createContext,
|
|
@@ -644,4 +646,4 @@ TkxCol.displayName = 'TkxCol';
|
|
|
644
646
|
// </TkxLayout>
|
|
645
647
|
// <TkxFooter>Footer</TkxFooter>
|
|
646
648
|
// </TkxLayout>
|
|
647
|
-
// ══════════════════════════════════════════════════════════════════════════════
|
|
649
|
+
// ══════════════════════════════════════════════════════════════════════════════
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { type ReactNode, type CSSProperties } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { useReducedMotion } from '../hooks';
|
|
@@ -294,4 +296,4 @@ function splitBrand(
|
|
|
294
296
|
<span style={{ color: primaryColor }}>{text.slice(split)}</span>
|
|
295
297
|
</>
|
|
296
298
|
);
|
|
297
|
-
}
|
|
299
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { type ReactNode, useState, useRef, useCallback, useEffect } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { sanitizeString } from '../engine/security';
|
|
@@ -207,4 +209,4 @@ export function TkxMentions({
|
|
|
207
209
|
)}
|
|
208
210
|
</div>
|
|
209
211
|
);
|
|
210
|
-
}
|
|
212
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { useEffect, useId, type ReactNode } from 'react';
|
|
2
4
|
import { createPortal } from 'react-dom';
|
|
3
5
|
import { useTheme } from '../themes';
|
|
@@ -117,4 +119,4 @@ export function TkxModal({ isOpen, onClose, title, size = 'md', closeOnOverlayCl
|
|
|
117
119
|
</div>,
|
|
118
120
|
document.body,
|
|
119
121
|
);
|
|
120
|
-
}
|
|
122
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { useState, useId } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { tkx } from '../engine/tkx';
|
|
@@ -385,4 +387,4 @@ export function TkxPagination({
|
|
|
385
387
|
);
|
|
386
388
|
}
|
|
387
389
|
|
|
388
|
-
TkxPagination.displayName = 'TkxPagination';
|
|
390
|
+
TkxPagination.displayName = 'TkxPagination';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
// ── TkxPlayground ─────────────────────────────────────────────────────────────
|
|
2
4
|
// In-browser live component playground. Type JSX, see it render instantly.
|
|
3
5
|
// Uses new Function() evaluation, an error boundary, quantum component
|
|
@@ -43,6 +45,56 @@ export interface TkxPlaygroundProps {
|
|
|
43
45
|
examples?: PlaygroundExample[];
|
|
44
46
|
height?: number;
|
|
45
47
|
imports?: Record<string, unknown>;
|
|
48
|
+
/**
|
|
49
|
+
* When true, reject code containing high-risk tokens (fetch, XMLHttpRequest,
|
|
50
|
+
* document.cookie, localStorage, sessionStorage, import(), window.*, eval).
|
|
51
|
+
* Defense-in-depth — not a true sandbox. Default: true.
|
|
52
|
+
*
|
|
53
|
+
* Set to `false` only in trusted developer environments where the playground
|
|
54
|
+
* input cannot come from an untrusted third party.
|
|
55
|
+
*/
|
|
56
|
+
strictMode?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Additional forbidden substrings appended to the default deny list
|
|
59
|
+
* (when strictMode is on).
|
|
60
|
+
*/
|
|
61
|
+
forbiddenTokens?: string[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Conservative deny list for strictMode. These patterns signal network
|
|
65
|
+
// exfiltration, storage access, or global-scope escape — capabilities that
|
|
66
|
+
// live-playground snippets should never need. Matching is substring-based
|
|
67
|
+
// and case-insensitive; it is intentionally coarse (false-positives are
|
|
68
|
+
// acceptable when the alternative is arbitrary code execution).
|
|
69
|
+
const DEFAULT_FORBIDDEN_TOKENS = [
|
|
70
|
+
'fetch(',
|
|
71
|
+
'XMLHttpRequest',
|
|
72
|
+
'navigator.sendBeacon',
|
|
73
|
+
'document.cookie',
|
|
74
|
+
'localStorage',
|
|
75
|
+
'sessionStorage',
|
|
76
|
+
'indexedDB',
|
|
77
|
+
'WebSocket',
|
|
78
|
+
'EventSource',
|
|
79
|
+
'import(',
|
|
80
|
+
'eval(',
|
|
81
|
+
'new Function(',
|
|
82
|
+
'postMessage',
|
|
83
|
+
'window.open',
|
|
84
|
+
'location.href',
|
|
85
|
+
'location.replace',
|
|
86
|
+
'location.assign',
|
|
87
|
+
'document.write',
|
|
88
|
+
'crypto.subtle',
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
function detectForbiddenToken(code: string, extra?: string[]): string | null {
|
|
92
|
+
const needles = [...DEFAULT_FORBIDDEN_TOKENS, ...(extra ?? [])];
|
|
93
|
+
const lower = code.toLowerCase();
|
|
94
|
+
for (const n of needles) {
|
|
95
|
+
if (lower.includes(n.toLowerCase())) return n;
|
|
96
|
+
}
|
|
97
|
+
return null;
|
|
46
98
|
}
|
|
47
99
|
|
|
48
100
|
// ── Built-in examples ─────────────────────────────────────────────────────────
|
|
@@ -194,11 +246,31 @@ function getBabel(): BabelStandalone | null {
|
|
|
194
246
|
function evalCode(
|
|
195
247
|
code: string,
|
|
196
248
|
importsObj: Record<string, unknown>,
|
|
249
|
+
opts?: { strictMode?: boolean; forbiddenTokens?: string[] },
|
|
197
250
|
): { element: ReactNode | null; error: string | null; renderMs: number } {
|
|
198
251
|
const t0 = performance.now();
|
|
199
252
|
try {
|
|
200
253
|
const trimmed = code.trim();
|
|
201
254
|
|
|
255
|
+
// Strict-mode defense: block high-risk tokens before evaluation.
|
|
256
|
+
// Not a sandbox — a layer of protection against accidental exfiltration
|
|
257
|
+
// when a playground is wired to untrusted input (e.g. shared snippets).
|
|
258
|
+
if (opts?.strictMode !== false) {
|
|
259
|
+
const hit = detectForbiddenToken(trimmed, opts?.forbiddenTokens);
|
|
260
|
+
if (hit) {
|
|
261
|
+
const renderMs = parseFloat((performance.now() - t0).toFixed(2));
|
|
262
|
+
return {
|
|
263
|
+
element: null,
|
|
264
|
+
error:
|
|
265
|
+
`Blocked by playground strictMode: code contains "${hit}". ` +
|
|
266
|
+
`This token is disallowed because playground snippets run in the ` +
|
|
267
|
+
`page's JavaScript context. If you trust the source, pass ` +
|
|
268
|
+
`strictMode={false} to <TkxPlayground>.`,
|
|
269
|
+
renderMs,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
202
274
|
// Always wrap user code in a function component so React hooks (useState,
|
|
203
275
|
// useEffect, ...) work — they require an active render context to dispatch.
|
|
204
276
|
// The user can write a single JSX expression OR a function body that returns JSX.
|
|
@@ -335,6 +407,8 @@ export function TkxPlayground({
|
|
|
335
407
|
examples: userExamples,
|
|
336
408
|
height = 480,
|
|
337
409
|
imports = {},
|
|
410
|
+
strictMode = true,
|
|
411
|
+
forbiddenTokens,
|
|
338
412
|
}: TkxPlaygroundProps) {
|
|
339
413
|
const theme = useTheme();
|
|
340
414
|
const allExamples = [...BUILT_IN_EXAMPLES, ...(userExamples ?? [])];
|
|
@@ -359,10 +433,10 @@ export function TkxPlayground({
|
|
|
359
433
|
const runEval = useCallback(
|
|
360
434
|
(src: string) => {
|
|
361
435
|
setBoundaryError(null);
|
|
362
|
-
const result = evalCode(src, imports);
|
|
436
|
+
const result = evalCode(src, imports, { strictMode, forbiddenTokens });
|
|
363
437
|
setPreview(result);
|
|
364
438
|
},
|
|
365
|
-
[imports],
|
|
439
|
+
[imports, strictMode, forbiddenTokens],
|
|
366
440
|
);
|
|
367
441
|
|
|
368
442
|
useEffect(() => {
|
|
@@ -768,4 +842,4 @@ export function TkxPlayground({
|
|
|
768
842
|
);
|
|
769
843
|
}
|
|
770
844
|
|
|
771
|
-
TkxPlayground.displayName = 'TkxPlayground';
|
|
845
|
+
TkxPlayground.displayName = 'TkxPlayground';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { useReducedMotion } from '../hooks';
|
|
@@ -109,4 +111,4 @@ export const TkxProgress = forwardRef<HTMLDivElement, TkxProgressProps>(
|
|
|
109
111
|
},
|
|
110
112
|
);
|
|
111
113
|
|
|
112
|
-
TkxProgress.displayName = 'TkxProgress';
|
|
114
|
+
TkxProgress.displayName = 'TkxProgress';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
// ── TkxQuantumForm ────────────────────────────────────────────────────────────
|
|
2
4
|
// Quantum-AI powered smart form. Field types, validation rules, labels, and
|
|
3
5
|
// placeholders are automatically inferred from field names via
|
|
@@ -589,4 +591,4 @@ export function TkxQuantumForm({
|
|
|
589
591
|
);
|
|
590
592
|
}
|
|
591
593
|
|
|
592
|
-
TkxQuantumForm.displayName = 'TkxQuantumForm';
|
|
594
|
+
TkxQuantumForm.displayName = 'TkxQuantumForm';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { type ReactNode } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { sanitizeString } from '../engine/security';
|
|
@@ -125,4 +127,4 @@ export function TkxResult({ status, title, subTitle, icon, extra }: TkxResultPro
|
|
|
125
127
|
)}
|
|
126
128
|
</div>
|
|
127
129
|
);
|
|
128
|
-
}
|
|
130
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { type ReactNode, useState, useRef, useEffect, useCallback } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { sanitizeString } from '../engine/security';
|
|
@@ -166,4 +168,4 @@ export function TkxSegmented({
|
|
|
166
168
|
})}
|
|
167
169
|
</div>
|
|
168
170
|
);
|
|
169
|
-
}
|
|
171
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { forwardRef, type HTMLAttributes } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { useReducedMotion } from '../hooks';
|
|
@@ -102,4 +104,4 @@ export const TkxSkeleton = forwardRef<HTMLDivElement, TkxSkeletonProps>(
|
|
|
102
104
|
},
|
|
103
105
|
);
|
|
104
106
|
|
|
105
|
-
TkxSkeleton.displayName = 'TkxSkeleton';
|
|
107
|
+
TkxSkeleton.displayName = 'TkxSkeleton';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { useState, useEffect, useRef, type ReactNode, type CSSProperties, createElement } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { sanitizeString } from '../engine/security';
|
|
@@ -258,4 +260,4 @@ export function TkxCountdown({
|
|
|
258
260
|
),
|
|
259
261
|
),
|
|
260
262
|
);
|
|
261
|
-
}
|
|
263
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { createContext, useContext, useState, useRef, useId, type ReactNode, type HTMLAttributes } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { handleTabsKeyboard } from '../engine/wcag';
|
|
@@ -121,4 +123,4 @@ export function TkxTabPanel({ index, children, style, className }: TkxTabPanelPr
|
|
|
121
123
|
{children}
|
|
122
124
|
</div>
|
|
123
125
|
);
|
|
124
|
-
}
|
|
126
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
// ══════════════════════════════════════════════════════════════════════════════
|
|
2
4
|
// TkxThemeBuilder — Quantum-powered visual theme builder component
|
|
3
5
|
// Uses real quantum annealing to optimize color palettes.
|
|
@@ -682,4 +684,4 @@ export function TkxThemeBuilder({
|
|
|
682
684
|
);
|
|
683
685
|
}
|
|
684
686
|
|
|
685
|
-
export default TkxThemeBuilder;
|
|
687
|
+
export default TkxThemeBuilder;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { forwardRef, useId, type ButtonHTMLAttributes } from 'react';
|
|
2
4
|
import { useTheme } from '../themes';
|
|
3
5
|
import { useReducedMotion } from '../hooks';
|
|
@@ -90,4 +92,4 @@ export const TkxToggle = forwardRef<HTMLButtonElement, TkxToggleProps>(
|
|
|
90
92
|
},
|
|
91
93
|
);
|
|
92
94
|
|
|
93
|
-
TkxToggle.displayName = 'TkxToggle';
|
|
95
|
+
TkxToggle.displayName = 'TkxToggle';
|