@nice2dev/ui 1.2.0 → 1.2.2
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/CHANGELOG.md +150 -0
- package/dist/NiceApiExplorer.doc-CFJndg5h.js +25 -0
- package/dist/NiceApiExplorer.doc-TEx67kV5.cjs +1 -0
- package/dist/NiceBPMNDesigner.doc-6lK1pXRq.js +32 -0
- package/dist/NiceBPMNDesigner.doc-BY8t7qOi.cjs +8 -0
- package/dist/NiceBackupDiffViewer.doc-CYvOeX19.js +25 -0
- package/dist/NiceBackupDiffViewer.doc-ChQaZCg1.cjs +1 -0
- package/dist/NiceBackupList.doc-BdQCw0_D.cjs +1 -0
- package/dist/NiceBackupList.doc-BwjIAoqz.js +25 -0
- package/dist/NiceBackupRestoreDialog.doc-B2iiqTps.cjs +1 -0
- package/dist/NiceBackupRestoreDialog.doc-DuXSGJiD.js +25 -0
- package/dist/NiceBackupScheduler.doc-BpY45181.js +31 -0
- package/dist/NiceBackupScheduler.doc-ByeL3iH1.cjs +7 -0
- package/dist/NiceBackupStatusBadge.doc-BA3dYgiW.cjs +1 -0
- package/dist/NiceBackupStatusBadge.doc-CxwkVarP.js +25 -0
- package/dist/NiceBackupTagEditor.doc-Bej1KHco.cjs +7 -0
- package/dist/NiceBackupTagEditor.doc-CNy4uNws.js +31 -0
- package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +8 -0
- package/dist/NiceBottomSheet.doc-v-UPUKQk.js +32 -0
- package/dist/NiceBranchManager.doc-BTyRjX7X.cjs +6 -0
- package/dist/NiceBranchManager.doc-Cz4SyEqE.js +30 -0
- package/dist/NiceButton-3AcJJ15c.cjs +1 -0
- package/dist/NiceButton-vkI07DP0.js +88 -0
- package/dist/NiceCodeEditor-C43xFG8v.cjs +260 -0
- package/dist/NiceCodeEditor-CspuYLh6.js +1174 -0
- package/dist/NiceCodeEditor-VGIDWSkS.js +1181 -0
- package/dist/NiceCodeEditor-qX39PSnQ.cjs +260 -0
- package/dist/NiceColorPicker-CQhhjZ8w.cjs +1 -0
- package/dist/NiceColorPicker-Cbop7VMu.js +491 -0
- package/dist/NiceConnectorConfigForm.doc-BKrDuhXw.cjs +7 -0
- package/dist/NiceConnectorConfigForm.doc-BsHeXz3M.js +31 -0
- package/dist/NiceDataBranchGraph.doc-Axidz41W.js +29 -0
- package/dist/NiceDataBranchGraph.doc-sjLmrrtE.cjs +5 -0
- package/dist/NiceDataBranchManager.doc-B1-Rp2X4.cjs +6 -0
- package/dist/NiceDataBranchManager.doc-GUqfTFvW.js +30 -0
- package/dist/NiceDataConflictResolver.doc-CjQryrTu.cjs +5 -0
- package/dist/NiceDataConflictResolver.doc-L-TcnQMX.js +29 -0
- package/dist/NiceDataDiffViewer.doc-BzGrf0U-.cjs +6 -0
- package/dist/NiceDataDiffViewer.doc-goxhSldH.js +30 -0
- package/dist/NiceDataGrid-BDEIbuBS.js +2218 -0
- package/dist/NiceDataGrid-CS5aB-EN.cjs +10 -0
- package/dist/NiceDataGrid-CrD4HPlO.cjs +10 -0
- package/dist/NiceDataGrid-Dfg1DVbU.js +2224 -0
- package/dist/NiceDataMapper.doc-QmnmnvVq.js +30 -0
- package/dist/NiceDataMapper.doc-ytGVtYVr.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-BcmzKxh2.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-BvYa4aUJ.js +30 -0
- package/dist/NiceDataSnapshot.doc-C73K1biG.cjs +6 -0
- package/dist/NiceDataSnapshot.doc-hU7wnOzM.js +30 -0
- package/dist/NiceDesktopViews.doc-DJjYlyP2.cjs +1 -0
- package/dist/NiceDesktopViews.doc-ly-VUAJj.js +25 -0
- package/dist/NiceDeviceControlCard.doc-BZIo92-w.cjs +1 -0
- package/dist/NiceDeviceControlCard.doc-DIzZcW9L.js +25 -0
- package/dist/NiceDocumentViewer-B9VIVKyw.js +726 -0
- package/dist/NiceDocumentViewer-CDXAmPp7.cjs +180 -0
- package/dist/NiceDocumentationViewer.doc-BSNGa7a_.js +25 -0
- package/dist/NiceDocumentationViewer.doc-CrwlvPFg.cjs +1 -0
- package/dist/NiceEnergyChart.doc-DW-jllDV.cjs +1 -0
- package/dist/NiceEnergyChart.doc-DnEehTff.js +25 -0
- package/dist/NiceFeatureGate.doc-DN17uS_B.cjs +3 -0
- package/dist/NiceFeatureGate.doc-DNfFSRrh.js +27 -0
- package/dist/NiceForm-BcN4p2kG.cjs +1 -0
- package/dist/NiceForm-CISJyzoW.cjs +1 -0
- package/dist/NiceForm-DmH6k1b_.js +4775 -0
- package/dist/NiceForm-tIXS-M6b.js +4770 -0
- package/dist/NiceFormItem.doc-BJwEnDz2.js +36 -0
- package/dist/NiceFormItem.doc-Ck3PgaPD.cjs +12 -0
- package/dist/NiceGantt-CHnq-n8f.cjs +1 -0
- package/dist/NiceGantt-CTbqCuwv.cjs +1 -0
- package/dist/NiceGantt-CX3jVNaF.js +330 -0
- package/dist/NiceGantt-Dao7pN9z.js +328 -0
- package/dist/NiceGantt.doc-B6YZcJvG.cjs +11 -0
- package/dist/NiceGantt.doc-DsI1QXly.js +48 -0
- package/dist/NiceGitBlame.doc-BQ2KvGkD.js +30 -0
- package/dist/NiceGitBlame.doc-DuTSjZVN.cjs +6 -0
- package/dist/NiceGitDiffViewer.doc-D24AGos_.js +30 -0
- package/dist/NiceGitDiffViewer.doc-D9FVquBC.cjs +6 -0
- package/dist/NiceGitGraph.doc-C-8VGMIz.js +29 -0
- package/dist/NiceGitGraph.doc-eRvTmefl.cjs +5 -0
- package/dist/NiceGitHooks.doc-DCTVw7HX.cjs +5 -0
- package/dist/NiceGitHooks.doc-OCFj5w6v.js +29 -0
- package/dist/NiceHtmlEditor-DUwcqj5N.cjs +10 -0
- package/dist/NiceHtmlEditor-DeK0Of98.js +883 -0
- package/dist/NiceHtmlEditor-DiAphF1k.js +889 -0
- package/dist/NiceHtmlEditor-DvVxl4Fu.cjs +10 -0
- package/dist/NiceInstanceMonitor.doc-BSDZp5xa.js +31 -0
- package/dist/NiceInstanceMonitor.doc-HVbLufnh.cjs +7 -0
- package/dist/NiceLocaleManager.doc-CbVHDEWu.js +25 -0
- package/dist/NiceLocaleManager.doc-XH6hMW0Z.cjs +1 -0
- package/dist/NiceLockButton.doc-BMhSj3TB.cjs +1 -0
- package/dist/NiceLockButton.doc-DvHGhcfm.js +25 -0
- package/dist/NiceLoginForm-CHXbz0eu.js +747 -0
- package/dist/NiceLoginForm-DQe77Isv.js +747 -0
- package/dist/NiceLoginForm-NBCo-DUZ.cjs +1 -0
- package/dist/NiceLoginForm-ix6J1adA.cjs +1 -0
- package/dist/NiceLoginForm.css +1 -1
- package/dist/NiceMAM.doc-CsQ57saR.cjs +8 -0
- package/dist/NiceMAM.doc-hjW7buTH.js +32 -0
- package/dist/NiceMention--3P3vO-W.cjs +430 -0
- package/dist/NiceMention-Co2cqkVM.js +11316 -0
- package/dist/NiceMention-DKhk3xdM.js +11321 -0
- package/dist/NiceMention-wp1AJ5oh.cjs +430 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-BbQwiEOp.cjs +1 -0
- package/dist/NiceModal-DQEfTcnZ.js +85 -0
- package/dist/NiceModuleLifecyclePanel-22CEEVbA.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BCd9Wv5Y.js +6825 -0
- package/dist/NiceModuleLifecyclePanel-DV3F_QdI.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-gaZkIEtK.js +6825 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NiceNetworkDiscoveryPanel.doc-B0RtGaS3.js +25 -0
- package/dist/NiceNetworkDiscoveryPanel.doc-BFgFZI5G.cjs +1 -0
- package/dist/NicePagination-B3nZDZem.js +165 -0
- package/dist/NicePagination-B8rg1Y67.cjs +1 -0
- package/dist/NicePagination-BFGt1v0a.js +165 -0
- package/dist/NicePagination-DltL3-Sz.cjs +1 -0
- package/dist/NicePipelineEditor.doc-CjqDKe2x.js +29 -0
- package/dist/NicePipelineEditor.doc-DZ0pTVTp.cjs +5 -0
- package/dist/NicePipelineMonitor.doc-C88-TagI.cjs +5 -0
- package/dist/NicePipelineMonitor.doc-CFtH4XJx.js +29 -0
- package/dist/NicePivotGrid-BD87Na7P.js +1163 -0
- package/dist/NicePivotGrid-BPmnvbPQ.cjs +152 -0
- package/dist/NicePivotGrid-BaZa2YZW.js +1157 -0
- package/dist/NicePivotGrid-DyOPhPO8.cjs +152 -0
- package/dist/NiceRoomGrid.doc-DJPVUQVg.cjs +8 -0
- package/dist/NiceRoomGrid.doc-DLHJS_Wb.js +32 -0
- package/dist/NiceSavedQueryPanel-BC84uRfh.cjs +586 -0
- package/dist/NiceSavedQueryPanel-BSTiZvFg.js +5130 -0
- package/dist/NiceSavedQueryPanel-CMfcODIO.js +5120 -0
- package/dist/NiceSavedQueryPanel-DrR3sw4T.cjs +586 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceSceneBar.doc-09sc3yuF.cjs +1 -0
- package/dist/NiceSceneBar.doc-DLePMuVU.js +25 -0
- package/dist/NiceSceneSelector.doc-CPzCAy-d.cjs +7 -0
- package/dist/NiceSceneSelector.doc-FCLZvPc0.js +31 -0
- package/dist/NiceScheduler-BAJRzFQN.js +1690 -0
- package/dist/NiceScheduler-DvxJ8N0I.js +1698 -0
- package/dist/NiceScheduler-TIksdF0k.cjs +5 -0
- package/dist/NiceScheduler-dJ7gHDv7.cjs +5 -0
- package/dist/NiceSchedulerViews.doc-C9opZpgg.cjs +1 -0
- package/dist/NiceSchedulerViews.doc-Dy7ZH1iL.js +25 -0
- package/dist/NiceSelect-CZR8Zu_k.js +420 -0
- package/dist/NiceSelect-DIKGbaJo.cjs +1 -0
- package/dist/NiceSensorGaugePanel.doc-BHirbWLn.cjs +8 -0
- package/dist/NiceSensorGaugePanel.doc-DjKmooI6.js +32 -0
- package/dist/NiceSpotlight.doc-BVZFfDVI.cjs +10 -0
- package/dist/NiceSpotlight.doc-JqwkzrEm.js +34 -0
- package/dist/NiceStateDesigner.doc-CfnwiwfU.js +29 -0
- package/dist/NiceStateDesigner.doc-DV4zEC50.cjs +5 -0
- package/dist/NiceStepper.doc-5VjaLM6r.js +31 -0
- package/dist/NiceStepper.doc-f8lYpr33.cjs +7 -0
- package/dist/NiceTaskInbox.doc-CHrxthqp.js +32 -0
- package/dist/NiceTaskInbox.doc-CdCTfgBq.cjs +8 -0
- package/dist/NiceTestBuilder.doc-BoBzLfa0.js +30 -0
- package/dist/NiceTestBuilder.doc-Cj1fNTvk.cjs +6 -0
- package/dist/NiceTranscoder.doc-Dnirl3wg.cjs +7 -0
- package/dist/NiceTranscoder.doc-cInCYZh7.js +31 -0
- package/dist/NiceVideoAnnotator.doc-C1iEi7OM.cjs +7 -0
- package/dist/NiceVideoAnnotator.doc-C8zyfKH_.js +31 -0
- package/dist/NiceVideoEditor.doc-C6mhEb-q.cjs +7 -0
- package/dist/NiceVideoEditor.doc-lrwmKjqj.js +31 -0
- package/dist/NiceWindow-CWN8OCHF.js +2109 -0
- package/dist/NiceWindow-Dd8qjkIW.cjs +1 -0
- package/dist/NiceWindow.css +1 -1
- package/dist/charts-Bo2WAI5T.cjs +768 -0
- package/dist/charts-BpELGDXh.cjs +768 -0
- package/dist/charts-ByrdMeQP.js +4767 -0
- package/dist/charts-M6LuVI7F.js +4776 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.d.ts +28 -46
- package/dist/charts.mjs +1 -1
- package/dist/core-B8eBUE4m.js +438 -0
- package/dist/core-lBFqvT0V.cjs +1 -0
- package/dist/core-lazy-Bh2yg4Et.js +351 -0
- package/dist/core-lazy-CkWKjfc6.cjs +1 -0
- package/dist/core-lazy-Ctin_LwS.cjs +1 -0
- package/dist/core-lazy-iDiropM6.js +351 -0
- package/dist/data-branching-BgIAw01q.cjs +1 -0
- package/dist/data-branching-Dak1_ZKR.cjs +1 -0
- package/dist/data-branching-DiLAO4Qt.js +6386 -0
- package/dist/data-branching-bvB9K6KS.js +6386 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +22 -18
- package/dist/data.mjs +3 -3
- package/dist/devops-Bp-_aA-9.js +8682 -0
- package/dist/devops-CXBSjnyX.cjs +17 -0
- package/dist/devops-DkVluHBp.cjs +17 -0
- package/dist/devops-zsMUueTd.js +8648 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.d.ts +3 -3
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +100 -38
- package/dist/editors.mjs +8 -8
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +71 -2
- package/dist/feedback.mjs +10 -9
- package/dist/index.cjs +263 -263
- package/dist/index.css +1 -1
- package/dist/index.d.ts +641 -253
- package/dist/index.mjs +26438 -26260
- package/dist/injectStyleOnce-BzC_BCs_.js +9 -0
- package/dist/injectStyleOnce-DeWaxcdf.cjs +1 -0
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +9 -7
- package/dist/lazy.mjs +51 -51
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.css +1 -0
- package/dist/navigation.d.ts +99 -43
- package/dist/navigation.mjs +504 -547
- package/dist/no-code-BNFk_BDO.js +8275 -0
- package/dist/no-code-CFdTp543.cjs +331 -0
- package/dist/no-code-DiTEnuRv.js +8288 -0
- package/dist/no-code-wG9c0z_T.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.css +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +12 -6
- package/dist/overlays.mjs +1 -1
- package/dist/pickerCommons-BCRiHDE_.cjs +1 -0
- package/dist/pickerCommons-CMxFt9SW.js +548 -0
- package/dist/pickerCommons-Dc_hlz-e.cjs +1 -0
- package/dist/pickerCommons-DkumQ3KE.js +548 -0
- package/dist/style.css +12 -9
- package/package.json +3 -3
package/dist/charts.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./charts-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./charts-BpELGDXh.cjs");exports.CHART_COLORS=e.CHART_COLORS;exports.NiceBarGauge=e.NiceBarGauge;exports.NiceBullet=e.NiceBullet;exports.NiceChart=e.NiceChart;exports.NiceChartAI=e.NiceChartAI;exports.NiceCircularGauge=e.NiceCircularGauge;exports.NiceForecastChart=e.NiceForecastChart;exports.NiceFunnel=e.NiceFunnel;exports.NiceHeatMap=e.NiceHeatMap;exports.NiceLinearGauge=e.NiceLinearGauge;exports.NiceLiveChart=e.NiceLiveChart;exports.NiceOrganizationChart=e.NiceOrganizationChart;exports.NicePieChart=e.NicePieChart;exports.NicePolarChart=e.NicePolarChart;exports.NiceRangeSelector=e.NiceRangeSelector;exports.NiceSankey=e.NiceSankey;exports.NiceSparkline=e.NiceSparkline;exports.NiceStockChart=e.NiceStockChart;exports.NiceTreeMap=e.NiceTreeMap;exports.NiceVectorMap=e.NiceVectorMap;
|
package/dist/charts.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.nice-chart-ai{--ai-primary: var(--nice-color-info, #3b82f6);--ai-primary-light: var(--nice-accent, #818cf8);--ai-bg: var(--nice-bg-secondary, #f8fafc);--ai-border: var(--nice-border-color, #e5e7eb);--ai-text: var(--nice-text-primary, #0f172a);--ai-text-muted: var(--nice-text-secondary, #475569);--ai-success: var(--nice-color-success, #10b981);--ai-panel-bg: var(--nice-bg-primary, #ffffff);position:relative;display:flex;flex-direction:column;border-radius:var(--nice-radius-lg, 8px);overflow:hidden;border:1px solid var(--ai-border);background:var(--ai-panel-bg)}[data-theme=dark] .nice-chart-ai,.nice-chart-ai.dark{--ai-primary: var(--nice-accent, #818cf8);--ai-primary-light: var(--nice-accent, #a5b4fc);--ai-bg: var(--nice-bg-primary, #0f172a);--ai-border: var(--nice-border-color, #0f172a);--ai-text: var(--nice-text-secondary, #e5e7eb);--ai-text-muted: var(--nice-text-muted, #94a3b8);--ai-success: var(--nice-color-success, #10b981);--ai-panel-bg: var(--nice-bg-primary, #0f172a)}.nice-chart-ai__toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--nice-space-4, 16px);padding:var(--nice-space-2-5, 10px) var(--nice-space-4, 16px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border);flex-wrap:wrap}.nice-chart-ai__toolbar-left{display:flex;align-items:center;gap:var(--nice-space-3, 12px);flex-wrap:wrap}.nice-chart-ai__badge{display:inline-flex;align-items:center;justify-content:center;padding:var(--nice-space-0-75, 3px) var(--nice-space-2-5, 10px);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:#fff;background:linear-gradient(135deg,var(--ai-primary) 0%,var(--ai-primary-light) 100%);border-radius:var(--nice-radius-sm, 4px)}.nice-chart-ai__suggestion{display:flex;align-items:center;gap:var(--nice-space-1-5, 6px);font-size:13px}.nice-chart-ai__suggestion-icon{font-size:14px}.nice-chart-ai__suggestion-text{color:var(--ai-text);font-weight:500}.nice-chart-ai__suggestion-reason{color:var(--ai-text-muted);font-size:12px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nice-chart-ai__loading{font-size:12px;color:var(--ai-primary);animation:pulse-opacity 1.5s ease-in-out infinite}@keyframes pulse-opacity{0%,to{opacity:.5}50%{opacity:1}}.nice-chart-ai__toolbar-center{display:flex;align-items:center}.nice-chart-ai__type-selector{display:flex;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1, 4px);background:var(--ai-panel-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px)}.nice-chart-ai__type-btn{display:flex;align-items:center;justify-content:center;width:32px;height:28px;padding:0;font-size:14px;background:transparent;border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-chart-ai__type-btn:hover{background:var(--ai-bg)}.nice-chart-ai__type-btn--active{background:var(--ai-primary);box-shadow:0 2px 4px var(--nice-accent-tint-30, rgba(99, 102, 241, .3))}.nice-chart-ai__toolbar-right{display:flex;align-items:center;gap:var(--nice-space-2, 8px)}.nice-chart-ai__auto-btn,.nice-chart-ai__insights-btn{display:inline-flex;align-items:center;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);font-size:12px;font-weight:500;color:var(--ai-text);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-chart-ai__auto-btn:hover:not(:disabled),.nice-chart-ai__insights-btn:hover:not(:disabled){background:var(--ai-primary);color:#fff;border-color:var(--ai-primary)}.nice-chart-ai__auto-btn:disabled,.nice-chart-ai__insights-btn:disabled{opacity:.5;cursor:not-allowed}.nice-chart-ai__chart-wrapper{flex:1;min-height:300px;padding:var(--nice-space-4, 16px)}.nice-chart-ai__insights{position:absolute;top:60px;right:16px;width:320px;max-height:calc(100% - 80px);background:var(--ai-panel-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-lg, 8px);box-shadow:0 10px 25px var(--nice-overlay-15, color-mix(in srgb, var(--nice-text-primary, #000) 15%, transparent));display:flex;flex-direction:column;z-index:10;animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.nice-chart-ai__insights--loading{justify-content:center;align-items:center;min-height:150px}.nice-chart-ai__loading-content{display:flex;flex-direction:column;align-items:center;gap:var(--nice-space-3, 12px);color:var(--ai-primary);font-size:14px}.nice-chart-ai__spinner{width:24px;height:24px;border:3px solid var(--ai-border);border-top-color:var(--ai-primary);border-radius:var(--nice-radius-full, 50%);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.nice-chart-ai__insights-header{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-3, 12px) var(--nice-space-3-5, 14px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border);border-radius:var(--nice-radius-lg, 8px) var(--nice-radius-lg, 8px) 0 0}.nice-chart-ai__insights-header h4{margin:0;font-size:14px;font-weight:600;color:var(--ai-text)}.nice-chart-ai__insights-close{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;font-size:14px;color:var(--ai-text-muted);background:transparent;border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-chart-ai__insights-close:hover{color:var(--ai-text);background:var(--ai-border)}.nice-chart-ai__insights-list{flex:1;margin:0;padding:var(--nice-space-3, 12px) var(--nice-space-3-5, 14px);list-style:none;overflow-y:auto}.nice-chart-ai__insight{display:flex;align-items:flex-start;gap:var(--nice-space-2, 8px);padding:var(--nice-space-2, 8px) 0;font-size:13px;line-height:1.5;color:var(--ai-text);border-bottom:1px solid var(--ai-border)}.nice-chart-ai__insight:last-child{border-bottom:none}.nice-chart-ai__insight-icon{color:var(--ai-primary);font-weight:700}.nice-chart-ai__insights-footer{padding:var(--nice-space-2-5, 10px) var(--nice-space-3-5, 14px);border-top:1px solid var(--ai-border)}.nice-chart-ai__refresh{width:100%;padding:var(--nice-space-2, 8px);font-size:12px;font-weight:500;color:var(--ai-primary);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-chart-ai__refresh:hover:not(:disabled){background:var(--ai-bg);border-color:var(--ai-primary)}.nice-chart-ai__refresh:disabled{opacity:.5;cursor:not-allowed}@media(max-width:768px){.nice-chart-ai__toolbar{flex-direction:column;align-items:stretch;gap:var(--nice-space-2-5, 10px)}.nice-chart-ai__toolbar-left,.nice-chart-ai__toolbar-right{justify-content:center}.nice-chart-ai__toolbar-center{order:-1;justify-content:center}.nice-chart-ai__insights{position:static;width:100%;max-height:none;margin-top:0;border-radius:0;border-left:none;border-right:none;box-shadow:none}.nice-chart-ai__suggestion-reason{display:none}}@media(max-width:480px){.nice-chart-ai__type-selector{width:100%;justify-content:center}.nice-chart-ai__auto-btn,.nice-chart-ai__insights-btn{flex:1;justify-content:center}}
|
|
1
|
+
.nice-chart-ai{--ai-primary: var(--nice-color-info, #3b82f6);--ai-primary-light: var(--nice-accent, #818cf8);--ai-bg: var(--nice-bg-secondary, #f8fafc);--ai-border: var(--nice-border-color, #e5e7eb);--ai-text: var(--nice-text-primary, #0f172a);--ai-text-muted: var(--nice-text-secondary, #475569);--ai-success: var(--nice-color-success, #10b981);--ai-panel-bg: var(--nice-bg-primary, #ffffff);position:relative;display:flex;flex-direction:column;border-radius:var(--nice-radius-lg, 8px);overflow:hidden;border:1px solid var(--ai-border);background:var(--ai-panel-bg)}[data-theme=dark] .nice-chart-ai,.nice-chart-ai.nice-dark{--ai-primary: var(--nice-accent, #818cf8);--ai-primary-light: var(--nice-accent, #a5b4fc);--ai-bg: var(--nice-bg-primary, #0f172a);--ai-border: var(--nice-border-color, #0f172a);--ai-text: var(--nice-text-secondary, #e5e7eb);--ai-text-muted: var(--nice-text-muted, #94a3b8);--ai-success: var(--nice-color-success, #10b981);--ai-panel-bg: var(--nice-bg-primary, #0f172a)}.nice-chart-ai__toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--nice-space-4, 16px);padding:var(--nice-space-2-5, 10px) var(--nice-space-4, 16px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border);flex-wrap:wrap}.nice-chart-ai__toolbar-left{display:flex;align-items:center;gap:var(--nice-space-3, 12px);flex-wrap:wrap}.nice-chart-ai__badge{display:inline-flex;align-items:center;justify-content:center;padding:var(--nice-space-0-75, 3px) var(--nice-space-2-5, 10px);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:#fff;background:linear-gradient(135deg,var(--ai-primary) 0%,var(--ai-primary-light) 100%);border-radius:var(--nice-radius-sm, 4px)}.nice-chart-ai__suggestion{display:flex;align-items:center;gap:var(--nice-space-1-5, 6px);font-size:13px}.nice-chart-ai__suggestion-icon{font-size:14px}.nice-chart-ai__suggestion-text{color:var(--ai-text);font-weight:500}.nice-chart-ai__suggestion-reason{color:var(--ai-text-muted);font-size:12px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nice-chart-ai__loading{font-size:12px;color:var(--ai-primary);animation:pulse-opacity 1.5s ease-in-out infinite}@keyframes pulse-opacity{0%,to{opacity:.5}50%{opacity:1}}.nice-chart-ai__toolbar-center{display:flex;align-items:center}.nice-chart-ai__type-selector{display:flex;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1, 4px);background:var(--ai-panel-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-md, 6px)}.nice-chart-ai__type-btn{display:flex;align-items:center;justify-content:center;width:32px;height:28px;padding:0;font-size:14px;background:transparent;border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-chart-ai__type-btn:hover{background:var(--ai-bg)}.nice-chart-ai__type-btn--active{background:var(--ai-primary);box-shadow:0 2px 4px var(--nice-accent-tint-30, rgba(99, 102, 241, .3))}.nice-chart-ai__toolbar-right{display:flex;align-items:center;gap:var(--nice-space-2, 8px)}.nice-chart-ai__auto-btn,.nice-chart-ai__insights-btn{display:inline-flex;align-items:center;gap:var(--nice-space-1, 4px);padding:var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);font-size:12px;font-weight:500;color:var(--ai-text);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-chart-ai__auto-btn:hover:not(:disabled),.nice-chart-ai__insights-btn:hover:not(:disabled){background:var(--ai-primary);color:#fff;border-color:var(--ai-primary)}.nice-chart-ai__auto-btn:disabled,.nice-chart-ai__insights-btn:disabled{opacity:.5;cursor:not-allowed}.nice-chart-ai__chart-wrapper{flex:1;min-height:300px;padding:var(--nice-space-4, 16px)}.nice-chart-ai__insights{position:absolute;top:60px;right:16px;width:320px;max-height:calc(100% - 80px);background:var(--ai-panel-bg);border:1px solid var(--ai-border);border-radius:var(--nice-radius-lg, 8px);box-shadow:0 10px 25px var(--nice-overlay-15, color-mix(in srgb, var(--nice-text-primary, #000) 15%, transparent));display:flex;flex-direction:column;z-index:10;animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.nice-chart-ai__insights--loading{justify-content:center;align-items:center;min-height:150px}.nice-chart-ai__loading-content{display:flex;flex-direction:column;align-items:center;gap:var(--nice-space-3, 12px);color:var(--ai-primary);font-size:14px}.nice-chart-ai__spinner{width:24px;height:24px;border:3px solid var(--ai-border);border-top-color:var(--ai-primary);border-radius:var(--nice-radius-full, 50%);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.nice-chart-ai__insights-header{display:flex;align-items:center;justify-content:space-between;padding:var(--nice-space-3, 12px) var(--nice-space-3-5, 14px);background:var(--ai-bg);border-bottom:1px solid var(--ai-border);border-radius:var(--nice-radius-lg, 8px) var(--nice-radius-lg, 8px) 0 0}.nice-chart-ai__insights-header h4{margin:0;font-size:14px;font-weight:600;color:var(--ai-text)}.nice-chart-ai__insights-close{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;font-size:14px;color:var(--ai-text-muted);background:transparent;border:none;border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-chart-ai__insights-close:hover{color:var(--ai-text);background:var(--ai-border)}.nice-chart-ai__insights-list{flex:1;margin:0;padding:var(--nice-space-3, 12px) var(--nice-space-3-5, 14px);list-style:none;overflow-y:auto}.nice-chart-ai__insight{display:flex;align-items:flex-start;gap:var(--nice-space-2, 8px);padding:var(--nice-space-2, 8px) 0;font-size:13px;line-height:1.5;color:var(--ai-text);border-bottom:1px solid var(--ai-border)}.nice-chart-ai__insight:last-child{border-bottom:none}.nice-chart-ai__insight-icon{color:var(--ai-primary);font-weight:700}.nice-chart-ai__insights-footer{padding:var(--nice-space-2-5, 10px) var(--nice-space-3-5, 14px);border-top:1px solid var(--ai-border)}.nice-chart-ai__refresh{width:100%;padding:var(--nice-space-2, 8px);font-size:12px;font-weight:500;color:var(--ai-primary);background:transparent;border:1px solid var(--ai-border);border-radius:var(--nice-radius-sm, 4px);cursor:pointer;transition:all .15s ease}.nice-chart-ai__refresh:hover:not(:disabled){background:var(--ai-bg);border-color:var(--ai-primary)}.nice-chart-ai__refresh:disabled{opacity:.5;cursor:not-allowed}@media(max-width:768px){.nice-chart-ai__toolbar{flex-direction:column;align-items:stretch;gap:var(--nice-space-2-5, 10px)}.nice-chart-ai__toolbar-left,.nice-chart-ai__toolbar-right{justify-content:center}.nice-chart-ai__toolbar-center{order:-1;justify-content:center}.nice-chart-ai__insights{position:static;width:100%;max-height:none;margin-top:0;border-radius:0;border-left:none;border-right:none;box-shadow:none}.nice-chart-ai__suggestion-reason{display:none}}@media(max-width:480px){.nice-chart-ai__type-selector{width:100%;justify-content:center}.nice-chart-ai__auto-btn,.nice-chart-ai__insights-btn{flex:1;justify-content:center}}
|
package/dist/charts.d.ts
CHANGED
|
@@ -213,7 +213,7 @@ declare interface NiceBarGaugeItem {
|
|
|
213
213
|
/** Props for the {@link NiceBarGauge} component — a circular segmented bar gauge. */
|
|
214
214
|
export declare interface NiceBarGaugeProps extends NiceStandardProps {
|
|
215
215
|
/** Gauge items. */
|
|
216
|
-
items
|
|
216
|
+
items?: NiceBarGaugeItem[];
|
|
217
217
|
/** Minimum scale value. */
|
|
218
218
|
min?: number;
|
|
219
219
|
/** Maximum scale value. */
|
|
@@ -330,7 +330,7 @@ declare interface NiceChartAnnotation {
|
|
|
330
330
|
* with stacking, zoom, crosshair, annotations, legend interaction and PNG export.
|
|
331
331
|
*/
|
|
332
332
|
export declare interface NiceChartProps extends NiceStandardProps {
|
|
333
|
-
series
|
|
333
|
+
series?: NiceChartSeries[];
|
|
334
334
|
categories?: string[];
|
|
335
335
|
width?: number;
|
|
336
336
|
height?: number;
|
|
@@ -402,34 +402,6 @@ export declare interface NiceCircularGaugeProps extends NiceStandardProps {
|
|
|
402
402
|
}[];
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
/**
|
|
406
|
-
* NiceForecastChart — Time series chart with forecast and confidence intervals.
|
|
407
|
-
*
|
|
408
|
-
* @example
|
|
409
|
-
* ```tsx
|
|
410
|
-
* <NiceForecastChart
|
|
411
|
-
* scenarios={[
|
|
412
|
-
* {
|
|
413
|
-
* id: 'base',
|
|
414
|
-
* name: 'Base Forecast',
|
|
415
|
-
* isBase: true,
|
|
416
|
-
* data: historicalAndForecastData,
|
|
417
|
-
* showConfidenceBand: true,
|
|
418
|
-
* confidenceLevel: 95,
|
|
419
|
-
* },
|
|
420
|
-
* {
|
|
421
|
-
* id: 'optimistic',
|
|
422
|
-
* name: 'Optimistic',
|
|
423
|
-
* data: optimisticData,
|
|
424
|
-
* },
|
|
425
|
-
* ]}
|
|
426
|
-
* forecastStartDate={new Date('2026-01-01')}
|
|
427
|
-
* annotations={[
|
|
428
|
-
* { id: '1', date: '2025-06-15', type: 'event', label: 'Product Launch' }
|
|
429
|
-
* ]}
|
|
430
|
-
* />
|
|
431
|
-
* ```
|
|
432
|
-
*/
|
|
433
405
|
export declare const NiceForecastChart: default_2.ForwardRefExoticComponent<NiceForecastChartProps & default_2.RefAttributes<ForecastChartRef>>;
|
|
434
406
|
|
|
435
407
|
/**
|
|
@@ -519,7 +491,7 @@ declare interface NiceFunnelItem {
|
|
|
519
491
|
/** Props for the {@link NiceFunnel} component — an SVG funnel / pyramid chart. */
|
|
520
492
|
export declare interface NiceFunnelProps extends NiceStandardProps {
|
|
521
493
|
/** Funnel stage data. */
|
|
522
|
-
data
|
|
494
|
+
data?: NiceFunnelItem[];
|
|
523
495
|
/** SVG width in px. */
|
|
524
496
|
width?: number;
|
|
525
497
|
/** SVG height in px. */
|
|
@@ -534,12 +506,14 @@ export declare interface NiceFunnelProps extends NiceStandardProps {
|
|
|
534
506
|
title?: string;
|
|
535
507
|
}
|
|
536
508
|
|
|
537
|
-
export declare const NiceHeatMap: default_2.ForwardRefExoticComponent<NiceHeatMapProps & default_2.RefAttributes<HTMLDivElement
|
|
509
|
+
export declare const NiceHeatMap: default_2.ForwardRefExoticComponent<NiceHeatMapProps & default_2.RefAttributes<HTMLDivElement>> & {
|
|
510
|
+
displayName: string;
|
|
511
|
+
};
|
|
538
512
|
|
|
539
513
|
/** Props for the {@link NiceHeatMap} component — a 2D color-intensity grid with optional cell click. */
|
|
540
514
|
export declare interface NiceHeatMapProps extends NiceStandardProps {
|
|
541
515
|
/** 2D data matrix (rows × cols). */
|
|
542
|
-
data
|
|
516
|
+
data?: number[][];
|
|
543
517
|
/** Column header labels. */
|
|
544
518
|
xLabels?: string[];
|
|
545
519
|
/** Row header labels. */
|
|
@@ -588,12 +562,14 @@ export declare interface NiceLinearGaugeProps extends NiceStandardProps {
|
|
|
588
562
|
tickCount?: number;
|
|
589
563
|
}
|
|
590
564
|
|
|
591
|
-
export declare const NiceLiveChart: default_2.ForwardRefExoticComponent<NiceLiveChartProps & default_2.RefAttributes<NiceLiveChartRef
|
|
565
|
+
export declare const NiceLiveChart: default_2.ForwardRefExoticComponent<NiceLiveChartProps & default_2.RefAttributes<NiceLiveChartRef>> & {
|
|
566
|
+
displayName: string;
|
|
567
|
+
};
|
|
592
568
|
|
|
593
569
|
/** Props for NiceLiveChart component. */
|
|
594
570
|
export declare interface NiceLiveChartProps extends NiceStandardProps {
|
|
595
571
|
/** Series configuration. Each series receives its own data stream. */
|
|
596
|
-
series
|
|
572
|
+
series?: NiceLiveChartSeriesConfig[];
|
|
597
573
|
/** Maximum number of data points to keep per series. Default: 100. */
|
|
598
574
|
maxPoints?: number;
|
|
599
575
|
/** Enable sliding window (auto-remove old points). Default: true. */
|
|
@@ -710,7 +686,9 @@ declare interface NiceMapRegion {
|
|
|
710
686
|
value?: number;
|
|
711
687
|
}
|
|
712
688
|
|
|
713
|
-
export declare const NiceOrganizationChart: default_2.ForwardRefExoticComponent<NiceOrganizationChartProps & default_2.RefAttributes<HTMLDivElement
|
|
689
|
+
export declare const NiceOrganizationChart: default_2.ForwardRefExoticComponent<NiceOrganizationChartProps & default_2.RefAttributes<HTMLDivElement>> & {
|
|
690
|
+
displayName: string;
|
|
691
|
+
};
|
|
714
692
|
|
|
715
693
|
/** Props for the {@link NiceOrganizationChart} component — a hierarchical org chart with optional node selection and collapsible branches. */
|
|
716
694
|
export declare interface NiceOrganizationChartProps extends NiceStandardProps {
|
|
@@ -747,7 +725,7 @@ export declare const NicePieChart: default_2.FC<NicePieChartProps>;
|
|
|
747
725
|
/** Props for the {@link NicePieChart} component — an SVG pie / donut chart with legend and labels. */
|
|
748
726
|
export declare interface NicePieChartProps extends NiceStandardProps {
|
|
749
727
|
/** Slice data. */
|
|
750
|
-
data
|
|
728
|
+
data?: NicePieSlice[];
|
|
751
729
|
/** Chart width in px. */
|
|
752
730
|
width?: number;
|
|
753
731
|
/** Chart height in px. */
|
|
@@ -777,9 +755,9 @@ export declare const NicePolarChart: default_2.FC<NicePolarChartProps>;
|
|
|
777
755
|
/** Props for the {@link NicePolarChart} component — an SVG radar / spider chart. */
|
|
778
756
|
export declare interface NicePolarChartProps extends NiceStandardProps {
|
|
779
757
|
/** Series definitions. */
|
|
780
|
-
series
|
|
758
|
+
series?: NicePolarChartSeries[];
|
|
781
759
|
/** Axis category labels. */
|
|
782
|
-
categories
|
|
760
|
+
categories?: string[];
|
|
783
761
|
/** Chart width in px. */
|
|
784
762
|
width?: number;
|
|
785
763
|
/** Chart height in px. */
|
|
@@ -857,9 +835,9 @@ declare interface NiceSankeyNode {
|
|
|
857
835
|
/** Props for the {@link NiceSankey} component — an SVG Sankey flow diagram. */
|
|
858
836
|
export declare interface NiceSankeyProps extends NiceStandardProps {
|
|
859
837
|
/** Node definitions. */
|
|
860
|
-
nodes
|
|
838
|
+
nodes?: NiceSankeyNode[];
|
|
861
839
|
/** Link definitions. */
|
|
862
|
-
links
|
|
840
|
+
links?: NiceSankeyLink[];
|
|
863
841
|
/** SVG width in px. */
|
|
864
842
|
width?: number;
|
|
865
843
|
/** SVG height in px. */
|
|
@@ -877,7 +855,7 @@ export declare const NiceSparkline: default_2.FC<NiceSparklineProps>;
|
|
|
877
855
|
/** Props for the {@link NiceSparkline} component — a compact inline chart (line, bar, or area). */
|
|
878
856
|
export declare interface NiceSparklineProps extends NiceStandardProps {
|
|
879
857
|
/** Data values. */
|
|
880
|
-
data
|
|
858
|
+
data?: number[];
|
|
881
859
|
/** SVG width in px. */
|
|
882
860
|
width?: number;
|
|
883
861
|
/** SVG height in px. */
|
|
@@ -892,12 +870,14 @@ export declare interface NiceSparklineProps extends NiceStandardProps {
|
|
|
892
870
|
showLastPoint?: boolean;
|
|
893
871
|
}
|
|
894
872
|
|
|
895
|
-
export declare const NiceStockChart: default_2.ForwardRefExoticComponent<NiceStockChartProps & default_2.RefAttributes<HTMLDivElement
|
|
873
|
+
export declare const NiceStockChart: default_2.ForwardRefExoticComponent<NiceStockChartProps & default_2.RefAttributes<HTMLDivElement>> & {
|
|
874
|
+
displayName: string;
|
|
875
|
+
};
|
|
896
876
|
|
|
897
877
|
/** Props for the {@link NiceStockChart} component — an SVG candlestick / OHLC / line stock chart with optional volume bars. */
|
|
898
878
|
export declare interface NiceStockChartProps extends NiceStandardProps {
|
|
899
879
|
/** OHLC data points. */
|
|
900
|
-
data
|
|
880
|
+
data?: NiceStockDataPoint[];
|
|
901
881
|
/** Chart type. */
|
|
902
882
|
type?: NiceStockChartType;
|
|
903
883
|
/** Show volume bars below the price chart. */
|
|
@@ -931,7 +911,9 @@ declare interface NiceStockDataPoint {
|
|
|
931
911
|
volume?: number;
|
|
932
912
|
}
|
|
933
913
|
|
|
934
|
-
export declare const NiceTreeMap: default_2.ForwardRefExoticComponent<NiceTreeMapProps & default_2.RefAttributes<HTMLDivElement
|
|
914
|
+
export declare const NiceTreeMap: default_2.ForwardRefExoticComponent<NiceTreeMapProps & default_2.RefAttributes<HTMLDivElement>> & {
|
|
915
|
+
displayName: string;
|
|
916
|
+
};
|
|
935
917
|
|
|
936
918
|
/** A hierarchical node in the {@link NiceTreeMap}. */
|
|
937
919
|
declare interface NiceTreeMapNode {
|
|
@@ -966,7 +948,7 @@ export declare const NiceVectorMap: default_2.FC<NiceVectorMapProps>;
|
|
|
966
948
|
/** Props for the {@link NiceVectorMap} component — an SVG choropleth map with region selection and tooltips. */
|
|
967
949
|
export declare interface NiceVectorMapProps extends NiceStandardProps {
|
|
968
950
|
/** Region definitions. */
|
|
969
|
-
regions
|
|
951
|
+
regions?: NiceMapRegion[];
|
|
970
952
|
/** SVG width in px. */
|
|
971
953
|
width?: number;
|
|
972
954
|
/** SVG height in px. */
|
package/dist/charts.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as i, j as c, h as r, o as s, p as N, l as t, r as C, g as h, e as n, k as o, s as l, b as g, n as p, m as u, a as S, f as k, i as G, c as L, d as M, N as O } from "./charts-
|
|
1
|
+
import { C as i, j as c, h as r, o as s, p as N, l as t, r as C, g as h, e as n, k as o, s as l, b as g, n as p, m as u, a as S, f as k, i as G, c as L, d as M, N as O } from "./charts-M6LuVI7F.js";
|
|
2
2
|
export {
|
|
3
3
|
i as CHART_COLORS,
|
|
4
4
|
c as NiceBarGauge,
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import W, { useState as L, useRef as I, useEffect as C, useCallback as u, useMemo as m, useContext as G, createContext as X } from "react";
|
|
2
|
+
import { DEFAULT_TRACELESS_POLICY as R, createPermissiveInstanceCeiling as D, resolveTracelessPolicy as E, generateTracelessComplianceReport as J, auditStorageCompliance as N, TRACELESS_POLICY_HEADER as F, parsePolicyFromHeader as K, StorageAdapter as Y, getTracelessBadgeInfo as z } from "@nice2dev/ui-core";
|
|
3
|
+
const x = /* @__PURE__ */ X(null);
|
|
4
|
+
function te({
|
|
5
|
+
children: s,
|
|
6
|
+
initialPolicy: r,
|
|
7
|
+
policyEndpoint: e,
|
|
8
|
+
instanceCeiling: t,
|
|
9
|
+
tenantPolicy: o,
|
|
10
|
+
groupPolicy: a,
|
|
11
|
+
userPreference: f,
|
|
12
|
+
instanceId: c = "default",
|
|
13
|
+
tenantId: l,
|
|
14
|
+
onPolicyChange: d
|
|
15
|
+
}) {
|
|
16
|
+
const [n, A] = L(r || R), [S, p] = L(
|
|
17
|
+
f
|
|
18
|
+
), [w, y] = L(!!e), [U, v] = L(null), h = I(/* @__PURE__ */ new Map());
|
|
19
|
+
C(() => {
|
|
20
|
+
const g = t || D(c), i = E(g, o, a, S);
|
|
21
|
+
A(i), d?.(i), h.current.forEach((P) => {
|
|
22
|
+
P.updatePolicy(i);
|
|
23
|
+
});
|
|
24
|
+
}, [t, o, a, S, c, d]), C(() => {
|
|
25
|
+
if (!e)
|
|
26
|
+
return;
|
|
27
|
+
(async () => {
|
|
28
|
+
y(!0), v(null);
|
|
29
|
+
try {
|
|
30
|
+
const i = await fetch(e, {
|
|
31
|
+
credentials: "include"
|
|
32
|
+
});
|
|
33
|
+
if (!i.ok)
|
|
34
|
+
throw new Error(`Failed to fetch policy: ${i.status}`);
|
|
35
|
+
const P = i.headers.get(F);
|
|
36
|
+
if (P) {
|
|
37
|
+
const M = K(P);
|
|
38
|
+
if (M) {
|
|
39
|
+
const b = t || D(c), $ = E(
|
|
40
|
+
b,
|
|
41
|
+
o ? { ...o, mode: M } : {
|
|
42
|
+
tenantId: "default",
|
|
43
|
+
mode: M,
|
|
44
|
+
allowGroupOverride: !0,
|
|
45
|
+
allowUserOverride: !0,
|
|
46
|
+
updatedAt: Date.now()
|
|
47
|
+
},
|
|
48
|
+
a,
|
|
49
|
+
S
|
|
50
|
+
);
|
|
51
|
+
A($), d?.($);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const M = await i.json();
|
|
56
|
+
M.policy && (A(M.policy), d?.(M.policy));
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
} catch (i) {
|
|
60
|
+
v(i instanceof Error ? i : new Error("Unknown error"));
|
|
61
|
+
} finally {
|
|
62
|
+
y(!1);
|
|
63
|
+
}
|
|
64
|
+
})();
|
|
65
|
+
}, [
|
|
66
|
+
e,
|
|
67
|
+
t,
|
|
68
|
+
o,
|
|
69
|
+
a,
|
|
70
|
+
S,
|
|
71
|
+
c,
|
|
72
|
+
d
|
|
73
|
+
]);
|
|
74
|
+
const k = u((g) => {
|
|
75
|
+
p((i) => ({
|
|
76
|
+
userId: i?.userId || "anonymous",
|
|
77
|
+
preferredMode: g.preferredMode || i?.preferredMode || "traceless",
|
|
78
|
+
restrictCookies: g.restrictCookies ?? i?.restrictCookies,
|
|
79
|
+
restrictLocalStorage: g.restrictLocalStorage ?? i?.restrictLocalStorage,
|
|
80
|
+
restrictSessionStorage: g.restrictSessionStorage ?? i?.restrictSessionStorage,
|
|
81
|
+
setAt: Date.now()
|
|
82
|
+
}));
|
|
83
|
+
}, []), O = u(() => J(n, c, l), [n, c, l]), q = u(() => N(n), [n]), H = u(async () => {
|
|
84
|
+
if (e) {
|
|
85
|
+
y(!0);
|
|
86
|
+
try {
|
|
87
|
+
const g = await fetch(e, {
|
|
88
|
+
credentials: "include",
|
|
89
|
+
cache: "no-cache"
|
|
90
|
+
});
|
|
91
|
+
if (g.ok) {
|
|
92
|
+
const i = g.headers.get(F);
|
|
93
|
+
if (i) {
|
|
94
|
+
const P = K(i);
|
|
95
|
+
if (P) {
|
|
96
|
+
const M = t || D(c), b = E(
|
|
97
|
+
M,
|
|
98
|
+
o ? { ...o, mode: P } : void 0,
|
|
99
|
+
a,
|
|
100
|
+
S
|
|
101
|
+
);
|
|
102
|
+
A(b), d?.(b);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
} finally {
|
|
107
|
+
y(!1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
e,
|
|
112
|
+
t,
|
|
113
|
+
o,
|
|
114
|
+
a,
|
|
115
|
+
S,
|
|
116
|
+
c,
|
|
117
|
+
d
|
|
118
|
+
]), V = u(
|
|
119
|
+
(g = "nice2dev") => {
|
|
120
|
+
let i = h.current.get(g);
|
|
121
|
+
return i || (i = new Y(n, g), h.current.set(g, i)), i;
|
|
122
|
+
},
|
|
123
|
+
[n]
|
|
124
|
+
), _ = m(() => z(n), [n]), Q = m(
|
|
125
|
+
() => ({
|
|
126
|
+
policy: n,
|
|
127
|
+
canUseCookies: n.cookiesAllowed,
|
|
128
|
+
canUseLocalStorage: n.localStorageAllowed,
|
|
129
|
+
canUseSessionStorage: n.sessionStorageAllowed,
|
|
130
|
+
canPersist: n.localStorageAllowed,
|
|
131
|
+
mode: n.effectiveMode,
|
|
132
|
+
requiresConsentBanner: n.requiresConsentBanner,
|
|
133
|
+
badgeInfo: _,
|
|
134
|
+
setUserPreference: k,
|
|
135
|
+
generateReport: O,
|
|
136
|
+
runAudit: q,
|
|
137
|
+
refreshPolicy: H,
|
|
138
|
+
getStorageAdapter: V,
|
|
139
|
+
isLoading: w,
|
|
140
|
+
error: U
|
|
141
|
+
}),
|
|
142
|
+
[
|
|
143
|
+
n,
|
|
144
|
+
_,
|
|
145
|
+
k,
|
|
146
|
+
O,
|
|
147
|
+
q,
|
|
148
|
+
H,
|
|
149
|
+
V,
|
|
150
|
+
w,
|
|
151
|
+
U
|
|
152
|
+
]
|
|
153
|
+
);
|
|
154
|
+
return W.createElement(x.Provider, { value: Q }, s);
|
|
155
|
+
}
|
|
156
|
+
function se() {
|
|
157
|
+
const s = G(x);
|
|
158
|
+
if (!s)
|
|
159
|
+
throw new Error("useTracelessPolicy must be used within a TracelessProvider");
|
|
160
|
+
return s;
|
|
161
|
+
}
|
|
162
|
+
function T() {
|
|
163
|
+
const s = G(x);
|
|
164
|
+
if (s)
|
|
165
|
+
return s;
|
|
166
|
+
const r = new Y(R);
|
|
167
|
+
return {
|
|
168
|
+
policy: R,
|
|
169
|
+
canUseCookies: !1,
|
|
170
|
+
canUseLocalStorage: !1,
|
|
171
|
+
canUseSessionStorage: !1,
|
|
172
|
+
canPersist: !1,
|
|
173
|
+
mode: "traceless",
|
|
174
|
+
requiresConsentBanner: !1,
|
|
175
|
+
badgeInfo: z(R),
|
|
176
|
+
setUserPreference: () => {
|
|
177
|
+
},
|
|
178
|
+
generateReport: () => J(R, "default"),
|
|
179
|
+
runAudit: () => N(R),
|
|
180
|
+
refreshPolicy: async () => {
|
|
181
|
+
},
|
|
182
|
+
getStorageAdapter: () => r,
|
|
183
|
+
isLoading: !1,
|
|
184
|
+
error: null
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function B(s = "nice2dev") {
|
|
188
|
+
const { getStorageAdapter: r } = T();
|
|
189
|
+
return m(() => r(s), [r, s]);
|
|
190
|
+
}
|
|
191
|
+
function j(s, r, e) {
|
|
192
|
+
const t = B(e?.namespace), { canPersist: o, canUseSessionStorage: a } = T(), f = e?.storageMode === "session" ? a : o, [c, l] = L(() => {
|
|
193
|
+
if (f) {
|
|
194
|
+
const n = t.get(s, e?.storageMode);
|
|
195
|
+
if (n !== null)
|
|
196
|
+
return n;
|
|
197
|
+
}
|
|
198
|
+
return r;
|
|
199
|
+
}), d = u(
|
|
200
|
+
(n) => {
|
|
201
|
+
l((A) => {
|
|
202
|
+
const S = typeof n == "function" ? n(A) : n;
|
|
203
|
+
return f && t.set(s, S, e?.storageMode === "session" ? "session" : "local"), S;
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
[t, s, f, e?.storageMode]
|
|
207
|
+
);
|
|
208
|
+
return [c, d, f];
|
|
209
|
+
}
|
|
210
|
+
function re() {
|
|
211
|
+
const { requiresConsentBanner: s, mode: r } = T(), e = B("nice2dev-consent"), [t, o] = L(() => e.get("banner-dismissed") === !0), a = u(() => {
|
|
212
|
+
o(!0), e.set("banner-dismissed", !0);
|
|
213
|
+
}, [e]);
|
|
214
|
+
return {
|
|
215
|
+
shouldShow: s && !t,
|
|
216
|
+
mode: r,
|
|
217
|
+
dismiss: a
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function oe(s = !1) {
|
|
221
|
+
const { runAudit: r } = T(), [e, t] = L(null), o = u(() => {
|
|
222
|
+
const a = r();
|
|
223
|
+
return t(a), a;
|
|
224
|
+
}, [r]);
|
|
225
|
+
return C(() => {
|
|
226
|
+
s && o();
|
|
227
|
+
}, [s, o]), {
|
|
228
|
+
result: e,
|
|
229
|
+
run: o,
|
|
230
|
+
isCompliant: e?.compliant ?? null
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function ne() {
|
|
234
|
+
const { policy: s, getStorageAdapter: r } = T(), e = m(() => r("local"), [r]), t = u(
|
|
235
|
+
(c) => e.get(c),
|
|
236
|
+
[e]
|
|
237
|
+
), o = u(
|
|
238
|
+
(c, l) => {
|
|
239
|
+
e.set(c, l);
|
|
240
|
+
},
|
|
241
|
+
[e]
|
|
242
|
+
), a = u(
|
|
243
|
+
(c) => {
|
|
244
|
+
e.remove(c);
|
|
245
|
+
},
|
|
246
|
+
[e]
|
|
247
|
+
), f = u(() => {
|
|
248
|
+
e.clear();
|
|
249
|
+
}, [e]);
|
|
250
|
+
return m(
|
|
251
|
+
() => ({
|
|
252
|
+
getItem: t,
|
|
253
|
+
setItem: o,
|
|
254
|
+
removeItem: a,
|
|
255
|
+
clear: f,
|
|
256
|
+
isAvailable: s.localStorageAllowed,
|
|
257
|
+
effectiveMode: s.effectiveMode,
|
|
258
|
+
policy: s
|
|
259
|
+
}),
|
|
260
|
+
[t, o, a, f, s]
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
function ce() {
|
|
264
|
+
const { policy: s, getStorageAdapter: r } = T(), e = m(() => r("session"), [r]), t = u(
|
|
265
|
+
(c) => e.get(c),
|
|
266
|
+
[e]
|
|
267
|
+
), o = u(
|
|
268
|
+
(c, l) => {
|
|
269
|
+
e.set(c, l);
|
|
270
|
+
},
|
|
271
|
+
[e]
|
|
272
|
+
), a = u(
|
|
273
|
+
(c) => {
|
|
274
|
+
e.remove(c);
|
|
275
|
+
},
|
|
276
|
+
[e]
|
|
277
|
+
), f = u(() => {
|
|
278
|
+
e.clear();
|
|
279
|
+
}, [e]);
|
|
280
|
+
return m(
|
|
281
|
+
() => ({
|
|
282
|
+
getItem: t,
|
|
283
|
+
setItem: o,
|
|
284
|
+
removeItem: a,
|
|
285
|
+
clear: f,
|
|
286
|
+
isAvailable: s.sessionStorageAllowed,
|
|
287
|
+
effectiveMode: s.effectiveMode
|
|
288
|
+
}),
|
|
289
|
+
[t, o, a, f, s]
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
function ae({
|
|
293
|
+
storageKey: s,
|
|
294
|
+
initialState: r = {},
|
|
295
|
+
onStateChange: e,
|
|
296
|
+
storageType: t = "auto"
|
|
297
|
+
}) {
|
|
298
|
+
const { policy: o, getStorageAdapter: a } = T(), f = `nice-datagrid-${s}`, c = m(() => {
|
|
299
|
+
if (t === "local" && o.localStorageAllowed)
|
|
300
|
+
return "local";
|
|
301
|
+
if (t === "session" && o.sessionStorageAllowed)
|
|
302
|
+
return "session";
|
|
303
|
+
if (t === "auto") {
|
|
304
|
+
if (o.localStorageAllowed)
|
|
305
|
+
return "local";
|
|
306
|
+
if (o.sessionStorageAllowed)
|
|
307
|
+
return "session";
|
|
308
|
+
}
|
|
309
|
+
return "memory";
|
|
310
|
+
}, [t, o]), l = m(() => a(c === "session" ? "session-grid" : "local-grid"), [a, c]), [d, n] = L(() => {
|
|
311
|
+
const w = l.get(f);
|
|
312
|
+
if (w)
|
|
313
|
+
try {
|
|
314
|
+
return { ...r, ...JSON.parse(w) };
|
|
315
|
+
} catch {
|
|
316
|
+
return r;
|
|
317
|
+
}
|
|
318
|
+
return r;
|
|
319
|
+
});
|
|
320
|
+
C(() => {
|
|
321
|
+
l.set(f, JSON.stringify(d)), e?.(d);
|
|
322
|
+
}, [d, l, f, e]);
|
|
323
|
+
const A = u((w) => {
|
|
324
|
+
n((y) => ({ ...y, ...w }));
|
|
325
|
+
}, []), S = u(() => {
|
|
326
|
+
l.remove(f), n(r);
|
|
327
|
+
}, [l, f, r]);
|
|
328
|
+
return {
|
|
329
|
+
state: d,
|
|
330
|
+
updateState: A,
|
|
331
|
+
setState: n,
|
|
332
|
+
clearState: S,
|
|
333
|
+
degraded: c === "memory",
|
|
334
|
+
effectiveStorageType: c,
|
|
335
|
+
policy: o
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
function le({
|
|
339
|
+
storageKey: s,
|
|
340
|
+
autoSaveInterval: r = 5e3,
|
|
341
|
+
maxVersions: e = 10
|
|
342
|
+
}) {
|
|
343
|
+
const { policy: t, getStorageAdapter: o } = T(), a = `nice-editor-${s}`, f = `${a}-history`, c = m(() => o("editor"), [o]), [l, d] = j(a, null, {
|
|
344
|
+
storageMode: t.localStorageAllowed ? "local" : "session"
|
|
345
|
+
}), [n, A] = j(f, [], {
|
|
346
|
+
storageMode: "local"
|
|
347
|
+
}), S = u(
|
|
348
|
+
(v, h) => {
|
|
349
|
+
const k = {
|
|
350
|
+
content: v,
|
|
351
|
+
cursorPosition: h,
|
|
352
|
+
lastModified: Date.now(),
|
|
353
|
+
version: (l?.version ?? 0) + 1
|
|
354
|
+
};
|
|
355
|
+
d(k);
|
|
356
|
+
},
|
|
357
|
+
[l, d]
|
|
358
|
+
), p = u(() => {
|
|
359
|
+
!l || !t.localStorageAllowed || A((v) => [...v, l].slice(-e));
|
|
360
|
+
}, [l, t.localStorageAllowed, e, A]), w = u(
|
|
361
|
+
(v) => {
|
|
362
|
+
const h = n.find((k) => k.version === v);
|
|
363
|
+
h && d(h);
|
|
364
|
+
},
|
|
365
|
+
[n, d]
|
|
366
|
+
), y = u(() => {
|
|
367
|
+
c.remove(a), d(null);
|
|
368
|
+
}, [c, a, d]), U = I(null);
|
|
369
|
+
return C(() => {
|
|
370
|
+
if (!r || !l?.content || l.content === U.current)
|
|
371
|
+
return;
|
|
372
|
+
const v = setTimeout(() => {
|
|
373
|
+
U.current = l.content ?? null;
|
|
374
|
+
}, r);
|
|
375
|
+
return () => clearTimeout(v);
|
|
376
|
+
}, [l?.content, r]), {
|
|
377
|
+
draft: l,
|
|
378
|
+
saveDraft: S,
|
|
379
|
+
saveToHistory: p,
|
|
380
|
+
restoreVersion: w,
|
|
381
|
+
clearDraft: y,
|
|
382
|
+
history: n,
|
|
383
|
+
hasDraft: l !== null,
|
|
384
|
+
degraded: !t.localStorageAllowed && !t.sessionStorageAllowed,
|
|
385
|
+
policy: t
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
function ie(s = "local") {
|
|
389
|
+
const r = B(s), e = I([]);
|
|
390
|
+
return m(
|
|
391
|
+
() => ({
|
|
392
|
+
getItem: (t) => r.get(t),
|
|
393
|
+
setItem: (t, o) => {
|
|
394
|
+
r.set(t, o), e.current.includes(t) || e.current.push(t);
|
|
395
|
+
},
|
|
396
|
+
removeItem: (t) => {
|
|
397
|
+
r.remove(t), e.current = e.current.filter((o) => o !== t);
|
|
398
|
+
},
|
|
399
|
+
clear: () => {
|
|
400
|
+
r.clear(), e.current = [];
|
|
401
|
+
},
|
|
402
|
+
get length() {
|
|
403
|
+
return e.current.length;
|
|
404
|
+
},
|
|
405
|
+
key: (t) => e.current[t] ?? null
|
|
406
|
+
}),
|
|
407
|
+
[r]
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
function ue(s) {
|
|
411
|
+
const { policy: r } = T();
|
|
412
|
+
return m(() => {
|
|
413
|
+
const e = r.cookiesAllowed && s.cookies !== !1, t = r.localStorageAllowed && s.localStorage !== !1, o = r.sessionStorageAllowed && s.sessionStorage !== !1;
|
|
414
|
+
return {
|
|
415
|
+
cookiesAllowed: e,
|
|
416
|
+
localStorageAllowed: t,
|
|
417
|
+
sessionStorageAllowed: o,
|
|
418
|
+
effectiveMode: r.effectiveMode,
|
|
419
|
+
canPersist: t || o,
|
|
420
|
+
degraded: !t && !o
|
|
421
|
+
};
|
|
422
|
+
}, [r, s.cookies, s.localStorage, s.sessionStorage]);
|
|
423
|
+
}
|
|
424
|
+
export {
|
|
425
|
+
te as T,
|
|
426
|
+
re as a,
|
|
427
|
+
T as b,
|
|
428
|
+
oe as c,
|
|
429
|
+
le as d,
|
|
430
|
+
ae as e,
|
|
431
|
+
j as f,
|
|
432
|
+
ue as g,
|
|
433
|
+
ne as h,
|
|
434
|
+
se as i,
|
|
435
|
+
ce as j,
|
|
436
|
+
ie as k,
|
|
437
|
+
B as u
|
|
438
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react"),d=require("@nice2dev/ui-core"),I=s.createContext(null);function Y({children:r,initialPolicy:o,policyEndpoint:e,instanceCeiling:t,tenantPolicy:a,groupPolicy:l,userPreference:S,instanceId:n="default",tenantId:u,onPolicyChange:f}){const[c,m]=s.useState(o||d.DEFAULT_TRACELESS_POLICY),[A,M]=s.useState(S),[C,E]=s.useState(!!e),[b,w]=s.useState(null),T=s.useRef(new Map);s.useEffect(()=>{const g=t||d.createPermissiveInstanceCeiling(n),i=d.resolveTracelessPolicy(g,a,l,A);m(i),f?.(i),T.current.forEach(L=>{L.updatePolicy(i)})},[t,a,l,A,n,f]),s.useEffect(()=>{if(!e)return;(async()=>{E(!0),w(null);try{const i=await fetch(e,{credentials:"include"});if(!i.ok)throw new Error(`Failed to fetch policy: ${i.status}`);const L=i.headers.get(d.TRACELESS_POLICY_HEADER);if(L){const k=d.parsePolicyFromHeader(L);if(k){const R=t||d.createPermissiveInstanceCeiling(n),F=d.resolveTracelessPolicy(R,a?{...a,mode:k}:{tenantId:"default",mode:k,allowGroupOverride:!0,allowUserOverride:!0,updatedAt:Date.now()},l,A);m(F),f?.(F)}}try{const k=await i.json();k.policy&&(m(k.policy),f?.(k.policy))}catch{}}catch(i){w(i instanceof Error?i:new Error("Unknown error"))}finally{E(!1)}})()},[e,t,a,l,A,n,f]);const P=s.useCallback(g=>{M(i=>({userId:i?.userId||"anonymous",preferredMode:g.preferredMode||i?.preferredMode||"traceless",restrictCookies:g.restrictCookies??i?.restrictCookies,restrictLocalStorage:g.restrictLocalStorage??i?.restrictLocalStorage,restrictSessionStorage:g.restrictSessionStorage??i?.restrictSessionStorage,setAt:Date.now()}))},[]),U=s.useCallback(()=>d.generateTracelessComplianceReport(c,n,u),[c,n,u]),D=s.useCallback(()=>d.auditStorageCompliance(c),[c]),_=s.useCallback(async()=>{if(e){E(!0);try{const g=await fetch(e,{credentials:"include",cache:"no-cache"});if(g.ok){const i=g.headers.get(d.TRACELESS_POLICY_HEADER);if(i){const L=d.parsePolicyFromHeader(i);if(L){const k=t||d.createPermissiveInstanceCeiling(n),R=d.resolveTracelessPolicy(k,a?{...a,mode:L}:void 0,l,A);m(R),f?.(R)}}}}finally{E(!1)}}},[e,t,a,l,A,n,f]),p=s.useCallback((g="nice2dev")=>{let i=T.current.get(g);return i||(i=new d.StorageAdapter(c,g),T.current.set(g,i)),i},[c]),O=s.useMemo(()=>d.getTracelessBadgeInfo(c),[c]),B=s.useMemo(()=>({policy:c,canUseCookies:c.cookiesAllowed,canUseLocalStorage:c.localStorageAllowed,canUseSessionStorage:c.sessionStorageAllowed,canPersist:c.localStorageAllowed,mode:c.effectiveMode,requiresConsentBanner:c.requiresConsentBanner,badgeInfo:O,setUserPreference:P,generateReport:U,runAudit:D,refreshPolicy:_,getStorageAdapter:p,isLoading:C,error:b}),[c,O,P,U,D,_,p,C,b]);return s.createElement(I.Provider,{value:B},r)}function x(){const r=s.useContext(I);if(!r)throw new Error("useTracelessPolicy must be used within a TracelessProvider");return r}function v(){const r=s.useContext(I);if(r)return r;const o=new d.StorageAdapter(d.DEFAULT_TRACELESS_POLICY);return{policy:d.DEFAULT_TRACELESS_POLICY,canUseCookies:!1,canUseLocalStorage:!1,canUseSessionStorage:!1,canPersist:!1,mode:"traceless",requiresConsentBanner:!1,badgeInfo:d.getTracelessBadgeInfo(d.DEFAULT_TRACELESS_POLICY),setUserPreference:()=>{},generateReport:()=>d.generateTracelessComplianceReport(d.DEFAULT_TRACELESS_POLICY,"default"),runAudit:()=>d.auditStorageCompliance(d.DEFAULT_TRACELESS_POLICY),refreshPolicy:async()=>{},getStorageAdapter:()=>o,isLoading:!1,error:null}}function h(r="nice2dev"){const{getStorageAdapter:o}=v();return s.useMemo(()=>o(r),[o,r])}function y(r,o,e){const t=h(e?.namespace),{canPersist:a,canUseSessionStorage:l}=v(),S=e?.storageMode==="session"?l:a,[n,u]=s.useState(()=>{if(S){const c=t.get(r,e?.storageMode);if(c!==null)return c}return o}),f=s.useCallback(c=>{u(m=>{const A=typeof c=="function"?c(m):c;return S&&t.set(r,A,e?.storageMode==="session"?"session":"local"),A})},[t,r,S,e?.storageMode]);return[n,f,S]}function q(){const{requiresConsentBanner:r,mode:o}=v(),e=h("nice2dev-consent"),[t,a]=s.useState(()=>e.get("banner-dismissed")===!0),l=s.useCallback(()=>{a(!0),e.set("banner-dismissed",!0)},[e]);return{shouldShow:r&&!t,mode:o,dismiss:l}}function H(r=!1){const{runAudit:o}=v(),[e,t]=s.useState(null),a=s.useCallback(()=>{const l=o();return t(l),l},[o]);return s.useEffect(()=>{r&&a()},[r,a]),{result:e,run:a,isCompliant:e?.compliant??null}}function V(){const{policy:r,getStorageAdapter:o}=v(),e=s.useMemo(()=>o("local"),[o]),t=s.useCallback(n=>e.get(n),[e]),a=s.useCallback((n,u)=>{e.set(n,u)},[e]),l=s.useCallback(n=>{e.remove(n)},[e]),S=s.useCallback(()=>{e.clear()},[e]);return s.useMemo(()=>({getItem:t,setItem:a,removeItem:l,clear:S,isAvailable:r.localStorageAllowed,effectiveMode:r.effectiveMode,policy:r}),[t,a,l,S,r])}function $(){const{policy:r,getStorageAdapter:o}=v(),e=s.useMemo(()=>o("session"),[o]),t=s.useCallback(n=>e.get(n),[e]),a=s.useCallback((n,u)=>{e.set(n,u)},[e]),l=s.useCallback(n=>{e.remove(n)},[e]),S=s.useCallback(()=>{e.clear()},[e]);return s.useMemo(()=>({getItem:t,setItem:a,removeItem:l,clear:S,isAvailable:r.sessionStorageAllowed,effectiveMode:r.effectiveMode}),[t,a,l,S,r])}function G({storageKey:r,initialState:o={},onStateChange:e,storageType:t="auto"}){const{policy:a,getStorageAdapter:l}=v(),S=`nice-datagrid-${r}`,n=s.useMemo(()=>{if(t==="local"&&a.localStorageAllowed)return"local";if(t==="session"&&a.sessionStorageAllowed)return"session";if(t==="auto"){if(a.localStorageAllowed)return"local";if(a.sessionStorageAllowed)return"session"}return"memory"},[t,a]),u=s.useMemo(()=>l(n==="session"?"session-grid":"local-grid"),[l,n]),[f,c]=s.useState(()=>{const C=u.get(S);if(C)try{return{...o,...JSON.parse(C)}}catch{return o}return o});s.useEffect(()=>{u.set(S,JSON.stringify(f)),e?.(f)},[f,u,S,e]);const m=s.useCallback(C=>{c(E=>({...E,...C}))},[]),A=s.useCallback(()=>{u.remove(S),c(o)},[u,S,o]);return{state:f,updateState:m,setState:c,clearState:A,degraded:n==="memory",effectiveStorageType:n,policy:a}}function K({storageKey:r,autoSaveInterval:o=5e3,maxVersions:e=10}){const{policy:t,getStorageAdapter:a}=v(),l=`nice-editor-${r}`,S=`${l}-history`,n=s.useMemo(()=>a("editor"),[a]),[u,f]=y(l,null,{storageMode:t.localStorageAllowed?"local":"session"}),[c,m]=y(S,[],{storageMode:"local"}),A=s.useCallback((w,T)=>{const P={content:w,cursorPosition:T,lastModified:Date.now(),version:(u?.version??0)+1};f(P)},[u,f]),M=s.useCallback(()=>{!u||!t.localStorageAllowed||m(w=>[...w,u].slice(-e))},[u,t.localStorageAllowed,e,m]),C=s.useCallback(w=>{const T=c.find(P=>P.version===w);T&&f(T)},[c,f]),E=s.useCallback(()=>{n.remove(l),f(null)},[n,l,f]),b=s.useRef(null);return s.useEffect(()=>{if(!o||!u?.content||u.content===b.current)return;const w=setTimeout(()=>{b.current=u.content??null},o);return()=>clearTimeout(w)},[u?.content,o]),{draft:u,saveDraft:A,saveToHistory:M,restoreVersion:C,clearDraft:E,history:c,hasDraft:u!==null,degraded:!t.localStorageAllowed&&!t.sessionStorageAllowed,policy:t}}function J(r="local"){const o=h(r),e=s.useRef([]);return s.useMemo(()=>({getItem:t=>o.get(t),setItem:(t,a)=>{o.set(t,a),e.current.includes(t)||e.current.push(t)},removeItem:t=>{o.remove(t),e.current=e.current.filter(a=>a!==t)},clear:()=>{o.clear(),e.current=[]},get length(){return e.current.length},key:t=>e.current[t]??null}),[o])}function N(r){const{policy:o}=v();return s.useMemo(()=>{const e=o.cookiesAllowed&&r.cookies!==!1,t=o.localStorageAllowed&&r.localStorage!==!1,a=o.sessionStorageAllowed&&r.sessionStorage!==!1;return{cookiesAllowed:e,localStorageAllowed:t,sessionStorageAllowed:a,effectiveMode:o.effectiveMode,canPersist:t||a,degraded:!t&&!a}},[o,r.cookies,r.localStorage,r.sessionStorage])}exports.TracelessProvider=Y;exports.useCookieBannerVisibility=q;exports.useEditorStatePersistence=K;exports.useGridStatePersistence=G;exports.usePersistedState=y;exports.useResolvedStorageProps=N;exports.useStorageAdapter=h;exports.useStorageAudit=H;exports.useTracelessLocalStorage=V;exports.useTracelessPolicy=x;exports.useTracelessPolicySafe=v;exports.useTracelessSessionStorage=$;exports.useTracelessStorage=J;
|