@nice2dev/ui 1.1.10 → 1.2.1
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 +183 -0
- package/README.md +12 -20
- 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-5tWvfXKl.cjs +1 -0
- package/dist/NiceButton-DHSgQT1_.js +112 -0
- package/dist/NiceButton-vkI07DP0.js +88 -0
- package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
- package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -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/NiceColorPicker-DCgmE-3H.cjs +1 -0
- package/dist/NiceColorPicker-DK30kJgy.js +486 -0
- package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
- package/dist/NiceColorPicker-bNJBAU_c.js +598 -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-BOCJr6XF.js +2217 -0
- package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
- package/dist/NiceDataGrid-CS5aB-EN.cjs +10 -0
- package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
- package/dist/NiceDataGrid-DjZchXYG.js +2217 -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-BCEXovJR.cjs +1 -0
- package/dist/NiceForm-BcN4p2kG.cjs +1 -0
- package/dist/NiceForm-D7oyWHXg.js +4820 -0
- package/dist/NiceForm-DUhxXArr.js +4817 -0
- package/dist/NiceForm-tIXS-M6b.js +4770 -0
- package/dist/NiceForm-uCeVmTrD.cjs +1 -0
- package/dist/NiceFormItem.doc-BJwEnDz2.js +36 -0
- package/dist/NiceFormItem.doc-Ck3PgaPD.cjs +12 -0
- package/dist/NiceGantt-CTbqCuwv.cjs +1 -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-BYk1roA4.cjs +10 -0
- package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
- package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
- package/dist/NiceHtmlEditor-DUwcqj5N.cjs +10 -0
- package/dist/NiceHtmlEditor-DiAphF1k.js +889 -0
- package/dist/NiceHtmlEditor-mWebBmy1.js +849 -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-BHyDY7br.cjs +1 -0
- package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
- package/dist/NiceLoginForm-DQe77Isv.js +747 -0
- package/dist/NiceLoginForm-NBCo-DUZ.cjs +1 -0
- package/dist/NiceLoginForm.css +1 -0
- 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-CA7CL5BI.js +11263 -0
- package/dist/NiceMention-CHcKRl-L.cjs +430 -0
- package/dist/NiceMention-Co2cqkVM.js +11316 -0
- package/dist/NiceMention-DJD0BLcp.js +11269 -0
- package/dist/NiceMention-DcaUEMSg.cjs +430 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-C4p8a82e.cjs +1 -0
- package/dist/NiceModal-TNlkaL_i.js +85 -0
- package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
- package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DV3F_QdI.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
- package/dist/NiceModuleLifecyclePanel-_OcfDmtC.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-8XsBbMNx.js +165 -0
- package/dist/NicePagination-B3nZDZem.js +165 -0
- package/dist/NicePagination-B8rg1Y67.cjs +1 -0
- package/dist/NicePagination-CkOoXf0f.js +165 -0
- package/dist/NicePagination-D7lek1G7.cjs +1 -0
- package/dist/NicePagination-OjTEfZJE.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-BJRSciWl.js +1183 -0
- package/dist/NicePivotGrid-BaZa2YZW.js +1157 -0
- package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
- package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
- package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -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-B5HhqlAI.cjs +586 -0
- package/dist/NiceSavedQueryPanel-BC84uRfh.cjs +586 -0
- package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
- package/dist/NiceSavedQueryPanel-CMfcODIO.js +5120 -0
- package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
- package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -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-7gP7vcLy.cjs +5 -0
- package/dist/NiceScheduler-BAJRzFQN.js +1690 -0
- package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
- package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
- package/dist/NiceScheduler-dJ7gHDv7.cjs +5 -0
- package/dist/NiceScheduler-l8N4yCWd.js +1716 -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/NiceSelect-DZB1Rs9x.js +435 -0
- package/dist/NiceSelect-tMz9QQUs.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/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
- package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -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-BEov3s9F.js +2094 -0
- package/dist/NiceWindow-CDt6PCEg.cjs +1 -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-ByrdMeQP.js +4767 -0
- package/dist/charts-C047IMVn.cjs +768 -0
- package/dist/charts-CCXSb3xk.js +4752 -0
- package/dist/charts-CqETcUhH.js +4752 -0
- package/dist/charts-DouiiHOT.cjs +768 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.d.ts +28 -18
- package/dist/charts.mjs +1 -1
- package/dist/core-B8eBUE4m.js +438 -0
- package/dist/core-BL-KmGYC.js +795 -0
- package/dist/core-Chg-oYCr.cjs +1 -0
- package/dist/core-CxBnKAhs.cjs +1 -0
- package/dist/core-D_LRh59n.js +795 -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/data-branching-Dak1_ZKR.cjs +1 -0
- package/dist/data-branching-DiLAO4Qt.js +6386 -0
- package/dist/data-branching-Km4lc8P_.cjs +1 -0
- package/dist/data-branching-YQtJJEtn.js +6273 -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 -69
- package/dist/data.mjs +3 -3
- package/dist/devops-D5yIDM3e.js +8312 -0
- package/dist/devops-DkVluHBp.cjs +17 -0
- package/dist/devops-rVpB0ZAX.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 +106 -63
- package/dist/editors.mjs +55 -54
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +76 -2
- package/dist/feedback.mjs +10 -9
- package/dist/index.cjs +261 -261
- package/dist/index.css +1 -1
- package/dist/index.d.ts +831 -433
- package/dist/index.mjs +27339 -26540
- 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 +55 -55
- 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-6WyYb3hL.cjs +331 -0
- package/dist/no-code-BH5oVFC6.js +8186 -0
- package/dist/no-code-CnHG5_Vn.js +8186 -0
- package/dist/no-code-DMKlg1Zl.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.d.ts +25 -18
- package/dist/no-code.mjs +3 -3
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +36 -30
- package/dist/overlays.mjs +24 -490
- package/dist/pickerCommons-0vyK1Knv.js +547 -0
- package/dist/pickerCommons-BCRiHDE_.cjs +1 -0
- package/dist/pickerCommons-BFbItm8o.cjs +1 -0
- package/dist/pickerCommons-BHirHJyn.js +548 -0
- package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
- package/dist/pickerCommons-DkumQ3KE.js +548 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +15 -9
- package/package.json +4 -6
- package/css/legacy-bg-text-aliases.css +0 -87
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceAccessMode as le, useNiceTranslation as he } from "@nice2dev/ui-core";
|
|
3
|
+
import { useState as F, useRef as R, useEffect as J, useMemo as O, useCallback as z } from "react";
|
|
4
|
+
const me = [], b = (m, D) => {
|
|
5
|
+
const y = new Date(m);
|
|
6
|
+
return y.setDate(y.getDate() + D), y;
|
|
7
|
+
}, E = (m, D) => Math.ceil((D.getTime() - m.getTime()) / 864e5), ue = ({
|
|
8
|
+
tasks: m = me,
|
|
9
|
+
columns: D,
|
|
10
|
+
scale: y = "day",
|
|
11
|
+
rowHeight: _ = 36,
|
|
12
|
+
dayWidth: P = 30,
|
|
13
|
+
onTaskClick: q,
|
|
14
|
+
onTaskUpdate: w,
|
|
15
|
+
showDependencies: G = !0,
|
|
16
|
+
dependencyStyle: K = "square",
|
|
17
|
+
draggable: M,
|
|
18
|
+
zoomControls: V,
|
|
19
|
+
className: Z,
|
|
20
|
+
style: k,
|
|
21
|
+
accessMode: H,
|
|
22
|
+
id: U
|
|
23
|
+
}) => {
|
|
24
|
+
const ee = le(H, U) === "hidden", { t: fe } = he(), [o, A] = F(P), [f, C] = F(null), x = D || [{ field: "title", title: "Task", width: 200 }], B = x.reduce((e, t) => e + (t.width || 120), 0), T = R(null), j = R(null), S = R(!1);
|
|
25
|
+
J(() => {
|
|
26
|
+
const e = T.current, t = j.current;
|
|
27
|
+
if (!e || !t)
|
|
28
|
+
return;
|
|
29
|
+
const a = (c, i) => () => {
|
|
30
|
+
S.current || (S.current = !0, i.scrollTop = c.scrollTop, requestAnimationFrame(() => {
|
|
31
|
+
S.current = !1;
|
|
32
|
+
}));
|
|
33
|
+
}, n = a(e, t), r = a(t, e);
|
|
34
|
+
return e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("scroll", r, { passive: !0 }), () => {
|
|
35
|
+
e.removeEventListener("scroll", n), t.removeEventListener("scroll", r);
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
const d = O(() => {
|
|
39
|
+
const e = (t) => m.filter((n) => (n.parentId ?? null) === t).flatMap((n) => [n, ...e(n.id)]);
|
|
40
|
+
return e(null);
|
|
41
|
+
}, [m]), u = O(() => {
|
|
42
|
+
if (d.length === 0)
|
|
43
|
+
return { start: /* @__PURE__ */ new Date(), end: /* @__PURE__ */ new Date(), days: 30 };
|
|
44
|
+
let e = new Date(d[0].start), t = new Date(d[0].end);
|
|
45
|
+
return d.forEach((a) => {
|
|
46
|
+
new Date(a.start) < e && (e = new Date(a.start)), new Date(a.end) > t && (t = new Date(a.end));
|
|
47
|
+
}), e = b(e, -2), t = b(t, 2), { start: e, end: t, days: E(e, t) };
|
|
48
|
+
}, [d]), X = u.days * o;
|
|
49
|
+
J(() => {
|
|
50
|
+
if (!f || !w)
|
|
51
|
+
return;
|
|
52
|
+
const e = (a) => {
|
|
53
|
+
const n = a.clientX - f.startX, r = Math.round(n / o);
|
|
54
|
+
if (r === 0)
|
|
55
|
+
return;
|
|
56
|
+
const c = m.find((i) => i.id === f.taskId);
|
|
57
|
+
if (c)
|
|
58
|
+
if (f.mode === "move")
|
|
59
|
+
w({
|
|
60
|
+
...c,
|
|
61
|
+
start: b(f.origStart, r),
|
|
62
|
+
end: b(f.origEnd, r)
|
|
63
|
+
});
|
|
64
|
+
else {
|
|
65
|
+
const i = b(f.origEnd, r);
|
|
66
|
+
i > f.origStart && w({ ...c, end: i });
|
|
67
|
+
}
|
|
68
|
+
}, t = () => C(null);
|
|
69
|
+
return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), () => {
|
|
70
|
+
document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t);
|
|
71
|
+
};
|
|
72
|
+
}, [f, o, m, w]);
|
|
73
|
+
const I = z(
|
|
74
|
+
(e, t, a) => {
|
|
75
|
+
if (!M || !w)
|
|
76
|
+
return;
|
|
77
|
+
a.stopPropagation();
|
|
78
|
+
const n = m.find((r) => r.id === e);
|
|
79
|
+
n && C({
|
|
80
|
+
taskId: e,
|
|
81
|
+
mode: t,
|
|
82
|
+
startX: a.clientX,
|
|
83
|
+
origStart: new Date(n.start),
|
|
84
|
+
origEnd: new Date(n.end)
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
[M, m, w]
|
|
88
|
+
), te = z(() => A((e) => Math.min(100, e + 5)), []), ne = z(() => A((e) => Math.max(8, e - 5)), []), ae = () => {
|
|
89
|
+
const e = [], t = [];
|
|
90
|
+
new Date(u.start);
|
|
91
|
+
const a = [
|
|
92
|
+
"Jan",
|
|
93
|
+
"Feb",
|
|
94
|
+
"Mar",
|
|
95
|
+
"Apr",
|
|
96
|
+
"May",
|
|
97
|
+
"Jun",
|
|
98
|
+
"Jul",
|
|
99
|
+
"Aug",
|
|
100
|
+
"Sep",
|
|
101
|
+
"Oct",
|
|
102
|
+
"Nov",
|
|
103
|
+
"Dec"
|
|
104
|
+
];
|
|
105
|
+
if (y === "day") {
|
|
106
|
+
let n = -1, r = 0;
|
|
107
|
+
for (let c = 0; c < u.days; c++) {
|
|
108
|
+
const i = b(u.start, c);
|
|
109
|
+
i.getMonth() !== n && (n >= 0 && e.push(
|
|
110
|
+
/* @__PURE__ */ l(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
className: "nice-gantt__header-cell",
|
|
114
|
+
style: { width: (c - r) * o },
|
|
115
|
+
children: [
|
|
116
|
+
a[n],
|
|
117
|
+
" ",
|
|
118
|
+
i.getFullYear()
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
`m${n}-${r}`
|
|
122
|
+
)
|
|
123
|
+
), n = i.getMonth(), r = c);
|
|
124
|
+
const h = i.getDay() === 0 || i.getDay() === 6;
|
|
125
|
+
t.push(
|
|
126
|
+
/* @__PURE__ */ s(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
className: `nice-gantt__header-cell nice-gantt__header-cell--sub ${h ? "nice-gantt__header-cell--weekend" : ""}`,
|
|
130
|
+
style: { width: o },
|
|
131
|
+
children: i.getDate()
|
|
132
|
+
},
|
|
133
|
+
c
|
|
134
|
+
)
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
n >= 0 && e.push(
|
|
138
|
+
/* @__PURE__ */ s(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
className: "nice-gantt__header-cell",
|
|
142
|
+
style: { width: (u.days - r) * o },
|
|
143
|
+
children: a[n]
|
|
144
|
+
},
|
|
145
|
+
`m${n}-last`
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
return /* @__PURE__ */ l("div", { className: "nice-gantt__chart-header", children: [
|
|
150
|
+
/* @__PURE__ */ s("div", { className: "nice-gantt__header-row", children: e }),
|
|
151
|
+
/* @__PURE__ */ s("div", { className: "nice-gantt__header-row", children: t })
|
|
152
|
+
] });
|
|
153
|
+
}, re = (e, t) => {
|
|
154
|
+
const a = E(u.start, new Date(e.start)) * o, n = Math.max(E(new Date(e.start), new Date(e.end)) * o, o), r = t * _ + 4, c = _ - 8, i = e.progress ?? 0;
|
|
155
|
+
return /* @__PURE__ */ l(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
className: `nice-gantt__bar ${M ? "nice-gantt__bar--draggable" : ""}`,
|
|
159
|
+
title: `${e.title} (${Math.round(i)}%)`,
|
|
160
|
+
style: {
|
|
161
|
+
left: a,
|
|
162
|
+
top: r,
|
|
163
|
+
width: n,
|
|
164
|
+
height: c,
|
|
165
|
+
backgroundColor: e.color || "var(--nice-color-primary, #3b82f6)"
|
|
166
|
+
},
|
|
167
|
+
onClick: () => q?.(e),
|
|
168
|
+
onMouseDown: M ? (h) => I(e.id, "move", h) : void 0,
|
|
169
|
+
children: [
|
|
170
|
+
i > 0 && /* @__PURE__ */ s("div", { className: "nice-gantt__bar-progress", style: { width: `${i}%` } }),
|
|
171
|
+
/* @__PURE__ */ s("span", { className: "nice-gantt__bar-label", children: e.title }),
|
|
172
|
+
M && /* @__PURE__ */ s(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
className: "nice-gantt__bar-resize",
|
|
176
|
+
onMouseDown: (h) => I(e.id, "resize", h)
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
e.id
|
|
182
|
+
);
|
|
183
|
+
}, se = (e, t, a, n, r) => {
|
|
184
|
+
const h = e + 10, L = a - 14, W = (t + n) / 2, N = n >= t ? 1 : -1, Q = Math.abs(n - t) < 1, Y = L <= h + 4, p = Q ? t : W, g = Y ? Math.max(h, e + 10) : h, v = Y ? Math.min(L, a - 10) : L;
|
|
185
|
+
if (Q || !r)
|
|
186
|
+
return [
|
|
187
|
+
`M ${e} ${t}`,
|
|
188
|
+
`L ${g} ${t}`,
|
|
189
|
+
`L ${g} ${p}`,
|
|
190
|
+
`L ${v} ${p}`,
|
|
191
|
+
`L ${v} ${n}`,
|
|
192
|
+
`L ${a} ${n}`
|
|
193
|
+
].join(" ");
|
|
194
|
+
const ce = Math.max(0, v - g), oe = Math.abs(n - t), de = Math.min(oe / 2 || 10, ce / 2 || 10), $ = Math.max(2, Math.min(10, de));
|
|
195
|
+
return [
|
|
196
|
+
`M ${e} ${t}`,
|
|
197
|
+
`L ${g - $} ${t}`,
|
|
198
|
+
`Q ${g} ${t} ${g} ${t + N * $}`,
|
|
199
|
+
`L ${g} ${p - N * $}`,
|
|
200
|
+
`Q ${g} ${p} ${g + $} ${p}`,
|
|
201
|
+
`L ${v - $} ${p}`,
|
|
202
|
+
`Q ${v} ${p} ${v} ${p + N * $}`,
|
|
203
|
+
`L ${v} ${n - N * $}`,
|
|
204
|
+
`Q ${v} ${n} ${v + $} ${n}`,
|
|
205
|
+
`L ${a} ${n}`
|
|
206
|
+
].join(" ");
|
|
207
|
+
}, ie = () => {
|
|
208
|
+
if (!G)
|
|
209
|
+
return null;
|
|
210
|
+
const e = [], t = new Map(d.map((a, n) => [a.id, n]));
|
|
211
|
+
return d.forEach((a) => {
|
|
212
|
+
(a.dependencies || []).forEach((n) => {
|
|
213
|
+
const r = t.get(n), c = t.get(a.id);
|
|
214
|
+
if (r == null || c == null)
|
|
215
|
+
return;
|
|
216
|
+
const i = d[r], h = E(u.start, new Date(i.end)) * o, L = r * _ + _ / 2, W = E(u.start, new Date(a.start)) * o, N = c * _ + _ / 2;
|
|
217
|
+
e.push(
|
|
218
|
+
/* @__PURE__ */ s(
|
|
219
|
+
"path",
|
|
220
|
+
{
|
|
221
|
+
d: se(h, L, W, N, K === "rounded"),
|
|
222
|
+
fill: "none",
|
|
223
|
+
stroke: "var(--nice-text-secondary, #6b7280)",
|
|
224
|
+
strokeWidth: 1.5,
|
|
225
|
+
strokeLinejoin: "round",
|
|
226
|
+
strokeLinecap: "round",
|
|
227
|
+
markerEnd: "url(#arrowhead)"
|
|
228
|
+
},
|
|
229
|
+
`${n}-${a.id}`
|
|
230
|
+
)
|
|
231
|
+
);
|
|
232
|
+
});
|
|
233
|
+
}), /* @__PURE__ */ l(
|
|
234
|
+
"svg",
|
|
235
|
+
{
|
|
236
|
+
className: "nice-gantt__deps",
|
|
237
|
+
width: X,
|
|
238
|
+
height: d.length * _,
|
|
239
|
+
style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" },
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ s("marker", { id: "arrowhead", markerWidth: "6", markerHeight: "4", refX: "5", refY: "2", orient: "auto", children: /* @__PURE__ */ s("polygon", { points: "0 0, 6 2, 0 4", fill: "var(--nice-text-secondary, #6b7280)" }) }) }),
|
|
242
|
+
e
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
};
|
|
247
|
+
return ee ? null : /* @__PURE__ */ l("div", { className: `nice-gantt ${Z || ""}`, style: k, children: [
|
|
248
|
+
V && /* @__PURE__ */ l("div", { className: "nice-gantt__zoom-controls", children: [
|
|
249
|
+
/* @__PURE__ */ s("button", { type: "button", className: "nice-btn nice-btn--sm", onClick: ne, children: "−" }),
|
|
250
|
+
/* @__PURE__ */ l("span", { className: "nice-gantt__zoom-label", children: [
|
|
251
|
+
o,
|
|
252
|
+
"px"
|
|
253
|
+
] }),
|
|
254
|
+
/* @__PURE__ */ s("button", { type: "button", className: "nice-btn nice-btn--sm", onClick: te, children: "+" })
|
|
255
|
+
] }),
|
|
256
|
+
/* @__PURE__ */ l("div", { className: "nice-gantt__container", children: [
|
|
257
|
+
/* @__PURE__ */ l("div", { className: "nice-gantt__table", style: { width: B, minWidth: B }, children: [
|
|
258
|
+
/* @__PURE__ */ l("div", { className: "nice-gantt__table-header", children: [
|
|
259
|
+
/* @__PURE__ */ s(
|
|
260
|
+
"div",
|
|
261
|
+
{
|
|
262
|
+
className: "nice-gantt__table-header-row nice-gantt__table-header-row--main",
|
|
263
|
+
"aria-hidden": "true",
|
|
264
|
+
children: " "
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
/* @__PURE__ */ s("div", { className: "nice-gantt__table-header-row nice-gantt__table-header-row--sub", children: x.map((e, t) => /* @__PURE__ */ s(
|
|
268
|
+
"div",
|
|
269
|
+
{
|
|
270
|
+
className: "nice-gantt__table-header-cell",
|
|
271
|
+
style: { width: e.width || 120 },
|
|
272
|
+
children: e.title
|
|
273
|
+
},
|
|
274
|
+
t
|
|
275
|
+
)) })
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ s("div", { className: "nice-gantt__table-body", ref: T, children: d.map((e, t) => /* @__PURE__ */ s("div", { className: "nice-gantt__table-row", style: { height: _ }, children: x.map((a, n) => /* @__PURE__ */ s(
|
|
278
|
+
"div",
|
|
279
|
+
{
|
|
280
|
+
className: "nice-gantt__table-cell",
|
|
281
|
+
style: { width: a.width || 120 },
|
|
282
|
+
children: e[a.field]
|
|
283
|
+
},
|
|
284
|
+
n
|
|
285
|
+
)) }, e.id)) })
|
|
286
|
+
] }),
|
|
287
|
+
/* @__PURE__ */ s("div", { className: "nice-gantt__chart", children: /* @__PURE__ */ l("div", { className: "nice-gantt__chart-body-wrap", ref: j, children: [
|
|
288
|
+
ae(),
|
|
289
|
+
/* @__PURE__ */ l(
|
|
290
|
+
"div",
|
|
291
|
+
{
|
|
292
|
+
className: "nice-gantt__chart-body",
|
|
293
|
+
style: {
|
|
294
|
+
width: X,
|
|
295
|
+
height: d.length * _,
|
|
296
|
+
position: "relative"
|
|
297
|
+
},
|
|
298
|
+
children: [
|
|
299
|
+
Array.from({ length: u.days }, (e, t) => {
|
|
300
|
+
const a = b(u.start, t), n = a.getDay() === 0 || a.getDay() === 6;
|
|
301
|
+
return /* @__PURE__ */ s(
|
|
302
|
+
"div",
|
|
303
|
+
{
|
|
304
|
+
className: `nice-gantt__gridline ${n ? "nice-gantt__gridline--weekend" : ""}`,
|
|
305
|
+
style: {
|
|
306
|
+
left: t * o,
|
|
307
|
+
width: o,
|
|
308
|
+
height: "100%",
|
|
309
|
+
position: "absolute",
|
|
310
|
+
top: 0
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
t
|
|
314
|
+
);
|
|
315
|
+
}),
|
|
316
|
+
d.map((e, t) => re(e, t)),
|
|
317
|
+
ie()
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
] }) })
|
|
322
|
+
] })
|
|
323
|
+
] });
|
|
324
|
+
};
|
|
325
|
+
process.env.NODE_ENV !== "production" && (ue.displayName = "NiceGantt");
|
|
326
|
+
export {
|
|
327
|
+
ue as NiceGantt
|
|
328
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceGantt",a="Gantt Chart",s="1.0.0",n="stable",o="planning",i="scheduling",r="Project Gantt chart with draggable bars, dependencies, and zoom controls.",c="1.0.0",d=["web","desktop"],l=["gantt","project","timeline","scheduling","tasks"],p=[{name:"tasks",type:"NiceGanttTask[]",required:!1,default:"[]",description:"Tasks (id, title, start, end, progress, color, parentId, dependencies)."},{name:"columns",type:"NiceGanttColumn[]",required:!1,description:"Left panel columns configuration."},{name:"scale",type:"'day' | 'week' | 'month'",required:!1,default:"'day'",description:"Time scale."},{name:"rowHeight",type:"number",required:!1,description:"Row height in px."},{name:"dayWidth",type:"number",required:!1,description:"Day column width in px."},{name:"showDependencies",type:"boolean",required:!1,default:"true",description:"Show dependency arrows."},{name:"draggable",type:"boolean",required:!1,description:"Enable drag to move/resize tasks."},{name:"zoomControls",type:"boolean",required:!1,description:"Show zoom controls."}],m=[{name:"onTaskClick",parameters:[{name:"task",type:"NiceGanttTask"}],description:"Called when task clicked."},{name:"onTaskUpdate",parameters:[{name:"task",type:"NiceGanttTask"}],description:"Called after task drag/resize."}],u=[],h=[{title:"Project Gantt",code:`<NiceGantt
|
|
2
|
+
tasks={projectTasks}
|
|
3
|
+
columns={[
|
|
4
|
+
{ field: 'title', header: 'Task', width: 200 },
|
|
5
|
+
{ field: 'assignee', header: 'Assignee', width: 100 }
|
|
6
|
+
]}
|
|
7
|
+
scale="week"
|
|
8
|
+
draggable
|
|
9
|
+
showDependencies
|
|
10
|
+
onTaskUpdate={handleTaskUpdate}
|
|
11
|
+
/>`,language:"tsx"}],g=[{name:"NiceScheduler",relationship:"calendar"},{name:"NiceTimeline",relationship:"simple"}],k={$schema:e,name:t,displayName:a,version:s,status:n,category:o,subcategory:i,package:"@nicetoDev/ui",description:r,since:c,platforms:d,keywords:l,props:p,events:m,cssVariables:u,examples:h,related:g};exports.$schema=e;exports.category=o;exports.cssVariables=u;exports.default=k;exports.description=r;exports.displayName=a;exports.events=m;exports.examples=h;exports.keywords=l;exports.name=t;exports.platforms=d;exports.props=p;exports.related=g;exports.since=c;exports.status=n;exports.subcategory=i;exports.version=s;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceGantt", n = "Gantt Chart", a = "1.0.0", s = "stable", o = "planning", i = "scheduling", c = "Project Gantt chart with draggable bars, dependencies, and zoom controls.", r = "1.0.0", d = ["web", "desktop"], l = ["gantt", "project", "timeline", "scheduling", "tasks"], p = [{ name: "tasks", type: "NiceGanttTask[]", required: !1, default: "[]", description: "Tasks (id, title, start, end, progress, color, parentId, dependencies)." }, { name: "columns", type: "NiceGanttColumn[]", required: !1, description: "Left panel columns configuration." }, { name: "scale", type: "'day' | 'week' | 'month'", required: !1, default: "'day'", description: "Time scale." }, { name: "rowHeight", type: "number", required: !1, description: "Row height in px." }, { name: "dayWidth", type: "number", required: !1, description: "Day column width in px." }, { name: "showDependencies", type: "boolean", required: !1, default: "true", description: "Show dependency arrows." }, { name: "draggable", type: "boolean", required: !1, description: "Enable drag to move/resize tasks." }, { name: "zoomControls", type: "boolean", required: !1, description: "Show zoom controls." }], m = [{ name: "onTaskClick", parameters: [{ name: "task", type: "NiceGanttTask" }], description: "Called when task clicked." }, { name: "onTaskUpdate", parameters: [{ name: "task", type: "NiceGanttTask" }], description: "Called after task drag/resize." }], u = [], h = [{ title: "Project Gantt", code: `<NiceGantt
|
|
2
|
+
tasks={projectTasks}
|
|
3
|
+
columns={[
|
|
4
|
+
{ field: 'title', header: 'Task', width: 200 },
|
|
5
|
+
{ field: 'assignee', header: 'Assignee', width: 100 }
|
|
6
|
+
]}
|
|
7
|
+
scale="week"
|
|
8
|
+
draggable
|
|
9
|
+
showDependencies
|
|
10
|
+
onTaskUpdate={handleTaskUpdate}
|
|
11
|
+
/>`, language: "tsx" }], k = [{ name: "NiceScheduler", relationship: "calendar" }, { name: "NiceTimeline", relationship: "simple" }], g = {
|
|
12
|
+
$schema: e,
|
|
13
|
+
name: t,
|
|
14
|
+
displayName: n,
|
|
15
|
+
version: a,
|
|
16
|
+
status: s,
|
|
17
|
+
category: o,
|
|
18
|
+
subcategory: i,
|
|
19
|
+
package: "@nicetoDev/ui",
|
|
20
|
+
description: c,
|
|
21
|
+
since: r,
|
|
22
|
+
platforms: d,
|
|
23
|
+
keywords: l,
|
|
24
|
+
props: p,
|
|
25
|
+
events: m,
|
|
26
|
+
cssVariables: u,
|
|
27
|
+
examples: h,
|
|
28
|
+
related: k
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
e as $schema,
|
|
32
|
+
o as category,
|
|
33
|
+
u as cssVariables,
|
|
34
|
+
g as default,
|
|
35
|
+
c as description,
|
|
36
|
+
n as displayName,
|
|
37
|
+
m as events,
|
|
38
|
+
h as examples,
|
|
39
|
+
l as keywords,
|
|
40
|
+
t as name,
|
|
41
|
+
d as platforms,
|
|
42
|
+
p as props,
|
|
43
|
+
k as related,
|
|
44
|
+
r as since,
|
|
45
|
+
s as status,
|
|
46
|
+
i as subcategory,
|
|
47
|
+
a as version
|
|
48
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceGitBlame", i = "Git blame view showing commit info per line with author, date, and commit message.", n = "devops", o = "1.0.7", c = "stable", a = [{ name: "content", type: "string", required: !0, description: "File content" }, { name: "language", type: "string", description: "Language for syntax highlighting" }, { name: "onCommitClick", type: "(hash: string) => void", description: "Callback when clicking a commit" }, { name: "showAge", type: "boolean", default: !0, description: "Show relative age colors" }], s = [{ title: "Git Blame", description: "View line-by-line commit history", code: `<NiceGitBlame
|
|
2
|
+
content={fileContent}
|
|
3
|
+
blameData={blameInfo}
|
|
4
|
+
language="typescript"
|
|
5
|
+
onCommitClick={handleCommitClick}
|
|
6
|
+
/>` }], l = { role: "region", ariaLabel: "Git blame view" }, m = ["NiceGitGraph", "NiceGitDiffViewer"], r = {
|
|
7
|
+
$schema: e,
|
|
8
|
+
name: t,
|
|
9
|
+
description: i,
|
|
10
|
+
category: n,
|
|
11
|
+
since: o,
|
|
12
|
+
status: c,
|
|
13
|
+
props: a,
|
|
14
|
+
examples: s,
|
|
15
|
+
accessibility: l,
|
|
16
|
+
seeAlso: m
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
e as $schema,
|
|
20
|
+
l as accessibility,
|
|
21
|
+
n as category,
|
|
22
|
+
r as default,
|
|
23
|
+
i as description,
|
|
24
|
+
s as examples,
|
|
25
|
+
t as name,
|
|
26
|
+
a as props,
|
|
27
|
+
m as seeAlso,
|
|
28
|
+
o as since,
|
|
29
|
+
c as status
|
|
30
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceGitBlame",i="Git blame view showing commit info per line with author, date, and commit message.",n="devops",o="1.0.7",s="stable",c=[{name:"content",type:"string",required:!0,description:"File content"},{name:"language",type:"string",description:"Language for syntax highlighting"},{name:"onCommitClick",type:"(hash: string) => void",description:"Callback when clicking a commit"},{name:"showAge",type:"boolean",default:!0,description:"Show relative age colors"}],a=[{title:"Git Blame",description:"View line-by-line commit history",code:`<NiceGitBlame
|
|
2
|
+
content={fileContent}
|
|
3
|
+
blameData={blameInfo}
|
|
4
|
+
language="typescript"
|
|
5
|
+
onCommitClick={handleCommitClick}
|
|
6
|
+
/>`}],l={role:"region",ariaLabel:"Git blame view"},m=["NiceGitGraph","NiceGitDiffViewer"],r={$schema:e,name:t,description:i,category:n,since:o,status:s,props:c,examples:a,accessibility:l,seeAlso:m};exports.$schema=e;exports.accessibility=l;exports.category=n;exports.default=r;exports.description=i;exports.examples=a;exports.name=t;exports.props=c;exports.seeAlso=m;exports.since=o;exports.status=s;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", i = "NiceGitDiffViewer", n = "Side-by-side or unified diff viewer with syntax highlighting and line navigation.", t = "devops", o = "1.0.7", s = "stable", a = [{ name: "filename", type: "string", description: "File name for syntax detection" }, { name: "mode", type: "'split' | 'unified'", default: "split", description: "Diff display mode" }, { name: "language", type: "string", description: "Language for syntax highlighting" }, { name: "showLineNumbers", type: "boolean", default: !0, description: "Show line numbers" }], c = [{ title: "Diff Viewer", description: "Compare two file versions", code: `<NiceGitDiffViewer
|
|
2
|
+
oldContent={oldCode}
|
|
3
|
+
newContent={newCode}
|
|
4
|
+
filename="index.ts"
|
|
5
|
+
mode="split"
|
|
6
|
+
/>` }], d = { role: "region", ariaLabel: "File diff viewer" }, l = ["NiceGitGraph", "NiceGitBlame", "NiceGitConflictResolver"], r = {
|
|
7
|
+
$schema: e,
|
|
8
|
+
name: i,
|
|
9
|
+
description: n,
|
|
10
|
+
category: t,
|
|
11
|
+
since: o,
|
|
12
|
+
status: s,
|
|
13
|
+
props: a,
|
|
14
|
+
examples: c,
|
|
15
|
+
accessibility: d,
|
|
16
|
+
seeAlso: l
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
e as $schema,
|
|
20
|
+
d as accessibility,
|
|
21
|
+
t as category,
|
|
22
|
+
r as default,
|
|
23
|
+
n as description,
|
|
24
|
+
c as examples,
|
|
25
|
+
i as name,
|
|
26
|
+
a as props,
|
|
27
|
+
l as seeAlso,
|
|
28
|
+
o as since,
|
|
29
|
+
s as status
|
|
30
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",i="NiceGitDiffViewer",t="Side-by-side or unified diff viewer with syntax highlighting and line navigation.",n="devops",s="1.0.7",o="stable",c=[{name:"filename",type:"string",description:"File name for syntax detection"},{name:"mode",type:"'split' | 'unified'",default:"split",description:"Diff display mode"},{name:"language",type:"string",description:"Language for syntax highlighting"},{name:"showLineNumbers",type:"boolean",default:!0,description:"Show line numbers"}],a=[{title:"Diff Viewer",description:"Compare two file versions",code:`<NiceGitDiffViewer
|
|
2
|
+
oldContent={oldCode}
|
|
3
|
+
newContent={newCode}
|
|
4
|
+
filename="index.ts"
|
|
5
|
+
mode="split"
|
|
6
|
+
/>`}],l={role:"region",ariaLabel:"File diff viewer"},r=["NiceGitGraph","NiceGitBlame","NiceGitConflictResolver"],d={$schema:e,name:i,description:t,category:n,since:s,status:o,props:c,examples:a,accessibility:l,seeAlso:r};exports.$schema=e;exports.accessibility=l;exports.category=n;exports.default=d;exports.description=t;exports.examples=a;exports.name=i;exports.props=c;exports.seeAlso=r;exports.since=s;exports.status=o;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", t = "NiceGitGraph", i = "Interactive Git commit graph visualization with branch lines, commit nodes, and merge indicators.", c = "devops", o = "1.0.7", n = "stable", a = [{ name: "commits", type: "GitCommit[]", required: !0, description: "Array of commits to visualize" }, { name: "branches", type: "GitBranch[]", description: "Branch information for coloring" }, { name: "selectedCommit", type: "string", description: "Currently selected commit hash" }, { name: "onCommitSelect", type: "(hash: string) => void", description: "Callback when a commit is clicked" }, { name: "onBranchSelect", type: "(branch: string) => void", description: "Callback when a branch is clicked" }, { name: "layout", type: "'horizontal' | 'vertical'", default: "vertical", description: "Graph layout direction" }], s = [{ title: "Git Graph", description: "Visualize commit history with branches", code: `<NiceGitGraph
|
|
2
|
+
commits={commits}
|
|
3
|
+
branches={branches}
|
|
4
|
+
onCommitSelect={(hash) => console.log('Selected:', hash)}
|
|
5
|
+
/>` }], r = { role: "tree", ariaLabel: "Git commit history graph" }, m = ["NiceBranchManager", "NiceGitDiffViewer", "NiceGitBlame"], h = {
|
|
6
|
+
$schema: e,
|
|
7
|
+
name: t,
|
|
8
|
+
description: i,
|
|
9
|
+
category: c,
|
|
10
|
+
since: o,
|
|
11
|
+
status: n,
|
|
12
|
+
props: a,
|
|
13
|
+
examples: s,
|
|
14
|
+
accessibility: r,
|
|
15
|
+
seeAlso: m
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
e as $schema,
|
|
19
|
+
r as accessibility,
|
|
20
|
+
c as category,
|
|
21
|
+
h as default,
|
|
22
|
+
i as description,
|
|
23
|
+
s as examples,
|
|
24
|
+
t as name,
|
|
25
|
+
a as props,
|
|
26
|
+
m as seeAlso,
|
|
27
|
+
o as since,
|
|
28
|
+
n as status
|
|
29
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceGitGraph",i="Interactive Git commit graph visualization with branch lines, commit nodes, and merge indicators.",c="devops",o="1.0.7",s="stable",n=[{name:"commits",type:"GitCommit[]",required:!0,description:"Array of commits to visualize"},{name:"branches",type:"GitBranch[]",description:"Branch information for coloring"},{name:"selectedCommit",type:"string",description:"Currently selected commit hash"},{name:"onCommitSelect",type:"(hash: string) => void",description:"Callback when a commit is clicked"},{name:"onBranchSelect",type:"(branch: string) => void",description:"Callback when a branch is clicked"},{name:"layout",type:"'horizontal' | 'vertical'",default:"vertical",description:"Graph layout direction"}],a=[{title:"Git Graph",description:"Visualize commit history with branches",code:`<NiceGitGraph
|
|
2
|
+
commits={commits}
|
|
3
|
+
branches={branches}
|
|
4
|
+
onCommitSelect={(hash) => console.log('Selected:', hash)}
|
|
5
|
+
/>`}],r={role:"tree",ariaLabel:"Git commit history graph"},m=["NiceBranchManager","NiceGitDiffViewer","NiceGitBlame"],l={$schema:e,name:t,description:i,category:c,since:o,status:s,props:n,examples:a,accessibility:r,seeAlso:m};exports.$schema=e;exports.accessibility=r;exports.category=c;exports.default=l;exports.description=i;exports.examples=a;exports.name=t;exports.props=n;exports.seeAlso=m;exports.since=o;exports.status=s;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o="https://nice2dev.com/schemas/component-doc-v1.json",e="NiceGitHooks",s="Git hooks configuration panel for pre-commit, pre-push, and other hook types.",t="devops",i="1.0.7",n="stable",c=[{name:"hooks",type:"GitHook[]",required:!0,description:"Configured hooks"},{name:"onChange",type:"(hooks: GitHook[]) => void",description:"Callback when hooks change"},{name:"templates",type:"HookTemplate[]",description:"Hook script templates"}],a=[{title:"Git Hooks",description:"Configure repository hooks",code:`<NiceGitHooks
|
|
2
|
+
hooks={repoHooks}
|
|
3
|
+
onChange={handleHooksChange}
|
|
4
|
+
availableHooks={['pre-commit', 'pre-push', 'commit-msg']}
|
|
5
|
+
/>`}],r={role:"region",ariaLabel:"Git hooks configuration"},p=["NiceGitManager","NicePipelineEditor"],l={$schema:o,name:e,description:s,category:t,since:i,status:n,props:c,examples:a,accessibility:r,seeAlso:p};exports.$schema=o;exports.accessibility=r;exports.category=t;exports.default=l;exports.description=s;exports.examples=a;exports.name=e;exports.props=c;exports.seeAlso=p;exports.since=i;exports.status=n;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const o = "https://nice2dev.com/schemas/component-doc-v1.json", e = "NiceGitHooks", s = "Git hooks configuration panel for pre-commit, pre-push, and other hook types.", t = "devops", i = "1.0.7", n = "stable", c = [{ name: "hooks", type: "GitHook[]", required: !0, description: "Configured hooks" }, { name: "onChange", type: "(hooks: GitHook[]) => void", description: "Callback when hooks change" }, { name: "templates", type: "HookTemplate[]", description: "Hook script templates" }], a = [{ title: "Git Hooks", description: "Configure repository hooks", code: `<NiceGitHooks
|
|
2
|
+
hooks={repoHooks}
|
|
3
|
+
onChange={handleHooksChange}
|
|
4
|
+
availableHooks={['pre-commit', 'pre-push', 'commit-msg']}
|
|
5
|
+
/>` }], p = { role: "region", ariaLabel: "Git hooks configuration" }, r = ["NiceGitManager", "NicePipelineEditor"], h = {
|
|
6
|
+
$schema: o,
|
|
7
|
+
name: e,
|
|
8
|
+
description: s,
|
|
9
|
+
category: t,
|
|
10
|
+
since: i,
|
|
11
|
+
status: n,
|
|
12
|
+
props: c,
|
|
13
|
+
examples: a,
|
|
14
|
+
accessibility: p,
|
|
15
|
+
seeAlso: r
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
o as $schema,
|
|
19
|
+
p as accessibility,
|
|
20
|
+
t as category,
|
|
21
|
+
h as default,
|
|
22
|
+
s as description,
|
|
23
|
+
a as examples,
|
|
24
|
+
e as name,
|
|
25
|
+
c as props,
|
|
26
|
+
r as seeAlso,
|
|
27
|
+
i as since,
|
|
28
|
+
n as status
|
|
29
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("@nice2dev/ui-core"),i=require("react"),y=require("./NiceButton-5tWvfXKl.cjs"),et=require("./NiceSelect-tMz9QQUs.cjs"),he=require("./NiceColorPicker-DtPFxDKM.cjs");function xe(b){const t=b.trim().toLowerCase();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")?!0:!(t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:text"))}const tt=[{target:".nice-htmleditor",titleKey:"tutorial.htmlEditor.intro.title",title:"Rich text editor",contentKey:"tutorial.htmlEditor.intro.content",content:"Format text with the toolbar, insert links, images and tables, and switch to HTML or Markdown source when you need it.",placement:"auto"}],nt=["bold","italic","underline","strikethrough","h1","h2","h3","ul","ol","blockquote","hr","link","unlink","image","table","code","alignLeft","alignCenter","alignRight","fontSize","fontColor","undo","redo","clear","findReplace","emoji","source","fullscreen","markdown"],l=b=>r.jsx(u.NiceIcon,{name:b,size:16}),rt={bold:r.jsx("strong",{style:{fontFamily:"serif"},children:"B"}),italic:r.jsx("em",{style:{fontFamily:"serif"},children:"I"}),underline:r.jsx("span",{style:{textDecoration:"underline"},children:"U"}),strikethrough:r.jsx("span",{style:{textDecoration:"line-through"},children:"S"}),h1:"H1",h2:"H2",h3:"H3",ul:l("list"),ol:l("list-ordered"),link:l("link"),unlink:l("unlink"),undo:l("reply"),redo:l("forward"),clear:l("trash"),table:l("table"),image:l("image"),code:l("code"),markdown:"MD",blockquote:l("quote"),hr:l("minus"),subscript:"X₂",superscript:"X²",indent:l("indent"),outdent:l("outdent"),alignLeft:l("align-left"),alignCenter:l("align-center"),alignRight:l("align-right"),alignJustify:l("align-justify"),fullscreen:l("expand"),removeFormat:l("eraser"),print:l("printer"),source:l("terminal"),emoji:l("smile"),findReplace:l("search"),fontSize:l("type"),fontColor:l("palette")},ot=[{value:"1",label:"8pt"},{value:"2",label:"10pt"},{value:"3",label:"12pt"},{value:"4",label:"14pt"},{value:"5",label:"18pt"},{value:"6",label:"24pt"},{value:"7",label:"36pt"}],it=[{label:"Faces",emojis:["😀","😂","😊","😍","🤔","😢","😎","🥳","😤","🤯","🥰","😴"]},{label:"Hands",emojis:["👍","👎","👏","🤝","✌️","🤞","💪","🙌","👋","🤙"]},{label:"Symbols",emojis:["❤️","⭐","🔥","✅","❌","⚡","💡","📌","🎯","🏆","🎉","💬"]},{label:"Arrows",emojis:["➡️","⬅️","⬆️","⬇️","↩️","🔄","▶️","⏸️","⏹️","⏩"]}];function st(b){let t=b;return t=t.replace(/<h1[^>]*>(.*?)<\/h1>/gi,`# $1
|
|
2
|
+
`),t=t.replace(/<h2[^>]*>(.*?)<\/h2>/gi,`## $1
|
|
3
|
+
`),t=t.replace(/<h3[^>]*>(.*?)<\/h3>/gi,`### $1
|
|
4
|
+
`),t=t.replace(/<strong[^>]*>(.*?)<\/strong>/gi,"**$1**"),t=t.replace(/<b[^>]*>(.*?)<\/b>/gi,"**$1**"),t=t.replace(/<em[^>]*>(.*?)<\/em>/gi,"*$1*"),t=t.replace(/<i[^>]*>(.*?)<\/i>/gi,"*$1*"),t=t.replace(/<code[^>]*>(.*?)<\/code>/gi,"`$1`"),t=t.replace(/<pre[^>]*>(.*?)<\/pre>/gis,"```\n$1\n```\n"),t=t.replace(/<br\s*\/?>/gi,`
|
|
5
|
+
`),t=t.replace(/<li[^>]*>(.*?)<\/li>/gi,`- $1
|
|
6
|
+
`),t=t.replace(/<\/?(?:ul|ol|p|div)[^>]*>/gi,`
|
|
7
|
+
`),t=t.replace(/<[^>]+>/g,""),t=t.replace(/\n{3,}/g,`
|
|
8
|
+
|
|
9
|
+
`),t.trim()}function at(b){let t=b;return t=t.replace(/^### (.+)$/gm,"<h3>$1</h3>"),t=t.replace(/^## (.+)$/gm,"<h2>$1</h2>"),t=t.replace(/^# (.+)$/gm,"<h1>$1</h1>"),t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/\*(.+?)\*/g,"<em>$1</em>"),t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/```\n?([\s\S]*?)\n?```/g,"<pre>$1</pre>"),t=t.replace(/^- (.+)$/gm,"<li>$1</li>"),t=t.replace(/(<li>.*<\/li>)/gs,"<ul>$1</ul>"),t=t.replace(/\n/g,"<br>"),t}const lt=({value:b,defaultValue:t,onChange:be,placeholder:ge,height:$=200,toolbar:Ce=nt,readOnly:h,onImageUpload:w,mentionTrigger:g,mentionSuggestions:ke,onMentionSearch:Y,onFileDrop:H,pasteCleanup:Z=!0,maxLength:M=0,showWordCount:ee=!1,templates:D,label:te,error:L,helperText:ne,required:ye,disabled:x,size:ve="md",id:re,className:je,style:Se,accessMode:Te,tutorial:we})=>{const I=u.useNiceAccessMode(Te,re),He=I==="hidden";I==="disabled"&&(x=!0),I==="readOnly"&&(h=!0);const oe=u.useControlId(re),[m,c]=u.useControllableState({value:b,defaultValue:t,fallbackValue:"",onChange:be,componentName:"NiceHtmlEditor"}),d=i.useRef(null),[Me]=i.useState(()=>({__html:m})),E=i.useRef(m);E.current=m;const Ne=i.useCallback(e=>{d.current=e,e&&e.innerHTML!==E.current&&(e.innerHTML=E.current)},[]);i.useLayoutEffect(()=>{const e=d.current;e&&e.innerHTML!==m&&(e.innerHTML=m)},[m]);const ie=i.useRef(null),_e=i.useRef(null),[v,O]=i.useState(!1),[B,se]=i.useState(""),[j,F]=i.useState(!1),[W,ae]=i.useState(""),[K,R]=i.useState(!1),[Le,Re]=i.useState(""),[q,A]=i.useState(0),[P,ze]=i.useState(!1),[le,$e]=i.useState("#000000"),[ce,De]=i.useState("#ffff00"),[de,U]=i.useState(0),[Ie,Ee]=i.useState(0),[Q,X]=i.useState(!1),[f,Oe]=i.useState(""),[N,Be]=i.useState(""),[J,ue]=i.useState(!1),[me,fe]=i.useState(!1),p=i.useCallback((e,n)=>{if(h||x)return;if(e==="markdown"){v?(c(at(B)),O(!1)):(se(st(m)),O(!0),F(!1));return}if(e==="source"){j?(c(W),F(!1)):(ae(m),F(!0),O(!1));return}const s=d.current;if(s){if(e==="fullscreen"){ze(o=>!o);return}if(e==="emoji"){ue(o=>!o);return}if(e==="findReplace"){X(o=>!o);return}if(e==="image"){if(w)ie.current?.click();else{const o=prompt("Image URL:");o&&xe(o)&&(s.focus(),document.execCommand("insertImage",!1,o),c(u.sanitizeHtml(s.innerHTML)))}return}switch(s.focus(),e){case"bold":document.execCommand("bold");break;case"italic":document.execCommand("italic");break;case"underline":document.execCommand("underline");break;case"strikethrough":document.execCommand("strikeThrough");break;case"h1":document.execCommand("formatBlock",!1,"h1");break;case"h2":document.execCommand("formatBlock",!1,"h2");break;case"h3":document.execCommand("formatBlock",!1,"h3");break;case"ul":document.execCommand("insertUnorderedList");break;case"ol":document.execCommand("insertOrderedList");break;case"blockquote":document.execCommand("formatBlock",!1,"blockquote");break;case"hr":document.execCommand("insertHorizontalRule");break;case"subscript":document.execCommand("subscript");break;case"superscript":document.execCommand("superscript");break;case"indent":document.execCommand("indent");break;case"outdent":document.execCommand("outdent");break;case"alignLeft":document.execCommand("justifyLeft");break;case"alignCenter":document.execCommand("justifyCenter");break;case"alignRight":document.execCommand("justifyRight");break;case"alignJustify":document.execCommand("justifyFull");break;case"removeFormat":document.execCommand("removeFormat");break;case"print":window.print();return;case"link":{const o=prompt("URL:");o&&xe(o)&&document.execCommand("createLink",!1,o);break}case"unlink":document.execCommand("unlink");break;case"undo":document.execCommand("undo");break;case"redo":document.execCommand("redo");break;case"clear":document.execCommand("removeFormat");break;case"fontSize":{n&&document.execCommand("fontSize",!1,n);break}case"fontColor":{n&&document.execCommand("foreColor",!1,n);break}case"bgColor":{n&&document.execCommand("hiliteColor",!1,n);break}case"table":{document.execCommand("insertHTML",!1,'<table class="nice-htmleditor__table"><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table><p> </p>');break}case"code":{const a=window.getSelection()?.toString()||"";a.includes(`
|
|
10
|
+
`)||a.length>60?document.execCommand("insertHTML",!1,`<pre class="nice-htmleditor__code-block">${a||"// code"}</pre>`):document.execCommand("insertHTML",!1,`<code>${a||"code"}</code>`);break}}c(u.sanitizeHtml(s.innerHTML)),U(s.textContent?.length??0)}},[c,h,x,v,B,m,w,j,W]),Fe=i.useCallback(async e=>{const n=e.target.files?.[0];if(!n||!w)return;const s=await w(n),o=d.current;o&&s&&(o.focus(),document.execCommand("insertImage",!1,s),c(o.innerHTML)),e.target.value=""},[w,c]),We=i.useCallback(()=>{const e=d.current;if(!e)return;const n=e.textContent?.length??0;if(M>0&&n>M&&(e.textContent=(e.textContent??"").slice(0,M)),U(n),Ee((e.textContent??"").trim().split(/\s+/).filter(Boolean).length),c(e.innerHTML),g){const s=window.getSelection();if(s&&s.rangeCount>0){const o=s.getRangeAt(0),a=o.startContainer;if(a.nodeType===Node.TEXT_NODE){const C=a.textContent||"",T=o.startOffset,z=C.slice(0,T),k=z.lastIndexOf(g);if(k>=0&&(k===0||/\s/.test(z[k-1]))){const _=z.slice(k+g.length);if(!/\s/.test(_)){R(!0),Re(_),A(0),Y?.(_);return}}}}R(!1)}},[c,g,Y]),S=ke?.filter(e=>e.label.toLowerCase().includes(Le.toLowerCase())).slice(0,8)??[],V=i.useCallback(e=>{const n=d.current;if(!n)return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const o=s.getRangeAt(0),a=o.startContainer;if(a.nodeType===Node.TEXT_NODE&&g){const C=a.textContent||"",T=o.startOffset,k=C.slice(0,T).lastIndexOf(g);if(k>=0){const _=C.slice(0,k),Ge=C.slice(T),Ye=`<span class="nice-htmleditor__mention" data-mention="${e.key}" contenteditable="false">${g}${e.label}</span> `;a.textContent=_;const G=document.createRange();G.setStartAfter(a),G.collapse(!0);const Ze=G.createContextualFragment(Ye+Ge);a.parentNode?.insertBefore(Ze,a.nextSibling),s.collapseToEnd(),c(n.innerHTML)}}R(!1)},[g,c]),Ke=i.useCallback(e=>{if(K&&S.length>0){e.key==="ArrowDown"?(e.preventDefault(),A(n=>Math.min(n+1,S.length-1))):e.key==="ArrowUp"?(e.preventDefault(),A(n=>Math.max(n-1,0))):e.key==="Enter"?(e.preventDefault(),V(S[q])):e.key==="Escape"&&R(!1);return}(e.ctrlKey||e.metaKey)&&e.key==="b"?(e.preventDefault(),p("bold")):(e.ctrlKey||e.metaKey)&&e.key==="i"?(e.preventDefault(),p("italic")):(e.ctrlKey||e.metaKey)&&e.key==="u"?(e.preventDefault(),p("underline")):(e.ctrlKey||e.metaKey)&&e.key==="f"?(e.preventDefault(),X(n=>!n)):(e.ctrlKey||e.metaKey)&&e.key==="z"&&!e.shiftKey?(e.preventDefault(),p("undo")):(e.ctrlKey||e.metaKey)&&(e.key==="y"||e.key==="z"&&e.shiftKey)&&(e.preventDefault(),p("redo"))},[K,S,q,V,p]),qe=i.useCallback(e=>{if(!Z)return;e.preventDefault();const n=e.clipboardData.getData("text/html"),s=e.clipboardData.getData("text/plain");if(n){const a=n.replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<script[\s\S]*?<\/script>/gi,"").replace(/class="[^"]*"/gi,"").replace(/style="[^"]*"/gi,"").replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,"").replace(/<!--[\s\S]*?-->/g,"").replace(/<\/?(?:xml|meta|link|font|span)[^>]*>/gi,"");document.execCommand("insertHTML",!1,a)}else s&&document.execCommand("insertText",!1,s);const o=d.current;o&&(c(o.innerHTML),U(o.textContent?.length??0))},[Z,c]),Ae=i.useCallback(async e=>{if(!H)return;e.preventDefault();const n=Array.from(e.dataTransfer.files);if(n.length===0)return;const s=await H(n),o=d.current;if(o){o.focus();for(const a of s)if(/\.(png|jpe?g|gif|webp|svg|bmp|ico)$/i.test(a)||a.startsWith("data:image/"))document.execCommand("insertImage",!1,a);else{const T=`<a href="${a}">${a.split("/").pop()??a}</a>`;document.execCommand("insertHTML",!1,T)}c(o.innerHTML)}},[H,c]),Pe=i.useCallback(e=>{H&&e.preventDefault()},[H]),pe=i.useCallback(e=>{const n=d.current;if(!n||!f)return;const s=n.textContent??"",o=f.toLowerCase(),a=s.toLowerCase();(e===1?a.indexOf(o):a.lastIndexOf(o))!==-1&&(n.focus(),window.find?.(f))},[f]),Ue=i.useCallback(()=>{const e=d.current;!e||!f||(e.innerHTML=e.innerHTML.split(f).join(N),c(e.innerHTML))},[f,N,c]),Qe=i.useCallback(()=>{if(!f)return;const e=m.split(f).join(N);c(e);const n=d.current;n&&(n.innerHTML=e)},[f,N,m,c]),Xe=i.useCallback(e=>{const n=d.current;n&&(n.focus(),document.execCommand("insertText",!1,e),c(n.innerHTML),ue(!1))},[c]),Je=i.useCallback(e=>{const n=d.current;n&&(n.focus(),document.execCommand("insertHTML",!1,e),c(n.innerHTML),fe(!1))},[c]),Ve=i.useCallback(e=>{const n=x||h;if(e==="fontSize")return r.jsx(et.NiceSelect,{size:"sm",value:"",onChange:o=>p("fontSize",String(o)),disabled:n,placeholder:"Size",options:ot.map(o=>({value:o.value,label:o.label})),style:{minWidth:70,maxWidth:80}},e);if(e==="fontColor")return r.jsx(he.NiceColorPicker,{value:le,onChange:o=>{$e(o),p("fontColor",o)},disabled:n,size:"sm",label:"",title:"Text color"},e);if(e==="bgColor")return r.jsx(he.NiceColorPicker,{value:ce,onChange:o=>{De(o),p("bgColor",o)},disabled:n,size:"sm",label:"",title:"Highlight color"},e);const s=e==="markdown"&&v||e==="fullscreen"&&P||e==="source"&&j||e==="findReplace"&&Q||e==="emoji"&&J;return r.jsx(y.NiceButton,{size:"sm",variant:s?"primary":"ghost",onClick:()=>p(e),title:e,disabled:n,children:rt[e]||e},e)},[x,h,p,v,P,le,ce,j,Q,J]);return He?null:r.jsxs("div",{className:`nice-field nice-field--${ve} ${L?"nice-field--error":""} ${je||""}`,style:Se,children:[te&&r.jsxs("label",{className:"nice-field__label",htmlFor:oe,children:[te,ye&&r.jsx("span",{className:"nice-field__required",children:"*"})]}),r.jsxs("div",{ref:_e,className:`nice-htmleditor${P?" nice-htmleditor--fullscreen":""}`,style:{position:"relative"},children:[r.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:20},children:r.jsx(u.NiceTutorialButton,{steps:u.resolveTutorial(we,tt)})}),r.jsxs("div",{className:"nice-htmleditor__toolbar",style:{display:"flex",flexWrap:"wrap",gap:2,alignItems:"center"},children:[Ce.map(Ve),D&&D.length>0&&r.jsxs("div",{style:{position:"relative"},children:[r.jsx(y.NiceButton,{size:"sm",variant:me?"primary":"ghost",onClick:()=>fe(e=>!e),title:"Insert template",children:r.jsx(u.NiceIcon,{name:"clipboard",size:16})}),me&&r.jsx("ul",{style:{position:"absolute",top:"100%",right:0,zIndex:200,background:"var(--nice-bg-primary, #fff)",border:"1px solid var(--nice-border-color, #ddd)",borderRadius:6,boxShadow:"0 4px 16px var(--nice-overlay-12, rgba(0, 0, 0, 0.12))",listStyle:"none",margin:0,padding:4,minWidth:160,maxHeight:200,overflow:"auto"},children:D.map((e,n)=>r.jsx("li",{style:{padding:"6px 10px",cursor:"pointer",borderRadius:4},onMouseDown:s=>{s.preventDefault(),Je(e.html)},children:e.label},n))})]})]}),Q&&r.jsxs("div",{className:"nice-htmleditor__find-bar",style:{display:"flex",gap:4,alignItems:"center",padding:"4px 8px",background:"var(--nice-bg-secondary, #f8f9fa)",borderBottom:"1px solid var(--nice-border-color, #ddd)",fontSize:"0.875em"},children:[r.jsx("input",{type:"text",placeholder:"Find...",value:f,onChange:e=>Oe(e.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid var(--nice-border-color, #ccc)",borderRadius:4,background:"var(--nice-bg-primary, #fff)",color:"var(--nice-text-primary, #1f2937)"}}),r.jsx("input",{type:"text",placeholder:"Replace...",value:N,onChange:e=>Be(e.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid var(--nice-border-color, #ccc)",borderRadius:4,background:"var(--nice-bg-primary, #fff)",color:"var(--nice-text-primary, #1f2937)"}}),r.jsx(y.NiceButton,{size:"sm",variant:"ghost",onClick:()=>pe(1),title:"Find next",children:r.jsx(u.NiceIcon,{name:"chevron-right",size:14})}),r.jsx(y.NiceButton,{size:"sm",variant:"ghost",onClick:()=>pe(-1),title:"Find previous",children:r.jsx(u.NiceIcon,{name:"chevron-left",size:14})}),r.jsx(y.NiceButton,{size:"sm",variant:"ghost",onClick:Ue,disabled:x||h,children:"Replace"}),r.jsx(y.NiceButton,{size:"sm",variant:"ghost",onClick:Qe,disabled:x||h,children:"All"}),r.jsx(y.NiceButton,{size:"sm",variant:"ghost",onClick:()=>X(!1),children:r.jsx(u.NiceIcon,{name:"close",size:14,title:"Close"})})]}),J&&r.jsx("div",{className:"nice-htmleditor__emoji-picker",style:{padding:8,background:"var(--nice-bg-primary, #fff)",borderBottom:"1px solid var(--nice-border-color, #ddd)",maxHeight:180,overflowY:"auto"},children:it.map(e=>r.jsxs("div",{children:[r.jsx("div",{style:{fontSize:"0.7em",fontWeight:600,color:"var(--nice-text-muted, #999)",padding:"4px 0"},children:e.label}),r.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:2},children:e.emojis.map(n=>r.jsx("span",{style:{cursor:"pointer",fontSize:"1.2em",padding:2,borderRadius:4},onClick:()=>Xe(n),title:n,children:n},n))})]},e.label))}),r.jsx("input",{ref:ie,type:"file",accept:"image/*",style:{display:"none"},onChange:Fe}),j?r.jsx("textarea",{className:"nice-htmleditor__source",value:W,onChange:e=>ae(e.target.value),style:{minHeight:$,width:"100%",fontFamily:"monospace",resize:"vertical",whiteSpace:"pre",fontSize:"0.85em",background:"var(--nice-bg-primary, #fff)",color:"var(--nice-text-primary, #1f2937)",border:"none",padding:12,boxSizing:"border-box",outline:"none"},disabled:x||h}):v?r.jsx("textarea",{className:"nice-htmleditor__markdown",value:B,onChange:e=>se(e.target.value),style:{minHeight:$,width:"100%",fontFamily:"monospace",resize:"vertical",background:"var(--nice-bg-primary, #fff)",color:"var(--nice-text-primary, #1f2937)",border:"none",padding:12,boxSizing:"border-box",outline:"none"},disabled:x||h}):r.jsxs("div",{style:{position:"relative"},children:[r.jsx("div",{ref:Ne,id:oe,className:"nice-htmleditor__content",contentEditable:!x&&!h,dangerouslySetInnerHTML:Me,onInput:We,onKeyDown:Ke,onPaste:qe,onDrop:Ae,onDragOver:Pe,style:{minHeight:$},"data-placeholder":ge,role:"textbox","aria-multiline":"true",suppressContentEditableWarning:!0}),K&&S.length>0&&r.jsx("ul",{className:"nice-htmleditor__mention-list",children:S.map((e,n)=>r.jsx("li",{className:`nice-htmleditor__mention-item ${n===q?"nice-htmleditor__mention-item--active":""}`,onMouseDown:s=>{s.preventDefault(),V(e)},children:e.label},e.key))})]}),r.jsxs("div",{className:"nice-htmleditor__statusbar",style:{display:"flex",gap:12,padding:"2px 8px",fontSize:"0.75em",color:"var(--nice-text-muted, #666)",borderTop:"1px solid var(--nice-border-color, #eee)"},children:[M>0&&r.jsxs("span",{children:[de," / ",M]}),ee&&r.jsxs("span",{children:[Ie," words"]}),ee&&r.jsxs("span",{children:[de," chars"]}),j&&r.jsx("span",{style:{fontWeight:600},children:"HTML Source"}),v&&r.jsx("span",{style:{fontWeight:600},children:"Markdown"})]})]}),L&&r.jsx("div",{className:"nice-field__error",children:L}),ne&&!L&&r.jsx("div",{className:"nice-field__hint",children:ne})]})};exports.NiceHtmlEditor=lt;
|